niceeval 0.15.1-canary.76 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (714) hide show
  1. package/INDEX.md +45 -40
  2. package/dist/adapter-execution-trace.cjs.map +1 -1
  3. package/dist/adapter-execution-trace.d.cts +26 -0
  4. package/dist/adapter-execution-trace.d.mts +26 -0
  5. package/dist/adapter-execution-trace.d.ts +26 -0
  6. package/dist/adapter-usage.cjs.map +1 -1
  7. package/dist/adapter-usage.d.cts +9 -0
  8. package/dist/adapter-usage.d.mts +9 -0
  9. package/dist/adapter-usage.d.ts +9 -0
  10. package/dist/adapter.cjs +19 -4
  11. package/dist/adapter.cjs.map +1 -1
  12. package/dist/adapter.d.cts +37 -12
  13. package/dist/adapter.d.mts +37 -12
  14. package/dist/adapter.d.ts +37 -12
  15. package/dist/agents/ai-sdk.cjs +3 -0
  16. package/dist/agents/ai-sdk.cjs.map +1 -1
  17. package/dist/agents/bub.cjs +3 -0
  18. package/dist/agents/bub.cjs.map +1 -1
  19. package/dist/agents/claude-code-native.cjs +28 -2
  20. package/dist/agents/claude-code-native.cjs.map +1 -1
  21. package/dist/agents/claude-code.cjs +3 -0
  22. package/dist/agents/claude-code.cjs.map +1 -1
  23. package/dist/agents/codex.cjs +3 -0
  24. package/dist/agents/codex.cjs.map +1 -1
  25. package/dist/agents/coding-cli-versions.cjs +9 -10
  26. package/dist/agents/coding-cli-versions.cjs.map +1 -1
  27. package/dist/agents/coding-cli-versions.d.cts +1 -1
  28. package/dist/agents/coding-cli-versions.d.mts +1 -1
  29. package/dist/agents/coding-cli-versions.d.ts +1 -1
  30. package/dist/agents/deepseek-harness.cjs +3 -0
  31. package/dist/agents/deepseek-harness.cjs.map +1 -1
  32. package/dist/agents/hermes.cjs +3 -0
  33. package/dist/agents/hermes.cjs.map +1 -1
  34. package/dist/agents/index.cjs.map +1 -1
  35. package/dist/agents/index.d.cts +3 -2
  36. package/dist/agents/index.d.mts +3 -2
  37. package/dist/agents/index.d.ts +3 -2
  38. package/dist/agents/omp.cjs +3 -0
  39. package/dist/agents/omp.cjs.map +1 -1
  40. package/dist/agents/openai-compat.cjs +6 -0
  41. package/dist/agents/openai-compat.cjs.map +1 -1
  42. package/dist/agents/openclaw.cjs +3 -0
  43. package/dist/agents/openclaw.cjs.map +1 -1
  44. package/dist/agents/opencode.cjs +3 -0
  45. package/dist/agents/opencode.cjs.map +1 -1
  46. package/dist/agents/sdk-streams.cjs +9 -0
  47. package/dist/agents/sdk-streams.cjs.map +1 -1
  48. package/dist/agents/ui-message-stream.cjs +3 -0
  49. package/dist/agents/ui-message-stream.cjs.map +1 -1
  50. package/dist/assertions/api.cjs.map +1 -1
  51. package/dist/assertions/api.d.cts +27 -5
  52. package/dist/assertions/api.d.mts +27 -5
  53. package/dist/assertions/api.d.ts +27 -5
  54. package/dist/assertions/collection.cjs +6 -0
  55. package/dist/assertions/collection.cjs.map +1 -1
  56. package/dist/assertions/collection.d.cts +4 -2
  57. package/dist/assertions/collection.d.mts +4 -2
  58. package/dist/assertions/collection.d.ts +4 -2
  59. package/dist/assertions/collection.js +12 -8
  60. package/dist/assertions/context-match.cjs +70 -0
  61. package/dist/assertions/context-match.cjs.map +1 -0
  62. package/dist/assertions/context-match.d.cts +107 -0
  63. package/dist/assertions/context-match.d.mts +107 -0
  64. package/dist/assertions/context-match.d.ts +107 -0
  65. package/dist/assertions/context-match.js +12 -0
  66. package/dist/assertions/context-match.js.map +1 -0
  67. package/dist/assertions/full-content.cjs +109 -0
  68. package/dist/assertions/full-content.cjs.map +1 -0
  69. package/dist/assertions/full-content.d.cts +6 -0
  70. package/dist/assertions/full-content.d.mts +6 -0
  71. package/dist/assertions/full-content.d.ts +6 -0
  72. package/dist/assertions/full-content.js +12 -0
  73. package/dist/assertions/full-content.js.map +1 -0
  74. package/dist/assertions/judge-presets.cjs +2 -34
  75. package/dist/assertions/judge-presets.cjs.map +1 -1
  76. package/dist/assertions/judge-presets.d.cts +6 -9
  77. package/dist/assertions/judge-presets.d.mts +6 -9
  78. package/dist/assertions/judge-presets.d.ts +6 -9
  79. package/dist/assertions/judge-presets.js +8 -8
  80. package/dist/assertions/judge.cjs +107 -29
  81. package/dist/assertions/judge.cjs.map +1 -1
  82. package/dist/assertions/judge.d.cts +2 -0
  83. package/dist/assertions/judge.d.mts +2 -0
  84. package/dist/assertions/judge.d.ts +2 -0
  85. package/dist/assertions/match.cjs +244 -5
  86. package/dist/assertions/match.cjs.map +1 -1
  87. package/dist/assertions/match.d.cts +43 -3
  88. package/dist/assertions/match.d.mts +43 -3
  89. package/dist/assertions/match.d.ts +43 -3
  90. package/dist/assertions/match.js +88 -78
  91. package/dist/assertions/material.cjs +520 -0
  92. package/dist/assertions/material.cjs.map +1 -0
  93. package/dist/assertions/material.d.cts +56 -0
  94. package/dist/assertions/material.d.mts +56 -0
  95. package/dist/assertions/material.d.ts +56 -0
  96. package/dist/assertions/material.js +20 -0
  97. package/dist/assertions/material.js.map +1 -0
  98. package/dist/assertions/record/attachment.cjs +5 -2
  99. package/dist/assertions/record/attachment.cjs.map +1 -1
  100. package/dist/assertions/record/codec.cjs +2 -1
  101. package/dist/assertions/record/codec.cjs.map +1 -1
  102. package/dist/assertions/record/model.cjs.map +1 -1
  103. package/dist/assertions/record/model.d.cts +6 -1
  104. package/dist/assertions/record/model.d.mts +6 -1
  105. package/dist/assertions/record/model.d.ts +6 -1
  106. package/dist/assertions/runtime.cjs +207 -14
  107. package/dist/assertions/runtime.cjs.map +1 -1
  108. package/dist/assertions/runtime.d.cts +9 -0
  109. package/dist/assertions/runtime.d.mts +9 -0
  110. package/dist/assertions/runtime.d.ts +9 -0
  111. package/dist/assertions/runtime.js +14 -8
  112. package/dist/assertions/score-match-audit.cjs +18 -8
  113. package/dist/assertions/score-match-audit.cjs.map +1 -1
  114. package/dist/assertions/score-match-gateway.cjs +83 -25
  115. package/dist/assertions/score-match-gateway.cjs.map +1 -1
  116. package/dist/assertions/score-match-gateway.d.cts +2 -0
  117. package/dist/assertions/score-match-gateway.d.mts +2 -0
  118. package/dist/assertions/score-match-gateway.d.ts +2 -0
  119. package/dist/assertions/value-composition.test-d.cjs +77 -0
  120. package/dist/assertions/value-composition.test-d.cjs.map +1 -0
  121. package/dist/assertions/value-composition.test-d.d.cts +1 -0
  122. package/dist/assertions/value-composition.test-d.d.mts +1 -0
  123. package/dist/assertions/value-composition.test-d.d.ts +1 -0
  124. package/dist/assertions/value-composition.test-d.js +4 -0
  125. package/dist/assertions/value-composition.test-d.js.map +1 -0
  126. package/dist/context/assert-first.cjs +207 -213
  127. package/dist/context/assert-first.cjs.map +1 -1
  128. package/dist/context/assert-first.d.cts +49 -23
  129. package/dist/context/assert-first.d.mts +49 -23
  130. package/dist/context/assert-first.d.ts +49 -23
  131. package/dist/context/session.cjs +111 -9
  132. package/dist/context/session.cjs.map +1 -1
  133. package/dist/context/session.d.cts +18 -0
  134. package/dist/context/session.d.mts +18 -0
  135. package/dist/context/session.d.ts +18 -0
  136. package/dist/define.cjs +17 -1
  137. package/dist/define.cjs.map +1 -1
  138. package/dist/eval/cli/contribution.cjs +2 -0
  139. package/dist/eval/cli/contribution.cjs.map +1 -1
  140. package/dist/eval/host/index.cjs +2 -0
  141. package/dist/eval/host/index.cjs.map +1 -1
  142. package/dist/eval/record/evaluation.cjs +3 -0
  143. package/dist/eval/record/evaluation.cjs.map +1 -1
  144. package/dist/eval/record/membership-provenance.d.cts +15 -15
  145. package/dist/eval/record/membership-provenance.d.mts +15 -15
  146. package/dist/eval/record/membership-provenance.d.ts +15 -15
  147. package/dist/eval/record/score.cjs +7 -0
  148. package/dist/eval/record/score.cjs.map +1 -1
  149. package/dist/eval/record/sealed-assertion.cjs +3 -0
  150. package/dist/eval/record/sealed-assertion.cjs.map +1 -1
  151. package/dist/eval/record/verdict.cjs +7 -0
  152. package/dist/eval/record/verdict.cjs.map +1 -1
  153. package/dist/expect/index.cjs +8 -2
  154. package/dist/expect/index.cjs.map +1 -1
  155. package/dist/expect/index.d.cts +9 -4
  156. package/dist/expect/index.d.mts +9 -4
  157. package/dist/expect/index.d.ts +9 -4
  158. package/dist/expect/index.js +72 -62
  159. package/dist/expect/index.mjs +72 -62
  160. package/dist/experiment/host/cli/contribution.cjs +37 -23
  161. package/dist/experiment/host/cli/contribution.cjs.map +1 -1
  162. package/dist/experiment/host/cli/contribution.d.cts +9 -1
  163. package/dist/experiment/host/cli/contribution.d.mts +9 -1
  164. package/dist/experiment/host/cli/contribution.d.ts +9 -1
  165. package/dist/experiment/host/current.cjs +74 -0
  166. package/dist/experiment/host/current.cjs.map +1 -0
  167. package/dist/experiment/host/current.d.cts +33 -0
  168. package/dist/experiment/host/current.d.mts +33 -0
  169. package/dist/experiment/host/current.d.ts +33 -0
  170. package/dist/experiment/host/current.js +10 -0
  171. package/dist/experiment/host/current.js.map +1 -0
  172. package/dist/experiment/host/index.cjs +17 -174
  173. package/dist/experiment/host/index.cjs.map +1 -1
  174. package/dist/experiment/host/index.d.cts +8 -54
  175. package/dist/experiment/host/index.d.mts +8 -54
  176. package/dist/experiment/host/index.d.ts +8 -54
  177. package/dist/experiment/host/operations.cjs +33 -10
  178. package/dist/experiment/host/operations.cjs.map +1 -1
  179. package/dist/experiment/host/operations.d.cts +29 -1
  180. package/dist/experiment/host/operations.d.mts +29 -1
  181. package/dist/experiment/host/operations.d.ts +29 -1
  182. package/dist/experiment/host/operations.js +6 -4
  183. package/dist/experiment/host/requirements.cjs +3 -0
  184. package/dist/experiment/host/requirements.cjs.map +1 -0
  185. package/dist/experiment/host/requirements.d.cts +3 -0
  186. package/dist/experiment/host/requirements.d.mts +3 -0
  187. package/dist/experiment/host/requirements.d.ts +3 -0
  188. package/dist/experiment/host/requirements.js +4 -0
  189. package/dist/experiment/host/requirements.js.map +1 -0
  190. package/dist/experiment/host/runtime.cjs +179 -0
  191. package/dist/experiment/host/runtime.cjs.map +1 -0
  192. package/dist/experiment/host/runtime.d.cts +79 -0
  193. package/dist/experiment/host/runtime.d.mts +79 -0
  194. package/dist/experiment/host/runtime.d.ts +79 -0
  195. package/dist/experiment/host/runtime.js +6 -0
  196. package/dist/experiment/host/runtime.js.map +1 -0
  197. package/dist/experiment/host/types.cjs.map +1 -1
  198. package/dist/experiment/host/types.d.cts +17 -16
  199. package/dist/experiment/host/types.d.mts +17 -16
  200. package/dist/experiment/host/types.d.ts +17 -16
  201. package/dist/fresh-import.cjs +2 -1
  202. package/dist/fresh-import.cjs.map +1 -1
  203. package/dist/index.cjs +4 -2
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +12 -6
  206. package/dist/index.d.mts +12 -6
  207. package/dist/index.d.ts +12 -6
  208. package/dist/index.js +32 -30
  209. package/dist/index.mjs +32 -30
  210. package/dist/inspection/artifacts.cjs +83 -54
  211. package/dist/inspection/artifacts.cjs.map +1 -1
  212. package/dist/inspection/artifacts.d.cts +8 -0
  213. package/dist/inspection/artifacts.d.mts +8 -0
  214. package/dist/inspection/artifacts.d.ts +8 -0
  215. package/dist/inspection/artifacts.js +2 -0
  216. package/dist/inspection/assertions.cjs +4 -1
  217. package/dist/inspection/assertions.cjs.map +1 -1
  218. package/dist/inspection/cli/contribution.cjs +27 -4
  219. package/dist/inspection/cli/contribution.cjs.map +1 -1
  220. package/dist/inspection/cli/contribution.d.cts +2 -1
  221. package/dist/inspection/cli/contribution.d.mts +2 -1
  222. package/dist/inspection/cli/contribution.d.ts +2 -1
  223. package/dist/inspection/execution-traces.cjs +114 -8
  224. package/dist/inspection/execution-traces.cjs.map +1 -1
  225. package/dist/inspection/execution-traces.d.cts +38 -0
  226. package/dist/inspection/execution-traces.d.mts +38 -0
  227. package/dist/inspection/execution-traces.d.ts +38 -0
  228. package/dist/inspection/facts.cjs +12 -0
  229. package/dist/inspection/facts.cjs.map +1 -1
  230. package/dist/inspection/limits.cjs +5 -1
  231. package/dist/inspection/limits.cjs.map +1 -1
  232. package/dist/inspection/limits.d.cts +4 -0
  233. package/dist/inspection/limits.d.mts +4 -0
  234. package/dist/inspection/limits.d.ts +4 -0
  235. package/dist/inspection/limits.js +6 -2
  236. package/dist/inspection/overview.cjs +74 -33
  237. package/dist/inspection/overview.cjs.map +1 -1
  238. package/dist/inspection/overview.d.cts +19 -1
  239. package/dist/inspection/overview.d.mts +19 -1
  240. package/dist/inspection/overview.d.ts +19 -1
  241. package/dist/inspection/overview.js +4 -2
  242. package/dist/inspection/project-input.cjs +9 -0
  243. package/dist/inspection/project-input.cjs.map +1 -0
  244. package/dist/inspection/project-input.d.cts +20 -0
  245. package/dist/inspection/project-input.d.mts +20 -0
  246. package/dist/inspection/project-input.d.ts +20 -0
  247. package/dist/inspection/project-input.js +8 -0
  248. package/dist/inspection/project-input.js.map +1 -0
  249. package/dist/inspection/project-result.cjs +60 -0
  250. package/dist/inspection/project-result.cjs.map +1 -0
  251. package/dist/inspection/project-result.d.cts +1264 -0
  252. package/dist/inspection/project-result.d.mts +1264 -0
  253. package/dist/inspection/project-result.d.ts +1264 -0
  254. package/dist/inspection/project-result.js +10 -0
  255. package/dist/inspection/project-result.js.map +1 -0
  256. package/dist/inspection/project-source.cjs +109 -0
  257. package/dist/inspection/project-source.cjs.map +1 -0
  258. package/dist/inspection/project-source.d.cts +10 -0
  259. package/dist/inspection/project-source.d.mts +10 -0
  260. package/dist/inspection/project-source.d.ts +10 -0
  261. package/dist/inspection/project-source.js +6 -0
  262. package/dist/inspection/project-source.js.map +1 -0
  263. package/dist/inspection/project.cjs +100 -0
  264. package/dist/inspection/project.cjs.map +1 -0
  265. package/dist/inspection/project.d.cts +3 -0
  266. package/dist/inspection/project.d.mts +3 -0
  267. package/dist/inspection/project.d.ts +3 -0
  268. package/dist/inspection/project.js +6 -0
  269. package/dist/inspection/project.js.map +1 -0
  270. package/dist/inspection/protocol.cjs +19 -9
  271. package/dist/inspection/protocol.cjs.map +1 -1
  272. package/dist/inspection/protocol.d.cts +5506 -38189
  273. package/dist/inspection/protocol.d.mts +5506 -38189
  274. package/dist/inspection/protocol.d.ts +5506 -38189
  275. package/dist/inspection/public.mjs +896 -84
  276. package/dist/inspection/query.cjs +2 -0
  277. package/dist/inspection/query.cjs.map +1 -1
  278. package/dist/inspection/results.cjs +234 -29
  279. package/dist/inspection/results.cjs.map +1 -1
  280. package/dist/inspection/results.d.cts +870 -13
  281. package/dist/inspection/results.d.mts +870 -13
  282. package/dist/inspection/results.d.ts +870 -13
  283. package/dist/inspection/results.js +36 -34
  284. package/dist/inspection/select.cjs +126 -14
  285. package/dist/inspection/select.cjs.map +1 -1
  286. package/dist/inspection/select.d.cts +1 -1
  287. package/dist/inspection/select.d.mts +1 -1
  288. package/dist/inspection/select.d.ts +1 -1
  289. package/dist/inspection/source.cjs +4 -0
  290. package/dist/inspection/source.cjs.map +1 -1
  291. package/dist/inspection/sources.cjs +5 -0
  292. package/dist/inspection/sources.cjs.map +1 -1
  293. package/dist/inspection/trace.cjs +82 -84
  294. package/dist/inspection/trace.cjs.map +1 -1
  295. package/dist/inspection/trace.d.cts +7 -2
  296. package/dist/inspection/trace.d.mts +7 -2
  297. package/dist/inspection/trace.d.ts +7 -2
  298. package/dist/model-slots.cjs +35 -0
  299. package/dist/model-slots.cjs.map +1 -0
  300. package/dist/model-slots.d.cts +19 -0
  301. package/dist/model-slots.d.mts +19 -0
  302. package/dist/model-slots.d.ts +19 -0
  303. package/dist/model-slots.js +8 -0
  304. package/dist/model-slots.js.map +1 -0
  305. package/dist/o11y/adapter-call-price.cjs +4 -0
  306. package/dist/o11y/adapter-call-price.cjs.map +1 -1
  307. package/dist/o11y/adapter-call-price.d.cts +24 -0
  308. package/dist/o11y/adapter-call-price.d.mts +24 -0
  309. package/dist/o11y/adapter-call-price.d.ts +24 -0
  310. package/dist/o11y/adapter-call-price.js +6 -2
  311. package/dist/o11y/adapter-usage-projection.cjs +158 -0
  312. package/dist/o11y/adapter-usage-projection.cjs.map +1 -0
  313. package/dist/o11y/adapter-usage-projection.d.cts +141 -0
  314. package/dist/o11y/adapter-usage-projection.d.mts +141 -0
  315. package/dist/o11y/adapter-usage-projection.d.ts +141 -0
  316. package/dist/o11y/adapter-usage-projection.js +20 -0
  317. package/dist/o11y/adapter-usage-projection.js.map +1 -0
  318. package/dist/o11y/eval-usage.cjs +149 -0
  319. package/dist/o11y/eval-usage.cjs.map +1 -0
  320. package/dist/o11y/eval-usage.d.cts +46 -0
  321. package/dist/o11y/eval-usage.d.mts +46 -0
  322. package/dist/o11y/eval-usage.d.ts +46 -0
  323. package/dist/o11y/eval-usage.js +8 -0
  324. package/dist/o11y/eval-usage.js.map +1 -0
  325. package/dist/o11y/judge-call-price.cjs +62 -0
  326. package/dist/o11y/judge-call-price.cjs.map +1 -0
  327. package/dist/o11y/judge-call-price.d.cts +3 -0
  328. package/dist/o11y/judge-call-price.d.mts +3 -0
  329. package/dist/o11y/judge-call-price.d.ts +3 -0
  330. package/dist/o11y/judge-call-price.js +6 -0
  331. package/dist/o11y/judge-call-price.js.map +1 -0
  332. package/dist/o11y/judge-usage-projection.cjs +134 -0
  333. package/dist/o11y/judge-usage-projection.cjs.map +1 -0
  334. package/dist/o11y/judge-usage-projection.d.cts +18 -0
  335. package/dist/o11y/judge-usage-projection.d.mts +18 -0
  336. package/dist/o11y/judge-usage-projection.d.ts +18 -0
  337. package/dist/o11y/judge-usage-projection.js +20 -0
  338. package/dist/o11y/judge-usage-projection.js.map +1 -0
  339. package/dist/o11y/judge-usage-receipt.cjs +135 -0
  340. package/dist/o11y/judge-usage-receipt.cjs.map +1 -0
  341. package/dist/o11y/judge-usage-receipt.d.cts +5 -0
  342. package/dist/o11y/judge-usage-receipt.d.mts +5 -0
  343. package/dist/o11y/judge-usage-receipt.d.ts +5 -0
  344. package/dist/o11y/judge-usage-receipt.js +6 -0
  345. package/dist/o11y/judge-usage-receipt.js.map +1 -0
  346. package/dist/o11y/judge-usage.cjs +171 -0
  347. package/dist/o11y/judge-usage.cjs.map +1 -0
  348. package/dist/o11y/judge-usage.d.cts +35 -0
  349. package/dist/o11y/judge-usage.d.mts +35 -0
  350. package/dist/o11y/judge-usage.d.ts +35 -0
  351. package/dist/o11y/judge-usage.js +6 -0
  352. package/dist/o11y/judge-usage.js.map +1 -0
  353. package/dist/plugin/contracts.cjs +2 -0
  354. package/dist/plugin/contracts.cjs.map +1 -1
  355. package/dist/plugin/link.cjs +7 -0
  356. package/dist/plugin/link.cjs.map +1 -1
  357. package/dist/record/attachment/protocol.cjs +8 -6
  358. package/dist/record/attachment/protocol.cjs.map +1 -1
  359. package/dist/record/attachment/protocol.d.cts +10 -0
  360. package/dist/record/attachment/protocol.d.mts +10 -0
  361. package/dist/record/attachment/protocol.d.ts +10 -0
  362. package/dist/record/attachment/protocol.js +38 -36
  363. package/dist/record/codec/seal-manifest.d.cts +3 -3
  364. package/dist/record/codec/seal-manifest.d.mts +3 -3
  365. package/dist/record/codec/seal-manifest.d.ts +3 -3
  366. package/dist/record/family/adapter-usage/definition.d.cts +1 -0
  367. package/dist/record/family/adapter-usage/definition.d.mts +1 -0
  368. package/dist/record/family/adapter-usage/definition.d.ts +1 -0
  369. package/dist/record/family/adapter-usage/persistence.cjs +1 -1
  370. package/dist/record/family/adapter-usage/persistence.cjs.map +1 -1
  371. package/dist/record/family/adapter-usage/persistence.d.cts +2 -1
  372. package/dist/record/family/adapter-usage/persistence.d.mts +2 -1
  373. package/dist/record/family/adapter-usage/persistence.d.ts +2 -1
  374. package/dist/record/family/adapter-usage/schema.cjs +21 -2
  375. package/dist/record/family/adapter-usage/schema.cjs.map +1 -1
  376. package/dist/record/family/adapter-usage/schema.d.cts +85 -0
  377. package/dist/record/family/adapter-usage/schema.d.mts +85 -0
  378. package/dist/record/family/adapter-usage/schema.d.ts +85 -0
  379. package/dist/record/family/adapter-usage/schema.js +18 -12
  380. package/dist/record/family/catalog.cjs +31 -27
  381. package/dist/record/family/catalog.cjs.map +1 -1
  382. package/dist/record/family/catalog.d.cts +94 -3
  383. package/dist/record/family/catalog.d.mts +94 -3
  384. package/dist/record/family/catalog.d.ts +94 -3
  385. package/dist/record/family/current.cjs +45 -42
  386. package/dist/record/family/current.cjs.map +1 -1
  387. package/dist/record/family/current.d.cts +240 -1
  388. package/dist/record/family/current.d.mts +240 -1
  389. package/dist/record/family/current.d.ts +240 -1
  390. package/dist/record/family/execution-traces/definition.d.cts +26 -0
  391. package/dist/record/family/execution-traces/definition.d.mts +26 -0
  392. package/dist/record/family/execution-traces/definition.d.ts +26 -0
  393. package/dist/record/family/execution-traces/definition.js +20 -14
  394. package/dist/record/family/execution-traces/schema.cjs +57 -1
  395. package/dist/record/family/execution-traces/schema.cjs.map +1 -1
  396. package/dist/record/family/execution-traces/schema.d.cts +114 -0
  397. package/dist/record/family/execution-traces/schema.d.mts +114 -0
  398. package/dist/record/family/execution-traces/schema.d.ts +114 -0
  399. package/dist/record/family/execution-traces/schema.js +18 -12
  400. package/dist/record/family/judge-usage/definition.cjs +12 -0
  401. package/dist/record/family/judge-usage/definition.cjs.map +1 -0
  402. package/dist/record/family/judge-usage/definition.d.cts +91 -0
  403. package/dist/record/family/judge-usage/definition.d.mts +91 -0
  404. package/dist/record/family/judge-usage/definition.d.ts +91 -0
  405. package/dist/record/family/judge-usage/definition.js +6 -0
  406. package/dist/record/family/judge-usage/definition.js.map +1 -0
  407. package/dist/record/family/judge-usage/persistence.cjs +10 -0
  408. package/dist/record/family/judge-usage/persistence.cjs.map +1 -0
  409. package/dist/record/family/judge-usage/persistence.d.cts +91 -0
  410. package/dist/record/family/judge-usage/persistence.d.mts +91 -0
  411. package/dist/record/family/judge-usage/persistence.d.ts +91 -0
  412. package/dist/record/family/judge-usage/persistence.js +6 -0
  413. package/dist/record/family/judge-usage/persistence.js.map +1 -0
  414. package/dist/record/family/judge-usage/schema.cjs +307 -0
  415. package/dist/record/family/judge-usage/schema.cjs.map +1 -0
  416. package/dist/record/family/judge-usage/schema.d.cts +351 -0
  417. package/dist/record/family/judge-usage/schema.d.mts +351 -0
  418. package/dist/record/family/judge-usage/schema.d.ts +351 -0
  419. package/dist/record/family/judge-usage/schema.js +18 -0
  420. package/dist/record/family/judge-usage/schema.js.map +1 -0
  421. package/dist/record/host/sqlite-host.cjs +55 -9
  422. package/dist/record/host/sqlite-host.cjs.map +1 -1
  423. package/dist/record/host/types.cjs.map +1 -1
  424. package/dist/record/host/types.d.cts +7 -0
  425. package/dist/record/host/types.d.mts +7 -0
  426. package/dist/record/host/types.d.ts +7 -0
  427. package/dist/record/model/run-context.cjs +7 -1
  428. package/dist/record/model/run-context.cjs.map +1 -1
  429. package/dist/record/model/run-context.d.cts +4 -0
  430. package/dist/record/model/run-context.d.mts +4 -0
  431. package/dist/record/model/run-context.d.ts +4 -0
  432. package/dist/record/model/seal-manifest.d.cts +1 -1
  433. package/dist/record/model/seal-manifest.d.mts +1 -1
  434. package/dist/record/model/seal-manifest.d.ts +1 -1
  435. package/dist/record/sqlite/client.cjs +18 -5
  436. package/dist/record/sqlite/client.cjs.map +1 -1
  437. package/dist/record/sqlite/client.d.cts +1 -1
  438. package/dist/record/sqlite/client.d.mts +1 -1
  439. package/dist/record/sqlite/client.d.ts +1 -1
  440. package/dist/record/sqlite/project-state-database.cjs +29 -8
  441. package/dist/record/sqlite/project-state-database.cjs.map +1 -1
  442. package/dist/run/host/runtime.cjs +4 -0
  443. package/dist/run/host/runtime.cjs.map +1 -1
  444. package/dist/run/storage/sqlite.cjs +20 -0
  445. package/dist/run/storage/sqlite.cjs.map +1 -1
  446. package/dist/runner/adapter-execution-trace.cjs +125 -2
  447. package/dist/runner/adapter-execution-trace.cjs.map +1 -1
  448. package/dist/runner/adapter-execution-trace.d.cts +1 -1
  449. package/dist/runner/adapter-execution-trace.d.mts +1 -1
  450. package/dist/runner/adapter-execution-trace.d.ts +1 -1
  451. package/dist/runner/adapter-usage.cjs +55 -7
  452. package/dist/runner/adapter-usage.cjs.map +1 -1
  453. package/dist/runner/adapter-usage.d.cts +9 -2
  454. package/dist/runner/adapter-usage.d.mts +9 -2
  455. package/dist/runner/adapter-usage.d.ts +9 -2
  456. package/dist/runner/adoption.cjs +9 -0
  457. package/dist/runner/adoption.cjs.map +1 -1
  458. package/dist/runner/attempt-cancellation.cjs +12 -0
  459. package/dist/runner/attempt-cancellation.cjs.map +1 -0
  460. package/dist/runner/attempt-cancellation.d.cts +6 -0
  461. package/dist/runner/attempt-cancellation.d.mts +6 -0
  462. package/dist/runner/attempt-cancellation.d.ts +6 -0
  463. package/dist/runner/attempt-cancellation.js +6 -0
  464. package/dist/runner/attempt-cancellation.js.map +1 -0
  465. package/dist/runner/attempt-resources.cjs +10 -4
  466. package/dist/runner/attempt-resources.cjs.map +1 -1
  467. package/dist/runner/attempt-resources.d.cts +2 -1
  468. package/dist/runner/attempt-resources.d.mts +2 -1
  469. package/dist/runner/attempt-resources.d.ts +2 -1
  470. package/dist/runner/attempt.cjs +1177 -1139
  471. package/dist/runner/attempt.cjs.map +1 -1
  472. package/dist/runner/config-identity.cjs +20 -1
  473. package/dist/runner/config-identity.cjs.map +1 -1
  474. package/dist/runner/config-identity.d.cts +5 -0
  475. package/dist/runner/config-identity.d.mts +5 -0
  476. package/dist/runner/config-identity.d.ts +5 -0
  477. package/dist/runner/discover.cjs +14 -0
  478. package/dist/runner/discover.cjs.map +1 -1
  479. package/dist/runner/discover.d.cts +3 -0
  480. package/dist/runner/discover.d.mts +3 -0
  481. package/dist/runner/discover.d.ts +3 -0
  482. package/dist/runner/feedback/human.cjs +9 -4
  483. package/dist/runner/feedback/human.cjs.map +1 -1
  484. package/dist/runner/fingerprint.cjs +1 -0
  485. package/dist/runner/fingerprint.cjs.map +1 -1
  486. package/dist/runner/judge-usage.cjs +18 -0
  487. package/dist/runner/judge-usage.cjs.map +1 -0
  488. package/dist/runner/judge-usage.d.cts +5 -0
  489. package/dist/runner/judge-usage.d.mts +5 -0
  490. package/dist/runner/judge-usage.d.ts +5 -0
  491. package/dist/runner/judge-usage.js +8 -0
  492. package/dist/runner/judge-usage.js.map +1 -0
  493. package/dist/runner/project-target.cjs.map +1 -1
  494. package/dist/runner/project-target.d.cts +2 -0
  495. package/dist/runner/project-target.d.mts +2 -0
  496. package/dist/runner/project-target.d.ts +2 -0
  497. package/dist/runner/record/planning.cjs +1 -0
  498. package/dist/runner/record/planning.cjs.map +1 -1
  499. package/dist/runner/record.cjs +4 -0
  500. package/dist/runner/record.cjs.map +1 -1
  501. package/dist/runner/reporters/braintrust.cjs +2 -0
  502. package/dist/runner/reporters/braintrust.cjs.map +1 -1
  503. package/dist/runner/reuse-diagnostics.cjs +9 -10
  504. package/dist/runner/reuse-diagnostics.cjs.map +1 -1
  505. package/dist/runner/reuse-diagnostics.d.cts +5 -6
  506. package/dist/runner/reuse-diagnostics.d.mts +5 -6
  507. package/dist/runner/reuse-diagnostics.d.ts +5 -6
  508. package/dist/runner/reuse-diagnostics.js +4 -4
  509. package/dist/runner/reuse-plan.cjs +100 -48
  510. package/dist/runner/reuse-plan.cjs.map +1 -1
  511. package/dist/runner/reuse-plan.d.cts +60 -3
  512. package/dist/runner/reuse-plan.d.mts +60 -3
  513. package/dist/runner/reuse-plan.d.ts +60 -3
  514. package/dist/runner/reuse-plan.js +14 -10
  515. package/dist/runner/run.cjs +8 -6
  516. package/dist/runner/run.cjs.map +1 -1
  517. package/dist/runner/session.cjs +1 -1
  518. package/dist/runner/session.cjs.map +1 -1
  519. package/dist/runner/session.d.cts +1 -1
  520. package/dist/runner/session.d.mts +1 -1
  521. package/dist/runner/session.d.ts +1 -1
  522. package/dist/runner/source-producer.cjs +3 -1
  523. package/dist/runner/source-producer.cjs.map +1 -1
  524. package/dist/runner/types.cjs.map +1 -1
  525. package/dist/runner/types.d.cts +26 -5
  526. package/dist/runner/types.d.mts +26 -5
  527. package/dist/runner/types.d.ts +26 -5
  528. package/dist/sandbox/action.cjs +3 -0
  529. package/dist/sandbox/action.cjs.map +1 -1
  530. package/dist/sandbox/commands.cjs +3 -0
  531. package/dist/sandbox/commands.cjs.map +1 -1
  532. package/dist/sandbox/compose.cjs +6 -0
  533. package/dist/sandbox/compose.cjs.map +1 -1
  534. package/dist/sandbox/docker-profile/registry.cjs +7 -0
  535. package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
  536. package/dist/sandbox/docker-profile/runtime.cjs +3 -0
  537. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
  538. package/dist/sandbox/docker-profile/schema.cjs +7 -0
  539. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  540. package/dist/sandbox/incus.cjs +7 -0
  541. package/dist/sandbox/incus.cjs.map +1 -1
  542. package/dist/sandbox/layer.cjs +12 -0
  543. package/dist/sandbox/layer.cjs.map +1 -1
  544. package/dist/shared/adapter-cleanup.cjs +18 -0
  545. package/dist/shared/adapter-cleanup.cjs.map +1 -0
  546. package/dist/shared/adapter-cleanup.d.cts +4 -0
  547. package/dist/shared/adapter-cleanup.d.mts +4 -0
  548. package/dist/shared/adapter-cleanup.d.ts +4 -0
  549. package/dist/shared/adapter-cleanup.js +10 -0
  550. package/dist/shared/adapter-cleanup.js.map +1 -0
  551. package/dist/shared/attempt-lifecycle.cjs +3 -0
  552. package/dist/shared/attempt-lifecycle.cjs.map +1 -0
  553. package/dist/shared/attempt-lifecycle.d.cts +13 -0
  554. package/dist/shared/attempt-lifecycle.d.mts +13 -0
  555. package/dist/shared/attempt-lifecycle.d.ts +13 -0
  556. package/dist/shared/attempt-lifecycle.js +4 -0
  557. package/dist/shared/attempt-lifecycle.js.map +1 -0
  558. package/dist/show/contribution.cjs +52 -14
  559. package/dist/show/contribution.cjs.map +1 -1
  560. package/dist/show/contribution.d.cts +23 -1
  561. package/dist/show/contribution.d.mts +23 -1
  562. package/dist/show/contribution.d.ts +23 -1
  563. package/dist/show/model.cjs +8 -1
  564. package/dist/show/model.cjs.map +1 -1
  565. package/dist/show/model.d.cts +10 -1
  566. package/dist/show/model.d.mts +10 -1
  567. package/dist/show/model.d.ts +10 -1
  568. package/dist/show/render.cjs +287 -49
  569. package/dist/show/render.cjs.map +1 -1
  570. package/dist/show/render.d.cts +3 -0
  571. package/dist/show/render.d.mts +3 -0
  572. package/dist/show/render.d.ts +3 -0
  573. package/dist/sources/projector.cjs +3 -0
  574. package/dist/sources/projector.cjs.map +1 -1
  575. package/dist/types.cjs.map +1 -1
  576. package/dist/types.d.cts +1 -1
  577. package/dist/types.d.mts +1 -1
  578. package/dist/types.d.ts +1 -1
  579. package/dist/view/app-dist/.vite/manifest.json +2 -2
  580. package/dist/view/app-dist/assets/index-CmVoXbwG.js +63 -0
  581. package/dist/view/app-dist/assets/{quality-cost-scatter-CFB3wnkN.js → quality-cost-scatter-BuLISaH4.js} +1 -1
  582. package/dist/view/app-dist/index.html +1 -1
  583. package/dist/view/cli/contribution.cjs +54 -21
  584. package/dist/view/cli/contribution.cjs.map +1 -1
  585. package/dist/view/cli/contribution.d.cts +2 -1
  586. package/dist/view/cli/contribution.d.mts +2 -1
  587. package/dist/view/cli/contribution.d.ts +2 -1
  588. package/dist/view/function-runtime.mjs +13231 -11647
  589. package/dist/view/http-protocol.cjs +3 -0
  590. package/dist/view/http-protocol.cjs.map +1 -1
  591. package/dist/view/http-protocol.d.cts +8 -0
  592. package/dist/view/http-protocol.d.mts +8 -0
  593. package/dist/view/http-protocol.d.ts +8 -0
  594. package/dist/view/inspection-host.cjs +17 -1
  595. package/dist/view/inspection-host.cjs.map +1 -1
  596. package/dist/view/render.cjs +1 -0
  597. package/dist/view/render.cjs.map +1 -1
  598. package/dist/view/render.d.cts +2 -1
  599. package/dist/view/render.d.mts +2 -1
  600. package/dist/view/render.d.ts +2 -1
  601. package/dist/view/revision.cjs.map +1 -1
  602. package/dist/view/revision.d.cts +12 -0
  603. package/dist/view/revision.d.mts +12 -0
  604. package/dist/view/revision.d.ts +12 -0
  605. package/dist/view/server.cjs +10 -9
  606. package/dist/view/server.cjs.map +1 -1
  607. package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
  608. package/docs-site/zh/explanation/adapter.mdx +2 -2
  609. package/docs-site/zh/explanation/assert.mdx +60 -24
  610. package/docs-site/zh/explanation/drive.mdx +1 -1
  611. package/docs-site/zh/explanation/evals.mdx +31 -29
  612. package/docs-site/zh/explanation/experiment.mdx +15 -15
  613. package/docs-site/zh/explanation/judge.mdx +23 -15
  614. package/docs-site/zh/explanation/overview.mdx +44 -21
  615. package/docs-site/zh/explanation/record.mdx +28 -13
  616. package/docs-site/zh/explanation/results-flow.mdx +37 -0
  617. package/docs-site/zh/explanation/runner.mdx +27 -6
  618. package/docs-site/zh/index.mdx +22 -115
  619. package/docs-site/zh/introduction.mdx +89 -61
  620. package/docs-site/zh/reference/cli.mdx +50 -26
  621. package/docs-site/zh/reference/define-agent.mdx +37 -5
  622. package/docs-site/zh/reference/define-eval.mdx +130 -29
  623. package/docs-site/zh/reference/define-experiment.mdx +251 -0
  624. package/docs-site/zh/reference/events.mdx +34 -30
  625. package/docs-site/zh/reference/expect.mdx +77 -2
  626. package/docs-site/zh/reference/official-adapters.mdx +2 -2
  627. package/docs-site/zh/troubleshooting/debug-sandbox.mdx +43 -24
  628. package/docs-site/zh/troubleshooting/debugging.mdx +65 -42
  629. package/docs-site/zh/troubleshooting/recover-after-kill.mdx +35 -28
  630. package/docs-site/zh/tutorials/accept-results.mdx +34 -24
  631. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +74 -43
  632. package/docs-site/zh/tutorials/agent-onboarding.mdx +27 -20
  633. package/docs-site/zh/tutorials/authoring.mdx +138 -121
  634. package/docs-site/zh/tutorials/ci-integration.mdx +46 -22
  635. package/docs-site/zh/tutorials/compare-runs.mdx +40 -13
  636. package/docs-site/zh/tutorials/concurrency.mdx +66 -62
  637. package/docs-site/zh/tutorials/configuration.mdx +17 -17
  638. package/docs-site/zh/tutorials/connect-otel.mdx +48 -37
  639. package/docs-site/zh/tutorials/connect-your-agent.mdx +80 -173
  640. package/docs-site/zh/tutorials/control-run-cost.mdx +63 -12
  641. package/docs-site/zh/tutorials/criteria-files.mdx +28 -21
  642. package/docs-site/zh/tutorials/custom-application.mdx +75 -55
  643. package/docs-site/zh/tutorials/dataset-fanout.mdx +32 -22
  644. package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +38 -31
  645. package/docs-site/zh/tutorials/docker-in-docker.mdx +83 -89
  646. package/docs-site/zh/tutorials/eval-groups.mdx +70 -89
  647. package/docs-site/zh/tutorials/evaluation-kinds.mdx +12 -5
  648. package/docs-site/zh/tutorials/experiment-services.mdx +243 -0
  649. package/docs-site/zh/tutorials/fixtures.mdx +42 -26
  650. package/docs-site/zh/tutorials/handle-execution-failures.mdx +41 -19
  651. package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +21 -16
  652. package/docs-site/zh/tutorials/niceeval-taste-application.mdx +394 -0
  653. package/docs-site/zh/tutorials/niceeval-taste.mdx +190 -0
  654. package/docs-site/zh/tutorials/nixos-managed-dind.mdx +51 -39
  655. package/docs-site/zh/tutorials/plugins.mdx +55 -31
  656. package/docs-site/zh/tutorials/prebuilt-sandbox.mdx +204 -0
  657. package/docs-site/zh/tutorials/quickstart.mdx +91 -47
  658. package/docs-site/zh/tutorials/reporters.mdx +45 -30
  659. package/docs-site/zh/tutorials/rerun-and-cache.mdx +39 -40
  660. package/docs-site/zh/tutorials/sandbox-agent.mdx +65 -40
  661. package/docs-site/zh/tutorials/sandbox-providers.mdx +104 -282
  662. package/docs-site/zh/tutorials/sandbox-reuse.mdx +65 -97
  663. package/docs-site/zh/tutorials/select-and-preview.mdx +25 -20
  664. package/docs-site/zh/tutorials/verify-judge.mdx +49 -26
  665. package/docs-site/zh/tutorials/viewing-results.mdx +130 -80
  666. package/docs-site/zh/tutorials/write-experiment.mdx +116 -298
  667. package/docs-site/zh/tutorials/write-send.mdx +53 -52
  668. package/node_modules/undici/docs/docs/api/Agent.md +8 -8
  669. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  670. package/node_modules/undici/docs/docs/api/Errors.md +25 -0
  671. package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
  672. package/node_modules/undici/docs/docs/api/Pool.md +5 -6
  673. package/node_modules/undici/lib/api/readable.js +1 -2
  674. package/node_modules/undici/lib/core/request.js +23 -2
  675. package/node_modules/undici/lib/core/util.js +0 -39
  676. package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
  677. package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
  678. package/node_modules/undici/lib/dispatcher/client.js +1 -1
  679. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
  680. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  681. package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  682. package/node_modules/undici/lib/dispatcher/pool.js +90 -7
  683. package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
  684. package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
  685. package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
  686. package/node_modules/undici/lib/handler/retry-handler.js +72 -13
  687. package/node_modules/undici/lib/interceptor/cache.js +4 -1
  688. package/node_modules/undici/lib/interceptor/decompress.js +236 -69
  689. package/node_modules/undici/lib/web/cache/cache.js +17 -8
  690. package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  691. package/node_modules/undici/lib/web/cookies/index.js +19 -7
  692. package/node_modules/undici/lib/web/cookies/util.js +3 -1
  693. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
  694. package/node_modules/undici/lib/web/fetch/body.js +22 -15
  695. package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  696. package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  697. package/node_modules/undici/lib/web/fetch/headers.js +34 -31
  698. package/node_modules/undici/lib/web/fetch/index.js +38 -14
  699. package/node_modules/undici/lib/web/fetch/request.js +74 -79
  700. package/node_modules/undici/lib/web/fetch/response.js +43 -44
  701. package/node_modules/undici/lib/web/fetch/util.js +7 -7
  702. package/node_modules/undici/lib/web/infra/index.js +16 -1
  703. package/node_modules/undici/lib/web/webidl/index.js +2 -14
  704. package/node_modules/undici/lib/web/websocket/events.js +43 -26
  705. package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
  706. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  707. package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  708. package/node_modules/undici/package.json +1 -1
  709. package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
  710. package/node_modules/undici/types/interceptors.d.ts +1 -1
  711. package/node_modules/undici/types/webidl.d.ts +13 -7
  712. package/package.json +4 -4
  713. package/dist/view/app-dist/assets/index-DFzw1L97.js +0 -63
  714. package/docs-site/zh/tutorials/experiments.mdx +0 -101
@@ -1,63 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function O(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ce=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function le(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ce)}catch(e){ce(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ue(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else le(ue.bind(null,e))}var de={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=de,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ue,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:O}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=le,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ee());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=D,ee=function(){ne.postMessage(null)}}else ee=function(){_(D,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),re=Symbol.for(`react.fragment`),ie=Symbol.for(`react.strict_mode`),ae=Symbol.for(`react.profiler`),oe=Symbol.for(`react.consumer`),se=Symbol.for(`react.context`),O=Symbol.for(`react.forward_ref`),ce=Symbol.for(`react.suspense`),le=Symbol.for(`react.suspense_list`),ue=Symbol.for(`react.memo`),de=Symbol.for(`react.lazy`),fe=Symbol.for(`react.activity`),pe=Symbol.for(`react.legacy_hidden`),me=Symbol.for(`react.memo_cache_sentinel`),he=Symbol.for(`react.view_transition`),ge=Symbol.for(`react.recoverable`),_e=Symbol.iterator;function ve(e){return typeof e!=`object`||!e?null:(e=_e&&e[_e]||e[`@@iterator`],typeof e==`function`?e:null)}var ye=Symbol.for(`react.client.reference`);function be(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case re:return`Fragment`;case ae:return`Profiler`;case ie:return`StrictMode`;case ce:return`Suspense`;case le:return`SuspenseList`;case fe:return`Activity`;case he:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case se:return e.displayName||`Context`;case oe:return(e._context.displayName||`Context`)+`.Consumer`;case O:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ue:return t=e.displayName||null,t===null?be(e.type)||`Memo`:t;case de:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}var xe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ce={pending:!1,data:null,method:null,action:null},we=[],Te=-1;function Ee(e){return{current:e}}function De(e){0>Te||(e.current=we[Te],we[Te]=null,Te--)}function Oe(e,t){Te++,we[Te]=e.current,e.current=t}var ke=Ee(null),Ae=Ee(null),je=Ee(null),Me=Ee(null);function Ne(e,t){switch(Oe(je,t),Oe(Ae,e),Oe(ke,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Op(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}De(ke),Oe(ke,e)}function Pe(){De(ke),De(Ae),De(je)}function Fe(e){var t=e.memoizedState;t!==null&&(wh._currentValue=t.memoizedState,Oe(Me,e)),t=ke.current;var n=Op(t,e.type);t!==n&&(Oe(Ae,e),Oe(ke,n))}function Ie(e){Ae.current===e&&(De(ke),De(Ae)),Me.current===e&&(De(Me),wh._currentValue=Ce)}var Le,Re;function ze(e){if(Le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Le=t&&t[1]||``,Re=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Le+e+Re}var Be=!1;function Ve(e,t){if(!e||Be)return``;Be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ze(n):``}function He(e,t){switch(e.tag){case 26:case 27:case 5:return ze(e.type);case 16:return ze(`Lazy`);case 13:return e.child!==t&&t!==null?ze(`Suspense Fallback`):ze(`Suspense`);case 19:return ze(`SuspenseList`);case 0:case 15:return Ve(e.type,!1);case 11:return Ve(e.type.render,!1);case 1:return Ve(e.type,!0);case 31:return ze(`Activity`);case 30:return ze(`ViewTransition`);default:return``}}function Ue(e){try{var t=``,n=null;do t+=He(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var We=Object.prototype.hasOwnProperty,Ge=t.unstable_scheduleCallback,Ke=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Je=t.unstable_requestPaint,Ye=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,Ze=t.unstable_ImmediatePriority,Qe=t.unstable_UserBlockingPriority,$e=t.unstable_NormalPriority,et=t.unstable_LowPriority,tt=t.unstable_IdlePriority,nt=t.log,rt=t.unstable_setDisableYieldValue,it=null,at=null;function ot(e){if(typeof nt==`function`&&rt(e),at&&typeof at.setStrictMode==`function`)try{at.setStrictMode(it,e)}catch{}}var st=Math.clz32?Math.clz32:ut,ct=Math.log,lt=Math.LN2;function ut(e){return e>>>=0,e===0?32:31-(ct(e)/lt|0)|0}var dt=256,ft=262144,pt=4194304;function mt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ht(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=mt(n))):i=mt(o):i=mt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=mt(n))):i=mt(o)):i=mt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-st(n),i=1<<r;t|=e[r],n&=~i}return t}function vt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yt(){var e=pt;return pt<<=1,!(pt&62914560)&&(pt=4194304),e}function bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function St(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-st(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-st(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function wt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Tt(e,t){var n=t&-t;return n=n&42?1:Et(n),(n&(e.suspendedLanes|t))===0?n:0}function Et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ot(){var e=Se.p;return e===0?(e=window.event,e===void 0?32:Bh(e.type)):e}function kt(e,t){var n=Se.p;try{return Se.p=e,t()}finally{Se.p=n}}var At=Math.random().toString(36).slice(2),jt=`__reactFiber$`+At,Mt=`__reactProps$`+At,Nt=`__reactContainer$`+At,Pt=`__reactEvents$`+At,Ft=`__reactListeners$`+At,It=`__reactHandles$`+At,Lt=`__reactResources$`+At,Rt=`__reactMarker$`+At,zt=`__reactLoad$`+At;function Bt(e){delete e[jt],delete e[Mt],delete e[Ft],delete e[It]}function Vt(e){var t;if(t=e[jt])return t;for(var n=e.parentNode;n;){if(t=n[Nt]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=km(e);e!==null;){if(n=e[jt])return n;e=km(e)}return t}e=n,n=e.parentNode}return null}function Ht(e){if(e=e[jt]||e[Nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Wt(e){var t=e[Lt];return t||=e[Lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Gt(e){e[Rt]=!0}function Kt(e){e[zt]=void 0}var qt=new Set,Jt={};function Yt(e,t){Xt(e,t),Xt(e+`Capture`,t)}function Xt(e,t){for(Jt[e]=t,e=0;e<t.length;e++)qt.add(t[e])}var Zt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Qt={},$t={};function en(e){return We.call($t,e)?!0:We.call(Qt,e)?!1:Zt.test(e)?$t[e]=!0:(Qt[e]=!0,!1)}var tn=!1;function nn(){var e=tn;return tn=!1,e}function rn(e,t,n){if(en(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function an(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function on(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function sn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function cn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ln(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function un(e){if(!e._valueTracker){var t=cn(e)?`checked`:`value`;e._valueTracker=ln(e,t,``+e[t])}}function dn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=cn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var fn=/[\n"\\]/g;function pn(e){return e.replace(fn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function mn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+sn(t)):e.value!==``+sn(t)&&(e.value=``+sn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):gn(e,sn(n)):o===`number`&&e.value==t?gn(e,sn(e.value)):gn(e,sn(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+sn(s):e.removeAttribute(`name`)}function hn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){un(e);return}n=n==null?``:``+sn(n),t=t==null?n:``+sn(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),un(e)}function gn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function _n(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+sn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function vn(e,t,n){if(t!=null&&(t=``+sn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+sn(n)}function yn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(xe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=sn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),un(e)}function bn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Sn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||xn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Cn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,tn=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(Sn(e,a,r),tn=!0)}else for(var o in t)t.hasOwnProperty(o)&&Sn(e,o,t[o])}function wn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Tn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),En=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Dn(e){return En.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function On(){}var kn=null;function An(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jn=null,Mn=null;function Nn(e){var t=Ht(e);if(t&&(e=t.stateNode)){var n=e[Mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(mn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+pn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Mt]||null;if(!a)throw Error(i(90));mn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&dn(r)}break a;case`textarea`:vn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&_n(e,!!n.multiple,t,!1)}}}var Pn=!1;function Fn(e,t,n){if(Pn)return e(t,n);Pn=!0;try{return e(t)}finally{if(Pn=!1,(jn!==null||Mn!==null)&&(ef(),jn&&(t=jn,e=Mn,Mn=jn=null,Nn(t),e)))for(t=0;t<e.length;t++)Nn(e[t])}}function In(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Ln=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Rn=!1;if(Ln)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Rn=!0}}),window.addEventListener(`test`,zn,zn),window.removeEventListener(`test`,zn,zn)}catch{Rn=!1}var Bn=null,Vn=null,Hn=null;function Un(){if(Hn)return Hn;var e,t=Vn,n=t.length,r,i=`value`in Bn?Bn.value:Bn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Hn=i.slice(e,1<r?1-r:void 0)}function Wn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gn(){return!0}function Kn(){return!1}function qn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Gn:Kn,this.isPropagationStopped=Kn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yn=qn(Jn),Xn=D({},Jn,{view:0,detail:0}),Zn=qn(Xn),Qn,$n,er,tr=D({},Xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==er&&(er&&e.type===`mousemove`?(Qn=e.screenX-er.screenX,$n=e.screenY-er.screenY):$n=Qn=0,er=e),Qn)},movementY:function(e){return`movementY`in e?e.movementY:$n}}),nr=qn(tr),rr=qn(D({},tr,{dataTransfer:0})),ir=qn(D({},Xn,{relatedTarget:0})),ar=qn(D({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0})),or=qn(D({},Jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),sr=qn(D({},Jn,{data:0})),cr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},lr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},ur={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function dr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ur[e])?!!t[e]:!1}function fr(){return dr}var pr=qn(D({},Xn,{key:function(e){if(e.key){var t=cr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Wn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?lr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fr,charCode:function(e){return e.type===`keypress`?Wn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Wn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),mr=qn(D({},tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),hr=qn(D({},Jn,{submitter:0})),gr=qn(D({},Xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fr})),_r=qn(D({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),vr=qn(D({},tr,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),yr=qn(D({},Jn,{newState:0,oldState:0,source:0})),br=[9,13,27,32],xr=Ln&&`CompositionEvent`in window,Sr=null;Ln&&`documentMode`in document&&(Sr=document.documentMode);var Cr=Ln&&`TextEvent`in window&&!Sr,wr=Ln&&(!xr||Sr&&8<Sr&&11>=Sr),Tr=` `,Er=!1;function Dr(e,t){switch(e){case`keyup`:return br.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var kr=!1;function Ar(e,t){switch(e){case`compositionend`:return Or(t);case`keypress`:return t.which===32?(Er=!0,Tr):null;case`textInput`:return e=t.data,e===Tr&&Er?null:e;default:return null}}function jr(e,t){if(kr)return e===`compositionend`||!xr&&Dr(e,t)?(e=Un(),Hn=Vn=Bn=null,kr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return wr&&t.locale!==`ko`?null:t.data;default:return null}}var Mr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Mr[e.type]:t===`textarea`}function Pr(e,t,n,r){jn?Mn?Mn.push(r):Mn=[r]:jn=r,t=up(t,`onChange`),0<t.length&&(n=new Yn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Fr=null,Ir=null;function Lr(e){rp(e,0)}function Rr(e){if(dn(Ut(e)))return e}function zr(e,t){if(e===`change`)return t}var Br=!1;if(Ln){var Vr;if(Ln){var Hr=`oninput`in document;if(!Hr){var Ur=document.createElement(`div`);Ur.setAttribute(`oninput`,`return;`),Hr=typeof Ur.oninput==`function`}Vr=Hr}else Vr=!1;Br=Vr&&(!document.documentMode||9<document.documentMode)}function Wr(){Fr&&(Fr.detachEvent(`onpropertychange`,Gr),Ir=Fr=null)}function Gr(e){if(e.propertyName===`value`&&Rr(Ir)){var t=[];Pr(t,Ir,e,An(e)),Fn(Lr,t)}}function Kr(e,t,n){e===`focusin`?(Wr(),Fr=t,Ir=n,Fr.attachEvent(`onpropertychange`,Gr)):e===`focusout`&&Wr()}function qr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Rr(Ir)}function Jr(e,t){if(e===`click`)return Rr(t)}function Yr(e,t){if(e===`input`||e===`change`)return Rr(t)}function Xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Zr=typeof Object.is==`function`?Object.is:Xr;function Qr(e,t){if(Zr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!We.call(t,i)||!Zr(e[i],t[i]))return!1}return!0}function $r(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function ei(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ti(e,t){var n=ei(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=ei(n)}}function ni(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ni(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ri(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$r(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=$r(e.document)}return t}function ii(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ai=Ln&&`documentMode`in document&&11>=document.documentMode,oi=null,si=null,ci=null,li=!1;function ui(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;li||oi==null||oi!==$r(r)||(r=oi,`selectionStart`in r&&ii(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ci&&Qr(ci,r)||(ci=r,r=up(si,`onSelect`),0<r.length&&(t=new Yn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=oi)))}function di(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var fi={animationend:di(`Animation`,`AnimationEnd`),animationiteration:di(`Animation`,`AnimationIteration`),animationstart:di(`Animation`,`AnimationStart`),transitionrun:di(`Transition`,`TransitionRun`),transitionstart:di(`Transition`,`TransitionStart`),transitioncancel:di(`Transition`,`TransitionCancel`),transitionend:di(`Transition`,`TransitionEnd`)},pi={},mi={};Ln&&(mi=document.createElement(`div`).style,`AnimationEvent`in window||(delete fi.animationend.animation,delete fi.animationiteration.animation,delete fi.animationstart.animation),`TransitionEvent`in window||delete fi.transitionend.transition);function hi(e){if(pi[e])return pi[e];if(!fi[e])return e;var t=fi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in mi)return pi[e]=t[n];return e}var gi=hi(`animationend`),_i=hi(`animationiteration`),vi=hi(`animationstart`),yi=hi(`transitionrun`),bi=hi(`transitionstart`),xi=hi(`transitioncancel`),Si=hi(`transitionend`),Ci=new Map,wi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);wi.push(`scrollEnd`);function Ti(e,t){Ci.set(e,t),Yt(t,[e])}var Ei=0;function Di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Fd.identifierPrefix;var n=Ei++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Oi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ud;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function ki(e,t){return e=Oi(e),t=Oi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ai=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ji=[],Mi=0,Ni=0;function Pi(){for(var e=Mi,t=Ni=Mi=0;t<e;){var n=ji[t];ji[t++]=null;var r=ji[t];ji[t++]=null;var i=ji[t];ji[t++]=null;var a=ji[t];if(ji[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ri(n,i,a)}}function Fi(e,t,n,r){ji[Mi++]=e,ji[Mi++]=t,ji[Mi++]=n,ji[Mi++]=r,Ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ii(e,t,n,r){return Fi(e,t,n,r),zi(e)}function Li(e,t){return Fi(e,null,null,t),zi(e)}function Ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-st(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function zi(e){if(50<Wd)throw Wd=0,Gd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function Vi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hi(e,t,n,r){return new Vi(e,t,n,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wi(e,t){var n=e.alternate;return n===null?(n=Hi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Gi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ki(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ui(r)&&(s=1);else if(typeof r==`string`)s=uh(e,n,ke.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case fe:return e=Hi(31,n,t,a),e.elementType=fe,e.lanes=o,e;case re:return qi(n.children,a,o,t);case ie:s=8,a|=24;break;case ae:return e=Hi(12,n,t,a|2),e.elementType=ae,e.lanes=o,e;case ce:return e=Hi(13,n,t,a),e.elementType=ce,e.lanes=o,e;case le:return e=Hi(19,n,t,a),e.elementType=le,e.lanes=o,e;case pe:case he:return e=a|32,e=Hi(30,n,t,e),e.elementType=he,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case se:s=10;break a;case oe:s=9;break a;case O:s=11;break a;case ue:s=14;break a;case de:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Hi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function qi(e,t,n,r){return e=Hi(7,e,r,t),e.lanes=n,e}function Ji(e,t,n){return e=Hi(6,e,null,t),e.lanes=n,e}function Yi(e){var t=Hi(18,null,null,0);return t.stateNode=e,t}function Xi(e,t,n){return t=Hi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zi=new WeakMap;function Qi(e,t){if(typeof e==`object`&&e){var n=Zi.get(e);return n===void 0?(t={value:e,source:t,stack:Ue(t)},Zi.set(e,t),t):n}return{value:e,source:t,stack:Ue(t)}}var $i=[],ea=0,ta=null,na=0,ra=[],ia=0,aa=null,oa=1,sa=``;function ca(e,t){$i[ea++]=na,$i[ea++]=ta,ta=e,na=t}function A(e,t,n){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,aa=e;var r=oa;e=sa;var i=32-st(r)-1;r&=~(1<<i),n+=1;var a=32-st(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,oa=1<<32-st(t)+i|n<<i|r,sa=a+e}else oa=1<<a|n<<i|r,sa=e}function la(e){e.return!==null&&(ca(e,1),A(e,1,0))}function ua(e){for(;e===ta;)ta=$i[--ea],$i[ea]=null,na=$i[--ea],$i[ea]=null;for(;e===aa;)aa=ra[--ia],ra[ia]=null,sa=ra[--ia],ra[ia]=null,oa=ra[--ia],ra[ia]=null}function da(e,t){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,oa=t.id,sa=t.overflow,aa=e}var fa=null,pa=null,j=!1,ma=null,ha=!1,ga=Error(i(519));function _a(e){throw Ca(Qi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ga}function va(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[jt]=e,t[Mt]=r,n){case`dialog`:I(`cancel`,t),I(`close`,t);break;case`iframe`:case`object`:case`embed`:I(`load`,t);break;case`video`:case`audio`:for(n=0;n<tp.length;n++)I(tp[n],t);break;case`source`:I(`error`,t);break;case`img`:case`image`:case`link`:I(`error`,t),I(`load`,t);break;case`details`:I(`toggle`,t);break;case`input`:I(`invalid`,t),hn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:I(`invalid`,t);break;case`textarea`:I(`invalid`,t),yn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||gp(t.textContent,n)?(r.popover!=null&&(I(`beforetoggle`,t),I(`toggle`,t)),r.onScroll!=null&&I(`scroll`,t),r.onScrollEnd!=null&&I(`scrollend`,t),r.onClick!=null&&(t.onclick=On),t=!0):t=!1,t||_a(e,!0)}function ya(e){for(fa=e.return;fa;)switch(fa.tag){case 5:case 31:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:fa=fa.return}}function ba(e){if(e!==fa)return!1;if(!j)return ya(e),j=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ap(e.type,e.memoizedProps)),n=!n),n&&pa&&_a(e),ya(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));pa=Om(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));pa=Om(e)}else t===27?(t=pa,zp(e.type)?(e=Dm,Dm=null,pa=e):pa=t):pa=fa?Em(e.stateNode.nextSibling):null;return!0}function xa(){pa=fa=null,j=!1}function Sa(){var e=ma;return e!==null&&(Dd===null?Dd=e:Dd.push.apply(Dd,e),ma=null),e}function Ca(e){ma===null?ma=[e]:ma.push(e)}var wa=Ee(null),Ta=null,Ea=null;function Da(e,t,n){Oe(wa,t._currentValue),t._currentValue=n}function Oa(e){e._currentValue=wa.current,De(wa)}function ka(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Aa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ka(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ka(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ka(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ja(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Zr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[wh]:e.push(wh))}a=a.return}return e!==null&&Aa(t,e,n,r),t.flags|=262144,e!==null}function Ma(e){for(e=e.firstContext;e!==null;){if(!Zr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Na(e){Ta=e,Ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pa(e){return Ia(Ta,e)}function Fa(e,t){return Ta===null&&Na(e),Ia(e,t)}function Ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ea===null){if(e===null)throw Error(i(308));Ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ea=Ea.next=t;return n}var La=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ra=t.unstable_scheduleCallback,za=t.unstable_NormalPriority,Ba={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Va(){return{controller:new La,data:new Map,refCount:0}}function Ha(e){e.refCount--,e.refCount===0&&Ra(za,function(){e.controller.abort()})}function Ua(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Wa=null;function Ga(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ka=null,qa=0,Ja=0,Ya=null;function Xa(e,t){if(Ka===null){var n=Ka=[];qa=0,Ja=Xf(),Ya={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return qa++,t.then(Za,Za),t}function Za(){if(--qa===0&&(Wa=null,Ka!==null)){Ya!==null&&(Ya.status=`fulfilled`);var e=Ka;Ka=null,Ja=0,Ya=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var $a=k.S;k.S=function(e,t){if(Ad=Ye(),typeof t==`object`&&t&&typeof t.then==`function`&&Xa(e,t),Wa!==null)for(var n=If;n!==null;)Ua(n,Wa),n=n.next;if(n=e.types,n!==null){for(var r=If;r!==null;)Ua(r,n),r=r.next;if(Ja!==0){r=Wa,r===null&&(r=Wa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}$a!==null&&$a(e,t)};var eo=Ee(null);function to(){var e=eo.current;return e===null?dd.pooledCache:e}function no(e,t){t===null?Oe(eo,eo.current):Oe(eo,t.pool)}function ro(){var e=to();return e===null?null:{parent:Ba._currentValue,pool:e}}var io=Error(i(460)),ao=Error(i(474)),oo=Error(i(542)),so={then:function(){}};function co(e){return e=e.status,e===`fulfilled`||e===`rejected`}function lo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(On,On),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,mo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(On,On);else{if(e=dd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,mo(e),e}throw fo=t,io}}function uo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(fo=e,io):e}}var fo=null;function po(){if(fo===null)throw Error(i(459));var e=fo;return fo=null,e}function mo(e){if(e===io||e===oo)throw Error(i(483))}var ho=null,go=0;function _o(e){var t=go;return go+=1,ho===null&&(ho=[]),lo(ho,e,t)}function vo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function yo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function bo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Wi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ji(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===re?(e=d(e,t,n.props.children,r,n.key),vo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===de&&uo(i)===t.type)?(t=a(t,n.props),vo(t,n),t.return=e,t):(t=Ki(n.type,n.key,n.props,null,e.mode,r),vo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Xi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=qi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Ki(t.type,t.key,t.props,null,e.mode,n),vo(n,t),n.return=e,n;case ne:return t=Xi(t,e.mode,n),t.return=e,t;case de:return t=uo(t),f(e,t,n)}if(xe(t)||ve(t))return t=qi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,_o(t),n);if(t.$$typeof===se)return f(e,Fa(e,t),n);yo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case de:return n=uo(n),p(e,t,n,r)}if(xe(n)||ve(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,_o(n),r);if(n.$$typeof===se)return p(e,t,Fa(e,n),r);yo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case de:return r=uo(r),m(e,t,n,r,i)}if(xe(r)||ve(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,_o(r),i);if(r.$$typeof===se)return m(e,t,n,Fa(t,r),i);yo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),j&&ca(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return j&&ca(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),j&&ca(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),j&&ca(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return j&&ca(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),j&&ca(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),vo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===de&&uo(l)===r.type){n(e,r.sibling),c=a(r,o.props),vo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=qi(o.props.children,e.mode,c,o.key),vo(c,o),c.return=e,e=c):(c=Ki(o.type,o.key,o.props,null,e.mode,c),vo(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Xi(o,e.mode,c),c.return=e,e=c}return s(e);case de:return o=uo(o),_(e,r,o,c)}if(xe(o))return h(e,r,o,c);if(ve(o)){if(l=ve(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,_o(o),c);if(o.$$typeof===se)return _(e,r,Fa(e,o),c);yo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ji(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{go=0;var i=_(e,t,n,r);return ho=null,i}catch(t){if(t===io||t===oo)throw t;var a=Hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var xo=bo(!0),So=bo(!1),Co=!1;function wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function To(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Eo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Do(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ud&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=zi(e),Ri(e,null,n),t}return Fi(e,r,t,n),zi(e)}function Oo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wt(e,n)}}function ko(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ao=!1;function jo(){if(Ao){var e=Ya;if(e!==null)throw e}}function Mo(e,t,n,r){Ao=!1;var i=e.updateQueue;Co=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(pd&f)===f:(r&f)===f){f!==0&&f===Ja&&(Ao=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:Co=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),xd|=o,e.lanes=o,e.memoizedState=d}}function No(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Po(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)No(n[e],t)}var Fo=Ee(null),Io=Ee(0);function Lo(e,t){e=yd,Oe(Io,e),Oe(Fo,t),yd=e|t.baseLanes}function Ro(){Oe(Io,yd),Oe(Fo,Fo.current)}function zo(){yd=Io.current,De(Fo),De(Io)}var Bo=Ee(null),M=null;function Vo(e){var t=e.alternate;Oe(Ko,Ko.current&1),Oe(Bo,e),M===null&&(t===null||Fo.current!==null||t.memoizedState!==null)&&(M=e)}function Ho(e){Oe(Ko,Ko.current),Oe(Bo,e),M===null&&(M=e)}function Uo(e){e.tag===22?(Oe(Ko,Ko.current),Oe(Bo,e),M===null&&(M=e)):Wo()}function Wo(){Oe(Ko,Ko.current),Oe(Bo,Bo.current)}function Go(e){De(Bo),M===e&&(M=null),De(Ko)}var Ko=Ee(0);function qo(e,t){Oe(Bo,Bo.current),Oe(Ko,t)}function Jo(e){De(Ko),De(Bo),M===e&&(M=null)}function Yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Cm(n)||wm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xo=0,N=null,P=null,Zo=null,Qo=!1,$o=!1,es=!1,ts=0,ns=0,rs=null,is=0;function as(){throw Error(i(321))}function os(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Zr(e[n],t[n]))return!1;return!0}function ss(e,t,n,r,i,a){return Xo=a,N=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?wc:Tc,es=!1,a=n(r,i),es=!1,$o&&(a=ls(t,n,r,i)),cs(e),a}function cs(e){k.H=Cc;var t=P!==null&&P.next!==null;if(Xo=0,Zo=P=N=null,Qo=!1,ns=0,rs=null,t)throw Error(i(300));e===null||Hc||(e=e.dependencies,e!==null&&Ma(e)&&(Hc=!0))}function ls(e,t,n,r){N=e;var a=0;do{if($o&&(rs=null),ns=0,$o=!1,25<=a)throw Error(i(301));if(a+=1,Zo=P=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Ec,o=t(n,r)}while($o);return o}function us(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?_s(t):t,e=e.useState()[0],(P===null?null:P.memoizedState)!==e&&(N.flags|=1024),t}function ds(){var e=ts!==0;return ts=0,e}function fs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ps(e){if(Qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qo=!1}Xo=0,Zo=P=N=null,$o=!1,ns=ts=0,rs=null}function ms(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zo===null?N.memoizedState=Zo=e:Zo=Zo.next=e,Zo}function hs(){if(P===null){var e=N.alternate;e=e===null?null:e.memoizedState}else e=P.next;var t=Zo===null?N.memoizedState:Zo.next;if(t!==null)Zo=t,P=e;else{if(e===null)throw N.alternate===null?Error(i(467)):Error(i(310));P=e,e={memoizedState:P.memoizedState,baseState:P.baseState,baseQueue:P.baseQueue,queue:P.queue,next:null},Zo===null?N.memoizedState=Zo=e:Zo=Zo.next=e}return Zo}function gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _s(e){var t=ns;return ns+=1,rs===null&&(rs=[]),e=lo(rs,e,t),t=N,(Zo===null?t.memoizedState:Zo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?wc:Tc),e}function vs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return _s(e);if(e.$$typeof===ge)return;if(e.$$typeof===se)return Pa(e)}throw Error(i(438,String(e)))}function ys(e){var t=null,n=N.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=N.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=gs(),N.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=me;return t.index++,n}function bs(e,t){return typeof t==`function`?t(e):t}function xs(e){return Ss(hs(),P,e)}function Ss(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Xo&f)===f:(pd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ja&&(d=!0);else if((Xo&p)===p){u=u.next,p===Ja&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,N.lanes|=p,xd|=p;f=u.action,es&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,N.lanes|=f,xd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Zr(o,e.memoizedState)&&(Hc=!0,d&&(n=Ya,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Cs(e){var t=hs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Zr(o,t.memoizedState)||(Hc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ws(e,t,n){var r=N,a=hs(),o=j;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Zr((P||a).memoizedState,n);if(s&&(a.memoizedState=n,Hc=!0),a=a.queue,Ys(Ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Zo!==null&&!!(Zo.memoizedState.tag&1),Ws(e?9:8,{destroy:void 0},Es.bind(null,r,a,n,t),null),e){if(r.flags|=2048,dd===null)throw Error(i(349));o||Xo&127||Ts(r,t,n)}return n}function Ts(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=N.updateQueue,t===null?(t=gs(),N.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Es(e,t,n,r){t.value=n,t.getSnapshot=r,Os(t)&&ks(e)}function Ds(e,t,n){return n(function(){Os(t)&&ks(e)})}function Os(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zr(e,n)}catch{return!0}}function ks(e){var t=Li(e,2);t!==null&&Yd(t,e,2)}function As(e){var t=ms();if(typeof e==`function`){var n=e;if(e=n(),es){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t}function js(e,t,n,r){return e.baseState=n,Ss(e,P,typeof r==`function`?r:bs)}function Ms(e,t,n,r,a){if(bc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};o.types=a===null?null:a.types,k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Ps(e,t,s)}catch(n){Is(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Ps(e,t,a)}catch(n){Is(e,t,n)}}function Ps(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Fs(e,t,n)},function(n){return Is(e,t,n)}):Fs(e,t,n)}function Fs(e,t,n){t.status=`fulfilled`,t.value=n,Ls(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ns(e,n)))}function Is(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ls(t),t=t.next;while(t!==r)}e.action=null}function Ls(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Rs(e,t){return t}function zs(e,t){if(j){var n=dd.formState;if(n!==null){a:{var r=N;if(j){if(pa){b:{for(var i=pa,a=ha;i.nodeType!==8;){if(!a){i=null;break b}if(i=Em(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){pa=Em(i.nextSibling),r=i.data===`F!`;break a}}_a(r)}r=!1}r&&(t=n[0])}}return n=ms(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:t},n.queue=r,n=_c.bind(null,N,r),r.dispatch=n,r=As(!1),a=yc.bind(null,N,!1,r.queue),r=ms(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ms.bind(null,N,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Bs(e){return Vs(hs(),P,e)}function Vs(e,t,n){if(t=Ss(e,t,Rs)[0],e=xs(bs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=_s(t)}catch(e){throw e===io?oo:e}else r=t;t=hs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(N.flags|=2048,Ws(9,{destroy:void 0},Hs.bind(null,i,n),null)),[r,a,e]}function Hs(e,t){e.action=t}function Us(e){var t=hs(),n=P;if(n!==null)return Vs(t,n,e);hs(),t=t.memoizedState,n=hs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ws(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=N.updateQueue,t===null&&(t=gs(),N.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Gs(){return hs().memoizedState}function Ks(e,t,n,r){var i=ms();N.flags|=e,i.memoizedState=Ws(1|t,{destroy:void 0},n,r===void 0?null:r)}function qs(e,t,n,r){var i=hs();r=r===void 0?null:r;var a=i.memoizedState.inst;P!==null&&r!==null&&os(r,P.memoizedState.deps)?i.memoizedState=Ws(t,a,n,r):(N.flags|=e,i.memoizedState=Ws(1|t,a,n,r))}function Js(e,t){Ks(8390656,8,e,t)}function Ys(e,t){qs(2048,8,e,t)}function Xs(e){N.flags|=4;var t=N.updateQueue;if(t===null)t=gs(),N.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Zs(e){var t=hs().memoizedState;return Xs({ref:t,nextImpl:e}),function(){if(ud&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Qs(e,t){return qs(4,2,e,t)}function $s(e,t){return qs(4,4,e,t)}function ec(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tc(e,t,n){n=n==null?null:n.concat([e]),qs(4,4,ec.bind(null,t,e),n)}function nc(){}function rc(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&os(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ic(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&os(t,r[1]))return r[0];if(r=e(),es){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function ac(e,t,n){return n===void 0||Xo&1073741824&&!(pd&261930)?e.memoizedState=t:(e.memoizedState=n,e=qd(),N.lanes|=e,xd|=e,n)}function oc(e,t,n,r){return Zr(n,t)?n:Fo.current===null?!(Xo&106)||Xo&1073741824&&!(pd&261930)?(Hc=!0,e.memoizedState=n):(e=qd(),N.lanes|=e,xd|=e,t):(e=ac(e,n,r),Zr(e,t)||(Hc=!0),e)}function sc(e,t,n,r,i){var a=Se.p;Se.p=a!==0&&8>a?a:8;var o=k.T,s={};s.types=o===null?null:o.types,k.T=s,yc(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?vc(e,t,Qa(c,r),Kd(e)):vc(e,t,r,Kd(e))}catch(n){vc(e,t,{then:function(){},status:`rejected`,reason:n},Kd())}finally{Se.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function cc(){}function lc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=uc(e).queue;sc(e,a,t,Ce,n===null?cc:function(){return dc(e),n(r)})}function uc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ce,baseState:Ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:Ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dc(e){var t=uc(e);t.next===null&&(t=e.alternate.memoizedState),vc(e,t.next.queue,{},Kd())}function fc(){return Pa(wh)}function pc(){return hs().memoizedState}function mc(){return hs().memoizedState}function hc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Kd();e=Eo(n);var r=Do(t,e,n);r!==null&&(Yd(r,t,n),Oo(r,t,n)),t={cache:Va()},e.payload=t;return}t=t.return}}function gc(e,t,n){var r=Kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bc(e)?xc(t,n):(n=Ii(e,t,n,r),n!==null&&(Yd(n,e,r),Sc(n,t,r)))}function _c(e,t,n){vc(e,t,n,Kd())}function vc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bc(e))xc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Zr(s,o))return Fi(e,t,i,0),dd===null&&Pi(),!1}catch{}if(n=Ii(e,t,i,r),n!==null)return Yd(n,e,r),Sc(n,t,r),!0}return!1}function yc(e,t,n,r){if(r={lane:2,revertLane:Xf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bc(e)){if(t)throw Error(i(479))}else t=Ii(e,n,r,2),t!==null&&Yd(t,e,2)}function bc(e){var t=e.alternate;return e===N||t!==null&&t===N}function xc(e,t){$o=Qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wt(e,n)}}var Cc={readContext:Pa,use:vs,useCallback:as,useContext:as,useEffect:as,useImperativeHandle:as,useLayoutEffect:as,useInsertionEffect:as,useMemo:as,useReducer:as,useRef:as,useState:as,useDebugValue:as,useDeferredValue:as,useTransition:as,useSyncExternalStore:as,useId:as,useHostTransitionStatus:as,useFormState:as,useActionState:as,useOptimistic:as,useMemoCache:as,useCacheRefresh:as,useEffectEvent:as},wc={readContext:Pa,use:vs,useCallback:function(e,t){return ms().memoizedState=[e,t===void 0?null:t],e},useContext:Pa,useEffect:Js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ks(4194308,4,ec.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=ms();t=t===void 0?null:t;var r=e();if(es){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ms();if(n!==void 0){var i=n(t);if(es){ot(!0);try{n(t)}finally{ot(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=gc.bind(null,N,e),[r.memoizedState,e]},useRef:function(e){var t=ms();return e={current:e},t.memoizedState=e},useState:function(e){e=As(e);var t=e.queue,n=_c.bind(null,N,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nc,useDeferredValue:function(e,t){return ac(ms(),e,t)},useTransition:function(){var e=As(!1);return e=sc.bind(null,N,e.queue,!0,!1),ms().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=N,a=ms();if(j){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),dd===null)throw Error(i(349));pd&127||Ts(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Js(Ds.bind(null,r,o,e),[e]),r.flags|=2048,Ws(9,{destroy:void 0},Es.bind(null,r,o,n,t),null),n},useId:function(){var e=ms(),t=dd.identifierPrefix;if(j){var n=sa,r=oa;n=(r&~(1<<32-st(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ts++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=is++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:zs,useActionState:zs,useOptimistic:function(e){var t=ms();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,N,!0,n),n.dispatch=t,[e,t]},useMemoCache:ys,useCacheRefresh:function(){return ms().memoizedState=hc.bind(null,N)},useEffectEvent:function(e){var t=ms(),n={impl:e};return t.memoizedState=n,function(){if(ud&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Tc={readContext:Pa,use:vs,useCallback:rc,useContext:Pa,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:xs,useRef:Gs,useState:function(){return xs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){return oc(hs(),P.memoizedState,e,t)},useTransition:function(){var e=xs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){return js(hs(),P,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs},Ec={readContext:Pa,use:vs,useCallback:rc,useContext:Pa,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:Cs,useRef:Gs,useState:function(){return Cs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){var n=hs();return P===null?ac(n,e,t):oc(n,P.memoizedState,e,t)},useTransition:function(){var e=Cs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Us,useActionState:Us,useOptimistic:function(e,t){var n=hs();return P===null?(n.baseState=e,[e,n.queue.dispatch]):js(n,P,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs};function Dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Kd(),i=Eo(r);i.payload=t,n!=null&&(i.callback=n),t=Do(e,i,r),t!==null&&(Yd(t,e,r),Oo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Kd(),i=Eo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Do(e,i,r),t!==null&&(Yd(t,e,r),Oo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kd(),r=Eo(n);r.tag=2,t!=null&&(r.callback=t),t=Do(e,r,n),t!==null&&(Yd(t,e,n),Oo(t,e,n))}};function kc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Qr(n,r)||!Qr(i,a):!0}function Ac(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Oc.enqueueReplaceState(t,t.state,null)}function jc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Mc(e){Ai(e)}function Nc(e){console.error(e)}function Pc(e){Ai(e)}function Fc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ic(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Lc(e,t,n){return n=Eo(n),n.tag=3,n.payload={element:null},n.callback=function(){Fc(e,t)},n}function Rc(e){return e=Eo(e),e.tag=3,e}function zc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ic(t,n,r),typeof i!=`function`&&(Nd===null?Nd=new Set([this]):Nd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Bc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ja(t,n,a,!0),n=Bo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return M===null?cf():n.alternate===null&&bd===0&&(bd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===so?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Af(e,r,a)),!1;case 22:return n.flags|=65536,r===so?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Af(e,r,a)),!1}throw Error(i(435,n.tag))}return Af(e,r,a),cf(),!1}if(j)return t=Bo.current,t===null?(r!==ga&&(t=Error(i(423),{cause:r}),Ca(Qi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Qi(r,n),a=Lc(e.stateNode,r,a),ko(e,a),bd!==4&&(bd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ga&&(e=Error(i(422),{cause:r}),Ca(Qi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Qi(o,n),Ed===null?Ed=[o]:Ed.push(o),bd!==4&&(bd=2),t===null)return!0;r=Qi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Lc(n.stateNode,r,e),ko(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Nd===null||!Nd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Rc(a),zc(a,e,n,r),ko(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Vc=Error(i(461)),Hc=!1;function Uc(e,t,n,r){t.child=e===null?So(t,null,n,r):xo(t,e.child,n,r)}function Wc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Na(t),r=ss(e,t,n,o,a,i),s=ds(),e!==null&&!Hc?(fs(e,t,i),vl(e,t,i)):(j&&s&&la(t),t.flags|=1,Uc(e,t,r,i),t.child)}function Gc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Kc(e,t,a,r,i)):(e=Ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!yl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Qr:n,n(o,r)&&e.ref===t.ref)return vl(e,t,i)}return t.flags|=1,e=Wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Kc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Qr(a,r)&&e.ref===t.ref){if(Hc=!1,t.pendingProps=r=a,yl(e,i))e.flags&131072&&(Hc=!0);else return t.lanes=e.lanes,vl(e,t,i)}}return el(e,t,n,r,i)}function qc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Yc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&no(t,a===null?null:a.cachePool),a===null?Ro():Lo(t,a),Uo(t);else return r=t.lanes=536870912,Yc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&no(t,null),Ro(),Wo()):(no(t,a.cachePool),Lo(t,a),Wo(),t.memoizedState=null);return Uc(e,t,i,n),t.child}function Jc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yc(e,t,n,r,i){var a=to();return a=a===null?null:{parent:Ba._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&no(t,null),Ro(),Uo(t),e!==null&&ja(e,t,r,!0),t.childLanes=i,null}function Xc(e,t){return t=ll({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zc(e,t,n){return xo(t,e.child,null,n),e=Xc(t,t.pendingProps),e.flags|=2,Go(t),t.memoizedState=null,e}function Qc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(j){if(r.mode===`hidden`)return e=Xc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Jc(null,e);if(Ho(t),(e=pa)?(e=Sm(e,ha),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return Xc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ho(t),a){if(t.flags&256)t.flags&=-257,t=Zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Hc||ja(e,t,n,!1),a=(n&e.childLanes)!==0,Hc||a){if(Fo.current===null){if(r=dd,r!==null&&(s=Tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Li(e,s),Yd(r,e,s),Vc;cf()}t=Zc(e,t,n)}else e=o.treeContext,pa=Em(s.nextSibling),fa=t,j=!0,ma=null,ha=!1,e!==null&&da(t,e),t=Xc(t,r),t.flags|=134221824;return t}return e=Wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function $c(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function el(e,t,n,r,i){return Na(t),n=ss(e,t,n,r,void 0,i),r=ds(),e!==null&&!Hc?(fs(e,t,i),vl(e,t,i)):(j&&r&&la(t),t.flags|=1,Uc(e,t,n,i),t.child)}function tl(e,t,n,r,i,a){return Na(t),t.updateQueue=null,n=ls(t,r,n,i),cs(e),r=ds(),e!==null&&!Hc?(fs(e,t,a),vl(e,t,a)):(j&&r&&la(t),t.flags|=1,Uc(e,t,n,a),t.child)}function nl(e,t,n,r,i){if(Na(t),t.stateNode===null){var a=Bi,o=n.contextType;typeof o==`object`&&o&&(a=Pa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Oc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},wo(t),o=n.contextType,a.context=typeof o==`object`&&o?Pa(o):Bi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Dc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Oc.enqueueReplaceState(a,a.state,null),Mo(t,r,a,i),jo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=jc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Bi,typeof u==`object`&&u&&(o=Pa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ac(t,a,r,o),Co=!1;var f=t.memoizedState;a.state=f,Mo(t,r,a,i),jo(),l=t.memoizedState,s||f!==l||Co?(typeof d==`function`&&(Dc(t,n,d,r),l=t.memoizedState),(c=Co||kc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,To(e,t),o=t.memoizedProps,u=jc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Bi,typeof l==`object`&&l&&(c=Pa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ac(t,a,r,c),Co=!1,f=t.memoizedState,a.state=f,Mo(t,r,a,i),jo();var p=t.memoizedState;o!==d||f!==p||Co||e!==null&&e.dependencies!==null&&Ma(e.dependencies)?(typeof s==`function`&&(Dc(t,n,s,r),p=t.memoizedState),(u=Co||kc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ma(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,$c(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=xo(t,e.child,null,i),t.child=xo(t,null,n,i)):Uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=vl(e,t,i),e}function rl(e,t,n,r){return xa(),t.flags|=256,Uc(e,t,n,r),t.child}var il={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function al(e){return{baseLanes:e,cachePool:ro()}}function ol(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=wd),e}function sl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ko.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(j){if(i?Vo(t):Wo(),(e=pa)?(e=Sm(e,ha),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw _a(t);return t.lanes=wm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Wo(),i=t.mode,a=ll({mode:`hidden`,children:a},i),r=qi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=al(n),r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(null,r)):(Vo(t),cl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return dl(e,t,a,o,r,c,s,n)}return i?(Wo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=qi(i,a,n,null),i.flags|=2):i=Wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Jc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=al(n):(a=i.cachePool,a===null?a=ro():(s=Ba._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(e.child,r)):(Vo(t),n=e.child,e=n.sibling,n=Wi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function cl(e,t){return t=ll({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ll(e,t){return e=Hi(22,e,null,t),e.lanes=0,e}function ul(e,t,n){return xo(t,e.child,null,n),e=cl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Vo(t),t.flags&=-257,ul(e,t,c)):t.memoizedState===null?(Wo(),o=a.fallback,s=t.mode,a=ll({mode:`visible`,children:a.children},s),o=qi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,xo(t,e.child,null,c),a=t.child,a.memoizedState=al(c),a.childLanes=ol(e,r,c),t.memoizedState=il,Jc(null,a)):(Wo(),t.child=e.child,t.flags|=128,null);if(Vo(t),wm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,Ca({value:a,source:null,stack:null})),ul(e,t,c)}if(Hc||ja(e,t,c,!1),r=(c&e.childLanes)!==0,Hc||r){if(Fo.current!==null)return ul(e,t,c);if(r=dd,r!==null&&(a=Tt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Li(e,a),Yd(r,e,a),Vc;return Cm(o)||cf(),ul(e,t,c)}return Cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,pa=Em(o.nextSibling),fa=t,j=!0,ma=null,ha=!1,e!==null&&da(t,e),t=cl(t,a.children),t.flags|=134221824,t)}function fl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ka(e.return,t,n)}function pl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Yo(n)===null&&(t=e),e=e.sibling}return t}function ml(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function hl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function gl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ko.current;if(t.flags&128)return qo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,qo(t,o),i===`backwards`&&e!==null?(hl(e),Uc(e,t,r,n),hl(e)):Uc(e,t,r,n),r=j?na:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fl(e,n,t);else if(e.tag===19)fl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,hl(t)),ml(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ml(t,!0,n,null,a,r);break;case`together`:ml(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ml(t,!1,i,n,a,r)}return t.child}function _l(e,t,n){var r=t.pendingProps;return Da(t,t.type,r.value),Uc(e,t,r.children,n),t.child}function vl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ja(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ma(e)))}function bl(e,t,n){switch(t.tag){case 3:Ne(t,t.stateNode.containerInfo),Da(t,Ba,e.memoizedState.cache),xa();break;case 27:case 5:Fe(t);break;case 4:Ne(t,t.stateNode.containerInfo);break;case 10:Da(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ho(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Vo(t),t.flags|=128,null;r=ja(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?sl(e,t,n):(Vo(t),e=vl(e,t,n),e===null?null:e.sibling)}Vo(t);break;case 19:if(t.flags&128)return gl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ja(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return gl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qo(t,Ko.current),r)break;return null;case 22:return t.lanes=0,qc(e,t,n,t.pendingProps);case 24:Da(t,Ba,e.memoizedState.cache)}return vl(e,t,n)}function xl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Hc=!0;else{if(!yl(e,n)&&!(t.flags&128))return Hc=!1,bl(e,t,n);Hc=!!(e.flags&131072)}}else Hc=!1,j&&t.flags&1048576&&A(t,na,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=uo(t.elementType),t.type=e,typeof e==`function`)Ui(e)?(r=jc(e,r),t.tag=1,t=nl(null,t,e,r,n)):(t.tag=0,t=el(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===O){t.tag=11,t=Wc(null,t,e,r,n);break a}if(a===ue){t.tag=14,t=Gc(null,t,e,r,n);break a}if(a===se){t.tag=10,t.type=e,t=_l(null,t,n);break a}}throw t=be(e)||e,Error(i(306,t,``))}}return t;case 0:return el(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=jc(r,t.pendingProps),nl(e,t,r,a,n);case 3:a:{if(Ne(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,To(e,t),Mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Da(t,Ba,r),r!==o.cache&&Aa(t,[Ba],n,!0),jo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=rl(e,t,r,n);break a}if(r!==a){a=Qi(Error(i(424)),t),Ca(a),t=rl(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(pa=Em(e.firstChild),fa=t,j=!0,ma=null,ha=!0,n=So(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(xa(),r===a){t=vl(e,t,n);break a}Uc(e,t,r,n)}t=t.child}return t;case 26:return $c(e,t),e===null?(n=Xm(t.type,null,t.pendingProps,null))?t.memoizedState=n:j||(t.stateNode=kp(t.type,t.pendingProps,je.current,t)):t.memoizedState=Xm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fe(t),e===null&&j&&(r=t.stateNode=Mm(t.type,t.pendingProps,je.current),fa=t,ha=!0,a=pa,zp(t.type)?(Dm=a,pa=Em(r.firstChild)):pa=a),Uc(e,t,t.pendingProps.children,n),$c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&j&&((a=r=pa)&&(r=bm(r,t.type,t.pendingProps,ha),r===null?a=!1:(t.stateNode=r,fa=t,pa=Em(r.firstChild),ha=!1,a=!0)),a||_a(t)),Fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ap(a,o)?r=null:s!==null&&Ap(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ss(e,t,us,null,null,n),wh._currentValue=a),$c(e,t),Uc(e,t,r,n),t.child;case 6:return e===null&&j&&((e=n=pa)&&(n=xm(n,t.pendingProps,ha),n===null?e=!1:(t.stateNode=n,fa=t,pa=null,e=!0)),e||_a(t)),null;case 13:return sl(e,t,n);case 4:return Ne(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xo(t,null,r,n):Uc(e,t,r,n),t.child;case 11:return Wc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,$c(e,t),Uc(e,t,r,n),t.child;case 8:return Uc(e,t,t.pendingProps.children,n),t.child;case 12:return Uc(e,t,t.pendingProps.children,n),t.child;case 10:return _l(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Na(t),a=Pa(a),r=r(a),t.flags|=1,Uc(e,t,r,n),t.child;case 14:return Gc(e,t,t.type,t.pendingProps,n);case 15:return Kc(e,t,t.type,t.pendingProps,n);case 19:return gl(e,t,n);case 31:return Qc(e,t,n);case 22:return qc(e,t,n,t.pendingProps);case 24:return Na(t),r=Pa(Ba),e===null?(a=to(),a===null&&(a=dd,o=Va(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},wo(t),Da(t,Ba,a)):((e.lanes&n)!==0&&(To(e,t),Mo(t,null,null,n),jo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Da(t,Ba,r),r!==a.cache&&Aa(t,[Ba],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Da(t,Ba,r))),Uc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:j&&la(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:$c(e,t),Uc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Sl(e){e.flags|=4}function Cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?dh(t,r):dh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(af())e.flags|=8192;else throw fo=so,ao}}else e.flags&=-16777217}function wl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!fh(t)){if(af())e.flags|=8192;else throw fo=so,ao}}function Tl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:yt(),e.lanes|=t,Td|=t)}function El(e,t){if(!j)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Dl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ol(e,t,n){var r=t.pendingProps;switch(ua(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dl(t),null;case 1:return Dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Oa(Ba),Pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ba(t)?Sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Sa())),Dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Sl(t),o===null?(Dl(t),Cl(t,a,null,r,n)):(Dl(t),wl(t,o))):o?o===e.memoizedState?(Dl(t),t.flags&=-16777217):(Sl(t),Dl(t),wl(t,o)):(e=e.memoizedProps,e!==r&&Sl(t),Dl(t),Cl(t,a,e,r,n)),null;case 27:if(Ie(t),n=je.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}e=ke.current,ba(t)?va(t,e):(e=Mm(a,r,n),t.stateNode=e,Sl(t))}return Dl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ie(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}if(o=ke.current,ba(t))va(t,o);else{var s=Ep(je.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[jt]=t,o[Mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(yp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Sl(t)}}return Dl(t),t.subtreeFlags&=-33554433,Cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=je.current,ba(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=fa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[jt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||gp(e.nodeValue,n)),e||_a(t,!0)}else e=Ep(e).createTextNode(r),e[jt]=t,t.stateNode=e}return Dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ba(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[jt]=t}else xa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),e=!1}else n=Sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Go(t),t):(Go(t),null);if(t.flags&128)throw Error(i(558))}return Dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ba(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[jt]=t}else xa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),a=!1}else a=Sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Go(t),t):(Go(t),null)}return Go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Tl(t,t.updateQueue),Dl(t),null);case 4:return Pe(),e===null&&op(t.stateNode.containerInfo),t.flags|=67108864,Dl(t),null;case 10:return Oa(t.type),Dl(t),null;case 19:if(Jo(t),r=t.memoizedState,r===null)return Dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)El(r,!1);else{if(bd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Yo(e),o!==null){for(t.flags|=128,El(r,!1),e=o.updateQueue,t.updateQueue=e,Tl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Gi(n,e),n=n.sibling;return qo(t,Ko.current&1|2),j&&ca(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ye()>jd&&(t.flags|=128,a=!0,El(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Yo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Tl(t,e),El(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!j)return Dl(t),null}else 2*Ye()-r.renderingStartTime>jd&&n!==536870912&&(t.flags|=128,a=!0,El(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ye(),e.sibling=null,o=Ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||j?qo(t,o):(n=o,Oe(Bo,t),Oe(Ko,n),M===null&&(M=t)),j&&ca(t,r.treeForkCount),e}return Dl(t),null;case 22:case 23:return Go(t),zo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Dl(t),t.subtreeFlags&6&&(t.flags|=8192)):Dl(t),n=t.updateQueue,n!==null&&Tl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&De(eo),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Ba),Dl(t),null;case 25:return null;case 30:return t.flags|=33554432,Dl(t),null}throw Error(i(156,t.tag))}function kl(e,t){switch(ua(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(Ba),Pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ie(t),null;case 31:if(t.memoizedState!==null){if(Go(t),t.alternate===null)throw Error(i(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Pe(),null;case 10:return Oa(t.type),null;case 22:case 23:return Go(t),zo(),e!==null&&De(eo),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Ba),null;case 25:return null;default:return null}}function Al(e,t){switch(ua(t),t.tag){case 3:Oa(Ba),Pe();break;case 26:case 27:case 5:Ie(t);break;case 4:Pe();break;case 31:t.memoizedState!==null&&Go(t);break;case 13:Go(t);break;case 19:Jo(t);break;case 10:Oa(t.type);break;case 22:case 23:Go(t),zo(),e!==null&&De(eo);break;case 24:Oa(Ba)}}function jl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){kf(t,t.return,e)}}function Ml(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){kf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){kf(t,t.return,e)}}function Nl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Po(t,n)}catch(t){kf(e,e.return,t)}}}function Pl(e,t,n){n.props=jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){kf(e,t,n)}}function Fl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Zp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Qp(e);m(e.child,!1,hm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){kf(e,t,n)}}function Il(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){kf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){kf(e,t,n)}else n.current=null}}function Ll(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)_m(e.stateNode,t[n])}function Rl(e){for(var t=e.return;t!==null&&(Vl(t)&&_m(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function zl(e){for(var t=e.return;t!==null&&(Vl(t)&&vm(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function Bl(e){return e.tag===5||e.tag===3||e.tag===27}function Vl(e){return e&&e.tag===7&&e.stateNode!==null}function F(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){kf(e,e.return,t)}}function Hl(e,t,n){try{var r=e.stateNode;xp(r,e.type,n,t),r[Mt]=t}catch(t){kf(e,e.return,t)}}function Ul(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zp(e.type)||e.tag===4}function Wl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ul(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&zp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=On)),Ll(e,r),tn=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,zp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Gl(e,t,n,r),e=e.sibling;e!==null;)Gl(e,t,n,r),e=e.sibling}function Kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ll(e,r),tn=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,zp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Kl(e,t,n,r),e=e.sibling;e!==null;)Kl(e,t,n,r),e=e.sibling}function ql(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);yp(t,r,n),t[jt]=e,t[Mt]=n}catch(t){kf(e,e.return,t)}}var Jl=!1,Yl=null;function Xl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Jl=!0)}var Zl=null;function Ql(){var e=Zl;return Zl=null,e}var $l=0;function eu(e,t,n,r,i){return $l=0,tu(e.child,t,n,r,i)}function tu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Gp(o);r.push(s),s.view&&(a=!0)}else a||Gp(o).view&&(a=!0);Jl=!0,Hp(o,$l===0?t:t+`_`+$l,n),$l++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||tu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function nu(e,t){for(;e!==null;)e.tag===5?Up(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||nu(e.child,t)),e=e.sibling}function ru(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ru(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=ki(t.default,t.share),t!==`none`&&(eu(e,n,t,null,!1)||nu(e.child,!1))}e=e.sibling}}function iu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Di(r,n),a=ki(r.default,n.paired?r.share:r.enter);a===`none`?ru(e):eu(e,i,a,null,!1)?(ru(e),n.paired||t||Jd(e,r.onEnter)):nu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)iu(e,t),e=e.sibling;else ru(e)}function au(e){if(Yl!==null&&Yl.size!==0){var t=Yl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=ki(n.default,n.share);if(a!==`none`&&(eu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Jd(e,n.onShare)):nu(e.child,!1)),t.delete(r),t.size===0)break}}}au(e)}e=e.sibling}}}function ou(e){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode),r=Yl===null?void 0:Yl.get(n),i=ki(t.default,r===void 0?t.exit:t.share);i!==`none`&&(eu(e,n,i,null,!1)?r===void 0?Jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Yl.delete(n),Jd(e,t.onShare)):nu(e.child,!1)),Yl!==null&&au(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else Yl!==null&&au(e)}function su(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode);t=ki(t.default,t.update),e.flags&=-5,t!==`none`&&eu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&su(e);e=e.sibling}}function cu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,nu(e.child,!1))}cu(e)}e=e.sibling}}function lu(e){if(e.tag===30)e.stateNode.paired=null,nu(e.child,!1),cu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)lu(e),e=e.sibling;else cu(e)}function uu(e){for(e=e.child;e!==null;)e.tag===30?nu(e.child,!1):e.subtreeFlags&33554432&&uu(e),e=e.sibling}function du(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&$l<a.length){var l=a[$l],u=Gp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Hp(c,$l===0?n:n+`_`+$l,i),s&&e.flags&4||(Zl===null&&(Zl=[]),Zl.push(c,$l===0?r:r+`_`+$l,t.memoizedProps)),$l++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:du(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function fu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Di(n,r),a=ki(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;$l=0,i=du(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&fu(e,t);e=e.sibling}}var pu=!1,mu=!1,hu=!1,gu=!1,_u=typeof WeakSet==`function`?WeakSet:Set,vu=null,yu=!1,bu=!1,xu=!1,Su=!1;function Cu(e,t,n){if(e=e.containerInfo,wp=Nh,e=ri(e),ii(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(Tp={focusedElem:e,selectionRange:r},Nh=!1,n=(n&335544064)===n,vu=t,t=n?9270:1024;vu!==null;){if(e=vu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ou(r[a]);if(e.alternate===null&&e.flags&2)n&&Xl(e),wu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ou(r),wu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Xl(e),wu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,vu=r):(n&&su(e),wu(n))}}Yl=null}function wu(e){for(;vu!==null;){var t=vu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=jc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){kf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)ym(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:ym(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=ki(a.default,a.update),a!==`none`&&eu(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,vu=r;break}vu=t.return}}function Tu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gu(e,n),r&4&&jl(5,n);break;case 1:if(Gu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){kf(n,n.return,e)}else{var i=jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){kf(n,n.return,e)}}}r&64&&Nl(n),r&512&&Fl(n,n.return);break;case 3:if(Gu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Po(e,t)}catch(e){kf(n,n.return,e)}}break;case 27:t===null&&r&4&&ql(n);case 26:case 5:Gu(e,n),t===null&&r&4&&F(n),r&512&&Fl(n,n.return);break;case 12:Gu(e,n);break;case 31:Gu(e,n),r&4&&Pu(e,n);break;case 13:Gu(e,n),r&4&&Fu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Nf.bind(null,n),Tm(e,n))));break;case 22:if(r=n.memoizedState!==null||pu,!r){var a=t!==null&&t.memoizedState!==null||mu;t=pu,i=mu,pu=r,(mu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),qu(e,n,r)):Gu(e,n),pu=t,mu=i}break;case 30:Gu(e,n),r&512&&Fl(n,n.return);break;case 7:r&512&&Fl(n,n.return);default:Gu(e,n)}}function Eu(e,t){for(e=e.child;e!==null;)Du(e,t),e=e.sibling}function Du(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){kf(e,e.return,t)}Ou(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,tn=!0}catch(t){kf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Vp(s,!0):Vp(e.stateNode,!1)}catch(t){kf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Eu(e,t);break;default:Eu(e,t)}}function Ou(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Du(n,r);break a;case 22:n.memoizedState===null&&Ou(n,r);break a;default:Ou(n,r)}}e=e.sibling}}function ku(e){var t=e.alternate;t!==null&&(e.alternate=null,ku(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Au=null,ju=!1;function Mu(e,t,n){for(n=n.child;n!==null;)Nu(e,t,n),n=n.sibling}function Nu(e,t,n){if(at&&typeof at.onCommitFiberUnmount==`function`)try{at.onCommitFiberUnmount(it,n)}catch{}switch(n.tag){case 26:mu||Il(n,t),Mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!mu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mu||Il(n,t),zl(n);var r=Au,i=ju;zp(n.type)&&(Au=n.stateNode,ju=!1),Mu(e,t,n),Nm(n.stateNode,n.type,n.memoizedProps),Au=r,ju=i;break;case 5:mu||Il(n,t),zl(n);case 6:if(n.tag===6&&zl(n),r=Au,i=ju,Au=null,Mu(e,t,n),Au=r,ju=i,Au!==null){if(ju)try{(Au.nodeType===9?Au.body:Au.nodeName===`HTML`?Au.ownerDocument.body:Au).removeChild(n.stateNode),tn=!0}catch(e){kf(n,t,e)}else try{Au.removeChild(n.stateNode),tn=!0}catch(e){kf(n,t,e)}}break;case 18:Au!==null&&(ju?(e=Au,Bp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ag(e)):Bp(Au,n.stateNode));break;case 4:r=Au,i=ju,Au=n.stateNode.containerInfo,ju=!0,Mu(e,t,n),Au=r,ju=i;break;case 0:case 11:case 14:case 15:Ml(2,n,t),mu||Ml(4,n,t),Mu(e,t,n);break;case 1:mu||(Il(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Pl(n,t,r)),Mu(e,t,n);break;case 21:Mu(e,t,n);break;case 22:mu=(r=mu)||n.memoizedState!==null,Mu(e,t,n),mu=r;break;case 30:Il(n,t),Mu(e,t,n);break;case 7:mu||Il(n,t),Mu(e,t,n);break;default:Mu(e,t,n)}}function Pu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ag(e)}catch(e){kf(t,t.return,e)}}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ag(e)}catch(e){kf(t,t.return,e)}}function Iu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _u),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _u),t;default:throw Error(i(435,e.tag))}}function Lu(e,t){var n=Iu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Pf.bind(null,e,t);t.then(r,r)}})}function Ru(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(zp(l.type)){Au=l.stateNode,ju=!1;break a}break;case 5:Au=l.stateNode,ju=!1;break a;case 3:case 4:Au=l.stateNode.containerInfo,ju=!0;break a}l=l.return}if(Au===null)throw Error(i(160));Nu(s,c,o),Au=null,ju=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bu(t,e,n),t=t.sibling}var zu=null;function Bu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ru(t,e,n),Vu(e),a&4&&(Ml(3,e,e.return),jl(3,e),Ml(5,e,e.return));break;case 1:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Il(r,r.return)),a&64&&pu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=zu,Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Il(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(pu)e.stateNode=kp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Rt]||r[jt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),yp(r,t,n),r[jt]=e,Gt(r),t=r;break a;case`link`:if(o=ch(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),yp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=ch(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),yp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[jt]=e,Gt(r),t=r}e.stateNode=t}}else pu||lh(o,e.type,e.stateNode)}else e.stateNode=rh(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||mu||t.parentNode.removeChild(t)):a.count--,n===null?pu||lh(o,e.type,e.stateNode):rh(o,n,e.memoizedProps))}break;case 27:Ru(t,e,n),Vu(e),a&512&&(mu||r===null||Il(r,r.return)),r!==null&&a&4&&Hl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=hu,hu=!1,Ru(t,e,n),hu=o,Vu(e),a&512&&(mu||r===null||Il(r,r.return)),e.flags&32){t=e.stateNode;try{bn(t,``),tn=!0}catch(t){kf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Hl(e,t,r===null?t:r.memoizedProps)),a&1024&&(gu=!0);break;case 6:if(Ru(t,e,n),Vu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,tn=!0}catch(t){kf(e,e.return,t)}}break;case 3:if(tn=!1,sh=null,o=zu,zu=Lm(t.containerInfo),Ru(t,e,n),zu=o,Vu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ag(t.containerInfo)}catch(t){kf(e,e.return,t)}gu&&(gu=!1,Hu(e)),tn=!1;break;case 4:a=hu,hu=pu,r=nn(),o=zu,zu=Lm(e.stateNode.containerInfo),Ru(t,e,n),Vu(e),zu=o,tn&&bu&&(xu=!0),tn=r,hu=a;break;case 12:Ru(t,e,n),Vu(e);break;case 31:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 13:Ru(t,e,n),Vu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(kd=Ye()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=pu,l=mu,u=hu;pu=c||o,hu=u||o,mu=l||s,Ru(t,e,n),mu=l,hu=u,pu=c,Vu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||pu||mu||(t=s||mu,n=pu,r=mu,pu=o||pu,mu=t,Ku(e,2),pu=n,mu=r),!o&&hu||Eu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Lu(e,n))));break;case 19:Ru(t,e,n),Vu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 30:a&512&&(mu||r===null||Il(r,r.return)),a=nn(),o=bu,s=(n&335544064)===n,c=e.memoizedProps,bu=s&&ki(c.default,c.update)!==`none`,Ru(t,e,n),Vu(e),s&&r!==null&&tn&&(e.flags|=4),bu=o,tn=a;break;case 21:break;case 7:a&512&&(mu||r===null||Il(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ru(t,e,n),Vu(e)}}function Vu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ul(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Vl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Bl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Kl(e,Wl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(bn(l,``),n.flags&=-33),Kl(e,Wl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Gl(e,Wl(e),u,s);break;default:throw Error(i(161))}}catch(t){kf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Hu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Nh=!0,t.reset(),Nh=!1),e=e.sibling}}function Uu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling;else fu(t,!1)}function Wu(e,t){var n=e.alternate;if(n===null)iu(e,!1);else switch(e.tag){case 3:if(Su=yu=!1,Ql(),Uu(t,e),!yu&&!xu){if(e=Zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Up(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Su=!0}Zl=null;break;case 5:Uu(t,e);break;case 4:r=yu,yu=!1,Uu(t,e),yu&&(xu=!0),yu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Uu(t,e):iu(e,!1));break;case 30:r=yu,i=Ql(),yu=!1,Uu(t,e),yu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Di(a,o),o=Di(n.memoizedProps,o);var s=ki(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,$l=0,t=du(e,n,t,o,s,a,!0),$l!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Jd(e,e.memoizedProps.onUpdate),Zl=i):i!==null&&(i.push.apply(i,Zl),Zl=i),yu=e.flags&32?!0:r;break;default:Uu(t,e)}}function Gu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tu(e,t.alternate,t),t=t.sibling}function Ku(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ml(4,n,n.return),Ku(n,r);break;case 1:Il(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Pl(n,n.return,i),Ku(n,r);break;case 27:r&2&&Nm(n.stateNode,n.type,n.memoizedProps);case 5:Il(n,n.return),n.tag!==5&&n.tag!==27||zl(n),Ku(n,r);break;case 6:zl(n);break;case 26:Il(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||mu||i.parentNode.removeChild(i),Ku(n,r);break;case 22:n.memoizedState===null&&Ku(n,r);break;case 30:Il(n,n.return),Ku(n,r);break;case 7:Il(n,n.return);default:Ku(n,r)}e=e.sibling}}function qu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:qu(i,a,n),jl(4,a);break;case 1:if(qu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){kf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)No(l[i],c)}catch(e){kf(r,r.return,e)}}s&&o&64&&Nl(a),Fl(a,a.return);break;case 27:n&2&&ql(a);case 5:a.tag!==5&&a.tag!==27||Rl(a),qu(i,a,n),s&&r===null&&o&4&&F(a),Fl(a,a.return);break;case 6:Rl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||pu||lh(Lm(c.ownerDocument),a.type,c),qu(i,a,n),s&&r===null&&o&4&&F(a),Fl(a,a.return);break;case 12:qu(i,a,n);break;case 31:qu(i,a,n),s&&o&4&&Pu(i,a);break;case 13:qu(i,a,n),s&&o&4&&Fu(i,a);break;case 22:a.memoizedState===null&&qu(i,a,n),Fl(a,a.return);break;case 30:qu(i,a,n),Fl(a,a.return);break;case 7:Fl(a,a.return);default:qu(i,a,n)}t=t.sibling}}function Ju(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ha(n))}function Yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ha(e))}function Xu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Zu(e,t,n,r),t=t.sibling;else i&&uu(t)}function Zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&lu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xu(e,t,n,r),a&2048&&jl(9,t);break;case 1:Xu(e,t,n,r);break;case 3:Xu(e,t,n,r),i&&Su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ha(a)));break;case 12:if(a&2048){Xu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){kf(t,t.return,e)}}else Xu(e,t,n,r);break;case 31:Xu(e,t,n,r);break;case 13:Xu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&lu(t),o._visibility&2?Xu(e,t,n,r):(o._visibility|=2,Qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&lu(s),o._visibility&2?Xu(e,t,n,r):$u(e,t)),a&2048&&Ju(s,t);break;case 24:Xu(e,t,n,r),a&2048&&Yu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(nu(a.child,!0),nu(t.child,!0))),Xu(e,t,n,r);break;default:Xu(e,t,n,r)}}function Qu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Qu(a,o,s,c,i),jl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Qu(a,o,s,c,i)):u._visibility&2?Qu(a,o,s,c,i):$u(a,o),i&&l&2048&&Ju(o.alternate,o);break;case 24:Qu(a,o,s,c,i),i&&l&2048&&Yu(o.alternate,o);break;default:Qu(a,o,s,c,i)}t=t.sibling}}function $u(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:$u(n,r),i&2048&&Ju(r.alternate,r);break;case 24:$u(n,r),i&2048&&Yu(r.alternate,r);break;default:$u(n,r)}t=t.sibling}}var ed=8192;function td(e,t,n){if(e.subtreeFlags&ed)for(e=e.child;e!==null;)nd(e,t,n),e=e.sibling}function nd(e,t,n){switch(e.tag){case 26:td(e,t,n),e.flags&ed&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&mh(n,e)):hh(n,zu,e.memoizedState,e.memoizedProps));break;case 5:td(e,t,n),e.flags&ed&&(e=e.stateNode,(t&335544128)===t&&mh(n,e));break;case 3:case 4:var r=zu;zu=Lm(e.stateNode.containerInfo),td(e,t,n),zu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ed,ed=16777216,td(e,t,n),ed=r):td(e,t,n));break;case 30:if((e.flags&ed)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Yl===null&&(Yl=new Map),Yl.set(r,i)}td(e,t,n);break;default:td(e,t,n)}}function rd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function id(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(e),e=e.sibling}function ad(e){switch(e.tag){case 0:case 11:case 15:id(e),e.flags&2048&&Ml(9,e,e.return);break;case 3:id(e);break;case 12:id(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,od(e)):id(e);break;default:id(e)}}function od(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ml(8,t,t.return),od(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,od(t));break;default:od(t)}e=e.sibling}}function sd(e,t){for(;vu!==null;){var n=vu;switch(n.tag){case 0:case 11:case 15:Ml(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ha(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,vu=r;else a:for(n=e;vu!==null;){r=vu;var i=r.sibling,a=r.return;if(ku(r),r===n){vu=null;break a}if(i!==null){i.return=a,vu=i;break a}vu=a}}}var cd={getCacheForType:function(e){var t=Pa(Ba),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pa(Ba).controller.signal}},ld=typeof WeakMap==`function`?WeakMap:Map,ud=0,dd=null,fd=null,pd=0,md=0,hd=null,gd=!1,_d=!1,vd=!1,yd=0,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=0,Ed=null,Dd=null,Od=!1,kd=0,Ad=0,jd=1/0,Md=null,Nd=null,Pd=0,Fd=null,Id=null,Ld=0,Rd=0,zd=null,Bd=null,Vd=null,Hd=null,Ud=null,Wd=0,Gd=null;function Kd(){return ud&2&&pd!==0?pd&-pd:k.T===null?Ot():Xf()}function qd(){if(wd===0){if(!(pd&536870912)||j){var e=ft;ft<<=1,!(ft&3932160)&&(ft=262144),wd=e}else wd=536870912}return e=Bo.current,e!==null&&(e.flags|=32),wd}function Jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Zp(Di(e.memoizedProps,n))),Hd===null&&(Hd=[]),Hd.push(t.bind(null,r))}}function Yd(e,t,n){(e===dd&&(md===2||md===9)||e.cancelPendingCommit!==null)&&(nf(e,0),$d(e,pd,wd,!1)),xt(e,n),(!(ud&2)||e!==dd)&&(e===dd&&(!(ud&2)&&(Sd|=n),bd===4&&$d(e,pd,wd,!1)),Hf(e))}function Xd(e,t,n){if(ud&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||gt(e,t),a=r?df(e,t):lf(e,t,!0),o=r;do{if(a===0){_d&&!r&&$d(e,t,0,!1);break}if(n=e.current.alternate,o&&!Qd(n)){a=lf(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ed;var l=c.current.memoizedState.isDehydrated;if(l&&(nf(c,s).flags|=256),s=lf(c,s,!1),s!==2&&s!==6){if(vd&&!l){c.errorRecoveryDisabledLanes|=o,Sd|=o,a=4;break a}o=Dd,Dd=a,o!==null&&(Dd===null?Dd=o:Dd.push.apply(Dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){nf(e,0),$d(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:$d(r,t,wd,!gd);break a;case 2:Dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=kd+300-Ye(),10<a)){if($d(r,t,wd,!gd),ht(r,0,!0)!==0)break a;Ld=t,r.timeoutHandle=Np(Zd.bind(null,r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,`Throttled`,-0,0),a);break a}Zd(r,n,Dd,Md,Od,t,wd,Sd,Td,gd,o,null,-0,0)}break}while(1);Hf(e)}function Zd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:On},Yl=null,nd(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=yh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?kd-Ye():(a&4194048)===a?Ad-Ye():0,m=_h(d,m),m!==null)){Ld=a,e.cancelPendingCommit=m(vf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),$d(e,a,o,!l);return}vf(e,t,a,n,r,i,o,s,c,l,u,d)}function Qd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Zr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $d(e,t,n,r){t=_t(e,t),t&=~Cd,t&=~Sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-st(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ct(e,n,t)}function ef(){return ud&6?!0:(Uf(0,!1),!1)}function tf(){if(fd!==null){if(md===0)var e=fd.return;else e=fd,Ea=Ta=null,ps(e),ho=null,go=0,e=fd;for(;e!==null;)Al(e.alternate,e),e=e.return;fd=null}}function nf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Pp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ld=0,tf(),dd=e,fd=n=Wi(e.current,null),pd=t,md=0,hd=null,gd=!1,_d=gt(e,t),vd=!1,Td=wd=Cd=Sd=xd=bd=0,Dd=Ed=null,Od=!1,yd=_t(e,t),Pi(),n}function rf(e,t){N=null,k.H=Cc,t===io||t===oo?(t=po(),md=3):t===ao?(t=po(),md=4):md=t===Vc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,hd=t,fd===null&&(bd=1,Fc(e,Qi(t,e.current)))}function af(){var e=Bo.current;return e===null?!0:(pd&4194048)===pd?M===null:(pd&62914560)===pd||pd&536870912?e===M:!1}function of(){var e=k.H;return k.H=Cc,e===null?Cc:e}function sf(){var e=k.A;return k.A=cd,e}function cf(){bd=4,gd||(pd&4194048)!==pd&&Bo.current!==null||(_d=!0),!(xd&134217727)&&!(Sd&134217727)||dd===null||$d(dd,pd,wd,!1)}function lf(e,t,n){var r=ud;ud|=2;var i=of(),a=sf();(dd!==e||pd!==t)&&(Md=null,nf(e,t)),t=!1;var o=bd;a:do try{if(md!==0&&fd!==null){var s=fd,c=hd;switch(md){case 8:tf(),o=6;break a;case 3:case 2:case 9:case 6:Bo.current===null&&(t=!0);var l=md;if(md=0,hd=null,hf(e,s,c,l),n&&_d){o=0;break a}break;default:l=md,md=0,hd=null,hf(e,s,c,l)}}uf(),o=bd;break}catch(t){rf(e,t)}while(1);return t&&e.shellSuspendCounter++,Ea=Ta=null,ud=r,k.H=i,k.A=a,fd===null&&(dd=null,pd=0,Pi()),o}function uf(){for(;fd!==null;)pf(fd)}function df(e,t){var n=ud;ud|=2;var r=of(),a=sf();dd!==e||pd!==t?(Md=null,jd=Ye()+500,nf(e,t)):_d=gt(e,t);a:do try{if(md!==0&&fd!==null){t=fd;var o=hd;b:switch(md){case 1:md=0,hd=null,hf(e,t,o,1);break;case 2:case 9:if(co(o)){md=0,hd=null,mf(t);break}t=function(){md!==2&&md!==9||dd!==e||(md=7),Hf(e)},o.then(t,t);break a;case 3:md=7;break a;case 4:md=5;break a;case 7:co(o)?(md=0,hd=null,mf(t)):(md=0,hd=null,hf(e,t,o,7));break;case 5:var s=null;switch(fd.tag){case 26:s=fd.memoizedState;case 5:case 27:var c=fd;if(s?fh(s):c.stateNode.complete){md=0,hd=null;var l=c.sibling;if(l!==null)fd=l;else{var u=c.return;u===null?fd=null:(fd=u,gf(u))}break b}}md=0,hd=null,hf(e,t,o,5);break;case 6:md=0,hd=null,hf(e,t,o,6);break;case 8:tf(),bd=6;break a;default:throw Error(i(462))}}ff();break}catch(t){rf(e,t)}while(1);return Ea=Ta=null,k.H=r,k.A=a,ud=n,fd===null?(dd=null,pd=0,Pi(),bd):0}function ff(){for(;fd!==null&&!qe();)pf(fd)}function pf(e){var t=xl(e.alternate,e,yd);e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function mf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=tl(n,t,t.pendingProps,t.type,void 0,pd);break;case 11:t=tl(n,t,t.pendingProps,t.type.render,t.ref,pd);break;case 5:ps(t);var r=t;r===fa&&(j?(ya(r),r.tag===5&&r.stateNode!=null&&(pa=r.stateNode)):(ya(r),j=!0));default:Al(n,t),t=fd=Gi(t,yd),t=xl(n,t,yd)}e.memoizedProps=e.pendingProps,t===null?gf(e):fd=t}function hf(e,t,n,r){Ea=Ta=null,ps(t),ho=null,go=0;var i=t.return;try{if(Bc(e,i,t,n,pd)){bd=1,Fc(e,Qi(n,e.current)),fd=null;return}}catch(t){if(i!==null)throw fd=i,t;bd=1,Fc(e,Qi(n,e.current)),fd=null;return}t.flags&32768?(j||r===1?e=!0:_d||pd&536870912?e=!1:(gd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Bo.current,r!==null&&r.tag===13&&(r.flags|=16384))),_f(t,e)):gf(t)}function gf(e){var t=e;do{if(t.flags&32768){_f(t,gd);return}e=t.return;var n=Ol(t.alternate,t,yd);if(n!==null){fd=n;return}if(t=t.sibling,t!==null){fd=t;return}fd=t=e}while(t!==null);bd===0&&(bd=5)}function _f(e,t){do{var n=kl(e.alternate,e);if(n!==null){n.flags&=32767,fd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){fd=e;return}fd=e=n}while(e!==null);bd=6,fd=null}function vf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Ef();while(Pd!==0);if(ud&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===dd&&(fd=dd=null,pd=0),Id=t,Fd=e,Ld=n,zd=a,Bd=r,yf(e,t,n,s,c,l,f)}}function yf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Rd=s,s|=Ni,St(e,n,s,r,i,a),Hd=null,(n&335544064)===n?(Ud=Ga(e),r=10262):(Ud=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ff($e,function(){return Df(),null})):(e.callbackNode=null,e.callbackPriority=0),Jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=k.T,k.T=null,i=Se.p,Se.p=2,a=ud,ud|=4;try{Cu(e,t,n)}finally{ud=a,Se.p=i,k.T=r}}Pd=1,Jl?Vd=Yp(o,e.containerInfo,Ud,Sf,Cf,xf,wf,Df,bf,null,null):(Sf(),Cf(),wf())}function bf(e){if(Pd!==0){var t=Fd.onRecoverableError;t(e,{componentStack:null})}}function xf(){Pd===3&&(Pd=0,Wu(Id,Fd),Pd=4)}function Sf(){if(Pd===1){Pd=0;var e=Fd,t=Id,n=Ld,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=k.T,k.T=null;var i=Se.p;Se.p=2;var a=ud;ud|=4;try{bu=xu=!1,Bu(t,e,n),n=Tp;var o=ri(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ni(s.ownerDocument.documentElement,s)){if(c!==null&&ii(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=ti(s,h),v=ti(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Nh=!!wp,Tp=wp=null}finally{ud=a,Se.p=i,k.T=r}}e.current=t,Pd=2}}function Cf(){if(Pd===2){Pd=0;var e=Fd,t=Id,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=Se.p;Se.p=2;var i=ud;ud|=4;try{Tu(e,t.alternate,t)}finally{ud=i,Se.p=r,k.T=n}}Pd=3}}function wf(){if(Pd===4||Pd===3){Pd=0;var e=Vd;Vd=null,Je();var t=Fd,n=Id,r=Ld,i=Bd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Pd=5:(Pd=0,Id=Fd=null,Tf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Nd=null),Dt(r),n=n.stateNode,at&&typeof at.onCommitFiberRoot==`function`)try{at.onCommitFiberRoot(it,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=k.T,a=Se.p,Se.p=2,k.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{k.T=n,Se.p=a}}if(i=Hd,o=Ud,Ud=null,i!==null&&(Hd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ld&3&&Ef(),Hf(t),a=t.pendingLanes,r&261930&&a&42?t===Gd?Wd++:(Wd=0,Gd=t):(Wd=0,Gd=null),Uf(0,!1)}}function Tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ha(t)))}function Ef(){return Vd!==null&&(Vd.skipTransition(),Vd=null),Sf(),Cf(),wf(),Df()}function Df(){if(Pd!==5)return!1;var e=Fd,t=Rd;Rd=0;var n=Dt(Ld),r=k.T,a=Se.p;try{Se.p=32>n?32:n,k.T=null,n=zd,zd=null;var o=Fd,s=Ld;if(Pd=0,Id=Fd=null,Ld=0,ud&6)throw Error(i(331));var c=ud;if(ud|=4,ad(o.current),Zu(o,o.current,s,n),ud=c,Uf(0,!1),at&&typeof at.onPostCommitFiberRoot==`function`)try{at.onPostCommitFiberRoot(it,o)}catch{}return!0}finally{Se.p=a,k.T=r,Tf(e,t)}}function Of(e,t,n){t=Qi(n,t),t=Lc(e.stateNode,t,2),e=Do(e,t,2),e!==null&&(xt(e,2),Hf(e))}function kf(e,t,n){if(e.tag===3)Of(e,e,n);else for(;t!==null;){if(t.tag===3){Of(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Nd===null||!Nd.has(r))){e=Qi(n,e),n=Rc(2),r=Do(t,n,2),r!==null&&(zc(n,r,t,e),xt(r,2),Hf(r));break}}t=t.return}}function Af(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ld;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(vd=!0,i.add(n),e=jf.bind(null,e,t,n),t.then(e,e))}function jf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,dd===e&&(pd&n)===n&&(bd===4||bd===3&&(pd&62914560)===pd&&300>Ye()-kd?ud&2?Cd|=n:nf(e,0):Cd|=n,Td===pd&&(Td=0)),Hf(e)}function Mf(e,t){t===0&&(t=yt()),e=Li(e,t),e!==null&&(xt(e,t),Hf(e))}function Nf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mf(e,n)}function Pf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Mf(e,n)}function Ff(e,t){return Ge(e,t)}var If=null,Lf=null,Rf=!1,zf=!1,Bf=!1,Vf=0;function Hf(e){e!==Lf&&e.next===null&&(Lf===null?If=Lf=e:Lf=Lf.next=e),zf=!0,Rf||(Rf=!0,Yf())}function Uf(e,t){if(!Bf&&zf){Bf=!0;do for(var n=!1,r=If;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-st(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Jf(r,a))}else a=pd,a=ht(r,r===dd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||gt(r,a)||(n=!0,Jf(r,a))}r=r.next}while(n);Bf=!1}}function Wf(){Gf()}function Gf(){zf=Rf=!1;var e=0;Vf!==0&&Mp()&&(e=Vf);for(var t=Ye(),n=null,r=If;r!==null;){var i=r.next,a=Kf(r,t);a===0?(r.next=null,n===null?If=i:n.next=i,i===null&&(Lf=n)):(n=r,(e!==0||a&3)&&(zf=!0)),r=i}Pd!==0&&Pd!==5||Uf(e,!1),Vf!==0&&(Vf=0)}function Kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-st(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=vt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=dd,n=pd,n=ht(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(md===2||md===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||gt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ke(r),Dt(n)){case 2:case 8:n=Qe;break;case 32:n=$e;break;case 268435456:n=tt;break;default:n=$e}return r=qf.bind(null,e),n=Ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ke(r),e.callbackPriority=2,e.callbackNode=null,2}function qf(e,t){if(Pd!==0&&Pd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ef()&&e.callbackNode!==n)return null;var r=pd;return r=ht(e,e===dd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Xd(e,r,t),Kf(e,Ye()),e.callbackNode!=null&&e.callbackNode===n?qf.bind(null,e):null)}function Jf(e,t){if(Ef())return null;Xd(e,t,!0)}function Yf(){Lp(function(){ud&6?Ge(Ze,Wf):Gf()})}function Xf(){if(Vf===0){var e=Ja;e===0&&(e=dt,dt<<=1,!(dt&261888)&&(dt=256)),Vf=e}return Vf}function Zf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Dn(e)}function Qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Zf((i[Mt]||null).action),o=r.submitter;o&&(t=(t=o[Mt]||null)?Zf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Yn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Vf!==0){var e=new FormData(i,o);lc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),lc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var $f=0;$f<wi.length;$f++){var ep=wi[$f];Ti(ep.toLowerCase(),`on`+(ep[0].toUpperCase()+ep.slice(1)))}Ti(gi,`onAnimationEnd`),Ti(_i,`onAnimationIteration`),Ti(vi,`onAnimationStart`),Ti(`dblclick`,`onDoubleClick`),Ti(`focusin`,`onFocus`),Ti(`focusout`,`onBlur`),Ti(yi,`onTransitionRun`),Ti(bi,`onTransitionStart`),Ti(xi,`onTransitionCancel`),Ti(Si,`onTransitionEnd`),Xt(`onMouseEnter`,[`mouseout`,`mouseover`]),Xt(`onMouseLeave`,[`mouseout`,`mouseover`]),Xt(`onPointerEnter`,[`pointerout`,`pointerover`]),Xt(`onPointerLeave`,[`pointerout`,`pointerover`]),Yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var tp=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),np=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(tp));function rp(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ai(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ai(e)}i.currentTarget=null,a=c}}}}function I(e,t){var n=t[Pt];n===void 0&&(n=t[Pt]=new Set);var r=e+`__bubble`;n.has(r)||(sp(t,e,2,!1),n.add(r))}function ip(e,t,n){var r=0;t&&(r|=4),sp(n,e,r,t)}var ap=`_reactListening`+Math.random().toString(36).slice(2);function op(e){if(!e[ap]){e[ap]=!0,qt.forEach(function(t){t!==`selectionchange`&&(np.has(t)||ip(t,!1,e),ip(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ap]||(t[ap]=!0,ip(`selectionchange`,!1,t))}}function sp(e,t,n,r){switch(Bh(t)){case 2:var i=Ph;break;case 8:i=Fh;break;default:i=Ih}n=i.bind(null,t,n,e),i=void 0,!Rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function cp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Fn(function(){var r=a,i=An(n),s=[];a:{var c=Ci.get(e);if(c!==void 0){var l=Yn,u=e;switch(e){case`keypress`:if(Wn(n)===0)break a;case`keydown`:case`keyup`:l=pr;break;case`focusin`:u=`focus`,l=ir;break;case`focusout`:u=`blur`,l=ir;break;case`beforeblur`:case`afterblur`:l=ir;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=nr;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=rr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=gr;break;case gi:case _i:case vi:l=ar;break;case Si:l=_r;break;case`scroll`:case`scrollend`:l=Zn;break;case`wheel`:l=vr;break;case`copy`:case`cut`:case`paste`:l=or;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=mr;break;case`submit`:l=hr;break;case`toggle`:case`beforetoggle`:l=yr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=In(m,p),g!=null&&d.push(lp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==kn&&(u=n.relatedTarget||n.fromElement)&&(Vt(u)||u[Nt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Vt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=nr,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=mr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ut(c),h=l==null?u:Ut(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Vt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,dp):null,c!==null&&fp(s,u,c,d,!1),l!==null&&f!==null&&fp(s,f,l,d,!0)))}a:{if(c=r?Ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=zr;else if(Nr(c)){if(Br)_=Yr;else{_=qr;var v=Kr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&wn(r.elementType)&&(_=zr):_=Jr;if(_&&=_(e,r)){Pr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ut(r):window,e){case`focusin`:(Nr(v)||v.contentEditable===`true`)&&(oi=v,si=r,ci=null);break;case`focusout`:ci=si=oi=null;break;case`mousedown`:li=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:li=!1,ui(s,n,i);break;case`selectionchange`:if(ai)break;case`keydown`:case`keyup`:ui(s,n,i)}var y;if(xr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else kr?Dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(wr&&n.locale!==`ko`&&(kr||b!==`onCompositionStart`?b===`onCompositionEnd`&&kr&&(y=Un()):(Bn=i,Vn=`value`in Bn?Bn.value:Bn.textContent,kr=!0)),v=up(r,b),0<v.length&&(b=new sr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Or(n),y!==null&&(b.data=y)))),(y=Cr?Ar(e,n):jr(e,n))&&(b=up(r,`onBeforeInput`),0<b.length&&(v=new sr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Qf(s,e,r,n,i)}rp(s,t)})}function lp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function up(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=In(e,n),i!=null&&r.unshift(lp(e,i,a)),i=In(e,t),i!=null&&r.push(lp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function dp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=In(n,a),l!=null&&o.unshift(lp(n,l,c))):i||(l=In(n,a),l!=null&&o.push(lp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var pp=/\r\n?/g,mp=/\u0000|\uFFFD/g;function hp(e){return(typeof e==`string`?e:``+e).replace(pp,`
9
- `).replace(mp,``)}function gp(e,t){return t=hp(t),hp(e)===t}function _p(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||bn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&bn(e,``+r);else return;break;case`className`:an(e,`class`,r);break;case`tabIndex`:an(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:an(e,n,r);break;case`style`:Cn(e,r,o);return;case`data`:if(t!==`object`){an(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Dn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&_p(e,t,`name`,a.name,a,null),_p(e,t,`formEncType`,a.formEncType,a,null),_p(e,t,`formMethod`,a.formMethod,a,null),_p(e,t,`formTarget`,a.formTarget,a,null)):(_p(e,t,`encType`,a.encType,a,null),_p(e,t,`method`,a.method,a,null),_p(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=On);return;case`onScroll`:r!=null&&I(`scroll`,e);return;case`onScrollEnd`:r!=null&&I(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Dn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:I(`beforetoggle`,e),I(`toggle`,e),rn(e,`popover`,r);break;case`xlinkActuate`:on(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:on(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:on(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:on(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:on(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:on(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:on(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:on(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:on(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:rn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Tn.get(n)||n,rn(e,n,r);else return}tn=!0}function vp(e,t,n,r,a,o){switch(n){case`style`:Cn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)bn(e,r);else if(typeof r==`number`||typeof r==`bigint`)bn(e,``+r);else return;break;case`onScroll`:r!=null&&I(`scroll`,e);return;case`onScrollEnd`:r!=null&&I(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=On);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Mt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}tn=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):rn(e,n,r)}return}tn=!0}function yp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:I(`error`,e),I(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,o,s,n,null)}}a&&_p(e,t,`srcSet`,n.srcSet,n,null),r&&_p(e,t,`src`,n.src,n,null);return;case`input`:I(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:_p(e,t,r,d,n,null)}}hn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in I(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:_p(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&_n(e,!!r,n,!0):_n(e,!!r,t,!1);return;case`textarea`:for(s in I(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:_p(e,t,s,c,n,null)}yn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:_p(e,t,l,r,n,null)}return;case`dialog`:I(`beforetoggle`,e),I(`toggle`,e),I(`cancel`,e),I(`close`,e);break;case`iframe`:case`object`:I(`load`,e);break;case`video`:case`audio`:for(r=0;r<tp.length;r++)I(tp[r],e);break;case`image`:I(`error`,e),I(`load`,e);break;case`details`:I(`toggle`,e);break;case`embed`:case`source`:case`link`:I(`error`,e),I(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:_p(e,t,u,r,n,null)}return;default:if(wn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&vp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&_p(e,t,c,r,n,null))}var bp={};function xp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||_p(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(tn=!0),o=m;break;case`name`:m!==f&&(tn=!0),a=m;break;case`checked`:m!==f&&(tn=!0),u=m;break;case`defaultChecked`:m!==f&&(tn=!0),d=m;break;case`value`:m!==f&&(tn=!0),s=m;break;case`defaultValue`:m!==f&&(tn=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&_p(e,t,p,m,r,f)}}mn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||_p(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(tn=!0),p=o;break;case`defaultValue`:o!==l&&(tn=!0),c=o;break;case`multiple`:o!==l&&(tn=!0),s=o;default:o!==l&&_p(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?_n(e,!!n,n?[]:``,!1):_n(e,!!n,t,!0)):_n(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:_p(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(tn=!0),p=a;break;case`defaultValue`:a!==o&&(tn=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&_p(e,t,s,a,r,o)}vn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:_p(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(tn=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:_p(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&_p(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:_p(e,t,u,p,r,m)}return;default:if(wn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&vp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||vp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&_p(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||_p(e,t,f,p,r,m)}function Sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Cp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Sp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Sp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var wp=null,Tp=null;function Ep(e){return e.nodeType===9?e:e.ownerDocument}function Dp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Op(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function kp(e,t,n,r){return n=Ep(n).createElement(e),n[jt]=r,n[Mt]=t,yp(n,e,t),Gt(n),n}function Ap(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jp=null;function Mp(){var e=window.event;return e&&e.type===`popstate`?e!==jp&&(jp=e,!0):(jp=null,!1)}var Np=typeof setTimeout==`function`?setTimeout:void 0,Pp=typeof clearTimeout==`function`?clearTimeout:void 0,Fp=typeof Promise==`function`?Promise:void 0,Ip=typeof requestAnimationFrame==`function`?requestAnimationFrame:Np,Lp=typeof queueMicrotask==`function`?queueMicrotask:Fp===void 0?Np:function(e){return Fp.resolve(null).then(e).catch(Rp)};function Rp(e){setTimeout(function(){throw e})}function zp(e){return e===`head`}function Bp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),ag(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Pm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Pm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Rt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Pm(e.ownerDocument.body)}n=i}while(n);ag(t)}function Vp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Hp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Up(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Wp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Gp(e){return Wp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Wp(t,n,e)}function qp(e){return e.documentElement.clientHeight}function Jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Yp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(qp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=ph(f),u>gh){s.length=o;break}f=new Promise(Jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Xp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Xp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Xp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Xp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Zp(e){return{name:e,group:new Xp(`group`,e),imagePair:new Xp(`image-pair`,e),old:new Xp(`old`,e),new:new Xp(`new`,e)}}function Qp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Qp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(rm(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=tm(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,$p,e,s,r)}this._eventListeners=a}};function $p(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Qp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=rm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=tm(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,em,e,n,i),r.splice(t,1),a!==null&&a()}};function em(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function tm(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function nm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function rm(e,t,n,r){if(e.length===0)return-1;r=nm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&nm(a.optionsOrUseCapture)===r)return i}return-1}Qp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,tm(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,tm(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Qp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,im,e,void 0,void 0)};function im(e,t){return e.tag!==6&&(e=b(e),Am(e,t))}Qp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,am,t,void 0,void 0);for(var n=t.length-1;0<=n&&!im(t[n],e);n--);};function am(e,t){return t.push(e),!1}Qp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=Ep(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,om,e,void 0,void 0))};function om(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Qp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,sm,e,void 0,void 0)};function sm(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Qp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,cm,e,void 0,void 0);for(var n=t=0;n<lm.length;n++){var r=lm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):lm[t++]=r}lm.length=t}};function cm(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var lm=[],um=!1;function dm(e,t,n){lm.push({fragmentInstance:e,observer:t,instance:n}),um||(um=!0,jm(function(){um=!1;var e=lm;lm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Qp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,fm,e,void 0,void 0),e};function fm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Qp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Qp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,am,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||pm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function pm(e,t,n,r,i){var a=Vt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function mm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Qp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,am,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),mm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),mm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function hm(e,t){return e=b(e),gm(e,t),!1}function gm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function _m(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,tm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<lm.length;i++){var a=lm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(lm[r++]=a)}lm.length=r,n.observe(e)}),gm(e,t))}function vm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,tm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?dm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function ym(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ym(n),Bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function bm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Rt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Em(e.nextSibling),e===null)break}return null}function xm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Em(e.nextSibling),e===null))return null;return e}function Sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Em(e.nextSibling),e===null))return null;return e}function Cm(e){return e.data===`$?`||e.data===`$~`}function wm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Tm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Em(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Dm=null;function Om(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Em(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function km(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Am(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function jm(e){Ip(function(){Ip(function(t){return e(t)})})}function Mm(e,t,n){switch(t=Ep(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Nm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&_p(e,t,r,null,bp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===On&&(e.onclick=null),Bt(e)}function Pm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Bt(e)}var Fm=new Map,Im=new Set;function Lm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Rm=Se.d;Se.d={f:zm,r:Bm,D:Um,C:Wm,L:Gm,m:Km,X:Jm,S:qm,M:Ym};function zm(){var e=Rm.f(),t=ef();return e||t}function Bm(e){var t=Ht(e);t!==null&&t.tag===5&&t.type===`form`?dc(t):Rm.r(e)}var Vm=typeof document>`u`?null:document;function Hm(e,t,n){var r=Vm;if(r&&typeof t==`string`&&t){var i=pn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Im.has(i)||(Im.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),yp(t,`link`,e),Gt(t),r.head.appendChild(t)))}}function Um(e){Rm.D(e),Hm(`dns-prefetch`,e,null)}function Wm(e,t){Rm.C(e,t),Hm(`preconnect`,e,t)}function Gm(e,t,n){Rm.L(e,t,n);var r=Vm;if(r&&e&&t){var i=`link[rel="preload"][as="`+pn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+pn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+pn(n.imageSizes)+`"]`)):i+=`[href="`+pn(e)+`"]`;var a=i;switch(t){case`style`:a=Zm(e);break;case`script`:a=th(e)}if(!(Fm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Fm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Qm(a))||t===`script`&&r.querySelector(nh(a))))){var o=r.createElement(`link`);yp(o,`link`,e),t===`style`&&(o[zt]=!0,o.onload=o.onerror=function(){Kt(o)}),Gt(o),r.head.appendChild(o)}}}function Km(e,t){Rm.m(e,t);var n=Vm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+pn(r)+`"][href="`+pn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=th(e)}if(!Fm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Fm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(nh(a)))return}r=n.createElement(`link`),yp(r,`link`,e),Gt(r),n.head.appendChild(r)}}}function qm(e,t,n){Rm.S(e,t,n);var r=Vm;if(r&&e){var i=Wt(r).hoistableStyles,a=Zm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Qm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Fm.get(a))&&ah(e,n);var c=o=r.createElement(`link`);Gt(c),yp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,ih(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Jm(e,t){Rm.X(e,t);var n=Vm;if(n&&e){var r=Wt(n).hoistableScripts,i=th(e),a=r.get(i);a||(a=n.querySelector(nh(i)),a||(e=D({src:e,async:!0},t),(t=Fm.get(i))&&oh(e,t),a=n.createElement(`script`),Gt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ym(e,t){Rm.M(e,t);var n=Vm;if(n&&e){var r=Wt(n).hoistableScripts,i=th(e),a=r.get(i);a||(a=n.querySelector(nh(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Fm.get(i))&&oh(e,t),a=n.createElement(`script`),Gt(a),yp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Xm(e,t,n,r){var a=(a=je.current)?Lm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Zm(n.href),t=Wt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Zm(n.href);var o=Wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Qm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Fm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Fm.set(e,o)),eh(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=th(n),t=Wt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Zm(e){return`href="`+pn(e)+`"`}function Qm(e){return`link[rel="stylesheet"][`+e+`]`}function $m(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function eh(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[zt]){r.loading=1;return}}else t=e.createElement(`link`),t[zt]=!0,t.onload=t.onerror=Kt.bind(null,t),yp(t,`link`,n),Gt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function th(e){return`[src="`+pn(e)+`"]`}function nh(e){return`script[async]`+e}function rh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+pn(n.href)+`"]`);if(r)return t.instance=r,Gt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Gt(r),yp(r,`style`,a),ih(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Zm(n.href);var o=e.querySelector(Qm(a));if(o)return t.state.loading|=4,t.instance=o,Gt(o),o;r=$m(n),(a=Fm.get(a))&&ah(r,a),o=(e.ownerDocument||e).createElement(`link`),Gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),yp(o,`link`,r),t.state.loading|=4,ih(o,n.precedence,e),t.instance=o;case`script`:return o=th(n.src),(a=e.querySelector(nh(o)))?(t.instance=a,Gt(a),a):(r=n,(a=Fm.get(o))&&(r=D({},n),oh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Gt(a),yp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,ih(r,n.precedence,e));return t.instance}function ih(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ah(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function oh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var sh=null;function ch(e,t,n){if(sh===null){var r=new Map,i=sh=new Map;i.set(n,r)}else i=sh,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Rt]||a[jt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function lh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function uh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function dh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function fh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ph(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function mh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ph(t),e.suspenseyImages.push(t)),e=bh.bind(e),t.decode().then(e,e))}function hh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Zm(r.href),a=t.querySelector(Qm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=yh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Gt(a);return}a=t.ownerDocument||t,r=$m(r),(i=Fm.get(i))&&ah(r,i),a=a.createElement(`link`),Gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),yp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=yh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var gh=0;function _h(e,t){return e.stylesheets&&e.count===0&&Sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&gh===0&&(gh=62500*Cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>gh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function vh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function yh(){this.count--,vh(this)}function bh(){this.imgCount--,vh(this)}var xh=null;function Sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xh=new Map,t.forEach(Ch,e),xh=null,yh.call(e))}function Ch(e,t){if(!(t.state.loading&4)){var n=xh.get(e);if(n)var r=n.get(null);else{n=new Map,xh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=yh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var wh={$$typeof:se,Provider:null,Consumer:null,_currentValue:Ce,_currentValue2:Ce,_threadCount:0};function Th(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function Eh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Th(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Hi(3,null,null,t),e.current=a,a.stateNode=e,t=Va(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},wo(a),e}function Dh(e){return e?(e=Bi,e):Bi}function Oh(e,t,n,r,i,a){i=Dh(i),r.context===null?r.context=i:r.pendingContext=i,r=Eo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Do(e,r,t),n!==null&&(Yd(n,e,t),Oo(n,e,t))}function kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ah(e,t){kh(e,t),(e=e.alternate)&&kh(e,t)}function jh(e){if(e.tag===13||e.tag===31){var t=Li(e,67108864);t!==null&&Yd(t,e,67108864),Ah(e,67108864)}}function Mh(e){if(e.tag===13||e.tag===31){var t=Kd();t=Et(t);var n=Li(e,t);n!==null&&Yd(n,e,t),Ah(e,t)}}var Nh=!0;function Ph(e,t,n,r){var i=k.T;k.T=null;var a=Se.p;try{Se.p=2,Ih(e,t,n,r)}finally{Se.p=a,k.T=i}}function Fh(e,t,n,r){var i=k.T;k.T=null;var a=Se.p;try{Se.p=8,Ih(e,t,n,r)}finally{Se.p=a,k.T=i}}function Ih(e,t,n,r){if(Nh){var i=Lh(r);if(i===null)cp(e,t,r,Rh,n),Yh(e,r);else if(Zh(i,e,t,n,r))r.stopPropagation();else if(Yh(e,r),t&4&&-1<Jh.indexOf(e)){for(;i!==null;){var a=Ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=mt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-st(o);s.entanglements[1]|=c,o&=~c}Hf(a),!(ud&6)&&(jd=Ye()+500,Uf(0,!1))}}break;case 31:case 13:s=Li(a,2),s!==null&&Yd(s,a,2),ef(),Ah(a,2)}if(a=Lh(r),a===null&&cp(e,t,r,Rh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else cp(e,t,r,null,n)}}function Lh(e){return e=An(e),zh(e)}var Rh=null;function zh(e){if(Rh=null,e=Vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rh=e,null}function Bh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Xe()){case Ze:return 2;case Qe:return 8;case $e:case et:return 32;case tt:return 268435456;default:return 32}default:return 32}}var Vh=!1,Hh=null,Uh=null,Wh=null,Gh=new Map,Kh=new Map,qh=[],Jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Yh(e,t){switch(e){case`focusin`:case`focusout`:Hh=null;break;case`dragenter`:case`dragleave`:Uh=null;break;case`mouseover`:case`mouseout`:Wh=null;break;case`pointerover`:case`pointerout`:Gh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Kh.delete(t.pointerId)}}function Xh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ht(t),t!==null&&jh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Zh(e,t,n,r,i){switch(t){case`focusin`:return Hh=Xh(Hh,e,t,n,r,i),!0;case`dragenter`:return Uh=Xh(Uh,e,t,n,r,i),!0;case`mouseover`:return Wh=Xh(Wh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Gh.set(a,Xh(Gh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Kh.set(a,Xh(Kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Qh(e){var t=Vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,kt(e.priority,function(){Mh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,kt(e.priority,function(){Mh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $h(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);kn=r,n.target.dispatchEvent(r),kn=null}else return t=Ht(n),t!==null&&jh(t),e.blockedOn=n,!1;t.shift()}return!0}function eg(e,t,n){$h(e)&&n.delete(t)}function tg(){Vh=!1,Hh!==null&&$h(Hh)&&(Hh=null),Uh!==null&&$h(Uh)&&(Uh=null),Wh!==null&&$h(Wh)&&(Wh=null),Gh.forEach(eg),Kh.forEach(eg)}function ng(e,n){e.blockedOn===n&&(e.blockedOn=null,Vh||(Vh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,tg)))}var rg=null;function ig(e){rg!==e&&(rg=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){rg===e&&(rg=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(zh(r||n)===null)continue;break}var a=Ht(n);a!==null&&(e.splice(t,3),t-=3,lc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ag(e){function t(t){return ng(t,e)}Hh!==null&&ng(Hh,e),Uh!==null&&ng(Uh,e),Wh!==null&&ng(Wh,e),Gh.forEach(t),Kh.forEach(t);for(var n=0;n<qh.length;n++){var r=qh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<qh.length&&(n=qh[0],n.blockedOn===null);)Qh(n),n.blockedOn===null&&qh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Mt]||null;if(typeof a==`function`)o||ig(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Mt]||null)s=o.formAction;else if(zh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),ig(n)}}}function og(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function sg(e){this._internalRoot=e}cg.prototype.render=sg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Oh(n,Kd(),e,t,null,null)},cg.prototype.unmount=sg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Oh(e.current,2,null,e,null,null),ef(),t[Nt]=null}};function cg(e){this._internalRoot=e}cg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qh.length&&t!==0&&t<qh[n].priority;n++);qh.splice(n,0,e),n===0&&Qh(e)}};var lg=n.version;if(lg!==`19.3.0`)throw Error(i(527,lg,`19.3.0`));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var ug={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var dg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dg.isDisabled&&dg.supportsFiber)try{it=dg.inject(ug),at=dg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Mc,s=Nc,c=Pc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Eh(e,1,!1,null,null,n,r,null,o,s,c,og),e[Nt]=t.current,op(e),new sg(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=l(h(),1),b=_(),x=`modulepreload`,S=function(e){return`/`+e},C={},w=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=S(t,n),t=s(t),t in C)return;C[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:x,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},T=e=>{throw TypeError(e)},E=(e,t,n)=>t.has(e)||T(`Cannot `+n),D=(e,t,n)=>(E(e,t,`read from private field`),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?T(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),te=(e,t,n,r)=>(E(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ne=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,re=/^[\\/]{2}/;function ie(e,t){return t+e.replace(/\\/g,`/`)}var ae=`popstate`;function oe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function se(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=pe(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),de(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:fe(t))}function r(e,t){ce(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return me(t,n,r,e)}function O(e,t){if(e===!1||e==null)throw Error(t)}function ce(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function le(){return Math.random().toString(36).substring(2,10)}function ue(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function de(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?pe(t):t,state:n,key:t&&t.key||r||le(),mask:i}}function fe({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function pe(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function me(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=oe(e)?e:de(h.location,e,t);n&&n(r,e),l=u()+1;let d=ue(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=oe(e)?e:de(h.location,e,t);n&&n(r,e),l=u();let i=ue(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return he(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ae,d),c=e,()=>{i.removeEventListener(ae,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function he(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),O(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:fe(t);return i=i.replace(/ $/,`%20`),!n&&re.test(i)&&(i=r+i),new URL(i,r)}var ge,_e=class{constructor(e){if(ee(this,ge,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(D(this,ge).has(e))return D(this,ge).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){D(this,ge).set(e,t)}};ge=new WeakMap;var ve=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ye(e){return ve.has(e)}var be=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function xe(e){return be.has(e)}function k(e){return e.index===!0}function Se(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(O(e.index!==!0||!e.children,`Cannot specify children on an index route`),O(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),k(e)){let n={...e,id:s};return r[s]=Ce(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Ce(n,t(n)),e.children&&(n.children=Se(e.children,t,o,r,i)),n}})}function Ce(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function we(e,t,n=`/`){return Te(e,t,n,!1)}function Te(e,t,n,r,i){let a=Ge((typeof t==`string`?pe(t):t).pathname||`/`,n);if(a==null)return null;let o=i??De(e),s=null,c=We(a);for(let e=0;s==null&&e<o.length;++e)s=Be(o[e],c,r);return s}function Ee(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function De(e){let t=Oe(e);return Ae(t),t}function Oe(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;O(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=tt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(O(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Oe(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Re(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ue(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ke(e.path))a(e,t,!0,n)}),t}function ke(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ke(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ae(e){e.sort((e,t)=>e.score===t.score?ze(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var je=/^:[\w-]+$/,Me=3,Ne=2,Pe=1,Fe=10,Ie=-2,Le=e=>e===`*`;function Re(e,t){let n=e.split(`/`),r=n.length;return n.some(Le)&&(r+=Ie),t&&(r+=Ne),n.filter(e=>!Le(e)).reduce((e,t)=>e+(je.test(t)?Me:t===``?Pe:Fe),r)}function ze(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Be(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?He(u,l,s.matcher,s.compiledParams):Ve(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:tt([a,d.pathname]),pathnameBase:rt(tt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=tt([a,d.pathnameBase]))}return o}function Ve(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ue(e.path,e.caseSensitive,e.end);return He(e,t,n,r)}function He(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=nt(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=nt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Ue(e,t=!1,n=!0){ce(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function We(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return ce(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ge(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ke({basename:e,pathname:t}){return t===`/`?e:tt([e,t])}var qe=e=>ne.test(e);function Je(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?pe(e):e,a;return n?(n=et(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ye(n.substring(1),`/`):Ye(n,t)):a=t,{pathname:a,search:it(r),hash:at(i)}}function Ye(e,t){let n=nt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ze(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qe(e){let t=Ze(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $e(e,t,n,r=!1){let i;typeof e==`string`?i=pe(e):(i={...e},O(!i.pathname||!i.pathname.includes(`?`),Xe(`?`,`pathname`,`search`,i)),O(!i.pathname||!i.pathname.includes(`#`),Xe(`#`,`pathname`,`hash`,i)),O(!i.search||!i.search.includes(`#`),Xe(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Je(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var et=e=>e.replace(/[\\/]{2,}/g,`/`),tt=e=>et(e.join(`/`));function nt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var rt=e=>nt(e).replace(/^\/*/,`/`),it=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,at=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ot=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},st=(e,t)=>{let n=ot(e,t);return n.headers.set(`X-Remix-Replace`,`true`),n},ct=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],lt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ut(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function dt(e){return tt(e.map(e=>e.route.path).filter(Boolean))||`/`}var ft=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function pt(e,t){let n=e;if(typeof n!=`string`||!ne.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ft)try{let e=new URL(window.location.href),r=re.test(n)?new URL(ie(n,e.protocol)):new URL(n),a=Ge(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{ce(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var mt=Symbol(`Uninstrumented`);function ht(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=_t(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=_t(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[mt]??i,a=_t(n[e],t,(...e)=>yt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[mt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[mt]??e,r=_t(n.middleware,t,(...e)=>yt(e[0]));return r?(r[mt]=t,r):e})),r}function gt(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[mt]??e.navigate,r=_t(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?fe(n):`.`,...bt(e,r??{})}});r&&(r[mt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[mt]??e.fetch,r=_t(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...bt(e,i??{})}});r&&(r[mt]=t,e.fetch=r)}return e}function _t(e,t,n){return e.length===0?null:async(...r)=>{let i=await vt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function vt(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=vt(e,t,n,r-1),a=await o,O(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function yt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:xt(t),params:{...r},pattern:i,context:St(n)}}function bt(e,t){return{currentUrl:fe(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function xt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function St(e){if(wt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Ct=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function wt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Ct}var Tt=new URL(`http://localhost`);function Et(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Tt)}catch{return Tt}}function Dt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ot(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function kt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Dt(i,n),s=!Dt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ot(e,i)||!Dt(i,a)))throw Error(`External navigation is not allowed`)}var At=[`POST`,`PUT`,`PATCH`,`DELETE`],jt=new Set(At),Mt=[`GET`,...At],Nt=new Set(Mt),Pt=new Set([301,302,303,307,308]),Ft=new Set([307,308]),It={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Lt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},zt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Bt=`remix-router-transitions`,Vt=Symbol(`ResetLoaderData`),Ht,Ut,Wt,Gt,Kt=class{constructor(e){ee(this,Ht),ee(this,Ut),ee(this,Wt),ee(this,Gt),te(this,Ht,e),te(this,Ut,De(e))}get stableRoutes(){return D(this,Ht)}get activeRoutes(){return D(this,Wt)??D(this,Ht)}get branches(){return D(this,Gt)??D(this,Ut)}get hasHMRRoutes(){return D(this,Wt)!=null}setRoutes(e){te(this,Ht,e),te(this,Ut,De(e))}setHmrRoutes(e){te(this,Wt,e),te(this,Gt,De(e))}commitHmrRoutes(){D(this,Wt)&&(te(this,Ht,D(this,Wt)),te(this,Ut,D(this,Gt)),te(this,Wt,void 0),te(this,Gt,void 0))}};Ht=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap;function qt(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;O(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||zt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...ht(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Kt(Se(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||dn,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Te(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=In(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Fn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&mt(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=mt(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>Qt(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=$t(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:It,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,ee,te=!1,ne=new Map,ie=null,ae=!1,oe=!1,se=new Set,le=new Map,ue=0,me=-1,ge=new Map,ve=new Set,ye=new Map,be=new Map,xe=new Set,k=new Map,Ce,we=null;function De(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(Ce){Ce(),Ce=void 0;return}ce(k.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=st({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{Ce=e});e.history.go(r*-1),ot(i,{state:`blocked`,location:n,proceed(){ot(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,Rt),Ae({blockers:e})}}),E?.resolve(),E=null;return}return Pe(t,n)}),n){or(t,ne);let e=()=>sr(t,ne);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||Pe(`POP`,w.location,{initialHydration:!0}),C}function Oe(){d&&d(),ie&&ie(),f.clear(),ee&&ee.abort(),w.fetchers.forEach((e,t)=>Qe(w.fetchers,t)),w.blockers.forEach((e,t)=>at(t))}function ke(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function Ae(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(xe.has(t)?n.push(t):r.push(t))}),xe.forEach(e=>{!w.fetchers.has(e)&&!le.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Qe(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function je(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Zn(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Mn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Rt)));let l=!ae&&pt(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&Zn(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ae||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`&&!ae&&t!==w.location){let e=ne.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:ne.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(te){let e=ne.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ne.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}Ae({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:It,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,te=!1,ae=!1,oe=!1,E?.resolve(),E=null,we?.resolve(),we=null}async function Me(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=cr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Xt(!1,Yt(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?pe(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},re.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),kt(typeof n.mask==`string`?n.mask:fe(n.mask),fe(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=de(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},kt(t==null?e.history.createHref(w.location):typeof t==`string`?t:fe(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Zn(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=st({currentLocation:s,nextLocation:l,historyAction:d});if(m){ot(m,{state:`blocked`,location:l,proceed(){ot(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Me(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Rt),Ae({blockers:e})}});return}await Pe(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function Ne(){we||=cr(),Ke(),Ae({revalidation:`loading`});let e=we.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(Pe(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(Pe(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:te===!0}),e)}async function Pe(t,n,r){ee&&ee.abort(),ee=null,T=t,ae=(r&&r.startUninterruptedRevalidation)===!0,ft(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,te=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Te(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!oe&&zn(w.location,n)&&!(r&&r.submission&&Zn(r.submission.formMethod))){je(n,{matches:a},{flushSync:o});return}let l=mt(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=ct(n.pathname);je(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;ee=new AbortController;let d=En(e.history,n,ee.signal,r&&r.submission),f=e.getContext?await e.getContext():new _e,p;if(r&&r.pendingError)p=[Pn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Zn(r.submission.formMethod)){let i=await Fe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Wn(t)&&ut(t.error)&&t.error.status===404){ee=null,je(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=tr(n,a,t,r.submission),o=!1,l.active=!1,d=En(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ie(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(ee=null,je(n,{matches:h||a,...Nn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Fe(t,n,i,l,u,d,f,p,m={}){if(Ke(),Ae({navigation:nr(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await _t(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Fn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Pn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=ct(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=$n(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:In(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ue(t,n,_n(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Gn(h)){let n;return n=m&&m.replace!=null?m.replace:Tn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await He(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Wn(h)){let e=Pn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ie(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||tr(n,i,l,p),x=p||m||er(b),S=!ae&&!g;if(d){if(S){let e=Le(v);Ae({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await _t(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Fn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Pn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=ct(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Zt(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,oe,se,xe,ye,ve,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(me=++ue,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=nt(e);return je(n,{matches:i,loaderData:{},errors:v&&Wn(v[1])?{[v[0]]:v[1].error}:null,...Nn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Le(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Re(E)),Ae(e,{flushSync:_})}E.forEach(e=>{et(e.key),e.controller&&le.set(e.key,e.controller)});let D=()=>E.forEach(e=>et(e.key));ee&&ee.signal.addEventListener(`abort`,D);let{loaderResults:te,fetcherResults:ne}=await We(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener(`abort`,D),E.forEach(e=>le.delete(e.key));let re=Ln(te);if(re)return await He(t,re.result,!0,{replace:h}),{shortCircuited:!0};if(re=Ln(ne),re)return ve.add(re.key),await He(t,re.result,!0,{replace:h}),{shortCircuited:!0};let ie=new Map(w.fetchers),{loaderData:O,errors:ce}=jn(w,i,te,v,E,ne,ie);g&&w.errors&&(ce={...w.errors,...ce});let de=nt(ie),fe=rt(me,ie),pe=de||fe||E.length>0;return{matches:i,loaderData:O,errors:ce,...pe?{workingFetchers:ie}:{}}}function Le(e){if(e&&!Wn(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Re(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=rr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function ze(t,n,r,i){et(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=Yt(w.location,w.matches,c,r,n,i?.relative),u=Te(o,l,c,!1,s.branches),d=mt(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Ye(t,n,In(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Xt(!0,l,i);if(m){Ye(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new _e,g=(i&&i.preventScrollReset)===!0;if(p&&Zn(p.formMethod)){await Be(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ye.set(t,{routeId:n,path:f}),await Ve(t,n,f,u,h,d.active,a,g,p)}async function Be(t,n,i,l,u,d,f,p,m,h){Ke(),ye.delete(t),Je(t,ir(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=En(e.history,i,g.signal,m);if(d){let e=await _t(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ye(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Ye(t,n,In(404,{pathname:i}),{flushSync:f});return}}let v=$n(l,i);if(!v.route.action&&!v.route.lazy){Ye(t,n,In(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}le.set(t,g);let y=ue,b=_n(a,o,_,i,l,v,r,u),x=await Ue(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){le.get(t)===g&&le.delete(t);return}if(xe.has(t)){if(Gn(S)||Wn(S)){Je(t,ar(void 0));return}}else{if(Gn(S)){if(le.delete(t),me>y){Je(t,ar(void 0));return}return ve.add(t),Je(t,rr(m)),He(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Wn(S)){Ye(t,n,S.error);return}}let C=w.navigation.location||w.location,E=En(e.history,C,g.signal),D=s.activeRoutes,te=w.navigation.state===`idle`?w.matches:Te(D,w.navigation.location,c,!1,s.branches);O(te,`Didn't find any matches after fetcher action`);let ne=++ue;ge.set(t,ne);let{dsMatches:re,revalidatingFetchers:ie}=Zt(E,u,a,o,e.history,w,te,m,C,r,!1,oe,se,xe,ye,ve,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ae=rr(m,S.data),ce=new Map(w.fetchers);ce.set(t,ae),ie.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=ce.get(t),r=rr(void 0,n?n.data:void 0);ce.set(t,r),et(t),e.controller&&le.set(t,e.controller)}),Ae({fetchers:ce});let de=()=>ie.forEach(e=>et(e.key));g.signal.addEventListener(`abort`,de);let{loaderResults:fe,fetcherResults:pe}=await We(re,ie,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,de),ge.delete(t),le.delete(t),ie.forEach(e=>le.delete(e.key));let he=w.fetchers.has(t),_e=e=>{if(!he)return e;let n=new Map(e.fetchers);return n.set(t,ar(S.data)),{...e,fetchers:n}},be=Ln(fe);if(be)return w=_e(w),He(E,be.result,!1,{preventScrollReset:p});if(be=Ln(pe),be)return ve.add(be.key),w=_e(w),He(E,be.result,!1,{preventScrollReset:p});let k=new Map(w.fetchers);he&&k.set(t,ar(S.data));let{loaderData:Se,errors:Ce}=jn(w,te,fe,void 0,ie,pe,k);rt(ne,k),w.navigation.state===`loading`&&ne>me?(O(T,`Expected pending action`),ee&&ee.abort(),je(w.navigation.location,{matches:te,loaderData:Se,errors:Ce,fetchers:k})):(Ae({errors:Ce,loaderData:Mn(w.loaderData,Se,te,Ce),fetchers:k}),oe=!1)}async function Ve(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Je(t,rr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=En(e.history,i,m.signal);if(l){let e=await _t(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Ye(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Ye(t,n,In(404,{pathname:i}),{flushSync:u});return}}let g=$n(s,i);le.set(t,m);let _=ue,v=await Ue(h,i,_n(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(le.get(t)===m&&le.delete(t),!h.signal.aborted){if(xe.has(t)){Je(t,ar(void 0));return}if(Gn(y)){if(me>_){Je(t,ar(void 0));return}ve.add(t),await He(h,y,!1,{preventScrollReset:d});return}if(Wn(y)){Ye(t,n,y.error);return}Je(t,ar(y.data))}}async function He(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let d=i.response.headers.get(`Location`);O(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Tn(d,p,c,e.history),kt(f,d,p,`allow-explicit`);let m=de(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(qe(d)){let n=he(t,d,!0);e=n.origin!==t.location.origin||Ge(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}ee=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=er(w.navigation));let y=o||s;Ft.has(i.response.status)&&y&&Zn(y.formMethod)?await Pe(h,m,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:a?te:void 0}):await Pe(h,m,{overrideNavigation:tr(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?te:void 0})}async function Ue(e,t,n,r,i){let a,o={};try{a=await vn(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Zn(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Un(r)){let i=r.result;o[t]={type:`redirect`,response:Sn(i,e,t,n,c)}}else o[t]=await xn(r);return o}async function We(e,t,n,r,i){let a=Ue(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ue(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:In(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ke(){oe=!0,ye.forEach((e,t)=>{le.has(t)&&se.add(t),et(t)})}function Je(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),Ae({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Ye(e,t,n,r={}){let i=Pn(w.matches,t),a=new Map(w.fetchers);Qe(a,e),Ae({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Xe(e){return be.set(e,(be.get(e)||0)+1),xe.has(e)&&xe.delete(e),w.fetchers.get(e)||Lt}function Ze(e,t){et(e,t?.reason),Je(e,ar(null))}function Qe(e,t){let n=w.fetchers.get(t);le.has(t)&&!(n&&n.state===`loading`&&ge.has(t))&&et(t),ye.delete(t),ge.delete(t),ve.delete(t),xe.delete(t),se.delete(t),e.delete(t)}function $e(e){let t=(be.get(e)||0)-1;t<=0?(be.delete(e),xe.add(e)):be.set(e,t),Ae({fetchers:new Map(w.fetchers)})}function et(e,t){let n=le.get(e);n&&(n.abort(t),le.delete(e))}function tt(e,t){for(let n of e){let e=t.get(n);O(e,`Expected fetcher: ${n}`);let r=ar(e.data);t.set(n,r)}}function nt(e){let t=[],n=!1;for(let r of ve){let i=e.get(r);O(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ve.delete(r),t.push(r),n=!0)}return tt(t,e),n}function rt(e,t){let n=[];for(let[r,i]of ge)if(i<e){let e=t.get(r);O(e,`Expected fetcher: ${r}`),e.state===`loading`&&(et(r),ge.delete(r),n.push(r))}return tt(n,t),n.length>0}function it(e,t){let n=w.blockers.get(e)||Rt;return k.get(e)!==t&&k.set(e,t),n}function at(e){w.blockers.delete(e),k.delete(e)}function ot(e,t){let n=w.blockers.get(e)||Rt;O(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),Ae({blockers:r})}function st({currentLocation:e,nextLocation:t,historyAction:n}){if(k.size===0)return;k.size>1&&ce(!1,`A router only supports one blocker at a time`);let r=Array.from(k.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function ct(e){let t=In(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Fn(n);return{notFoundMatches:r,route:i,error:t}}function lt(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===It){_=!0;let e=pt(w.location,w.matches);e!=null&&Ae({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function dt(e,t){return h&&h(e,t.map(e=>Ee(e,w.loaderData)))||e.key}function ft(e,t){if(m&&g){let n=dt(e,t);m[n]=g()}}function pt(e,t){if(m){let n=dt(e,t),r=m[n];if(typeof r==`number`)return r}return null}function mt(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Te(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Te(n,r,c,!0,e)}}return{active:!1,matches:null}}async function _t(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||rn(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=Te(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Te(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&vt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Te(s.activeRoutes,n,c,!0,u),!f||vt(l,f))return{type:`success`,matches:null};l=f}}function vt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function yt(e){o={},s.setHmrRoutes(Se(e,a,void 0,o))}function bt(e,t,n=!1){rn(e,t,s,o,a,n),s.hasHMRRoutes||Ae({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:De,subscribe:ke,enableScrollRestoration:lt,navigate:Me,fetch:ze,revalidate:Ne,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Xe,resetFetcher:Ze,deleteFetcher:$e,dispose:Oe,getBlocker:it,deleteBlocker:at,patchRoutes:bt,_internalFetchControllers:le,_internalSetRoutes:yt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Ae(e)}},e.instrumentations&&(C=gt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Jt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Yt(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=$e(r||`.`,Qe(o),Ge(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Qn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Ke({basename:n,pathname:c.pathname})),fe(c)}function Xt(e,t,n){if(!n||!Jt(n))return{path:t};if(n.formMethod&&!Xn(n.formMethod))return{path:t,error:In(405,{method:n.formMethod})};let r=()=>({path:t,error:In(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Rn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Zn(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
10
- `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Zn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}O(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=On(n.formData),s=n.formData;else if(n.body instanceof FormData)o=On(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=kn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=kn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Zn(c.formMethod))return{path:t,submission:c};let l=pe(t);return e&&l.search&&Qn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:fe(l),submission:c}}function Zt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Wn(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Wn(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,ee={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},te=dt(o),ne=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!Qt(s))f=!1;else if(u){let{shouldLoad:e}=$t(s,a.loaderData,a.errors);f=e}else en(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return gn(n,r,e,c,te,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?tn(a.matches[o],i)&&(p=!0):p=!0;let m={...ee,defaultShouldRevalidate:p},h=nn(i,m);return gn(n,r,e,c,te,i,l,t,h,m,x)}),re=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=Te(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;re.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=$n(b,e.path),C=new AbortController,w=En(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=_n(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=_n(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...ee,defaultShouldRevalidate:i};nn(S,a)&&(T=_n(n,r,w,e.path,b,S,l,t,a))}T&&re.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:ne,revalidatingFetchers:re}}function Qt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function $t(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Qt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function en(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function tn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function nn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function rn(e,t,n,r,i,a){let o;if(e){let t=r[e];O(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>an(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Se(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Se([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function an(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>an(e,t)))??!1}var on=new WeakMap,sn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(O(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=on.get(i);o||(o={},on.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ye(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)ce(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)ce(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},cn=new WeakMap;function ln(e,t,n,r,i){let a=n[e.id];if(O(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=cn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{O(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=xe(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?ce(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?ce(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return cn.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=sn({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function un(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function dn(e){return e.matches.some(e=>e.route.middleware)?fn(e,()=>un(e)):un(e)}function fn(e,t){return pn(e,t,e=>{if(Yn(e))throw e;return e},Vn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Pn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function pn(e,t,n,r,i){let{matches:a,...o}=e;return await mn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function mn(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await mn(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function hn(e,t,n,r,i){let a=sn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=ln(r.route,Zn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function gn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=hn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?nn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?nn(a,{...l,defaultShouldRevalidate:e}):nn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Zn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Zn(n.method)||!p)?yn({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function _n(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?gn(e,t,n,r,dt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:hn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function vn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Dn(t,n),pattern:dt(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return fn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function yn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Zn(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Dn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw In(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw In(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function bn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function xn(e){let{result:t,type:n}=e;if(qn(t)){let e;try{e=await bn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new lt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Kn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Bn(t),statusCode:ut(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ut(t)?t.status:void 0}:Kn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Sn(e,t,n,r,i){let a=e.headers.get(`Location`);if(O(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!qe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Yt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Cn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function wn(e){try{return Cn.includes(new URL(e).protocol)}catch{return!1}}function Tn(e,t,n,r){if(qe(e)){let r=e,i=re.test(r)?new URL(ie(r,t.protocol)):new URL(r);if(wn(i.toString()))throw Error(`Invalid redirect location`);let a=Ge(i.pathname,n)!=null;if(i.origin===t.origin&&a)return et(i.pathname)+i.search+i.hash}try{if(wn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function En(e,t,n,r){let i=e.createURL(Rn(t)).toString(),a={signal:n};if(r&&Zn(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?On(r.formData):r.formData}return new Request(i,a)}function Dn(e,t){let n=new URL(e.url),r=typeof t==`string`?pe(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function On(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function kn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function An(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Wn(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(O(!Gn(f),`Cannot handle redirect results in processLoaderData`),Wn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Pn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Vt),c||(c=!0,s=ut(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function jn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=An(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(O(s,`Did not find corresponding fetcher result`),Wn(s)){let t=Pn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Gn(s))O(!1,`Unhandled fetcher revalidation redirect`);else{let e=ar(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Mn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Vt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Nn(e){return e?Wn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Pn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Fn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function In(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new lt(e||500,o,Error(s),!0)}function Ln(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Gn(r))return{key:n,result:r}}}function Rn(e){return fe({...typeof e==`string`?pe(e):e,hash:``})}function zn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Bn(e){return new lt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Vn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Hn(t))}function Hn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Un(e){return qn(e.result)&&Pt.has(e.result.status)}function Wn(e){return e.type===`error`}function Gn(e){return(e&&e.type)===`redirect`}function Kn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function qn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Jn(e){return Pt.has(e)}function Yn(e){return qn(e)&&Jn(e.status)&&e.headers.has(`Location`)}function Xn(e){return Nt.has(e.toUpperCase())}function Zn(e){return jt.has(e.toUpperCase())}function Qn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function $n(e,t){let n=typeof t==`string`?pe(t).search:t.search;if(e[e.length-1].route.index&&Qn(n||``))return e[e.length-1];let r=Ze(e);return r[r.length-1]}function er(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function tr(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function nr(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function rr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ir(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ar(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function or(e,t){try{let n=e.sessionStorage.getItem(Bt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function sr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Bt,JSON.stringify(n))}catch(e){ce(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function cr(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var lr=v.createContext(null);lr.displayName=`DataRouter`;var ur=v.createContext(null);ur.displayName=`DataRouterState`;var dr=v.createContext(!1);function fr(){return v.useContext(dr)}var pr=v.createContext({isTransitioning:!1});pr.displayName=`ViewTransition`;var mr=v.createContext(new Map);mr.displayName=`Fetchers`;var hr=v.createContext(null);hr.displayName=`Await`;var gr=v.createContext(null);gr.displayName=`Navigation`;var _r=v.createContext(null);_r.displayName=`Location`;var vr=v.createContext({outlet:null,matches:[],isDataRoute:!1});vr.displayName=`Route`;var yr=v.createContext(null);yr.displayName=`RouteError`;var br=`REACT_ROUTER_ERROR`,xr=`REDIRECT`,Sr=`ROUTE_ERROR_RESPONSE`;function Cr(e){if(e.startsWith(`${br}:${xr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function wr(e){if(e.startsWith(`${br}:${Sr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new lt(t.status,t.statusText,t.data)}catch{}}function Tr(e,{relative:t}={}){O(Er(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(gr),{hash:i,pathname:a,search:o}=Mr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:tt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Er(){return v.useContext(_r)!=null}function Dr(){return O(Er(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(_r).location}var Or=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function kr(e){v.useContext(gr).static||v.useLayoutEffect(e)}function Ar(){let{isDataRoute:e}=v.useContext(vr);return e?Xr():jr()}function jr(){O(Er(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(lr),{basename:t,navigator:n}=v.useContext(gr),{matches:r}=v.useContext(vr),{pathname:i}=Dr(),a=JSON.stringify(Qe(r)),o=v.useRef(!1);return kr(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(ce(o.current,Or),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$e(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:tt([t,c.pathname])),kt(typeof r==`string`?r:fe(r),n.createHref(c),Et(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function Mr(e,{relative:t}={}){let{matches:n}=v.useContext(vr),{pathname:r}=Dr(),i=JSON.stringify(Qe(n));return v.useMemo(()=>$e(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Nr(e,t,n){O(Er(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(gr),{matches:i}=v.useContext(vr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Qr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
-
12
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Dr(),d;if(t){let e=typeof t==`string`?pe(t):t;O(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):we(e,{pathname:p});ce(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),ce(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Br(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:tt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:tt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(_r.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Pr(){let e=qr(),t=ut(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var Fr=v.createElement(Pr,null),Ir=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=wr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(vr.Provider,{value:this.props.routeContext},v.createElement(yr.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(Rr,{error:e},t):t}};Ir.contextType=dr;var Lr=new WeakMap;function Rr({children:e,error:t}){let{basename:n,navigator:r}=v.useContext(gr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Cr(t.digest);if(e){let i=Lr.get(t);if(i)throw i;let a=pt(e.location,n),o=a.absoluteURL||a.to;if(kt(e.location,o,Et(r),`allow-explicit`),wn(o))throw Error(`Invalid redirect location`);if(ft&&!Lr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Lr.set(t,n),n}}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function zr({routeContext:e,match:t,children:n}){let r=v.useContext(lr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(vr.Provider,{value:e},n)}function Br(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);O(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:dt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Fr,o&&(s<0&&c===0?(Qr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(zr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(Ir,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Vr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hr(e){let t=v.useContext(lr);return O(t,Vr(e)),t}function Ur(e){let t=v.useContext(ur);return O(t,Vr(e)),t}function Wr(e){let t=v.useContext(vr);return O(t,Vr(e)),t}function Gr(e){let t=Wr(e),n=t.matches[t.matches.length-1];return O(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Kr(){return Gr(`useRouteId`)}function qr(){let e=v.useContext(yr),t=Ur(`useRouteError`),n=Gr(`useRouteError`);return e===void 0?t.errors?.[n]:e}var Jr=0;function Yr(e){let{router:t,basename:n}=Hr(`useBlocker`),r=Ur(`useBlocker`),[i,a]=v.useState(``),o=v.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:Ge(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:Ge(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return v.useEffect(()=>{let e=String(++Jr);return a(e),()=>t.deleteBlocker(e)},[t]),v.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Rt}function Xr(){let{router:e}=Hr(`useNavigate`),t=Gr(`useNavigate`),n=v.useRef(!1);return kr(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{ce(n.current,Or),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Zr={};function Qr(e,t,n){!t&&!Zr[e]&&(Zr[e]=!0,ce(!1,n))}var $r={};function ei(e,t){!e&&!$r[t]&&($r[t]=!0,console.warn(t))}var ti=v.useOptimistic,ni=()=>void 0;function ri(e){return ti?ti(e):[e,ni]}function ii(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ce(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ce(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ce(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var ai=[`HydrateFallback`,`hydrateFallbackElement`],oi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function si({router:e,flushSync:t,onError:n,useTransitions:r}){r=fr()||r;let[i,a]=v.useState(e.state),[o,s]=ri(i),[c,l]=v.useState(),[u,d]=v.useState({isTransitioning:!1}),[f,p]=v.useState(),[m,h]=v.useState(),[g,_]=v.useState(),y=v.useRef(new Map),b=v.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:dt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),ei(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ei(g==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!b){t&&u?t(()=>a(i)):r===!1?a(i):v.startTransition(()=>{r===!0&&s(e=>ci(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);v.useLayoutEffect(()=>e.subscribe(b),[e,b]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new oi)},[u]),v.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):v.startTransition(()=>{r===!0&&s(e=>ci(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),v.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),v.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=v.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=v.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return v.createElement(v.Fragment,null,v.createElement(lr.Provider,{value:C},v.createElement(ur.Provider,{value:o},v.createElement(mr.Provider,{value:y.current},v.createElement(pr.Provider,{value:u},v.createElement(di,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},v.createElement(li,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function ci(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var li=v.memo(ui);function ui({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Nr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function di({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){O(!Er(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=pe(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=Ge(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return ce(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(gr.Provider,{value:c},v.createElement(_r.Provider,{children:t,value:h}))}v.Component;var fi=`get`,pi=`application/x-www-form-urlencoded`;function mi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function hi(e){return mi(e)&&e.tagName.toLowerCase()===`button`}function gi(e){return mi(e)&&e.tagName.toLowerCase()===`form`}function _i(e){return mi(e)&&e.tagName.toLowerCase()===`input`}function vi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yi(e,t){return e.button===0&&(!t||t===`_self`)&&!vi(e)}var bi=null;function xi(){if(bi===null)try{new FormData(document.createElement(`form`),0),bi=!1}catch{bi=!0}return bi}var Si=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ci(e){return e!=null&&!Si.has(e)?(ce(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pi}"`),null):e}function wi(e,t){let n,r,i,a,o;if(gi(e)){let o=e.getAttribute(`action`);r=o?Ge(o,t):null,n=e.getAttribute(`method`)||fi,i=Ci(e.getAttribute(`enctype`))||pi,a=new FormData(e)}else if(hi(e)||_i(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ge(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||fi,i=Ci(e.getAttribute(`formenctype`))||Ci(o.getAttribute(`enctype`))||pi,a=new FormData(o,e),!xi()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(mi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=fi,r=null,i=pi,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ti(e,t){if(e===!1||e==null)throw Error(t)}function Ei(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ge(i.pathname,t)===`/`?`${nt(t)}/_root.${r}`:`${nt(i.pathname)}.${r}`,i}async function Di(e,t){if(e.id in t)return t[e.id];try{let n=await w(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Oi(e){return e!=null&&typeof e.page==`string`}function ki(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ai(e,t,n){return Fi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Di(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ki).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ji(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Mi(e,t,{includeHydrateFallback:n}={}){return Ni(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ni(e){return[...new Set(e)]}function Pi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Fi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Oi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Pi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ii(){let e=v.useContext(lr);return Ti(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Li(){let e=v.useContext(ur);return Ti(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ri=v.createContext(void 0);Ri.displayName=`FrameworkContext`;function zi(){let e=v.useContext(Ri);return Ti(e,`You must render this element inside a <HydratedRouter> element`),e}function Bi(e,t){let n=v.useContext(Ri),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Vi(s,p),onBlur:Vi(c,m),onMouseEnter:Vi(l,p),onMouseLeave:Vi(u,m),onTouchStart:Vi(d,p)}]:[a,f,{}]:[!1,f,{}]}function Vi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Hi({page:e,...t}){let n=fr(),{nonce:r}=zi(),{router:i}=Ii(),a=v.useMemo(()=>we(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(Wi,{page:e,matches:a,...t}):v.createElement(Gi,{page:e,matches:a,...t})):null}function Ui(e){let{manifest:t,routeModules:n}=zi(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return Ai(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Wi({page:e,matches:t,...n}){let r=Dr(),{future:i}=zi(),{basename:a}=Ii(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ei(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Gi({page:e,matches:t,...n}){let r=Dr(),{future:i,manifest:a,routeModules:o}=zi(),{basename:s}=Ii(),{loaderData:c,matches:l}=Li(),u=v.useMemo(()=>ji(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>ji(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Ei(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>Mi(d,a),[d,a]),m=Ui(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ki(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var qi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{qi&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Ji(e,t){return qt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:se({window:t?.window}),hydrationData:t?.hydrationData||Yi(),routes:e,mapRouteProperties:ii,hydrationRouteProperties:ai,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Yi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Xi(e.errors)}),e}function Xi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new lt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&ct.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var Zi=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(gr),y=typeof l==`string`&&ne.test(l),b=pt(l,h);l=b.to;let x=Tr(l,{relative:r}),S=Dr(),C=null;if(o){let e=$e(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:tt([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Bi(n,p),D=na(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ee(t){e&&e(t),t.defaultPrevented||D(t)}let te=!(b.isExternal||i),re=v.createElement(`a`,{...p,...E,href:(te?C:void 0)||b.absoluteURL||x,onClick:te?ee:e,ref:Ki(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,re,v.createElement(Hi,{page:x})):re});Zi.displayName=`Link`;var Qi=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Mr(a,{relative:c.relative}),d=Dr(),f=v.useContext(ur),{navigator:p,basename:m}=v.useContext(gr),h=f!=null&&sa(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ge(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(Zi,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Qi.displayName=`NavLink`;var $i=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=fi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(gr),g=aa(),_=oa(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ne.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});$i.displayName=`Form`;function ea(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ta(e){let t=v.useContext(lr);return O(t,ea(e)),t}function na(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Ar(),d=Dr(),f=Mr(e,{relative:o});return v.useCallback(p=>{if(yi(p,t)){p.preventDefault();let t=n===void 0?fe(d)===fe(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var ra=0,ia=()=>`__${String(++ra)}__`;function aa(){let{router:e}=ta(`useSubmit`),{basename:t}=v.useContext(gr),n=Kr(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=wi(e,t);if(a.navigate===!1){let e=a.fetcherKey||ia();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function oa(e,{relative:t}={}){let{basename:n}=v.useContext(gr),r=v.useContext(vr);O(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Mr(e||`.`,{relative:t})},o=Dr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:tt([n,a.pathname])),fe(a)}function sa(e,{relative:t}={}){let n=v.useContext(pr);O(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ta(`useViewTransitionState`),i=Mr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ge(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ge(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ve(i.pathname,o)!=null||Ve(i.pathname,a)!=null}function ca(e){return v.createElement(si,{flushSync:y.flushSync,...e})}var A=e=>typeof e==`string`,la=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ua=e=>e==null?``:``+e,da=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},fa=/###/g,pa=e=>e&&e.indexOf(`###`)>-1?e.replace(fa,`.`):e,j=e=>!e||A(e),ma=(e,t,n)=>{let r=A(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(j(e))return{};let t=pa(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return j(e)?{}:{obj:e,k:pa(r[i])}},ha=(e,t,n)=>{let{obj:r,k:i}=ma(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=ma(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ma(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},ga=(e,t,n,r)=>{let{obj:i,k:a}=ma(e,t,Object);i[a]=i[a]||[],i[a].push(n)},_a=(e,t)=>{let{obj:n,k:r}=ma(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},va=(e,t,n)=>{let r=_a(e,n);return r===void 0?_a(t,n):r},ya=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?A(e[r])||e[r]instanceof String||A(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ya(e[r],t[r],n):e[r]=t[r]);return e},ba=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),xa={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Sa=e=>A(e)?e.replace(/[&<>"'\/]/g,e=>xa[e]):e,Ca=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},wa=[` `,`,`,`?`,`!`,`;`],Ta=new Ca(20),Ea=(e,t,n)=>{t||=``,n||=``;let r=wa.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Ta.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Da=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Oa=e=>e?.replace(/_/g,`-`),ka={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Aa=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||ka,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(A(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ja=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},Ma=class extends ja{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):A(n)&&i?o.push(...n.split(i)):o.push(n)));let s=_a(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!A(n)?s:Da(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),ha(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(A(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=_a(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ya(s,n,i):s={...s,...n},ha(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Na={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Pa=Symbol(`i18next/PATH_KEY`);function Fa(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Pa?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ia(e,t){let{[Pa]:n}=e(Fa()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var La={},Ra=e=>!A(e)&&typeof e!=`boolean`&&typeof e!=`number`,za=class e extends ja{constructor(e,t={}){super(),da([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Aa.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Ra(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Ea(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:A(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Ia(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Ia(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!A(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=Ra(E),ee=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(ee)<0&&!(A(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Ra(T)?T[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&A(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=A(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!A(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=A(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Na.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return A(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Ia(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!A(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(A(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!La[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(La[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!A(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},Ba=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Aa.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Oa(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Oa(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),A(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return A(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):A(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Va={zero:0,one:1,two:2,few:3,many:4,other:5},Ha={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Ua=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Aa.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Oa(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Ha;if(!e.match(/-|_/))return Ha;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Va[e]-Va[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Wa=(e,t,n,r=`.`,i=!0)=>{let a=va(e,t,n);return!a&&i&&A(n)&&(a=Da(e,n,r),a===void 0&&(a=Da(t,n,r))),a},Ga=e=>e.replace(/\$/g,`$$$$`),Ka=class{constructor(e={}){this.logger=Aa.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Sa:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?ba(i):a||`{{`,this.suffix=o?ba(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?ba(d):f||ba(`$t(`),this.nestingSuffix=p?ba(p):m||ba(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Wa(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Wa(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Ga(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Ga(this.escape(e)):Ga(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=A(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!A(a)&&!this.useRawValueToEscape&&(a=ua(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${ba(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!A(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!A(i))return i;A(i)||(i=ua(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},qa=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Ja=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Oa(r),i),t[o]=s),s(n)}},Ya=e=>(t,n,r)=>e(Oa(n),r)(t),Xa=class{constructor(e={}){this.logger=Aa.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Ja:Ya;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ja(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=qa(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Za=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Qa=class extends ja{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Aa.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{ga(n.loaded,[i],a),Za(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();A(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},$a=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),A(e[1])&&(t.defaultValue=e[1]),A(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),eo=e=>(A(e.ns)&&(e.ns=[e.ns]),A(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),to=()=>{},no=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ro=`__i18next_supportNoticeShown`,io=()=>!!(typeof globalThis<`u`&&globalThis[ro]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),ao=()=>{typeof globalThis<`u`&&(globalThis[ro]=!0)},oo=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),so=class e extends ja{constructor(e={},t){if(super(),this.options=eo(e),this.services={},this.logger=Aa,this.modules={external:[]},no(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(A(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=$a();this.options={...n,...this.options,...eo(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!oo(this)&&!io()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),ao());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Aa.init(r(this.modules.logger),this.options):Aa.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Xa;let t=new Ba(this.options);this.store=new Ma(this.options.resources,this.options);let i=this.services;i.logger=Aa,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Ua(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Ka(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Qa(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new za(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=to,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=la(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=to){let n=t,r=A(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=la();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=to,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Na.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=la();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=A(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(A(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=Ia(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=Ia(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=Ia(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return A(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=la();return this.options.ns?(A(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=la();A(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Ba($a());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=to){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Ma(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...$a().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ka(n)}return a.translator=new za(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();so.createInstance,so.dir,so.init,so.loadResources,so.reloadResources,so.use,so.changeLanguage,so.getFixedT,so.t,so.exists,so.setDefaultNamespace,so.hasLoadedNamespace,so.loadNamespaces,so.loadLanguages;var co=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);go(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},lo={},uo=(e,t,n,r)=>{go(n)&&lo[n]||(go(n)&&(lo[n]=new Date),co(e,t,n,r))},fo=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},po=(e,t,n)=>{e.loadNamespaces(t,fo(e,n))},mo=(e,t,n,r)=>{if(go(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return po(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,fo(e,r))},ho=(e,t,n={})=>!t.languages||!t.languages.length?(uo(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),go=e=>typeof e==`string`,_o=e=>typeof e==`object`&&!!e,vo=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yo={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},bo=e=>yo[e],xo={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(vo,bo),transDefaultProps:void 0},So=(e={})=>{xo={...xo,...e}},Co=()=>xo,wo,To=e=>{wo=e},Eo=()=>wo,Do={type:`3rdParty`,init(e){So(e.options.react),To(e)}},Oo=(0,v.createContext)(),ko=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},Ao=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),jo=o(((e,t)=>{t.exports=Ao()})),Mo=jo(),No={t:(e,t)=>{if(go(t))return t;if(_o(t)&&go(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},Po=()=>()=>{},Fo=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,v.useContext)(Oo)||{},a=n||r||Eo();a&&!a.reportNamespaces&&(a.reportNamespaces=new ko),a||uo(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,v.useMemo)(()=>({...Co(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=go(l)?[l]:l||[`translation`],d=(0,v.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,v.useRef)(0),p=(0,v.useCallback)(e=>{if(!a)return Po;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,v.useRef)(),h=(0,v.useCallback)(()=>{if(!a)return No;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>ho(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,v.useState)(0),{t:y,ready:b}=(0,Mo.useSyncExternalStore)(p,h,h);(0,v.useEffect)(()=>{if(a&&!b&&!s){let e=()=>_(e=>e+1);t.lng?mo(a,t.lng,d,e):po(a,d,e)}},[a,t.lng,d,b,s,g]);let x=a||{},S=(0,v.useRef)(null),C=(0,v.useRef)(),w=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},T=(0,v.useMemo)(()=>{let e=x,t=e?.language,n=e;e&&(S.current&&S.current.__original===e&&C.current===t?n=S.current:(n=w(e),S.current=n,C.current=t));let r=!b&&!s?(...e)=>(uo(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),y(...e)):y,i=[r,n,b];return i.t=r,i.i18n=n,i.ready=b,i},[y,x,b,x.resolvedLanguage,x.language,x.languages]);if(a&&s&&!b)throw new Promise(e=>{let n=()=>e();t.lng?mo(a,t.lng,d,n):po(a,d,n)});return T},Io={en:{translation:{"app.failed":`NiceEval View failed to load`,"executionTrace.title":`Execution events`,"executionTrace.stableId":`Stable event or evidence ID`,"executionTrace.openEvent":`Open event`,"executionTrace.openEvidence":`Open evidence`,"executionTrace.nextPage":`Next event page`,"executionTrace.firstPage":`First event page`,"executionTrace.nextBytes":`Next evidence chunk`,"executionTrace.omitted":`{{count}} events remaining`,"executionTrace.byteRange":`UTF-8 preview from byte {{offset}} of {{total}}`,"nav.experiments":`Experiments`,"nav.language":`Language`,"nav.pages":`Report pages`,"insight.title":`NiceEval Insight`,"insight.navigation":`Insight`,"insight.chart.cost":`Cost`,"insight.chart.passRate":`Pass rate`,"insight.chart.score":`Score`,"insight.chart.noData":`No chartable data`,"insight.chart.partial":`partial data`,"insight.chart.openExperiment":`open experiment`,"verdict.passed":`passed`,"verdict.scored":`scored`,"verdict.failed":`failed`,"verdict.errored":`errored`,"verdict.skipped":`skipped`,"cell.missing":`no data`,"cell.unscorable":`unscorable`,"cell.noCurrentResult":`no result for current config`,"cell.metricFailed":`failed`,"cell.metricUnavailable":`unavailable`,"cell.metricUnsupported":`unsupported`,"cell.metricMigrationRequired":`migration required`,"cell.measuredTitle":`{{samples}}/{{total}} attempts measured`,"cell.noneMeasurableTitle":`0/{{total}} attempts measurable`,"cell.coverageTitle":`coverage {{samples}}/{{total}}: this metric is null for the remaining attempts`,"cell.coverageDetail":`Result coverage {{samples}}/{{total}}`,"cell.partialTitle":`This value is a known subtotal because some underlying observations are unavailable`,"cell.partialDetail":`partial`,"cell.costReported":`reported`,"cell.costEstimated":`estimated`,"cell.costMixed":`reported + estimated`,"usage.external":`External call usage`,"usage.input":`Input tokens (excluding cache)`,"usage.output":`Output tokens`,"usage.requests":`Requests`,"usage.calls":`Recorded calls`,"usage.prices":`Sealed pricing evidence`,"usage.coverage":`{{covered}}/{{total}} calls fully costed`,"cell.evidence":`{{n}} attempts`,"table.model":`Model`,"cell.mixedExecution":`mixed`,"table.adapter":`Adapter`,"table.filterPlaceholder":`Filter rows…`,"experimentList.experiment":`Experiment`,"experimentList.avgDuration":`Avg. time`,"experimentList.passRate":`Pass rate`,"experimentList.totalScore":`Total score`,"experimentList.missedScoreItems":`{{n}} missed checks`,"experimentList.tokens":`Tokens`,"experimentList.cost":`Cost`,"experimentList.result":`Result`,"experimentList.status":`Status`,"experimentList.filterPlaceholder":`Filter experiments…`,"report.close":`Close`,"report.details":`Details`,"report.loading":`Loading…`,"report.loadingDetails":`Loading details…`,"report.backToResults":`Back to results`,"report.retry":`Retry`,"report.unableToLoad":`Unable to load this page.`,"report.unableToLoadDetails":`Unable to load details.`,"attempt.title":`Attempt`,"attempt.experiment":`Experiment`,"attempt.adapter":`Adapter`,"attempt.adapterRevisionNotDeclared":`revision not declared`,"attempt.eval":`Eval`,"attempt.score":`Score`,"attempt.scoreCompleted":`Score completed`,"attempt.started":`Started`,"attempt.duration":`Duration`,"attempt.cost":`Cost`,"attempt.assertions":`Assertions`,"attempt.traceDetails":`Trace details`,"attempt.traceItem":`item {{id}}`,"attempt.traceTool":`tool {{id}}`,"attempt.traceCommand":`command {{id}}`,"attempt.executionTimeline":`Execution timeline`,"attempt.usage":`Usage`,"attempt.sources":`Sources`,"attempt.fileChanges":`File changes`,"attempt.artifacts":`Artifacts`,"attempt.loadOnDemand":`Expand or select to load.`,"attempt.artifactsNone":`No artifacts were recorded.`,"attempt.artifactsRetained_one":`{{count}} retained content item`,"attempt.artifactsRetained_other":`{{count}} retained content items`,"attempt.truncated":`(truncated)`,"attempt.verdict.passed":`passed`,"attempt.verdict.failed":`failed`,"attempt.verdict.errored":`errored`,"attempt.verdict.skipped":`skipped`,"attempt.verdict.unknown":`unknown`,"refresh.action":`Refresh`,"refresh.available":`An update with newer sealed results is available.`,"refresh.failed":`Refresh failed. The current result is still available.`,"refresh.reload":`Reload`,"refresh.reloadRequired":`Reload NiceEval View`,"refresh.reloadRequiredDetail":`The refresh result could not be confirmed. Reload before continuing to review results.`,"refresh.working":`Refreshing…`,"refresh.selectionChanged":`The previous selection is no longer available. Showing the nearest available result.`}},"zh-CN":{translation:{"app.failed":`NiceEval 视图载入失败`,"executionTrace.title":`执行事件`,"executionTrace.stableId":`稳定事件或证据 ID`,"executionTrace.openEvent":`打开事件`,"executionTrace.openEvidence":`打开证据`,"executionTrace.nextPage":`下一页事件`,"executionTrace.firstPage":`第一页事件`,"executionTrace.nextBytes":`下一段证据`,"executionTrace.omitted":`尚有 {{count}} 条事件`,"executionTrace.byteRange":`UTF-8 预览,从第 {{offset}} 字节开始,共 {{total}} 字节`,"nav.experiments":`实验`,"nav.language":`语言`,"nav.pages":`报告页面`,"insight.title":`NiceEval Insight`,"insight.navigation":`洞察`,"insight.chart.cost":`成本`,"insight.chart.passRate":`通过率`,"insight.chart.score":`得分`,"insight.chart.noData":`暂无可绘制的数据`,"insight.chart.partial":`部分数据`,"insight.chart.openExperiment":`打开实验`,"verdict.passed":`通过`,"verdict.scored":`评分完成`,"verdict.failed":`失败`,"verdict.errored":`错误`,"verdict.skipped":`跳过`,"cell.missing":`无数据`,"cell.unscorable":`测不出`,"cell.noCurrentResult":`当前配置下无结果`,"cell.metricFailed":`读取失败`,"cell.metricUnavailable":`不可用`,"cell.metricUnsupported":`不支持`,"cell.metricMigrationRequired":`需要迁移`,"cell.measuredTitle":`{{samples}}/{{total}} 次 attempt 测得`,"cell.noneMeasurableTitle":`0/{{total}} 次 attempt 可测`,"cell.coverageTitle":`覆盖率 {{samples}}/{{total}}:其余 attempt 测不了这个指标`,"cell.coverageDetail":`结果完整度 {{samples}}/{{total}}`,"cell.partialTitle":`部分底层观测不可用,此值是已知小计`,"cell.partialDetail":`部分`,"cell.costReported":`回执金额`,"cell.costEstimated":`估算金额`,"cell.costMixed":`回执金额 + 估算`,"usage.external":`外部调用用量`,"usage.input":`输入 token(不含缓存)`,"usage.output":`输出 token`,"usage.requests":`请求数`,"usage.calls":`已保存调用`,"usage.prices":`封存价格证据`,"usage.coverage":`{{covered}}/{{total}} 个调用成本完整`,"cell.evidence":`{{n}} 个 Attempt`,"table.model":`模型`,"cell.mixedExecution":`混合`,"table.adapter":`Adapter`,"table.filterPlaceholder":`筛选行…`,"experimentList.experiment":`实验`,"experimentList.avgDuration":`平均耗时`,"experimentList.passRate":`通过率`,"experimentList.totalScore":`总分`,"experimentList.missedScoreItems":`{{n}} 项未满足`,"experimentList.tokens":`Tokens`,"experimentList.cost":`成本`,"experimentList.result":`结果`,"experimentList.status":`状态`,"experimentList.filterPlaceholder":`筛选实验…`,"report.close":`关闭`,"report.details":`详情`,"report.loading":`正在加载…`,"report.loadingDetails":`正在加载详情…`,"report.backToResults":`返回结果`,"report.retry":`重试`,"report.unableToLoad":`无法加载此页面。`,"report.unableToLoadDetails":`无法加载详情。`,"attempt.title":`尝试`,"attempt.experiment":`实验`,"attempt.adapter":`Adapter`,"attempt.adapterRevisionNotDeclared":`未声明修订`,"attempt.eval":`评测`,"attempt.score":`得分`,"attempt.scoreCompleted":`评分完成`,"attempt.started":`开始时间`,"attempt.duration":`耗时`,"attempt.cost":`成本`,"attempt.assertions":`断言`,"attempt.traceDetails":`轨迹详情`,"attempt.traceItem":`项目 {{id}}`,"attempt.traceTool":`工具 {{id}}`,"attempt.traceCommand":`命令 {{id}}`,"attempt.executionTimeline":`执行时间轴`,"attempt.usage":`用量`,"attempt.sources":`来源`,"attempt.fileChanges":`文件变更`,"attempt.artifacts":`产物`,"attempt.loadOnDemand":`展开或选择后载入。`,"attempt.artifactsNone":`未记录产物。`,"attempt.artifactsRetained_one":`保留了 {{count}} 项内容`,"attempt.artifactsRetained_other":`保留了 {{count}} 项内容`,"attempt.truncated":`(已截断)`,"attempt.verdict.passed":`通过`,"attempt.verdict.failed":`失败`,"attempt.verdict.errored":`错误`,"attempt.verdict.skipped":`跳过`,"attempt.verdict.unknown":`未知`,"refresh.action":`刷新`,"refresh.available":`有更新的封存结果可用。`,"refresh.failed":`刷新失败,当前结果仍可继续查看。`,"refresh.reload":`重新加载`,"refresh.reloadRequired":`重新加载 NiceEval 视图`,"refresh.reloadRequiredDetail":`无法确认刷新结果。请先重新加载,再继续审阅结果。`,"refresh.working":`正在刷新…`,"refresh.selectionChanged":`之前的选择已不存在,现已显示最近的可用结果。`}}},Lo=`niceeval:report:locale`;so.use(Do).init({resources:Io,lng:(()=>{try{let e=localStorage.getItem(Lo);if(e===`en`||e===`zh-CN`)return e}catch{}return navigator.language.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`})(),fallbackLng:`en`,supportedLngs:[`en`,`zh-CN`],interpolation:{escapeValue:!1},returnNull:!1}),so.on(`languageChanged`,e=>{document.documentElement.lang=e;try{localStorage.setItem(Lo,e)}catch{}}),document.documentElement.lang=so.resolvedLanguage??`en`;var Ro=so,zo=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Bo=o(((e,t)=>{t.exports=zo()})),M=Bo(),Vo=v.createContext(void 0),Ho=e=>{let t=v.useContext(Vo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Uo=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,M.jsx)(Vo.Provider,{value:e,children:t})),Wo={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Go=new class{#e=Wo;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ko(e){setTimeout(e,0)}var qo=typeof window>`u`||`Deno`in globalThis;function Jo(){}function Yo(e,t){return typeof e==`function`?e(t):e}function Xo(e){return typeof e==`number`&&e>=0&&e!==1/0}function N(e,t){return Math.max(e+(t||0)-Date.now(),0)}function P(e,t){return typeof e==`function`?e(t):e}function Zo(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==$o(o,t.options))return!1}else if(!ts(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Qo(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(es(t.options.mutationKey)!==es(a))return!1}else if(!ts(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function $o(e,t){return(t?.queryKeyHashFn||es)(e)}function es(e){return JSON.stringify(e,(e,t)=>os(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ts(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ts(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ts(e[r],t[r]))return!1;return!0}return!1}var ns=Object.prototype.hasOwnProperty;function rs(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=as(e)&&as(t);if(!r&&!(os(e)&&os(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ns.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=rs(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function is(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function as(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function os(e){if(!ss(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ss(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ss(e){return Object.prototype.toString.call(e)===`[object Object]`}function cs(e){return new Promise(t=>{Go.setTimeout(t,e)})}function ls(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:rs(e,t)}function us(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ds(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fs=Symbol();function ps(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fs?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ms(e,t){return typeof e==`function`?e(...t):!!e}function hs(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var gs=()=>qo,_s=()=>gs(),vs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ys=new class extends vs{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},bs=Ko;function xs(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=bs,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ss=xs(),Cs=new class extends vs{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ws(e){return Math.min(1e3*2**e,3e4)}function Ts(e){return(e??`online`)!==`online`||Cs.isOnline()}var Es=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ds(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Jo);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Es(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ys.isFocused()&&(e.networkMode===`always`||Cs.isOnline())&&e.canRun(),p=()=>Ts(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(_s()?0:3),a=e.retryDelay??ws,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),cs(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Os=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xo(this.gcTime)&&(this.#e=Go.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_s()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Go.clearTimeout(this.#e),this.#e=void 0)}};function ks(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{hs(e,()=>t.signal,()=>n=!0)},u=ps(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ds:us;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?js:As,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:As(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function As(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function js(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ms=class extends Os{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fs(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fs(this.options);e.data!==void 0&&(this.setState(Ps(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ls(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Jo).catch(Jo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>P(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>P(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!N(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ps(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ks(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Ds({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Es&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Es){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ns(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ps(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ss.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ns(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ts(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ps(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fs(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Is=class extends vs{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Rs(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zs(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zs(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof P(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!is(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Bs(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||P(this.options.enabled,this.#t)!==P(t.enabled,this.#t)||P(this.options.staleTime,this.#t)!==P(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||P(this.options.enabled,this.#t)!==P(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return is(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Jo)),t}#h(e){return!_s()&&P(this.options.enabled,this.#t)!==!1&&Xo(e)}#g(){this.#b();let e=P(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=N(this.#r.dataUpdatedAt,e)+1;this.#u=Go.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return P(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Go.setInterval(()=>{(this.options.refetchIntervalInBackground||ys.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Go.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Go.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Rs(e,t),o=i&&Bs(e,n,t,r);(a||o)&&(l={...l,...Ns(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ls(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ls(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Vs(e,t),refetch:this.refetch,isEnabled:P(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),is(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Ss.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ls(e,t){return P(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||P(t.retryOnMount,e)!==!1)}function Rs(e,t){return Ls(e,t)||e.state.data!==void 0&&zs(e,t,t.refetchOnMount)}function zs(e,t,n){if(P(t.enabled,e)!==!1&&P(t.staleTime,e)!==`static`){let r=P(n,e);return r===`always`||r!==!1&&Vs(e,t)}return!1}function Bs(e,t,n,r){return(e!==t||P(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Vs(e,n)}function Vs(e,t){return P(t.enabled,e)!==!1&&e.isStaleByTime(P(t.staleTime,e))}var Hs=class extends Os{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Us(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Ds({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Ss.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Us(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ws=class extends vs{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Hs({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Gs(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Gs(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Gs(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Gs(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ss.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Qo(t,e))}findAll(e={}){return this.getAll().filter(t=>Qo(e,t))}notify(e){Ss.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ss.batch(()=>Promise.all(e.map(e=>e.continue().catch(Jo))))}};function Gs(e){return e.options.scope?.id}function Ks(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var qs=class extends vs{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Ss.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!is(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ks(e,n).forEach(e=>{e.destroy()}),Ks(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=rs(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Is(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Ss.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Js=class extends vs{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??$o(r,t),a=this.get(i);return a||(a=new Ms({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ss.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Zo(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Zo(e,t)):t}notify(e){Ss.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ss.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ss.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ys=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Js,this.#t=e.mutationCache||new Ws,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ys.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Cs.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(P(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Yo(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ss.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ss.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ss.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ss.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Jo).catch(Jo)}invalidateQueries(e,t={}){return Ss.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ss.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Jo)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Jo)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(P(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(P(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jo).catch(Jo)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jo).catch(Jo)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Cs.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(es(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ts(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(es(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ts(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=$o(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===fs&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Xs=v.createContext(!1),Zs=()=>v.useContext(Xs);Xs.Provider;function Qs(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $s=v.createContext(Qs()),ec=()=>v.useContext($s),tc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ms(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},nc=e=>{v.useEffect(()=>{e.clearReset()},[e])},rc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ms(n,[e.error,r])),ic=(e,t)=>t.state.data===void 0,ac=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},oc=(e,t)=>e?.suspense&&t.isPending,sc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function cc({queries:e,...t},n){let r=Ho(n),i=Zs(),a=ec(),o=t.subscribed!==!1,s=v.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{ac(e);let t=r.getQueryCache().get(e.queryHash);tc(e,a,t)}),nc(a);let[c]=v.useState(()=>new qs(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;v.useSyncExternalStore(v.useCallback(e=>f?c.subscribe(Ss.batchCalls(e)):Jo,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>oc(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&oc(n,e)?sc(n,new Is(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&rc({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function lc(e,t,n){let r=Zs(),i=ec(),a=Ho(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ac(o),tc(o,i,s),nc(i);let[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(Ss.batchCalls(e)):Jo;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),oc(o,u))throw sc(o,l,i);if(rc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function uc(e,t){return lc(e,Is,t)}function dc(e,t){return lc({...e,enabled:!0,suspense:!0,throwOnError:ic,placeholderData:void 0},Is,t)}function fc(e){return e}var pc=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},mc={pipe(){return pc(this,arguments)}},hc=function(){function e(){}return e.prototype=mc,e}(),gc=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},_c=e=>e,vc=(e=>()=>e)(void 0),yc=vc;function bc(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function xc(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var Sc=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Cc=new WeakSet;function wc(e){return typeof e==`string`}function Tc(e){return typeof e==`number`}function Ec(e){return typeof e==`boolean`}function Dc(e){return typeof e==`symbol`}function Oc(e){return wc(e)||Tc(e)||Dc(e)}function kc(e){return typeof e==`function`}function Ac(e){return e!==void 0}function jc(e){return e!=null}function Mc(e){return!1}function Nc(e){return!0}function Pc(e){return typeof e==`object`&&!!e||kc(e)}var Fc=gc(2,(e,t)=>Pc(e)&&t in e),Ic=`~effect/interfaces/Hash`,Lc=e=>{switch(typeof e){case`number`:return Hc(e);case`bigint`:return Uc(e.toString(10));case`boolean`:return Uc(String(e));case`symbol`:return Uc(String(e));case`string`:return Uc(e);case`undefined`:return Uc(`undefined`);case`function`:case`object`:if(e===null)return Uc(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?Uc(`Invalid Date`):Uc(e.toISOString());if(e instanceof RegExp)return Uc(e.toString());{if(Cc.has(e))return Rc(e);if(Zc.has(e))return Zc.get(e);let t=$c(e,()=>Vc(e)?e[Ic]():typeof e==`function`?Rc(e):e instanceof DataView?qc(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?qc(e):e instanceof Map?Jc(e):e instanceof Set?Yc(e):Gc(e));return Zc.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Rc=e=>(Xc.has(e)||Xc.set(e,Hc(Math.floor(Math.random()*(2**53-1)))),Xc.get(e)),zc=gc(2,(e,t)=>e*53^t),Bc=e=>e&3221225471|e>>>1&1073741824,Vc=e=>Fc(e,Ic),Hc=e=>{if(e!==e)return Uc(`NaN`);if(e===1/0)return Uc(`Infinity`);if(e===-1/0)return Uc(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Bc(t)},Uc=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Bc(t)},Wc=(e,t)=>{let n=12289;for(let r of t)n^=zc(Lc(r),Lc(e[r]));return Bc(n)},Gc=e=>Wc(e,Sc(e)),Kc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Bc(r)},qc=Kc(6151,Lc),Jc=Kc(Uc(`Map`),([e,t])=>zc(Lc(e),Lc(t))),Yc=Kc(Uc(`Set`),Lc),Xc=new WeakMap,Zc=new WeakMap,Qc=new WeakSet;function $c(e,t){if(Qc.has(e))return Uc(`[Circular]`);Qc.add(e);let n=t();return Qc.delete(e),n}var el=`~effect/interfaces/Equal`;function tl(){return arguments.length===1?e=>nl(e,arguments[0]):nl(arguments[0],arguments[1])}function nl(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Cc.has(e)||Cc.has(t)?!1:sl(e,t,ol):!1}function rl(e,t,n){let r=il.has(e),i=al.has(t);if(r&&i)return!0;if(r||i)return!1;il.add(e),al.add(t);let a=n();return il.delete(e),al.delete(t),a}var il=new WeakSet,al=new WeakSet;function ol(e,t){if(Lc(e)!==Lc(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=gl(e),r=gl(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:rl(e,t,()=>{if(i)return e[el](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:ll(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return ul(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return ul(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:pl(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:hl(e,t):dl(e,t)})}function sl(e,t,n){let r=cl.get(e);if(!r)r=new WeakMap,cl.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=cl.get(t);return a||(a=new WeakMap,cl.set(t,a)),a.set(e,i),i}var cl=new WeakMap;function ll(e,t){for(let n=0;n<e.length;n++)if(!nl(e[n],t[n]))return!1;return!0}function ul(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function dl(e,t){let n=Sc(e),r=Sc(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!nl(e[i],t[i]))return!1;return!0}function fl(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var pl=fl(nl,nl);function ml(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var hl=ml(nl),gl=e=>Fc(e,el),_l=e=>(t,n)=>t===n||e(t,n),vl=e=>e.length>0;function yl(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function bl(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&yl(e,n,t[n])}var xl=Symbol.for(`~effect/Redactable`),Sl=e=>Fc(e,xl);function Cl(e){return Sl(e)?wl(e):e}function wl(e){return e[xl](globalThis[`~effect/Fiber/currentFiber`]?.context??Dl)}var Tl=`~effect/Fiber/currentFiber`,El=new Map,Dl={"~effect/Context":{},base:El,depth:0,mapUnsafe:El,pipe(){return pc(this,arguments)}};function Ol(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return kl;r.add(e);let l;if(xl in e)l=c(wl(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
13
- `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Ml(e);else if(!t?.ignoreToString&&Fc(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Nl(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Al(t)}:${c(e[t],n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Al(t)}: ${c(e[t],n+1)}`).join(`,
14
- `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var kl=`[Circular]`;function Al(e){return typeof e==`string`?JSON.stringify(e):String(e)}function jl(e){return e.map(e=>`[${Al(e)}]`).join(``)}function Ml(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Nl(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var Pl=Symbol.for(`nodejs.util.inspect.custom`),Fl=e=>{try{return e=Cl(e),Fc(e,`toJSON`)&&kc(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Fl):e}catch{return`[toJSON threw]`}},Il=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},Ll=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),Rl=`~effect/Effect`,zl=`~effect/Exit`,Bl={_A:_c,_E:_c,_R:_c},Vl=`${Rl}/identifier`,F=`${Rl}/args`,Hl=`${Rl}/evaluate`,Ul=`${Rl}/successCont`,Wl=`${Rl}/failureCont`,Gl=`${Rl}/ensureCont`,Kl=Symbol.for(`effect/Effect/Yield`),ql={pipe(){return pc(this,arguments)},toJSON(){return{...this}},toString(){return Ol(this.toJSON(),{ignoreToString:!0,space:2})},[Pl](){return this.toJSON()}},Jl={[Rl]:Bl,...ql,[Symbol.iterator](){return new Il(this)},toJSON(){return{_id:`Effect`,op:this[Vl],...F in this?{args:this[F]}:void 0}}},Yl=e=>Fc(e,zl),Xl=`~effect/Cause`,Zl=`~effect/Cause/Reason`,Ql=e=>Fc(e,Xl),$l=class{[Xl];reasons;constructor(e){this[Xl]=Xl,this.reasons=e}pipe(){return pc(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Ol(this.reasons)})`}[Pl](){return this.toJSON()}[el](e){return Ql(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>tl(t,e.reasons[n]))}[Ic](){return qc(this.reasons)}},eu=new WeakMap,tu=class{[Zl];annotations;_tag;constructor(e,t,n){if(this[Zl]=Zl,this._tag=e,t!==nu&&typeof n==`object`&&n&&t.size>0){let e=eu.get(n);e&&(t=new Map([...e,...t])),eu.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return pc(this,arguments)}toString(){return Ol(this)}[Pl](){return this.toString()}},nu=new Map,ru=class extends tu{error;constructor(e,t=nu){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Ol(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[el](e){return lu(e)&&tl(this.error,e.error)&&tl(this.annotations,e.annotations)}[Ic](){return zc(Uc(this._tag))(zc(Lc(this.error))(Lc(this.annotations)))}},iu=e=>new $l(e),au=e=>new $l([new ru(e)]),ou=class extends tu{defect;constructor(e,t=nu){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Ol(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[el](e){return uu(e)&&tl(this.defect,e.defect)&&tl(this.annotations,e.annotations)}[Ic](){return zc(Uc(this._tag))(zc(Lc(this.defect))(Lc(this.annotations)))}},su=e=>new $l([new ou(e)]),cu=gc(e=>Ql(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new $l(e.reasons.map(e=>e.annotate(t,n)))),lu=e=>e._tag===`Fail`,uu=e=>e._tag===`Die`,du=e=>e._tag===`Interrupt`;function fu(e){return xu(`Effect.evaluate: Not implemented`)}var pu=e=>({...Jl,[Vl]:e.op,[Hl]:e[Hl]??fu,[Ul]:e[Ul],[Wl]:e[Wl],[Gl]:e[Gl]}),mu=e=>{let t=pu(e);return function(){let n=Object.create(t);return n[F]=e.single===!1?arguments:arguments[0],n}},hu=e=>{let t={[zl]:zl,_tag:e.op,get[e.prop](){return this[F]},...pu(e),toString(){return`${e.op}(${Ol(this[F])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[F]}},[el](e){return Yl(e)&&e._tag===this._tag&&tl(this[F],e[F])},[Ic](){return zc(Uc(e.op),Lc(this[F]))}};return function(e){let n=Object.create(t);return n[F]=e,n}},gu=hu({op:`Success`,prop:`value`,[Hl](e){let t=e.getCont(Ul);return t?t[Ul](this[F],e,this):e.yieldWith(this)}}),_u={key:`effect/Cause/StackTrace`},vu={key:`effect/Cause/InterruptorStackTrace`},yu=hu({op:`Failure`,prop:`cause`,[Hl](e){let t=this[F],n=!1;e.currentStackFrame&&(t=cu(t,{mapUnsafe:new Map([[_u.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(Wl);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(Wl);return r?r[Wl](t,e,n?void 0:this):e.yieldWith(n?yu(t):this)}}),bu=e=>yu(au(e)),xu=e=>yu(su(e)),Su=mu({op:`WithFiber`,[Hl](e){return this[F](e)}}),Cu=function(){class e extends globalThis.Error{}let t=pu({op:`YieldableError`,[Hl](){return bu(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),wu=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Cu{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(bl(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Tu=e=>{class t extends wu{_tag=e}return t.prototype.name=e,t},Eu=`~effect/data/Option`,Du={[Eu]:{_A:e=>e},...ql,[Symbol.iterator](){return new Il(this)}},Ou=Object.defineProperty(Object.assign(Object.create(Du),{_tag:`Some`,_op:`Some`,[el](e){return ju(e)&&Nu(e)&&tl(this.value,e.value)},[Ic](){return zc(Lc(this._tag))(Lc(this.value))},toString(){return`some(${Ol(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Fl(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),ku=Lc(`None`),Au=Object.assign(Object.create(Du),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[el](e){return ju(e)&&Mu(e)},[Ic](){return ku},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),ju=e=>Fc(e,Eu),Mu=e=>e._tag===`None`,Nu=e=>e._tag===`Some`,Pu=Object.create(Au),Fu=e=>{let t=Object.create(Ou);return t.value=e,t},Iu=`~effect/data/Result`,Lu={[Iu]:{_A:e=>e,_E:e=>e},...ql,[Symbol.iterator](){return new Il(this)}},Ru=Object.assign(Object.create(Lu),{_tag:`Success`,_op:`Success`,[el](e){return Bu(e)&&Hu(e)&&tl(this.success,e.success)},[Ic](){return zc(Lc(this._tag))(Lc(this.success))},toString(){return`success(${Ol(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Fl(this.success)}}}),zu=Object.assign(Object.create(Lu),{_tag:`Failure`,_op:`Failure`,[el](e){return Bu(e)&&Vu(e)&&tl(this.failure,e.failure)},[Ic](){return zc(Lc(this._tag))(Lc(this.failure))},toString(){return`failure(${Ol(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Fl(this.failure)}}}),Bu=e=>Fc(e,Iu),Vu=e=>e._tag===`Failure`,Hu=e=>e._tag===`Success`,Uu=e=>{let t=Object.create(zu);return t.failure=e,t},Wu=e=>{let t=Object.create(Ru);return t.success=e,t},Gu=()=>Pu,Ku=Fu,qu=Mu,Ju=Nu,Yu=gc(2,(e,t)=>qu(e)?Gu():Ku(t(e.value))),Xu=gc(2,(e,t)=>qu(e)?Gu():t(e.value)?Ku(e.value):Gu()),Zu=Wu,Qu=Uu,$u=Vu,ed=Hu,td=gc(2,(e,t)=>$u(e)?Qu(t(e.failure)):e),nd=globalThis.Array,rd=e=>nd.isArray(e)?e:nd.from(e),id=gc(2,(e,t)=>[...e,t]),ad=gc(2,(e,t)=>rd(e).concat(rd(t)));nd.isArray;var od=vl,sd=vl,cd=(e,t)=>{let n=Lc(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(tl(e,t))return!1;return r.push(t),!0},ld=gc(2,(e,t)=>{let n=rd(e),r=rd(t);return sd(n)?sd(r)?fd(ad(n,r)):n:r}),ud=()=>[],dd=gc(2,(e,t)=>e.map(t)),fd=e=>{let t=rd(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)cd(n,e)&&r.push(e);return r},pd=`~effect/BigDecimal`,md={[pd]:pd,[Ic](){let e=xd(this);return zc(Lc(e.value),Hc(e.scale))},[el](e){return hd(e)&&Td(this,e)},toString(){return`BigDecimal(${Ed(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Pl](){return this.toJSON()},pipe(){return pc(this,arguments)}},hd=e=>Fc(e,pd),gd=(e,t)=>{let n=Object.create(md);return n.value=e,n.scale=t,n},_d=(e,t)=>{if(e!==vd&&e%yd===vd)throw RangeError(`Value must be normalized`);let n=gd(e,t);return n.normalized=n,n},vd=BigInt(0),yd=BigInt(10),bd=_d(vd,0),xd=e=>{if(e.normalized===void 0){if(e.value===vd)e.normalized=bd;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=_d(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},Sd=gc(2,(e,t)=>t>e.scale?gd(e.value*yd**BigInt(t-e.scale),t):t<e.scale?gd(e.value/yd**BigInt(e.scale-t),t):e),Cd=e=>e.value<vd?gd(-e.value,e.scale):e,wd=_l((e,t)=>e.scale>t.scale?Sd(t,e.scale).value===e.value:e.scale<t.scale?Sd(e,t.scale).value===t.value:e.value===t.value),Td=gc(2,(e,t)=>wd(e,t)),Ed=e=>{let t=xd(e);if(Math.abs(t.scale)>=16)return Dd(t);let n=t.value<vd,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},Dd=e=>{if(Od(e))return`0e+0`;let t=xd(e),n=`${Cd(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${kd(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},Od=e=>e.value===vd,kd=e=>e.value<vd,Ad=e=>pu({op:e.label,[Hl]:e.evaluate}),jd=`~effect/Context/Service`,Md=function(){function e(){}let t=e;Object.setPrototypeOf(t,Nd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Fd]=Fd,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Pd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},Nd={[jd]:jd,...Ad({label:`Service`,evaluate(e){return gu(tf(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Zd(this,e)},use(e){return Su(t=>e(tf(t.context,this)))},useSync(e){return Su(t=>gu(e(tf(t.context,this))))}},Pd=new Set,Fd=`~effect/Context/Reference`,Id=`~effect/Context`,Ld=8,Rd=8,zd=(e,t,n,r)=>{let i=Object.create(Gd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Bd=(e,t)=>{t&&(Bd(e,t.parent),e.set(t.key,t.value))},Vd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Bd(t,e.overlay),e._flat=t},Hd=Symbol(),Ud=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Hd:(n.overlay&&++n.baseHits>=Rd&&(n.base=Vd(n),n.overlay=void 0,n.depth=0),r)},Wd=e=>zd(void 0,e,void 0,0),Gd={get mapUnsafe(){return Vd(this)},...ql,[Id]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[el](e){if(!qd(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!tl(r,n.get(e)))return!1;return!0},[Ic](){return Hc(this.mapUnsafe.size)}},Kd=(e,t)=>e.cacheRoot===t.cacheRoot,qd=e=>Fc(e,Id),Jd=e=>!!e[Fd],Yd=()=>Xd,Xd=Wd(new Map),Zd=(e,t)=>Wd(new Map([[e.key,t]])),Qd=gc(3,(e,t,n)=>$d(e,t.key,n)),$d=(e,t,n)=>{let r=e,i=Pd.has(t)?void 0:r.cacheRoot;if(r.depth>=Ld){let e=new Map(r.mapUnsafe);return e.set(t,n),zd(i,e,void 0,0)}return zd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},ef=(e,t)=>{let n=Ud(e,t);return n===Hd?void 0:n},tf=gc(2,(e,t)=>{let n=Ud(e,t.key);if(n===Hd){if(Jd(t))return rf(t);throw af(t)}return n}),nf=`~effect/Context/defaultValue`,rf=e=>nf in e?e[nf]:e[nf]=e.defaultValue(),af=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
15
- `);e.splice(1,3),t.stack=e.join(`
16
- `)}return t},of=Md,sf=of(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new df}),cf=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},lf=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},uf=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},df=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?lf:cf)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new ff(this.setImmediate)}},ff=class{tasks=new uf;running=void 0;setImmediate;constructor(e=cf){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},pf=of(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),mf=of(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),hf=Tu,gf=[];for(let e=0;e<256;e++)gf.push(e.toString(16).padStart(2,`0`));var _f=`effect/Tracer/ParentSpan`,vf=`effect/Tracer`,yf=`effect/observability/Metric/FiberRuntimeMetricsKey`,bf=of(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:vc}),xf=of(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Sf=of(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Cf=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),wf=()=>Error.stackTraceLimit,Tf=e=>{Cf&&(Error.stackTraceLimit=e)},Ef=class extends tu{fiberId;constructor(e,t=nu){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[el](e){return du(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Ic](){return zc(Uc(`${this._tag}:${this.fiberId}`))(Rc(this.annotations))}},Df=e=>new $l([new Ef(e)]),Of=e=>e.reasons.some(du),kf=gc(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new $l(ld(e.reasons,t.reasons));return tl(e,n)?e:n}),Af=gc(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>lu(e)?(n=!0,new ru(t(e.error),e.annotations)):e);return n?iu(r):e}),jf=`~effect/Fiber`,Mf={_A:_c,_E:_c},Nf={id:0},Pf=()=>globalThis[Tl],Ff=class{constructor(e,t=!0){this[jf]=Mf,this.setContext(e),this.id=++Nf.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[jf];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return tf(this.context,e)}addObserver(e){return this._exit?(e(this._exit),yc):(this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=Df(e);this.currentStackFrame&&(n=cu(n,Zd(_u,this.currentStackFrame))),t&&(n=cu(n,t)),this._interruptedCause=this._interruptedCause?kf(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Hf(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===Kl)return;let n=Lf.interruptChildren&&Lf.interruptChildren(this);if(n!==void 0)return this.evaluate(I(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Yd()}runLoop(e){let t=globalThis[Tl];globalThis[Tl]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=Hf(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=I(Kf,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Hl](this),i===Kl){let e=this._yielded;if(zl in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Kl}}}catch(e){return Fc(i,Hl)?this.runLoop(xu(e)):xu(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Tl]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,If;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Gl]&&t[Gl](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,Kl}children(){return this._children??=new Set}pipe(){return pc(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Kd(t,e))return;let n=this.getRef(sf);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=ef(e,_f),this.currentLogLevel=this.getRef(xf),this.minimumLogLevel=this.getRef(Sf),this.currentStackFrame=this.getRef(bf),this.maxOpsBeforeYield=this.getRef(pf),this.currentPreventYield=this.getRef(mf),this.runtimeMetrics=ef(e,yf);let r=ef(e,vf);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},If={[Ul](e,t){return Hf(t._interruptedCause)},[Wl](e,t){return Hf(t._interruptedCause)}},Lf={interruptChildren:void 0},Rf=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(vu.key,e.currentStackFrame),Wd(t)},zf=e=>Qf(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Vf(r))}return a(),Wf(()=>i?.())}),Bf=e=>Su(t=>{let n=Rf(t),r=ud();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return rp(zf(r))}),Vf=gu,Hf=yu,Uf=bu,Wf=mu({op:`Sync`,[Hl](e){let t=this[F](),n=e.getCont(Ul);return n?n[Ul](t,e):e.yieldWith(gu(t))}}),Gf=mu({op:`Suspend`,[Hl](e){return this[F]()}}),Kf=mu({op:`Yield`,[Hl](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(dp)},this[F]??0),e.yieldWith(()=>{t=!0})}})(0),qf=e=>Gf(()=>Hf(Ll(e))),Jf=e=>xu(e),Yf=Vf(void 0),Xf=mu({op:`Async`,single:!1,[Hl](e){let t=Ll(()=>this[F][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[F][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(Zf(()=>(n=!0,i?.abort(),a??dp))),Kl):r}}),Zf=mu({op:`AsyncFinalizer`,[Gl](e){e.interruptible&&(e.interruptible=!1,e._stack.push(vp))},[Wl](e,t){return Of(e)?I(this[F](),()=>Hf(e)):Hf(e)}}),Qf=e=>Xf(e,e.length>=2),$f=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),ep=(e,...t)=>$f(e.length,t.length===0?function(){return tp(()=>e.apply(this,arguments))}:function(){let n=tp(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),tp=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Vf(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Gf(()=>n?(n=!1,I(r.value,e=>np(t,e))):Gf(()=>np(e())))}}}catch(e){return Jf(e)}},np=mu({op:`Iterator`,single:!1,[Ul](e,t){let n=this[F][0];for(;;){let r=n.next(e);if(r.done)return Vf(r.value);if(!ap(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Hl](e){return this[Ul](this[F][1],e)}}),rp=e=>I(e,e=>dp),I=gc(2,(e,t)=>{let n=Object.create(ip);return n[F]=e,n[Ul]=t.length===1?t:e=>t(e),n}),ip=pu({op:`OnSuccess`,[Hl](e){return e._stack.push(this),this[F]}}),ap=e=>zl in e,op=gc(2,(e,t)=>ap(e)?e._tag===`Success`?t(e.value):e:I(e,t)),sp=gc(2,(e,t)=>I(e,e=>Vf(Ll(()=>t(e))))),cp=gc(2,(e,t)=>ap(e)?fp(e,t):sp(e,t)),lp=e=>e._tag===`Success`,up=e=>e._tag===`Failure`,dp=gu(void 0),fp=gc(2,(e,t)=>e._tag===`Success`?gu(t(e.value)):e),pp=gc(2,(e,t)=>{let n=Object.create(mp);return n[F]=e,n[Wl]=t.length===1?t:e=>t(e),n}),mp=pu({op:`OnFailure`,[Hl](e){return e._stack.push(this),this[F]}}),hp=e=>ap(e)?gu(e):gp(e),gp=mu({op:`Exit`,[Hl](e){return e._stack.push(this),this[F]},[Ul](e,t,n){return Vf(n??gu(e))},[Wl](e,t,n){return Vf(n??yu(e))}}),_p=e=>Su(t=>t.interruptible?(t.interruptible=!1,t._stack.push(vp),e):e),vp=mu({op:`SetInterruptible`,[Gl](e){if(e.interruptible=this[F],e._interruptedCause&&e.interruptible)return()=>Hf(e._interruptedCause)}})(!0),yp=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!ap(c))return I(hp(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??Yf);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=xu(e);return h=t,u=!0,m=!0,f&&f.size>0?I(_p(Bf(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(ap(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=xp(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=yu(iu([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?yu(iu(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??Yf)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return Qf(e=>{d=Pf(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):Gf(()=>(h=dp,m=!0,f?Bf(f):Yf))})}if(u=!0,h){if(f&&f.size>0){let e=Rf(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p){if(f)f.size===0&&p(Yf);else return dp}};return x()}},bp=()=>yp,xp=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Ff(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},Sp=e=>(t,n)=>{let r=new Ff(n?.scheduler?Qd(e,sf,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Cp=(e=>{let t=Sp(e);return e=>{if(ap(e))return e;let n=new df(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??xu(new Tp(r))}})(Yd()),wp=`~effect/Cause/AsyncFiberError`,Tp=class extends Tu(`AsyncFiberError`){[wp]=wp;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Ep={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Ep.gray,Ep.blue,Ep.green,Ep.yellow,Ep.red,Ep.bgBrightRed,Ep.black;var Dp=lu,Op=Af,kp=gu,Ap=yu,jp=bu,Mp=dp,Np=lp,Pp=up,Fp=`~effect/time/DateTime`,Ip=`~effect/time/DateTime/TimeZone`,Lp={[Fp]:Fp,pipe(){return pc(this,arguments)},[Pl](){return this.toString()},toJSON(){return zp(this).toJSON()}};({...Lp}),{...Lp};var Rp={[Ip]:Ip,[Pl](){return this.toString()}};({...Rp}),{...Rp};var zp=e=>new Date(e.epochMilliseconds),Bp=Vf,Vp=Uf,Hp=qf,Up=Jf,Wp=I,Gp=hp,Kp=pp,qp=Cp,Jp=cp,Yp=op,Xp=ep;function Zp(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function Qp(e){return t=>Zp(t)?.[e]}var $p=`~structural`,em=`~sentinels`,tm=`~constructor`,nm=Qp(`brands`),rm=bc(e=>{let t=Zp(e)?.identifier;return typeof t==`string`?t:e.getExpected(rm)}),im=Symbol(),am=kp,om=am(im),sm=am(im),cm=e=>e===im?Gu():Ku(e),lm=e=>e._tag===`None`?om:am(e.value),um=`~effect/SchemaIssue/Issue`;function dm(e){return Fc(e,um)&&e[um]===um}function fm(e){return Object.hasOwn(e,`input`)}var pm=class{[um]=um;constructor(e,t){t?.reportInput===!0&&e!==im&&(this.input=e)}},mm=class extends pm{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},hm=class extends pm{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},gm=class extends pm{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},_m=class extends pm{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},vm=class extends pm{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},ym=class extends pm{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},bm=class extends pm{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},xm=class extends pm{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Sm=class extends pm{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Cm=class extends pm{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function wm(e,t,n){if(dm(e))return e;if(typeof e==`string`)return new xm({message:e},t,n);let r=typeof e.issue==`string`?new xm({message:e.issue},t,n):e.issue;return new gm(e.path,r)}function Tm(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new xm(void 0,t,n):wm(e,t,n)}function Em(e,t,n,r){return Array.isArray(t)?sd(t)?t.length===1?wm(t[0],n,r):new ym(e,dd(t,e=>wm(e,n,r)),n,r):void 0:Tm(t,n,r)}var Dm=e=>{let t=Rm(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Mm(rm(e.ast),e);case`InvalidValue`:{let t=jm(e);if(t!==void 0)return Mm(t,e);let n=Am(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Am(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Am(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Om=e=>Rm(e.issue)??Rm(e);function km(e){return t=>({issues:Nm(t,[],e?.leafHook??Dm,e?.checkHook??Om)})}function Am(e){return fm(e)?Ol(e.input):void 0}function jm(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Mm(e,t){let n=Am(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Nm(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return Nm(e.issue,t,n,r);let a=jm(e.issue);return[{path:t,message:a===void 0?Mm(Pm(e.filter),e):Mm(a,e.issue)}]}case`Encoding`:return Nm(e.issue,t,n,r);case`Pointer`:return Nm(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>Nm(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:Rm(e)??Mm(rm(e.ast),e)}]:e.issues.flatMap(e=>Nm(e,t,n,r));default:return[{path:t,message:n(e)}]}}function Pm(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>Pm(e)).join(` & `)}}function Fm(){return e=>Lm(e,``)}var Im=Fm();function Lm(e,t){let n;switch(e._tag){case`Filter`:{let r=Om(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Lm(e.issue,t);let r=jm(e.issue);n=r===void 0?Mm(Pm(e.filter),e):Mm(r,e.issue)}break}case`Encoding`:return Lm(e.issue,t);case`Pointer`:return Lm(e.issue,t+jl(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Lm(e,t)).join(`
17
- `);n=Rm(e)??Mm(rm(e.ast),e);break;default:n=Dm(e)}return t?`${n}\n at ${t}`:n}function Rm(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Rm(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function zm(e){let t;for(let n of e.reasons){if(!Dp(n)||!dm(n.error))return;t??=n.error}return t}function Bm(e,t){let n=zm(e);if(n===void 0)throw Error(t,{cause:e});return n}var Vm=class e extends hc{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(Jp(Yu(t))))}compose(t){return Um(this)?t:Um(t)?this:new e((e,n)=>this.run(e,n).pipe(Yp(e=>t.run(e,n))))}},Hm=new Vm(Bp);function Um(e){return e.run===Hm.run}function Wm(){return Hm}function Gm(e){return Km(Yu(e))}function Km(e){return new Vm(t=>Bp(e(t)))}function qm(e){return new Vm(t=>{let n=Xu(t,Ac);return Ju(n)?Bp(n):Jp(e,Ku)})}function Jm(){return Gm(globalThis.String)}function Ym(){return Gm(globalThis.Number)}var Xm=`~effect/SchemaTransformation/Transformation`,Zm=class e{[Xm]=Xm;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function Qm(e){return Fc(e,Xm)&&e[Xm]===Xm}var $m=e=>Qm(e)?e:new Zm(e.decode,e.encode);function eh(e){return new Zm(Gm(e.decode),Gm(e.encode))}var th=new Zm(Wm(),Wm());function nh(){return th}var rh=new Zm(Ym(),Jm());function ih(e){return t=>t._tag===e}function ah(e){return Fc(e,gh)&&e[gh]===gh}var oh=ih(`Declaration`),sh=ih(`Never`),ch=ih(`Literal`),lh=ih(`UniqueSymbol`),uh=ih(`Arrays`),dh=ih(`Objects`),fh=ih(`Suspend`),ph=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},mh={},hh=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},gh=`~effect/Schema`,_h=class{[gh]=gh;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},vh=class e extends _h{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===im?om:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r,i,a){let o=Pg(this.typeParameters,t);return o===this.typeParameters&&n===this.checks&&r===this.encodingChecks&&i===this.run&&a===this.encodingRun?this:new e(o,i,this.annotations,n,void 0,this.context,r,a)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},yh=new class extends _h{_tag=`Null`;getParser(){return Zg(this,null)}getExpected(){return`null`}},bh=class extends _h{_tag=`Undefined`;getParser(){return Zg(this,void 0)}toCodecJson(){return Cg(this,[xh])}getExpected(){return`undefined`}},xh=new ph(yh,new Zm(Gm(()=>void 0),Gm(()=>null))),Sh=new bh,Ch=new class extends _h{_tag=`Never`;getParser(){return Qg(this,Mc)}getExpected(){return`never`}},wh=new class extends _h{_tag=`Unknown`;getParser(){return Qg(this,Nc)}getExpected(){return`unknown`}},Th=class extends _h{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Ol(e)}`);this.literal=e}getParser(){return Zg(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Eh(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Eh(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Eh(e){let t=globalThis.String(e.literal);return Cg(e,[new ph(new Th(t),new Zm(Gm(()=>e.literal),Gm(()=>t)))])}var Dh=new class extends _h{_tag=`String`;getParser(){return Qg(this,wc)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&o_(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},Oh=class extends _h{_tag=`Number`;getParser(){return Qg(this,Tc)}matchKey(e,t){return this._match(t_,e,t)}matchPart(e,t){return this._match(e_,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:o_(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(kh(this.checks,`effect/schema/isFinite`)||kh(this.checks,`effect/schema/isInt`))?this:Cg(this,[vg])}toCodecStringTree(){return this.toCodecJson()===this?Cg(this,[i_]):Cg(this,[a_])}getExpected(){return`number`}};function kh(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&kh(e.checks,t))}var Ah=new Oh,jh=new class extends _h{_tag=`Boolean`;getParser(){return Qg(this,Ec)}getExpected(){return`boolean`}},Mh=class e extends _h{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Ug(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Ug(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return Xp(function*(e,c){if(e===im)return im;if(!Array.isArray(e))return yield*Vp(new bm(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=Nh(u,e,{concurrency:Ph(c?.concurrency)?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(d&&(yield*d),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new vm(n,e[t],c),i=new gm([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*Vp(new ym(n,[i],e,c))}return u.issues?yield*Vp(new ym(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=Pg(this.elements,t),a=Pg(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}},Nh=bp()({onItem(e,t,n){let r=n<e.len?t:im;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return Fh(e,e.ast,r,n);let i=n===sm?t:n[F];if(i!==im)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Ug(t.ast))return;let n=new gm([r],new _m(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return jp(new ym(e.ast,[n],e.input,e.options))}}}),Ph=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),Fh=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=zm(r.cause);if(i===void 0)return Ap(Op(r.cause,r=>new ym(t,[new gm([n],r)],e.input,e.options)));let a=new gm([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return jp(new ym(t,[a],e.input,e.options))},Ih=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function Lh(e,t,n=mh){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a($g(qg(t)))}var Rh=class{name;type;constructor(e,t){this.name=e,this.type=t}};function zh(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(zh);default:return!1}}function Bh(e){return zh(e)&&zh(qg(e))}var Vh=class{parameter;type;constructor(e,t){if(!Bh(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Ug(t)&&!Xg(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Hh=class e extends _h{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return Qg(n,jc);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return Fh(e,n,t,s)??Mp;let c=s===sm?a:s[F];if(r!==im&&c!==im){if(i&&(o.has(t)||o.has(r)))return Mp;yl(e.out,r,c)}return Mp},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!ap(n))return Wp(Gp(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return Fh(e,n,t,i)??Mp;let a=i===sm?t:i[F],o=e.input[t],s=r.parserValue(o,e.options);return ap(s)?l(e,t,a,o,s):Wp(Gp(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return ap(i)?l(e,t,t,r,i):Wp(Gp(i),n=>l(e,t,t,r,n))},f=a?bp()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0,p=()=>(s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e($g(n.parameter)),parserValue:t(n.type)})):void 0),s),m=Xp(function*(e,t){if(e===im)return im;if(typeof e!=`object`||!e||Array.isArray(e))return yield*Vp(new bm(n,e,t));p();let l=e,m={},h={ast:n,input:l,out:m,issues:void 0,options:t},g=t.errors===`all`,_=t.onExcessProperty===`error`,v=t.onExcessProperty===`preserve`,y;if(!a&&(_||v)){o??=new Set(r),y=Reflect.ownKeys(l);for(let r=0;r<y.length;r++){let i=y[r];if(!o.has(i)){if(_){let r=new vm(n,l[i],t),a=new gm([i],r);if(g){h.issues?h.issues.push(a):h.issues=[a];continue}return yield*Vp(new ym(n,[a],e,t))}yl(m,i,l[i])}}}let b=Ph(t?.concurrency);if(i){let e=Wh(h,s,b);e&&(yield*e)}if(a&&!b)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===Dh?d:u,i=n.is.parameter===Dh?Object.keys(l):Lh(l,n.is.parameter,t);for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!ap(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=ud();for(let n=0;n<a;n++){let r=c[n],i=Lh(l,r.is.parameter,t);for(let t=0;t<i.length;t++)e.push([i[t],r])}let n=f(h,e,b);n&&(yield*n)}if(h.issues)return yield*Vp(new ym(n,h.issues,e,t));if(t.propertyOrder===`original`){let e=(y??Reflect.ownKeys(l)).concat(r),t={};for(let n of e)Object.hasOwn(m,n)&&yl(t,n,m[n]);return t}return m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return Wp(Gp(n),n=>{let i=Uh(e,r,n);if(i)return i;let a=()=>am(e.out),o=Wh(e,s.slice(t+1));return o?Yp(o,a):a()})};return(e,t)=>{if(e===im)return om;if(t.errors===`all`||t.onExcessProperty!==void 0||t.propertyOrder===`original`||t.concurrency!==void 0)return m(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return Vp(new bm(n,e,t));let r=p(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Object.hasOwn(i,s),l=c?i[s]:im,u=n.parser(l,t);if(!ap(u))return h(o,e,u);if(u===sm){c&&yl(a,s,l);continue}let d=Uh(o,n,u);if(d)return d}}catch(e){return Up(e)}return am(a)}}_rebuild(t,n,r,i){let a=Pg(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new Rh(e.name,n)}),o=Pg(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Vh(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Uh(e,t,n){if(n._tag===`Failure`)return Fh(e,e.ast,t.name,n);if(n===sm)return;let r=n[F];if(r!==im){yl(e.out,t.name,r);return}if(delete e.out[t.name],!Ug(t.type)){let n=new gm([t.name],new _m(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return jp(new ym(e.ast,[n],e.input,e.options))}}var Wh=bp()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(im,e.options);let n=e.input[t.name];return yl(e.out,t.name,n),t.parser(n,e.options)},step:Uh});function Gh(e,t){return e?t?[...e,...t]:e:t}function Kh(e,t,n){return new Hh(Reflect.ownKeys(e).map(t=>new Rh(t,e[t].ast)),[],n,t)}function qh(e){return e.ast}function Jh(e,t=void 0){return new Mh(!1,e.map(e=>e.ast),[],void 0,t)}function Yh(e,t,n){return new ig(e.map(qh),t,void 0,n)}var Xh=xc(e=>{for(;;){if(fh(e))return wh;let t=e.encoding;if(!t)return e.recur?.(Xh,_c)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==_c))return wh;e=t[t.length-1].to}});function Zh(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Zh)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Qh(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[em];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Ug(t)){if(ch(t))return[{key:e.name,literal:t.literal}];if(lh(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Ug(e)){if(ch(e))return[{key:t,literal:e.literal}];if(lh(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Qh(Xh(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Qh(e.thunk())}}var $h=new WeakMap,eg=Object.freeze([]);function tg(e){let t=$h.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Xh(s);if(sh(c))continue;if(o){if(ch(c)||lh(c)){a??=new Map;let e=ch(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Qh(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Zh(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??eg;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(Pc(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??eg;if(n)return e}return eg}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??eg;if(!Pc(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??eg).map(t=>e[t]).filter(ng(t));return $h.set(e,t),t}function ng(e){return t=>{let n=Xh(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function rg(e,t,n=!1){return tg(t)(e,n)}var ig=class e extends _h{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===im)return om;let a=rg(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:ap(t)?ag(n,t.cause,r,i):Kp(t,e=>ag(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=Ph(i?.concurrency),c=og(o,a,s?{...s,orderedStep:!0}:void 0);return c?Yp(c,e=>o.out===sm?Bp(r):o.out?o.out:Vp(new Sm(n,o.issues??[],r,i))):o.out?o.out:Vp(new Sm(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=Pg(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=qg(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(ch);if(t.length>0)return`${cg(n.isMutable)}[ ${t.map(t=>e(t)+lg(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>ch(e.type));if(t.length>0)return`{ ${t.map(t=>`${cg(t.type.context?.isMutable)}${Al(t.name)}${lg(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function ag(e,t,n,r){let i=zm(t);return i?jp(new Sm(e,[i],n,r)):Ap(t)}var og=bp()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=zm(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),jp(new Cm(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Mp}}}),sg=new ig([new Th(`Infinity`),new Th(`-Infinity`),new Th(`NaN`)],`anyOf`);function cg(e){return e?``:`readonly `}function lg(e){return e?`?`:``}function ug(e){let t=!1,n;return()=>t?n:(n=e(),t=!0,n)}var dg=class e extends _h{_tag=`Suspend`;thunk;constructor(e,t,n,r,i){if(n)throw Error(`Cannot add checks to Suspend`);super(t,void 0,r,i),this.thunk=ug(e)}getParser(e){let t;return(n,r)=>(t??=e(this.thunk()))(n,r)}recur(t){return new e(()=>t(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},fg=class e extends hc{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new pg([this,e],t)}},pg=class e extends hc{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function mg(e,t,n=!1){return new fg((t,n,r)=>Em(n,e(t,n,r),t,r),t,n)}function hg(e,t){return new fg((t,n,r)=>e(t)?void 0:new xm(void 0,t,r),t,!0)}function gg(e){return mg(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var _g=Dg(Ah,[gg()]),vg=new ph(new ig([_g,sg],`anyOf`),new Zm(Ym(),Gm(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function yg(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return mg(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function bg(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var xg=new WeakMap;function Sg(e){return xg.get(e)??e}function Cg(e,t){return e.encoding===t?e:bg(e,e=>{e.encoding.value=t})}function wg(e,t){if(e.context===t)return e;let n=Sg(e);if(n.context===t)return n;let r=bg(e,e=>{e.context.value=t});return xg.set(r,n),r}function Tg(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return Eg(e,id(e.checks.slice(0,-1),n.annotate(t)))}return bg(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function Eg(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:bg(e,e=>{e.checks.value=t})}function Dg(e,t){return Eg(e,Gh(e.checks,t))}function Og(e,t){let n=t(e.to);return n===e.to?e:new ph(n,e.transformation)}function kg(e,t){let n=e,r=n[n.length-1],i=Og(r,t);return i===r?e:id(e.slice(0,e.length-1),i)}function Ag(e){return t=>t.encoding?Cg(t,kg(t.encoding,e)):t}function jg(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Cg(r,kg(r.encoding,n))}return e(r)}return xc(n)}function Mg(e,t,n){let r=new ph(e,t);return Cg(n,n.encoding?[...n.encoding,r]:[r])}function Ng(e,t){let n=nm(e);return Tg(e,{brands:n?[...n,t]:[t]})}function Pg(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function Fg(e,t){return wg(e,e.context?new hh(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new hh(!1,!1,void 0,t))}var Ig=xc(e=>Lg(wg(e,e.context?e.context.isOptional===!1?new hh(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new hh(!0,!1)))),Lg=Ag(Ig),Rg=bc(e=>Ig(new ig([e,Sh],`anyOf`)));function zg(e,t){let n=new ph(wh,new Zm(qm(t),Wm()));return wg(e,e.context?new hh(e.context.isOptional,e.context.isMutable,n,e.context.annotations):new hh(!1,!1,n))}function Bg(e,t,n){return Mg(e,n,t)}function Vg(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Oc(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Hg(e,t){let{literals:n,parameters:r}=Vg(e);return new Hh(n.map(e=>new Rh(e,t)),r.map(e=>new Vh(e,t)))}function Ug(e){return e.context?.isOptional??!1}function Wg(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Wg)}function Gg(e){function t(e){return Wg(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return od(n)?n:void 0}var Kg=xc(e=>{if(e.encoding)return Kg(Cg(e,void 0));let t=e,n=t.recur?.(Kg)??t,r=n.encodingChecks;if(r){let t=n===e?r:uh(n)||dh(n)||oh(n)&&n.typeParameters.length>0?Gg(r):void 0;return bg(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Gh(n.checks,t)})}return n}),qg=xc(e=>Kg(Yg(e)));function Jg(e,t){let n=t,r=n.length,i=n[r-1],a=[new ph(Yg(Cg(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new ph(Yg(n[e-1].to),n[e].transformation.flip()));let o=Yg(i.to);return o.encoding?Cg(o,[...o.encoding,...a]):Cg(o,a)}var Yg=bc(e=>{if(e.encoding)return Jg(e,e.encoding);let t=e;return t.flip?.(Yg)??t.recur?.(Yg)??t});function Xg(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Xg);default:return!1}}function Zg(e,t){let n=am(t);return(r,i)=>r===im?om:r===t?n:Vp(new bm(e,r,i))}function Qg(e,t){return(n,r)=>n===im?om:t(n)?sm:Vp(new bm(e,n,r))}var $g=jg(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur($g)}}),e_=new globalThis.RegExp(`^${Ih}$`),t_=new globalThis.RegExp(`^(?:${Ih}|Infinity|-Infinity|NaN)$`);function n_(e){return yg(e_,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:e_.source}),...e})}var r_=Dg(Dh,[n_()]),i_=new ph(r_,rh),a_=new ph(new ig([r_,sg],`anyOf`),rh);function o_(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=o_(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new mm(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function s_(e){if(!oh(e))return;let t=e.annotations?.[tm];return kc(t)?t(e.typeParameters):void 0}function c_(e){let t=y_(C_,Kg(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function l_(e){let t=c_(e);return(e,n)=>{let r=qp(t(e,n));return Np(r)?Ku(r.value):(Bm(r.cause,`Option adapter can only return none for schema issues`),Gu())}}function u_(e){let t=c_(e);return(e,n)=>{let r=qp(t(e,n));if(Np(r))return r.value;let i=Bm(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function d_(e,t){let n=v_(e.ast);return t===void 0?n:(e,r)=>n(e,g_(t,r))}function f_(e,t){return b_(d_(e,t))}function p_(e,t){return x_(d_(e,t))}function m_(e,t){let n=v_(Yg(e.ast));return t===void 0?n:(e,r)=>n(e,g_(t,r))}function h_(e,t){return b_(m_(e,t))}var g_=(e,t)=>t?{...e,...t}:e,__=e=>e===im?Vp(new xm):Bp(e);function v_(e){return y_(S_,e)}function y_(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??mh);return a===sm?Bp(r):ap(a)?a[F]===im?__(im):a:Yp(a,__)}}function b_(e){return(t,n)=>qp(e(t,n))}function x_(e){let t=b_(e);return(e,n)=>{let r=t(e,n);return Np(r)?Zu(r.value):Qu(Bm(r.cause,`Result adapter can only return schema issues`))}}var S_=bc(e=>O_(e,S_)),C_=bc(e=>O_(e,C_,T_)),w_=bc(e=>O_(e,C_,T_,e.context?.constructorDefault));function T_(e){return e.context?.constructorDefault?w_(e):C_(e)}function E_(e,t,n,r){let i;if(ap(e)&&e._tag===`Success`){let a=cm(e===sm?t:e[F]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(am(a),r)}else i=n._tag===`Transformation`?Yp(e,e=>n.decode.run(cm(e),r)):n.decode(Jp(e,cm),r);return ap(i)&&i._tag===`Success`?lm(i[F]):Yp(i,lm)}function D_(e,t){let n;return(r,i)=>r===im?om:e.isConstructed(r)?sm:E_((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function O_(e,t,n,r){let i=n?s_(e):void 0,a=i?D_(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,g_(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(ap(r)){if(r._tag===`Success`){let i=r===sm?t:r[F];if(t!==im&&i!==im){let i=o_(c,t,void 0,e,n);i&&(r=Vp(new ym(e,i,t,n)))}}}else r=Wp(r,r=>{if(t!==im&&r!==im){let r=o_(c,t,void 0,e,n);if(r)return Vp(new ym(e,r,t,n))}return Bp(r)})}if(o&&!n.disableChecks){if(ap(r)){if(r._tag===`Success`){let i=r===sm?t:r[F];if(i===im)return r;let a=o_(o,i,void 0,e,n);a&&(r=Vp(new ym(e,a,i,n)))}}else r=Wp(r,t=>{if(t!==im){let r=o_(o,t,void 0,e,n);if(r)return Vp(new ym(e,r,t,n))}return Bp(t)})}return r};return s?(n,r)=>{l&&(r=g_(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=E_(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[F],o=t(a,r)):o=Yp(o,e=>{let n=t(e,r);return n===sm?am(e):n})}if(o._tag===`Success`){let e=o[F],t=d(e,r);return t===sm?o:t}return o=Kp(o,t=>Hp(()=>Op(t,t=>new hm(e,t,n,r)))),Yp(o,e=>{let t=d(e,r);return t===sm?am(e):t})}:l?(e,t)=>d(e,g_(t,l)):d}var k_=`~effect/Schema/Schema`,A_={[k_]:k_,pipe(){return pc(this,arguments)},annotate(e){return this.rebuild(Tg(this.ast,e))},annotateKey(e){return this.rebuild(Fg(this.ast,e))},check(...e){return this.rebuild(Dg(this.ast,e))}};function j_(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,A_),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>j_(e,t),r.makeEffect=c_(r),r.make=u_(r),r.makeOption=l_(r),r}var M_=gc(2,(e,t)=>({...e,...t})),N_=gc(2,(e,t)=>F_(e,(e,n)=>[Object.hasOwn(t,e)?t[e]:e,n])),P_=e=>e;function F_(e,t){let n={};for(let r of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;let i=t(r,e[r]);if(i){let[e,t]=i;yl(n,e,t)}}return n}var I_=k_;function L_(){return(e,t,n)=>K_(new vh(e.map(qh),e=>t(e.map(e=>K_(e))),n))}function R_(e,t){return L_()([],()=>(t,n,r)=>e(t)?Bp(t):Vp(new bm(n,t,r)),t)}var z_=`~effect/SchemaError/SchemaError`,B_=class extends hf(`SchemaError`){[z_]=z_;constructor(e){let t=wf();Tf(0);try{super({issue:e})}finally{Tf(t)}}get message(){return Im(this.issue)}toString(){return`SchemaError(${this.message})`}};function V_(e){return Fc(e,z_)&&e[z_]===z_}function H_(e,t){let n=f_(e,t);return(e,t)=>U_(n(e,t))}function U_(e){return Np(e)?e:Ap(Op(e.cause,e=>new B_(e)))}function W_(e,t){let n=p_(e,t);return(e,t)=>td(n(e,t),e=>new B_(e))}function G_(e,t){let n=h_(e,t);return(e,t)=>U_(n(e,t))}var K_=j_;function q_(e){return Fc(e,I_)&&e[I_]===I_}var J_=P_(e=>K_(Ig(e.ast),{schema:e})),L=P_(e=>{let t=cv(e);return K_(Rg(e.ast),{schema:t})}),R=P_(e=>K_(Kg(e.ast),{schema:e})),Y_=P_(e=>K_(qg(e.ast),{schema:e}));function z(e){let t=K_(new Th(e),{literal:e,transform(n){return t.pipe(fv(z(n),{decode:Gm(()=>n),encode:Gm(()=>e)}))}});return t}var X_=K_(Ch),Z_=K_(yh),Q_=K_(Sh),B=K_(Dh),V=K_(Ah),H=K_(jh);function $_(e,t){return K_(e,{fields:t,mapFields(e,t){let n=e(this.fields);return $_(Kh(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function U(e){return $_(Kh(e,void 0),e)}function ev(e){return P_(t=>t.mapFields(M_(e)))}var tv=e=>typeof e==`symbol`?e:globalThis.String(e);function nv(e){return function(t){let n={},r=Object.create(null),i=Object.create(null),a=new Set;for(let o of Reflect.ownKeys(t.fields)){let s=Y_(t.fields[o]),c=Object.hasOwn(e,o),l=c?e[o]:o,u=tv(l);if(a.has(u))throw new globalThis.Error(`Duplicate encoded keys: ${Al(l)}`);a.add(u),yl(n,l,s),c&&(r[o]=l,i[l]=o)}return U(n).pipe(fv(t,eh({decode:N_(i),encode:N_(r)})))}}function rv(e,t){return K_(Hg(e.ast,t.ast),{key:e,value:t})}function iv(e,t){return K_(e,{elements:t,mapElements(e,t){let n=e(this.elements);return iv(Jh(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function av(e){return iv(Jh(e),e)}var W=P_(e=>K_(new Mh(!1,[],[e.ast]),{value:e})),ov=P_(e=>K_(new Mh(!1,[e.ast],[e.ast]),{value:e}));function sv(e,t){return K_(e,{members:t,mapMembers(e,t){let n=e(this.members);return sv(Yh(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function G(e,t){return sv(Yh(e,t?.mode??`anyOf`,void 0),e)}function K(e){let t=e.map(z);return K_(Yh(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return G(e(this.members))},pick(e){return K(e)},transform(e){return G(t.map((t,n)=>t.transform(e[n])))}})}var q=P_(e=>G([e,Z_])),cv=P_(e=>G([e,Q_]));function lv(e){return K_(new dg(()=>e().ast))}function J(...e){return t=>t.check(...e)}function uv(e,t){return n=>K_(Dg(n.ast,[hg(e,t)]),{schema:n})}function dv(e){return t=>K_(Ng(t.ast,e),{schema:t,identifier:e})}function fv(e,t){return n=>K_(Bg(n.ast,e.ast,t?$m(t):nh()),{from:n,to:e})}function pv(e){return t=>K_(zg(t.ast,e),{schema:t})}function mv(e){return z(e).pipe(pv(Bp(e)))}function hv(e,t){return U({_tag:mv(e),...t})}var Y=mg,gv=K_(_g);function _v(e,t){return e=Math.max(0,Math.floor(e)),Y(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[$p]:!0,arbitrary:{constraint:{minLength:e}},...t})}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var vv=globalThis.Symbol.for(`immer-draftable`),yv={};function bv(e,t,n,r,i){let a=Cv(n,t,r),o=Sv(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===yv?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:yv,value:i}})}static[I_]=I_;get[o](){return o}static[vv]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return pc(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return l_(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(Tg(this.ast,e))}static annotateKey(e){return this.rebuild(Fg(this.ast,e))}static check(...e){return this.rebuild(Dg(this.ast,e))}static extend(e){return(t,r)=>{let a=wv(t)?t:U(t),o={...n.fields,...a.fields},s=Kh(o,n.ast.checks,{identifier:e});return bv(this,e,$_(Dg(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function xv(e){return new Zm(Gm(t=>new e(t,{"~payload":{token:yv,value:t}})),Wm())}function Sv(e){return`~effect/Schema/Class/${e}`}function Cv(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=Sv(t),o=e=>e instanceof i||Fc(e,a),s=xv(i);return r=fv(K_(new vh([e.ast],()=>(e,t,n)=>o(e)?Bp(e):Vp(new bm(t,e,n)),{identifier:t,[tm]:([e])=>({isConstructed:o,link:new ph(e,s)}),toCodec:([e])=>new ph(e.ast,s),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>new i(e)),terminal:e.terminal?.map(e=>new i(e))}),toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[em]:Qh(e.ast),...n})),s)(e)}}function wv(e){return q_(e)}var Tv=e=>(t,n)=>bv(wu,e,wv(t)?t:U(t),n,e=>({name:e})),Ev=e=>(t,n,r)=>{let i=wv(n)?n.mapFields(e=>({_tag:mv(t),...e}),{unsafePreserveChecks:!0}):hv(t,n);return Tv(e??t)(i,r)},Dv=new WeakMap,Ov=new WeakMap,kv=new WeakMap;function Av(e){let t=Ov.get(e);if(t!==void 0||!ah(e)||!oh(e))return t;if(!(e.typeParameters.length!==0||e.checks!==void 0||e.encoding!==void 0||e.context!==void 0||e.encodingChecks!==void 0||e.encodingRun!==void 0&&e.encodingRun!==e.run))return kv.get(e.run)}function jv(e,t){let n=R_(t=>Iv(t)&&Dv.get(t)?.kind===e,{identifier:e===`text`?`RecordTextContent`:`RecordBytesContent`});return Ov.set(n,Object.freeze({kind:e,maximumBytes:t})),Ov.set(n.ast,Object.freeze({kind:e,maximumBytes:t})),kv.set(n.ast.run,Object.freeze({kind:e,maximumBytes:t})),n}var Mv=jv(`text`,void 0),Nv=jv(`bytes`,void 0),Pv=Object.freeze({maximumBytes(e){if(!Number.isSafeInteger(e)||e<0)throw TypeError(`Record content maximumBytes must be a non-negative safe integer`);return t=>{let n=Ov.get(t);if(n===void 0)throw TypeError(`Record content maximumBytes requires a package-owned content declaration`);return jv(n.kind,e)}}});function Fv(e){let t=Av(e);return t===void 0?void 0:Object.freeze({...t,category:`content`})}function Iv(e){return typeof e==`object`&&!!e&&Dv.has(e)}function Lv(e){return Iv(e)&&Dv.get(e)?.kind===`text`}function Rv(e){return Iv(e)&&Dv.get(e)?.kind===`bytes`}var zv=Object.freeze({entries:4096,groupDepth:16,displayCodePoints:256,jsonDepth:8,jsonObjectKeys:64,jsonArrayItems:256,stringBytes:8192,diagnosticDepth:2,diagnosticNodes:64,diagnosticBytes:65536,collectionDiagnosticCandidates:8}),Bv=[`less-than`,`at-most`,`greater-than`,`at-least`],Vv=`@niceeval/assertions/AssertionEntryId`,Hv=65536;Object.freeze({errors:`all`,onExcessProperty:`error`});var Uv=new TextEncoder,Wv=/[\p{Cc}]/u,Gv=/^ae_[a-z0-9]{20}$/,Kv=/^[\x21-\x7e]+$/;function qv(e){return Uv.encode(e).byteLength}function Jv(e){return Array.from(e).length}function Yv(e){return qv(e)<=zv.stringBytes}function Xv(e){return!Wv.test(e)&&Jv(e)<=zv.displayCodePoints}function Zv(e){return qv(e)<=128&&Kv.test(e)}function Qv(e){return Number.isFinite(e)&&Number.isInteger(e)&&e>=0}function $v(e){return Number.isFinite(e)&&e>=0}function ey(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ty(e){return Object.keys(e).length<=zv.jsonObjectKeys}function ny(e){return e.length<=zv.jsonArrayItems}function ry(e){return Gv.test(e)}function iy(e){try{let t=JSON.stringify(e);return typeof t==`string`&&qv(t)<=4194304}catch{return!1}}function ay(e){let t=new Set;for(let n of e.entries){if(t.has(n.entryId))return!1;t.add(n.entryId)}return!0}function oy(e){let t=e.coverage;return t.state===`complete`?e.limitations.length===0:t.state!==`partial`||e.limitations.some(e=>e.kind===t.reason)}var sy=B.check(Y(Yv,{identifier:`AssertionsBoundedJsonString`,description:`a UTF-8 string no longer than 8 KiB`})),cy=B.check(Y(Xv,{identifier:`AssertionDisplayText`,description:`text without control characters and at most 256 code points`})),ly=sy.check(Y(e=>e.length>0&&!Wv.test(e),{identifier:`MatcherSourceIdentity`,description:`a non-empty bounded source identity without control characters`})),uy=B.check(Y(Zv,{identifier:`AssertionCriterionIdentifier`,description:`a non-empty printable ASCII identifier no longer than 128 bytes`})),dy=gv.check(Y(Qv,{identifier:`AssertionNonNegativeInteger`,description:`a finite non-negative integer`})),fy=gv.check(Y(e=>Number.isSafeInteger(e)&&e>0,{identifier:`AssertionPositiveInteger`,description:`a positive safe integer`})),py=gv.check(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`AssertionNonNegativeSafeInteger`,description:`a non-negative safe integer`})),my=gv.check(Y($v,{identifier:`AssertionNonNegativeNumber`,description:`a finite non-negative number`}));function hy(e){if(e===`0`)return!0;if(!/^[1-9][0-9]*$/.test(e))return!1;let t=Number(e);return Number.isSafeInteger(t)&&t>=0&&t<4294967295}function gy(e,t,n){if(e===null||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e==`string`)return Yv(e);if(typeof e!=`object`||t>=zv.jsonDepth)return!1;try{if(n.has(e))return!1;if(n.add(e),Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||!ny(e))return!1;for(let t of Reflect.ownKeys(e)){if(t===`length`)continue;if(typeof t!=`string`||!hy(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);if(n===void 0||!n.enumerable||!(`value`in n))return!1}for(let r=0;r<e.length;r+=1)if(!Object.prototype.hasOwnProperty.call(e,r)||!gy(e[r],t+1,n))return!1;return!0}let r=e;if(!ey(r)||!ty(r))return!1;for(let e of Reflect.ownKeys(r)){if(typeof e!=`string`||!Yv(e))return!1;let i=Object.getOwnPropertyDescriptor(r,e);if(i===void 0||!i.enumerable||!(`value`in i)||!gy(i.value,t+1,n))return!1}return!0}catch{return!1}finally{n.delete(e)}}function _y(e){return gy(e,0,new WeakSet)}function vy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&gy(e,0,new WeakSet)}var yy=lv(()=>G([Z_,H,gv,sy,W(yy),rv(sy,yy)]).check(Y(_y,{identifier:`AssertionsBoundedJsonValue`,description:`a recursive JSON value within the Assertions limits`}))),by=yy,xy=rv(sy,yy).check(Y(vy,{identifier:`AssertionsBoundedJsonObject`,description:`a recursive JSON object within the Assertions limits`})),Sy=B.check(Y(ry,{identifier:`AssertionEntryId`,description:`an attachment-local ae_ identifier with 20 lowercase base-36 characters`})).pipe(dv(Vv)),Cy=U({key:L(cy),label:L(cy),groupPath:W(cy).check(Y(e=>e.length<=zv.groupDepth,{identifier:`AssertionDisplayGroupPath`,description:`a group path no deeper than 16 segments`}))}),wy=U({kind:z(`builtin`),id:uy,data:by}),Ty=U({name:uy,schemaId:uy,data:by});G([wy,Ty]);var Ey=G([G([U({kind:z(`builtin`),id:z(`value-match/v1`),data:U({subject:z(`explicit-value`),matcher:G([U({state:z(`declared`),name:sy}),U({state:z(`unavailable`)})])})}),U({kind:z(`builtin`),id:z(`numeric-comparison/v1`),data:U({comparator:K(Bv),threshold:gv,subject:G([U({kind:z(`explicit-value`)}),U({kind:z(`scope-metric`),metric:z(`tokens`),scope:K([`turn`,`session`,`attempt`]),unit:z(`tokens`)}),U({kind:z(`scope-metric`),metric:z(`cost`),scope:K([`turn`,`session`,`attempt`]),unit:z(`usd`)}),U({kind:z(`collection-cardinality`),collection:z(`tool-calls`),scope:K([`turn`,`session`,`attempt`])})])})}),U({kind:z(`builtin`),id:z(`scope-status/v1`),data:U({scope:K([`turn`,`session`,`attempt`]),assertion:K([`succeeded`,`no-failed-actions`])})}),U({kind:z(`builtin`),id:z(`occurrence/v1`),data:U({scope:K([`turn`,`session`,`attempt`]),occurrence:K([`tool`,`skill`,`event`]),assertion:K([`present`,`absent`,`count`,`order`]),matcher:L(sy),quantifier:L(G([U({kind:z(`absent`)}),U({kind:K([`at-least`,`exact`]),count:fy})]))})}),U({kind:z(`builtin`),id:z(`occurrence/v2`),data:U({scope:K([`turn`,`session`,`attempt`]),occurrence:K([`tool`,`skill`,`event`]),assertion:K([`present`,`absent`,`count`,`order`]),matcher:L(sy),quantifier:L(G([U({kind:z(`absent`)}),U({kind:z(`exact`),count:fy}),U({kind:K([`at-least`,`less-than`,`at-most`,`greater-than`]),count:py})]))})}),U({kind:z(`builtin`),id:z(`judge-measurement/v1`),data:U({recipe:B,scale:z(`unit-interval`)})}),U({kind:z(`builtin`),id:z(`judge-measurement/v2`),data:U({name:B,scale:z(`unit-interval`)})}),U({kind:z(`builtin`),id:z(`llm-measurement/v1`),data:U({name:B,scale:z(`unit-interval`)})}),G([U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`changed-paths`),paths:W(sy)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`no-changes`)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`file-changed`),path:sy,status:L(K([`added`,`modified`,`deleted`])),before:L(sy),after:L(sy)})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`file-deleted`),path:sy})}),U({kind:z(`builtin`),id:z(`sandbox-result/v1`),data:U({operation:z(`not-in-diff`),pattern:sy,flags:sy,content:K([`added`,`removed`,`both`])})})]),U({kind:z(`builtin`),id:z(`direct-score/v1`),data:U({source:z(`author`)})})]),Ty]),Dy=G([U({state:z(`complete`)}),U({state:z(`partial`),reason:K([`sampled`,`truncated`,`redacted`,`provider-limited`])}),U({state:z(`unavailable`),reason:K([`not-collected`,`source-unavailable`,`producer-failed`])}),U({state:z(`not-applicable`),reason:K([`optional-material`,`unsupported-subject`])})]),Oy=G([U({kind:z(`redacted`),fieldCount:dy}),U({kind:z(`sampled`),captured:dy,knownTotal:L(dy)}),U({kind:z(`truncated`),omittedBytes:dy}),U({kind:z(`provider-limited`)})]),ky=U({state:z(`not-scored`)}),Ay=U({state:z(`earned`),points:my,earned:my}).check(Y(e=>e.earned<=e.points,{identifier:`AssertionEarnedScore`,description:`an earned score no greater than its points`})),jy=U({state:z(`unavailable`),points:my,reason:K([`source-unavailable`,`evaluation-errored`,`not-applicable`])});function My(e){return e.matched+e.mismatched+e.unavailable!==e.examined||e.knownTotal!==null&&e.examined>e.knownTotal||e.complete&&e.knownTotal===null?!1:!e.exhaustive||e.knownTotal!==null&&e.examined===e.knownTotal}var Ny=U({examined:dy,matched:dy,mismatched:dy,unavailable:dy,knownTotal:q(dy),complete:H,exhaustive:H,decisive:H}).check(Y(My,{identifier:`AssertionCollectionReceipt`,description:`a collection receipt whose counts and completion boundary agree`})),Py=lv(()=>G([U({kind:z(`unavailable`),reason:K([`not-recorded`,`not-declared`,`source-unavailable`])}),U({kind:z(`value`),value:G([Z_,H,gv,sy])}),U({kind:z(`text`),text:sy}),U({kind:z(`list`),items:W(Py)}),U({kind:z(`fields`),fields:W(U({label:sy,value:Py}))})])),Fy=G([U({state:z(`exact`)}),U({state:z(`unavailable`),reason:K([`historical-not-recorded`,`source-unavailable`,`ambiguous`])})]),Iy=G([U({kind:z(`tool-occurrence`),toolOccurrenceId:ly,relation:Fy}),U({kind:z(`event`),eventId:ly,toolOccurrenceId:L(ly),relation:Fy})]),Ly=W(U({locator:Iy,result:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),difference:L(Py)})).check(Y(e=>e.length<=8,{identifier:`MatcherRetainedRows`,description:`at most eight representative matcher rows`})),Ry=U({step:fy,summary:Py}),zy=U({family:z(`niceeval.agent-turns`),schemaVersion:fy}),By=K([`complete`,`partial`,`unavailable`]),Vy=U({scope:z(`turn`),sessionId:ly,turnId:ly,scopeId:ly,throughSessionSequence:dy,source:zy,collectionAtCut:By}),Hy=U({scope:z(`session`),sessionId:ly,scopeId:ly,throughSessionSequence:dy,source:zy,collectionAtCut:By}),Uy=G([Vy,Hy,U({scope:z(`attempt`),scopeId:ly,sessions:W(U({sessionId:ly,throughSessionSequence:dy})).check(Y(e=>e.every((t,n)=>n===0||e[n-1].sessionId<t.sessionId),{identifier:`MatcherAttemptVectorCut`,description:`a unique vector cut in canonical session identity order`})),source:zy,collectionAtCut:By})]),Wy=U({sourceRows:dy,comparisons:dy,unavailableComparisons:dy,definitePrefixLength:dy,possiblePrefixLength:dy,stepReceipts:W(U({step:fy,comparisons:dy,matched:dy,mismatched:dy,unavailable:dy}).check(Y(e=>e.matched+e.mismatched+e.unavailable===e.comparisons,{identifier:`MatcherOrderStepReceipt`,description:`an order step receipt whose result counts equal its comparisons`}))),complete:H,exhaustive:H,decisive:H}),Gy=U({step:fy,locator:Iy,sessionId:ly,sessionSequence:fy,result:K([`matched`,`unavailable`])}),Ky=U({longestDefinitePrefix:W(Gy),longestPossiblePrefix:W(Gy),firstBlockingStep:fy,suffixChecked:Ny,representatives:Ly});function qy(e,t,n,r){if(e.length!==n)return!1;let i=0;for(let[n,a]of e.entries()){if(a.step!==n+1||a.sessionId!==t.sessionId||a.sessionSequence<=i||a.sessionSequence>t.throughSessionSequence||r===`matched`&&a.result!==`matched`||a.result===`matched`&&a.locator.relation.state!==`exact`)return!1;i=a.sessionSequence}return!0}function Jy(e){let t=e.querySteps.length,n=e.receipt;if(e.querySteps.some((e,t)=>e.step!==t+1)||n.stepReceipts.length!==t||n.stepReceipts.some((e,t)=>e.step!==t+1)||n.definitePrefixLength>n.possiblePrefixLength||n.possiblePrefixLength>t||n.comparisons!==n.stepReceipts.reduce((e,t)=>e+t.comparisons,0)||n.unavailableComparisons!==n.stepReceipts.reduce((e,t)=>e+t.unavailable,0)||n.complete!==(e.sourceSnapshot.collectionAtCut===`complete`)||n.stepReceipts.some(e=>e.comparisons>n.sourceRows)||n.stepReceipts.some((e,t)=>t>0&&e.comparisons!==n.stepReceipts[0].comparisons)||n.exhaustive&&n.stepReceipts.some(e=>e.comparisons!==n.sourceRows))return!1;switch(e.result.state){case`matched`:return n.definitePrefixLength===t&&n.possiblePrefixLength===t&&n.decisive&&qy(e.result.witnessPath,e.sourceSnapshot,t,`matched`);case`mismatched`:{let r=e.result.failureFrontier;return n.complete&&n.exhaustive&&n.decisive&&n.possiblePrefixLength<t&&r.firstBlockingStep===n.possiblePrefixLength+1&&r.suffixChecked.complete&&r.suffixChecked.exhaustive&&r.suffixChecked.decisive&&r.suffixChecked.knownTotal===r.suffixChecked.examined&&r.suffixChecked.matched===0&&r.suffixChecked.unavailable===0&&qy(r.longestDefinitePrefix,e.sourceSnapshot,n.definitePrefixLength,`matched`)&&qy(r.longestPossiblePrefix,e.sourceSnapshot,n.possiblePrefixLength,`possible`)}case`unavailable`:return e.result.reason.length>0&&!n.decisive}}var Yy=U({kind:z(`collection-filter`),sourceSnapshot:Uy,query:Ry,receipt:Ny,retainedRows:Ly}).check(Y(e=>e.query.step===1&&e.receipt.knownTotal!==null&&e.receipt.complete===(e.sourceSnapshot.collectionAtCut===`complete`),{identifier:`MatcherCollectionFilterArtifact`,description:`a collection matcher artifact with one query and a matching source cut`})),Xy=G([U({state:z(`matched`),witnessPath:W(Gy)}),U({state:z(`mismatched`),failureFrontier:Ky}),U({state:z(`unavailable`),reason:ly})]),Zy=U({kind:z(`ordered-sequence`),sourceSnapshot:G([Vy,Hy]),querySteps:W(Ry).check(Y(e=>e.length>=2&&e.length<=64,{identifier:`MatcherOrderQuerySteps`,description:`between two and 64 ordered matcher query steps`})),receipt:Wy,result:Xy,retainedRows:Ly}).check(Y(Jy,{identifier:`MatcherOrderedSequenceArtifact`,description:`an ordered matcher artifact with consistent receipts, paths, and cut`}));function Qy(e){try{return qv(JSON.stringify(e))<=Hv}catch{return!1}}var $y=G([Yy,Zy]).check(Y(Qy,{identifier:`MatcherQueryArtifactSize`,description:`a matcher query artifact no larger than 64 KiB`})),eb=G([U({kind:z(`boolean`),expected:z(!0)}),U({kind:z(`at-least`),threshold:my}),U({kind:z(`record-only`)})]),tb=U({requirement:G([U({state:z(`available`),value:K([`required`,`optional`])}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),condition:G([U({state:z(`available`),value:eb}),U({state:z(`unavailable`),reason:z(`not-recorded`)})])});G([U({state:z(`matched`),gate:K([`not-gate`,`satisfied`]),score:G([ky,Ay]),diagnostic:L(xy),receipt:L(Ny)}),U({state:z(`mismatched`),reason:z(`condition-not-met`),gate:K([`not-gate`,`failed`]),score:G([ky,Ay]),diagnostic:L(xy),receipt:L(Ny)}),U({state:z(`unavailable`),reason:K([`evidence-unavailable`,`source-unavailable`,`redacted`]),gate:K([`not-gate`,`unavailable`]),score:G([ky,jy]),diagnostic:L(xy),receipt:L(Ny)}),U({state:z(`errored`),reason:K([`evaluator-failed`,`producer-interrupted`,`invalid-subject`]),gate:K([`not-gate`,`unavailable`]),score:G([ky,jy]),diagnostic:L(xy),receipt:L(Ny)}),U({state:z(`not-applicable`),reason:z(`coverage-not-applicable`),gate:K([`not-gate`,`not-applicable`]),score:G([ky,jy]),diagnostic:L(xy),receipt:L(Ny)})]);function nb(e){let t=W(e),n=W(R(Oy)),r=U({source:e,evidence:t,coverage:R(Dy),limitations:n}).check(Y(e=>oy(e),{identifier:`AssertionCoverageLimitations`,description:`coverage and limitations with a consistent sealed relationship`})),i=U({observed:R(Py),receipt:L(R(Ny))}),a=G([U({kind:z(`ordinary`),observed:R(Py),receipt:L(R(Ny))}),U({kind:z(`matcher-current`),observed:R(Py),artifact:R($y),receipt:L(X_)}),U({kind:z(`matcher-legacy`),observed:R(Py),reason:z(`historical-not-recorded`),legacyDiagnostic:L(R(Py)),receipt:L(X_)})]),o=U({result:K([`matched`,`mismatched`,`unavailable`,`errored`,`not-applicable`]),reason:q(K([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`])),gate:K([`not-gate`,`satisfied`,`failed`,`unavailable`,`not-applicable`])}),s=G([U({state:z(`retained`),value:R(Py)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),c=U({entryId:R(Sy),display:R(Cy),criterion:G([U({state:z(`available`),value:R(xy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:i,decision:o,policy:R(tb),contribution:G([R(ky),R(Ay),R(jy)]),explanationRetention:s}),l=U({entryId:R(Sy),display:R(Cy),criterion:G([U({state:z(`available`),value:R(xy)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:R(tb),contribution:G([R(ky),R(Ay),R(jy)]),explanationRetention:s}).check(Y(e=>e.evaluation.kind===`ordinary`||e.explanationRetention.state===`unavailable`,{identifier:`MatcherExplanationOwnership`,description:`matcher artifacts and legacy diagnostics are not duplicated in explanation retention`})),u=W(c).check(Y(e=>e.length<=zv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),d=W(l).check(Y(e=>e.length<=zv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`})),f=U({entries:d}).check(Y(ay,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),Y(iy,{identifier:`AssertionsDocumentSize`,description:`a JSON document no larger than 4 MiB`})),p=U({entryId:R(Sy),display:R(Cy),criterion:G([U({state:z(`available`),value:R(Ey)}),U({state:z(`unavailable`),reason:z(`not-recorded`)})]),materials:r,evaluation:a,decision:o,policy:R(tb),contribution:G([R(ky),R(Ay),R(jy)]),explanationRetention:s}),m=U({entries:W(p).check(Y(e=>e.length<=zv.entries,{identifier:`AssertionsEntryCount`,description:`at most 4,096 assertion entries`}))}).check(Y(ay,{identifier:`AssertionsUniqueEntryIds`,description:`unique attachment-local assertion entry IDs`}),Y(iy,{identifier:`AssertionsDocumentSize`,description:`a JSON document no larger than 4 MiB`}));return Object.freeze({material:e,entry:p,entries:d,historicalV2Entries:u,outerDocument:f,document:m})}Object.freeze({code:`assertions-document-invalid`});var rb=/^@1[0-9A-HJKMNP-TV-Z]{12}$/;B.pipe(uv(e=>rb.test(e),{identifier:`AttemptLocator`,description:`a canonical @-prefixed Attempt locator`})),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);var ib=`@niceeval/record/RecordId`,ab=`@niceeval/record/RunId`,ob=`@niceeval/record/SlotId`,sb=`@niceeval/record/AttemptId`,cb=`@niceeval/record/UtcMillis`,lb=`@niceeval/record/RecordAttachmentName`,ub=`@niceeval/record/RecordAttachmentSchemaId`,db=`@niceeval/record/RecordFormatId`,fb=`@niceeval/record/ExperimentId`,pb=`@niceeval/record/EvalId`,mb=`@niceeval/record/ExecutionIdentityDigest`,hb=`@niceeval/record/Sha256Digest`,gb=`@niceeval/record/SourceItemId`,_b=`@niceeval/record/FileChangeId`,vb=`@niceeval/record/ArtifactId`,yb=`@niceeval/record/RecordBlobKey`,bb=`@niceeval/record/SourceSegmentId`,xb=`@niceeval/record/CanonicalRunRelativePath`,Sb=`@niceeval/record/CanonicalProjectRelativePath`,Cb=`niceeval.record.attachments`,wb=/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/,Tb=/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,Eb=`[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?`,Db=RegExp(`^(?:${Eb}\\.)+${Eb}$`),Ob=/^niceeval\.record\.attachments$/,kb=/^[a-f0-9]{64}$/;function Ab(e){return wb.test(e)&&!Tb.test(e)}function jb(e,t){return e===t?0:e<t?-1:1}function Mb(e){return Number.isSafeInteger(e)&&e>=0}function Nb(e){return e.length>0&&e.length<=1024&&!/[\u0000-\u001f\u007f]/.test(e)}function Pb(e){return kb.test(e)}function Fb(e){return Ab(e)}function Ib(e){return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e)}function Lb(e){return e.length>0&&e.length<=4096&&!e.startsWith(`/`)&&!e.startsWith(`\\`)&&!e.includes(`\\`)&&e.split(`/`).every(Ab)}function Rb(e){return e.length>0&&e.length<=4096&&!e.startsWith(`/`)&&!e.startsWith(`\\`)&&!e.includes(`\\`)&&!/[\u0000-\u001f\u007f]/.test(e)&&e.split(`/`).every(e=>e.length>0&&e!==`.`&&e!==`..`)}function zb(e){return e.length<=255&&Ab(e)&&Db.test(e)}function Bb(e){return zb(e)?{name:e,version:`1`}:void 0}function Vb(e){let t=Bb(e);return t!==void 0&&zb(t.name)}function Hb(e){return Ob.test(e)}var Ub=B.check(Y(Ab,{identifier:`RecordPortableSegment`,description:`an ASCII portable file-name segment without path separators or reserved device names`})),Wb=Ub.pipe(dv(ib)),Gb=Ub.pipe(dv(ab)),Kb=Ub.pipe(dv(ob)),qb=Ub.pipe(dv(sb)),Jb=B.check(Y(Nb,{identifier:`RecordDomainIdentity`,description:`a bounded durable identity without control characters`})),Yb=Jb.pipe(dv(fb)),Xb=Jb.pipe(dv(pb)),Zb=B.check(Y(Pb,{identifier:`ExecutionIdentityDigest`,description:`a lowercase hexadecimal SHA-256 execution identity digest`})).pipe(dv(mb)),Qb=B.check(Y(Pb,{identifier:`Sha256Digest`,description:`a lowercase hexadecimal SHA-256 digest`})).pipe(dv(hb)),$b=Ub.pipe(dv(gb)),ex=Ub.pipe(dv(_b)),tx=Ub.pipe(dv(vb)),nx=B.check(Y(Fb,{identifier:`RecordBlobKey`,description:`an opaque portable Attachment blob key`})).pipe(dv(yb));B.check(Y(Ib,{identifier:`SourceSegmentId`,description:`a bounded opaque source receipt segment identity`})).pipe(dv(bb)),B.check(Y(Lb,{identifier:`CanonicalRunRelativePath`,description:`a slash-separated portable path inside one sealed Run`})).pipe(dv(xb));var rx=B.check(Y(Rb,{identifier:`CanonicalProjectRelativePath`,description:`a slash-separated project-relative path without dot segments`})).pipe(dv(Sb)),ix=V.check(Y(Mb,{identifier:`UtcMillis`,description:`a non-negative JSON-safe Unix-epoch millisecond value`})).pipe(dv(cb));B.check(Y(zb,{identifier:`RecordAttachmentName`,description:`a lowercase reverse-domain portable Attachment name`})).pipe(dv(lb)),B.check(Y(Vb,{identifier:`RecordAttachmentSchemaId`,description:`a RecordAttachment name followed by /vN`})).pipe(dv(ub)),B.check(Y(Hb,{identifier:`RecordFormatId`,description:`the current generic Attachment Record format identity`})).pipe(dv(db));var ax=K([Cb]).pipe(dv(db)),ox=new TextEncoder,sx=Object.freeze({"$niceeval.record.blob-ref":!0});function cx(e,t,n){e.failure===void 0&&(e.failure=Object.freeze({code:t,path:Object.freeze([...n])}))}function lx(e,t){if(e===t)return 0;let n=ox.encode(e),r=ox.encode(t),i=Math.min(n.byteLength,r.byteLength);for(let e=0;e<i;e+=1){let t=n[e]-r[e];if(t!==0)return t}return n.byteLength-r.byteLength}function ux(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function dx(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function fx(e,t){let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0&&`value`in n&&n.enumerable===!0)return Object.freeze({value:n.value})}function px(e,t){let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0&&`value`in n)return Object.freeze({value:n.value})}function mx(e,t,n,r,i){if(t>r.maximumDepth||(i.nodes+=1,i.nodes>r.maximumNodes))return cx(i,`record-json-limit-exceeded`,n),!1;if(typeof e==`string`){if(!ux(e))return cx(i,`record-json-invalid`,n),!1;if(ox.encode(e).byteLength>r.maximumStringUtf8Bytes)return cx(i,`record-json-limit-exceeded`,n),!1}return!0}function hx(e,t,n,r){let i=Reflect.ownKeys(e);if(i.some(e=>typeof e!=`string`))return cx(r,`record-json-invalid`,t);if(i.length>n.maximumObjectKeys)return cx(r,`record-json-limit-exceeded`,t);let a=i;for(let e of a){if(!ux(e))return cx(r,`record-json-invalid`,[...t,e]);if(e.length===0||ox.encode(e).byteLength>n.maximumKeyUtf8Bytes)return cx(r,`record-json-limit-exceeded`,[...t,e])}return Object.freeze([...a].sort(lx))}function gx(e){let t=Object.create(null);for(let[n,r]of e)Object.defineProperty(t,n,{configurable:!1,enumerable:!0,value:r,writable:!1});return Object.freeze(t)}function _x(e,t,n,r,i,a){if(e.length>r.maximumArrayItems)return cx(a,`record-json-limit-exceeded`,n);let o=new Set([`length`]);for(let t=0;t<e.length;t+=1)o.add(String(t));let s=Reflect.ownKeys(e);if(s.length!==o.size||s.some(e=>typeof e!=`string`||!o.has(e)))return cx(a,`record-json-invalid`,n);let c=px(e,`length`);if(c===void 0||c.value!==e.length)return cx(a,`record-json-invalid`,n);let l=[];for(let o=0;o<e.length;o+=1){let s=fx(e,String(o));if(s===void 0)return cx(a,`record-json-invalid`,[...n,String(o)]);let c=yx(s.value,t+1,[...n,String(o)],r,i,a);if(c===void 0)return;l.push(c)}return Object.freeze(l)}function vx(e,t,n,r,i,a){let o=hx(e,n,r,a);if(o===void 0)return;let s=[];for(let c of o){let o=fx(e,c);if(o===void 0)return cx(a,`record-json-invalid`,[...n,c]);let l=yx(o.value,t+1,[...n,c],r,i,a);if(l===void 0)return;s.push([c,l])}return gx(s)}function yx(e,t,n,r,i,a){if(mx(e,t,n,r,a)){if(e===null||typeof e==`boolean`||typeof e==`string`)return e;if(typeof e==`number`)return Number.isFinite(e)&&!Object.is(e,-0)?e:cx(a,`record-json-invalid`,n);if(typeof e!=`object`)return cx(a,`record-json-invalid`,n);try{if(i.isBlobRef?.(e))return e;if(a.ancestors.has(e))return cx(a,`record-json-invalid`,n);a.ancestors.add(e);try{return Array.isArray(e)?_x(e,t,n,r,i,a):dx(e)?vx(e,t,n,r,i,a):cx(a,`record-json-invalid`,n)}finally{a.ancestors.delete(e)}}catch{return cx(a,`record-json-invalid`,n)}}}function bx(e,t){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(typeof e!=`object`)return;if(t.isBlobRef?.(e))return sx;if(Array.isArray(e)){let n=[];for(let r of e){let e=bx(r,t);if(e===void 0)return;n.push(e)}return Object.freeze(n)}if(!dx(e))return;let n=[];for(let r of Object.keys(e).sort(lx)){let i=bx(e[r],t);if(i===void 0)return;n.push([r,i])}return gx(n)}function xx(e){let t=JSON.stringify(e);return t===void 0?void 0:ox.encode(t).byteLength}function Sx(e,t,n={}){let r={nodes:0,ancestors:new WeakSet,failure:void 0},i=yx(e,0,[],t,n,r);if(i===void 0)return Qu(r.failure??Object.freeze({code:`record-json-invalid`,path:Object.freeze([])}));let a=bx(i,n),o=a===void 0?void 0:xx(a);return o===void 0||o>t.maximumJsonBytes?Qu(Object.freeze({code:`record-json-limit-exceeded`,path:Object.freeze([])})):Zu(i)}var Cx=Object.freeze({errors:`all`,exact:!0,onExcessProperty:`error`}),wx=Object.freeze({kind:`schema`,issues:Object.freeze([])});function Tx(e){try{let t=km()(e.issue).issues.map(e=>Object.freeze({path:Object.freeze((e.path??[]).map(e=>typeof e==`object`&&e&&`key`in e?e.key:e)),message:e.message}));return Object.freeze({kind:`schema`,issues:Object.freeze(t)})}catch{return wx}}function Ex(e){if(e.cause.reasons.length===1){let[t]=e.cause.reasons;if(t!==void 0&&Dp(t)&&V_(t.error))return Tx(t.error)}throw e.cause}function Dx(e){return Object.freeze({kind:`canonical`,failure:e})}function Ox(e){for(let[t,n]of Object.entries(e))if(!Number.isSafeInteger(n)||n<=0)throw TypeError(`Record schema limit ${t} must be a positive safe integer`);return Object.freeze({...e})}function kx(e){return e===null||typeof e==`boolean`||typeof e==`string`||typeof e==`number`&&Number.isFinite(e)&&!Object.is(e,-0)}function Ax(e,t){if(e.context?.isOptional!==!0)return Nx(e,t);if(e._tag===`Never`)return!0;if(e._tag!==`Union`)return Nx(e,t);let n=!1;for(let r of e.types){if(r._tag===`Undefined`||r._tag===`Never`){n=!0;continue}if(!Nx(r,t))return!1}return n}function jx(e,t){return e.propertySignatures.every(e=>typeof e.name==`string`&&e.name.length>0&&Ax(e.type,t))&&e.indexSignatures.every(e=>e.parameter._tag===`String`&&Ax(e.type,t))}function Mx(e,t){if(e.encoding===void 0)return!0;if(e._tag!==`Objects`||e.encoding.length!==1)return!1;let n=e.encoding[0];return n.transformation._tag!==`Transformation`||n.to._tag!==`Objects`||e.propertySignatures.length!==n.to.propertySignatures.length||e.indexSignatures.length!==n.to.indexSignatures.length?!1:jx(n.to,t)}function Nx(e,t){let n=t.states.get(e);if(n===`allowed`||n===`pending`)return!0;if(n===`rejected`)return!1;t.states.set(e,`pending`);let r;try{switch(e._tag){case`Literal`:r=kx(e.literal);break;case`Null`:case`String`:case`Number`:case`Boolean`:r=!0;break;case`Objects`:r=jx(e,t);break;case`Arrays`:r=e.elements.every(e=>Nx(e,t))&&e.rest.every(e=>Nx(e,t));break;case`Union`:r=e.types.every(e=>Nx(e,t));break;case`Suspend`:r=Nx(e.thunk(),t);break;case`Declaration`:r=t.declarations.has(e)||t.getAttachmentDeclaration?.(e)!==void 0;break;default:r=!1}}catch{r=!1}return r&&=Mx(e,t),!r&&t.failure===void 0&&(t.failure=e._tag),t.states.set(e,r?`allowed`:`rejected`),r}function Px(e){let t=[...e.attachmentDeclarations??[],...e.blobRef===void 0?[]:[{schema:e.blobRef.schema,isValue:e.blobRef.isBlobRef}]];if(t.some(e=>e.schema.ast._tag!==`Declaration`))throw TypeError(`Record Attachment opaque values must be Effect Schema Declarations`);let n={declarations:new Set(t.map(e=>e.schema.ast)),getAttachmentDeclaration:e.getAttachmentDeclaration,states:new WeakMap,failure:void 0};if(!Nx(e.schema.ast,n))throw TypeError(`Record schema may contain only canonical JSON nodes, Schema.encodeKeys transformations, and its minted Attachment BlobRef (rejected ${n.failure??`AST`})`)}function Fx(e,t,n,r=new WeakSet){if(r.has(e))return;r.add(e);let i=t.attachmentDeclarations?.find(t=>t.schema.ast===e)?.metadata,a=t.getAttachmentDeclaration?.(e);if(i!==void 0||a!==void 0){n.push(i??a?.metadata);return}switch(e._tag){case`Objects`:for(let i of e.propertySignatures)Fx(i.type,t,n,r);for(let i of e.indexSignatures)Fx(i.type,t,n,r);break;case`Arrays`:for(let i of e.elements)Fx(i,t,n,r);for(let i of e.rest)Fx(i,t,n,r);break;case`Union`:for(let i of e.types)Fx(i,t,n,r);break;case`Suspend`:Fx(e.thunk(),t,n,r)}}function Ix(e,t,n=new WeakSet){if(typeof e!=`object`||!e||t?.(e)===!0||n.has(e))return e;n.add(e);for(let r of Object.values(Object.getOwnPropertyDescriptors(e)))`value`in r&&Ix(r.value,t,n);return Object.freeze(e),e}function Lx(e){Px(e);let t=Ox(e.limits),n=[...e.attachmentDeclarations??[],...e.blobRef===void 0?[]:[{schema:e.blobRef.schema,isValue:e.blobRef.isBlobRef}]],r=n.length===0?{}:{isBlobRef:t=>n.some(e=>e.isValue(t))||e.isAttachmentOpaque?.(t)!==void 0},i=H_(e.schema,Cx),a=G_(e.schema,Cx),o=H_(R(e.schema),Cx),s=[];Fx(e.schema.ast,e,s);let c=e=>{let n=Sx(e,t,r);return $u(n)?Qu(Dx(n.failure)):Zu(n.success)},l=(t,r,i)=>{let a=t=>{let r=n.find(e=>e.schema.ast===t);return r===void 0?e.getAttachmentDeclaration?.(t):{metadata:`metadata`in r?r.metadata:void 0}},o=new WeakMap,s=(e,t)=>{let n=a(e);if(n!==void 0){let e=r(t,n.metadata);return e._tag===`matched`?{matched:!0,value:e.value}:{matched:!1,value:t}}if(typeof t!=`object`||!t)return{matched:!1,value:t};let i=o.get(t)?.get(e);if(i!==void 0)return{matched:!1,value:i};switch(e._tag){case`Suspend`:return s(e.thunk(),t);case`Objects`:{let n={...t},r=o.get(t)??new WeakMap;r.set(e,n),o.set(t,r);let i=!1;for(let r of e.propertySignatures){if(typeof r.name!=`string`)continue;let e=Object.getOwnPropertyDescriptor(t,r.name);if(e!==void 0&&`value`in e){let t=s(r.type,e.value);i||=t.matched,n[r.name]=t.value}}return i?{matched:!0,value:n}:{matched:!1,value:t}}case`Arrays`:{if(!Array.isArray(t))return{matched:!1,value:t};let n=[...t],r=o.get(t)??new WeakMap;r.set(e,n),o.set(t,r);let i=!1;for(let r=0;r<e.elements.length;r+=1){let a=s(e.elements[r],t[r]);i||=a.matched,n[r]=a.value}if(e.rest.length>0)for(let r=e.elements.length;r<t.length;r+=1){let a=s(e.rest[0],t[r]);i||=a.matched,n[r]=a.value}return i?{matched:!0,value:n}:{matched:!1,value:t}}case`Union`:for(let n of e.types){let e=s(n,t);if(e.matched)return e}return{matched:!1,value:t};default:return{matched:!1,value:t}}};return s(i===`type`?e.schema.ast:qg(e.schema.ast),t).value};return Object.freeze({schema:e.schema,limits:t,opaqueDeclarationMetadata:Object.freeze(s),decode:e=>{let t=c(e);if($u(t))return Qu(t.failure);let n=i(t.success);if(Pp(n))return Qu(Ex(n));let a=o(n.value);if(Pp(a))return Qu(Ex(a));let s=c(a.value);if($u(s))return Qu(s.failure);let l=o(s.success);return Pp(l)?Qu(Ex(l)):Zu(Ix(l.value,r.isBlobRef))},enumerateOpaque:t=>{let r=[],i=new WeakMap,a=t=>{let r=n.find(e=>e.schema.ast===t);return r===void 0?e.getAttachmentDeclaration?.(t):{metadata:`metadata`in r?r.metadata:void 0,accepts:r.isValue}},o=(e,t)=>{let n=a(e);if(n!==void 0){typeof t==`object`&&t&&n.accepts(t)&&r.push(Object.freeze({value:t,metadata:n.metadata}));return}if(typeof t!=`object`||!t)return;let s=i.get(t)??new WeakSet;if(!s.has(e))switch(s.add(e),i.set(t,s),e._tag){case`Suspend`:o(e.thunk(),t);return;case`Objects`:for(let n of e.propertySignatures){if(typeof n.name!=`string`)continue;let e=Object.getOwnPropertyDescriptor(t,n.name);e!==void 0&&`value`in e&&o(n.type,e.value)}return;case`Arrays`:if(!Array.isArray(t))return;for(let n=0;n<e.elements.length;n+=1)o(e.elements[n],t[n]);if(e.rest.length>0)for(let n=e.elements.length;n<t.length;n+=1)o(e.rest[0],t[n]);return;case`Union`:for(let n of e.types)o(n,t);return}};return o(e.schema.ast,t),Object.freeze(r)},mapOpaque:(e,t)=>l(e,t,`type`),mapOpaqueEncoded:(e,t)=>l(e,t,`encoded`),encode:e=>{let t=c(e);if($u(t))return Qu(t.failure);let n=a(t.success);return Pp(n)?Qu(Ex(n)):c(n.value)}})}var Rx=K([`record-attachment-owner-invalid`,`record-attachment-schema-id-mismatch`,`record-attachment-schema-invalid`,`record-attachment-payload-invalid`,`record-attachment-json-invalid`,`record-attachment-blob-refs-invalid`,`record-attachment-blob-ref-illegal`,`record-attachment-blob-ref-missing`,`record-attachment-blob-ref-extra`,`record-attachment-blob-ref-duplicate`,`record-attachment-closure-mismatch`,`record-attachment-snapshot-bytes-invalid`,`record-attachment-blob-budget-exceeded`,`record-attachment-materialized-invalid`,`record-attachment-family-invalid`]);function zx(e,t=[]){return Object.freeze({code:e,path:Object.freeze([...t])})}var Bx=class extends Error{code;cause;constructor(e=`invalid-family-definition`,t){super(e===`migration-chain-invalid`?`Invalid Record Attachment migration chain`:`Invalid Record Attachment family definition`,{cause:t}),this.code=e,this.cause=t,this.name=`RecordAttachmentSpiDefinitionError`}},Vx=Symbol(`@niceeval/record/RecordAttachmentDefinition`),Hx=Symbol(`@niceeval/record/RecordAttachmentPersistence`),Ux=new WeakMap,Wx=new WeakMap,Gx=new WeakSet,Kx=new WeakMap,qx=new WeakMap,Jx=new WeakMap;function Yx(e){let t=qx.get(e);if(t!==void 0||!ah(e)||!oh(e))return t;if(!(e.typeParameters.length!==0||e.checks!==void 0||e.encoding!==void 0||e.context!==void 0||e.encodingChecks!==void 0||e.encodingRun!==void 0&&e.encodingRun!==e.run))return Jx.get(e.run)}function Xx(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function Zx(e){return e===`run`||e===`attempt`}function Qx(e){throw new Bx(`invalid-family-definition`,e)}function $x(e){return e.ast.context===void 0}function eS(e){(!Zx(e.owner)||!zb(e.family)||!$x(e.schema)||e.validate!==void 0&&typeof e.validate!=`function`)&&Qx();let t={maximumJsonBytes:1048576,maximumDepth:64,maximumNodes:1e5,maximumObjectKeys:1e4,maximumArrayItems:1e5,maximumKeyUtf8Bytes:16384,maximumStringUtf8Bytes:1048576},n=Object.freeze({owner:e.owner,family:e.family,schema:e.schema,validate:e.validate,[Vx]:()=>({owner:e.owner,family:e.family})});try{Ux.set(n,Object.freeze({codec:Lx({schema:e.schema,limits:t,attachmentDeclarations:[{schema:Mv,isValue:Lv,metadata:Fv(Mv)},{schema:Nv,isValue:Rv,metadata:Fv(Nv)}],getAttachmentDeclaration:e=>{let t=aS(e);if(t!==void 0)return t;let n=Fv(e);return n===void 0?void 0:Object.freeze({metadata:n,accepts:n.kind===`text`?Lv:Rv})},isAttachmentOpaque:e=>iS(e)?{category:`reference`}:Iv(e)?{category:`content`}:void 0})}))}catch(e){Qx(e)}return n}function tS(e){(!nS(e.attachment)||!Xx(e.revision))&&Qx();let t=Object.freeze({attachment:e.attachment,revision:e.revision,[Hx]:()=>({attachment:e.attachment,revision:e.revision})});return Gx.add(t),t}Object.freeze({to(e,t){let n=rS(e);n===void 0&&Qx();let r=R_(e=>{let r=iS(e)?Kx.get(e):void 0;return r!==void 0&&r.definition===n&&(t===void 0||!$u(W_(t)(r.value)))},{identifier:`RecordAttachmentReference<${n.owner}:${n.family}>`});return qx.set(r,Object.freeze({definition:n,valueSchema:t})),qx.set(r.ast,Object.freeze({definition:n,valueSchema:t})),Jx.set(r.ast.run,Object.freeze({definition:n,valueSchema:t})),r}});function nS(e){return typeof e==`object`&&!!e&&Ux.has(e)}function rS(e){return nS(e)?e:typeof e==`object`&&e||typeof e==`function`?Wx.get(e):void 0}function iS(e){return typeof e==`object`&&!!e&&Kx.has(e)}function aS(e){let t=Yx(e);return t===void 0?void 0:Object.freeze({metadata:Object.freeze({category:`reference`,definition:t.definition,valueSchema:t.valueSchema}),accepts:e=>iS(e)&&Kx.get(e)?.definition===t.definition&&(t.valueSchema===void 0||!$u(W_(t.valueSchema)(Kx.get(e)?.value)))})}var oS=ov(U({code:K(`record-schema-invalid.record-run-time-order-invalid.record-run-context-invalid.record-run-context-size-exceeded.record-run-context-experiment-mismatch.record-run-order-invalid.record-expected-slot-order-invalid.record-expected-slot-duplicate.record-run-duplicate.record-member-slot-order-invalid.record-member-slot-duplicate.record-member-slot-unexpected.record-member-slot-missing.record-member-action-invalid.record-attempt-order-invalid.record-attempt-duplicate.record-attempt-owner-invalid.record-attempt-slot-unexpected.record-attempt-slot-mismatch.record-attempt-eval-mismatch.record-attempt-digest-mismatch.record-attempt-reference-missing.record-origin-member-missing.record-origin-member-duplicate.record-attachment-schema-id-mismatch.record-fixed-family-owner-invalid`.split(`.`)),path:W(B)}));function sS(e,t=[]){return Object.freeze({code:e,path:Object.freeze([...t])})}function cS(e){let[t,...n]=e;if(t===void 0)return;let r=[t,...n];return Object.freeze(r)}var lS=K([`record`,`run`,`member`,`attempt`,`attachment-envelope`,`record-core`]),uS=K([`record-schema-invalid`,`record-invariant-invalid`]);Ev()(`RecordCodecError`,{code:uS,document:lS,issues:oS}),Ev()(`RecordCoreInvalid`,{code:z(`record-core-invalid`),issues:oS}),Ev()(`RecordReferenceInvalid`,{code:z(`record-reference-invalid`)}),Ev()(`RecordAttachmentEnvelopeInvalid`,{code:z(`record-attachment-envelope-invalid`),issues:oS});function dS(e){let t=Lx({schema:e.schema,limits:e.limits});return Object.freeze({...t,kind:`core`})}var fS=[`completed`,`errored`,`cancelled`,`interrupted`],pS=[`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`],mS=[`executed`,`carried`,`accepted`],hS=[`not-dispatched`,`interrupted`],gS=`niceeval.record-attachment`,_S=[`run`,`attempt`];function vS(e){return`${e.originRunId}\u0000${e.attemptId}`}var yS=`niceeval.run/v1`,bS=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0))),xS=K([`active`,`completed`,`interrupted`,`failed`]),SS=K([`early-exit-satisfied`,`budget-exhausted`,`stopped-by-failure`,`interrupted-before-publication`,`dispatch-failed`]),CS=U({state:z(`pending`)}),wS=U({state:z(`published`),action:K([`executed`,`carried`,`accepted`]),attemptId:B,attemptLocator:B,originRunId:B,originSlotId:B}),TS=U({state:z(`absent`),reason:SS}),ES=U({slotId:B,evalId:B,attemptOrdinal:bS,executionIdentityDigest:B,publication:G([CS,wS,TS])}),DS=U({published:bS,expected:bS,missing:bS}),OS=U({runId:B,invocationId:B,experimentId:B,state:xS,startedAt:B,completedAt:L(B),coverage:DS}),kS=OS.pipe(ev({slots:W(ES)}));U({identity:B,revision:bS}),G([U({protocol:z(yS),operation:z(`run.list`),runs:W(OS),continuation:L(B)}),U({protocol:z(yS),operation:z(`run.get`),run:kS})]);var AS=Object.freeze({maximumJsonBytes:262144,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8192}),jS=lv(()=>G([Z_,H,V,B,W(jS),rv(B,jS)])),MS=rv(B,jS),NS=B.pipe(J(_v(1))),PS=U({name:NS,contract:NS,behaviorRevision:q(NS)}),FS=dS({schema:U({experimentId:Yb,execution:U({adapter:PS,model:q(B),reasoningEffort:q(B),flags:MS,experimentHooks:J_(U({version:z(1),setup:K([`absent`,`opaque`]),teardown:K([`absent`,`opaque`])}))}),labels:rv(B,B)}),limits:AS}),IS=FS.schema;function LS(e){let t=cS([e.kind===`canonical`?sS(e.failure.code===`record-json-limit-exceeded`?`record-run-context-size-exceeded`:`record-run-context-invalid`,e.failure.path):sS(`record-run-context-invalid`)]);if(t===void 0)throw Error(`Run context failure must contain one issue`);return t}function RS(e){let t=FS.decode(e);return $u(t)?Qu(LS(t.failure)):Zu(t.success)}function zS(e){let t=RS(e);return $u(t)?t.failure:Object.freeze([])}function BS(e,t,n){for(let r of n)e.push(sS(r.code,[...t,...r.path]))}function VS(e,t){return e===void 0||jb(e,t)<0}function HS(e){let t=[],n=new Set,r=new Set,i;for(let[a,o]of e.entries()){let e=[`expectedSlots`,String(a),`slotId`];VS(i,o.slotId)||t.push(sS(i===o.slotId?`record-expected-slot-duplicate`:`record-expected-slot-order-invalid`,e)),n.has(o.slotId)&&i!==o.slotId&&t.push(sS(`record-expected-slot-duplicate`,e));let s=`${o.evalId}\u0000${String(o.attemptOrdinal)}`;r.has(s)&&t.push(sS(`record-expected-slot-duplicate`,[`expectedSlots`,String(a),`attemptOrdinal`])),n.add(o.slotId),r.add(s),i=o.slotId}return Object.freeze(t)}function US(e){let t=[];e.completedAt<e.startedAt&&t.push(sS(`record-run-time-order-invalid`,[`completedAt`])),BS(t,[`context`],zS(e.context));let n=RS(e.context);return ed(n)&&n.success.experimentId!==e.experimentId&&t.push(sS(`record-run-context-experiment-mismatch`,[`context`,`experimentId`])),BS(t,[],HS(e.expectedSlots)),Object.freeze(t)}function WS(e){return(e.action===`executed`||e.action===`carried`||e.action===`accepted`)==(e.attempt!==null)?Object.freeze([]):Object.freeze([sS(`record-member-action-invalid`,[`attempt`])])}function GS(e){return Object.freeze([])}function KS(e){return[`runs`,String(e)]}function qS(e,t){return[...KS(e),`members`,String(t)]}function JS(e,t){return[...KS(e),`attempts`,String(t)]}function YS(e){return vS(e)}function XS(e){return new Map(e.expectedSlots.map(e=>[e.slotId,e]))}function ZS(e,t){return e.slotId===t.slotId&&e.evalId===t.evalId&&e.attemptOrdinal===t.attemptOrdinal&&e.executionIdentityDigest===t.executionIdentityDigest}function QS(e,t,n){let r=XS(e.run),i=new Set,a;for(let[o,s]of e.members.entries()){let e=qS(t,o);BS(n,e,WS(s)),VS(a,s.slotId)||n.push(sS(a===s.slotId?`record-member-slot-duplicate`:`record-member-slot-order-invalid`,[...e,`slotId`])),i.has(s.slotId)&&a!==s.slotId&&n.push(sS(`record-member-slot-duplicate`,[...e,`slotId`])),r.has(s.slotId)||n.push(sS(`record-member-slot-unexpected`,[...e,`slotId`])),i.add(s.slotId),a=s.slotId}for(let[r,a]of e.run.expectedSlots.entries())i.has(a.slotId)||n.push(sS(`record-member-slot-missing`,[...KS(t),`run`,`expectedSlots`,String(r),`slotId`]))}function $S(e){let t=[],n=new Map,r=new Map,i;for(let[a,o]of e.runs.entries()){let e=o.run.runId,s=KS(a);VS(i,e)||t.push(sS(i===e?`record-run-duplicate`:`record-run-order-invalid`,[...s,`run`,`runId`])),n.has(e)&&i!==e&&t.push(sS(`record-run-duplicate`,[...s,`run`,`runId`])),n.set(e,a),i=e,BS(t,[...s,`run`],US(o.run)),QS(o,a,t);let c=XS(o.run),l;for(let[n,i]of o.attempts.entries()){let o=JS(a,n);if(BS(t,o,GS(i)),VS(l,i.attemptId)||t.push(sS(l===i.attemptId?`record-attempt-duplicate`:`record-attempt-order-invalid`,[...o,`attemptId`])),l=i.attemptId,i.originRunId!==e){t.push(sS(`record-attempt-owner-invalid`,[...o,`originRunId`]));continue}let s=c.get(i.slotId);s===void 0?t.push(sS(`record-attempt-slot-unexpected`,[...o,`slotId`])):(s.evalId!==i.evalId&&t.push(sS(`record-attempt-eval-mismatch`,[...o,`evalId`])),s.executionIdentityDigest!==i.executionIdentityDigest&&t.push(sS(`record-attempt-digest-mismatch`,[...o,`executionIdentityDigest`])));let u=YS({originRunId:e,attemptId:i.attemptId});r.has(u)?t.push(sS(`record-attempt-duplicate`,[...o,`attemptId`])):r.set(u,{runIndex:a,attemptIndex:n,attempt:i})}}let a=new Map;for(let[n,i]of e.runs.entries())for(let[o,s]of i.members.entries()){if(s.attempt===null)continue;let c=qS(n,o),l=r.get(YS(s.attempt));if(l===void 0){t.push(sS(`record-attempt-reference-missing`,[...c,`attempt`]));continue}if(s.action!==`accepted`){let n=XS(i.run).get(s.slotId),r=XS(e.runs[l.runIndex].run).get(l.attempt.slotId);(n===void 0||r===void 0||!ZS(n,r))&&t.push(sS(`record-attempt-slot-mismatch`,[...c,`attempt`]))}if(s.action===`executed`){if(s.attempt.originRunId!==i.run.runId){t.push(sS(`record-member-action-invalid`,[...c,`action`]));continue}let e=YS(s.attempt);a.set(e,(a.get(e)??0)+1)}else s.attempt.originRunId===i.run.runId&&t.push(sS(`record-member-action-invalid`,[...c,`action`]))}for(let[e,n]of r.entries()){let r=a.get(e)??0,i=JS(n.runIndex,n.attemptIndex);r===0?t.push(sS(`record-origin-member-missing`,i)):r>1&&t.push(sS(`record-origin-member-duplicate`,i))}return Object.freeze(t)}var eC=Object.freeze({maximumJsonBytes:1048576,maximumDepth:8,maximumNodes:4096,maximumObjectKeys:64,maximumArrayItems:256,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:8192}),tC=Object.freeze({...eC,maximumJsonBytes:8388608,maximumNodes:32768,maximumArrayItems:4096});function nC(e){return e.length===0?void 0:e.map(e=>({path:e.path,issue:e.code}))}var rC=K(fS),iC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordAttemptOrdinal`,description:`a zero-based non-negative JSON-safe attempt ordinal`}))),aC=dS({schema:U({originRunId:Gb,attemptId:qb}),limits:eC}).schema,oC=dS({schema:U({slotId:Kb,evalId:Xb,attemptOrdinal:iC,executionIdentityDigest:Zb}),limits:eC}).schema,sC=dS({schema:U({format:ax,recordId:Wb}),limits:eC}).schema,cC=dS({schema:U({runId:Gb,experimentId:Yb,context:IS,startedAt:ix,completedAt:ix,expectedSlots:W(oC)}).pipe(J(Y(e=>nC(US(e)),{identifier:`RecordRunDocumentInvariant`,description:`a Run document with valid chronology, context, and expected Slots`}))),limits:eC}).schema,lC=dS({schema:G([U({slotId:Kb,action:K(mS),attempt:aC}),U({slotId:Kb,action:K(hS),attempt:Z_,absenceReason:SS})]).pipe(J(Y(e=>nC(WS(e)),{identifier:`RecordMemberDocumentInvariant`,description:`a Member action paired with its required Attempt reference`}))),limits:eC}).schema,uC=dS({schema:U({attemptId:qb,originRunId:Gb,slotId:Kb,evalId:Xb,executionIdentityDigest:Zb,outcome:rC}).pipe(J(Y(e=>nC(GS(e)),{identifier:`RecordAttemptDocumentInvariant`,description:`an Attempt document satisfying its local invariant`}))),limits:eC}).schema,dC=dS({schema:U({run:cC,members:W(lC),attempts:W(uC)}),limits:tC}).schema;dS({schema:U({record:sC,runs:W(dC)}).pipe(J(Y(e=>nC($S(e)),{identifier:`RecordCoreInvariant`,description:`a complete Record Core with consistent Run, Member, and Attempt documents`}))),limits:tC}).schema;var fC=Cx,pC=oC,mC=cC,hC=lC,gC=uC;W_(G([U({format:z(`niceeval.attempt-publication-closure/v1`),originRun:mC}),U({originRun:mC})]),{errors:`all`,onExcessProperty:`error`}),K(pS);var _C=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0))),vC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>0))),yC=U({sha256:Qb,byteLength:_C}),bC=U({key:nx,sha256:Qb,byteLength:_C}),xC=U({owner:K(_S),family:B.pipe(J(Y(zb)))});function SC(e){let t;for(let n of e.contents){if(t!==void 0&&t>=n.key)return!1;t=n.key}let n;for(let t of e.references){let e=`${t.owner}\u0000${t.family}`;if(n!==void 0&&n>=e)return!1;n=e}return!0}U({format:K([gS]),ownerKind:K(_S),family:B.pipe(J(Y(zb))),schemaVersion:vC,payload:yC,contents:W(bC),references:W(xC)}).pipe(J(Y(SC)));var CC=Object.freeze({run:`run`,attempt:`attempt`});Object.freeze({maximumJsonBytes:16777216,maximumDepth:32,maximumNodes:2e5,maximumObjectKeys:5e4,maximumArrayItems:1e5,maximumKeyUtf8Bytes:256,maximumStringUtf8Bytes:1048576});var wC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`RecordNonNegativeSafeInteger`,description:`a non-negative JSON-safe integer`}))),TC=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>0,{identifier:`RecordPositiveSafeInteger`,description:`a positive JSON-safe integer`})));V.pipe(J(Y(e=>Number.isFinite(e)&&e>=0,{identifier:`RecordFiniteNonNegativeNumber`,description:`a finite non-negative JSON number`})));var EC=B.pipe(J(Y(e=>new TextEncoder().encode(e).byteLength<=16384&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(e),{identifier:`RecordSafeText`,description:`bounded text without NUL or unsafe control characters`}))),DC=B.pipe(J(Y(e=>/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(e),{identifier:`RecordSafeIdentifier`,description:`a bounded ASCII identifier`}))),OC=B.pipe(J(Y(e=>e.length>0&&e.length<=255&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+(?:;[!#$%&'*+.^_`|~0-9A-Za-z-]+=[!#$%&'*+.^_`|~0-9A-Za-z-]+)*$/.test(e),{identifier:`RecordMediaType`,description:`a bounded MIME media type without free-form parameters`}))),kC=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:DC}),U({code:K([`collection-cap-reached`,`unsupported-input`]),omittedAtLeast:TC})]),AC=av([]).pipe(J(Y(e=>e.length===0,{identifier:`RecordEmptyArray`,description:`an exact empty array`}))),jC=G([U({state:z(`complete`),limitations:AC}),U({state:z(`partial`),limitations:ov(kC)})]);function MC(e){let t,n=new Set;for(let r of e){if(n.has(r)||t!==void 0&&t>=r)return!1;n.add(r),t=r}return!0}var NC=Object.freeze({maximumArtifacts:4e3,maximumContentBytes:1073741824}),PC=U({artifactId:tx,mediaType:R(OC),label:R(EC),byteLength:wC,sha256:Qb,content:Nv.pipe(Pv.maximumBytes(NC.maximumContentBytes))}),FC=U({collection:R(jC),artifacts:W(PC)}).pipe(nv({collection:`collection-data`,artifacts:`artifacts-data`}));function IC(e){return zx(`record-attachment-schema-invalid`,e)}function LC(e){let t=[];e.artifacts.length>NC.maximumArtifacts&&t.push(IC([`artifacts`])),MC(e.artifacts.map(e=>e.artifactId))||t.push(IC([`artifacts`,`artifactId`]));for(let[n,r]of e.artifacts.entries())r.byteLength>NC.maximumContentBytes&&t.push(IC([`artifacts`,String(n),`byteLength`]));return Object.freeze(t)}var RC=eS({owner:CC.attempt,family:`niceeval.artifacts`,schema:FC,validate:LC}),zC=eS({owner:CC.run,family:`niceeval.artifacts`,schema:FC,validate:LC});tS({attachment:RC,revision:2}),tS({attachment:zC,revision:2}),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);var BC=Object.freeze({defaultBytes:65536,maximumBytes:262144}),VC=wC,HC=wC.pipe(J(Y(e=>e>0&&e<=BC.maximumBytes))),UC=U({artifactId:tx,offset:L(VC),limit:L(HC)}),WC=G([U({state:z(`not-found`),artifactId:tx}),U({state:z(`available`),artifactId:tx,name:R(EC),mediaType:R(OC),byteLength:wC,sha256:Qb,offset:VC,base64:B.pipe(J(Y(e=>e.length<=Math.ceil(BC.maximumBytes/3)*4&&e.length%4==0&&/^[A-Za-z0-9+/]*={0,2}$/.test(e)))),nextOffset:q(VC)})]);hf(`InspectionArtifactError`),W_(UC,fC),W_(U({"$niceeval.record.content":B}),fC);var{content:GC,...KC}=PC.fields,qC=wC.pipe(J(Y(e=>e>0&&e<=128))),JC=U(KC),YC=U({collection:R(jC),artifacts:W(JC)});W_(U({"$niceeval.record.content":B}),fC),Object.freeze({conversation:Object.freeze({maxPayloadBytes:2097152,maxItems:2048,maxTurns:256,maxClosureBytes:0}),commands:Object.freeze({maxPayloadBytes:2097152,maxItems:256,maxClosureBytes:33554432}),usage:Object.freeze({maxPayloadBytes:1048576,maxItems:2048,maxClosureBytes:0}),timing:Object.freeze({maxPayloadBytes:1048576,maxItems:4096,maxClosureBytes:0}),diagnostics:Object.freeze({maxPayloadBytes:524288,maxItems:512,maxClosureBytes:0})});var XC=`@niceeval/o11y/NonNegativeSafeInteger`,ZC=`@niceeval/o11y/PositiveSafeInteger`,QC=`@niceeval/o11y/SafeIdentifier`,$C=`@niceeval/o11y/SourceNativeToolName`,ew=`@niceeval/o11y/StableLabel`,tw=`@niceeval/o11y/SafeText`,nw=`@niceeval/o11y/CanonicalDecimal`,rw=`@niceeval/o11y/CurrencyCode`,iw=new TextEncoder,aw=/^[a-z][a-z0-9.-]{0,63}$/,ow=/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/,sw=/^[A-Z]{3}$/,cw=/[\u0000-\u0009\u000B-\u001F]/u;function lw(e){return iw.encode(e).byteLength}function uw(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(n<56320||n>57343)return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function dw(e){return Number.isSafeInteger(e)&&e>=0}function fw(e){return Number.isSafeInteger(e)&&e>0}function pw(e){return dw(e)?e:void 0}function mw(e){return fw(e)?e:void 0}function hw(e){return lw(e)<=64&&aw.test(e)}function gw(e){return lw(e)<=64&&aw.test(e)}function _w(e){return e.length>0&&!e.includes(`
18
- `)&&yw(e,256)}function vw(e){return uw(e)&&!cw.test(e)}function yw(e,t){return Number.isSafeInteger(t)&&t>=0&&vw(e)&&lw(e)<=t}function bw(e){return lw(e)<=64&&ow.test(e)}function xw(e){return sw.test(e)}var Sw=`@niceeval/o11y/TurnId`,Cw=`@niceeval/o11y/ItemId`,ww=`@niceeval/o11y/CallId`,Tw=`@niceeval/o11y/EventId`,Ew=`@niceeval/o11y/ToolOccurrenceId`,Dw=`@niceeval/o11y/SessionScopeId`,Ow=`@niceeval/o11y/LegacySourceLocalCallId`,kw=`@niceeval/o11y/CommandId`,Aw=`@niceeval/o11y/UsageObservationId`,jw=`@niceeval/o11y/IntervalId`,Mw=`@niceeval/o11y/DiagnosticId`;Object.freeze([`turn`,`item`,`call`,`event`,`tool-occurrence`,`session-scope`,`command`,`usage-observation`,`interval`,`diagnostic`]);var Nw=`[0123456789abcdefghjkmnpqrstvwxyz]`,Pw=Object.freeze({turn:`turn_`,item:`item_`,call:`call_`,event:`event_`,"tool-occurrence":`tool_`,"session-scope":`session_`,command:`command_`,"usage-observation":`usage_`,interval:`interval_`,diagnostic:`diagnostic_`});function Fw(e){return RegExp(`^${e}${Nw}{26}$`)}var Iw=Fw(Pw.turn),Lw=Fw(Pw.item),Rw=Fw(Pw.call),zw=Fw(Pw.event),Bw=Fw(Pw[`tool-occurrence`]),Vw=Fw(Pw[`session-scope`]),Hw=Fw(Pw.command),Uw=Fw(Pw[`usage-observation`]),Ww=Fw(Pw.interval),Gw=Fw(Pw.diagnostic);function Kw(e){return Iw.test(e)}function qw(e){return Lw.test(e)}function Jw(e){return Rw.test(e)}function Yw(e){return zw.test(e)}function Xw(e){return Bw.test(e)}function Zw(e){return Vw.test(e)}function Qw(e){return Rw.test(e)}function $w(e){return Hw.test(e)}function eT(e){return Uw.test(e)}function tT(e){return Ww.test(e)}function nT(e){return Gw.test(e)}Object.freeze([`niceeval.agent-turns`,`niceeval.sandbox-commands`,`niceeval.runner-activities`,`niceeval.runner-diagnostics`]),Object.freeze([`niceeval.runner-activities`,`niceeval.runner-diagnostics`]);function rT(e){return typeof e==`object`&&!!e}function iT(e,t){let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}function aT(e){if(!rT(e))return!1;let t=iT(e,`family`),n=iT(e,`kind`),r=iT(e,`id`);return typeof t==`string`&&typeof n==`string`&&typeof r==`string`}function oT(e){if(!aT(e))return!1;switch(e.kind){case`turn`:return e.family===`niceeval.agent-turns`&&Kw(e.id);case`item`:return e.family===`niceeval.agent-turns`&&qw(e.id);case`call`:return e.family===`niceeval.agent-turns`&&Jw(e.id);case`event`:return e.family===`niceeval.agent-turns`&&Yw(e.id);case`tool-occurrence`:return e.family===`niceeval.agent-turns`&&Xw(e.id);case`session-scope`:return e.family===`niceeval.agent-turns`&&Zw(e.id);case`command`:return e.family===`niceeval.sandbox-commands`&&$w(e.id);case`usage-observation`:return e.family===`niceeval.agent-turns`&&eT(e.id);case`interval`:return e.family===`niceeval.runner-activities`&&tT(e.id);case`diagnostic`:return e.family===`niceeval.runner-diagnostics`&&nT(e.id);default:return!1}}function sT(e){return aT(e)?e.family===`niceeval.runner-activities`&&e.kind===`interval`&&tT(e.id)||e.family===`niceeval.runner-diagnostics`&&e.kind===`diagnostic`&&nT(e.id):!1}function cT(e,t){return e===t?0:e<t?-1:1}function lT(e,t){let n=cT(e.family,t.family);if(n!==0)return n;let r=cT(e.kind,t.kind);return r===0?cT(e.id,t.id):r}function uT(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!oT(t)||n!==void 0&&lT(n,t)>=0)return!1;n=t}return!0}function dT(e,t){if(e.length>16)return!1;let n;for(let t of e){if(!sT(t)||n!==void 0&&lT(n,t)>=0)return!1;n=t}return!0}var fT=Object.freeze([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]),pT=Object.freeze([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]);function mT(e,t){return e.some(e=>e===t)}function hT(e){return mT(fT,e)}function gT(e){return mT(pT,e)}function _T(e){switch(e.code){case`stream-truncated`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return e.stream===`stdout`?`command-stdout`:`command-stderr`;default:return e.target}}function vT(e){switch(e.code){case`text-truncated`:return e.target===`conversation-text`?e.itemId:e.target===`command-manifest`?e.commandId:e.diagnosticId;case`stream-truncated`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return e.commandId;default:return``}}function yT(e){return e.code===`capture-failed`||e.code===`capture-interrupted`?e.stage:``}function bT(e){return[e.code,_T(e),vT(e),yT(e)].join(`\0`)}function xT(e,t){let n=cT(e.code,t.code);if(n!==0)return n;let r=cT(_T(e),_T(t));if(r!==0)return r;let i=cT(vT(e),vT(t));return i===0?cT(yT(e),yT(t)):i}function ST(e){return e===`stdout`||e===`stderr`}function CT(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return gT(e.stage)&&hT(e.target);case`collection-cap-reached`:return hT(e.target)&&dw(e.retained)&&fw(e.omittedAtLeast);case`unsupported-input`:return hT(e.target)&&fw(e.omittedAtLeast);case`text-truncated`:return dw(e.retainedBytes)&&fw(e.omittedBytes)&&(e.target===`conversation-text`&&qw(e.itemId)||e.target===`command-manifest`&&$w(e.commandId)||e.target===`diagnostic`&&nT(e.diagnosticId));case`stream-truncated`:return $w(e.commandId)&&ST(e.stream)&&dw(e.retainedBytes)&&fw(e.omittedBytes);case`invalid-utf8-replaced`:return $w(e.commandId)&&ST(e.stream)&&fw(e.replacementCount);case`unsafe-control-stripped`:return $w(e.commandId)&&ST(e.stream)&&fw(e.strippedCount);case`redacted`:return hT(e.target)&&fw(e.replacementCount)}}function wT(e){let t=[];(e.state===`complete`&&e.limitations.length!==0||e.state===`partial`&&e.limitations.length===0)&&t.push(Object.freeze({code:`observability-collection-state-invalid`}));let n,r=new Set;for(let[i,a]of e.limitations.entries()){let e=pw(i);if(e===void 0)throw Error(`Array index must be a safe integer`);if(!CT(a)){t.push(Object.freeze({code:`observability-limitation-invalid`,index:e}));continue}if(n!==void 0&&xT(n,a)>=0){let e=mw(i);if(e===void 0)throw Error(`Non-first array index must be positive`);t.push(Object.freeze({code:`observability-limitation-order-invalid`,index:e}))}let o=bT(a);if(r.has(o)){let e=mw(i);if(e===void 0)throw Error(`Duplicate cannot be at index zero`);t.push(Object.freeze({code:`observability-limitation-duplicate`,index:e}))}r.add(o),n=a}return Object.freeze(t)}var TT=`niceeval.query/v1`,ET=`2.0.0`;function DT(e,t=new Set){if(e===null||typeof e==`string`||typeof e==`boolean`)return!0;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||t.has(e))return!1;let n=new Set(t);if(n.add(e),Array.isArray(e))return e.every(e=>DT(e,n));let r=Object.getPrototypeOf(e);return r!==Object.prototype&&r!==null?!1:Object.values(e).every(e=>DT(e,n))}var OT=U({state:z(`available`),byteLength:V,sha256:B,base64:B}),kT=U({state:z(`available`),byteLength:V,sha256:B}),AT=G([U({kind:z(`unavailable`),reason:z(`not-recorded`)}),U({kind:z(`content`),content:G([OT,kT]),encoding:K([`json`,`utf-8`,`binary`]),byteLength:V,preview:q(B)})]),jT=G([U({state:z(`available`),request:B}),U({state:z(`invalid`)}),U({state:z(`unsupported`),schemaVersion:V})]),MT=U({state:K([`unavailable`,`errored`]),code:B,message:B}),NT=U({ordinal:V,transport:z(`attempted`),result:G([U({state:z(`returned`),response:B}),U({state:z(`failed`),code:B,message:B}),U({state:z(`interrupted`)})])}),PT=R_(DT),FT=G([U({ordinal:V,operation:K([`score`,`classify`,`extract`,`batchClassify`]),state:z(`rejected`),transport:z(`not-sent`),failure:MT}),U({ordinal:V,operation:K([`score`,`classify`,`extract`,`batchClassify`]),state:z(`admitted`),request:B,attempts:W(NT),result:G([U({state:z(`completed`),output:B}),MT,U({state:z(`interrupted`)})])})]),IT=U({schemaVersion:z(1),protocol:z(`niceeval.score-match-audit/v1`),definition:U({name:B,version:B,config:B,digest:B,limits:U({maxCalls:V,maxMaterialBytes:V,maxAuditBytes:V})}),input:B,calls:W(FT),result:G([U({state:z(`measured`),value:V}),MT,U({state:z(`interrupted`)})])}),LT=U({rubric:B,anchors:W(U({measurement:V,description:B})),material:PT}),RT=U({rubric:B,choices:W(B),material:PT}),zT=U({rubric:B,choices:W(B),items:W(U({id:B,text:B})),material:PT}),BT=G([U({operation:z(`score`),input:LT}),U({operation:z(`classify`),input:RT}),U({operation:z(`batchClassify`),input:zT})]),VT=G([U({ordinal:V,operation:K([`score`,`classify`,`extract`,`batchClassify`]),state:z(`rejected`),transport:z(`not-sent`),failure:MT}),U({ordinal:V,operation:K([`score`,`classify`,`batchClassify`]),state:z(`admitted`),request:B,attempts:W(NT),mapping:BT,result:G([U({state:z(`completed`),output:B}),MT,U({state:z(`interrupted`)})])})]),HT=U({schemaVersion:z(2),protocol:z(`niceeval.score-match-audit/v2`),definition:U({name:B,version:B,config:B,digest:B,limits:U({maxCalls:V,maxMaterialBytes:V,maxAuditBytes:V})}),input:B,calls:W(VT),result:G([U({state:z(`measured`),value:V}),MT,U({state:z(`interrupted`)})])}),UT=U({schemaVersion:z(3),protocol:z(`niceeval.score-match-audit/v3`),definition:U({name:B,version:B,config:B,digest:B,limits:U({maxCalls:V,maxMaterialBytes:V,maxAuditBytes:V})}),input:B,images:W(U({imageId:B,evidenceIndex:V,mediaType:K([`image/png`,`image/jpeg`]),byteLength:V,sha256:B,paths:W(B)})),calls:W(G([U({ordinal:V,operation:K([`score`,`classify`,`extract`,`batchClassify`]),state:z(`rejected`),transport:z(`not-sent`),failure:MT}),U({ordinal:V,operation:K([`score`,`classify`,`extract`,`batchClassify`]),state:z(`admitted`),requestTemplate:B,wireBody:U({byteLength:V,sha256:B}),attempts:W(NT),result:FT.members[1].fields.result})])),result:G([U({state:z(`measured`),value:V}),MT,U({state:z(`interrupted`)})])}),WT=G([U({state:z(`available`),audit:G([IT,HT,UT])}),U({state:z(`invalid`)}),U({state:z(`unsupported`),schemaVersion:V})]),GT=nb(AT).entry,KT=U({...GT.fields,judgeMaterial:L(jT),scoreMatchAudit:L(WT)}),qT=U({entryId:Sy,sourceOrder:V,role:K([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),source:U({sourceItemId:B,sha256:B}),start:U({line:V,column:V}),end:U({line:V,column:V})}),JT=G([Py,eb]),YT=K([`condition-not-met`,`evidence-unavailable`,`source-unavailable`,`redacted`,`evaluator-failed`,`producer-interrupted`,`invalid-subject`,`coverage-not-applicable`,`not-recorded`,`not-declared`]),XT=lv(()=>U({label:B,state:B,expected:q(JT),observed:q(Py),reason:q(YT),anchor:q(Py),children:W(XT)})),ZT=K([`historical-not-recorded`,`source-unavailable`,`ambiguous`]),QT=G([U({state:z(`exact`),turnId:B,eventId:B,anchor:B}),U({state:z(`unavailable`),reason:ZT})]),$T=G([U({kind:z(`tool-occurrence`),toolOccurrenceId:B}),U({kind:z(`event`),eventId:B})]),eE=U({kind:K([`tool`,`event`,`legacy-source-row`]),rowId:B,number:B,phase:K([`at-evaluation`,`outside-evaluation-snapshot`,`historical`]),summary:B,detail:Py,locator:L($T),evaluation:U({result:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`,`not-retained`,`outside-snapshot`,`legacy`]),difference:L(Py)}),conversationTarget:QT}),tE=G([U({state:z(`unavailable`),reason:ZT,rows:av([]),limitations:av([])}),U({state:K([`complete`,`partial`]),rows:W(eE),limitations:W(Py)})]),nE=G([U({kind:z(`collection-filter`),summary:Py}),U({kind:z(`ordered-sequence`),summaries:W(Py)})]),rE=U({step:V,summary:Py,state:K([`matched`,`possible`,`blocked`,`not-reached`]),sourceRow:L(B),conversationTarget:L(QT)}),iE=G([U({state:z(`legacy`),subject:K([`tool`,`event`,`source-row`]),query:U({state:z(`unavailable`),reason:z(`historical-not-recorded`)}),source:U({final:tE,atEvaluation:tE}),identityRelation:U({state:z(`unavailable`),reason:z(`historical-not-recorded`)}),overlayRetention:z(`unavailable`),steps:av([]),legacyDiagnostic:L(Py)}),U({state:z(`current`),subject:K([`tool`,`event`,`source-row`]),query:nE,receipt:G([Ny,Wy]),source:U({final:tE,atEvaluation:tE}),identityRelation:G([U({state:z(`exact`)}),U({state:z(`unavailable`),reason:K([`source-unavailable`,`ambiguous`])})]),overlayRetention:K([`complete`,`partial`,`unavailable`]),steps:W(rE)})]),aE=U({state:z(`unavailable`),reason:z(`not-recorded`)}),oE=U({state:z(`missing`),sourceState:K([`not-recorded`,`invalid`]),comparator:Z_,sourceLedger:Z_,receipt:Z_,result:Z_,targets:av([]),debugger:Z_,sandboxCommandJoin:aE}),sE=G([oE,U({state:z(`ordinary`),sourceState:Z_,comparator:Z_,sourceLedger:q(Ny),receipt:q(Ny),result:Z_,targets:av([]),debugger:Z_,sandboxCommandJoin:aE}),U({state:z(`legacy`),sourceState:z(`unavailable`),comparator:Z_,sourceLedger:Z_,receipt:Z_,result:Z_,targets:av([]),reason:z(`historical-not-recorded`),debugger:iE,sandboxCommandJoin:aE}),U({state:z(`available`),sourceState:K([`complete`,`partial`,`unavailable`]),comparator:q(G([Ry,W(Ry)])),sourceLedger:U({sourceSnapshot:Uy,receipt:G([Ny,Wy])}),receipt:G([Ny,Wy]),result:q(Xy),targets:W(U({state:K([`matched`,`mismatched`,`unavailable`,`not-evaluated`]),anchor:$T,difference:q(Py)})),debugger:iE,sandboxCommandJoin:aE})]),cE=R(G([U({entryId:B,state:K([`not-recorded`,`invalid`]),issues:L(W(U({code:Rx,path:W(B)}))),sourceSites:av([]),check:XT,matcher:oE}),U({entryId:Sy,display:R(Cy),entry:R(KT),sourceSites:W(qT),check:XT,matcher:sE})]));Object.freeze({errors:`all`,onExcessProperty:`error`});var lE=V.pipe(J(Y(dw,{identifier:`ObservabilityNonNegativeSafeInteger`,description:`a JSON-safe non-negative integer`})),dv(XC)),uE=V.pipe(J(Y(fw,{identifier:`ObservabilityPositiveSafeInteger`,description:`a positive JSON-safe integer`})),dv(ZC)),dE=B.pipe(J(Y(hw,{identifier:`ObservabilitySafeIdentifier`,description:`a lowercase ASCII identifier no longer than 64 bytes`})),dv(QC));B.pipe(J(Y(gw,{identifier:`ObservabilityStableLabel`,description:`a provider-neutral lowercase ASCII label no longer than 64 bytes`})),dv(ew));var fE=B.pipe(J(Y(vw,{identifier:`ObservabilitySafeText`,description:`strict UTF-8 text without NUL or C0 controls other than LF`})),dv(tw)),pE=B.pipe(J(Y(_w,{identifier:`ObservabilitySourceNativeToolName`,description:`a non-empty source-native tool name no longer than 256 UTF-8 bytes`})),dv($C)),mE=B.pipe(J(Y(bw,{identifier:`ObservabilityCanonicalDecimal`,description:`a non-negative canonical decimal string no longer than 64 bytes`})),dv(nw)),hE=B.pipe(J(Y(xw,{identifier:`ObservabilityCurrencyCode`,description:`an uppercase three-letter currency code`})),dv(rw)),gE=B.pipe(J(Y(Kw,{identifier:`ObservabilityTurnId`,description:`a turn_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Sw)),_E=B.pipe(J(Y(qw,{identifier:`ObservabilityItemId`,description:`an item_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Cw)),vE=B.pipe(J(Y(Jw,{identifier:`ObservabilityCallId`,description:`a call_ identifier with 26 lowercase Crockford base-32 characters`})),dv(ww)),yE=B.pipe(J(Y(Qw,{identifier:`ObservabilityLegacySourceLocalCallId`,description:`a v1 source-local call identifier`})),dv(Ow)),bE=B.pipe(J(Y(Yw,{identifier:`ObservabilityEventId`,description:`an event_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Tw)),xE=B.pipe(J(Y(Xw,{identifier:`ObservabilityToolOccurrenceId`,description:`a tool_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Ew)),SE=B.pipe(J(Y(Zw,{identifier:`ObservabilitySessionScopeId`,description:`a session_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Dw)),CE=B.pipe(J(Y($w,{identifier:`ObservabilityCommandId`,description:`a command_ identifier with 26 lowercase Crockford base-32 characters`})),dv(kw)),wE=B.pipe(J(Y(eT,{identifier:`ObservabilityUsageObservationId`,description:`a usage_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Aw)),TE=B.pipe(J(Y(tT,{identifier:`ObservabilityIntervalId`,description:`an interval_ identifier with 26 lowercase Crockford base-32 characters`})),dv(jw)),EE=B.pipe(J(Y(nT,{identifier:`ObservabilityDiagnosticId`,description:`a diagnostic_ identifier with 26 lowercase Crockford base-32 characters`})),dv(Mw)),DE=K([`conversation-item`,`conversation-text`,`command-manifest`,`command-stdout`,`command-stderr`,`usage-observation`,`timing-interval`,`diagnostic`]).pipe(J(Y(hT,{identifier:`ObservabilityCollectionTarget`,description:`a closed Observability collection target`}))),OE=K([`adapter`,`command-capture`,`usage-capture`,`timing-capture`,`diagnostic-capture`,`attempt-finalizer`,`run-teardown`]).pipe(J(Y(gT,{identifier:`ObservabilityCollectionStage`,description:`a closed Observability capture stage`}))),kE=G([U({code:z(`capture-failed`),stage:OE,target:DE}),U({code:z(`capture-interrupted`),stage:OE,target:DE}),U({code:z(`collection-cap-reached`),target:DE,retained:lE,omittedAtLeast:uE}),U({code:z(`unsupported-input`),target:DE,omittedAtLeast:uE}),U({code:z(`text-truncated`),target:z(`conversation-text`),itemId:_E,retainedBytes:lE,omittedBytes:uE}),U({code:z(`text-truncated`),target:z(`command-manifest`),commandId:CE,retainedBytes:lE,omittedBytes:uE}),U({code:z(`text-truncated`),target:z(`diagnostic`),diagnosticId:EE,retainedBytes:lE,omittedBytes:uE}),U({code:z(`stream-truncated`),commandId:CE,stream:K([`stdout`,`stderr`]),retainedBytes:lE,omittedBytes:uE}),U({code:z(`invalid-utf8-replaced`),commandId:CE,stream:K([`stdout`,`stderr`]),replacementCount:uE}),U({code:z(`unsafe-control-stripped`),commandId:CE,stream:K([`stdout`,`stderr`]),strippedCount:uE}),U({code:z(`redacted`),target:DE,replacementCount:uE})]).pipe(J(Y(CT,{identifier:`ObservabilityLimitation`,description:`a semantically valid closed Observability limitation`})));G([U({state:z(`complete`),limitations:av([])}),U({state:z(`partial`),limitations:ov(kE)})]).pipe(J(Y(e=>wT(e).length===0,{identifier:`ObservabilityCollection`,description:`a complete empty or partial canonically ordered limitation collection`})));var AE=U({family:z(`niceeval.agent-turns`),kind:z(`turn`),id:gE}),jE=U({family:z(`niceeval.agent-turns`),kind:z(`item`),id:_E}),ME=U({family:z(`niceeval.agent-turns`),kind:z(`call`),id:vE}),NE=U({family:z(`niceeval.agent-turns`),kind:z(`event`),id:bE}),PE=U({family:z(`niceeval.agent-turns`),kind:z(`tool-occurrence`),id:xE}),FE=U({family:z(`niceeval.agent-turns`),kind:z(`session-scope`),id:SE}),IE=U({family:z(`niceeval.sandbox-commands`),kind:z(`command`),id:CE}),LE=U({family:z(`niceeval.agent-turns`),kind:z(`usage-observation`),id:wE}),RE=U({family:z(`niceeval.runner-activities`),kind:z(`interval`),id:TE}),zE=U({family:z(`niceeval.runner-diagnostics`),kind:z(`diagnostic`),id:EE}),BE=G([AE,jE,ME,NE,PE,FE,IE,LE,RE,zE]),VE=G([RE,zE]);W(BE).pipe(J(Y(e=>e.length<=16&&uT(e,`niceeval.agent-turns`)))),W(BE).pipe(J(Y(e=>e.length<=16&&uT(e,`niceeval.sandbox-commands`)))),W(BE).pipe(J(Y(e=>e.length<=16&&uT(e,`niceeval.agent-turns`)))),W(BE).pipe(J(Y(e=>e.length<=16&&uT(e,`niceeval.runner-activities`)))),W(BE).pipe(J(Y(e=>e.length<=16&&uT(e,`niceeval.runner-diagnostics`)))),W(VE).pipe(J(Y(e=>e.length<=16&&dT(e,`niceeval.runner-activities`)))),W(VE).pipe(J(Y(e=>e.length<=16&&dT(e,`niceeval.runner-diagnostics`))));var HE=Object.freeze([`input`,`output`,`cache-read`,`cache-write`]),UE=B.pipe(J(Y(e=>e.trim().length>0&&new TextEncoder().encode(e).byteLength<=256&&!/[\u0000-\u001f\u007f]/u.test(e)))),WE=q(wC),GE=U({callId:UE,retryOf:q(UE),provider:q(UE),model:q(UE),status:K([`succeeded`,`failed`,`cancelled`,`unknown`]),inputTokens:WE,inputTotalTokens:WE,outputTokens:WE,cacheReadTokens:WE,cacheWriteTokens:WE}),KE=U({transportProvider:q(UE),endpointId:q(UE)}),qE=U({amount:mE,currency:hE,source:U({kind:z(`reported`),id:UE})}),JE=B.pipe(J(Y(e=>/^sha256:[0-9a-f]{64}$/u.test(e)))),YE=q(mE),XE=U({input:YE,output:YE,cacheRead:YE,cacheWrite:YE}),ZE=U({kind:z(`configured-profile`),id:UE,asOf:q(TC),profileDigest:JE}),QE=U({basis:z(`catalog-reference`),currency:z(`USD`),source:ZE,requestModel:UE,selector:UE,match:K([`exact`,`provider-wildcard`]),ratesPerMTok:XE}),$E=U({bucket:K(HE),tokens:wC,ratePerMTok:YE,amount:mE}),eD=U({bucket:K(HE),reason:K([`tokens-unknown`,`rate-unknown`])}),tD=U({kind:z(`adapter-call-price-estimate`),callId:UE,state:K([`complete`,`partial`]),amount:mE,currency:z(`USD`),source:U({kind:z(`estimated`),id:UE}),pricing:QE,charges:ov($E),missing:W(eD)}),nD=U({...GE.fields,route:KE,cost:q(qE)});Object.freeze({maximumCalls:4e3}),U({collection:jC,calls:W(GE)}),U({collection:jC,calls:W(nD),priceReceipts:W(tD)});var rD=Object.freeze({completed:`completed`,failed:`failed`,cancelled:`cancelled`,interrupted:`interrupted`}),iD=[rD.completed,rD.failed,rD.cancelled,rD.interrupted],aD=Object.freeze({attemptSetup:`attempt.setup`,sandboxPrepare:`sandbox.prepare`,agentEnsure:`agent.ensure`,evalRun:`eval.run`,agentSend:`agent.send`,sandboxCommand:`sandbox.command`,assertionEvaluate:`assertion.evaluate`,verdictFold:`verdict.fold`,attemptTeardown:`attempt.teardown`,runSetup:`run.setup`,runDiscovery:`run.discovery`,runPlan:`run.plan`,runDispatch:`run.dispatch`,runTeardown:`run.teardown`,collection:`collection`}),oD=[aD.attemptSetup,aD.sandboxPrepare,aD.agentEnsure,aD.evalRun,aD.agentSend,aD.sandboxCommand,aD.assertionEvaluate,aD.verdictFold,aD.attemptTeardown];aD.attemptSetup,aD.sandboxPrepare,aD.agentEnsure,aD.evalRun,aD.sandboxCommand,aD.assertionEvaluate,aD.verdictFold,aD.attemptTeardown;var sD=[aD.runSetup,aD.runDiscovery,aD.runPlan,aD.runDispatch,aD.runTeardown],cD=[aD.collection];[...oD,...cD],[...sD,...cD];var lD=[aD.attemptSetup,aD.sandboxPrepare,aD.agentEnsure,aD.evalRun,aD.sandboxCommand,aD.attemptTeardown],uD=Object.freeze({...rD,unknown:`unknown`}),dD=[uD.completed,uD.failed,uD.cancelled,uD.interrupted,uD.unknown],fD=Object.freeze({timeout:`timeout`,cancelled:`cancelled`,transportLost:`transport-lost`}),pD=[fD.timeout,fD.cancelled,fD.transportLost],mD=Object.freeze({spawnFailed:`spawn-failed`,cancelledBeforeStart:`cancelled-before-start`}),hD=[mD.spawnFailed,mD.cancelledBeforeStart],gD=DC,_D=K([`adapter`,`session-manager`,`sandbox-wrapper`,`runner-clock`,`runner-diagnostic-sink`,`attempt-finalizer`,`run-teardown`]),vD=K([`turn`,`turn-item`,`usage-observation`,`turn-context`,`command`,`stdout`,`stderr`,`activity`,`diagnostic`,`diagnostic-cause`,`value-byte`,`content-byte`]),yD=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:_D,target:vD}),U({code:K([`collection-cap-reached`,`unsupported-input`]),target:vD,omittedAtLeast:TC}),U({code:K([`text-truncated`,`redacted`,`invalid-utf8-replaced`,`unsafe-control-stripped`]),target:vD,replacementOrOmittedCount:TC})]);function bD(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return[e.code,e.stage,e.target].join(`\0`);case`collection-cap-reached`:case`unsupported-input`:return[e.code,e.target,String(e.omittedAtLeast)].join(`\0`);case`text-truncated`:case`redacted`:case`invalid-utf8-replaced`:case`unsafe-control-stripped`:return[e.code,e.target,String(e.replacementOrOmittedCount)].join(`\0`)}}function xD(e){let t,n=new Set;for(let r of e){let e=bD(r);if(n.has(e)||t!==void 0&&t>=e)return!1;n.add(e),t=e}return!0}var SD=G([U({state:z(`complete`),limitations:AC}),U({state:z(`partial`),limitations:ov(yD).pipe(J(Y(xD)))})]);Object.freeze({maximumBlobs:1,maximumBlobBytes:1,maximumTotalBytes:1});var CD={itemId:_E,eventId:bE,sessionSequence:uE},wD=G([U({state:z(`exact`),toolOccurrenceId:xE}),U({state:z(`unavailable`),reason:K([`orphan-finish`,`ambiguous-operation`])})]),TD=G([U({...CD,kind:z(`message`),role:K([`user`,`assistant`]),text:fE}),U({...CD,kind:z(`tool-start`),toolOccurrenceId:xE,tool:pE,inputSummary:fE}),U({...CD,kind:z(`tool-finish`),occurrence:wD,outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:fE}),U({...CD,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:fE}),U({...CD,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:dE,summary:fE}),U({...CD,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),promptSummary:fE,responseSummary:q(fE)}),U({...CD,kind:K([`skill-load`,`conversation-error`]),code:dE,summary:fE})]),ED={itemId:_E,sequence:TC},DD=G([U({...ED,kind:z(`message`),role:K([`user`,`assistant`]),text:fE}),U({...ED,kind:z(`tool-call`),callId:yE,tool:pE,inputSummary:fE}),U({...ED,kind:z(`tool-result`),callId:yE,outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),outputSummary:fE}),U({...ED,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:fE}),U({...ED,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:dE,summary:fE}),U({...ED,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),promptSummary:fE,responseSummary:q(fE)}),U({...ED,kind:K([`skill-load`,`conversation-error`]),code:dE,summary:fE})]),OD=G([U({usageObservationId:wE,kind:z(`token-bucket`),provider:dE,bucket:K([`input`,`output`,`cache-read`,`cache-write`,`reasoning`,`other`]),tokens:lE}),U({usageObservationId:wE,kind:z(`request`),provider:dE,requestKind:K([`model`,`tool`])}),U({usageObservationId:wE,kind:z(`provider-cost`),provider:dE,amount:B.pipe(J(Y(e=>/^(?:0|[1-9][0-9]*)(?:\.[0-9]*[1-9])?$/u.test(e)))),currency:hE})]),kD=K([`complete`,`partial`,`unavailable`]),AD=B.pipe(J(Y(e=>e.trim().length>0&&!!yw(e,16384),{identifier:`AgentTurnEvidenceCoverageReason`,description:`non-empty durable coverage reason within the conversation text limit`}))),jD=G([U({status:z(`complete`)}),U({status:K([`partial`,`unavailable`]),reason:AD})]),MD=U({events:jD,actions:jD,messages:jD,usage:jD,status:jD,data:jD}),ND=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),evidenceCoverage:U({events:kD,actions:kD,messages:kD,usage:kD,status:kD,data:kD})}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})]),PD=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),evidenceCoverage:MD}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})]),FD={segmentId:gD,turnId:gE,sequence:TC,outcome:K(iD),usage:W(OD)},ID=U({...FD,sessionId:SE,terminal:PD,items:W(TD)}),LD=U({...FD,terminal:PD,items:W(DD)}),RD=U({...FD,sessionId:SE,terminal:ND,items:W(TD)}),zD=U({...FD,terminal:ND,items:W(DD)});U({collection:SD,segments:W(zD)}).pipe(nv({collection:`collection-data`,segments:`segments-data`})),G([U({state:z(`current`),collection:SD,segments:W(RD)}).pipe(nv({collection:`collection-data`,segments:`segments-data`})),U({state:z(`legacy`),collection:SD,segments:W(zD)}).pipe(nv({collection:`collection-data`,segments:`segments-data`}))]),G([U({state:z(`current`),collection:SD,segments:W(ID)}).pipe(nv({collection:`collection-data`,segments:`segments-data`})),U({state:z(`legacy`),collection:SD,segments:W(LD)}).pipe(nv({collection:`collection-data`,segments:`segments-data`}))]);var BD=B.pipe(J(Y(e=>new TextEncoder().encode(e).byteLength>0&&new TextEncoder().encode(e).byteLength<=256,{identifier:`ExecutionTraceIdentifier`}))),VD=B.pipe(J(Y(e=>new TextEncoder().encode(e).byteLength<=512,{identifier:`ExecutionTraceSummary`}))),HD=V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>=0,{identifier:`ExecutionTraceNonNegativeSafeInteger`})));V.pipe(J(Y(e=>Number.isSafeInteger(e)&&e>0,{identifier:`ExecutionTracePositiveSafeInteger`})));var UD=V.pipe(J(Y(Number.isFinite,{identifier:`ExecutionTraceFiniteNumber`}))),WD=B.pipe(J(Y(e=>/^[0-9a-f]{64}$/u.test(e),{identifier:`ExecutionTraceSha256`}))),GD=lv(()=>G([Z_,H,UD,B,W(GD),rv(B,GD)])),KD=G([U({state:z(`complete`),limitations:av([])}),U({state:z(`partial`),limitations:ov(U({code:BD,message:B}))})]),qD=U({scopeId:BD,label:B,boundary:GD}),JD=G([U({relation:BD,targetKey:BD}),U({relation:BD,unresolved:U({sourceEventId:BD,reason:B})})]),YD=U({key:BD,label:B,artifactId:BD,pointer:B}),XD=U({key:BD,type:BD,source:U({id:BD,eventId:L(BD),sequence:L(HD)}),actor:L(U({id:BD,label:L(B)})),time:L(U({clockId:BD,value:UD,unit:BD})),summary:VD,payload:L(GD),links:L(W(JD)),evidence:L(W(YD)),scopeMemberships:L(W(U({scopeId:BD,state:K([`included`,`excluded`,`unknown`])})))});U({traceId:BD,schema:U({id:BD}),collection:KD,scopes:W(qD),events:W(XD)});var ZD=U({kind:z(`trace-header`),traceId:BD,sourceTraceId:BD,schema:U({id:BD,revision:L(HD)}),collection:KD,scopes:W(qD)}),QD=U({kind:z(`event`),traceId:BD,eventId:BD,ordinal:HD,key:BD,type:BD,source:U({id:BD,eventId:L(BD),sequence:L(HD)}),actor:L(U({id:BD,label:L(B)})),time:L(U({clockId:BD,value:UD,unit:BD})),summary:VD,payload:L(GD),links:W(JD),evidence:W(U({key:BD,label:B,artifactId:BD,pointer:B,evidenceId:BD,artifactSha256:WD,targetSha256:WD,targetByteLength:HD})),scopeMemberships:W(U({scopeId:BD,state:K([`included`,`excluded`,`unknown`])}))});G([ZD,QD]),Object.freeze({maximumTraces:32,maximumEvents:1e5,maximumCanonicalInputBytes:67108864,maximumPayloadBytes:16384,maximumSummaryBytes:512,maximumLinksPerEvent:32,maximumEvidencePerEvent:8,maximumScopesPerEvent:8,maximumJsonDepth:32,maximumIdentifierBytes:256,maximumEvidenceSourceBytes:268435456,maximumEvidenceTargetBytes:134217728,maximumDetailPreviewBytes:2048,maximumDetailBytes:524288,maximumOutlineEvents:32,maximumOutlineBytes:65536});var $D=Object.freeze({maximumWindows:256,maximumChangesPerWindow:1e4,maximumRetainedChanges:1e4,maximumTextRevisionBytes:1048576,maximumContents:2e4,maximumContentBytes:1048576,maximumTotalContentBytes:134217728,maximumPayloadJsonBytes:16777216,maximumPolicyEntries:256,maximumPolicyEntryUtf8Bytes:4096}),eO=new TextEncoder;function tO(e){return eO.encode(e).byteLength}function nO(e){let t,n=new Set;for(let r of e){if(n.has(r)||t!==void 0&&jb(t,r)>=0)return!1;n.add(r),t=r}return!0}function rO(e){return nO(e.map(lO))}var iO=B.pipe(J(Y(e=>/^(?:turn[1-9][0-9]*|session[1-9][0-9]*\/turn[1-9][0-9]*)$/.test(e),{identifier:`FileChangesWindowId`,description:`a canonical agent send-window id`}))),aO=W(B.pipe(J(Y(e=>tO(e)<=$D.maximumPolicyEntryUtf8Bytes,{identifier:`FileChangesPolicyEntry`,description:`a File Changes include or ignore entry within its UTF-8 budget`})))).pipe(J(Y(e=>e.length<=$D.maximumPolicyEntries&&nO(e),{identifier:`FileChangesPolicyEntries`,description:`an ASCII-canonical, deduplicated bounded policy entry sequence`}))),oO=U({kind:z(`agent-send-window-endpoints`),policy:U({defaultPolicy:z(`niceeval.sandbox-ledger/default-excludes/v1`),include:aO,ignore:aO})}),sO=K([`checkpoint`,`export`,`finalizer-export`,`normalize`]),cO=G([U({code:K([`capture-failed`,`capture-interrupted`]),stage:sO,atWindowId:q(iO)}),U({code:z(`collection-cap-reached`),target:K([`window`,`change`,`content`,`value`,`content-byte`]),omittedAtLeast:TC,atWindowId:q(iO)}),U({code:z(`unsupported-input`),target:z(`endpoint-metadata`),omittedAtLeast:TC})]);function lO(e){switch(e.code){case`capture-failed`:case`capture-interrupted`:return[e.code,e.stage,e.atWindowId??``].join(`\0`);case`collection-cap-reached`:return[e.code,e.target,e.atWindowId??``,String(e.omittedAtLeast)].join(`\0`);case`unsupported-input`:return[e.code,e.target,String(e.omittedAtLeast)].join(`\0`)}}var uO=G([U({state:z(`complete`),limitations:AC}),U({state:z(`partial`),limitations:ov(cO).pipe(J(Y(rO,{identifier:`FileChangesPartialLimitations`,description:`a deterministic deduplicated File Changes limitation sequence`})))})]),dO=G([U({kind:z(`text`),sha256:Qb,byteLength:wC.pipe(J(Y(e=>e<=$D.maximumTextRevisionBytes,{identifier:`FileChangesTextRevisionByteLength`,description:`a retained text revision within the File Changes text budget`}))),content:G([U({state:z(`available`),content:Mv.pipe(Pv.maximumBytes($D.maximumContentBytes))}),U({state:z(`omitted`),reason:z(`collection-cap`)})])}),U({kind:z(`elided`),reason:K([`binary`,`oversized-text`]),byteLength:wC}),U({kind:z(`unavailable`),reason:K([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),fO=G([U({state:z(`absent`)}),U({state:z(`present`),revision:dO})]);U({attribution:oO,collection:uO,windows:W(U({windowId:iO,sequence:TC,changes:W(U({changeId:ex,path:rx,kind:K([`created`,`modified`,`deleted`]),before:fO,after:fO}).pipe(J(Y(e=>{switch(e.kind){case`created`:return e.before.state===`absent`&&e.after.state===`present`;case`modified`:return e.before.state===`present`&&e.after.state===`present`;case`deleted`:return e.before.state===`present`&&e.after.state===`absent`}},{identifier:`FileChange`,description:`a coherent created, modified, or deleted endpoint transition`})))).pipe(J(Y(e=>e.length<=$D.maximumChangesPerWindow&&nO(e.map(e=>e.path)),{identifier:`FileChangesWindowChanges`,description:`a bounded ASCII-path-canonical unique window change sequence`})))}))}).pipe(nv({attribution:`attribution-data`,collection:`collection-data`,windows:`windows-data`}));var pO=K([`available`,`partial`,`unavailable`,`empty`,`unsupported`,`failed`]),mO=B.pipe(J(Y(qw))),hO=B.pipe(J(Y(Xw))),gO=B.pipe(J(Y($w))),_O=G([U({kind:z(`redacted`),fieldCount:V}),U({kind:z(`sampled`),captured:V,knownTotal:L(V)}),U({kind:z(`truncated`),omittedBytes:V}),U({kind:z(`provider-limited`)})]),vO=G([U({code:K([`assertions-not-recorded`,`assertions-revision-unsupported`,`assertions-current-invalid`]),locator:B}),U({code:K([`attempt-origin-missing`,`attempt-not-observed`]),runId:B,slotId:B,evalId:B,attemptOrdinal:V}),U({code:z(`score-contribution-unavailable`),locator:B,entryId:B,reason:K([`source-unavailable`,`evaluation-errored`,`not-applicable`])}),U({code:z(`score-partial`),locator:q(B)})]),yO=U({identity:U({kind:z(`attempt`),locator:B})}),bO=U({state:pO,value:q(V),samples:V,total:V,basis:K([`slot`,`eval`]),issues:W(vO),refs:W(yO),unit:L(K([`points`,`USD`,`ms`,`tokens`])),bounds:L(U({min:V,max:V}))}),xO=U({...bO.fields,source:q(K([`reported`,`estimated`,`mixed`]))}),SO=G([U({identity:U({kind:z(`attempt`),locator:B}),state:K([`not-recorded`,`unsupported`,`failed`])}),U({identity:U({kind:z(`attempt`),locator:B}),entryId:B,groupPath:W(B),state:K([`complete`,`partial`,`unavailable`,`not-applicable`]),reason:L(K([`sampled`,`truncated`,`redacted`,`provider-limited`,`not-collected`,`source-unavailable`,`producer-failed`,`optional-material`,`unsupported-subject`])),limitations:W(_O)})]),CO={evaluationKind:K([`pass`,`points`,`mixed`]),denominator:U({expected:V,observed:V,classified:V,missing:V}),verdict:U({tally:U({passed:V,failed:V,errored:V,skipped:V}),passRate:bO}),score:bO,costUSD:xO,durationMs:bO,tokens:bO,coverage:W(SO),issues:W(vO)},wO=U({...wS.fields,verdict:q(K([`passed`,`failed`,`errored`,`skipped`])),score:bO,costUSD:xO,durationMs:bO,tokens:bO}),TO=G([U({state:z(`available`),value:B}),U({state:z(`mixed`)}),U({state:z(`unavailable`)})]),EO=rv(B,TO),DO=U({runId:B,slotId:B,evalId:B,attemptOrdinal:V,labels:EO,publication:G([CS,wO,TS])}),OO=U({groupPath:W(B),...CO}),kO=U({experimentId:B,adapter:G([U({state:z(`available`),value:PS}),U({state:z(`mixed`)})]),model:TO,labels:EO,groups:W(OO),...CO}),AO=U({experimentId:B,evalId:B,groupPath:W(B),members:W(DO),...CO}),jO=U({totals:U(CO),experiments:W(kO),cells:W(AO)}),MO=U({experiment:kO,cells:W(AO)}),NO=U({value:U({runId:Gb,experimentId:Yb,state:xS,context:L(IS),startedAt:ix,completedAt:L(ix),expectedSlots:W(pC)}),members:W(hC),attempts:W(gC)});W(U({runId:Gb,state:z(`completed`),experimentId:Yb,invocationId:Z_,startedAt:ix,completedAt:ix,coverage:U({published:V,expected:V})}));var PO=G([U({state:z(`not-scored`)}),U({state:z(`complete`),earned:V,possible:V}),U({state:z(`unavailable`),earned:V,possible:V,unavailable:V})]),FO=q(K([`passed`,`failed`,`errored`,`skipped`])),IO=U({runs:W(mC),denominator:U({expected:V,observed:V}),members:W(U({runId:B,slotId:B,evalId:B,attemptOrdinal:V,executionIdentityDigest:B,state:K([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`missing`]),locator:q(B),outcome:q(K([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:FO,score:L(PO)}))}),LO=U({channel:K([`events`,`actions`,`messages`,`usage`,`status`,`data`]),status:K([`complete`,`partial`,`unavailable`]),reason:L(B)}),RO=G([LO,U({owner:z(`assertion-material`),state:z(`partial`),reason:K([`sampled`,`truncated`,`redacted`,`provider-limited`]),limitations:W(_O)}),U({owner:z(`assertion-material`),state:z(`unavailable`),reason:K([`not-collected`,`source-unavailable`,`producer-failed`]),limitations:W(_O)}),U({owner:z(`assertion-material`),state:z(`not-applicable`),reason:K([`optional-material`,`unsupported-subject`]),limitations:W(_O)})]),zO=U({state:K([`available`,`not-recorded`,`partial`,`unavailable`])}),BO=U({assertions:zO,trace:zO,sources:zO,diff:zO,artifacts:zO,timing:zO,usage:zO,conversation:zO,commands:zO,diagnostics:zO}),VO=U({state:K([`available`,`not-recorded`,`invalid`]),entries:W(U({entryId:B,display:U({label:L(B),key:L(B),groupPath:W(B)})}))}),HO=G([U({state:z(`not-recorded`),entryCount:z(0)}),U({state:z(`available`),entryCount:V,sourceSiteCount:V}),U({state:K([`unsupported`,`failed`,`invalid`]),entryCount:z(0)})]),UO=U({core:gC,locator:B,originRun:mC,targets:W(U({runId:B,member:hC})),evidence:HO,assertions:VO,sections:BO,verdict:FO,score:PO,evidenceCoverage:W(LO),limitations:W(RO)}),WO=G([U({state:z(`available`),text:B}),U({state:z(`omitted`),reason:z(`inspection-result-byte-limit`),byteLength:V,byteLimit:V})]),GO=G([U({state:z(`mapped`),sourceItemId:B,sha256:B}),U({state:z(`unmapped`),reason:K([`source-snapshot-not-recorded`,`position-unrepresentable`])})]),KO=U({entryId:B,sourceOrder:V,role:K([`declaration`,`threshold`,`score`,`gate`,`optional`,`stop`]),start:U({line:V,column:V}),end:U({line:V,column:V}),source:GO}),qO=G([U({state:K([`not-recorded`,`invalid`]),sourceSites:av([]),hasMoreSourceSites:z(!1),omittedSourceSiteCount:z(0)}),U({state:z(`available`),sourceSites:W(KO),hasMoreSourceSites:H,omittedSourceSiteCount:V})]),JO=U({state:K([`available`,`not-recorded`,`invalid`]),items:W(U({sourceItemId:B,path:B,byteLength:V,sha256:B,content:WO})),hasMore:H,omittedItemCount:V,assertions:qO}),YO=K([`complete`,`partial`,`not-recorded`,`invalid`]),XO=G([yD,U({issue:B}),U({source:z(`agent-turns`),turnId:gE,channel:K([`conversation`,`events`,`actions`,`messages`,`status`,`data`]),state:K([`partial`,`unavailable`]),reason:B}),U({source:z(`turn-contexts`),state:K([`partial`,`not-recorded`,`invalid`]),limitations:W(G([yD,U({issue:B})]))})]),ZO=K(iD),QO=G([U({state:z(`not-recorded`)}),U({state:z(`unmapped`),reason:K([`location-not-captured`,`source-snapshot-not-recorded`,`position-unrepresentable`]),sessionIndex:V,turnIndex:V,sourceOrder:q(V)}),U({state:z(`mapped`),sourceItemId:$b,sha256:Qb,start:U({line:V,column:V}),end:U({line:V,column:V}),sessionIndex:V,turnIndex:V,sourceOrder:V})]),$O=G([U({state:z(`complete`)}),U({state:K([`partial`,`unavailable`]),reason:B})]),ek=G([U({state:z(`recorded`),status:K([`completed`,`failed`,`waiting`]),coverage:U({events:$O,actions:$O,messages:$O,status:$O,data:$O})}),U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`]),coverage:U({state:z(`unavailable`),reason:K([`send-failed`,`send-interrupted`])})})]),tk=G([yD,U({issue:B})]),nk=U({sourceItemId:$b,sha256:Qb,start:U({line:V,column:V}),end:U({line:V,column:V})}),rk=U({state:YO,limitations:W(tk),limitationsTruncated:H,omittedLimitationCount:V,items:W(U({diagnosticId:B,sequence:V,turnId:q(B),phase:K([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`agent.send`,`sandbox.command`,`assertion.evaluate`,`verdict.fold`,`attempt.teardown`]),kind:K([`advisory`,`execution-error`]),code:B,summary:B,summaryTruncated:H,causes:W(U({code:B,summary:B,summaryTruncated:H})),causesTruncated:H,omittedCauseCount:V,redaction:G([U({state:z(`none`)}),U({state:z(`applied`),replacements:V})]),sourceFrame:q(nk)})),hasMore:H,omittedDiagnosticCount:V}),ik={itemId:mO,turnId:B,sequence:V},ak=G([U({...ik,kind:z(`message`),role:K([`user`,`assistant`]),text:B,textTruncated:H}),U({...ik,kind:z(`tool-call`),tool:B,input:B,inputTruncated:H,toolOccurrenceId:L(hO)}),U({...ik,kind:z(`tool-result`),outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),output:B,outputTruncated:H,toolOccurrenceId:L(hO)}),U({...ik,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:B,summaryTruncated:H}),U({...ik,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:B,summary:B,summaryTruncated:H}),U({...ik,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),prompt:B,promptTruncated:H,response:q(B),responseTruncated:H}),U({...ik,kind:K([`skill-load`,`conversation-error`]),code:B,summary:B,summaryTruncated:H})]),ok=G([U({kind:z(`exited`),exitCode:V}),U({kind:z(`terminated`),reason:K(pD)}),U({kind:z(`not-started`),reason:K(hD)})]),sk=U({execution:U({state:YO,limitations:W(G([U({code:z(`capture-failed`),stage:z(`adapter`)}),U({code:z(`capture-interrupted`),stage:z(`attempt-finalizer`)}),U({code:z(`collection-cap-reached`),omittedAtLeast:V}),U({code:z(`legacy-source-state`),state:K([`partial`,`invalid`]),message:B})])),traces:W(ZD.pipe(ev({eventCount:V}))),events:W(U({traceId:B,eventId:B,origin:G([U({kind:z(`execution-event`),eventId:B}),U({kind:z(`agent-item`),itemId:mO})]),ordinal:V,type:B,source:QD.fields.source,actor:QD.fields.actor,time:QD.fields.time,summary:B,links:QD.fields.links,evidence:W(U({evidenceId:B,key:B,label:B})),scopeMemberships:QD.fields.scopeMemberships})),identityIndex:U({traceIds:W(B),omittedTraceIdCount:V,eventIds:W(B),omittedEventIdCount:V,evidenceIds:W(B),omittedEvidenceIdCount:V}),hasMore:H,omittedEventCount:V,continuation:L(B)}),conversation:U({state:YO,limitations:W(XO),limitationsTruncated:H,omittedLimitationCount:V,turns:W(U({turnId:B,sequence:V,sessionId:L(SE),outcome:ZO,terminal:ek,context:QO})),turnsTruncated:H,omittedTurnCount:V,items:W(ak),itemsTruncated:H,omittedItemCount:V}),commands:U({state:YO,limitations:W(XO),limitationsTruncated:H,omittedLimitationCount:V,items:W(U({commandId:gO,phase:K(lD),outcome:ok})),hasMore:H,omittedCommandCount:V}),diagnostics:rk,identityIndex:U({itemIds:W(mO),omittedItemIdCount:V,toolOccurrenceIds:U({ids:W(hO),omittedIdCount:V}),commandIds:W(gO),omittedCommandIdCount:V})}),ck={itemId:mO,turnId:B,turnSequence:V,turnOutcome:ZO,sessionId:L(B),eventId:L(B),sequence:L(V)},lk=G([U({...ck,kind:z(`message`),role:K([`user`,`assistant`]),text:B}),U({...ck,kind:z(`tool-call`),toolOccurrenceId:L(hO),tool:B,input:B}),U({...ck,kind:z(`tool-result`),toolOccurrenceId:L(hO),outcome:K([`completed`,`rejected`,`failed`,`cancelled`]),output:B}),U({...ck,kind:K([`thinking-summary`,`compaction`,`context-injection`]),summary:B}),U({...ck,kind:z(`subagent`),state:K([`started`,`completed`,`failed`]),label:B,summary:B}),U({...ck,kind:z(`input-request`),state:K([`requested`,`answered`,`cancelled`]),prompt:B,response:q(B)}),U({...ck,kind:K([`skill-load`,`conversation-error`]),code:B,summary:B})]),uk=U({turnId:B,sequence:V,outcome:ZO}),dk=G([U({kind:z(`shell`),command:B}),U({kind:z(`argv`),executable:B,arguments:W(B)})]),fk=G([U({kind:z(`sandbox-default`)}),U({kind:z(`project-relative`),path:B}),U({kind:z(`redacted`)})]),pk=U({text:B,retainedBytes:V,totalSafeUtf8Bytes:V,sha256:B,truncation:U({state:K([`not-truncated`,`truncated`]),omittedSafeUtf8Bytes:V})}),mk=G([U({kind:z(`execution-event`),event:QD,evidence:W(U({evidenceId:B,key:B,label:B,artifactId:B,pointer:B,targetSha256:B,targetByteLength:V,offset:z(0),base64:B,nextOffset:q(V),truncated:H}))}),U({kind:z(`execution-evidence`),evidenceId:B,eventId:B,traceId:B,key:B,label:B,artifactId:B,pointer:B,artifactSha256:B,targetSha256:B,targetByteLength:V,offset:V,base64:B,nextOffset:q(V)}),U({kind:z(`item`),itemId:mO,item:lk}),U({kind:z(`tool-occurrence`),toolOccurrenceId:hO,call:q(lk),result:q(lk),turn:U({call:q(uk),result:q(uk)})}),U({kind:z(`command`),commandId:gO,invocation:dk,workingDirectory:fk,outcome:ok,turnId:q(B),phase:K([`attempt.setup`,`sandbox.prepare`,`agent.ensure`,`eval.run`,`sandbox.command`,`attempt.teardown`]),sequence:V,stdout:pk,stderr:pk})]),hk=G([yD,U({issue:B})]),gk=G([U({state:z(`complete`)}),U({state:K([`partial`,`unavailable`]),reason:B})]),_k=G([hk,U({source:z(`agent-turns`),turnId:B,channel:z(`usage`),state:K([`partial`,`unavailable`]),reason:B})]),[vk,yk,bk]=OD.members,xk=G([U({turnId:gE,...vk.fields}),U({turnId:gE,...yk.fields}),U({turnId:gE,...bk.fields})]),Sk=U({state:K([`available`,`partial`,`unavailable`]),value:q(V),observationCount:V}),Ck=U({currency:B,value:B,observationCount:V}),wk=U({amount:B,currency:B,source:U({kind:K([`reported`,`estimated`]),id:B}),state:K([`complete`,`partial`])}),Tk=U({...nD.fields,effectiveCost:q(wk)}),Ek=U({state:K([`complete`,`partial`,`unavailable`]),source:q(K([`reported`,`estimated`,`mixed`])),values:W(U({currency:B,value:B,source:K([`reported`,`estimated`,`mixed`]),coveredCalls:V,reportedCalls:V,estimatedCalls:V})),totalCalls:V}),Dk=U({inputTotalTokens:L(Sk),inputTokens:Sk,outputTokens:Sk,requests:Sk,providerCosts:L(U({state:K([`available`,`partial`,`unavailable`]),values:W(Ck),observationCount:V})),costs:L(Ek)}),Ok=U({source:L(z(`adapter`)),coverage:L(z(`recorded-calls`)),calls:L(W(Tk)),priceReceipts:L(q(W(tD))),callsTruncated:L(H),omittedCallCount:L(V),state:YO,limitations:W(_k),limitationsTruncated:H,omittedLimitationCount:V,turns:W(U({turnId:B,coverage:gk})),turnsTruncated:H,omittedTurnCount:V,observations:W(xk),totals:Dk,hasMore:H,omittedObservationCount:V}),kk=K([`complete`,`partial`,`not-recorded`,`invalid`,`unavailable`]),Ak=U({state:kk,facts:W(LO),limitations:W(RO)}),jk=U({state:kk,summary:q(U({turnCount:V,observationCount:V})),totals:Dk,limitations:W(_k),limitationsTruncated:H,omittedLimitationCount:V}),Mk=G([U({kind:z(`member-not-observed`),state:K([`pending`,`not-dispatched`,`interrupted`])}),U({kind:z(`attempt-unresolved`),originRunId:B,attemptId:B}),U({kind:z(`coverage`),detail:RO}),U({kind:z(`usage`),detail:_k})]),Nk=U({slot:pC,state:K([`executed`,`carried`,`accepted`,`not-dispatched`,`interrupted`,`pending`]),locator:q(B),relation:q(K([`origin`,`reference`])),outcome:q(K([`completed`,`errored`,`cancelled`,`interrupted`])),verdict:FO,score:q(PO),coverage:Ak,usage:jk,limitations:W(Mk)}),Pk=U({slotId:B,locator:q(B),limitation:Mk}),Fk=U({identity:U({runId:Gb,experimentId:Yb,adapter:q(PS)}),state:xS,startedAt:ix,completedAt:L(ix),denominator:U({expected:V,observed:V}),members:W(Nk),coverage:U({state:kk,expectedMemberCount:V,observedMemberCount:V,completeMemberCount:V,factCount:V,limitations:W(Pk)}),usage:U({state:kk,expectedMemberCount:V,observedMemberCount:V,recordedAttemptCount:V,totals:Dk,limitations:W(Pk)}),limitations:W(Pk)}),Ik=U({state:YO,limitations:W(hk),limitationsTruncated:H,omittedLimitationCount:V,activities:W(U({activityId:B,sequence:V,parentActivityId:q(B),turnId:q(B),phase:B,label:B,startOffsetMs:V,durationMs:V,outcome:K(dD)})),hasMore:H,omittedActivityCount:V}),Lk=G([U({kind:z(`text`),sha256:B,byteLength:V,content:K([`available`,`omitted`])}),U({kind:z(`elided`),reason:K([`binary`,`oversized-text`]),byteLength:V}),U({kind:z(`unavailable`),reason:K([`unsupported-input`,`capture-failed`,`capture-interrupted`])})]),Rk=G([U({state:z(`absent`)}),U({state:z(`present`),revision:Lk})]),zk=U({windowId:B,sequence:V,changes:W(U({changeId:B,path:B,kind:K([`created`,`modified`,`deleted`]),before:Rk,after:Rk}))}),Bk=G([U({state:z(`not-recorded`),windows:av([])}),U({state:z(`invalid`),issues:W(B),windows:av([])}),U({state:K([`complete`,`partial`]),limitations:W(cO),windows:W(zk)})]),Vk=B.pipe(uv(e=>rb.test(e),{identifier:`AttemptLocator`,description:`a canonical @-prefixed Attempt locator`})),Hk=B.pipe(J(Y(qw))),Uk=B.pipe(J(Y(Xw))),Wk=B.pipe(J(Y($w))),Gk=W(Gb),Kk=(e,t)=>U({kind:z(e),...t}),qk=U({kind:K([`project-record`,`external-record`]),sealedCutoffIdentity:B}),Jk=U({kind:z(`inspection-sealed-cutoff`),identity:B,runCount:V,runs:W(U({runId:B,logicalSealIdentity:B}))}),Yk=U({requestedRunIds:W(B),selectedRunIds:W(B),missingRunIds:W(B)}),Xk=U({protocol:z(TT),outcome:z(`success`),behaviorVersion:z(ET),source:qk,sealedCutoff:Jk,selection:Yk,issues:av([]),evidence:U({refs:W(B)})}),Zk=U({protocol:z(TT),outcome:z(`success`),behaviorVersion:z(ET),source:qk,sealedCutoff:U({kind:z(`inspection-sealed-cutoff`),identity:B,runCount:V}),selection:U({requestedRunIds:W(B),selectedRunIds:W(B),missingRunIds:W(B),returnedRunCount:V,totalRunCount:V,truncated:H}),issues:av([]),evidence:U({refs:W(B)})}),Qk=G([U({code:z(`selection-run-missing`),side:K([`left`,`right`]),runId:B}),U({code:z(`comparison-member-set-mismatch`)})]),$k=Xk.pipe(ev({issues:W(Qk)})),eA=G([U({state:z(`not-recorded`)}),U({state:z(`available`),value:YC,collection:U({state:K([`complete-page`,`bounded-page`]),items:W(JC),hasMore:H,nextOffset:q(VC),total:VC}),contents:W(U({logicalHandle:B,byteLength:V,digest:B})),contentsTruncated:H})]),tA=U({runId:B,writerGeneration:B,startedAt:B,logicalSealIdentity:B,slotCount:V,memberCount:V,attemptCount:V,attachmentCount:V,contentCount:V,contentByteLength:V,sealEntryCount:V}),nA=U({key:B,runId:B,slotId:B,evalId:B,attemptOrdinal:V,locator:B}),rA=U({mode:K([`side-by-side`,`exact`,`paired`]),left:U({runs:W(mC),members:W(nA)}),right:U({runs:W(mC),members:W(nA)}),exactMemberSet:H,pairs:W(U({key:B,left:nA,right:nA}))}),iA=e=>Object.freeze(e),aA=Object.freeze({"overview.get":iA({request:Kk(`overview.get`,{runIds:L(Gk)}),result:{overview:jO},factKinds:[`core`,`assertions`,`attempt-cost`]}),"experiment.get":iA({request:Kk(`experiment.get`,{experimentId:Yb}),result:{experiment:MO},factKinds:[`core`,`assertions`,`attempt-cost`]}),"runs.list":iA({request:Kk(`runs.list`,{continuation:L(B)}),result:{runs:W(tA),continuation:L(B)},factKinds:[`core`]}),"run.get":iA({request:Kk(`run.get`,{runId:Gb}),result:{run:NO},factKinds:[`core`]}),"run.summary":iA({request:Kk(`run.summary`,{runId:Gb}),result:{summary:IO},factKinds:[`core`,`assertions`,`agent-turns`]}),"run.overview":iA({request:Kk(`run.overview`,{runId:Gb}),result:{runOverview:Fk},factKinds:[`core`,`assertions`,`agent-turns`]}),"attempt.get":iA({request:Kk(`attempt.get`,{locator:Vk}),result:{attempt:UO},factKinds:[`core`,`assertions`]}),"attempt.assertion.detail":iA({request:Kk(`attempt.assertion.detail`,{locator:Vk,entryId:Sy}),result:{assertion:cE},factKinds:[`assertions`,`agent-turns`,`sources`]}),"attempt.assertion.image":iA({request:Kk(`attempt.assertion.image`,{locator:Vk,entryId:Sy,imageId:B,offset:L(VC),limit:L(HC)}),result:{image:G([U({state:z(`available`),imageId:B,mediaType:K([`image/png`,`image/jpeg`]),byteLength:V,sha256:B,offset:V,base64:B,nextOffset:q(V)}),U({state:z(`invalid`)}),U({state:z(`not-recorded`)})])},factKinds:[`assertions`]}),"attempt.trace":iA({request:Kk(`attempt.trace`,{locator:Vk,traceId:L(B),sourceId:L(B),actorId:L(B),continuation:L(B)}),result:{trace:sk},factKinds:[`execution-traces`,`agent-turns`,`turn-contexts`,`sandbox-commands`,`runner-activities`,`runner-diagnostics`]}),"attempt.trace.detail":iA({request:Kk(`attempt.trace.detail`,{locator:Vk,selector:G([Kk(`execution-event`,{eventId:B}),Kk(`execution-evidence`,{evidenceId:B,offset:L(VC),limit:L(HC)}),Kk(`item`,{itemId:Hk}),Kk(`tool-occurrence`,{toolOccurrenceId:Uk}),Kk(`command`,{commandId:Wk})])}),result:{detail:mk},factKinds:[`execution-traces`,`agent-turns`,`sandbox-commands`,`artifacts`]}),"attempt.timing":iA({request:Kk(`attempt.timing`,{locator:Vk}),result:{timing:Ik},factKinds:[`runner-activities`]}),"attempt.usage":iA({request:Kk(`attempt.usage`,{locator:Vk}),result:{usage:Ok},factKinds:[`agent-turns`,`adapter-usage`]}),"attempt.diff":iA({request:Kk(`attempt.diff`,{locator:Vk}),result:{diff:Bk},factKinds:[`file-changes`]}),"attempt.sources":iA({request:Kk(`attempt.sources`,{locator:Vk}),result:{sources:JO},factKinds:[`assertions`,`sources`]}),"attempt.artifacts":iA({request:Kk(`attempt.artifacts`,{locator:Vk,offset:L(VC),limit:L(qC)}),result:{artifacts:eA},factKinds:[`artifacts`]}),"attempt.artifact":iA({request:Kk(`attempt.artifact`,{locator:Vk,artifactId:tx,offset:L(VC),limit:L(HC)}),result:{artifact:WC},factKinds:[`artifacts`]}),"runs.compare":iA({request:Kk(`runs.compare`,{mode:K([`side-by-side`,`exact`,`paired`]),leftRunIds:Gk,rightRunIds:Gk}),result:{comparison:rA},factKinds:[`core`]})}),oA=K(Object.freeze(Object.keys(aA))),sA=Object.entries(aA),cA=U({protocol:z(TT),operation:G(sA.map(([,e])=>e.request))}),lA=(e,t)=>{let n=ev({operation:z(e),...t.result});return e===`runs.list`?Zk.pipe(n):e===`runs.compare`?$k.pipe(n):Xk.pipe(n)},uA=G(sA.map(([e,t])=>lA(e,t))),dA=(e,t)=>{let n=ev({outcome:z(`explanation`),operation:z(e),factKinds:av(t.factKinds.map(e=>z(e)))});return e===`runs.list`?Zk.pipe(n):Xk.pipe(n)},fA=G(sA.map(([e,t])=>dA(e,t))),pA=G(sA.map(([e])=>U({id:z(e)}))),mA=G([U({protocol:z(TT),outcome:z(`discovery`),operations:W(pA)}),uA,fA,U({protocol:z(TT),outcome:z(`failure`),operation:q(oA),failure:U({code:K([`inspection-request-invalid`,`inspection-selection-missing`,`inspection-source-invalid`,`inspection-record-integrity-failure`,`inspection-operation-failed`,`inspection-result-invalid`,`evidence-budget-exceeded`,`restart-required`]),reason:B,identity:L(U({runId:B})),correction:K([`fix-request`,`choose-existing-selection`,`fix-record-source`,`retry`,`upgrade-or-report`,`restart`])})})]);function hA(e){let t=W_(mA,{errors:`all`,onExcessProperty:`error`})(e);return ed(t)?{success:!0,value:e}:{success:!1,reason:String(t.failure)}}function gA(e,t){return e.outcome===`success`&&e.operation===t?{success:!0,value:e}:{success:!1,reason:`expected success ${t}, received ${e.outcome}${`operation`in e?` ${e.operation}`:``}`}}var _A=W_(cA,{onExcessProperty:`error`});function vA(e){let t=_A({protocol:TT,operation:e});return $u(t)?Qu(Object.freeze({classification:`protocol/query`,code:`inspection-request-invalid`,reason:String(t.failure)})):Zu(t.success.operation)}var yA=new WeakSet;W_(cA,{onExcessProperty:`error`});function bA(e){let t=new Set,n=(e,r)=>{if(e===null||typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`)return Number.isFinite(e)?e:xA(r,`numbers must be finite`);if(Array.isArray(e)){if(t.has(e))return xA(r,`cyclic arrays are not encodable`);t.add(e);let i=[];for(let[t,a]of e.entries()){let e=n(a,[...r,String(t)]);if(CA(e))return e;i.push(e)}return t.delete(e),Object.freeze(i)}if(typeof e!=`object`||!e)return xA(r,`unsupported ${typeof e} value`);if(t.has(e))return xA(r,`cyclic objects are not encodable`);let i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)return xA(r,`only plain objects may cross Inspection delivery`);t.add(e);let a=Object.create(null);for(let t of Object.keys(e).sort(TA)){let i=n(Reflect.get(e,t),[...r,t]);if(CA(i))return i;a[t]=i}return t.delete(e),Object.freeze(a)};return n(e,[])}function xA(e,t){let n=Object.freeze({code:`inspection-result-invalid`,reason:`${e.length===0?`$`:e.join(`.`)}: ${t}`});return yA.add(n),n}function SA(e){return wA(e)&&yA.has(e)}var CA=SA;function wA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function TA(e,t){return e<t?-1:+(e>t)}function EA(e){let t=bA(e);return SA(t)?Qu(t):Zu(`${DA(t)}\n`)}function DA(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(DA).join(`,`)}]`;let t=e;return`{${Object.keys(t).sort(OA).map(e=>`${JSON.stringify(e)}:${DA(t[e])}`).join(`,`)}}`}function OA(e,t){return e<t?-1:+(e>t)}new TextEncoder;function kA(e,t){let n=EA(t);if($u(n))throw Error(`Inspection operation query key is invalid: ${n.failure.reason}`);return[`inspection`,e,`${t.kind}:${n.success}`]}function AA(e,t){return fc({queryKey:kA(e.identity,t),queryFn:()=>e.inspectRepository(t)})}var jA=(0,v.createContext)(null);function MA({runtime:e,children:t}){let n=(0,v.useSyncExternalStore)(t=>e.subscribe(t),()=>e.current,()=>e.current);if(n===void 0)throw Error(`No View generation has been committed.`);return(0,M.jsx)(jA.Provider,{value:n.binding,children:(0,M.jsx)(Uo,{client:e.queryClient,children:t})})}function NA(){let e=(0,v.useContext)(jA);if(e===null)throw Error(`useCurrentGeneration must be used inside InspectionRuntimeProvider.`);return e}function PA(e,t={}){let n=(0,v.useContext)(jA);if(n===null)throw Error(`useInspectionQuery must be used inside InspectionRuntimeProvider.`);let r=(t.enabled??!0)&&e!==null;if(e===null)return uc({queryKey:[`inspection`,n.identity,`disabled`],queryFn:fs,enabled:!1});let i=AA(n,e);return uc({queryKey:i.queryKey,queryFn:i.queryFn,enabled:r,...t.select===void 0?{}:{select:t.select}})}var FA=class{generation;#e=!1;constructor(e){this.generation=e}get identity(){return this.generation.identity}inspect(e){return this.#e?Promise.reject(Error(`Generation lease is released.`)):this.generation.queryClient.fetchQuery(AA(this.generation,e))}release(){this.#e||(this.#e=!0,this.generation.releaseLease())}},IA=class{repository;queryClient;onClosed;identity;#e=`preparing`;#t=0;#n=0;#r;binding;constructor(e,t,n){this.repository=e,this.queryClient=t,this.onClosed=n,this.identity=e.generationId;let r=this;this.binding=Object.freeze({identity:this.identity,queryClient:this.queryClient,get snapshot(){return r.snapshot},inspectRepository(e){return r.inspectRepository(e)}})}get status(){return this.#e}get snapshot(){if(this.#r===void 0)throw Error(`View generation snapshot is not ready.`);return this.#r}attachSnapshot(e){if(this.#e!==`preparing`||this.#r!==void 0)throw Error(`A View generation snapshot can only be attached once while preparing.`);this.#r=e}acquire(){if(this.#e===`retiring`||this.#e===`closed`)throw Error(`View generation is ${this.#e}.`);return this.#t+=1,new FA(this)}inspectRepository(e){if(this.#e===`retiring`||this.#e===`closed`)return Promise.reject(Error(`View generation is ${this.#e}.`));this.#n+=1;let t;try{t=this.repository.inspect(e)}catch(e){return this.#i(),Promise.reject(e)}return t.finally(()=>this.#i())}publish(){if(this.#e!==`preparing`)throw Error(`Only a preparing generation can be published.`);this.#e=`current`}drain(){this.#e!==`retiring`&&this.#e!==`closed`&&(this.#e=`retiring`,this.#s(),this.#a())}close(){this.#t=0,this.#o()}releaseLease(){this.#t>0&&--this.#t,this.#a()}#i(){this.#n>0&&--this.#n,this.#a()}#a(){this.#e===`retiring`&&this.#t===0&&this.#n===0&&this.#o()}#o(){this.#e!==`closed`&&(this.#e=`closed`,this.#s(),this.repository.close(),this.onClosed())}#s(){this.queryClient.removeQueries({type:`inactive`,predicate:e=>e.queryKey[1]===this.identity})}},LA=class{#e;#t=new Set;#n=new Map;#r=new Set;#i=!1;queryClient=new Ys({defaultOptions:{queries:{gcTime:3e5,retry:1,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}}});get current(){return this.#e}acquireCurrent(){this.#a();let e=this.#e;if(e===void 0)throw Error(`No View generation has been committed.`);return e.acquire()}subscribe(e){return this.#a(),this.#r.add(e),()=>this.#r.delete(e)}prepare(e){if(this.#i)throw e.close(),Error(`View runtime is disposed.`);let t=this.#n.get(e.generationId);if(t!==void 0)throw t.repository!==e&&e.close(),Error(`View generation ${e.generationId} already has an owner.`);let n;n=new IA(e,this.queryClient,()=>{this.#n.get(n.identity)===n&&this.#n.delete(n.identity)});try{let e={generation:n,lease:n.acquire()};return this.#n.set(n.identity,n),this.#t.add(n),e}catch(e){throw n.close(),e}}attachSnapshot(e,t){if(this.#a(),!this.#t.has(e.generation)||this.#n.get(e.generation.identity)!==e.generation)throw Error(`Only a prepared View generation can receive a snapshot.`);e.generation.attachSnapshot(t)}commit(e){if(this.#a(),!this.#t.has(e.generation)||this.#n.get(e.generation.identity)!==e.generation||e.generation.status!==`preparing`)throw Error(`Only an open View generation can be committed.`);e.generation.snapshot,this.#t.delete(e.generation);let t=this.#e;e.generation.publish(),this.#e=e.generation,e.lease.release();for(let e of this.#r)e();return t}retire(e){e!==void 0&&e!==this.#e&&this.#n.get(e.identity)===e&&e.drain()}reject(e){this.#t.has(e.generation)&&this.#n.get(e.generation.identity)===e.generation&&e.generation.status===`preparing`&&(this.#t.delete(e.generation),e.lease.release(),e.generation.close())}dispose(){if(!this.#i){this.#i=!0,this.#r.clear(),this.#e=void 0,this.#t.clear();for(let e of[...this.#n.values()])e.close();this.#n.clear(),this.queryClient.clear()}}#a(){if(this.#i)throw Error(`View runtime is disposed.`)}},RA=class extends Error{classification=`route-input`;translationKey=`report.unableToLoad`},zA=class extends Error{classification=`selection`;translationKey=`report.unableToLoad`};function BA(e){let t=vA(e);if($u(t))throw new RA(`Invalid Insight route input.`);return t.success}function VA(e=[]){let t=BA({kind:`overview.get`,...e.length===0?{}:{runIds:e}});if(t.kind!==`overview.get`)throw new RA(`Invalid overview operation.`);return t}function HA(e){let t=BA({kind:`run.get`,runId:e}),n=BA({kind:`run.summary`,runId:e});if(t.kind!==`run.get`||n.kind!==`run.summary`)throw new RA(`Invalid run route.`);return[t,n]}function UA(e){let t=BA({kind:`attempt.get`,locator:e}),n=BA({kind:`attempt.trace`,locator:e});if(t.kind!==`attempt.get`||n.kind!==`attempt.trace`)throw new RA(`Invalid attempt route.`);return[t,n]}function WA(e){let t=BA(e);switch(t.kind){case`attempt.assertion.detail`:case`attempt.trace.detail`:case`attempt.timing`:case`attempt.usage`:case`attempt.sources`:case`attempt.diff`:case`attempt.artifacts`:return t;default:throw new RA(`Invalid Attempt detail operation.`)}}function GA(e){return Object.freeze({state:`available`,value:e})}function KA(){return Object.freeze({state:`unavailable`})}function qA(e,t){let n=e.attempt.originRun.expectedSlots.find(({slotId:t})=>t===e.attempt.core.slotId),r=e.attempt.score,i=r.state===`complete`?r.earned:void 0;return Object.freeze({locator:e.attempt.locator,runId:e.attempt.originRun.runId,experimentId:e.attempt.originRun.experimentId,evalId:e.attempt.core.evalId,summary:Object.freeze({experimentId:e.attempt.originRun.experimentId,adapter:e.attempt.originRun.context.execution.adapter,identity:Object.freeze({runId:e.attempt.originRun.runId,evalId:e.attempt.core.evalId,attempt:n===void 0?KA():GA(n.attemptOrdinal)}),verdict:e.attempt.verdict??`unknown`,startedAt:new Date(e.attempt.originRun.startedAt).toISOString(),durationMs:KA(),capabilities:Object.freeze({source:e.attempt.sections.sources.state,execution:e.attempt.sections.trace.state,timing:e.attempt.sections.timing.state,diff:e.attempt.sections.diff.state}),...i===void 0?{}:{totalScore:i}}),assertionEntryIds:Object.freeze(e.attempt.assertions.entries.map(({entryId:e})=>e)),traceItemIds:Object.freeze([...t.trace.identityIndex.itemIds]),toolOccurrenceIds:Object.freeze([...t.trace.identityIndex.toolOccurrenceIds.ids]),commandIds:Object.freeze([...t.trace.identityIndex.commandIds])})}function JA(e,t){let[n,r]=UA(t);return fc({queryKey:[`insight-attempt`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(AA(e,n)),e.queryClient.fetchQuery(AA(e,r))]);return qA(t,i)}})}function YA(e,t,n,r,i){return fc({queryKey:[`insight-results`,e.identity,r??null,i??null],queryFn:async()=>{let e=t.groups.find(({identity:e})=>e.kind===r&&(e.kind===`named`?e.groupId===i:e.experimentId===i));if(e===void 0&&t.groups.length>0)throw new zA(`Results selection is unavailable.`);let a=e?.members??[];return Object.freeze({overview:n,selectedExperiments:a,selectionTitle:e?.label??`Results`})}})}function XA(e,t,n){return fc({queryKey:[`insight-experiment`,e.identity,n],queryFn:async()=>{if(!t.catalog.experiments.includes(n))throw new zA(`Experiment selection is unavailable.`);let e=[n];return Object.freeze({overview:t,selectedExperiments:Object.freeze(e),selectionTitle:e[0]??`Results`})}})}function ZA(e){let t=e.overview.cells.map(e=>Object.freeze({experimentId:e.experimentId,evalId:e.evalId,evaluationKind:e.evaluationKind,passRate:QA(e.verdict.passRate),score:QA(e.score),costUSD:QA(e.costUSD),durationMs:QA(e.durationMs),tokens:QA(e.tokens),tally:Object.freeze({...e.verdict.tally}),members:Object.freeze(e.members.map(e=>Object.freeze({runId:e.runId,attemptOrdinal:e.attemptOrdinal,publication:e.publication.state===`published`?Object.freeze({state:`published`,locator:e.publication.attemptLocator,score:QA(e.publication.score),costUSD:QA(e.publication.costUSD),durationMs:QA(e.publication.durationMs),tokens:QA(e.publication.tokens)}):e.publication})))})),n=e.overview.experiments.map(e=>Object.freeze({experimentId:e.experimentId,evaluationKind:e.evaluationKind,passRate:QA(e.verdict.passRate),score:QA(e.score),costUSD:QA(e.costUSD),durationMs:QA(e.durationMs),tokens:QA(e.tokens),adapter:e.adapter,model:e.model,groups:Object.freeze(e.groups.map(e=>Object.freeze({groupPath:Object.freeze([...e.groupPath]),evaluationKind:e.evaluationKind,passRate:QA(e.verdict.passRate),score:QA(e.score),costUSD:QA(e.costUSD),durationMs:QA(e.durationMs),tokens:QA(e.tokens)})))})),r=n.map(({experimentId:e})=>e),i=rj(t.flatMap(e=>e.members.map(t=>({runId:t.runId,experimentId:e.experimentId}))),({runId:e})=>e),a=rj(t.flatMap(e=>e.members.flatMap(t=>t.publication.state===`published`?[{locator:t.publication.locator,experimentId:e.experimentId}]:[])),({locator:e})=>e);return Object.freeze({cells:Object.freeze(t),experiments:Object.freeze(n),catalog:Object.freeze({experiments:Object.freeze(r),runExperiments:Object.freeze(i),attemptExperiments:Object.freeze(a)})})}function QA(e){return Object.freeze({value:e.value,state:e.state,samples:e.samples,total:e.total,basis:e.basis,issues:Object.freeze(e.issues),refs:Object.freeze(e.refs.map(e=>Object.freeze({identity:Object.freeze({kind:e.identity.kind,locator:e.identity.locator})}))),...e.unit===void 0?{}:{unit:e.unit},...`source`in e&&(e.source===`reported`||e.source===`estimated`||e.source===`mixed`||e.source===null)?{source:e.source}:{},...e.bounds===void 0?{}:{bounds:Object.freeze({...e.bounds})}})}function $A(e,t){let n=new Set(t),r=e.cells.filter(({experimentId:e})=>n.has(e)),i=[...new Set(r.map(({evalId:e})=>e))];return t.flatMap(t=>{let n=e.experiments.find(e=>e.experimentId===t);if(n===void 0)return[];let a=r.filter(e=>e.experimentId===t);if(a.length===0)return[];let o=a.map(ej),s=n.evaluationKind,c=i.filter(e=>!a.some(t=>t.evalId===e));return[Object.freeze({experimentId:t,adapter:n.adapter,model:n.model,flags:null,evaluationKind:s,score:n.score,costUSD:n.costUSD,durationMs:n.durationMs,tokens:n.tokens,endToEndPassRate:n.passRate,missingEvalIds:Object.freeze(c),groupMetrics:tj(n.groups),evalRows:Object.freeze(o),href:`#/experiment/${encodeURIComponent(t)}`})]})}function ej(e){let t=e.members.flatMap(t=>{if(t.publication.state!==`published`)return[];let n=e.members.length===1?nj(e.tally):null;return[Object.freeze({locator:t.publication.locator,experimentId:e.experimentId,evalId:e.evalId,attemptOrdinal:t.attemptOrdinal,verdict:n,failureSummary:null,evaluationKind:e.evaluationKind===`pass`?`pass`:`points`,score:t.publication.score,costUSD:t.publication.costUSD,durationMs:t.publication.durationMs,tokens:t.publication.tokens,startedAt:null,href:`#/attempt/${t.publication.locator.startsWith(`@`)?t.publication.locator.slice(1):t.publication.locator}`})]});return Object.freeze({evalId:e.evalId,evaluationKind:e.evaluationKind===`pass`?`pass`:`points`,score:e.score,costUSD:e.costUSD,durationMs:e.durationMs,tokens:e.tokens,endToEndPassRate:e.passRate,attempts:Object.freeze(t)})}function tj(e){return new Map(e.map(e=>[e.groupPath.join(`/`),Object.freeze({passRate:e.passRate,score:e.score,costUSD:e.costUSD,durationMs:e.durationMs,tokens:e.tokens})]))}function nj(e){return e.passed===1&&e.failed===0&&e.errored===0&&e.skipped===0?`passed`:e.passed===0&&e.failed===1&&e.errored===0&&e.skipped===0?`failed`:e.passed===0&&e.failed===0&&e.errored===1&&e.skipped===0?`errored`:e.passed===0&&e.failed===0&&e.errored===0&&e.skipped===1?`skipped`:null}function rj(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return Object.freeze([...n.values()])}function ij(e,t){return Object.freeze({runId:e.run.value.runId,experimentId:e.run.value.experimentId,adapter:e.run.value.context?.execution.adapter??null,members:Object.freeze(t.summary.members.map((e,t)=>Object.freeze({key:`${e.slotId}:${t}`,slotId:e.slotId,evalId:e.evalId,attemptOrdinal:e.attemptOrdinal,state:e.state,locator:e.locator,outcome:e.outcome,verdict:e.verdict,...e.score===void 0?{}:{score:e.score}})))})}function aj(e,t){let[n,r]=HA(t);return fc({queryKey:[`insight-run`,e.identity,t],queryFn:async()=>{let[t,i]=await Promise.all([e.queryClient.fetchQuery(AA(e,n)),e.queryClient.fetchQuery(AA(e,r))]);return ij(t,i)}})}var oj=Object.defineProperty,sj=(e,t)=>oj(e,`name`,{value:t,configurable:!0}),cj=!!(typeof window<`u`&&window.document&&window.document.createElement);function lj(e,t,{checkForDefaultPrevented:n=!0}={}){return sj(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}sj(lj,`composeEventHandlers`);function uj(e){if(!cj)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}sj(uj,`getOwnerWindow`);function dj(e){if(!cj)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}sj(dj,`getOwnerDocument`);function fj(e,t=!1){let{activeElement:n}=dj(e);if(!n?.nodeName)return null;if(pj(n)&&n.contentDocument)return fj(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=dj(n).getElementById(e);if(t)return t}}return n}sj(fj,`getActiveElement`);function pj(e){return e.tagName===`IFRAME`}sj(pj,`isFrame`);var mj=Object.defineProperty,hj=(e,t)=>mj(e,`name`,{value:t,configurable:!0});function gj(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}hj(gj,`setRef`);function _j(...e){return t=>{let n=!1,r=e.map(e=>{let r=gj(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():gj(e[t],null)}}}}hj(_j,`composeRefs`);function vj(...e){return v.useCallback(_j(...e),e)}hj(vj,`useComposedRefs`);var yj=Object.defineProperty,bj=(e,t)=>yj(e,`name`,{value:t,configurable:!0});function xj(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=bj(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return bj(i,`useContext`),[r,i]}bj(xj,`createContext`);function Sj(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=bj(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return bj(s,`useContext`),[o,s]}bj(r,`createContext`);let i=bj(()=>{let t=n.map(e=>v.createContext(e));return bj(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Cj(i,...t)]}bj(Sj,`createContextScope`);function Cj(...e){let t=e[0];if(e.length===1)return t;let n=bj(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return bj(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}bj(Cj,`composeContextScopes`);var wj=globalThis?.document?v.useLayoutEffect:()=>{},Tj=Object.defineProperty,Ej=(e,t)=>Tj(e,`name`,{value:t,configurable:!0}),Dj=v.useId||(()=>void 0),Oj=0;function kj(e){let[t,n]=v.useState(Dj());return wj(()=>{e||n(e=>e??String(Oj++))},[e]),e||(t?`radix-${t}`:``)}Ej(kj,`useId`);var Aj=Object.defineProperty,jj=(e,t)=>Aj(e,`name`,{value:t,configurable:!0}),Mj=v.useEffectEvent,Nj=v.useInsertionEffect;function Pj(e){if(typeof Mj==`function`)return Mj(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Nj==`function`?Nj(()=>{t.current=e}):wj(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}jj(Pj,`useEffectEvent`);var Fj=Object.defineProperty,Ij=(e,t)=>Fj(e,`name`,{value:t,configurable:!0}),Lj=v.useInsertionEffect||wj;function Rj({prop:e,defaultProp:t,onChange:n=Ij(()=>{},`onChange`),caller:r}){let[i,a,o]=zj({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Bj(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ij(Rj,`useControllableState`);function zj({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Lj(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ij(zj,`useUncontrolledState`);function Bj(e){return typeof e==`function`}Ij(Bj,`isFunction`);var Vj=Symbol(`RADIX:SYNC_STATE`);function Hj(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Pj(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===Vj)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Vj,state:i})},[i,d.state,c]),[h,f]}Ij(Hj,`useControllableStateReducer`);var Uj=Object.defineProperty,Wj=(e,t)=>Uj(e,`name`,{value:t,configurable:!0});function Gj(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];$j(r)&&typeof rM==`function`&&(r=rM(r._payload)),v.Children.forEach(r,e=>{if(Zj(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;$j(n)&&typeof rM==`function`&&(n=rM(n._payload)),a=Jj(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?Xj(a):void 0,l=vj(n,c);if(!a){if(r||r===0)throw Error(o?nM(e):tM(e));return r}let u=Yj(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Wj(Gj,`createSlot`);var Kj=Symbol.for(`radix.slottable`);function qj(e){let t=Wj(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Kj,t}Wj(qj,`createSlottable`);var Jj=Wj((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Yj(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Wj(Yj,`mergeProps`);function Xj(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Wj(Xj,`getElementRef`);function Zj(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Kj}Wj(Zj,`isSlottable`);var Qj=Symbol.for(`react.lazy`);function $j(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Qj&&`_payload`in e&&eM(e._payload)}Wj($j,`isLazyComponent`);function eM(e){return typeof e==`object`&&!!e&&`then`in e}Wj(eM,`isPromiseLike`);var tM=Wj(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),nM=Wj(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),rM=v.use,iM=Object.defineProperty,aM=(e,t)=>iM(e,`name`,{value:t,configurable:!0}),oM=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Gj(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sM(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}aM(sM,`dispatchDiscreteCustomEvent`);var cM=Object.defineProperty,lM=(e,t)=>cM(e,`name`,{value:t,configurable:!0});function uM(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}lM(uM,`useCallbackRef`);var dM=Object.defineProperty,fM=(e,t)=>dM(e,`name`,{value:t,configurable:!0}),pM=`dismissableLayer.update`,mM=`dismissableLayer.pointerDownOutside`,hM=`dismissableLayer.focusOutside`,gM,_M=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),vM=v.forwardRef(fM(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(_M),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=vj(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_?g.indexOf(_):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=v.useRef(!1),w=xM(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=SM(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=uM(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gM=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),CM(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=gM))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),CM())},[d,u]),v.useEffect(()=>{let e=fM(()=>m({}),`handleUpdate`);return document.addEventListener(pM,e),()=>document.removeEventListener(pM,e)},[]),(0,M.jsx)(oM.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:lj(e.onFocusCapture,T.onFocusCapture),onBlurCapture:lj(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:lj(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function yM(){let e=v.useContext(_M),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}fM(yM,`useDismissableLayerSurface`);var bM=fM(()=>!0,`IS_TRUE`);function xM(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=bM}=t,s=uM(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}fM(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}fM(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}fM(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}fM(p,`handleInteractionBubble`);let m=fM(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||wM(mM,s,p,{discrete:!0})};if(fM(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:fM(()=>c.current=!0,`onPointerDownCapture`)}}fM(xM,`usePointerDownOutside`);function SM(e,t=globalThis?.document){let n=uM(e),r=v.useRef(!1);return v.useEffect(()=>{let e=fM(e=>{e.target&&!r.current&&wM(hM,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:fM(()=>r.current=!0,`onFocusCapture`),onBlurCapture:fM(()=>r.current=!1,`onBlurCapture`)}}fM(SM,`useFocusOutside`);function CM(){let e=new CustomEvent(pM);document.dispatchEvent(e)}fM(CM,`dispatchUpdate`);function wM(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?sM(i,a):i.dispatchEvent(a)}fM(wM,`handleAndDispatchCustomEvent`);var TM=Object.defineProperty,EM=(e,t)=>TM(e,`name`,{value:t,configurable:!0}),DM=`focusScope.autoFocusOnMount`,OM=`focusScope.autoFocusOnUnmount`,kM={bubbles:!1,cancelable:!0},AM=v.forwardRef(EM(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=uM(i),u=uM(a),d=v.useRef(null),f=vj(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:LM(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||LM(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&LM(s)};EM(e,`handleFocusIn`),EM(t,`handleFocusOut`),EM(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){RM.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(DM,kM);s.addEventListener(DM,l),s.dispatchEvent(t),t.defaultPrevented||(jM(VM(NM(s)),{select:!0}),document.activeElement===e&&LM(s))}return()=>{s.removeEventListener(DM,l),setTimeout(()=>{let t=new CustomEvent(OM,kM);s.addEventListener(OM,u),s.dispatchEvent(t),t.defaultPrevented||LM(e??document.body,{select:!0}),s.removeEventListener(OM,u),RM.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=MM(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&LM(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&LM(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(oM.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function jM(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(LM(r,{select:t}),document.activeElement!==n)return}EM(jM,`focusFirst`);function MM(e){let t=NM(e);return[PM(t,e),PM(t.reverse(),e)]}EM(MM,`getTabbableEdges`);function NM(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:EM(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}EM(NM,`getTabbableCandidates`);function PM(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):FM(r,{upTo:t})))return r}EM(PM,`findVisible`);function FM(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}EM(FM,`isHidden`);function IM(e){return e instanceof HTMLInputElement&&`select`in e}EM(IM,`isSelectableInput`);function LM(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&IM(e)&&t&&e.select()}}EM(LM,`focus`);var RM=zM();function zM(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=BM(e,t),e.unshift(t)},remove(t){e=BM(e,t),e[0]?.resume()}}}EM(zM,`createFocusScopesStack`);function BM(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}EM(BM,`arrayRemove`);function VM(e){return e.filter(e=>e.tagName!==`A`)}EM(VM,`removeLinks`);var HM=Object.defineProperty,UM=v.forwardRef(((e,t)=>HM(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);wj(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?y.createPortal((0,M.jsx)(oM.div,{...r,ref:t}),o):null},`Portal`)),WM=Object.defineProperty,GM=(e,t)=>WM(e,`name`,{value:t,configurable:!0});function KM(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}GM(KM,`useStateMachine`);var qM=GM(e=>{let{present:t,children:n}=e,r=JM(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=XM(r.ref,QM(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function JM(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=KM(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??ZM(r.current),o.current=void 0):a.current=`none`},[s]),wj(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ZM(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),wj(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=GM(a=>{let o=ZM(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=GM(e=>{e.target===t&&(a.current=ZM(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ZM(t)}else r.current=null;n(e)},[])}}GM(JM,`usePresence`);function YM(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}GM(YM,`setRef`);function XM(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=YM(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():YM(n[e],null)}}},[])}GM(XM,`useStableComposedRefs`);function ZM(e){return e?.animationName||`none`}GM(ZM,`getAnimationName`);function QM(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}GM(QM,`getElementRef`);var $M=Object.defineProperty,eN=(e,t)=>$M(e,`name`,{value:t,configurable:!0}),tN=0,nN=null;function rN(e){return iN(),e.children}eN(rN,`FocusGuards`);function iN(){v.useEffect(()=>{nN||={start:aN(),end:aN()};let{start:e,end:t}=nN;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),tN++,()=>{tN===1&&(nN?.start.remove(),nN?.end.remove(),nN=null),tN=Math.max(0,tN-1)}},[])}eN(iN,`useFocusGuards`);function aN(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}eN(aN,`createFocusGuard`);var oN=function(){return oN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oN.apply(this,arguments)};function sN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cN(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var lN=`right-scroll-bar-position`,uN=`width-before-scroll-bar`,dN=`with-scroll-bars-hidden`,fN=`--removed-body-scroll-bar-size`;function pN(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function mN(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hN=typeof window<`u`?v.useLayoutEffect:v.useEffect,gN=new WeakMap;function _N(e,t){var n=mN(t||null,function(t){return e.forEach(function(e){return pN(e,t)})});return hN(function(){var t=gN.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||pN(e,null)}),i.forEach(function(e){r.has(e)||pN(e,a)})}gN.set(n,e)},[e]),n}function vN(e){return e}function yN(e,t){t===void 0&&(t=vN);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function bN(e){e===void 0&&(e={});var t=yN(null);return t.options=oN({async:!0,ssr:!1},e),t}var xN=function(e){var t=e.sideCar,n=sN(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,oN({},n))};xN.isSideCarExport=!0;function SN(e,t){return e.useMedium(t),xN}var CN=bN(),wN=function(){},TN=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:wN,onWheelCapture:wN,onTouchMoveCapture:wN}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=sN(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=_N([n,t]),w=oN(oN({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:CN,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),oN(oN({},w),{ref:C})):v.createElement(y,oN({},w,{className:c,ref:C}),s))});TN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},TN.classNames={fullWidth:uN,zeroRight:lN};var EN=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function DN(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=EN();return t&&e.setAttribute(`nonce`,t),e}function ON(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kN(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var AN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=DN())&&(ON(t,n),kN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jN=function(){var e=AN();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MN=function(){var e=jN();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},NN={left:0,top:0,right:0,gap:0},PN=function(e){return parseInt(e||``,10)||0},FN=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[PN(n),PN(r),PN(i)]},IN=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return NN;var t=FN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},LN=MN(),RN=`data-scroll-locked`,zN=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
19
- .${dN} {
20
- overflow: hidden ${r};
21
- padding-right: ${s}px ${r};
22
- }
23
- body[${RN}] {
24
- overflow: hidden ${r};
25
- overscroll-behavior: contain;
26
- ${[t&&`position: relative ${r};`,n===`margin`&&`
27
- padding-left: ${i}px;
28
- padding-top: ${a}px;
29
- padding-right: ${o}px;
30
- margin-left:0;
31
- margin-top:0;
32
- margin-right: ${s}px ${r};
33
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
34
- }
35
-
36
- .${lN} {
37
- right: ${s}px ${r};
38
- }
39
-
40
- .${uN} {
41
- margin-right: ${s}px ${r};
42
- }
43
-
44
- .${lN} .${lN} {
45
- right: 0 ${r};
46
- }
47
-
48
- .${uN} .${uN} {
49
- margin-right: 0 ${r};
50
- }
51
-
52
- body[${RN}] {
53
- ${fN}: ${s}px;
54
- }
55
- `},BN=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},VN=function(){v.useEffect(function(){return document.body.setAttribute(RN,(BN()+1).toString()),function(){var e=BN()-1;e<=0?document.body.removeAttribute(RN):document.body.setAttribute(RN,e.toString())}},[])},HN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;VN();var a=v.useMemo(function(){return IN(i)},[i]);return v.createElement(LN,{styles:zN(a,!t,i,n?``:`!important`)})},UN=!1;if(typeof window<`u`)try{var WN=Object.defineProperty({},"passive",{get:function(){return UN=!0,!0}});window.addEventListener(`test`,WN,WN),window.removeEventListener(`test`,WN,WN)}catch{UN=!1}var GN=UN?{passive:!1}:!1,KN=function(e){return e.tagName===`TEXTAREA`},qN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!KN(e)&&n[t]===`visible`)},JN=function(e){return qN(e,`overflowY`)},YN=function(e){return qN(e,`overflowX`)},XN=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),$N(e,r)){var i=eP(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZN=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},QN=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},$N=function(e,t){return e===`v`?JN(t):YN(t)},eP=function(e,t){return e===`v`?ZN(t):QN(t)},tP=function(e,t){return e===`h`&&t===`rtl`?-1:1},nP=function(e,t,n,r,i){var a=tP(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=eP(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&$N(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},rP=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iP=function(e){return[e.deltaX,e.deltaY]},aP=function(e){return e&&`current`in e?e.current:e},oP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sP=function(e){return`
56
- .block-interactivity-${e} {pointer-events: none;}
57
- .allow-interactivity-${e} {pointer-events: all;}
58
- `},cP=0,lP=[];function uP(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(cP++)[0],a=v.useState(MN)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=cN([e.lockRef.current],(e.shards||[]).map(aP),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=rP(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=XN(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=XN(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return nP(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(lP.length&&lP[lP.length-1]===a){var r=`deltaY`in n?iP(n):rP(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&oP(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(aP).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:dP(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=rP(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,iP(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,rP(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return lP.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,GN),document.addEventListener(`touchmove`,c,GN),document.addEventListener(`touchstart`,u,GN),function(){lP=lP.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,GN),document.removeEventListener(`touchmove`,c,GN),document.removeEventListener(`touchstart`,u,GN)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:sP(i)}):null,p?v.createElement(HN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var fP=SN(CN,uP),pP=v.forwardRef(function(e,t){return v.createElement(TN,oN({},e,{ref:t,sideCar:fP}))});pP.classNames=TN.classNames;var mP=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},hP=new WeakMap,gP=new WeakMap,_P={},vP=0,yP=function(e){return e&&(e.host||yP(e.parentNode))},bP=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=yP(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},xP=function(e,t,n,r){var i=bP(t,Array.isArray(e)?e:[e]);_P[n]||(_P[n]=new WeakMap);var a=_P[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(hP.get(e)||0)+1,l=(a.get(e)||0)+1;hP.set(e,c),a.set(e,l),o.push(e),c===1&&i&&gP.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),vP++,function(){o.forEach(function(e){var t=hP.get(e)-1,i=a.get(e)-1;hP.set(e,t),a.set(e,i),t||(gP.has(e)||e.removeAttribute(r),gP.delete(e)),i||e.removeAttribute(n)}),vP--,vP||(hP=new WeakMap,hP=new WeakMap,gP=new WeakMap,_P={})}},SP=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||mP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),xP(r,i,n,`aria-hidden`)):function(){return null}},CP=Object.defineProperty,wP=(e,t)=>CP(e,`name`,{value:t,configurable:!0}),TP=`Dialog`,[EP,DP]=Sj(TP),[OP,kP]=EP(TP),AP=wP(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Rj({prop:r,defaultProp:i??!1,onChange:a,caller:TP}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,M.jsx)(OP,{scope:t,triggerRef:s,contentRef:c,contentId:kj(),titleId:kj(),descriptionId:kj(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),jP=`DialogPortal`,[MP,NP]=EP(jP,{forceMount:void 0}),PP=wP(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=kP(jP,t);return(0,M.jsx)(MP,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,M.jsx)(qM,{present:n||a.open,children:(0,M.jsx)(UM,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),FP=`DialogOverlay`,IP=v.forwardRef(wP(function(e,t){let n=NP(FP,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kP(FP,e.__scopeDialog);return a.modal?(0,M.jsx)(qM,{present:r||a.open,children:(0,M.jsx)(RP,{...i,ref:t})}):null},`DialogOverlay`)),LP=Gj(`DialogOverlay.RemoveScroll`),RP=v.forwardRef(wP(function(e,t){let{__scopeDialog:n,...r}=e,i=kP(FP,n),a=vj(t,yM());return(0,M.jsx)(pP,{as:LP,allowPinchZoom:!0,shards:[i.contentRef],children:(0,M.jsx)(oM.div,{"data-state":JP(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),zP=`DialogContent`,BP=v.forwardRef(wP(function(e,t){let n=NP(zP,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kP(zP,e.__scopeDialog);return(0,M.jsx)(qM,{present:r||a.open,children:a.modal?(0,M.jsx)(VP,{...i,ref:t}):(0,M.jsx)(HP,{...i,ref:t})})},`DialogContent`)),VP=v.forwardRef(wP(function(e,t){let n=kP(zP,e.__scopeDialog),r=v.useRef(null),i=vj(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return SP(e)},[]),(0,M.jsx)(UP,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:lj(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:lj(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:lj(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),HP=v.forwardRef(wP(function(e,t){let n=kP(zP,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,M.jsx)(UP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),UP=v.forwardRef(wP(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=kP(zP,n);return iN(),(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(AM,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(vM,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":JP(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),WP=`DialogTitle`,GP=v.forwardRef(wP(function(e,t){let{__scopeDialog:n,...r}=e,i=kP(WP,n),{setTitleCount:a}=i;return wj(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,M.jsx)(oM.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),KP=`DialogClose`,qP=v.forwardRef(wP(function(e,t){let{__scopeDialog:n,...r}=e,i=kP(KP,n);return(0,M.jsx)(oM.button,{type:`button`,...r,ref:t,onClick:lj(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function JP(e){return e?`open`:`closed`}wP(JP,`getState`);var YP=(0,v.createContext)(!1);function XP({locked:e,children:t}){return(0,M.jsx)(YP.Provider,{value:e,children:t})}function ZP(){return(0,v.useContext)(YP)}function QP(){let e=Ar(),[t,n]=(0,v.useState)(`idle`),r=(0,v.useRef)(!0),i=(0,v.useRef)(0),a=(0,v.useRef)(!1),o=(0,v.useRef)(void 0),s=(0,v.useRef)(void 0),c=(0,v.useRef)([]),l=(0,v.useRef)([]),u=t!==`idle`,d=(0,v.useCallback)(({nextLocation:e})=>{let t=o.current;if(!u||t===void 0||!t.active||t.signal.aborted||!r.current)return!1;let n={sequence:++i.current,source:a.current?`fallback`:`user`,location:e};t.latestIntent=n;let s=c.current.filter(e=>e.session===t&&e.intent.sequence<n.sequence);c.current=c.current.filter(e=>e.session!==t||e.intent.sequence>=n.sequence);for(let e of s)e.resolve(void 0);return!0},[u]),f=Yr(d),p=(0,v.useRef)(f);p.current=f;let m=(0,v.useCallback)(e=>{if(!r.current||!e.active)throw Error(`View refresh navigation lock owner is no longer active.`);if(e.signal.aborted)throw e.signal.reason},[]),h=(0,v.useCallback)((e,t)=>{m(e);let n=p.current;return $P(n,t)?Promise.resolve(n):new Promise((n,r)=>{c.current.push({session:e,intent:t,resolve:n,reject:r})})},[m]),g=(0,v.useCallback)(e=>(m(e),p.current.state===`unblocked`?Promise.resolve():new Promise((t,n)=>l.current.push({session:e,resolve:t,reject:n}))),[m]),_=(0,v.useCallback)((e,t)=>{if(!e.active)return;e.active=!1,e.removeAbortListener(),o.current===e&&(o.current=void 0);let n=s.current;n?.session===e&&(s.current=void 0,n.reject(t));let r=c.current.filter(t=>t.session===e);c.current=c.current.filter(t=>t.session!==e);for(let e of r)e.reject(t);let i=l.current.filter(t=>t.session===e);l.current=l.current.filter(t=>t.session!==e);for(let e of i)e.reject(t)},[]),y=(0,v.useCallback)(e=>{if(e.aborted)return Promise.reject(e.reason);if(!r.current||s.current!==void 0||o.current!==void 0||t!==`idle`)return Promise.reject(Error(`A View refresh navigation lock is already active.`));let i,a=()=>_(i,e.reason);return i={signal:e,active:!0,removeAbortListener:()=>e.removeEventListener(`abort`,a)},o.current=i,e.addEventListener(`abort`,a,{once:!0}),n(`locked`),new Promise((e,t)=>{s.current={session:i,resolve:e,reject:t}})},[_,t]),b=(0,v.useRef)(void 0);return b.current===void 0&&(b.current={hasUserIntent:()=>o.current?.latestIntent?.source===`user`,enqueueFallback:async t=>{let n=o.current;if(n===void 0)throw Error(`View refresh navigation lock is not active.`);if(m(n),n.latestIntent?.source!==`user`){a.current=!0;try{await e(t,{replace:!0,state:null})}finally{a.current=!1}if(n.latestIntent===void 0)throw Error(`View refresh fallback navigation was not blocked.`);m(n)}},release:async()=>{let e=o.current;if(e===void 0)throw Error(`View refresh navigation lock is not active.`);return e.release===void 0&&(e.release=(async()=>{m(e);let t;for(;e.latestIntent!==void 0;){let n=e.latestIntent,r=await h(e,n);if(m(e),e.latestIntent?.sequence!==n.sequence)continue;let i=p.current;if(r!==void 0&&$P(i,n)&&i===r){t=n.source,i.proceed();break}}return m(e),await g(e),m(e),n(`idle`),e.active=!1,e.removeAbortListener(),o.current===e&&(o.current=void 0),t})()),e.release},recover:()=>{let e=o.current;if(e===void 0)throw Error(`View refresh navigation lock is not active.`);m(e),n(`recovery`)}}),(0,v.useEffect)(()=>{if(t!==`locked`||s.current===void 0)return;let e=s.current;m(e.session),s.current=void 0,e.resolve(b.current)},[t,m,d]),(0,v.useEffect)(()=>{if(f.state!==`blocked`)return;let e=c.current.filter(e=>$P(f,e.intent));c.current=c.current.filter(e=>!$P(f,e.intent));for(let t of e)try{m(t.session),t.resolve(f)}catch(e){t.reject(e)}},[f,m]),(0,v.useEffect)(()=>{if(f.state!==`unblocked`)return;let e=l.current.splice(0);for(let t of e)try{m(t.session),t.resolve()}catch(e){t.reject(e)}},[f,m]),(0,v.useEffect)(()=>(r.current=!0,()=>{r.current=!1;let e=o.current;e!==void 0&&_(e,Error(`View refresh navigation lock owner was unmounted.`))}),[_]),{acquire:y,interactionLocked:u,recoveryRequired:t===`recovery`}}function $P(e,t){return e.state===`blocked`&&e.location===t.location&&eF(e.location,t.location)}function eF(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}function tF({title:e,children:t,onClose:n}){let{t:r}=Fo(),i=ZP();return(0,M.jsx)(AP,{open:!0,onOpenChange:e=>{e||n()},children:(0,M.jsxs)(PP,{children:[(0,M.jsx)(IP,{className:`niceeval-view-dialog-overlay`,inert:i?!0:void 0}),(0,M.jsxs)(BP,{className:`niceeval-view-dialog`,inert:i?!0:void 0,onEscapeKeyDown:e=>{i&&e.preventDefault()},onPointerDownOutside:e=>{i&&e.preventDefault()},children:[(0,M.jsxs)(`div`,{className:`niceeval-view-dialog-head`,children:[(0,M.jsx)(GP,{className:`niceeval-view-dialog-title`,children:e}),(0,M.jsx)(qP,{disabled:i,className:`niceeval-view-dialog-close`,"aria-label":r(`report.close`),children:`×`})]}),(0,M.jsx)(`div`,{className:`niceeval-view-dialog-body niceeval-view-report-slot`,children:t})]})]})})}function nF(e,t){return typeof e==`string`?e:e[t]??e.en??Object.values(e).find(e=>typeof e==`string`)??``}function rF(...e){return e.filter(Boolean).join(` `)}function iF(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function aF(e){return typeof e==`string`||iF(e)&&Object.values(e).every(e=>typeof e==`string`)}function oF(e,t,n,r){return Error(`<${e}> received invalid ${n} from ${t}: ${r}.`)}function sF(e){return e.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,``)}function cF(e){let t=/^turn[-_ ]?(\d+)$/i.exec(e);return t===null?e:`Turn ${t[1]}`}function lF(e){if(e<1e3)return`${Math.round(e)}ms`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function uF(e,t=`en`){return new Intl.NumberFormat(t===`zh-CN`?`zh-CN`:`en-US`,{maximumFractionDigits:12,maximumSignificantDigits:12}).format(e)}function dF(e,t=`en`){return`${uF(e,t)} ${e===1?`pt`:`pts`}`}function fF(e,t){let n=new Date(e);return Number.isNaN(n.valueOf())?e:n.toLocaleString(t===`zh-CN`?`zh-CN`:`en-US`)}function pF(e){let t=Math.abs(e);if(t!==0&&t<1e-9)return`$${e.toExponential(4)}`;let n=t===0||t>=1?6:Math.min(12,Math.max(2,Math.ceil(-Math.log10(t))+5));return`$${e.toFixed(n).replace(/(?:\.0+|(?:(\.[0-9]*?)0+))$/,`$1`)}`}var mF={error:3,warning:2,info:1};function hF(e){return e.length===0||_F(e)===0}function gF(e){let t=[];for(let n of e){let e=n.groups;if(n.items.length===0&&e?.length===1){t.push(e[0]);continue}t.push(n)}return t}function _F(e){let t=0,n=e=>{for(let r of e)t+=r.items.length,r.groups&&n(r.groups)};return n(e),t}function vF(e){let t=`info`,n=e=>{for(let r of e){for(let e of r.items)mF[e.level]>mF[t]&&(t=e.level);r.groups&&n(r.groups)}};return n(e),t}function yF(e){return[...new Set(e.map(e=>e.command).filter(e=>e!==void 0))]}function bF(e){let t=yF(e.items);return t.length>1?null:t.length===1?t[0]:e.command??null}function xF(e,t){return t===`zh-CN`?e===`error`?`错误`:e===`warning`?`警告`:`提示`:e===`error`?`errors`:e===`warning`?`warnings`:`notices`}function SF(e,t){let n=gF(e),r=_F(e),i=xF(vF(e),t);if(n.length===1){let e=nF(n[0].title,t);return t===`zh-CN`?`${e} · ${r} 条${i}`:`${e} · ${r} ${i}`}return t===`zh-CN`?`${n.length} 组 · ${r} 条${i}`:`${n.length} groups · ${r} ${i}`}function CF(e,t){return e===`zh-CN`?`${t} 条明细`:t===1?`1 detail`:`${t} details`}function wF(e,t){let n=nF(e.message,t),r=e.count??1;return r<=1?n:`${n} ×${r}`}function TF({text:e,className:t,children:n}){let[r,i]=(0,v.useState)(!1),a=async()=>{try{if(navigator.clipboard===void 0)throw Error(`Clipboard API unavailable`);await navigator.clipboard.writeText(e),i(!0),window.setTimeout(()=>i(!1),1500)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);t.remove(),n&&(i(!0),window.setTimeout(()=>i(!1),1500))}};return(0,M.jsxs)(`button`,{type:`button`,className:t,onClick:()=>void a(),children:[n,r?` ✓`:``]})}function EF(...e){return e.filter(Boolean).join(` `)}function DF(e,t){return iF(e)?e.level!==`error`&&e.level!==`warning`&&e.level!==`info`?`"${t}.level" must be error | warning | info`:aF(e.message)?null:`"${t}.message" must be a LocalizedText`:`"${t}" must be an object`}function OF(e,t){if(!iF(e))return`"${t}" must be an object`;if(!aF(e.title))return`"${t}.title" must be a LocalizedText`;if(!Array.isArray(e.items))return`"${t}.items" must be an array`;for(let n=0;n<e.items.length;n++){let r=DF(e.items[n],`${t}.items[${n}]`);if(r!==null)return r}return null}function kF(e){if(!Array.isArray(e))throw oF(`Callouts`,`toSampleNotices`,`CalloutGroup[]`,`"items" must be an array`);for(let t=0;t<e.length;t++){let n=OF(e[t],`items[${t}]`);if(n!==null)throw oF(`Callouts`,`toSampleNotices`,`CalloutGroup[]`,n)}return e}function AF({command:e}){return(0,M.jsx)(TF,{className:`niceeval-callout-command`,text:e,children:(0,M.jsx)(`code`,{children:e})})}function jF({group:e,locale:t,detailsOpen:n}){let r=bF(e),i=e.groups;return(0,M.jsxs)(`li`,{className:`niceeval-callout-group`,children:[(0,M.jsxs)(`div`,{className:EF(`niceeval-callout-head`,`niceeval-callout-head--${vF([e])}`),children:[(0,M.jsx)(`span`,{className:`niceeval-callout-title`,children:nF(e.title,t)}),e.badges?.map((e,n)=>(0,M.jsx)(`span`,{className:`niceeval-callout-badge`,children:nF(e,t)},n)),r===null?null:(0,M.jsx)(AF,{command:r})]}),e.items.length>0?(0,M.jsxs)(`details`,{className:`niceeval-callout-details`,open:n||void 0,children:[(0,M.jsx)(`summary`,{children:CF(t,e.items.length)}),(0,M.jsx)(`ul`,{className:`niceeval-callout-items`,children:e.items.map((e,n)=>(0,M.jsxs)(`li`,{className:EF(`niceeval-callout-item`,`niceeval-callout-item--${e.level}`),children:[(0,M.jsx)(`span`,{className:`niceeval-callout-message`,children:wF(e,t)}),r===null&&e.command!==void 0?(0,M.jsx)(AF,{command:e.command}):null]},n))})]}):null,i&&i.length>0?(0,M.jsx)(`ul`,{className:`niceeval-callout-nested`,children:gF(i).map((e,r)=>(0,M.jsx)(jF,{group:e,locale:t,detailsOpen:n},r))}):null]})}function MF(e,t,n){if(hF(e))return null;let r=gF(e),i=_F(e)<=3,a=vF(e);return(0,M.jsx)(`div`,{className:EF(`niceeval-report`,`niceeval-callouts`,n),children:(0,M.jsxs)(`details`,{className:`niceeval-callouts-root`,children:[(0,M.jsx)(`summary`,{className:EF(`niceeval-callouts-summary`,`niceeval-callouts-summary--${a}`),children:SF(e,t)}),(0,M.jsx)(`ul`,{className:`niceeval-callout-groups`,children:r.map((e,n)=>(0,M.jsx)(jF,{group:e,locale:t,detailsOpen:i},n))})]})})}function NF({items:e,locale:t,className:n}){return MF(kF(e??[]),t,n)}function PF(...e){return e.filter(Boolean).join(` `)}function FF(e,t,n){return e===`zh-CN`?n:t}function IF(e){try{return JSON.parse(e)}catch{return}}function LF(e){return iF(e)?e:void 0}function RF(e,t){for(let n of t){let t=e[n];if(typeof t==`string`)return t}}function zF(e,t){for(let n of t){let t=e[n];if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return t}}function BF(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e)))}function VF({children:e,tone:t}){return(0,M.jsx)(`pre`,{className:PF(`niceeval-tool-evidence-code`,t===`error`&&`niceeval-tool-evidence-code--error`),children:e})}function HF({label:e,children:t}){return(0,M.jsxs)(`section`,{className:`niceeval-tool-evidence-section`,children:[(0,M.jsx)(`h5`,{children:e}),t]})}function UF(e,t){let n=RF(e,[`command`,`cmd`,`script`]);if(n===void 0)return;let r=RF(e,[`cwd`,`workdir`]),i=BF(e,new Set([`command`,`cmd`,`script`,`cwd`,`workdir`]));return(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":`command`,children:[r===void 0?null:(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence-context`,children:[(0,M.jsx)(`span`,{children:FF(t,`Working directory`,`工作目录`)}),(0,M.jsx)(`code`,{children:r})]}),(0,M.jsx)(HF,{label:FF(t,`Command`,`命令`),children:(0,M.jsx)(VF,{children:n})}),Object.keys(i).length===0?null:(0,M.jsx)(HF,{label:FF(t,`Additional input`,`其他输入`),children:(0,M.jsx)(VF,{children:JSON.stringify(i,null,2)})})]})}function WF(e,t){let n=RF(e,[`output`,`stdout`]),r=RF(e,[`stderr`]),i=zF(e,[`exit_code`,`exitCode`]),a=zF(e,[`signal`]);if(n===void 0&&r===void 0&&i===void 0&&a===void 0)return;let o=BF(e,new Set([`output`,`stdout`,`stderr`,`exit_code`,`exitCode`,`signal`]));return(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":`terminal`,children:[(0,M.jsxs)(`div`,{className:`niceeval-tool-evidence-context`,children:[i===void 0?null:(0,M.jsxs)(`span`,{children:[FF(t,`Exit`,`退出码`),` `,(0,M.jsx)(`strong`,{"data-failed":Number(i)!==0||void 0,children:String(i)})]}),a===void 0?null:(0,M.jsxs)(`span`,{children:[FF(t,`Signal`,`信号`),` `,(0,M.jsx)(`strong`,{children:String(a)})]})]}),n===void 0?null:(0,M.jsx)(HF,{label:FF(t,`Output`,`输出`),children:(0,M.jsx)(VF,{children:n||FF(t,`No output`,`无输出`)})}),r===void 0||r===``?null:(0,M.jsx)(HF,{label:`stderr`,children:(0,M.jsx)(VF,{tone:`error`,children:r})}),Object.keys(o).length===0?null:(0,M.jsx)(HF,{label:FF(t,`Additional result`,`其他结果`),children:(0,M.jsx)(VF,{children:JSON.stringify(o,null,2)})})]})}function GF(e,t){let n=e.phase===`finished`?e.outputSummary??``:e.inputSummary,r=IF(n),i=LF(r),a=i===void 0?void 0:e.phase===`started`?UF(i,t):WF(i,t);if(a!==void 0)return a;let o=r===void 0?n:typeof r==`string`?r:JSON.stringify(r,null,2);return(0,M.jsx)(`div`,{className:`niceeval-tool-evidence`,"data-tool-evidence-kind":r===void 0?`text`:`json`,children:(0,M.jsx)(HF,{label:r===void 0?FF(t,`Text`,`文本`):`JSON`,children:(0,M.jsx)(VF,{tone:e.outcome===`failed`||e.outcome===`rejected`?`error`:void 0,children:o})})})}function KF({content:e,locale:t}){return GF(e,t)}function qF(...e){return e.filter(Boolean).join(` `)}function JF(e,t){return e.kind===`tool-evidence`?(0,M.jsx)(KF,{content:e.content,locale:t}):e.kind===`text`?(0,M.jsx)(`div`,{className:qF(`niceeval-report`,`niceeval-text`,e.className),children:e.text}):e.items.map((e,n)=>(0,M.jsx)(v.Fragment,{children:JF(e,t)},n))}function YF(e,t,n=140){let r=sF(nF(e,t)).replace(/\s+/g,` `).trim();return r.length>n?`${r.slice(0,n)}…`:r}function XF(e){let t=e.classification===`succeeded`?`COMMAND`:e.classification===`failed`?`FAILED COMMAND`:`NON-ZERO COMMAND · observed`,n=e.exitCode===void 0?typeof e.outcome==`string`?e.outcome:JSON.stringify(e.outcome):`exit ${e.exitCode}`;return`${t} · ${e.phase} · ${n}${e.durationMs===void 0?``:` · ${e.durationMs}ms`}`}function ZF({command:e}){return(0,M.jsxs)(`article`,{className:qF(`niceeval-command-evidence-card`,`niceeval-command-evidence--${e.classification}`),children:[(0,M.jsx)(`header`,{className:`niceeval-conversation-turn-head`,children:(0,M.jsx)(`span`,{className:`niceeval-conversation-turn-label`,children:XF(e)})}),(0,M.jsx)(`div`,{className:`niceeval-command-evidence-display`,children:e.display}),e.stdout?(0,M.jsxs)(`details`,{className:`niceeval-conversation-entry niceeval-conversation-entry--expandable`,children:[(0,M.jsx)(`summary`,{className:`niceeval-conversation-entry-summary`,children:`stdout`}),(0,M.jsx)(`pre`,{className:`niceeval-conversation-io`,children:e.stdout})]}):null,e.stderr?(0,M.jsxs)(`details`,{className:`niceeval-conversation-entry niceeval-conversation-entry--expandable`,open:!0,children:[(0,M.jsx)(`summary`,{className:`niceeval-conversation-entry-summary`,children:`stderr`}),(0,M.jsx)(`pre`,{className:`niceeval-conversation-io`,children:e.stderr})]}):null]})}function QF(e){if(e==null)return null;if(!iF(e)||!Array.isArray(e.commands))throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands" must be an array`);for(let[t,n]of e.commands.entries()){if(!iF(n))throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}]" must be an object`);if(typeof n.commandId!=`string`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].commandId" must be a string`);if(typeof n.phase!=`string`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].phase" must be a string`);if(typeof n.display!=`string`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].display" must be a string`);if(n.exitCode!==void 0&&typeof n.exitCode!=`number`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].exitCode" must be a number`);if(n.outcome===void 0)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].outcome" must be present`);if(n.classification!==`succeeded`&&n.classification!==`observed`&&n.classification!==`failed`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].classification" must be succeeded | observed | failed`);if(n.durationMs!==void 0&&typeof n.durationMs!=`number`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].durationMs" must be a number`);if(n.stdout!==void 0&&typeof n.stdout!=`string`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].stdout" must be a string`);if(n.stderr!==void 0&&typeof n.stderr!=`string`)throw oF(`CommandEvidence`,`commandEvidenceData`,`CommandEvidenceContent`,`"data.commands[${t}].stderr" must be a string`)}return e}function $F({data:e,className:t,locale:n}){let r=QF(e);return r===null||r.commands.length===0?null:(0,M.jsx)(`section`,{className:qF(`niceeval-report`,`niceeval-command-evidence`,t),children:(0,M.jsxs)(`details`,{className:`niceeval-command-evidence-region`,children:[(0,M.jsx)(`summary`,{className:`niceeval-command-evidence-summary`,children:nF({en:`Commands · ${r.commands.length}`,"zh-CN":`命令证据 · ${r.commands.length}`},n)}),(0,M.jsx)(`div`,{className:`niceeval-command-evidence-cards`,children:r.commands.map(e=>(0,M.jsx)(ZF,{command:e},e.commandId))})]})})}function eI(e){return e===`added`?`A`:e===`deleted`?`D`:`M`}function tI(e){return e===`binary`?`binary`:`oversized text`}function nI(e){return[...e].sort((e,t)=>e.path.localeCompare(t.path))}var rI=new TextEncoder;function iI(e){let t=0;for(let n of e.windows)n.patch!==void 0&&(t+=rI.encode(n.patch).length);return t}function aI(e){let t=new Set,n=0;for(let r of nI(e)){if(r.elided)continue;let e=iI(r);e===0||e>65536||n+e>524288||(n+=e,t.add(r.path))}return t}function oI(e,t){return{name:e,path:t,dirs:new Map,files:[]}}function sI(e){let t=oI(``,``);for(let n of nI(e)){let e=n.path.split(`/`),r=t;for(let t=0;t<e.length-1;t++){let n=e[t],i=r.path===``?n:`${r.path}/${n}`,a=r.dirs.get(n);a===void 0&&(a=oI(n,i),r.dirs.set(n,a)),r=a}r.files.push(n)}return cI(t)}function cI(e){let t=e;for(;t.files.length===0&&t.dirs.size===1&&t.path!==``;){let e=[...t.dirs.values()][0];t={name:`${t.name}/${e.name}`,path:e.path,dirs:e.dirs,files:e.files}}let n=[...t.dirs.values()].map(cI).sort((e,t)=>e.path.localeCompare(t.path)),r=t.files,i=r.length,a=0,o=0;for(let e of r)a+=e.added,o+=e.removed;for(let e of n)i+=e.fileCount,a+=e.added,o+=e.removed;return{name:t.name,path:t.path,dirs:n,files:r,fileCount:i,added:a,removed:o}}function lI(e,t){if(!iF(e))return`"${t}" must be a DiffFile object`;if(typeof e.path!=`string`)return`"${t}.path" must be a string`;if(e.change!==`added`&&e.change!==`modified`&&e.change!==`deleted`)return`"${t}.change" must be added | modified | deleted`;if(typeof e.added!=`number`)return`"${t}.added" must be a number`;if(typeof e.removed!=`number`)return`"${t}.removed" must be a number`;if(!Array.isArray(e.windows))return`"${t}.windows" must be an array of DiffFileWindow`;for(let n=0;n<e.windows.length;n++){let r=e.windows[n];if(!iF(r)||typeof r.window!=`string`)return`"${t}.windows[${n}].window" must be a string`;if(r.patch!==void 0&&typeof r.patch!=`string`)return`"${t}.windows[${n}].patch" must be a string`}return null}function uI(e){if(e==null)return null;if(!Array.isArray(e))throw oF(`DiffView`,`diffViewFiles`,`DiffContent`,`"files" must be an array or null`);for(let t=0;t<e.length;t++){let n=lI(e[t],`files[${t}]`);if(n!==null)throw oF(`DiffView`,`diffViewFiles`,`DiffContent`,n)}return e}function dI(e){let t=[],n=1,r=1;for(let i of e.split(`
59
- `)){if(i.startsWith(`@@`)){t.push({kind:`meta`,oldNo:null,newNo:null,text:i});let e=i.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);e&&(n=Number(e[1]),r=Number(e[2]));continue}if(i.startsWith(`+++`)||i.startsWith(`---`)){t.push({kind:`meta`,oldNo:null,newNo:null,text:i});continue}if(i.startsWith(`+`)){t.push({kind:`add`,oldNo:null,newNo:r,text:i.slice(1)}),r+=1;continue}if(i.startsWith(`-`)){t.push({kind:`remove`,oldNo:n,newNo:null,text:i.slice(1)}),n+=1;continue}let e=i.startsWith(` `)?i.slice(1):i;t.push({kind:`context`,oldNo:n,newNo:r,text:e}),n+=1,r+=1}return t}function fI({patch:e}){let t=dI(e);return(0,M.jsx)(`pre`,{className:`niceeval-diff-patch`,children:t.map((e,t)=>(0,M.jsxs)(`div`,{className:rF(`niceeval-diff-patch-line`,e.kind===`add`&&`niceeval-diff-patch-line--add`,e.kind===`remove`&&`niceeval-diff-patch-line--remove`,e.kind===`meta`&&`niceeval-diff-patch-line--meta`),children:[(0,M.jsx)(`span`,{className:`niceeval-diff-patch-ln niceeval-diff-patch-ln-old`,children:e.oldNo===null?``:e.oldNo}),(0,M.jsx)(`span`,{className:`niceeval-diff-patch-ln niceeval-diff-patch-ln-new`,children:e.newNo===null?``:e.newNo}),(0,M.jsx)(`span`,{className:`niceeval-diff-patch-text`,children:e.text})]},t))})}function pI({windows:e}){let t=e.filter(e=>e.patch!==void 0&&e.patch.length>0);return t.length===0?(0,M.jsx)(`p`,{className:`niceeval-diff-patch-missing`,children:`Patch unavailable for this file.`}):(0,M.jsx)(M.Fragment,{children:t.map(e=>(0,M.jsxs)(`section`,{className:`niceeval-diff-window`,children:[(0,M.jsxs)(`h4`,{className:`niceeval-diff-window-title`,children:[`window `,cF(e.window)]}),(0,M.jsx)(fI,{patch:e.patch})]},e.window))})}function mI(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function hI({added:e,removed:t}){return(0,M.jsxs)(`span`,{className:`niceeval-diff-lines`,children:[(0,M.jsxs)(`span`,{className:`niceeval-diff-lines-added`,children:[`+`,e]}),` / `,(0,M.jsxs)(`span`,{className:`niceeval-diff-lines-removed`,children:[`-`,t]})]})}function gI({file:e}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`niceeval-diff-change`,"data-change":e.change,children:eI(e.change)}),(0,M.jsx)(`span`,{className:`niceeval-diff-path`,children:mI(e.path)}),e.elided?(0,M.jsxs)(`span`,{className:`niceeval-diff-bytes`,children:[tI(e.elided.reason),` `,e.elided.beforeBytes??0,` → `,e.elided.afterBytes??0,` bytes`]}):(0,M.jsx)(hI,{added:e.added,removed:e.removed})]})}function _I({file:e,inlined:t,drillCommand:n}){let r=rF(`niceeval-diff-file`,`niceeval-diff-${e.change}`);if(!t){let t=e.elided;return(0,M.jsxs)(`li`,{className:r,"data-inlined":`false`,children:[(0,M.jsx)(`div`,{className:`niceeval-diff-file-summary`,children:(0,M.jsx)(gI,{file:e})}),(0,M.jsxs)(`p`,{className:`niceeval-diff-patch-omitted`,children:[t?`${tI(t.reason)} file · content elided from the diff export`:`patch over inline budget`,t===void 0&&n!==void 0?(0,M.jsxs)(M.Fragment,{children:[` · `,(0,M.jsx)(`code`,{children:`${n}=${e.path}`})]}):null]})]})}return(0,M.jsx)(`li`,{className:r,"data-inlined":`true`,children:(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{className:`niceeval-diff-file-summary`,children:(0,M.jsx)(gI,{file:e})}),(0,M.jsx)(pI,{windows:e.windows})]})})}function vI({node:e,inlined:t,drillCommand:n}){return(0,M.jsxs)(`ul`,{className:`niceeval-diff-tree`,children:[e.dirs.map(e=>(0,M.jsx)(`li`,{className:`niceeval-diff-dir`,children:(0,M.jsxs)(`details`,{open:!0,children:[(0,M.jsxs)(`summary`,{className:`niceeval-diff-dir-summary`,children:[(0,M.jsxs)(`span`,{className:`niceeval-diff-dir-name`,children:[e.name,`/`]}),(0,M.jsxs)(`span`,{className:`niceeval-diff-dir-count`,children:[e.fileCount,` `,e.fileCount===1?`file`:`files`]}),(0,M.jsx)(hI,{added:e.added,removed:e.removed})]}),(0,M.jsx)(vI,{node:e,inlined:t,drillCommand:n})]})},e.path)),e.files.map(e=>(0,M.jsx)(_I,{file:e,inlined:t.has(e.path),drillCommand:n},e.path))]})}function yI({files:e,className:t,drillCommand:n}){let r=uI(e);return r===null||r.length===0?null:(0,M.jsx)(`div`,{className:rF(`niceeval-report`,`niceeval-diff-view`,t),children:(0,M.jsx)(vI,{node:sI(r),inlined:aI(r),drillCommand:n})})}function X(e,t,n){return e===`zh-CN`?n:t}function bI(e,t){switch(e){case`requirement`:return X(t,`Requirement`,`目标`);case`observed`:return X(t,`Observed`,`结果`);case`examined`:return X(t,`Examined`,`检查范围`);case`coverage`:return X(t,`Source`,`记录完整度`)}}function xI(e,t){switch(e){case`matched`:return X(t,`Match`,`命中`);case`mismatched`:return X(t,`No match`,`未命中`);case`unavailable`:return X(t,`Unknown`,`无法判断`);case`not-evaluated`:return X(t,`Not evaluated`,`未参与判断`);case`not-retained`:return X(t,`Checked`,`已检查`);case`outside-snapshot`:return X(t,`After evaluation`,`评估后出现`);case`legacy`:return X(t,`Recorded`,`已记录`)}}function SI(e,t){switch(e){case`tool`:return X(t,`Tool call`,`工具调用`);case`event`:return X(t,`Event`,`事件`);case`legacy-source-row`:return X(t,`Record`,`记录`)}}function CI(e,t){return e===void 0?null:e===`matched`?X(t,`match`,`命中`):e===`mismatched`?X(t,`different`,`不匹配`):X(t,`unknown`,`无法判断`)}function wI({fields:e,locale:t}){return e.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-filter-row-fields`,children:e.map((e,n)=>{let r=CI(e.state,t);return(0,M.jsxs)(`div`,{"data-field-state":e.state,children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(`pre`,{children:e.value})}),r===null?null:(0,M.jsx)(`span`,{children:r})]},`${e.label}:${n}`)})})}function TI({anchor:e,locale:t}){return(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-filter-row-target`,onClick:()=>{let t=document.getElementById(`conversation-${e}`)??document.getElementById(`trace-${e}`),n=t?.closest(`details`);n instanceof HTMLDetailsElement&&(n.open=!0),t?.scrollIntoView({behavior:`smooth`,block:`center`}),t instanceof HTMLElement&&t.focus()},children:[X(t,`View in conversation`,`在会话中查看`),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]})}function EI({row:e,locale:t}){let n=`${SI(e.kind,t)} ${e.number}`,r=e.fields.length>0||(e.difference?.length??0)>0||e.note!==void 0||e.conversationTarget!==void 0,i=(0,M.jsxs)(`span`,{className:`niceeval-filter-row-summary`,children:[(0,M.jsx)(`span`,{className:`niceeval-filter-row-number`,children:n}),(0,M.jsx)(`strong`,{children:e.summary}),(0,M.jsx)(`span`,{className:`niceeval-filter-row-state`,"data-state":e.state,children:xI(e.state,t)})]});return r?(0,M.jsxs)(`details`,{className:`niceeval-filter-row`,"data-state":e.state,children:[(0,M.jsx)(`summary`,{children:i}),(0,M.jsxs)(`div`,{className:`niceeval-filter-row-detail`,children:[e.note===void 0?null:(0,M.jsx)(`p`,{className:`niceeval-filter-row-note`,children:e.note}),e.difference===void 0||e.difference.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h6`,{children:X(t,`Filter comparison`,`Filter 对比`)}),(0,M.jsx)(wI,{fields:e.difference,locale:t})]}),e.fields.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h6`,{children:X(t,`Recorded detail`,`调用详情`)}),(0,M.jsx)(wI,{fields:e.fields,locale:t})]}),e.conversationTarget===void 0?null:(0,M.jsx)(TI,{anchor:e.conversationTarget.anchor,locale:t})]})]}):(0,M.jsx)(`div`,{className:`niceeval-filter-row`,"data-state":e.state,children:i})}function DI(e,t){switch(e){case`matched`:return X(t,`Matched`,`已匹配`);case`possible`:return X(t,`Possible`,`可能匹配`);case`blocked`:return X(t,`Blocked here`,`阻塞于此`);case`not-reached`:return X(t,`Not reached`,`尚未到达`)}}function OI({steps:e,locale:t}){return e.length===0?null:(0,M.jsxs)(`section`,{className:`niceeval-filter-steps`,children:[(0,M.jsx)(`h5`,{children:X(t,`Sequence path`,`顺序匹配路径`)}),(0,M.jsx)(`ol`,{children:e.map(e=>(0,M.jsxs)(`li`,{"data-state":e.state,children:[(0,M.jsx)(`span`,{className:`niceeval-filter-step-index`,children:e.step}),(0,M.jsx)(`code`,{children:e.summary}),e.sourceRow===void 0?null:(0,M.jsx)(`span`,{children:e.sourceRow}),(0,M.jsx)(`span`,{className:`niceeval-filter-step-state`,children:DI(e.state,t)}),e.conversationTarget===void 0?null:(0,M.jsx)(TI,{anchor:e.conversationTarget.anchor,locale:t})]},e.step))})]})}function kI(e,t){return e===`tool`?X(t,`tool calls`,`工具调用`):e===`event`?X(t,`events`,`事件`):X(t,`records`,`记录`)}function AI(e,t){switch(e){case`historical-not-recorded`:return X(t,`This historical Record did not retain this Matcher query or its row-by-row relation. Rerun it to inspect match reasons and paths.`,`此历史 Record 未保存本次 Matcher 查询与逐行关联,重跑后可查看命中原因/匹配路径。`);case`source-unavailable`:return X(t,`The source records were not retained.`,`没有保存可用的来源记录。`);case`ambiguous-relation`:return X(t,`The stored identities cannot prove a unique assertion-to-row relation.`,`已保存的身份无法证明断言与记录之间唯一对应。`);case`source-partial`:return X(t,`The source records may be incomplete; missing rows are not treated as mismatches.`,`来源记录可能不完整;缺失记录不会被当作未命中。`);case`overlay-partial`:return X(t,`Only bounded representative comparisons were retained; other examined rows are marked as checked.`,`只保留了有界的代表性对比;其余参与评估的记录标记为“已检查”。`)}}function jI(e,t){return e.queryKind===`ordered-sequence`?X(t,`Event order`,`事件顺序`):e.subject===`tool`?X(t,`Tool call filter`,`工具调用筛选`):X(t,`Event filter`,`事件筛选`)}function MI(e){return typeof e==`object`&&e&&!Array.isArray(e)&&`kind`in e&&typeof e.kind==`string`?e.kind:void 0}function NI(e){let t=e.comparator;return typeof t==`object`&&t&&!Array.isArray(t)&&`display`in t&&typeof t.display==`string`?t.display:t==null?e.querySummary:JSON.stringify(t)}function PI(e,t,n){let r=e.atEvaluation.rows.length;return n===`zh-CN`?e.state===`legacy`?`查看已记录的 ${r} 条${t}`:`查看评估时的 ${r} 条${t}`:e.state===`legacy`?`View ${r} recorded ${t}`:`View the ${r} ${t} at evaluation`}function FI({content:e,locale:t}){let n=kI(e.subject,t),r=e.state===`legacy`;return(0,M.jsxs)(`section`,{className:`niceeval-filter-debugger`,"aria-label":jI(e,t),"data-state":e.state,"data-source-state":e.atEvaluation.state,"data-comparator":MI(e.comparator),children:[r?null:(0,M.jsxs)(`header`,{className:`niceeval-filter-debugger-head`,children:[(0,M.jsx)(`span`,{children:jI(e,t)}),(0,M.jsx)(`code`,{children:NI(e)}),e.retainedTarget?.state===`available`?(0,M.jsx)(TI,{anchor:e.retainedTarget.anchor,locale:t}):null]}),e.facts.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-filter-facts`,children:e.facts.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:bI(e.kind,t)}),(0,M.jsx)(`dd`,{children:nF(e.value,t)})]},e.kind))}),(0,M.jsx)(OI,{steps:e.steps??[],locale:t}),e.relationNotice===void 0?null:(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:AI(e.relationNotice,t)}),e.retainedTarget?.state===`unavailable`?(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:e.retainedTarget.reason}):null,e.commandMatch?.state===`unavailable`?(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:e.commandMatch.reason}):null,(e.atEvaluation.notices??[]).map(e=>(0,M.jsx)(`p`,{className:`niceeval-filter-notice`,children:AI(e,t)},e)),(0,M.jsxs)(`details`,{className:`niceeval-filter-ledger`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(`span`,{children:PI(e,n,t)}),r&&e.atEvaluation.state===`partial`?(0,M.jsx)(`small`,{children:X(t,`Records may be incomplete`,`记录可能不完整`)}):null]}),(0,M.jsxs)(`div`,{className:`niceeval-filter-ledger-content`,children:[(0,M.jsx)(`p`,{children:r?X(t,`Open a row to inspect its recorded detail.`,`展开任一行可查看已记录详情。`):X(t,`Open a row to inspect its captured detail and filter comparison.`,`展开任一行可查看已记录详情和 Filter 对比。`)}),e.atEvaluation.rows.length===0?null:(0,M.jsx)(`div`,{className:`niceeval-filter-rows`,children:e.atEvaluation.rows.map(e=>(0,M.jsx)(EI,{row:e,locale:t},e.key))}),e.atEvaluation.rows.length===0&&(r||e.atEvaluation.state!==`unavailable`)?(0,M.jsx)(`p`,{className:`niceeval-filter-empty`,children:e.atEvaluation.state===`unavailable`?X(t,`Source rows were not recorded.`,`没有记录可用的来源行。`):X(t,`No ${n} were in this evaluation snapshot.`,`这个评估快照里没有${n}。`)}):null]})]}),e.afterEvaluation.length===0?null:(0,M.jsxs)(`details`,{className:`niceeval-filter-later`,children:[(0,M.jsxs)(`summary`,{children:[X(t,`Context recorded after evaluation`,`评估后记录的上下文`),(0,M.jsx)(`span`,{children:e.afterEvaluation.length})]}),(0,M.jsx)(`p`,{children:X(t,`These rows are visible for context and did not affect the sealed result.`,`这些行只用于查看上下文,不影响已经封口的判断结果。`)}),(0,M.jsx)(`div`,{className:`niceeval-filter-rows`,children:e.afterEvaluation.map(e=>(0,M.jsx)(EI,{row:e,locale:t},e.key))})]})]})}var II=240,LI=120;function Z(e,t,n){return e===`zh-CN`?n:t}function RI(e){return typeof e==`string`?JSON.stringify(e):String(e)}function zI(e){return Array.from(e)}function BI(e,t){let n=zI(e),r=n.slice(0,LI).join(``),i=Z(t,n.length===1?`character`:`characters`,`字符`);return`${n.length} ${i} · ${JSON.stringify(r)}…`}function Q(e,t){return e?.kind===`fields`?e.fields.find(e=>e.label===t)?.value:void 0}function VI(e){return e?.kind===`value`&&typeof e.value==`string`?e.value:void 0}function HI(e){if(e?.kind===`text`)return e.text;if(e?.kind===`unavailable`)return e.reason;if(e?.kind===`value`)return typeof e.value==`string`?e.value:String(e.value)}function UI(e){return e?.kind===`value`&&typeof e.value==`number`?e.value:void 0}function WI(e){let t=Q(e,`data`);if(qI(e)===`numeric-comparison/v1`){let e=VI(Q(t,`comparator`)),n=UI(Q(t,`threshold`));if(e!==void 0&&n!==void 0){let t=e===`less-than`?`lessThan`:e===`at-most`?`atMost`:e===`greater-than`?`greaterThan`:e===`at-least`?`atLeast`:void 0;if(t!==void 0)return`${t}(${n})`}}let n=VI(Q(Q(t,`matcher`),`name`));if(n!==void 0)return n;if(qI(e)!==`occurrence/v1`&&qI(e)!==`occurrence/v2`||VI(Q(t,`occurrence`))!==`tool`)return;let r=VI(Q(t,`matcher`));if(r===void 0)return;let i=VI(Q(t,`assertion`));if(i===`order`)return r;let a=Q(t,`quantifier`),o=VI(Q(a,`kind`)),s=UI(Q(a,`count`));if(i===`absent`||o===`absent`)return`notCalledTool(${r})`;if(o===`at-least`&&s===1)return`calledTool(${r})`;let c=o===`at-least`?`atLeast`:o===`less-than`?`lessThan`:o===`at-most`?`atMost`:o===`greater-than`?`greaterThan`:o===`exact`?`exactly`:void 0;return c!==void 0&&s!==void 0?`${r}.${c}(${s})`:`calledTool(${r})`}function GI(e){let t=VI(e);return t===`matched`||t===`mismatched`||t===`unavailable`?t:void 0}function KI(e){if(e?.kind!==`fields`)return null;let t=Q(e,`children`),n=t?.kind===`list`?t.items.flatMap((e,t)=>{let n=GI(Q(e,`state`));return n===void 0?[]:[{index:UI(Q(e,`index`))??t,label:VI(Q(e,`label`))??`matcher ${t+1}`,state:n,diagnostic:KI(Q(e,`diagnostic`))}]}):[];return{code:VI(Q(e,`code`)),expected:Q(e,`expected`),received:Q(e,`received`),reason:VI(Q(e,`reason`)),locator:VI(Q(Q(e,`locator`),`id`)),children:n}}function qI(e){return VI(Q(e,`id`))}function JI(e){return(qI(e)===`occurrence/v1`||qI(e)===`occurrence/v2`)&&VI(Q(Q(e,`data`),`occurrence`))===`tool`}function YI(e){return e===`less-than`||e===`at-most`||e===`greater-than`||e===`at-least`?e:void 0}function XI(e){return e===`exact`||e===`lower-bound`||e===`unavailable`?e:void 0}function ZI(e,t){if(qI(e)!==`numeric-comparison/v1`)return;let n=Q(e,`data`),r=YI(VI(Q(n,`comparator`))),i=UI(Q(n,`threshold`)),a=Q(n,`subject`),o=VI(Q(a,`kind`)),s=Q(t,`input`),c=XI(VI(Q(s,`state`)));if(r===void 0||i===void 0||c===void 0||o!==`explicit-value`&&o!==`scope-metric`&&o!==`collection-cardinality`)return;let l=VI(Q(a,`metric`)),u=VI(Q(a,`scope`)),d=VI(Q(a,`unit`));return{comparator:r,threshold:i,subject:{kind:o,...l===`tokens`||l===`cost`?{metric:l}:{},...u===`turn`||u===`session`||u===`attempt`?{scope:u}:{},...d===`tokens`||d===`usd`?{unit:d}:{}},material:{state:c,...UI(Q(s,`value`))===void 0?{}:{value:UI(Q(s,`value`))},...VI(Q(s,`reason`))===void 0?{}:{reason:VI(Q(s,`reason`))},...Q(s,`derivation`)===void 0?{}:{derivation:Q(s,`derivation`)}}}}function QI(e){if(VI(Q(e,`kind`))!==`pricing-estimate`)return;let t=VI(Q(e,`model`)),n=Q(e,`priceSource`),r=VI(Q(n,`kind`)),i=VI(Q(n,`selector`)),a=UI(Q(e,`amountUSD`)),o=Q(e,`charges`);if(!(t===void 0||i===void 0||a===void 0||r!==`configured-override`&&r!==`builtin`||o?.kind!==`list`))return{model:t,sourceKind:r,sourceSelector:i,charges:o.items.flatMap(e=>{let t=VI(Q(e,`bucket`)),n=UI(Q(e,`tokens`)),r=UI(Q(e,`rateUSDPerMTok`)),i=UI(Q(e,`amountUSD`));return t!==`input`&&t!==`output`&&t!==`cache-read`&&t!==`cache-write`||n===void 0||r===void 0||i===void 0?[]:[{bucket:t,tokens:n,rateUSDPerMTok:r,amountUSD:i}]}),amountUSD:a}}function $I(e){let t=VI(Q(e,`kind`));if(t===`at-least`){let t=UI(Q(e,`threshold`));return t===void 0?void 0:{kind:`text`,text:`≥ ${t}`}}return t===void 0?e:void 0}function eL(e){return Q(e,`value`)??e}function tL({value:e,locale:t,quoted:n}){return(0,M.jsxs)(`details`,{className:`niceeval-assertion-evidence-long-value`,children:[(0,M.jsx)(`summary`,{children:BI(e,t)}),(0,M.jsx)(`pre`,{className:`niceeval-assertion-evidence-code`,children:n?JSON.stringify(e):e})]})}function nL({value:e,locale:t}){switch(e.kind){case`text`:return zI(e.text).length>II?(0,M.jsx)(tL,{value:e.text,locale:t,quoted:!1}):(0,M.jsx)(`p`,{children:e.text});case`value`:return typeof e.value==`string`&&zI(e.value).length>II?(0,M.jsx)(tL,{value:e.value,locale:t,quoted:!0}):(0,M.jsx)(`pre`,{className:`niceeval-assertion-evidence-code`,children:RI(e.value)});case`unavailable`:return(0,M.jsxs)(`p`,{className:`niceeval-assertion-evidence-state`,children:[(0,M.jsx)(`code`,{children:`unavailable`}),(0,M.jsx)(`span`,{children:e.reason})]});case`fields`:return(0,M.jsx)(`dl`,{className:`niceeval-assertion-evidence-fields`,children:e.fields.map((e,n)=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(nL,{value:e.value,locale:t})})]},`${e.label}:${n}`))});case`list`:return(0,M.jsxs)(`details`,{className:`niceeval-assertion-evidence-collection`,children:[(0,M.jsx)(`summary`,{children:(0,M.jsx)(`code`,{children:`Array(${e.items.length})`})}),(0,M.jsx)(`ol`,{className:`niceeval-assertion-evidence-list`,children:e.items.map((e,n)=>(0,M.jsx)(`li`,{children:(0,M.jsx)(nL,{value:e,locale:t})},n))})]})}}function rL({heading:e,value:t,locale:n}){return(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:e}),(0,M.jsx)(nL,{value:t,locale:n})]})}function iL({rows:e}){return(0,M.jsx)(`dl`,{className:`niceeval-match-facts`,children:e.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:e.value})]},e.label))})}function aL({diagnostic:e,locale:t}){let n=[...e.expected===void 0?[]:[{label:Z(t,`Expected`,`预期`),value:e.expected}],...e.received===void 0?[]:[{label:Z(t,`Observed`,`实际`),value:e.received}],...e.locator===void 0?[]:[{label:Z(t,`Call`,`调用`),value:e.locator}],...e.reason===void 0?[]:[{label:Z(t,`Reason`,`原因`),value:e.reason}]];return n.length===0?null:(0,M.jsx)(`dl`,{className:`niceeval-match-facts`,children:n.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:typeof e.value==`string`?e.value:(0,M.jsx)(nL,{value:e.value,locale:t})})]},e.label))})}function oL({input:e,diagnostic:t,locale:n}){let r=VI(Q(e,`command`)),i=UI(Q(e,`exitCode`)),a=HI(t?.expected),o=[...r===void 0?[]:[{label:Z(n,`Command`,`命令`),value:r}],...i===void 0?[]:[{label:Z(n,`Result`,`结果`),value:Z(n,`Exit code ${i}`,`退出码 ${i}`)}],...a===void 0?[]:[{label:Z(n,`Expected`,`预期`),value:a}]];return(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:Z(n,`Command result`,`命令结果`)}),(0,M.jsx)(iL,{rows:o})]})}function sL({observed:e,diagnostic:t,locale:n}){let r=UI(Q(Q(e,`receipt`),`examined`));return(0,M.jsxs)(`div`,{className:`niceeval-match-evidence-grid`,children:[t?.received===void 0?null:(0,M.jsx)(rL,{heading:Z(n,`Observed`,`实际结果`),value:t.received,locale:n}),t?.expected===void 0?null:(0,M.jsx)(rL,{heading:Z(n,`Expected`,`预期结果`),value:t.expected,locale:n}),r===void 0?null:(0,M.jsxs)(`section`,{className:`niceeval-assertion-evidence-section`,children:[(0,M.jsx)(`h5`,{children:Z(n,`Tool calls`,`工具调用`)}),(0,M.jsx)(iL,{rows:[{label:Z(n,`Examined`,`已检查`),value:Z(n,`${r} tool call${r===1?``:`s`}`,`${r} 次工具调用`)}]})]})]})}function cL(e,t){return new Intl.NumberFormat(t===`zh-CN`?`zh-CN`:`en-US`,{maximumFractionDigits:12,maximumSignificantDigits:12}).format(e)}function lL(e){let t=Math.abs(e);if(t!==0&&t<1e-9)return`$${e.toExponential(4)}`;let n=t===0||t>=1?6:Math.min(12,Math.max(2,Math.ceil(-Math.log10(t))+5));return`$${e.toFixed(n).replace(/(?:\.0+|(?:(\.[0-9]*?)0+))$/,`$1`)}`}function uL(e){return e===`less-than`?`<`:e===`at-most`?`≤`:e===`greater-than`?`>`:`≥`}function dL(e){return e===`less-than`?`≥`:e===`at-most`?`>`:e===`greater-than`?`≤`:`<`}function fL(e,t){return t===`zh-CN`?e===`turn`?`本轮`:e===`session`?`本次会话`:`本次 Attempt`:e===`turn`?`Turn`:e===`session`?`Session`:`Attempt`}function pL(e,t){if(e.subject.kind===`explicit-value`)return Z(t,`Number comparison`,`数值比较`);let n=fL(e.subject.scope,t);return e.subject.kind===`collection-cardinality`?Z(t,`${n} tool calls`,`${n}工具调用`):e.subject.metric===`cost`?Z(t,`${n} estimated cost`,`${n}估算费用`):Z(t,`${n} token usage`,`${n} token 用量`)}function mL(e,t,n){if(e.subject.metric===`cost`)return lL(t);let r=cL(t,n);return e.subject.metric===`tokens`?`${r} tokens`:r}function hL(e,t){let n=mL(e,e.threshold,t);return e.subject.metric===`tokens`||e.subject.metric===`cost`?Z(t,`limit ${n}`,`上限 ${n}`):n}function gL(e,t){switch(e){case`model-not-recorded`:return Z(t,`The model was not recorded, so its price cannot be selected.`,`没有记录模型,无法选择对应价格。`);case`price-source-not-found`:return Z(t,`No configured or built-in price was found for this model.`,`没有找到该模型的配置价格或内置价格。`);case`pricing-input-invalid`:return Z(t,`The recorded pricing input is invalid.`,`记录的计价输入无效。`);case`usage-not-recorded`:return Z(t,`Usage was not recorded.`,`没有记录用量。`);case`usage-input-invalid`:return Z(t,`The recorded token usage is invalid.`,`记录的 token 用量无效。`);case`non-finite-number`:case`numeric-value-non-finite`:return Z(t,`The compared number is not finite.`,`被比较的数值不是有限数。`);default:return Z(t,`The compared value is unavailable.`,`没有可用于比较的数值。`)}}function _L(e,t,n){let r=e.material.value;if(e.material.state===`unavailable`||r===void 0)return gL(e.material.reason,n);let i=mL(e,r,n),a=hL(e,n);if(e.material.state===`lower-bound`&&t===`unavailable`)return e.subject.kind===`collection-cardinality`?Z(n,`At least ${i} tool calls were recorded, but the collection is incomplete, so NiceEval cannot determine whether it is ${uL(e.comparator)} ${a}.`,`目前至少已有 ${i} 次工具调用,但集合不完整,无法判断是否 ${uL(e.comparator)} ${a}。`):Z(n,`At least ${i} was recorded, but usage is incomplete, so NiceEval cannot determine whether it is ${uL(e.comparator)} ${a}.`,`目前至少记录了 ${i},但用量记录不完整,无法判断是否 ${uL(e.comparator)} ${a}。`);let o=t===`mismatched`?dL(e.comparator):uL(e.comparator),s=e.material.state===`lower-bound`?Z(n,`Known minimum`,`已知至少`):e.subject.kind===`collection-cardinality`?Z(n,`Tool calls`,`工具调用`):e.subject.metric===`cost`?Z(n,`Estimated`,`估算`):e.subject.metric===`tokens`?Z(n,`Used`,`已用`):Z(n,`Observed`,`实际`),c=t===`matched`?Z(n,`so it passes.`,`所以通过。`):t===`mismatched`?Z(n,`so it does not pass.`,`所以未通过。`):Z(n,`so the result is unavailable.`,`所以无法判断。`);return`${s} ${i} ${o} ${a}${n===`zh-CN`?`,`:`, `}${c}`}function vL(e,t){return e===`input`?Z(t,`Input`,`输入`):e===`output`?Z(t,`Output`,`输出`):e===`cache-read`?Z(t,`Cache read`,`缓存读取`):Z(t,`Cache write`,`缓存写入`)}function yL({receipt:e,locale:t}){let n=e.sourceKind===`builtin`?Z(t,`Built-in price`,`内置价格`):Z(t,`Configured override`,`配置覆盖价格`);return(0,M.jsxs)(`details`,{className:`niceeval-numeric-pricing`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(`span`,{children:Z(t,`View estimate basis`,`查看估算依据`)}),(0,M.jsx)(`code`,{children:e.model}),(0,M.jsxs)(`small`,{children:[n,` · `,e.sourceSelector]})]}),(0,M.jsxs)(`dl`,{children:[e.charges.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:vL(e.bucket,t)}),(0,M.jsxs)(`dd`,{children:[(0,M.jsxs)(`code`,{children:[cL(e.tokens,t),` tokens`]}),(0,M.jsx)(`span`,{children:`×`}),(0,M.jsxs)(`code`,{children:[lL(e.rateUSDPerMTok),`/M`]}),(0,M.jsx)(`span`,{children:`=`}),(0,M.jsx)(`strong`,{children:lL(e.amountUSD)})]})]},e.bucket)),(0,M.jsxs)(`div`,{className:`niceeval-numeric-pricing-total`,children:[(0,M.jsx)(`dt`,{children:Z(t,`Estimated total`,`估算合计`)}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(`strong`,{children:lL(e.amountUSD)})})]})]})]})}function bL({view:e,state:t,locale:n}){let r=e.material.value,i=t===`mismatched`?dL(e.comparator):uL(e.comparator),a=e.subject.metric===`cost`?QI(e.material.derivation):void 0;return(0,M.jsxs)(`section`,{className:`niceeval-numeric-evidence`,"data-state":t,children:[(0,M.jsx)(`span`,{className:`niceeval-numeric-evidence-label`,children:pL(e,n)}),r===void 0?(0,M.jsx)(`p`,{className:`niceeval-numeric-evidence-unavailable`,children:Z(n,`No comparable value`,`没有可比较的数值`)}):e.material.state===`lower-bound`&&t===`unavailable`?(0,M.jsxs)(`p`,{className:`niceeval-numeric-evidence-formula`,children:[(0,M.jsx)(`small`,{children:Z(n,`Known minimum`,`已知至少`)}),(0,M.jsx)(`strong`,{children:mL(e,r,n)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,M.jsx)(`small`,{children:hL(e,n)})]}):(0,M.jsxs)(`p`,{className:`niceeval-numeric-evidence-formula`,children:[e.material.state===`lower-bound`?(0,M.jsx)(`small`,{children:Z(n,`Known minimum`,`已知至少`)}):null,(0,M.jsx)(`strong`,{children:mL(e,r,n)}),(0,M.jsx)(`span`,{className:`niceeval-numeric-evidence-operator`,children:i}),(0,M.jsx)(`strong`,{children:hL(e,n)})]}),(0,M.jsx)(`p`,{className:`niceeval-numeric-evidence-conclusion`,children:_L(e,t,n)}),a===void 0?null:(0,M.jsx)(yL,{receipt:a,locale:n})]})}function xL({content:e,input:t,diagnostic:n,locale:r}){let i=n?.expected===void 0?$I(e.expected):n.expected,a=n?.received===void 0?eL(e.observed):n.received;return(0,M.jsxs)(`div`,{className:`niceeval-match-evidence-grid`,children:[(0,M.jsx)(rL,{heading:Z(r,`Input`,`输入`),value:t,locale:r}),a===void 0?null:(0,M.jsx)(rL,{heading:Z(r,`Observed`,`实际结果`),value:a,locale:r}),i===void 0?null:(0,M.jsx)(rL,{heading:Z(r,`Expected`,`预期结果`),value:i,locale:r})]})}function SL({source:e,locale:t}){let n=Q(e,`coverage`),r=VI(Q(n,`state`));if(r===void 0||r===`complete`)return null;let i=VI(Q(n,`reason`)),a=Q(e,`limitations`),o=a?.kind===`list`?a.items.map(e=>UI(Q(e,`omittedBytes`))).find(e=>e!==void 0):void 0,s=[i,o===void 0?void 0:Z(t,`${o} bytes omitted`,`省略 ${o} 字节`)].filter(e=>e!==void 0).join(` · `);return(0,M.jsxs)(`p`,{className:`niceeval-match-coverage`,children:[Z(t,`Input evidence ${r}`,`输入证据${r===`partial`?`不完整`:`不可用`}`),s.length===0?``:` · ${s}`]})}function CL(e,t){return t===`zh-CN`?e===`matched`?`命中`:e===`mismatched`?`未命中`:`无法判断`:e}function wL(e){return e?.code===`tool-count-match`||e?.code===`tool-count-mismatch`||e?.code===`tool-count-exceeded`||e?.code===`tool-count-unavailable`||e?.code===`tool-absence-match`||e?.code===`tool-absence-mismatch`||e?.code===`tool-absence-unavailable`}function TL(e){if(e?.received!==void 0)return HI(e.received);let t=e?.children.find(e=>e.label===`name`);return t?.diagnostic?.received===void 0?t?.state===`matched`?HI(t.diagnostic?.expected):void 0:HI(t.diagnostic.received)}function EL(e,t,n,r){let i=t===`command-candidate`?Z(r,`Command`,`命令`):t===`tool-candidate`?Z(r,`Tool call`,`工具调用`):Z(r,`Candidate`,`候选`),a=TL(n),o=Z(r,`invocation details not recorded`,`调用详情未记录`);return`${i} ${e+1} · ${a??o}`}function DL(e,t){return t===`zh-CN`?e===`name`?`名称`:e===`input`?`输入`:e===`output`?`输出`:e===`command`?`命令`:e===`status`?`状态`:e:e}function OL(e,t){if(e===null||e.children.length>0)return[];let n=HI(e.expected),r=HI(e.received);return[...n===void 0?[]:[{label:Z(t,`Expected`,`预期`),value:n}],...r===void 0?[]:[{label:Z(t,`Observed`,`实际`),value:r}],...e.reason===void 0?[]:[{label:Z(t,`Reason`,`原因`),value:e.reason}]]}function kL({label:e,state:t,diagnostic:n,locale:r,root:i=!1,toolCandidateIndex:a,toolField:o=!1,children:s}){let c=a===void 0?o?DL(e,r):e:EL(a,e,n,r),l=CL(t,r),u=`${c}: ${l}`,d=OL(n,r),f=(0,M.jsxs)(`span`,{className:`niceeval-match-summary niceeval-match-summary--${t}`,children:[(0,M.jsxs)(`span`,{className:`niceeval-match-summary-main`,children:[(0,M.jsx)(`code`,{children:c}),d.length===0?null:(0,M.jsx)(`span`,{className:`niceeval-match-summary-facts`,children:d.map(e=>(0,M.jsxs)(`span`,{className:`niceeval-match-summary-fact`,children:[(0,M.jsx)(`span`,{children:e.label}),(0,M.jsx)(`code`,{children:e.value})]},e.label))})]}),(0,M.jsx)(`span`,{className:`niceeval-match-state`,children:l})]}),p=n?.children??[],m=wL(n),h=p.length>0||n?.locator!==void 0||s!==void 0?(0,M.jsxs)(`div`,{className:`niceeval-match-detail`,children:[p.length>0?(0,M.jsx)(`div`,{className:`niceeval-match-children`,children:p.map((e,t)=>(0,M.jsx)(kL,{label:e.label,state:e.state,diagnostic:e.diagnostic,locale:r,...m?{toolCandidateIndex:e.index}:{},...a===void 0?{}:{toolField:!0}},`${e.label}:${t}`))}):null,i||n===null||n.locator===void 0?null:(0,M.jsx)(aL,{diagnostic:n,locale:r}),s]}):null;return h===null?(0,M.jsx)(`div`,{className:`niceeval-match-node`,"aria-label":u,children:f}):(0,M.jsxs)(`details`,{className:`niceeval-match-node${i?` niceeval-match-node--root`:``}`,children:[(0,M.jsx)(`summary`,{"aria-label":u,children:f}),h]})}function AL(e,t,n,r){let i=KI(e.explanation),a=WI(e.check)??n??Z(t,`Match`,`检查`),o=Q(e.source,`input`)??e.source,s=i?.code,c=ZI(e.check,e.source),l=c===void 0?s===`command-succeeded`||s===`command-failed`?(0,M.jsx)(oL,{input:o,diagnostic:i,locale:t}):JI(e.check)?(0,M.jsx)(sL,{observed:e.observed,diagnostic:i,locale:t}):(0,M.jsx)(xL,{content:e,input:o,diagnostic:i,locale:t}):(0,M.jsx)(bL,{view:c,state:r,locale:t});return(0,M.jsx)(`div`,{className:`niceeval-assertion-evidence`,children:(0,M.jsx)(kL,{label:a,state:r,diagnostic:c===void 0?i:null,locale:t,root:!0,children:(0,M.jsxs)(`div`,{className:`niceeval-match-body`,children:[e.matcherDebugger===void 0?l:(0,M.jsxs)(M.Fragment,{children:[l,(0,M.jsx)(FI,{content:e.matcherDebugger,locale:t})]}),(0,M.jsx)(SL,{source:e.source,locale:t}),(0,M.jsxs)(`details`,{className:`niceeval-match-raw`,children:[(0,M.jsx)(`summary`,{children:Z(t,`Raw assertion data`,`原始断言数据`)}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(rL,{heading:Z(t,`Source`,`来源`),value:e.source,locale:t}),(0,M.jsx)(rL,{heading:Z(t,`Check`,`检查条件`),value:e.check,locale:t}),(0,M.jsx)(rL,{heading:Z(t,`Explanation`,`解释`),value:e.explanation,locale:t})]})]})]})})})}function jL({content:e,label:t,state:n,locale:r}){return AL(e,r,t,n??`unavailable`)}var ML=(0,v.createContext)(null);function NL(){let e=(0,v.useContext)(ML);if(e===null)throw Error(`Trace interaction context is missing`);return e}function PL(...e){return e.filter(Boolean).join(` `)}function $(e,t,n){return e===`zh-CN`?n:t}function FL(e){if(e===void 0)return`Not recorded`;if(e<1e3)return`${Math.round(e)} ms`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function IL(e){return e.durationMs!==void 0&&Number.isFinite(e.durationMs)?Math.max(0,e.durationMs):void 0}function LL(e){switch(e.toLowerCase()){case`user`:case`input`:case`context`:return`input`;case`tool`:case`subagent`:case`skill`:return`tools`;default:return`model`}}function RL(e){return LL(e)===`tools`}function zL(e){let t=e.filter(e=>e.entry.callPhase===`started`).length;return t===0?e.filter(e=>e.toolLike).length:t}function BL(e,t){return e.callOutcome===`completed`?$(t,`Completed`,`已完成`):e.callOutcome===`failed`?$(t,`Failed`,`失败`):e.callOutcome===`rejected`?$(t,`Rejected`,`已拒绝`):e.callOutcome===`cancelled`?$(t,`Cancelled`,`已取消`):e.failed===!0?$(t,`Failed`,`失败`):e.callPhase===`started`?$(t,`Started`,`已开始`):e.callPhase===`finished`?$(t,`Completed`,`已完成`):$(t,`Captured`,`已捕获`)}function VL(e){return e.toolOccurrence?.state===`exact`?e.toolOccurrence.toolOccurrenceId:e.toolOccurrence===void 0?e.callId:void 0}function HL(e){let t=new Map;for(let[n,r]of e.entries.entries()){let e=VL(r);if(e===void 0||r.callPhase===void 0)continue;let i=t.get(e)??{started:[],finished:[]};i[r.callPhase].push(n),t.set(e,i)}let n=new Map,r=new Set;for(let i of t.values()){if(i.started.length!==1||i.finished.length!==1)continue;let t=i.started[0],a=i.finished[0];if(a<=t)continue;let o=e.entries[t],s=e.entries[a],c=[o.raw,s.raw].filter(e=>e!==void 0).join(`
60
- `),l=[o.detail,s.detail].filter(e=>e!==void 0);n.set(t,{id:o.id,kind:o.kind,preview:o.preview,...o.anchor===void 0?{}:{anchor:o.anchor},callId:VL(o),...o.toolOccurrence===void 0?{}:{toolOccurrence:o.toolOccurrence},callPhase:`finished`,...s.callOutcome===void 0?{}:{callOutcome:s.callOutcome},...o.failed===!0||s.failed===!0?{failed:!0}:{},...(s.commandMatch??o.commandMatch)===void 0?{}:{commandMatch:s.commandMatch??o.commandMatch},...c===``?{}:{raw:c},...l.length===0?{}:{detail:l.length===1?l[0]:{kind:`stack`,items:l}}}),r.add(a)}return e.entries.flatMap((e,t)=>r.has(t)?[]:[{entry:n.get(t)??e,entryIndex:t}])}function UL(e,t){return e.turns.flatMap((e,n)=>HL(e).map(({entry:r,entryIndex:i})=>{let a=r.raw??nF(r.preview,t);return{id:r.id,turn:e,turnIndex:n,entry:r,entryIndex:i,lane:LL(r.kind),summary:YF(r.preview,t,180),raw:a,toolLike:RL(r.kind)}}))}function WL(e){return e.every(e=>e.entries.length===0||IL(e)!==void 0)}function GL(e,t){let n=new Map;if(t.length===0)return n;let r=WL(e),i=new Map;for(let n of e){let e=t.filter(e=>e.turn.key===n.key);if(e.length===0)continue;let a=IL(n),o=r&&a!==void 0?Math.max(1,a)/e.length:1;for(let t of e)i.set(t.id,o)}let a=t.length*1,o=t.reduce((e,t)=>e+(i.get(t.id)??1),0),s=0,c=0;for(let e of t){let t=i.get(e.id)??1;n.set(e.id,{sequenceLeft:s/a*100,sequenceWidth:1/a*100,durationLeft:c/o*100,durationWidth:t/o*100}),s+=1,c+=t}return n}function KL(e){return e===`input`?7:e===`model`?21:35}function qL(e,t){let n=nF(e.turn.label,t),r=IL(e.turn),i=r===void 0?$(t,`timing not recorded`,`未记录时长`):`${FL(r)} ${$(t,`turn duration`,`轮次时长`)}`;return`${e.entry.kind} · ${n} · ${i}`}function JL({content:e,events:t,locale:n}){let r=e.turns.flatMap(e=>{let t=IL(e);return t===void 0?[]:[t]}),i=r.length===0?$(n,`—`,`—`):FL(r.reduce((e,t)=>e+t,0)),a=zL(t),o=WL(e.turns)&&t.length>0,s=NL();return(0,M.jsxs)(`header`,{className:`niceeval-trace-toolbar`,role:`toolbar`,"aria-label":$(n,`Trajectory controls`,`轨迹控制`),children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-toolbar-main`,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-title`,children:$(n,`Session log`,`会话日志`)}),(0,M.jsxs)(`div`,{className:`niceeval-trace-toolbar-actions`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button niceeval-trace-toolbar-button--duration`,onClick:()=>s.setDuration(!s.duration),"aria-pressed":s.duration,disabled:!o,title:o?$(n,`Use turn-duration projection`,`按轮次时长投影`):$(n,`Turn timing is incomplete; sequence stays equal-width`,`轮次时长不完整;保持等宽顺序`),children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,M.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.25`}),(0,M.jsx)(`path`,{d:`M8 4.75V8l2.25 1.5`})]}),(0,M.jsx)(`span`,{children:$(n,`Duration`,`时长`)}),(0,M.jsx)(`b`,{children:i})]}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button`,onClick:()=>s.setTurnsCollapsed(!s.turnsCollapsed),"aria-pressed":s.turnsCollapsed,title:$(n,`Collapse turns`,`折叠轮次`),children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-glyph`,"aria-hidden":`true`,children:`⊟`}),(0,M.jsx)(`span`,{children:$(n,`Turns`,`轮次`)}),(0,M.jsx)(`b`,{children:e.turns.length})]}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-toolbar-button`,onClick:()=>s.setCallsCollapsed(!s.callsCollapsed),"aria-pressed":s.callsCollapsed,title:$(n,`Collapse tool calls`,`折叠工具调用`),disabled:a===0,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-toolbar-glyph`,"aria-hidden":`true`,children:`⊟`}),(0,M.jsx)(`span`,{children:$(n,`Calls`,`调用`)}),(0,M.jsx)(`b`,{children:a})]})]})]}),(0,M.jsxs)(`label`,{className:`niceeval-trace-search`,children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,M.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.25`}),(0,M.jsx)(`path`,{d:`m10.25 10.25 3 3`})]}),(0,M.jsx)(`span`,{className:`niceeval-trace-visually-hidden`,children:$(n,`Search trajectory`,`搜索轨迹`)}),(0,M.jsx)(`input`,{type:`search`,value:s.query,onChange:e=>s.setQuery(e.target.value),placeholder:$(n,`Search`,`搜索`),"aria-label":$(n,`Search trajectory`,`搜索轨迹`)})]})]})}function YL({content:e,events:t,locale:n}){let r=GL(e.turns,t),i=WL(e.turns),a=NL(),o=t.filter((e,n)=>n===0||t[n-1]?.turn.key!==e.turn.key);return(0,M.jsxs)(`section`,{className:`niceeval-trace-timeline`,"aria-label":$(n,`Trajectory timeline`,`轨迹时间线`),"data-timing-complete":i?`true`:void 0,children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-timeline-plot`,children:[(0,M.jsxs)(`div`,{className:`niceeval-trace-timeline-labels`,"aria-hidden":`true`,children:[(0,M.jsx)(`span`,{children:$(n,`Input / User`,`输入 / 用户`)}),(0,M.jsx)(`span`,{children:$(n,`Model / Assistant`,`模型 / 助手`)}),(0,M.jsx)(`span`,{children:$(n,`Tools / Tool`,`工具 / 工具`)})]}),(0,M.jsxs)(`svg`,{className:`niceeval-trace-timeline-track`,viewBox:`0 0 100 50`,preserveAspectRatio:`none`,"aria-hidden":t.length===0?`true`:void 0,children:[t.length===0?(0,M.jsx)(`text`,{className:`niceeval-trace-timeline-empty`,x:`50`,y:`25`,textAnchor:`middle`,dominantBaseline:`middle`,children:$(n,`No captured events`,`没有已捕获事件`)}):null,(e=>(0,M.jsxs)(`g`,{className:`niceeval-trace-timeline-projection niceeval-trace-timeline-projection--${e}`,children:[o.map(t=>{let n=r.get(t.id);if(n===void 0)return null;let i=e===`sequence`?n.sequenceLeft:n.durationLeft;return(0,M.jsx)(`line`,{className:`niceeval-trace-timeline-boundary`,x1:i,x2:i,y1:`0`,y2:`50`,"aria-hidden":`true`},`${e}-boundary-${t.id}`)}),t.map(t=>{let i=r.get(t.id);if(i===void 0)return null;let o=e===`sequence`?i.sequenceLeft:i.durationLeft,s=e===`sequence`?i.sequenceWidth:i.durationWidth,c=qL(t,n),l=t.entry.kind===`assistant`?`assistant: ${t.summary} · ${c}`:c;return(0,M.jsxs)(`g`,{className:`niceeval-trace-timeline-span`,role:`button`,tabIndex:0,onClick:()=>a.setSelected(a.selected===t.id?null:t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&a.setSelected(a.selected===t.id?null:t.id)},"data-lane":t.lane,"data-failed":t.entry.failed?`true`:void 0,"aria-label":l,"aria-pressed":a.selected===t.id,children:[(0,M.jsx)(`title`,{children:l}),(0,M.jsx)(`rect`,{className:`niceeval-trace-timeline-span-geometry`,x:o,y:KL(t.lane),width:s,height:`8`,rx:`1`})]},`${e}-event-${t.id}`)})]}))(a.duration?`duration`:`sequence`)]})]}),(0,M.jsx)(`p`,{className:`niceeval-trace-timeline-note`,children:i?$(n,`Duration projects captured turn durations; without per-event timestamps, events remain evenly sequenced within each turn.`,`时长模式投影已捕获的轮次时长;没有逐事件时间戳时,事件在轮次内保持等宽顺序。`):$(n,`Per-event timing was not captured, so the timeline uses equal-width sequence spans.`,`未捕获逐事件时长,因此时间线使用等宽顺序跨度。`)})]})}function XL({event:e,locale:t}){let n=e.entry.detail===void 0?null:JF(e.entry.detail,t),r=IL(e.turn),i=NL(),[a,o]=(0,v.useState)(`preview`);return(0,M.jsxs)(`details`,{className:`niceeval-trace-evidence`,open:i.selected===e.id,children:[(0,M.jsx)(`summary`,{children:$(t,`Evidence`,`证据`)}),(0,M.jsxs)(`div`,{className:`niceeval-trace-evidence-body`,children:[(0,M.jsxs)(`dl`,{className:`niceeval-trace-evidence-meta`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Source`,`来源`)}),(0,M.jsx)(`dd`,{children:nF(e.turn.label,t)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Status`,`状态`)}),(0,M.jsx)(`dd`,{children:BL(e.entry,t)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Total duration`,`总时长`)}),(0,M.jsx)(`dd`,{children:r===void 0?$(t,`Not recorded`,`未记录`):FL(r)})]}),e.entry.callPhase===void 0?null:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Call phase`,`调用阶段`)}),(0,M.jsx)(`dd`,{children:e.entry.callPhase})]}),e.entry.callId===void 0?null:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Call ID`,`调用 ID`)}),(0,M.jsx)(`dd`,{children:e.entry.callId})]}),e.entry.toolOccurrence?.state===`unavailable`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Tool occurrence`,`工具调用身份`)}),(0,M.jsxs)(`dd`,{children:[$(t,`Unavailable`,`不可用`),` · `,e.entry.toolOccurrence.reason]})]}):null,e.entry.commandMatch===void 0?null:e.entry.commandMatch.state===`matched`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Command`,`命令`)}),(0,M.jsx)(`dd`,{children:e.entry.commandMatch.commandId})]}):(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:$(t,`Command`,`命令`)}),(0,M.jsxs)(`dd`,{children:[$(t,`Unavailable`,`不可用`),` · `,e.entry.commandMatch.reason]})]})]}),(0,M.jsxs)(`div`,{className:`niceeval-trace-evidence-tabs`,role:`tablist`,"aria-label":$(t,`Record detail tabs`,`记录详情标签`),children:[(0,M.jsx)(`button`,{type:`button`,role:`tab`,onClick:()=>o(`preview`),onKeyDown:eR,"aria-selected":a===`preview`,children:$(t,`Preview`,`预览`)}),(0,M.jsx)(`button`,{type:`button`,role:`tab`,onClick:()=>o(`raw`),onKeyDown:eR,"aria-selected":a===`raw`,children:$(t,`Raw`,`原始`)})]}),(0,M.jsxs)(`section`,{className:`niceeval-trace-evidence-panel`,hidden:a!==`preview`,role:`tabpanel`,"aria-label":$(t,`Preview`,`预览`),children:[(0,M.jsx)(`h4`,{children:$(t,`Preview`,`预览`)}),n===null?(0,M.jsx)(`pre`,{className:`niceeval-trace-evidence-raw`,children:e.raw}):(0,M.jsx)(`div`,{className:`niceeval-trace-evidence-detail`,children:n})]}),(0,M.jsxs)(`section`,{className:`niceeval-trace-evidence-panel`,hidden:a!==`raw`,role:`tabpanel`,"aria-label":$(t,`Raw`,`原始`),children:[(0,M.jsx)(`h4`,{children:$(t,`Raw`,`原始`)}),(0,M.jsx)(`pre`,{className:`niceeval-trace-evidence-raw`,children:e.raw})]})]})]})}function ZL({event:e,locale:t}){let n=nF(e.turn.label,t),r=IL(e.turn),i=BL(e.entry,t),a=NL(),o=a.callsCollapsed&&e.toolLike||a.query!==``&&!`${e.entry.kind} ${e.summary} ${e.raw}`.toLocaleLowerCase().includes(a.query.toLocaleLowerCase());return(0,M.jsxs)(`article`,{hidden:o,className:PL(`niceeval-trace-event-row`,e.toolLike&&`niceeval-trace-event-row--tool`,e.entry.failed&&`niceeval-trace-event-row--failed`),id:`trace-${e.entry.anchor}`,"data-tool-row":e.toolLike?`true`:void 0,"data-call-outcome":e.entry.callOutcome,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-event-turn-rail`,"aria-hidden":`true`}),(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-event-select`,onClick:()=>a.setSelected(a.selected===e.id?null:e.id),"aria-pressed":a.selected===e.id,"aria-expanded":a.selected===e.id,"aria-label":`${e.entry.kind}: ${e.summary||$(t,`captured event`,`已捕获事件`)}`,children:[(0,M.jsx)(`span`,{className:`niceeval-trace-event-kind`,"data-lane":e.lane,children:e.entry.kind}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-summary`,children:e.summary||`—`}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-meta`,title:r===void 0?$(t,`Turn timing not recorded`,`未记录轮次时长`):`${n} · ${FL(r)}`,children:r===void 0?`—`:FL(r)}),(0,M.jsx)(`span`,{className:`niceeval-trace-event-status`,"data-call-outcome":e.entry.callOutcome,children:i})]}),(0,M.jsx)(XL,{event:e,locale:t})]})}function QL({turn:e,events:t,locale:n}){let r=IL(e),i=zL(t),a=t.some(e=>e.entry.failed===!0),o=NL(),[s,c]=(0,v.useState)(!1),l=o.turnsCollapsed||s;return(0,M.jsxs)(`section`,{className:PL(`niceeval-trace-turn`,e.verdict&&`niceeval-trace-turn--${e.verdict}`,a&&`niceeval-trace-turn--failed-events`),"data-collapsed":l,children:[(0,M.jsx)(`header`,{className:`niceeval-trace-turn-head niceeval-conversation-turn-head`,children:(0,M.jsxs)(`button`,{type:`button`,className:`niceeval-trace-turn-toggle`,onClick:()=>c(!s),"aria-expanded":!l,title:$(n,`Collapse turn`,`折叠轮次`),children:[(0,M.jsx)(`span`,{className:`niceeval-trace-turn-chevron`,"aria-hidden":`true`,children:`⌄`}),(0,M.jsx)(`span`,{className:`niceeval-trace-turn-label`,children:nF(e.label,n)}),(0,M.jsxs)(`span`,{className:`niceeval-trace-turn-facts`,children:[r===void 0?$(n,`timing unavailable`,`时长不可用`):FL(r),(0,M.jsxs)(`span`,{children:[t.length,` `,$(n,`events`,`事件`)]}),i>0?(0,M.jsxs)(`span`,{children:[i,` `,$(n,`calls`,`调用`)]}):null]}),e.verdict?(0,M.jsx)(`span`,{className:`niceeval-trace-turn-verdict`,children:e.verdict}):null]})}),(0,M.jsx)(`div`,{className:`niceeval-trace-turn-events`,hidden:l,children:t.length===0?(0,M.jsx)(`p`,{className:`niceeval-trace-empty-turn`,children:$(n,`No events captured for this turn.`,`此轮没有已捕获事件。`)}):t.map(e=>(0,M.jsx)(ZL,{event:e,locale:n},e.id))})]})}function $L({data:e,locale:t,className:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null);if(e===null||e.turns.length===0)return null;let p=UL(e,t),m={duration:r,setDuration:i,turnsCollapsed:a,setTurnsCollapsed:o,callsCollapsed:s,setCallsCollapsed:c,query:l,setQuery:u,selected:d,setSelected:f};return(0,M.jsx)(ML.Provider,{value:m,children:(0,M.jsxs)(`section`,{className:PL(`niceeval-report`,`niceeval-turn-trace`,n),"data-duration-mode":r?`duration`:`sequence`,onKeyDown:e=>{e.key===`Escape`&&f(null)},children:[(0,M.jsx)(JL,{content:e,events:p,locale:t}),(0,M.jsx)(YL,{content:e,events:p,locale:t}),(0,M.jsx)(`div`,{className:`niceeval-trace-ledger`,children:e.turns.map((e,n)=>(0,M.jsx)(QL,{turn:e,events:p.filter(e=>e.turnIndex===n),locale:t},e.key))})]})})}function eR(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=[...e.currentTarget.parentElement?.querySelectorAll(`[role=tab]`)??[]],n=t.indexOf(e.currentTarget);n<0||t.length===0||(e.preventDefault(),t[(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length]?.focus())}var tR=/(\/\/[^\n]*)|(\/\*[^]*?\*\/)|(`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|\b(import|from|export|default|const|let|var|async|await|function|return|if|else|for|of|in|new|class|extends|typeof|void|true|false|null|undefined)\b|\b(\d[\d_.]*)\b|([A-Za-z_$][\w$]*)(?=\s*\()/g;function nR(e){let t=[],n=0,r=0,i;for(tR.lastIndex=0;i=tR.exec(e);){i.index>n&&t.push(e.slice(n,i.index));let a=i[1]||i[2]?`tok-comment`:i[3]?`tok-str`:i[4]?`tok-kw`:i[5]?`tok-num`:`tok-fn`;t.push((0,M.jsx)(`span`,{className:a,children:i[0]},r++)),n=i.index+i[0].length,i[0].length===0&&tR.lastIndex++}return n<e.length&&t.push(e.slice(n)),t}function rR(e,t){return e.kind===`assertion`?(0,M.jsx)(jL,{content:e.content,label:e.label,state:e.state,locale:t}):e.kind===`turn-trace`?(0,M.jsx)($L,{data:e.data,locale:t}):(0,M.jsx)(`div`,{className:rF(`niceeval-report`,`niceeval-text`,e.className),children:e.text})}function iR(e,t){if(!iF(e))return`"${t}" must be an object`;if(typeof e.sourceItemId!=`string`)return`"${t}.sourceItemId" must be a string`;if(typeof e.sha256!=`string`)return`"${t}.sha256" must be a string`;if(typeof e.path!=`string`)return`"${t}.path" must be a string`;if(!Array.isArray(e.lines))return`"${t}.lines" must be an array`;for(let n=0;n<e.lines.length;n++){let r=e.lines[n];if(!iF(r))return`"${t}.lines[${n}]" must be an object`;if(typeof r.number!=`number`)return`"${t}.lines[${n}].number" must be a number`;if(typeof r.text!=`string`)return`"${t}.lines[${n}].text" must be a string`;if(r.interaction!==void 0&&r.interaction!==`send`)return`"${t}.lines[${n}].interaction" must be send`;if(r.turnIds!==void 0&&(!Array.isArray(r.turnIds)||r.turnIds.some(e=>typeof e!=`string`)))return`"${t}.lines[${n}].turnIds" must be an array of strings`;if(r.pill!==void 0&&!aF(r.pill))return`"${t}.lines[${n}].pill" must be a LocalizedText`}return null}function aR(e){if(e==null)return null;if(!iF(e))throw oF(`SourceView`,`sourceViewData`,`SourceContent`,`"data" must be an object or null`);let t=iR(e.spine,`data.spine`);if(t!==null)throw oF(`SourceView`,`sourceViewData`,`SourceContent`,t);if(!Array.isArray(e.detached))throw oF(`SourceView`,`sourceViewData`,`SourceContent`,`"data.detached" must be an array`);for(let t=0;t<e.detached.length;t++){let n=iR(e.detached[t],`data.detached[${t}]`);if(n!==null)throw oF(`SourceView`,`sourceViewData`,`SourceContent`,n)}return e}function oR(e){return e.aborted?`gate-fail`:e.tone}function sR(e){if(e)return`niceeval-source-line--${e}`}var cR={send:(0,M.jsx)(`path`,{d:`M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z`}),passed:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"gate-fail":(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`m15 9-6 6`}),(0,M.jsx)(`path`,{d:`m9 9 6 6`})]}),"soft-fail":(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),unavailable:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,M.jsx)(`path`,{d:`M12 17h.01`})]})},lR={send:`send`,passed:`passed`,"gate-fail":`failed`,"soft-fail":`mismatched`,unavailable:`unavailable`};function uR({line:e}){let t=e.interaction===`send`?`send`:oR(e);return t===void 0?(0,M.jsx)(`span`,{className:`niceeval-source-gutter`,children:e.number}):(0,M.jsx)(`span`,{className:`niceeval-source-gutter niceeval-source-gutter-mark`,role:`img`,"aria-label":lR[t],title:lR[t],children:(0,M.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:cR[t]})})}function dR({line:e,locale:t}){return(0,M.jsxs)(`span`,{className:`niceeval-source-line-summary`,children:[(0,M.jsx)(uR,{line:e}),(0,M.jsx)(`span`,{className:`niceeval-source-code`,children:nR(e.text)}),(0,M.jsxs)(`span`,{className:`niceeval-source-meta`,children:[e.pill===void 0?null:(0,M.jsx)(`span`,{className:`niceeval-source-pill`,children:nF(e.pill,t)}),e.aborted?(0,M.jsx)(`span`,{className:`niceeval-source-abort-mark`,"aria-hidden":`true`,children:`⤓`}):null]})]})}function fR({calls:e,locale:t,renderChild:n}){return(0,M.jsx)(`div`,{className:`niceeval-source-calls`,children:e.map((e,r)=>(0,M.jsxs)(`details`,{className:rF(`niceeval-source-call`,e.tone&&`niceeval-source-call--${e.tone}`),open:e.open,children:[(0,M.jsx)(`summary`,{children:nF(e.summary,t)}),e.target.kind===`opaque`?(0,M.jsxs)(`div`,{className:`niceeval-source-opaque`,children:[(0,M.jsx)(`div`,{className:`niceeval-source-opaque-label`,children:nF(e.target.label,t)}),e.target.calls?(0,M.jsx)(fR,{calls:e.target.calls,locale:t,renderChild:n}):null]}):(0,M.jsx)(pR,{block:e.target.block,locale:t,renderChild:n,nested:!0})]},r))})}function pR({block:e,locale:t,renderChild:n,nested:r=!1}){let i=e.lines.find(e=>e.tone===`gate-fail`||e.tone===`soft-fail`||e.tone===`unavailable`)?.number,a=!1;return(0,M.jsxs)(`div`,{className:rF(`niceeval-source-block`,r&&`niceeval-source-block--nested`),children:[(0,M.jsx)(`div`,{className:`niceeval-source-block-path`,children:e.path}),(0,M.jsx)(`div`,{className:`niceeval-source-lines`,children:e.lines.map(e=>{let r=a;e.aborted&&(a=!0);let o=e.details!==void 0&&e.details.length>0||e.calls!==void 0&&e.calls.length>0,s=rF(`niceeval-source-line`,e.interaction===`send`&&`niceeval-source-line--send`,sR(oR(e)),r&&`niceeval-source-line-unreached`);return o?(0,M.jsxs)(`details`,{className:s,open:e.interaction!==`send`&&e.number===i,children:[(0,M.jsx)(`summary`,{children:(0,M.jsx)(dR,{line:e,locale:t})}),(0,M.jsxs)(`div`,{className:`niceeval-source-line-detail`,children:[e.details?.map((e,t)=>(0,M.jsx)(`div`,{children:n(e)},t)),e.calls?(0,M.jsx)(fR,{calls:e.calls,locale:t,renderChild:n}):null]})]},e.number):(0,M.jsx)(`div`,{className:s,children:(0,M.jsx)(dR,{line:e,locale:t})},e.number)})})]})}function mR({data:e,locale:t,className:n}){let r=aR(e??null);if(r===null)return null;let i=e=>rR(e,t);return(0,M.jsxs)(`div`,{className:rF(`niceeval-report`,`niceeval-source-view`,n),children:[(0,M.jsx)(pR,{block:r.spine,locale:t,renderChild:i}),r.detached.map(e=>(0,M.jsx)(pR,{block:e,locale:t,renderChild:i},e.path)),r.unmapped&&r.unmapped.length>0?(0,M.jsx)(`div`,{className:`niceeval-source-unmapped`,children:r.unmapped.map((e,t)=>(0,M.jsx)(`div`,{children:i(e)},t))}):null]})}var hR=`—`;function gR(e){return e===null?hR:lF(e)}function _R(e,t,n){let r=Math.max(n,1),i=Math.min(r,Math.max(0,e));return{x:i,width:Math.min(r-i,Math.max(t,r/1e3))}}function vR(e){return e.reduce((e,t)=>e+1+vR(t.children??[]),0)}function yR(e,t=[]){for(let n of e){let e=n.children??[];e.length===0?t.push(n):yR(e,t)}return t}var bR=5;function xR(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)>>>0;return t%bR}function SR(e){return e.reduce((e,t)=>e+ +!!t.failed+SR(t.children??[]),0)}var CR=.01,wR=3,TR=2;function ER(e,t){return!!e.failed||!!e.open||e.durationMs===null||e.durationMs>=t*CR}function DR(e){return!e.failed&&!e.open&&e.durationMs!==null}function OR(e,t){if(t===null||t<=0)return e.map(e=>({kind:`node`,node:e}));let n=[];for(let r of e){if(ER(r,t)){n.push({kind:`node`,node:r});continue}let e=n[n.length-1];e!==void 0&&e.kind===`fold`?e.nodes.push(r):n.push({kind:`fold`,nodes:[r]})}return n.map(e=>e.kind===`fold`&&e.nodes.length<TR?{kind:`node`,node:e.nodes[0]}:e)}function kR(e,t){let n=[],r=[],i=null,a=()=>{if(r.length>=wR)n.push({kind:`repeat`,nodes:r});else for(let e of r)n.push({kind:`node`,node:e});r=[],i=null};for(let o of e){if(o.kind===`node`&&DR(o.node)){let e=`${o.node.kind}\u0000${nF(o.node.label,t)}`;e!==i&&a(),i=e,r.push(o.node);continue}a(),n.push(o)}return a(),n}function AR(e,t,n){return kR(OR(e,t),n)}function jR(e){let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>`${e} ×${t}`).join(` · `)}function MR(e,t){return`${nF(e[0].label,t)} ×${e.length}`}function NR(e,t){let n=e.reduce((e,t)=>e+(t.durationMs??0),0);return t===`zh-CN`?`合计 ${lF(n)}`:`total ${lF(n)}`}function PR(e,t,n){return e===`zh-CN`?t===`nodes`?`${n} 个节点`:`${n} 个失败节点`:`${n} ${t===`nodes`?`node`:`failed node`}${n===1?``:`s`}`}function FR({nodes:e,locale:t,rowDurationMs:n,className:r=`niceeval-waterfall-nodes`}){return(0,M.jsx)(`ul`,{className:r,children:AR(e,n,t).map(e=>e.kind===`node`?(0,M.jsx)(IR,{node:e.node,locale:t,rowDurationMs:n},e.node.key):(0,M.jsx)(`li`,{children:(0,M.jsxs)(`details`,{className:`niceeval-waterfall-fold`,children:[(0,M.jsxs)(`summary`,{className:`niceeval-waterfall-node niceeval-waterfall-fold-summary`,children:[(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-name`,children:e.kind===`fold`?jR(e.nodes):MR(e.nodes,t)}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-dur`,children:NR(e.nodes,t)})]}),(0,M.jsx)(`ul`,{className:`niceeval-waterfall-node-children`,children:e.nodes.map(e=>(0,M.jsx)(IR,{node:e,locale:t,rowDurationMs:n},e.key))})]})},`${e.kind}:${e.nodes[0].key}`))})}function IR({node:e,locale:t,rowDurationMs:n}){let r=nF(e.label,t),i=e.children??[],a=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-kind`,children:e.kind}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-name`,title:r,children:r}),e.failed?(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-failed`,children:`✗`}):null,(0,M.jsx)(`span`,{className:`niceeval-waterfall-node-dur`,children:gR(e.durationMs)})]});return i.length===0?(0,M.jsx)(`li`,{className:rF(`niceeval-waterfall-node`,e.failed&&`niceeval-waterfall-node--failed`),children:a}):(0,M.jsx)(`li`,{children:(0,M.jsxs)(`details`,{open:!!e.failed||!!e.open,children:[(0,M.jsx)(`summary`,{className:rF(`niceeval-waterfall-node`,e.failed&&`niceeval-waterfall-node--failed`),children:a}),(0,M.jsx)(FR,{nodes:i,locale:t,rowDurationMs:n,className:`niceeval-waterfall-node-children`})]})})}function LR(e,t,n,r){return(0,M.jsxs)(`section`,{className:rF(`niceeval-report`,`niceeval-waterfall`,r),children:[n===void 0?null:(0,M.jsx)(`div`,{className:`niceeval-waterfall-title`,children:nF(n,t)}),(0,M.jsx)(`ul`,{className:`niceeval-waterfall-list`,children:e.map(e=>{let n=vR(e.nodes),r=SR(e.nodes),i=yR(e.nodes),a=nF(e.label,t),o=e.locator!==void 0&&a===String(e.locator);return(0,M.jsxs)(`li`,{className:`niceeval-waterfall-row`,children:[(0,M.jsxs)(`div`,{className:`niceeval-waterfall-head`,children:[e.locator===void 0?null:e.href===void 0?(0,M.jsx)(`span`,{className:`niceeval-locator`,children:e.locator}):(0,M.jsx)(`a`,{className:`niceeval-locator`,href:e.href,children:e.locator}),o?null:(0,M.jsx)(`span`,{className:`niceeval-waterfall-label`,children:a}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-duration`,children:gR(e.durationMs)}),(0,M.jsx)(`span`,{className:`niceeval-waterfall-count`,children:PR(t,`nodes`,n)}),r>0?(0,M.jsxs)(`span`,{className:`niceeval-waterfall-failed`,children:[`✗ `,PR(t,`failed`,r)]}):null]}),e.durationMs!==null&&i.some(e=>e.durationMs!==null)?(0,M.jsx)(`svg`,{className:`niceeval-waterfall-track`,viewBox:`0 0 ${Math.max(e.durationMs,1)} 1`,preserveAspectRatio:`none`,children:i.map(n=>{if(n.durationMs===null)return null;let r=_R(n.startOffsetMs,n.durationMs,e.durationMs);return(0,M.jsx)(`rect`,{className:rF(`niceeval-waterfall-bar`,`niceeval-span-kind-${xR(n.kind)}`,n.failed&&`niceeval-span-failed`),x:r.x,y:.15,width:r.width,height:.7,children:(0,M.jsx)(`title`,{children:`${nF(n.label,t)} · ${lF(n.durationMs)}${n.failed?` · ✗`:``}`})},n.key)})}):null,e.nodes.length>0?(0,M.jsx)(FR,{nodes:e.nodes,locale:t,rowDurationMs:e.durationMs}):null]},e.key)})})]})}function RR({nodes:e,locale:t,title:n,className:r}){let i=e??null;return i===null||i.length===0?null:LR(i,t,n,r)}function zR({children:e,className:t}){return(0,M.jsx)(`div`,{className:rF(`niceeval-report`,`niceeval-col`,t),children:v.Children.toArray(e)})}function BR({children:e,className:t}){let n=v.Children.toArray(e);return(0,M.jsx)(`div`,{className:`niceeval-report niceeval-grid-fit`,children:(0,M.jsx)(`div`,{className:rF(`niceeval-report`,`niceeval-grid`,t),"data-cells":n.length,children:n.map((e,t)=>(0,M.jsx)(`div`,{className:`niceeval-grid-cell`,children:e},t))})})}function VR({cell:e}){return e===void 0||e.kind===`notApplicable`?`—`:e.kind===`verdict`?(0,M.jsx)(`span`,{className:rF(`niceeval-verdict-pill`,`niceeval-verdict-${e.verdict}`),children:e.verdict}):e.text}function HR({data:e,locale:t,className:n}){return e===null||e.rows.length===0||e.columns.length===0?null:(0,M.jsxs)(`table`,{className:rF(`niceeval-report`,`niceeval-table`,n),children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.columns.map(e=>(0,M.jsx)(`th`,{scope:`col`,children:nF(e.header,t)},e.key))})}),(0,M.jsx)(`tbody`,{children:e.rows.map(t=>(0,M.jsx)(`tr`,{children:e.columns.map(e=>(0,M.jsx)(`td`,{children:(0,M.jsx)(VR,{cell:t.cells[e.key]})},e.key))},t.key))})]})}function UR(e){return ZR(e.map(e=>Qz(e,`assertion`))).slice}function WR(e,t,n){return jz(Qz(e,`trace`),t,n)}function GR(e,t,n){return Fz(Qz(e,`trace`),t,n)}function KR(e){return Iz(Qz(e,`trace`))}function qR(e,t){return Nz(Qz(e,`timing`),t).slice}function JR(e,t){return Pz(Qz(t,`trace`),Qz(e,`usage`))}function YR(e,t,n){return Lz(Qz(e,`sources`),Qz(t,`trace`),n).slice}function XR(e){return Rz(Qz(e,`diff`))}function ZR(e){let t=e.flatMap(e=>{try{return[QR(e)]}catch{return[]}}),n=t.filter(e=>e.display.outcome!==`passed`||e.score!==void 0),r=t.filter(e=>e.display.outcome===`passed`&&e.score===void 0),i=new Map;for(let e of r){let t=e.display.groupPath.join(` > `)||`Passed checks`,n=i.get(t)??[];n.push(e),i.set(t,n)}let a=t.flatMap(({score:e})=>e===void 0?[]:[e]),o=Object.freeze({attention:Object.freeze(n),passedGroups:Object.freeze([...i].map(([e,t])=>Object.freeze({group:e,items:Object.freeze(t)}))),evaluationKind:a.length===0?`pass`:`points`});return Object.freeze({data:o,slice:Object.freeze({state:`available`,data:o})})}function QR(e){let t=Qz(e,`entry`),n=Qz(e,`display`),r=Qz(t,`decision`),i=Qz(t,`evaluation`),a=eB(t.contribution)??eB(r.contribution),o=Qz(t,`criterion`),s=Qz(t,`materials`),c=eB(t.judgeMaterial),l=eB(t.scoreMatchAudit),u=eB(eB(t.policy)?.condition),d=Vz(r.result),f=tB(e,`sourceSites`).flatMap(e=>{let t=eB(e),n=eB(t?.source),r=eB(t?.start),i=eB(t?.end);return t===void 0||n===void 0||r===void 0||i===void 0||typeof t.entryId!=`string`||typeof t.sourceOrder!=`number`||typeof t.role!=`string`||typeof n.sourceItemId!=`string`||typeof n.sha256!=`string`||typeof r.line!=`number`||typeof r.column!=`number`||typeof i.line!=`number`||typeof i.column!=`number`?[]:[Object.freeze({entryId:t.entryId,sourceOrder:t.sourceOrder,role:t.role,source:n,start:Object.freeze({line:r.line,column:r.column}),end:Object.freeze({line:i.line,column:i.column})})]}),p=f.map(e=>{let t=$z(e.source,`assertion.sourceSites[].source`);return Object.freeze({...e,target:Object.freeze({state:`exact`,sourceItemId:nB(t,`sourceItemId`),sha256:nB(t,`sha256`)})})}),m=$R(Qz(e,`check`)),h=Qz(e,`matcher`),g=Az(h),_=dz(h.debugger),v=ez(o),y=nz(i,g),b=tz(u),x=iz(t,m),S=rz(s,c,l),C=Object.freeze({entryId:nB(e,`entryId`),display:Object.freeze({...typeof n.key==`string`?{key:n.key}:{},...typeof n.label==`string`?{label:n.label}:{},groupPath:Object.freeze(rB(n.groupPath))}),entry:t,sourceSites:Object.freeze(f),check:m,matcher:g}),w=typeof n.label==`string`?n.label:typeof n.key==`string`?n.key:C.entryId,T=Bz(a),E=r.gate,D=d===`matched`?`passed`:d===`mismatched`||d===`errored`?`failed`:`unavailable`;return Object.freeze({entryId:C.entryId,closed:C,display:Object.freeze({name:w,severity:E===`failed`||E===`unavailable`?`gate`:T===void 0?`recorded`:`scored`,outcome:D,groupPath:C.display.groupPath,detail:typeof r.reason==`string`?r.reason:``}),sourceSites:Object.freeze(p),check:v,decision:Object.freeze({result:d,observed:y,expected:b,diagnosticTree:x,...typeof r.reason==`string`?{reason:r.reason}:{}}),evidence:Object.freeze({source:S,check:v,observed:y,expected:b,explanation:x,..._===void 0?{}:{matcherDebugger:_}}),...T===void 0?{}:{score:T},retained:Object.freeze({matcher:g})})}function $R(e){return Object.freeze({label:nB(e,`label`),state:nB(e,`state`),expected:cB(e.expected),observed:cB(e.observed),reason:oB(e.reason),anchor:cB(e.anchor),children:Object.freeze(tB(e,`children`).map((e,t)=>$R($z(e,`check.children[${t}]`))))})}function ez(e){return e.state===`available`?Kz(e.value):Object.freeze({kind:`unavailable`,reason:`not-recorded`})}function tz(e){return e?.state===`available`?Kz(e.value):Object.freeze({kind:`unavailable`,reason:`not-recorded`})}function nz(e,t){let n=Gz(e.observed),r=e.kind===`ordinary`?e.receipt:e.kind===`matcher-current`&&!Array.isArray(t.comparator)?t.receipt:void 0;return Wz([...n.kind===`fields`?n.fields:[{label:`value`,value:n}],...r==null?[]:[{label:`receipt`,value:Kz(r)}]])}function rz(e,t,n){let r=lz(Qz(e,`source`)),i=tB(e,`evidence`).map((e,t)=>lz($z(e,`materials.evidence[${t}]`))),a=tB(e,`limitations`).map(Kz);return Wz([{label:`input`,value:r},...t===void 0?[]:[{label:`judge material`,value:Kz(t)}],...n===void 0?[]:[{label:`model evaluation`,value:Kz(n)}],...i.length===0?[]:[{label:`evidence`,value:Object.freeze({kind:`list`,items:Object.freeze(i)})}],{label:`coverage`,value:Kz(e.coverage)},...a.length===0?[]:[{label:`limitations`,value:Object.freeze({kind:`list`,items:Object.freeze(a)})}]])}function iz(e,t){let n=Qz(e,`explanationRetention`);if(n.state===`retained`){let e=oz(Gz(n.value));if(e.kind!==`fields`)return sz(t);let r=new Set(e.fields.map(e=>e.label));return Wz([...e.fields,...!r.has(`expected`)&&t.expected!==null?[{label:`expected`,value:az(t.expected)}]:[],...!r.has(`received`)&&t.observed!==null?[{label:`received`,value:az(t.observed)}]:[],...!r.has(`reason`)&&t.reason!==null?[{label:`reason`,value:Uz(t.reason)}]:[]])}return sz(t)}function az(e){let t=eB(e);return t!==void 0&&(t.kind===`unavailable`||t.kind===`value`||t.kind===`text`||t.kind===`list`||t.kind===`fields`)?Gz(e):Kz(e)}function oz(e){if(e.kind===`list`)return Object.freeze({kind:`list`,items:Object.freeze(e.items.map(oz))});if(e.kind!==`fields`)return e;let t=new Set(e.fields.map(e=>e.label));return Wz(e.fields.map(e=>({label:e.label===`observed`&&!t.has(`received`)?`received`:e.label===`message`&&!t.has(`reason`)?`reason`:e.label,value:oz(e.value)})))}function sz(e){let t=eB(e.anchor),n=typeof t?.id==`string`?t.id:typeof t?.toolOccurrenceId==`string`?t.toolOccurrenceId:typeof t?.eventId==`string`?t.eventId:void 0;return Wz([{label:`code`,value:Uz(e.label)},...e.expected===null?[]:[{label:`expected`,value:az(e.expected)}],...e.observed===null?[]:[{label:`received`,value:az(e.observed)}],...e.reason===null?[]:[{label:`reason`,value:Uz(e.reason)}],...n===void 0?[]:[{label:`locator`,value:Wz([{label:`id`,value:Uz(n)}])}],{label:`children`,value:Object.freeze({kind:`list`,items:Object.freeze(e.children.map((e,t)=>Wz([{label:`index`,value:Uz(t)},{label:`label`,value:Uz(e.label)},{label:`state`,value:Uz(cz(e.state))},{label:`diagnostic`,value:sz(e)}])))})}])}function cz(e){return e===`matched`||e===`mismatched`?e:`unavailable`}function lz(e){if(e.kind===`snapshot`)return Kz(e.value);if(e.kind===`unavailable`)return Object.freeze({kind:`unavailable`,reason:`not-recorded`});if(e.kind!==`content`)throw Error(`Assertion material kind is invalid`);let t=Qz(e,`content`);if(t.state!==`available`||typeof t.base64!=`string`)throw Error(`Assertion material content is unavailable`);let n=uz(t.base64);return e.encoding===`json`?Kz(JSON.parse(n)):e.encoding===`utf-8`?Object.freeze({kind:`text`,text:n}):Kz({encoding:e.encoding,byteLength:e.byteLength,preview:e.preview})}function uz(e){let t=globalThis.atob(e),n=Uint8Array.from(t,e=>e.charCodeAt(0));return new TextDecoder(`utf-8`,{fatal:!0}).decode(n)}function dz(e){if(e==null)return;let t=$z(e,`matcher.debugger`),n=Sz(t.state),r=Cz(t.subject),i=Qz(t,`source`),a=fz(Qz(i,`final`));if(n===`legacy`)return Object.freeze({state:n,queryKind:`unavailable`,subject:r,querySummary:`Matcher query was not retained`,facts:Object.freeze([]),atEvaluation:Object.freeze({state:a.state,rows:Object.freeze(a.rows.map(e=>e.content))}),afterEvaluation:Object.freeze([]),relationNotice:`historical-not-recorded`});let o=Qz(t,`query`),s=wz(o.kind),c=Object.freeze(s===`collection-filter`?[Gz(o.summary)]:tB(o,`summaries`).map(Gz)),l=s===`collection-filter`?gz(c[0]):c.map(_z).join(` → `),u=Qz(t,`receipt`),d=fz(Qz(i,`atEvaluation`)),f=xz(Qz(t,`identityRelation`)),p=[...d.state===`partial`?[`source-partial`]:[],...t.overlayRetention===`partial`?[`overlay-partial`]:[],...d.state===`unavailable`?[`source-unavailable`]:[]].filter(e=>e!==f);return Object.freeze({state:n,queryKind:s,subject:r,querySummary:l,receipt:cB(u),sourceLedger:cB(i),facts:Object.freeze([Object.freeze({kind:`observed`,value:yz(s,c.length,u)}),Object.freeze({kind:`examined`,value:bz(s,u)})]),steps:Object.freeze(tB(t,`steps`).map(mz)),atEvaluation:Object.freeze({state:d.state,rows:Object.freeze(d.rows.map(e=>e.content)),...p.length===0?{}:{notices:Object.freeze(p)}}),afterEvaluation:Object.freeze(a.rows.filter(e=>e.phase===`outside-evaluation-snapshot`).map(e=>e.content)),...f===void 0?{}:{relationNotice:f}})}function fz(e){return Object.freeze({state:Tz(e.state),rows:Object.freeze(tB(e,`rows`).map((e,t)=>pz($z(e,`matcher.debugger.source.rows[${t}]`))))})}function pz(e){let t=Qz(e,`evaluation`),n=Dz(t.result),r=t.difference===void 0?void 0:hz(Gz(t.difference)),i=eB(e.conversationTarget);return Object.freeze({phase:Oz(e.phase),content:Object.freeze({key:nB(e,`rowId`),number:nB(e,`number`),kind:Ez(e.kind),summary:nB(e,`summary`),state:n,fields:hz(Gz(e.detail)),...r===void 0?{}:{difference:r},...i?.state===`exact`&&typeof i.anchor==`string`?{conversationTarget:Object.freeze({anchor:i.anchor})}:{}})})}function mz(e,t){let n=$z(e,`matcher.debugger.steps[${t}]`),r=eB(n.conversationTarget);return Object.freeze({step:aB(n,`step`),summary:qz(Gz(n.summary)),state:kz(n.state),...typeof n.sourceRow==`string`?{sourceRow:n.sourceRow}:{},...r?.state===`exact`&&typeof r.anchor==`string`?{conversationTarget:Object.freeze({anchor:r.anchor})}:{}})}function hz(e){return e.kind===`fields`?Object.freeze(e.fields.map(e=>Object.freeze({label:e.label,value:qz(e.value)}))):e.kind===`list`?Object.freeze(e.items.map((e,t)=>Object.freeze({label:String(t+1),value:qz(e)}))):Object.freeze([Object.freeze({label:`value`,value:qz(e)})])}function gz(e){let t=vz(e,`matcher`),n=vz(e,`quantifier`),r=n===void 0?void 0:vz(n,`kind`),i=n===void 0?void 0:vz(n,`count`),a=t===void 0?void 0:qz(t);return a===void 0||a.length===0||r?.kind!==`value`||typeof r.value!=`string`?qz(e):r.value===`absent`?`none × ${a}`:i?.kind!==`value`||typeof i.value!=`number`?qz(e):r.value===`exact`?`exactly ${i.value} × ${a}`:r.value===`at-least`?`at least ${i.value} × ${a}`:r.value===`less-than`?`less than ${i.value} × ${a}`:r.value===`at-most`?`at most ${i.value} × ${a}`:r.value===`greater-than`?`greater than ${i.value} × ${a}`:qz(e)}function _z(e){let t=vz(e,`matcher`);if(t===void 0)return qz(e);let n=qz(t);return n.length===0?qz(e):n}function vz(e,t){return e.kind===`fields`?e.fields.find(e=>e.label===t)?.value:void 0}function yz(e,t,n){return e===`collection-filter`&&typeof n.matched==`number`&&typeof n.mismatched==`number`&&typeof n.unavailable==`number`?Object.freeze({en:`${n.matched} matched · ${n.mismatched} not matched · ${n.unavailable} unknown`,"zh-CN":`${n.matched} 条命中 · ${n.mismatched} 条未命中 · ${n.unavailable} 条无法判断`}):e===`ordered-sequence`&&typeof n.definitePrefixLength==`number`&&typeof n.possiblePrefixLength==`number`?Object.freeze({en:`${n.definitePrefixLength}/${t} definite · ${n.possiblePrefixLength}/${t} possible`,"zh-CN":`${n.definitePrefixLength}/${t} 步确定 · ${n.possiblePrefixLength}/${t} 步可能`}):Object.freeze({en:`unavailable`,"zh-CN":`不可用`})}function bz(e,t){if(e===`collection-filter`&&typeof t.examined==`number`){let e=typeof t.knownTotal==`number`?t.knownTotal:`?`;return Object.freeze({en:`${t.examined}/${e} rows`,"zh-CN":`${t.examined}/${e} 条记录`})}return e===`ordered-sequence`&&typeof t.sourceRows==`number`&&typeof t.comparisons==`number`?Object.freeze({en:`${t.sourceRows} rows · ${t.comparisons} comparisons`,"zh-CN":`${t.sourceRows} 条记录 · ${t.comparisons} 次比较`}):Object.freeze({en:`unavailable`,"zh-CN":`不可用`})}function xz(e){if(e.state!==`exact`)return e.reason===`ambiguous`?`ambiguous-relation`:`source-unavailable`}function Sz(e){if(e===`current`||e===`legacy`)return e;throw Error(`matcher.debugger.state is invalid`)}function Cz(e){if(e===`tool`||e===`event`||e===`source-row`)return e;throw Error(`matcher.debugger.subject is invalid`)}function wz(e){if(e===`collection-filter`||e===`ordered-sequence`)return e;throw Error(`matcher.debugger.query.kind is invalid`)}function Tz(e){if(e===`complete`||e===`partial`||e===`unavailable`)return e;throw Error(`matcher.debugger source state is invalid`)}function Ez(e){if(e===`tool`||e===`event`||e===`legacy-source-row`)return e;throw Error(`matcher.debugger row kind is invalid`)}function Dz(e){if(e===`matched`||e===`mismatched`||e===`unavailable`||e===`not-evaluated`||e===`not-retained`||e===`outside-snapshot`||e===`legacy`)return e;throw Error(`matcher.debugger row state is invalid`)}function Oz(e){if(e===`at-evaluation`||e===`outside-evaluation-snapshot`||e===`historical`)return e;throw Error(`matcher.debugger row phase is invalid`)}function kz(e){if(e===`matched`||e===`possible`||e===`blocked`||e===`not-reached`)return e;throw Error(`matcher.debugger step state is invalid`)}function Az(e){let t=tB(e,`targets`).flatMap(e=>{let t=eB(e),n=eB(t?.anchor);if(t===void 0||n===void 0||typeof t.state!=`string`)return[];let r;return n.kind===`tool-occurrence`&&typeof n.toolOccurrenceId==`string`?r={kind:`tool-occurrence`,toolOccurrenceId:n.toolOccurrenceId}:n.kind===`event`&&typeof n.eventId==`string`&&(r={kind:`event`,eventId:n.eventId}),r===void 0?[]:[Object.freeze({state:t.state,anchor:Object.freeze(r),difference:cB(t.difference),conversationAnchor:Hz(r)})]}),n=eB(e.sandboxCommandJoin),r=n?.state===`matched`&&typeof n.commandId==`string`?{state:`matched`,commandId:n.commandId}:{state:`unavailable`,reason:typeof n?.reason==`string`?n.reason:`not-recorded`},i=e.state===`ordinary`||e.state===`legacy`||e.state===`available`||e.state===`missing`?e.state:`missing`;return Object.freeze({state:i,sourceState:typeof e.sourceState==`string`?e.sourceState:null,comparator:cB(e.comparator),sourceLedger:cB(e.sourceLedger),receipt:cB(e.receipt),result:cB(e.result),targets:Object.freeze(t),sandboxCommandJoin:r,commandMatch:r,...typeof e.reason==`string`?{reason:e.reason}:{}})}function jz(e,t,n){let r=Qz(e,`conversation`),i=tB(r,`items`).map((e,t)=>$z(e,`trace.conversation.items[${t}]`)),a=new Map;for(let e of t){if(e.operation!==`attempt.trace.detail`)continue;let t=Qz(e,`detail`);if(t.kind===`item`){let e=eB(t.item);e!==void 0&&typeof t.itemId==`string`&&a.set(t.itemId,e)}}let o=tB(r,`turns`).map((e,t)=>{let n=$z(e,`trace.conversation.turns[${t}]`),r=nB(n,`turnId`),o=i.filter(e=>e.turnId===r).map(e=>Mz(a.get(nB(e,`itemId`))??e));return Object.freeze({key:r,label:`Turn ${aB(n,`sequence`)}`,verdict:Zz(n.outcome),entries:Object.freeze(o)})}),s=Object.freeze({turns:Object.freeze(o),locator:n});return zz(r.state,s,`Closed observability`)}function Mz(e){let t=nB(e,`itemId`),n=nB(e,`kind`),r=eB(e.occurrence),i=typeof e.toolOccurrenceId==`string`?e.toolOccurrenceId:r?.state===`exact`&&typeof r.toolOccurrenceId==`string`?r.toolOccurrenceId:void 0,a=typeof e.eventId==`string`?e.eventId:void 0,o=Jz(e,n),s=typeof e.role==`string`?e.role:void 0,c=n===`message`?s===`user`?`user`:s===`assistant`?`assistant`:`message`:n===`tool-call`||n===`tool-result`?`tool`:n,l=typeof e.tool==`string`?e.tool:`tool`,u=typeof e.input==`string`?e.input:``,d=typeof e.output==`string`?e.output:void 0,f=n===`tool-call`?`started`:n===`tool-result`?`finished`:void 0,p=Xz(e.outcome),m=i===void 0?a===void 0?void 0:Hz({kind:`event`,eventId:a}):Hz({kind:`tool-occurrence`,toolOccurrenceId:i}),h=f===void 0?{kind:`text`,text:o}:{kind:`tool-evidence`,content:{phase:f,tool:l,...i===void 0?{}:{callId:i},...r===void 0?{}:i===void 0?{toolOccurrence:{state:`unavailable`,reason:String(r.reason??`not-recorded`)}}:{toolOccurrence:{state:`exact`,toolOccurrenceId:i}},inputSummary:u,...d===void 0?{}:{outputSummary:d},...p===void 0?{}:{outcome:p}}};return Object.freeze({id:t,...a===void 0?{}:{eventId:a},...typeof e.sequence==`number`?{sequence:e.sequence}:{},kind:c,preview:o,...m===void 0?{}:{anchor:m},detail:h,raw:JSON.stringify(e),...p===`failed`||p===`rejected`?{failed:!0}:{},...f===void 0?{}:{callPhase:f},...i===void 0?{}:{callId:i},...r===void 0?{}:i===void 0?{toolOccurrence:{state:`unavailable`,reason:String(r.reason??`not-recorded`)}}:{toolOccurrence:{state:`exact`,toolOccurrenceId:i}},...p===void 0?{}:{callOutcome:p},commandMatch:{state:`unavailable`,reason:`not-recorded`}})}function Nz(e,t){let n=tB(e,`activities`).map((e,t)=>$z(e,`timing.activities[${t}]`)),r=new Map;for(let e of n){let t=typeof e.parentActivityId==`string`?e.parentActivityId:null,n=r.get(t)??[];n.push(e),r.set(t,n)}let i=e=>{let t=nB(e,`activityId`),n=(r.get(t)??[]).map(i);return Object.freeze({key:t,label:nB(e,`label`),kind:nB(e,`phase`),startOffsetMs:iB(e,`startOffsetMs`),durationMs:sB(e.durationMs),...e.outcome===`failed`?{failed:!0}:{},...n.length===0?{}:{children:Object.freeze(n)}})},a=(r.get(null)??[]).map(i),o=n.reduce((e,t)=>{let n=iB(t,`startOffsetMs`),r=sB(t.durationMs);return r===null?e:Math.max(e??0,n+r)},null),s=n.length===0?Object.freeze([]):Object.freeze([{key:t,label:t,durationMs:o,nodes:Object.freeze(a),locator:t}]);return Object.freeze({data:s,slice:zz(e.state,s,`Execution timeline`)})}function Pz(e,t){let n=[];for(let e of tB(t,`observations`)){let t=eB(e);if(t!==void 0&&typeof t.kind==`string`&&typeof t.turnId==`string`){if(t.kind===`token-bucket`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.bucket==`string`&&typeof t.tokens==`number`){n.push({kind:`token-bucket`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,bucket:t.bucket,tokens:t.tokens});continue}if(t.kind===`request`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.requestKind==`string`){n.push({kind:`request`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,requestKind:t.requestKind});continue}t.kind===`provider-cost`&&typeof t.usageObservationId==`string`&&typeof t.provider==`string`&&typeof t.amount==`string`&&typeof t.currency==`string`&&n.push({kind:`provider-cost`,usageObservationId:t.usageObservationId,turnId:t.turnId,provider:t.provider,amount:t.amount,currency:t.currency})}}let r=Qz(e,`conversation`),i=Object.freeze({turns:tB(r,`turns`).length,toolCalls:tB(r,`items`).filter(e=>eB(e)?.kind===`tool-call`).length,observations:Object.freeze(n)});return zz(t.state,i,`Usage`)}function Fz(e,t,n){let r=Qz(e,`commands`),i=new Map;for(let e of t){if(e.operation!==`attempt.trace.detail`)continue;let t=Qz(e,`detail`);t.kind===`command`&&typeof t.commandId==`string`&&i.set(t.commandId,t)}let a=tB(r,`items`).map((e,t)=>{let n=$z(e,`trace.commands.items[${t}]`),a=nB(n,`commandId`),o=i.get(a)??n,s=Qz(o,`invocation`),c=Qz(o,`outcome`),l=eB(o.stdout),u=eB(o.stderr),d=eB(l?.truncation),f=eB(u?.truncation),p=c.kind===`exited`&&typeof c.exitCode==`number`?c.exitCode:void 0;return Object.freeze({commandId:a,timingNodeId:a,phase:nB(o,`phase`),display:Yz(s),...p===void 0?{}:{exitCode:p},invocation:s,...typeof o.workingDirectory==`string`?{workingDirectory:o.workingDirectory}:{},outcome:c,classification:p===0?`succeeded`:p===void 0?`observed`:`failed`,...typeof l?.text==`string`&&l.text.length>0?{stdout:l.text}:{},...typeof u?.text==`string`&&u.text.length>0?{stderr:u.text}:{},collectionState:r.state===`partial`?`partial`:`complete`,...l===void 0?{}:{stdoutState:l.textTruncated===!0||d?.state===`truncated`?`truncated`:`complete`,...typeof l.retainedBytes==`number`?{stdoutRetainedBytes:l.retainedBytes}:{},...typeof l.totalSafeUtf8Bytes==`number`?{stdoutTotalBytes:l.totalSafeUtf8Bytes}:{}},...u===void 0?{}:{stderrState:u.textTruncated===!0||f?.state===`truncated`?`truncated`:`complete`,...typeof u.retainedBytes==`number`?{stderrRetainedBytes:u.retainedBytes}:{},...typeof u.totalSafeUtf8Bytes==`number`?{stderrTotalBytes:u.totalSafeUtf8Bytes}:{}}})});return zz(r.state,Object.freeze({commands:Object.freeze(a),locator:n}),`Commands`)}function Iz(e){let t=eB(e.diagnostics);if(t===void 0)return Object.freeze({state:`unavailable`,limitations:Object.freeze([{code:`diagnostics-projection-unavailable`,summary:`Diagnostics are not exposed by the fixed execution projection.`}])});let n=tB(t,`items`).map((e,t)=>{let n=$z(e,`trace.diagnostics.items[${t}]`),r=eB(n.redaction),i=nB(n,`kind`),a=r?.state===`applied`&&typeof r.replacements==`number`?{state:`applied`,replacements:r.replacements}:{state:`none`};return Object.freeze({diagnosticId:nB(n,`diagnosticId`),code:nB(n,`code`),kind:i,phase:nB(n,`phase`),summary:nB(n,`summary`),level:i===`execution-error`?`error`:`warning`,causes:Object.freeze(tB(n,`causes`).flatMap(e=>{let t=eB(e);return typeof t?.code==`string`&&typeof t.summary==`string`?[{code:t.code,summary:t.summary}]:[]})),redaction:a,...n.sourceFrame===null||n.sourceFrame===void 0?{}:{sourceFrame:cB(n.sourceFrame)}})}),r=new Map;for(let e of n){let t=r.get(e.phase)??[];t.push(e),r.set(e.phase,t)}let i=Object.freeze({groups:Object.freeze([...r].map(([e,t])=>Object.freeze({phase:e,items:Object.freeze(t)})))});return zz(t.state,i,`Diagnostics`)}function Lz(e,t,n){let r=tB(Qz(t,`conversation`),`turns`),i=tB(e,`items`).flatMap((e,t)=>{let n=eB(e),i=eB(n?.content);if(n===void 0||i?.state!==`available`||typeof n.sourceItemId!=`string`||typeof n.path!=`string`||typeof n.sha256!=`string`||typeof i.text!=`string`)return[];let a=r.flatMap(e=>{let t=eB(e),r=eB(t?.context);return r?.state===`mapped`&&r.sourceItemId===n.sourceItemId&&r.sha256===n.sha256&&typeof t?.turnId==`string`?[{turnId:t.turnId,start:eB(r.start),end:eB(r.end)}]:[]}),o=i.text.split(`
61
- `).map((e,t)=>{let n=t+1,r=a.flatMap(e=>typeof e.start?.line==`number`&&typeof e.end?.line==`number`&&n>=e.start.line&&n<=e.end.line?[e.turnId]:[]);return Object.freeze({number:n,text:e,...r.length===0?{}:{tone:`send`,turnIds:Object.freeze(r)}})});return[Object.freeze({sourceItemId:n.sourceItemId,sha256:n.sha256,path:n.path,lines:Object.freeze(o)})]});if(i.length===0)return Object.freeze({data:null,slice:zz(e.state,null,`Source navigation`)});let a=Object.freeze({spine:i[0],detached:Object.freeze(i.slice(1)),locator:n}),o=zz(e.state,a,`Source navigation`);return Object.freeze({data:a,slice:o})}function Rz(e){return e.state===`not-recorded`||Object.keys(e).length===0?Object.freeze({state:`not-recorded`,limitations:Object.freeze([{code:`file-changes-not-recorded`,summary:`File changes collection was not recorded for this Attempt.`}])}):Object.freeze({state:`unavailable`,limitations:Object.freeze([{code:`file-changes-content-unavailable`,summary:`File changes collection has no display-safe patch projection.`}])})}function zz(e,t,n){if(e===`available`||e===`complete`)return Object.freeze({state:`available`,data:t});let r=Object.freeze([{code:String(e??`unavailable`),summary:`${n}: ${String(e??`unavailable`)}.`}]);return Object.freeze(e===`partial`?{state:`partial`,data:t,limitations:r}:e===`not-recorded`?{state:`not-recorded`,limitations:r}:{state:`unavailable`,limitations:r})}function Bz(e){if(e!==void 0&&e.state!==`not-scored`&&typeof e.points==`number`)return e.state===`earned`&&typeof e.earned==`number`?Object.freeze({state:`earned`,points:e.points,earned:e.earned}):Object.freeze({state:`unavailable`,points:e.points})}function Vz(e){return e===`matched`||e===`mismatched`||e===`unavailable`||e===`errored`||e===`not-applicable`?e:`unavailable`}function Hz(e){return e.kind===`tool-occurrence`?`tool:${e.toolOccurrenceId}`:`event:${e.eventId}`}function Uz(e){return Object.freeze({kind:`value`,value:e})}function Wz(e){return Object.freeze({kind:`fields`,fields:Object.freeze(e.map(e=>Object.freeze(e)))})}function Gz(e){let t=$z(e,`assertion fact`);if(t.kind===`unavailable`&&typeof t.reason==`string`)return Object.freeze({kind:`unavailable`,reason:t.reason});if(t.kind===`value`&&(t.value===null||typeof t.value==`string`||typeof t.value==`boolean`||typeof t.value==`number`&&Number.isFinite(t.value)))return Uz(t.value);if(t.kind===`text`&&typeof t.text==`string`)return Object.freeze({kind:`text`,text:t.text});if(t.kind===`list`)return Object.freeze({kind:`list`,items:Object.freeze(tB(t,`items`).map(Gz))});if(t.kind===`fields`)return Wz(tB(t,`fields`).map((e,t)=>{let n=$z(e,`assertion fact.fields[${t}]`);return Object.freeze({label:nB(n,`label`),value:Gz(n.value)})}));throw Error(`Assertion fact has an invalid closed shape`)}function Kz(e){if(e===null||typeof e==`string`||typeof e==`boolean`)return Uz(e);if(typeof e==`number`)return Number.isFinite(e)?Uz(e):Object.freeze({kind:`unavailable`,reason:`source-unavailable`});if(Array.isArray(e))return Object.freeze({kind:`list`,items:Object.freeze(e.map(Kz))});let t=eB(e);return t===void 0?Object.freeze({kind:`unavailable`,reason:`source-unavailable`}):Wz(Object.entries(t).map(([e,t])=>({label:e,value:Kz(t)})))}function qz(e){switch(e.kind){case`unavailable`:return e.reason;case`value`:return typeof e.value==`string`?e.value:String(e.value);case`text`:return e.text;case`list`:return e.items.map(qz).join(`, `);case`fields`:return e.fields.map(e=>`${e.label}: ${qz(e.value)}`).join(` · `)}}function Jz(e,t){return t===`message`&&typeof e.text==`string`?e.text:t===`tool-call`?`${typeof e.tool==`string`?e.tool:`tool`} ${typeof e.input==`string`?e.input:``}`.trim():t===`tool-result`&&typeof e.output==`string`?e.output:typeof e.summary==`string`?e.summary:t===`input-request`&&typeof e.prompt==`string`?typeof e.response==`string`?`${e.prompt}\n${e.response}`:e.prompt:JSON.stringify(e)}function Yz(e){return e.kind===`shell`&&typeof e.command==`string`?e.command:e.kind===`argv`&&typeof e.executable==`string`?[e.executable,...rB(e.arguments)].join(` `):JSON.stringify(e)}function Xz(e){return e===`completed`||e===`rejected`||e===`failed`||e===`cancelled`?e:void 0}function Zz(e){if(e===`completed`)return`passed`;if(e===`failed`)return`failed`;if(e===`cancelled`)return`skipped`;if(e===`interrupted`)return`errored`}function Qz(e,t){return $z(Reflect.get(e,t),t)}function $z(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`${t} must be an object.`);return e}function eB(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function tB(e,t){let n=e[t];if(!Array.isArray(n))throw Error(`${t} must be an array.`);return n}function nB(e,t){let n=e[t];if(typeof n!=`string`)throw Error(`${t} must be a string.`);return n}function rB(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function iB(e,t){let n=e[t];if(typeof n!=`number`||!Number.isFinite(n))throw Error(`${t} must be a number.`);return n}function aB(e,t){let n=e[t];if(typeof n!=`number`||!Number.isSafeInteger(n))throw Error(`${t} must be an integer.`);return n}function oB(e){return typeof e==`string`?e:null}function sB(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function cB(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return e;if(Array.isArray(e))return Object.freeze(e.map(cB));let t=eB(e);return t===void 0?null:Object.freeze(Object.fromEntries(Object.entries(t).map(([e,t])=>[e,cB(t)])))}function lB(e){let t=e.display,n=e.score,r=n?.state===`earned`?n.earned??0:void 0,i=n===void 0?``:` · weight ${n.points} ${n.points===1?`pt`:`pts`} · earned ${r===void 0?`unavailable`:`${r} ${r===1?`pt`:`pts`}`}`;return[{kind:`text`,className:`niceeval-source-assertion ${e.decision.result===`matched`?`niceeval-tone-good`:e.decision.result===`mismatched`&&t.severity===`gate`?`niceeval-tone-bad`:e.decision.result===`mismatched`?`niceeval-tone-warn`:`niceeval-tone-na`}`,text:`${t.name} · ${t.severity} ${t.outcome}${i}`},{kind:`assertion`,entryId:e.entryId,content:e.evidence,label:t.name,state:e.decision.result===`matched`?`matched`:e.decision.result===`mismatched`?`mismatched`:`unavailable`}]}function uB(e){return e===null||e.attention.length===0&&e.passedGroups.length===0?null:{columns:[{key:`name`,header:{en:`Name`,"zh-CN":`名称`}},{key:`severity`,header:{en:`Severity`,"zh-CN":`级别`}},{key:`outcome`,header:{en:`Outcome`,"zh-CN":`结果`}},{key:`detail`,header:{en:`Detail`,"zh-CN":`详情`}}],rows:e.attention.map(e=>({key:e.entryId,cells:{name:{kind:`text`,text:e.display.name},severity:{kind:`text`,text:e.display.severity},outcome:{kind:`verdict`,verdict:e.display.outcome===`unavailable`?`skipped`:e.display.outcome},detail:e.display.detail.length>0?{kind:`text`,text:e.display.detail}:{kind:`notApplicable`}}}))}}function dB(e){if(e.some(e=>e.decision.result===`mismatched`&&e.display.severity===`gate`))return`gate-fail`;if(e.some(e=>e.decision.result===`mismatched`))return`soft-fail`;if(e.some(e=>e.decision.result===`unavailable`||e.decision.result===`errored`||e.decision.result===`not-applicable`))return`unavailable`;if(e.some(e=>e.decision.result===`matched`))return`passed`}function fB(e,t){let n={send:0,passed:1,unavailable:2,"soft-fail":3,"gate-fail":4};return t===void 0?e:e===void 0||n[t]>n[e]?t:e}function pB(e,t){if(e===null||t===null)return e;let n=[...t.attention,...t.passedGroups.flatMap(e=>e.items)],r=[e.spine,...e.detached],i=new Set(r.map(e=>`${e.sourceItemId}\u0000${e.sha256}`)),a=new Set,o=e=>({...e,lines:e.lines.map(t=>{let r=n.flatMap(n=>n.sourceSites.filter(n=>n.target.state===`exact`&&n.target.sourceItemId===e.sourceItemId&&n.target.sha256===e.sha256&&t.number>=n.start.line&&t.number<=n.end.line).map(e=>({entry:n,site:e})));for(let{entry:e}of r)a.add(e.entryId);let i=r.filter(({site:e})=>e.role!==`score`).map(({entry:e})=>e),o=r.filter(({site:e})=>e.role!==`score`&&e.start.line===t.number).map(({entry:e})=>e),s=new Set((t.details??[]).flatMap(e=>e.kind===`assertion`?[e.entryId]:[])),c=[...t.details??[],...o.filter(e=>!s.has(e.entryId)).flatMap(lB)],l=r.filter(({site:e,entry:t})=>e.role===`score`&&t.score!==void 0),u=l.reduce((e,{entry:t})=>e+(t.score?.state===`earned`?t.score.earned??0:0),0),d=l.length===0?t.pill:`${u} ${u===1?`pt`:`pts`}`,f=fB(t.tone,dB(i));return{...t,...f===void 0?{}:{tone:f},...d===void 0?{}:{pill:d},...c.length===0?{}:{details:c}}})}),s=o(e.spine),c=e.detached.map(o);for(let e of n)e.sourceSites.some(e=>e.target.state===`exact`&&i.has(`${e.target.sourceItemId}\u0000${e.target.sha256}`))||a.delete(e.entryId);let l=[...e.unmapped??[],...n.filter(e=>!a.has(e.entryId)).flatMap(lB)];return{...e,spine:s,detached:c,...l.length===0?{}:{unmapped:l}}}var mB=[{title:{en:`Execution evidence unavailable`,"zh-CN":`执行证据不可用`},items:[{level:`warning`,message:{en:`The events artifact is missing or was not published.`,"zh-CN":`事件证据缺失或未发布。`}}]}];function hB(e){return e===null?[]:e.groups.map(e=>({title:e.phase,items:e.items.map(e=>({level:e.level,message:`${e.code}: ${e.summary}`}))}))}function gB(e){return e.map(e=>({level:`warning`,message:`${e.code}: ${e.summary}`}))}function _B(e,t){if(t.state===`available`)return[];let n=gB(t.limitations);return[{title:e,items:n.length>0?n:[{level:`warning`,message:`Evidence state: ${t.state}.`}]}]}function vB(e){return e.state===`available`||e.state===`partial`?e.data:null}function yB(e,t){let n=t?.turns??[],r=new Map(n.map(e=>[e.key,e])),i=new Set,a=e=>{let n=(e.turnIds??[]).flatMap(e=>{let t=r.get(e);return t===void 0?[]:(i.add(e),[t])}),a=e.details===void 0&&n.length===0?void 0:[...e.details??[],...n.length===0?[]:[{kind:`turn-trace`,data:{turns:n,locator:t?.locator}}]];return{...e,...a===void 0?{}:{details:a}}},o=e=>({...e,lines:e.lines.map(a)}),s=e===null?null:{...e,spine:o(e.spine),detached:e.detached.map(o)},c=n.filter(e=>!i.has(e.key));return{source:s,conversation:t===null||c.length===0?null:{...t,turns:c}}}function bB(e){return new TextDecoder().decode(Uint8Array.from(atob(e),e=>e.charCodeAt(0)))}function xB({locator:e,selector:t,select:n}){let{t:r}=Fo(),i=PA({kind:`attempt.trace.detail`,locator:e,selector:t});if(i.isPending)return(0,M.jsx)(`p`,{role:`status`,children:r(`report.loadingDetails`)});if(i.isError)return(0,M.jsxs)(`div`,{role:`alert`,children:[(0,M.jsx)(`p`,{children:i.error.message}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void i.refetch(),children:r(`report.retry`)})]});let a=i.data.detail;return a.kind===`execution-evidence`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{children:a.label}),(0,M.jsxs)(`p`,{children:[(0,M.jsx)(`code`,{children:a.evidenceId}),` · `,(0,M.jsx)(`code`,{children:a.pointer})]}),(0,M.jsxs)(`p`,{children:[r(`executionTrace.byteRange`,{offset:a.offset,total:a.targetByteLength}),` · SHA-256 `,(0,M.jsx)(`code`,{children:a.targetSha256})]}),(0,M.jsx)(`pre`,{style:{maxHeight:`28rem`,overflow:`auto`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:bB(a.base64)}),a.nextOffset===null?null:(0,M.jsx)(`button`,{type:`button`,onClick:()=>n({kind:`execution-evidence`,evidenceId:a.evidenceId,offset:a.nextOffset,limit:65536}),children:r(`executionTrace.nextBytes`)})]}):a.kind===`execution-event`?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{children:a.event.summary}),(0,M.jsx)(`pre`,{style:{maxHeight:`28rem`,overflow:`auto`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:JSON.stringify(a.event,null,2)}),a.evidence.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h5`,{children:e.label}),(0,M.jsxs)(`p`,{children:[(0,M.jsx)(`code`,{children:e.pointer}),` · `,(0,M.jsx)(`code`,{children:e.evidenceId}),e.truncated?` ${r(`attempt.truncated`)}`:``]}),(0,M.jsx)(`pre`,{style:{maxHeight:`16rem`,overflow:`auto`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:bB(e.base64)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>n({kind:`execution-evidence`,evidenceId:e.evidenceId}),children:r(`executionTrace.openEvidence`)})]},e.evidenceId))]}):(0,M.jsx)(`pre`,{children:JSON.stringify(a,null,2)})}function SB({locator:e,initial:t}){let{t:n}=Fo(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(``),l=PA(r===void 0?null:{...UA(e)[1],continuation:r}),u=r===void 0?t:l.data?.trace.execution;return t.state===`not-recorded`?null:(0,M.jsxs)(`section`,{"aria-label":n(`executionTrace.title`),className:`niceeval-col`,children:[(0,M.jsx)(`h3`,{children:n(`executionTrace.title`)}),(0,M.jsx)(`p`,{children:t.state}),t.limitations.length===0?null:(0,M.jsx)(`pre`,{children:JSON.stringify(t.limitations,null,2)}),t.traces.map(e=>(0,M.jsxs)(`details`,{children:[(0,M.jsxs)(`summary`,{children:[e.sourceTraceId,` · `,e.collection.state,` · `,e.eventCount]}),(0,M.jsx)(`pre`,{style:{maxHeight:`16rem`,overflow:`auto`,whiteSpace:`pre-wrap`},children:JSON.stringify({schema:e.schema,collection:e.collection,scopes:e.scopes},null,2)})]},e.traceId)),(0,M.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),s.trim()&&o({kind:`execution-event`,eventId:s.trim()})},children:[(0,M.jsxs)(`label`,{children:[n(`executionTrace.stableId`),` `,(0,M.jsx)(`input`,{value:s,onChange:e=>c(e.target.value)})]}),` `,(0,M.jsx)(`button`,{type:`submit`,disabled:!s.trim(),children:n(`executionTrace.openEvent`)}),` `,(0,M.jsx)(`button`,{type:`button`,disabled:!s.trim(),onClick:()=>o({kind:`execution-evidence`,evidenceId:s.trim()}),children:n(`executionTrace.openEvidence`)})]}),r!==void 0&&l.isPending?(0,M.jsx)(`p`,{role:`status`,children:n(`report.loadingDetails`)}):null,l.isError?(0,M.jsxs)(`div`,{role:`alert`,children:[(0,M.jsx)(`p`,{children:l.error.message}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void l.refetch(),children:n(`report.retry`)})]}):null,u===void 0?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ol`,{children:u.events.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>o({kind:`execution-event`,eventId:e.eventId}),children:e.summary||e.type}),(0,M.jsxs)(`p`,{children:[(0,M.jsx)(`code`,{children:e.eventId}),` · `,e.actor?.label??e.actor?.id??e.source.id,` · `,e.type,e.time===void 0?``:` · ${e.time.clockId}: ${e.time.value} ${e.time.unit}`]}),e.scopeMemberships.map(e=>(0,M.jsxs)(`span`,{children:[e.scopeId,`: `,e.state,` `]},e.scopeId))]},e.eventId))}),u.hasMore?(0,M.jsx)(`p`,{children:n(`executionTrace.omitted`,{count:u.omittedEventCount})}):null,u.continuation===void 0?null:(0,M.jsx)(`button`,{type:`button`,onClick:()=>i(u.continuation),children:n(`executionTrace.nextPage`)})]}),r===void 0?null:(0,M.jsx)(`button`,{type:`button`,onClick:()=>i(void 0),children:n(`executionTrace.firstPage`)}),a===void 0?null:(0,M.jsx)(xB,{locator:e,selector:a,select:o})]})}function CB({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`niceeval-kpi`,children:[(0,M.jsx)(`span`,{className:`niceeval-kpi-label`,children:e}),(0,M.jsx)(`span`,{className:`niceeval-kpi-value`,children:t})]})}function wB({locator:e,data:t,locale:n}){let{t:r}=Fo(),i=t.verdict===`passed`&&t.totalScore!==void 0,a=`${t.adapter.name} · ${t.adapter.contract} · ${t.adapter.behaviorRevision===null?r(`attempt.adapterRevisionNotDeclared`):t.adapter.behaviorRevision}`;return(0,M.jsxs)(`div`,{className:`niceeval-attempt-summary`,children:[(0,M.jsxs)(`div`,{className:`niceeval-attempt-summary-head`,children:[(0,M.jsx)(`span`,{className:`niceeval-verdict-pill niceeval-verdict-${t.verdict}`,children:r(i?`attempt.scoreCompleted`:`attempt.verdict.${t.verdict}`)}),(0,M.jsx)(`span`,{className:`niceeval-attempt-summary-locator`,children:e})]}),(0,M.jsxs)(`div`,{className:`niceeval-grid niceeval-attempt-summary-kpis`,children:[(0,M.jsx)(CB,{label:r(`attempt.experiment`),value:t.experimentId}),(0,M.jsx)(CB,{label:r(`attempt.adapter`),value:a}),(0,M.jsx)(CB,{label:r(`attempt.eval`),value:t.identity.evalId}),(0,M.jsx)(CB,{label:r(`attempt.title`),value:t.identity.attempt.state===`available`?String(t.identity.attempt.value+1):`—`}),t.totalScore===void 0?null:(0,M.jsx)(CB,{label:r(`attempt.score`),value:dF(t.totalScore,n)}),t.startedAt===void 0?null:(0,M.jsx)(CB,{label:r(`attempt.started`),value:fF(t.startedAt,n)}),(0,M.jsx)(CB,{label:r(`attempt.duration`),value:t.durationMs.state===`available`?lF(t.durationMs.value):`—`}),t.observedCostUSD===void 0?null:(0,M.jsx)(CB,{label:r(`attempt.cost`),value:pF(t.observedCostUSD)})]})]})}function TB(e,t){let n=WA(t);if(n.kind!==e)throw Error(`Expected ${e} operation.`);return n}function EB({data:e}){if(e===null)return null;let t=[];e.turns!==void 0&&t.push([`turns`,String(e.turns)]),e.toolCalls!==void 0&&t.push([`tool calls`,String(e.toolCalls)]);for(let n of e.observations)n.kind===`token-bucket`?t.push([`${n.provider} ${n.bucket}`,n.tokens.toLocaleString()]):n.kind===`request`?t.push([`${n.provider} ${n.requestKind}`,`1`]):t.push([`${n.provider} cost`,`${n.amount} ${n.currency}`]);return e.observedCostUSD!==void 0&&t.push([`observed cost`,`$${e.observedCostUSD.toFixed(4)}`]),t.length===0?null:(0,M.jsx)(BR,{className:`niceeval-usage-table`,children:t.map(([e,t],n)=>(0,M.jsx)(CB,{label:e,value:t},`${e}:${n}`))})}function DB({usage:e}){let{t}=Fo();if(e.source!==`adapter`)return null;let n=e.totals.costs,r={maxHeight:`24rem`,overflow:`auto`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`};return(0,M.jsxs)(`section`,{"aria-label":t(`usage.external`),children:[(0,M.jsx)(`h3`,{children:t(`usage.external`)}),(0,M.jsxs)(`p`,{children:[e.state,` · `,e.coverage]}),(0,M.jsx)(BR,{children:[[`usage.input`,e.totals.inputTokens],[`usage.output`,e.totals.outputTokens],[`usage.requests`,e.totals.requests]].map(([e,n])=>(0,M.jsx)(CB,{label:t(e),value:`${n.value??`—`} (${n.state})`},e))}),n===void 0||n.values.length===0?(0,M.jsxs)(`p`,{children:[t(`attempt.cost`),`: `,t(`cell.metricUnavailable`)]}):null,n?.values.map(e=>(0,M.jsxs)(`p`,{children:[e.value,` `,e.currency,` · `,t(e.source===`reported`?`cell.costReported`:e.source===`estimated`?`cell.costEstimated`:`cell.costMixed`),` · `,n.state,` · `,t(`usage.coverage`,{covered:e.coveredCalls,total:n.totalCalls})]},e.currency)),(0,M.jsxs)(`details`,{children:[(0,M.jsxs)(`summary`,{children:[t(`usage.calls`),` (`,e.calls?.length??0,`; `,e.omittedCallCount??0,` `,t(`attempt.truncated`),`)`]}),(0,M.jsx)(`pre`,{style:r,children:JSON.stringify(e.calls??[],null,2)})]}),(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:t(`usage.prices`)}),(0,M.jsx)(`pre`,{style:r,children:JSON.stringify(e.priceReceipts??null,null,2)})]}),e.limitations.length===0?null:(0,M.jsx)(`pre`,{style:r,children:JSON.stringify(e.limitations,null,2)})]})}function OB({model:e,locale:t,className:n}){let{t:r}=Fo(),i=NA(),a=e.assertionEntryIds.map(t=>TB(`attempt.assertion.detail`,{kind:`attempt.assertion.detail`,locator:e.locator,entryId:t})),o=[...e.traceItemIds.map(t=>TB(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`item`,itemId:t}})),...e.toolOccurrenceIds.map(t=>TB(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`tool-occurrence`,toolOccurrenceId:t}})),...e.commandIds.map(t=>TB(`attempt.trace.detail`,{kind:`attempt.trace.detail`,locator:e.locator,selector:{kind:`command`,commandId:t}}))],s=cc({queries:a.map(e=>AA(i,e))}),c=cc({queries:o.map(e=>AA(i,e))}),l=PA(UA(e.locator)[1]),u=PA(TB(`attempt.timing`,{kind:`attempt.timing`,locator:e.locator}),{select:t=>qR(t,e.locator)}),d=PA(TB(`attempt.usage`,{kind:`attempt.usage`,locator:e.locator})),f=PA(TB(`attempt.sources`,{kind:`attempt.sources`,locator:e.locator})),p=PA(TB(`attempt.diff`,{kind:`attempt.diff`,locator:e.locator}),{select:XR}),m=[...s,...c,l,u,d,f,p];if(m.some(e=>e.isPending))return(0,M.jsx)(`p`,{role:`status`,children:r(`report.loadingDetails`)});if(m.some(e=>e.isError))return(0,M.jsxs)(`div`,{role:`alert`,children:[(0,M.jsx)(`p`,{children:r(`report.unableToLoadDetails`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>{for(let e of m)e.isError&&e.refetch()},children:r(`report.retry`)})]});let h=s.map(e=>e.data),g=c.map(e=>e.data),_=l.data,v=UR(h),y=WR(_,g,e.locator),b=GR(_,g,e.locator),x=KR(_),S=yB(pB(vB(YR(f.data,_,e.locator)),vB(v)),vB(y)),C=[...hB(vB(x)),..._B(`Assertions`,v),..._B(`Source`,YR(f.data,_,e.locator)),..._B(`Execution timeline`,u.data),..._B(`Usage`,JR(d.data,_)),..._B(`Conversation`,y),..._B(`Commands`,b),..._B(`Diagnostics`,x),..._B(`File changes`,p.data)];return(0,M.jsxs)(zR,{className:rF(`niceeval-report`,n),children:[(0,M.jsx)(wB,{locator:e.locator,data:e.summary,locale:t}),(0,M.jsx)(NF,{items:C,locale:t}),S.source===null?(0,M.jsx)(HR,{data:uB(vB(v)),locale:t}):(0,M.jsx)(mR,{data:S.source,locale:t}),(0,M.jsx)(RR,{nodes:vB(u.data),title:{en:`Execution timeline`,"zh-CN":`执行时间轴`},locale:t}),(0,M.jsx)(EB,{data:vB(JR(d.data,_))}),(0,M.jsx)(DB,{usage:d.data.usage}),(0,M.jsx)(SB,{locator:e.locator,initial:_.trace.execution},e.locator),S.conversation===null?vB(y)===null&&_.trace.execution.state===`not-recorded`?(0,M.jsx)(NF,{items:mB,locale:t}):null:(0,M.jsx)($L,{data:S.conversation,locale:t}),(0,M.jsx)($F,{data:vB(b),locale:t}),(0,M.jsx)(yI,{files:vB(p.data),locale:t})]})}function kB({locator:e,onClose:t}){let{data:n}=dc(JA(NA(),e)),{i18n:r,t:i}=Fo(),a=r.resolvedLanguage===`zh-CN`?`zh-CN`:`en`;return(0,M.jsx)(tF,{title:i(`attempt.title`),onClose:t,children:(0,M.jsx)(OB,{model:n,locale:a})})}function AB(e,t){if(typeof e==`string`)return e;let n=e[t];if(n!==void 0&&n!==``)return n;let r=e.en;if(r!==void 0&&r!==``)return r;for(let t of Object.keys(e).sort()){let n=e[t];if(n!==void 0&&n!==``)return n}throw Error(`LocalizedText object has no non-empty value. Provide at least one locale entry, e.g. { en: "…" }.`)}function jB(e,t,n){return Ro.getFixedT(e)(t,n)}function MB(e){return Object.freeze({en:jB(`en`,e),"zh-CN":jB(`zh-CN`,e)})}function NB(e,t,n){return jB(e,t,{n})}function PB(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function FB(e){return e>=1e9?`${PB(e/1e9)}B`:e>=1e6?`${PB(e/1e6)}M`:e>=1e3?`${PB(e/1e3)}k`:Number.isInteger(e)?String(e):PB(e)}function IB(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${PB(e/1e3)}s`;let t=Math.round(e/1e3);return`${Math.floor(t/60)}m ${t%60}s`}function LB(e){return e>=1e3?FB(e):e>=.01||e===0?e.toFixed(2):String(e)}function RB(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(t===`%`)return`${n}${PB(Math.round(r*1e3)/10)}%`;if(t===`ms`)return n+IB(r);if(t===`$`||t===`USD`)return`${n}$${LB(r)}`;let i=FB(r);return t?`${n}${i} ${t}`:`${n}${i}`}function zB(e,t){switch(typeof e==`string`?e:e&&`kind`in e?e.kind:void 0){case`percent`:case`ratio`:return`%`;case`usd`:case`currency`:case`currency-usd`:return`$`;case`duration`:case`duration-ms`:case`milliseconds`:return`ms`;case`number`:case`count`:case`integer`:return;default:return t}}function BB(e,t,n,r=`en`){return e===null?UB(`noSamples`,r):n&&typeof n==`object`&&n.kind===`custom`&&`format`in n&&typeof n.format==`function`?n.format(e,r):RB(e,zB(n,t))}function VB(e,t=`en`){switch(e){case`available`:case`partial`:case`empty`:return UB(`noSamples`,t);case`failed`:return jB(t,`cell.metricFailed`);case`unavailable`:return jB(t,`cell.metricUnavailable`);case`unsupported`:return jB(t,`cell.metricUnsupported`);case`migration-required`:return jB(t,`cell.metricMigrationRequired`)}}var HB={noSamples:`cell.missing`,unscorable:`cell.unscorable`,noCurrentResult:`cell.noCurrentResult`,mixedExecution:`cell.mixedExecution`};function UB(e,t=`en`){let n=HB[e];return n?jB(t,n):e}function WB(e){return(e<0?`-`:``)+PB(Math.round(Math.abs(e)*10)/10)}function GB(e){switch(e){case`passed`:return`✓`;case`failed`:return`✗`;case`errored`:return`!`;case`skipped`:return`–`}}function KB(e){let t=e.projection;if(typeof t!=`object`||!t)return;let n=t;if(n.state===`available`||n.state===`partial`||n.state===`unavailable`||n.state===`migration-required`){if(n.combined===null)return{state:n.state,combined:null};if(typeof n.combined==`object`&&typeof n.combined.amount==`string`)return{state:n.state,combined:{amount:n.combined.amount}}}}function qB(e,t,n=!1){let r=KB(e.metric),i=r?.combined!==null&&r?.combined!==void 0?`$${r.combined.amount}`:e.metric.value===null?VB(e.metric.state,t):`${e.metric.source===`estimated`?`~`:``}${BB(e.metric.value,e.metric.unit,e.metric.format,t)}`;return e.showCoverage===!1?i:n&&e.metric.value!==null&&e.metric.samples<e.metric.total?`${i}\n ${jB(t,`cell.coverageDetail`,{samples:e.metric.samples,total:e.metric.total})}`:`${i} · ${e.metric.state}`}function JB(e,t){if(e==null)return`—`;switch(e.kind){case`stack`:{let n=t??`en`,r=e.cells.map((e,r)=>r===0&&e.kind===`metric`?qB(e,n,!0):JB(e,t)).filter(e=>e!==`—`);if(r.length===0)return`—`;let i=[],a=[];for(let e of r){let[t,...n]=e.split(`
62
- `);t&&i.push(t),a.push(...n.map(e=>e.trimStart()).filter(Boolean))}let o=a.length>0?`\n${a.map(e=>` ${e}`).join(`
63
- `)}`:``;return`${i.join(` · `)}${o}`}case`notApplicable`:return`—`;case`missing`:{let n=t??`en`,r=UB(e.code,n);return e.detail?`${r} · ${e.detail}`:r}case`text`:return e.detail?`${e.text}\n ${e.detail}`:e.text;case`locator`:return`${e.verdict===void 0?``:`${GB(e.verdict)} `}${e.locator}`;case`summary`:{let t=e.more&&e.more>0?` +${e.more} more`:``;return`${e.text}${t}`}case`score`:{let n=WB(e.earned),r=e.possible===void 0?n:`${n} / ${WB(e.possible)}`;return e.missedScoreItems===void 0?r:`${r} · ${NB(t??`en`,`experimentList.missedScoreItems`,e.missedScoreItems)}`}case`verdict`:{let n=t??`en`;return e.counts?[`passed`,`failed`,`errored`,`skipped`].filter(t=>e.counts[t]>0).map(t=>`${e.counts[t]} ${jB(n,`verdict.${t}`)}`).join(` · `)||`—`:e.verdict===void 0?`—`:e.bare?GB(e.verdict):`${GB(e.verdict)} ${e.label===void 0?jB(n,`verdict.${e.verdict}`):AB(e.label,n)}`}case`metric`:return qB(e,t??`en`)}}function YB(...e){return e.filter(Boolean).join(` `)}var XB=`—`;function ZB(e){return`#/attempt/${e.startsWith(`@`)?e.slice(1):e}`}function QB(e){return $B(e.columns.map(e=>({key:e.key,header:e.header??e.key,align:e.better?`right`:`left`,better:e.better})),e)}function $B(e,t){if(e.length===0)throw Error(`Table needs at least one column.`);let n=new Set;for(let t of e){if(n.has(t.key))throw Error(`Table column key "${t.key}" is declared twice.`);n.add(t.key)}return tV(t.rows),eV(t.rows,n),{columns:e,content:t}}function eV(e,t){for(let n of e){for(let e of Object.keys(n.cells))if(!t.has(e))throw Error(`Table row "${n.key}" has a cell for "${e}", which is not a declared column.`);for(let e of t)if(!(e in n.cells))throw Error(`Table row "${n.key}" has no cell for column "${e}".`);n.subRows?.length&&eV(n.subRows,t)}}function tV(e){let t=new Set;for(let n of e){if(t.has(n.key))throw Error(`Table row key "${n.key}" is declared twice at the same level.`);t.add(n.key),n.subRows?.length&&tV(n.subRows)}}function nV(e){return e.refs.flatMap(e=>e.identity.kind===`attempt`?[e.identity.locator]:[])}function rV({cell:e,href:t,locale:n,showCoverage:r=!0,coverageDetail:i=!1}){let a=n??`en`,o=KB(e);if(o!==void 0){let t=o.combined===null?VB(e.state,a):`$${o.combined.amount}`;return(0,M.jsx)(`span`,{className:`niceeval-cell`,children:(0,M.jsx)(`span`,{className:`niceeval-value`,children:t})})}let s=e.value===null?VB(e.state,a):`${e.source===`estimated`?`~`:``}${BB(e.value,e.unit,e.format,a)}`;if(e.value===null)return(0,M.jsx)(`span`,{className:`niceeval-cell niceeval-cell-missing`,children:(0,M.jsx)(`span`,{className:`niceeval-missing`,title:jB(a,`cell.noneMeasurableTitle`,{total:e.total}),children:s})});let c=nV(e),l=e.samples<e.total,u=e.state===`partial`||r&&l,d=l?jB(a,`cell.coverageTitle`,{samples:e.samples,total:e.total}):jB(a,`cell.partialTitle`),f=l?jB(a,`cell.coverageDetail`,{samples:e.samples,total:e.total}):jB(a,`cell.partialDetail`);return(0,M.jsxs)(`span`,{className:YB(`niceeval-cell`,u&&i&&`niceeval-cell-text`),children:[(0,M.jsx)(`span`,{className:`niceeval-value`,title:jB(a,`cell.measuredTitle`,{samples:e.samples,total:e.total}),children:s}),u&&(i?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,title:d,children:f}):(0,M.jsx)(`sup`,{className:`niceeval-coverage`,title:d,children:l?`${e.samples}/${e.total}`:jB(a,`cell.partialDetail`)})),e.source==null?null:(0,M.jsx)(`small`,{className:`niceeval-cost-source`,children:jB(a,e.source===`reported`?`cell.costReported`:e.source===`estimated`?`cell.costEstimated`:`cell.costMixed`)}),t&&c.length===1&&t(c[0])!==void 0&&(0,M.jsx)(`span`,{className:`niceeval-refs`,children:(0,M.jsx)(`a`,{className:`niceeval-ref`,href:t(c[0]),children:`#1`})}),t&&c.length>1&&(0,M.jsxs)(`details`,{className:`niceeval-refs`,children:[(0,M.jsx)(`summary`,{className:`niceeval-refs-summary`,children:NB(a,`cell.evidence`,c.length)}),(0,M.jsx)(`span`,{className:`niceeval-refs-list`,children:c.map((e,n)=>t(e)===void 0?(0,M.jsxs)(`span`,{className:`niceeval-ref-text`,children:[`#`,n+1]},e):(0,M.jsxs)(`a`,{className:`niceeval-ref`,href:t(e),children:[`#`,n+1]},e))})]})]})}function iV(e,t,n=!1){if(!e)return(0,M.jsx)(`span`,{className:`niceeval-missing`,children:XB});switch(e.kind){case`stack`:return(0,M.jsx)(`span`,{className:`niceeval-cell-stack`,children:e.cells.map((e,n)=>(0,M.jsx)(`span`,{className:`niceeval-cell-stack-item`,children:iV(e,t,n===0)},n))});case`notApplicable`:return(0,M.jsx)(`span`,{className:`niceeval-missing`,children:XB});case`missing`:return(0,M.jsxs)(`span`,{className:`niceeval-missing`,children:[(0,M.jsx)(`span`,{className:`niceeval-missing-reason`,children:UB(e.code,t.locale)}),e.detail?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,children:e.detail}):null]});case`text`:return(0,M.jsxs)(`span`,{className:`niceeval-cell-text`,children:[(0,M.jsx)(`span`,{children:e.text}),e.detail?(0,M.jsx)(`small`,{className:`niceeval-cell-detail`,children:e.detail}):null]});case`locator`:{let n=e.verdict,r=YB(`niceeval-locator`,n!==void 0&&`niceeval-verdict-${n}`),i=n===void 0?null:(0,M.jsx)(`span`,{className:`niceeval-locator-mark`,"aria-hidden":`true`,children:GB(n)}),a=t.href(e.locator);return a===void 0?(0,M.jsxs)(`span`,{className:r,children:[i,e.locator]}):(0,M.jsxs)(`a`,{className:r,href:a,children:[i,e.locator]})}case`summary`:case`score`:return JB(e,t.locale);case`verdict`:{if(e.counts){let n=[`passed`,`failed`,`errored`,`skipped`].filter(t=>e.counts[t]>0);return(0,M.jsxs)(`span`,{className:`niceeval-verdict-tally`,children:[n.map(n=>(0,M.jsxs)(`span`,{className:`niceeval-verdict-${n}`,children:[e.counts[n],` `,jB(t.locale,`verdict.${n}`)]},n)),n.length===0?(0,M.jsx)(`span`,{className:`niceeval-missing`,children:XB}):null]})}let n=e.verdict??`skipped`;return(0,M.jsxs)(`span`,{className:YB(`niceeval-verdict`,`niceeval-verdict-${n}`),children:[GB(n),e.bare?null:(0,M.jsxs)(M.Fragment,{children:[` `,e.label===void 0?jB(t.locale,`verdict.${n}`):AB(e.label,t.locale)]})]})}case`metric`:return(0,M.jsx)(rV,{cell:e.metric,href:t.showMeasureRefs===!1?void 0:t.href,locale:t.locale,showCoverage:e.showCoverage!==!1,coverageDetail:n})}}function aV(e){return e?e.kind===`stack`?aV(e.cells[0]):e.kind===`metric`?e.metric.value??``:e.kind===`score`?e.earned:e.kind===`text`?e.text:e.kind===`locator`?e.locator:e.kind===`verdict`&&e.counts?e.counts.passed:JB(e):``}function oV(e,t,n,r=0){return e.map(e=>{let i=t.map(t=>(0,M.jsx)(`span`,{className:YB(`niceeval-table-hierarchy-cell`,t.align===`right`&&`niceeval-align-right`),"data-sort-value":aV(e.cells[t.key]),children:iV(e.cells[t.key],n)},t.key)),a=YB(`niceeval-table-hierarchy-row`,e.variant===`placeholder`&&`niceeval-row-placeholder`,e.variant===`group`&&`niceeval-row-group`);return e.subRows?.length?(0,M.jsxs)(`details`,{className:YB(a,`niceeval-table-hierarchy-group`),"data-depth":r||void 0,children:[(0,M.jsx)(`summary`,{className:`niceeval-table-hierarchy-summary`,children:i}),(0,M.jsx)(`div`,{className:`niceeval-table-hierarchy-children`,children:oV(e.subRows,t,n,r+1)})]},e.key):(0,M.jsx)(`div`,{className:a,"data-depth":r||void 0,children:i},e.key)})}function sV(e,t,n){return e.map(e=>(0,M.jsx)(`tr`,{className:YB(e.variant===`placeholder`&&`niceeval-row-placeholder`,e.variant===`group`&&`niceeval-row-group`),children:t.map(t=>(0,M.jsx)(`td`,{className:t.align===`right`?`niceeval-align-right`:void 0,children:iV(e.cells[t.key],n)},t.key))},e.key))}function cV(e){let t=e.locale??`en`,{columns:n,content:r}=QB(e.data),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(e.sort===void 0?null:{key:e.sort,direction:`asc`}),c=(0,v.useMemo)(()=>{let e=i.trim().toLocaleLowerCase(),n=r=>{let i=r.subRows?.map(n).filter(e=>e!==null);return e===``||Object.values(r.cells).some(n=>JB(n,t).toLocaleLowerCase().includes(e))||(i?.length??0)>0?{...r,...i===void 0?{}:{subRows:i}}:null},a=r.rows.map(n).filter(e=>e!==null);if(o===null)return a;let s=o.direction===`asc`?1:-1;return[...a].sort((e,n)=>JB(e.cells[o.key],t).localeCompare(JB(n.cells[o.key],t),t,{numeric:!0})*s)},[r.rows,t,i,o]),l=e.hrefForLocator??ZB,u=r.rows.some(e=>(e.subRows?.length??0)>0),d=(0,M.jsxs)(`table`,{className:YB(`niceeval-report`,`niceeval-table`,u&&`niceeval-table--hierarchical`,e.className),"data-column-count":u?n.length:void 0,children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:n.map(e=>(0,M.jsx)(`th`,{scope:`col`,className:YB(e.align===`right`&&`niceeval-align-right`,o?.key===e.key?o.direction===`asc`?`niceeval-sort-asc`:`niceeval-sort-desc`:void 0),onClick:e.better===void 0?void 0:()=>s(t=>({key:e.key,direction:t?.key===e.key&&t.direction===`asc`?`desc`:`asc`})),tabIndex:e.better===void 0?void 0:0,onKeyDown:e.better===void 0?void 0:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},children:AB(e.header,t)},e.key))})}),u?(0,M.jsx)(`tbody`,{children:(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:n.length,className:`niceeval-table-hierarchy-body`,children:oV(c,n,{href:l,locale:t,showMeasureRefs:!1})})})}):(0,M.jsx)(`tbody`,{children:sV(c,n,{href:l,locale:t})})]});return e.searchable===!0?(0,M.jsxs)(`div`,{className:`niceeval-report niceeval-table-wrap`,children:[(0,M.jsx)(`input`,{className:`niceeval-filter`,type:`search`,value:i,onChange:e=>a(e.target.value),placeholder:jB(t,n[0].key===`entity`?`experimentList.filterPlaceholder`:`table.filterPlaceholder`)}),d]}):d}function lV(e,t){if(!t)return e;let n=`${t}/`;return e.startsWith(n)?e.slice(n.length):e}function uV(e,t){return e?`${e}/${t}`:t}function dV(e){return fV(e,``)}function fV(e,t){if(e.length===0)return[];let n=[],r=new Map;for(let i of e){let e=lV(i,t).split(`/`).filter(Boolean);if(e.length<=1){n.push(i);continue}let a=e[0],o=r.get(a);o?o.push(i):r.set(a,[i])}if(r.size===0||r.size===1&&n.length===0||[...r.values()].every(e=>e.length===1)){if(r.size===1&&n.length===0){let n=[...r.keys()][0];return fV(e,uV(t,n))}return[...n].sort((e,t)=>e.localeCompare(t)).map(e=>({kind:`leaf`,evalId:e}))}let i=[...r.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,n])=>({kind:`group`,segment:e,prefix:uV(t,e),children:fV(n,uV(t,e))})),a=[...n].sort((e,t)=>e.localeCompare(t)).map(e=>({kind:`leaf`,evalId:e}));return[...i,...a]}function pV(e){return e.some(e=>e.evaluationKind!==`pass`)?e.some(e=>e.evaluationKind!==`points`)?`mixed`:`points`:`pass`}function mV(e){let t=pV(e);return[...e].sort(hV(e=>t===`pass`?e.endToEndPassRate?.value??null:e.score?.value??null))}function hV(e){return(t,n)=>{let r=e(t),i=e(n);return r===null&&i===null?t.experimentId.localeCompare(n.experimentId):r===null?1:i===null?-1:i-r||t.experimentId.localeCompare(n.experimentId)}}var gV=`noCurrentResult`,_V=`noSamples`,vV={entity:MB(`experimentList.experiment`),model:MB(`table.model`),adapter:MB(`table.adapter`),durationMs:MB(`experimentList.avgDuration`),passRate:MB(`experimentList.passRate`),totalScore:MB(`experimentList.totalScore`),tokens:MB(`experimentList.tokens`),costUSD:MB(`experimentList.cost`),record:MB(`experimentList.result`),verdict:MB(`experimentList.status`),result:MB(`experimentList.result`)};function yV(e,t){let n={};for(let r of t)n[r.key]=e[r.key]??{kind:`notApplicable`};return n}function bV(e,t=e.state!==`available`){return{kind:`metric`,metric:e,showCoverage:t}}function xV(...e){let t=e.filter(e=>e.kind!==`notApplicable`);return t.length===0?{kind:`notApplicable`}:t.length===1?t[0]:{kind:`stack`,cells:t}}function SV(e){let t={passed:0,failed:0,errored:0,skipped:0};for(let n of e)n.verdict!==null&&(t[n.verdict]+=1);return t}function CV(e){return{kind:`verdict`,counts:SV(e)}}function wV(e){let t=SV(e);return t.failed+t.errored+t.skipped===0?{kind:`notApplicable`}:{kind:`verdict`,counts:{...t,passed:0}}}function TV(e){let t=e.length===1?e[0]:void 0;return t===void 0?CV(e):EV(t)}function EV(e){let{verdict:t}=e;return t===null?{kind:`notApplicable`}:{kind:`verdict`,verdict:t,...t===`passed`&&e.evaluationKind===`points`&&e.score?.state===`available`&&e.score.value!==null?{label:MB(`verdict.scored`)}:{}}}function DV(e){return{kind:`locator`,locator:e.locator,...e.verdict===null?{}:{verdict:e.verdict}}}function OV(e,t){return t?{kind:`text`,text:e,detail:t}:{kind:`text`,text:e}}function kV(e){return e.failureSummary===null?{kind:`text`,text:`—`}:{kind:`summary`,text:e.failureSummary}}function AV(e){return{entity:DV(e),verdict:EV(e),result:kV(e),...e.durationMs===void 0?{}:{durationMs:bV(e.durationMs)},...e.tokens===void 0?{}:{tokens:bV(e.tokens)},...e.score===void 0?{}:{totalScore:bV(e.score)},...e.costUSD===void 0?{}:{costUSD:bV(e.costUSD)}}}var jV=[{key:`entity`,header:vV.entity},{key:`model`,header:vV.model},{key:`adapter`,header:vV.adapter},{key:`durationMs`,better:`lower`,header:vV.durationMs}],MV=[{key:`tokens`,better:`lower`,header:vV.tokens},{key:`summary`,better:`higher`,header:vV.result}];function NV(){return[...jV,...MV]}var PV={key:`costUSD`,better:`lower`,header:vV.costUSD};vV.entity,vV.verdict,vV.result,vV.durationMs;function FV(e,t){if(!t)return e;let n=e.findIndex(e=>e.key===`summary`);return n<0?[...e,PV]:[...e.slice(0,n),PV,...e.slice(n)]}function IV(e,t){return OV(`${e} (${t})`)}function LV(e,t){return t>e?`${e}/${t} evals`:`${e} evals`}function RV(e,t){let n=e?.[t];return n===void 0?{kind:`notApplicable`}:bV(n)}function zV(e,t,n,r){let i={entity:OV(n),summary:{kind:`missing`,code:gV,detail:`niceeval exp ${e}`}};return{key:`${e}:${t}:missing`,variant:`placeholder`,cells:yV(i,r)}}function BV(e,t){return{key:e.locator,cells:yV(AV(e),t)}}function VV(e,t,n){let r={entity:OV(t),...e.durationMs===void 0?{}:{durationMs:bV(e.durationMs)},...e.tokens===void 0?{}:{tokens:bV(e.tokens)},summary:e.evaluationKind===`pass`?e.attempts.length===1?TV(e.attempts):xV(e.endToEndPassRate===void 0?{kind:`notApplicable`}:bV(e.endToEndPassRate),CV(e.attempts)):xV(e.score===void 0?{kind:`notApplicable`}:bV(e.score),wV(e.attempts)),...e.costUSD===void 0?{}:{costUSD:bV(e.costUSD)}};return{key:e.evalId,cells:yV(r,n.columns),subRows:e.attempts.map(e=>BV(e,n.columns))}}function HV(e,t){let n=lV(e.evalId,t.labelPrefix),r=t.item.evalRows.find(t=>t.evalId===e.evalId);return r===void 0?zV(t.item.experimentId,e.evalId,n,t.columns):VV(r,n,t)}function UV(e,t){let n=new Set,r=e=>{for(let t of e)t.kind===`leaf`?n.add(t.evalId):r(t.children)};return r([e]),t.filter(e=>n.has(e.evalId)).flatMap(e=>e.attempts)}function WV(e,t,n){let r=new Set,i=e=>{for(let t of e)t.kind===`leaf`?r.add(t.evalId):i(t.children)};i([e]);let a=t.evalRows.filter(e=>r.has(e.evalId)),o=r.size,s=a.length,c=t.groupMetrics.get(e.prefix),l=UV(e,t.evalRows),u=s===0?{kind:`missing`,code:_V}:CV(l),d=a.every(e=>e.evaluationKind===`pass`),f=d?RV(c,`passRate`):RV(c,`score`),p={entity:IV(e.segment,LV(s,o)),durationMs:RV(c,`durationMs`),tokens:RV(c,`tokens`),...c?.costUSD===void 0?{}:{costUSD:bV(c.costUSD)},summary:xV(f,d?u:wV(l))};return{key:`group:${e.prefix}`,variant:`group`,cells:yV(p,n.columns),subRows:GV(e.children,{...n,labelPrefix:e.prefix})}}function GV(e,t){let n=e.filter(e=>e.kind===`group`).slice().sort((e,n)=>{let r=KV(e,t.item),i=KV(n,t.item);return r===null&&i===null?e.segment.localeCompare(n.segment):r===null?1:i===null?-1:i-r||e.segment.localeCompare(n.segment)}),r=e.filter(e=>e.kind===`leaf`);return[...n.map(e=>WV(e,t.item,t)),...r.map(e=>HV(e,t))]}function KV(e,t){let n=`${e.prefix}/`,r=t.evalRows.some(e=>e.evalId.startsWith(n)&&e.evaluationKind!==`pass`),i=t.groupMetrics.get(e.prefix);return(r?i?.score:i?.passRate)?.value??null}function qV(e,t){let n=new Set(e.evalRows.map(e=>e.evalId)),r=dV([...new Set([...n,...e.missingEvalIds])]),i=e.evalRows.flatMap(e=>e.attempts),a=e.evaluationKind===`pass`?e.endToEndPassRate===void 0?{kind:`notApplicable`}:bV(e.endToEndPassRate,!1):e.score===void 0?{kind:`notApplicable`}:bV(e.score),o=e.evalRows.length,s=o+e.missingEvalIds.length,c={entity:IV(e.experimentId,`${o}/${s}`),model:JV(e.model),adapter:YV(e.adapter),...e.durationMs===void 0?{}:{durationMs:bV(e.durationMs,!1)},...e.tokens===void 0?{}:{tokens:bV(e.tokens,!1)},...e.costUSD===void 0?{}:{costUSD:bV(e.costUSD,!1)},summary:xV(a,e.evaluationKind===`pass`?CV(i):wV(i))};return{key:e.experimentId,cells:yV(c,t.columns),subRows:r.length>0?GV(r,t):[]}}function JV(e){return e.state===`available`?OV(e.value):e.state===`mixed`?{kind:`missing`,code:`mixedExecution`}:{kind:`notApplicable`}}function YV(e){if(e.state===`mixed`)return{kind:`missing`,code:`mixedExecution`};let t=e.value;return OV(t.name,`${t.contract} · ${t.behaviorRevision??`—`}`)}function XV(e){let t=FV(NV(),e.some(e=>e.costUSD!==void 0));return{columns:t,rows:e.map(e=>qV(e,{columns:t,item:e,labelPrefix:``}))}}var ZV=(0,v.lazy)(()=>w(()=>import(`./quality-cost-scatter-CFB3wnkN.js`),[]));function QV({data:e,locale:t}){let{t:n}=Fo(),r=mV(e.experiments),i=pV(r)===`pass`?`pass`:`points`;return(0,M.jsxs)(`section`,{className:`niceeval-report niceeval-section`,children:[(0,M.jsx)(`h2`,{className:`niceeval-section-title`,children:AB(e.selectionTitle,t)}),(0,M.jsx)(`div`,{className:`niceeval-quality-cost-comparison`,children:(0,M.jsx)(v.Suspense,{fallback:(0,M.jsx)(`p`,{role:`status`,children:n(`report.loading`)}),children:(0,M.jsx)(ZV,{items:r,kind:i,locale:t})})}),(0,M.jsx)(cV,{data:XV(r),sort:`summary`,searchable:!0,locale:t})]})}function $V({model:e,locale:t}){let{t:n}=Fo();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`header`,{className:`niceeval-report niceeval-hero`,children:(0,M.jsx)(`h1`,{className:`niceeval-hero-title`,children:n(`insight.title`)})}),(0,M.jsx)(`div`,{className:`niceeval-view-report-slot`,children:(0,M.jsx)(QV,{data:{selectionTitle:e.selectionTitle,experiments:$A(e.overview,e.selectedExperiments)},locale:t})})]})}function eH({target:e}){return e.kind===`group`?(0,M.jsx)(tH,{groupKind:e.groupKind,groupKey:e.key}):(0,M.jsx)(nH,{experimentId:e.experimentId})}function tH({groupKind:e,groupKey:t}){let n=NA(),r=n.snapshot,{data:i}=dc(YA(n,r.manifest,r.overview,e,t));return(0,M.jsx)(rH,{model:i})}function nH({experimentId:e}){let t=NA(),n=t.snapshot,{data:r}=dc(XA(t,n.overview,e));return(0,M.jsx)(rH,{model:r})}function rH({model:e}){let{i18n:t}=Fo(),n=t.resolvedLanguage??`en`;return(0,M.jsx)($V,{model:e,locale:n})}function iH({model:e,locale:t}){let n=e.members.map(t=>{let n={experiment:{kind:`text`,text:e.experimentId},adapter:e.adapter===null?{kind:`notApplicable`}:{kind:`text`,text:e.adapter.name,detail:`${e.adapter.contract} · ${e.adapter.behaviorRevision??`—`}`},eval:{kind:`text`,text:t.evalId},attempt:{kind:`text`,text:String(t.attemptOrdinal+1)},membership:{kind:`text`,text:t.state},outcome:oH(t.outcome),verdict:t.verdict===null?{kind:`notApplicable`}:{kind:`verdict`,verdict:t.verdict,...t.verdict===`passed`&&t.score?.state===`complete`?{label:MB(`verdict.scored`)}:{}},locator:t.locator===null?{kind:`notApplicable`}:{kind:`locator`,locator:t.locator,...t.verdict===null?{}:{verdict:t.verdict}},selectedRun:{kind:`text`,text:e.runId},slot:{kind:`text`,text:t.slotId}};return Object.freeze({key:t.key,cells:Object.freeze(n)})}),r=Object.freeze({columns:Object.freeze([{key:`experiment`,header:{en:`Experiment`,"zh-CN":`实验`}},{key:`adapter`,header:{en:`Adapter`,"zh-CN":`应用`}},{key:`eval`,header:{en:`Eval`,"zh-CN":`评估`}},{key:`attempt`,header:{en:`Attempt`,"zh-CN":`尝试`}},{key:`membership`,header:{en:`Membership`,"zh-CN":`成员关系`}},{key:`outcome`,header:{en:`Outcome`,"zh-CN":`执行结果`}},{key:`verdict`,header:{en:`Verdict`,"zh-CN":`判定`}},{key:`locator`,header:{en:`Attempt locator`,"zh-CN":`Attempt 定位符`}},{key:`selectedRun`,header:{en:`Selected run`,"zh-CN":`所选 Run`}},{key:`slot`,header:{en:`Slot`,"zh-CN":`槽位`}}]),rows:Object.freeze(n)});return(0,M.jsxs)(`section`,{className:`niceeval-report niceeval-section`,children:[(0,M.jsx)(`h2`,{className:`niceeval-section-title`,children:t===`zh-CN`?`Run 成员 · ${e.runId}`:`Run membership · ${e.runId}`}),(0,M.jsx)(cV,{data:r,searchable:!0,locale:t})]})}function aH({runId:e,presentation:t,onClose:n}){let{data:r}=dc(aj(NA(),e)),{i18n:i}=Fo(),a=i.resolvedLanguage===`zh-CN`?`zh-CN`:`en`,o=(0,M.jsx)(iH,{model:r,locale:a});if(t===`page`)return o;if(n===void 0)throw Error(`Run dialog close target is missing.`);return(0,M.jsx)(tF,{title:a===`zh-CN`?`运行`:`Run`,onClose:n,children:o})}function oH(e){return typeof e==`string`&&e.length>0?{kind:`text`,text:e}:{kind:`notApplicable`}}function sH(e){let t=e.indexOf(`/`);if(t===-1)return Object.freeze({kind:`singleton`,experimentId:e,key:`singleton/${e}`});let n=e.slice(0,t);return Object.freeze({kind:`named`,groupId:n,key:`named/${n}`})}function cH(e,t=[]){let n=new Map;for(let t of[...new Set(e.experiments)].sort(xH)){let e=sH(t),r=n.get(e.key)??{identity:e,members:[]};r.members.push(t),n.set(e.key,r)}let r=Object.freeze([...n.values()].sort((e,t)=>xH(e.identity.key,t.identity.key)).map(({identity:e,members:t})=>Object.freeze({identity:e,members:Object.freeze(t),route:lH(e),label:e.key}))),i=t.map(t=>e.runExperiments.find(e=>e.runId===t)?.experimentId).find(e=>e!==void 0),a=i===void 0?r[0]:r.find(({members:e})=>e.includes(i))??r[0],o=a?.route??`/`,s=r.map(e=>bH({pageId:`group:${e.identity.key}`,route:e.route,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!1,target:e.identity.kind===`named`?{kind:`group`,groupKind:`named`,key:e.identity.groupId}:{kind:`group`,groupKind:`singleton`,key:e.identity.experimentId}}));for(let{experimentId:t}of e.experiments.map(e=>({experimentId:e})))s.push(bH({pageId:`experiment:${t}`,route:`/experiment/${encodeURIComponent(t)}`,title:{en:`Experiment`,"zh-CN":`实验`},navigation:!1,target:{kind:`experiment`,experimentId:t}}));for(let{runId:t}of yH(e.runExperiments,({runId:e})=>e))s.push(bH({pageId:`run:${t}`,route:`/run/${encodeURIComponent(t)}`,title:{en:`Run`,"zh-CN":`运行`},navigation:!1,target:{kind:`run`,runId:t}}));for(let{locator:t}of yH(e.attemptExperiments,({locator:e})=>e))s.push(bH({pageId:`attempt:${t}`,route:`/attempt/${uH(t)}`,title:{en:`Attempt`,"zh-CN":`尝试`},navigation:!1,target:{kind:`attempt`,locator:t}}));return s.unshift(bH({pageId:`overview`,route:`/`,title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},navigation:!0,target:a===void 0?{kind:`group`,groupKind:`singleton`,key:``}:a.identity.kind===`named`?{kind:`group`,groupKind:`named`,key:a.identity.groupId}:{kind:`group`,groupKind:`singleton`,key:a.identity.experimentId}})),Object.freeze({title:{en:`NiceEval Insight`,"zh-CN":`NiceEval Insight`},defaultRoute:o,experimentSelection:{options:r.map(({route:e,label:t})=>Object.freeze({route:e,label:t}))},pages:Object.freeze(s),groups:r})}function lH(e){return e.kind===`named`?`/group/named/${encodeURIComponent(e.groupId)}`:`/group/singleton/${encodeURIComponent(e.experimentId)}`}function uH(e){return encodeURIComponent(e.startsWith(`@`)?e.slice(1):e)}function dH(e,t){if(t===`/`)return e.pages.find(e=>e.route===t)?.target;if(!t.startsWith(`/`))return;let n=t.slice(1).replace(/\/$/u,``).split(`/`);try{return pH(n.map(fH))}catch{return}}function fH(e){return decodeURIComponent(e).replace(/%2F/gu,`/`)}function pH(e){if(e.length===3&&e[0]===`group`&&(e[1]===`named`||e[1]===`singleton`)&&e[2])return{kind:`group`,groupKind:e[1],key:e[2]};if(e.length===2&&e[1]){if(e[0]===`experiment`)return{kind:`experiment`,experimentId:e[1]};if(e[0]===`run`)return{kind:`run`,runId:e[1]};if(e[0]===`attempt`)return{kind:`attempt`,locator:`@${e[1]}`}}}function mH(e,t){let n=t.pathname,r=dH(e,n);if(r===void 0)throw Error(`Insight route target is malformed.`);let i=_H(t,r,`page`);if(r.kind===`group`||r.kind===`experiment`)return{background:i};let a=vH(t.state),o=a?.background===void 0?void 0:gH(e,a.background);if(r.kind===`run`&&o===void 0)return{background:i};if(o!==void 0)return{background:o,foreground:{..._H(t,r,`dialog`),close:{kind:`history`}}};let s=Object.freeze({pathname:e.defaultRoute}),c=dH(e,s.pathname);if(c===void 0)throw Error(`Insight default route target is missing.`);return{background:_H(s,c,`page`),foreground:{..._H(t,r,`dialog`),close:{kind:`replace`,route:e.defaultRoute}}}}function hH(e){return`${e.target.kind}:${e.location.pathname}:${e.location.search??``}`}function gH(e,t){let n=dH(e,t.pathname);if(n!==void 0&&n.kind!==`attempt`)return _H(t,n,`page`)}function _H(e,t,n){return Object.freeze({location:Object.freeze({pathname:e.pathname,...e.search===void 0?{}:{search:e.search}}),target:t,presentation:n})}function vH(e){if(typeof e!=`object`||!e||!(`background`in e))return;let t=e.background;if(typeof t!=`object`||!t||!(`pathname`in t)||typeof t.pathname!=`string`)return;let n=`search`in t&&typeof t.search==`string`?t.search:void 0;return{background:{pathname:t.pathname,...n===void 0?{}:{search:n}}}}function yH(e,t){let n=new Map;for(let r of e)n.set(t(r),r);return[...n.values()]}function bH(e){return Object.freeze(e)}function xH(e,t){return e<t?-1:+(e>t)}function SH({checkForUpdate:e,refresh:t}){let{manifest:n,presentation:r}=NA().snapshot,{acquire:i,interactionLocked:a,recoveryRequired:o}=QP(),{t:s}=Fo();return o?(0,M.jsxs)(`main`,{className:`niceeval-view-main`,role:`alert`,children:[(0,M.jsx)(`h1`,{children:s(`refresh.reloadRequired`)}),(0,M.jsx)(`p`,{children:s(`refresh.reloadRequiredDetail`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),children:s(`refresh.reload`)})]}):(0,M.jsx)(XP,{locked:a,children:(0,M.jsx)(CH,{manifest:n,presentation:r,refresh:()=>t(i),checkForUpdate:e,interactionLocked:a})})}function CH({checkForUpdate:e,interactionLocked:t,manifest:n,presentation:r,refresh:i}){let a=NA(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),{i18n:f,t:p}=Fo(),m=Dr(),h=Ar(),g=uc({queryKey:[`view`,a.identity,`update-available`],queryFn:e,refetchInterval:500,staleTime:0,retry:!1}),_=(0,v.useRef)(void 0);r===void 0?_.current=void 0:(_.current?.generationIdentity!==a.identity||_.current.originLocationKey!==r.originLocationKey)&&(_.current={generationIdentity:a.identity,originLocationKey:r.originLocationKey,consumed:!1}),_.current!==void 0&&m.key!==_.current.originLocationKey&&(_.current.consumed=!0);let y=r!==void 0&&_.current?.consumed===!1?r.plan:mH(n,m),b=f.resolvedLanguage??`en`;(0,v.useEffect)(()=>{document.title=p(`insight.title`)},[p]);let x=n.experimentSelection?.options??[],S=x.find(({route:e})=>m.pathname===e)??x[0],C=(0,v.useCallback)(e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target instanceof Element?e.target.closest(`a[href]`):null;if(t===null||t.target&&t.target!==`_self`||t.hasAttribute(`download`))return;let r=new URL(t.href,document.baseURI);if(r.origin!==window.location.origin||!r.hash.startsWith(`#/`))return;let i=r.hash.slice(1),a=dH(n,i);a!==void 0&&(e.preventDefault(),a.kind===`run`||a.kind===`attempt`?h(i,{state:{background:y.background.location}}):h(i,{state:null}))},[n,h,y.background.location]),w=(0,v.useCallback)(e=>{e.kind===`history`?h(-1):h(e.route,{replace:!0,state:null})},[h]),T=y.foreground;return(0,M.jsxs)(`div`,{onClickCapture:C,children:[(0,M.jsxs)(`header`,{className:`niceeval-view-shell`,children:[(0,M.jsxs)(`a`,{className:`niceeval-view-brand`,href:`https://niceeval.com/?utm_source=insight&utm_medium=brand`,target:`_blank`,rel:`noopener`,children:[(0,M.jsx)(`span`,{className:`niceeval-view-mark`,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:`NiceEval`})]}),(0,M.jsx)(`nav`,{className:`niceeval-view-nav`,"aria-label":p(`nav.pages`),children:(0,M.jsx)(`a`,{href:`#${n.defaultRoute}`,"aria-current":y.foreground===void 0?`page`:void 0,"aria-disabled":t||void 0,children:p(`insight.navigation`)})}),(0,M.jsxs)(`div`,{className:`niceeval-view-controls`,children:[S===void 0?null:(0,M.jsxs)(`label`,{className:`niceeval-view-experiment`,children:[(0,M.jsx)(`span`,{children:p(`nav.experiments`)}),(0,M.jsx)(`select`,{disabled:t,value:S.route,onChange:e=>h(e.target.value),children:x.map(e=>(0,M.jsx)(`option`,{value:e.route,children:e.label},e.route))})]}),(0,M.jsx)(`label`,{className:`niceeval-view-language`,children:(0,M.jsxs)(`select`,{disabled:t,"aria-label":p(`nav.language`),value:b,onChange:e=>void f.changeLanguage(e.target.value),children:[(0,M.jsx)(`option`,{value:`en`,children:`EN`}),(0,M.jsx)(`option`,{value:`zh-CN`,children:`中文`})]})}),(0,M.jsx)(`button`,{type:`button`,disabled:o||t,onClick:()=>{s(!0),d(!1),l(void 0),i().then(e=>{l(e.noticeKey)}).catch(()=>d(!0)).finally(()=>s(!1))},children:p(o?`refresh.working`:`refresh.action`)}),g.data===!0&&!o?(0,M.jsx)(`span`,{role:`status`,children:p(`refresh.available`)}):null,c===void 0?null:(0,M.jsx)(`span`,{role:`status`,children:p(c)}),u?(0,M.jsx)(`span`,{role:`alert`,children:p(`refresh.failed`)}):null]})]}),(0,M.jsxs)(`main`,{className:`niceeval-view-main`,inert:t?!0:void 0,children:[(0,M.jsx)(wH,{surface:y.background},`background:${hH(y.background)}`),T===void 0?null:(0,M.jsx)(wH,{surface:T,onClose:()=>w(T.close)},`foreground:${hH(T)}`)]})]})}function wH({surface:e,onClose:t}){let{target:n,presentation:r}=e;if(n.kind===`group`||n.kind===`experiment`)return(0,M.jsx)(eH,{target:n});if(n.kind===`run`)return(0,M.jsx)(aH,{runId:n.runId,presentation:r,onClose:t});if(t===void 0)throw Error(`Attempt dialog close target is missing.`);return(0,M.jsx)(kB,{locator:n.locator,onClose:t})}var TH=U({generationId:B,sourceCutoffIdentity:B,refreshSupported:H,stale:H});U({generationId:B}),U({generationId:B,request:cA});var EH=U({code:K([`view-request-invalid`,`view-generation-not-found`,`view-generation-stale`,`view-inspection-failed`]),reason:B,correction:K([`fix-request`,`refresh-generation`,`retry`])}),DH={errors:`all`,onExcessProperty:`error`},OH=W_(TH,DH),kH=W_(EH,DH),AH=class extends Error{status;code;correction;classification=`view-http`;constructor(e,t,n,r,i){super(r,i),this.status=e,this.code=t,this.correction=n,this.name=`ViewHttpError`}},jH=class{descriptor;generationId;#e=new AbortController;#t=!1;constructor(e){this.descriptor=e,this.generationId=e.generationId}async inspect(e){if(this.#t)throw Error(`HTTP Inspection repository is closed.`);let t=vA(e);if($u(t))throw Error(t.failure.reason);let n=await IH(`/_niceeval/inspection`,{method:`POST`,signal:this.#e.signal,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:this.descriptor.generationId,request:{protocol:TT,operation:t.success}})}),r=await LH(n);if(!n.ok)throw RH(n.status,r);let i=hA(r);if(!i.success)throw new AH(n.status,`view-response-invalid`,`retry`,i.reason);let a=gA(i.value,e.kind);if(!a.success)throw new AH(n.status,`view-response-invalid`,`retry`,a.reason);return a.value}close(){this.#t||(this.#t=!0,this.#e.abort())}};async function MH(){return FH(`/_niceeval/generation`,{method:`GET`})}async function NH(){return FH(`/_niceeval/generation/refresh`,{method:`POST`})}async function PH(e){return FH(`/_niceeval/generation/commit`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({generationId:e})})}async function FH(e,t){let n=await IH(e,t),r=await LH(n);if(!n.ok)throw RH(n.status,r);let i=OH(r);if($u(i))throw new AH(n.status,`view-response-invalid`,`retry`,String(i.failure));return i.success}function IH(e,t){return fetch(new URL(e,document.baseURI),{...t,cache:`no-store`,credentials:`same-origin`})}async function LH(e){try{return await e.json()}catch(t){throw new AH(e.status,`view-response-invalid`,`retry`,`View HTTP response is not JSON.`,{cause:t})}}function RH(e,t){let n=kH(t);return $u(n)?new AH(e,`view-response-invalid`,`retry`,`View HTTP request failed (${e}).`):new AH(e,n.success.code,n.success.correction,n.success.reason)}var zH=class extends Error{classification=`generation-prepare`;translationKey=`report.unableToLoad`};async function BH(e){let t=new URL(document.baseURI).searchParams.getAll(`run`),n=new LA,r=new AbortController,i;window.addEventListener(`pagehide`,()=>{r.abort(Error(`NiceEval View page was hidden.`)),e(),i?.(),n.dispose()},{once:!0});let a=await MH(),o=n.prepare(new jH(a)),s,c;try{c=ZA(await o.lease.inspect(VA(t))),s=cH(c.catalog);let e=KH(s.defaultRoute),r=dH(s,e.pathname)===void 0?{pathname:s.defaultRoute}:e;await YH(o.lease,s,c,mH(s,r)),n.attachSnapshot(o,$H(s,c)),n.commit(o)}catch(e){throw n.reject(o),new zH(`Unable to prepare initial generation.`,{cause:e})}let l=e=>async()=>{let t=n.acquireCurrent();try{return await e(t)}finally{t.release()}},u=(e,t)=>{let n=e[t];if(!n)throw new RA(`Insight route parameter is missing.`);return n},d=e=>({params:t})=>l(async n=>{let r=pH(e(t));if(r===void 0)throw new RA(`Insight route parameter is malformed.`);let i=n.generation.binding;return await XH(n,i.snapshot.manifest,i.snapshot.overview,r),null})(),f=()=>n.current?.snapshot.manifest.defaultRoute??s.defaultRoute,p=0,m=Ji([{path:`/`,element:(0,M.jsx)(MA,{runtime:n,children:(0,M.jsx)(SH,{checkForUpdate:async()=>{HH(r.signal);let e=await MH();return HH(r.signal),e.stale||e.generationId!==n.current?.identity},refresh:async e=>{let i=p,a=m.state.location.pathname,o=m.state.location.key,s=m.state.location.state,c=n.current.identity,l=await NH();if(HH(r.signal),l.generationId===c)return WH(n);let u=n.prepare(new jH(l)),d=!0,f,h=!1,g=!1;try{let _=ZA(await u.lease.inspect(VA(t))),v=cH(_.catalog),y=ZH(n.current.snapshot.overview,_,v,a),b=mH(v,{pathname:y.route,state:y.fallback?null:s});if(await YH(u.lease,v,_,b),HH(r.signal),!UH(m,p,i,a,o))throw n.reject(u),d=!1,new zH(`View location changed while refresh was preparing.`);if(f=await e(r.signal),h=!0,HH(r.signal),!UH(m,p,i,a,o))throw n.reject(u),d=!1,await f.release(),h=!1,new zH(`View location changed while refresh was preparing.`);n.attachSnapshot(u,$H(v,_,y.fallback?{originLocationKey:o,plan:b}:void 0));let x=await GH(l.generationId,c,r.signal);if(HH(r.signal),x===`rejected`)throw new zH(`View Host rejected the prepared generation.`);if(x===`uncertain`)return n.reject(u),d=!1,f.recover(),h=!1,WH(n);g=!0,y.fallback&&!f.hasUserIntent()&&(await f.enqueueFallback(y.route),HH(r.signal));let S=n.commit(u);d=!1,n.retire(S);let C=await f.release();h=!1;let w=y.fallback&&C!==`user`;return Object.freeze({manifest:v,...w?{fallbackRoute:y.route,noticeKey:`refresh.selectionChanged`}:{}})}catch(e){if(r.signal.aborted)throw r.signal.reason;if(g&&h)return d&&u.generation.status===`preparing`&&n.reject(u),f.recover(),WH(n);throw d&&n.reject(u),h&&await f.release(),e instanceof zH?e:new zH(`Unable to prepare refreshed generation.`,{cause:e})}}})}),errorElement:(0,M.jsx)(JH,{}),children:[{index:!0,loader:()=>{let e=f();return e===`/`?null:st(e)}},{path:`group/:groupKind/:key`,element:null,loader:d(e=>[`group`,u(e,`groupKind`),u(e,`key`)])},{path:`experiment/:experimentId`,element:null,loader:d(e=>[`experiment`,u(e,`experimentId`)])},{path:`run/:runId`,element:null,loader:d(e=>[`run`,u(e,`runId`)])},{path:`attempt/:locator`,element:null,loader:d(e=>[`attempt`,u(e,`locator`)])},{path:`*`,loader:()=>st(f())}]}]);i=()=>m.dispose(),await VH(m);let h=m.state.location;return m.subscribe(e=>{e.location!==h&&(h=e.location,p+=1)}),m}function VH(e){return e.state.initialized?Promise.resolve():new Promise(t=>{let n=e.subscribe(e=>{e.initialized&&(n(),t())});e.state.initialized&&(n(),t())})}function HH(e){if(e.aborted)throw e.reason}function UH(e,t,n,r,i){return t===n&&e.state.location.pathname===r&&e.state.location.key===i&&e.state.navigation.state===`idle`}function WH(e){return Object.freeze({manifest:e.current.snapshot.manifest})}async function GH(e,t,n){let r;try{let t=await PH(e);if(HH(n),t.generationId===e)return`committed`;r=new zH(`View Host committed an unexpected generation.`)}catch(e){HH(n),r=e}let i;try{i=await MH(),HH(n)}catch{return HH(n),`uncertain`}return i.generationId===e?`committed`:r instanceof AH&&r.code===`view-generation-stale`&&i.generationId===t?`rejected`:`uncertain`}function KH(e){let t=window.location.hash,n=t.startsWith(`#/`)?t.slice(1):e,r=n.indexOf(`?`);return{pathname:r<0?n:n.slice(0,r),...r<0?{}:{search:n.slice(r)},state:qH()}}function qH(){let e=window.history.state;return typeof e==`object`&&e&&`usr`in e?e.usr:void 0}function JH(){let e=qr(),{t}=Fo(),n=typeof e==`object`&&e&&`translationKey`in e&&(e.translationKey===`report.unableToLoad`||e.translationKey===`report.unableToLoadDetails`)?e.translationKey:`report.unableToLoad`;return(0,M.jsxs)(`main`,{className:`niceeval-view-main`,role:`alert`,children:[(0,M.jsx)(`h1`,{children:t(`report.unableToLoad`)}),(0,M.jsx)(`p`,{children:t(n)}),(0,M.jsx)(`a`,{href:`#/`,children:t(`report.backToResults`)})]})}async function YH(e,t,n,r){await XH(e,t,n,r.background.target),r.foreground!==void 0&&await XH(e,t,n,r.foreground.target)}async function XH(e,t,n,r){let i=e.generation.binding;r.kind===`attempt`?await i.queryClient.fetchQuery(JA(i,r.locator)):r.kind===`run`?await i.queryClient.fetchQuery(aj(i,r.runId)):r.kind===`experiment`?await i.queryClient.fetchQuery(XA(i,n,r.experimentId)):await i.queryClient.fetchQuery(YA(i,t,n,r.groupKind,r.key))}function ZH(e,t,n,r){let i=dH(n,r);if(i===void 0)return{route:n.defaultRoute,fallback:!0};if(i.kind===`attempt`){if(t.catalog.attemptExperiments.some(e=>e.locator===i.locator))return{route:r,fallback:!1};let a=e.catalog.attemptExperiments.find(e=>e.locator===i.locator)?.experimentId;if(a===void 0)return{route:r,fallback:!1};let o=t.catalog.runExperiments.filter(e=>e.experimentId===a).sort((e,t)=>QH(e.runId,t.runId))[0];return o===void 0?{route:n.defaultRoute,fallback:!0}:{route:`/run/${encodeURIComponent(o.runId)}`,fallback:!0}}return i.kind===`run`?e.catalog.runExperiments.some(e=>e.runId===i.runId)?t.catalog.runExperiments.some(e=>e.runId===i.runId)?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:{route:r,fallback:!1}:i.kind===`experiment`&&e.catalog.experiments.includes(i.experimentId)?t.catalog.experiments.includes(i.experimentId)?{route:r,fallback:!1}:{route:n.defaultRoute,fallback:!0}:{route:r,fallback:!1}}function QH(e,t){return e<t?-1:+(e>t)}function $H(e,t,n){return Object.freeze({manifest:e,overview:t,...n===void 0?{}:{presentation:n}})}var eU=document.getElementById(`root`);if(eU===null)throw Error(`NiceEval View root is missing`);var tU=(0,b.createRoot)(eU),nU=BH(()=>tU.unmount());function rU(){let e=(0,v.use)(nU);return(0,M.jsx)(ca,{router:e})}function iU(){let e=window.location.hash.startsWith(`#/attempt/`);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`main`,{className:`niceeval-view-main`,children:e?(0,M.jsx)(`h1`,{children:`NiceEval Insight`}):(0,M.jsx)(`p`,{role:`status`,children:Ro.t(`report.loading`)})}),e?(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`niceeval-bootstrap-attempt-title`,className:`niceeval-view-dialog`,children:[(0,M.jsx)(`div`,{className:`niceeval-view-dialog-head`,children:(0,M.jsx)(`h2`,{id:`niceeval-bootstrap-attempt-title`,className:`niceeval-view-dialog-title`,children:Ro.t(`attempt.title`)})}),(0,M.jsx)(`p`,{role:`status`,children:Ro.t(`report.loadingDetails`)})]}):null]})}var aU=class extends v.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){}render(){return this.state.failed?(0,M.jsx)(`main`,{className:`niceeval-view-main`,role:`alert`,children:(0,M.jsx)(`h1`,{children:Ro.t(`app.failed`)})}):this.props.children}};tU.render((0,M.jsx)(v.StrictMode,{children:(0,M.jsx)(aU,{children:(0,M.jsx)(v.Suspense,{fallback:(0,M.jsx)(iU,{}),children:(0,M.jsx)(rU,{})})})}));export{d as a,l as c,h as i,Fo as n,o,jo as r,s,Bo as t};