@documentation-robotics/cli 0.1.0 → 0.1.7

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 (510) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +466 -693
  3. package/dist/analysis/data-model-analyzer.js +189 -0
  4. package/dist/analysis/data-model-analyzer.js.map +7 -0
  5. package/dist/analysis/index.js +3 -0
  6. package/dist/analysis/index.js.map +7 -0
  7. package/dist/analysis/relationship-classifier.js +181 -0
  8. package/dist/analysis/relationship-classifier.js.map +7 -0
  9. package/dist/analyzers/base-analyzer.js +1 -0
  10. package/dist/analyzers/base-analyzer.js.map +7 -0
  11. package/dist/analyzers/call-graph-utils.js +39 -0
  12. package/dist/analyzers/call-graph-utils.js.map +7 -0
  13. package/dist/analyzers/cbm-analyzer.js +1205 -0
  14. package/dist/analyzers/cbm-analyzer.js.map +7 -0
  15. package/dist/analyzers/heuristic-utils.js +55 -0
  16. package/dist/analyzers/heuristic-utils.js.map +7 -0
  17. package/dist/analyzers/mapping-loader.js +146 -0
  18. package/dist/analyzers/mapping-loader.js.map +7 -0
  19. package/dist/analyzers/registry.js +124 -0
  20. package/dist/analyzers/registry.js.map +7 -0
  21. package/dist/analyzers/session-state.js +176 -0
  22. package/dist/analyzers/session-state.js.map +7 -0
  23. package/dist/analyzers/stdio-client.js +208 -0
  24. package/dist/analyzers/stdio-client.js.map +7 -0
  25. package/dist/analyzers/types.js +15 -0
  26. package/dist/analyzers/types.js.map +7 -0
  27. package/dist/analyzers/verify-engine.js +209 -0
  28. package/dist/analyzers/verify-engine.js.map +7 -0
  29. package/dist/analyzers/verify-ignore.js +130 -0
  30. package/dist/analyzers/verify-ignore.js.map +7 -0
  31. package/dist/analyzers/version.js +8 -0
  32. package/dist/analyzers/version.js.map +7 -0
  33. package/dist/audit/ai/runner.js +41 -0
  34. package/dist/audit/ai/runner.js.map +7 -0
  35. package/dist/audit/differential-analyzer.js +183 -0
  36. package/dist/audit/differential-analyzer.js.map +7 -0
  37. package/dist/audit/index.js +32 -0
  38. package/dist/audit/index.js.map +7 -0
  39. package/dist/audit/nodes/ai/evaluator.js +49 -0
  40. package/dist/audit/nodes/ai/evaluator.js.map +7 -0
  41. package/dist/audit/nodes/ai/parser.js +55 -0
  42. package/dist/audit/nodes/ai/parser.js.map +7 -0
  43. package/dist/audit/nodes/ai/prompts.js +103 -0
  44. package/dist/audit/nodes/ai/prompts.js.map +7 -0
  45. package/dist/audit/nodes/analysis/node-completeness-checker.js +32 -0
  46. package/dist/audit/nodes/analysis/node-completeness-checker.js.map +7 -0
  47. package/dist/audit/nodes/analysis/node-definition-analyzer.js +47 -0
  48. package/dist/audit/nodes/analysis/node-definition-analyzer.js.map +7 -0
  49. package/dist/audit/nodes/analysis/node-overlap-detector.js +79 -0
  50. package/dist/audit/nodes/analysis/node-overlap-detector.js.map +7 -0
  51. package/dist/audit/nodes/model/orchestrator.js +82 -0
  52. package/dist/audit/nodes/model/orchestrator.js.map +7 -0
  53. package/dist/audit/nodes/spec/loader.js +116 -0
  54. package/dist/audit/nodes/spec/loader.js.map +7 -0
  55. package/dist/audit/nodes/spec/orchestrator.js +68 -0
  56. package/dist/audit/nodes/spec/orchestrator.js.map +7 -0
  57. package/dist/audit/nodes/types.js +1 -0
  58. package/dist/audit/nodes/types.js.map +7 -0
  59. package/dist/audit/pipeline/index.js +5 -0
  60. package/dist/audit/pipeline/index.js.map +7 -0
  61. package/dist/audit/pipeline/pipeline-orchestrator.js +218 -0
  62. package/dist/audit/pipeline/pipeline-orchestrator.js.map +7 -0
  63. package/dist/audit/relationships/ai/evaluator.js +235 -0
  64. package/dist/audit/relationships/ai/evaluator.js.map +7 -0
  65. package/dist/audit/relationships/ai/parser.js +197 -0
  66. package/dist/audit/relationships/ai/parser.js.map +7 -0
  67. package/dist/audit/relationships/ai/prompts.js +274 -0
  68. package/dist/audit/relationships/ai/prompts.js.map +7 -0
  69. package/dist/audit/relationships/analysis/balance-assessor.js +115 -0
  70. package/dist/audit/relationships/analysis/balance-assessor.js.map +7 -0
  71. package/dist/audit/relationships/analysis/coverage-analyzer.js +99 -0
  72. package/dist/audit/relationships/analysis/coverage-analyzer.js.map +7 -0
  73. package/dist/audit/relationships/analysis/duplicate-detector.js +95 -0
  74. package/dist/audit/relationships/analysis/duplicate-detector.js.map +7 -0
  75. package/dist/audit/relationships/analysis/gap-analyzer.js +99 -0
  76. package/dist/audit/relationships/analysis/gap-analyzer.js.map +7 -0
  77. package/dist/audit/relationships/analysis/layer-templates.js +294 -0
  78. package/dist/audit/relationships/analysis/layer-templates.js.map +7 -0
  79. package/dist/audit/relationships/graph/connectivity.js +129 -0
  80. package/dist/audit/relationships/graph/connectivity.js.map +7 -0
  81. package/dist/audit/relationships/graph/relationship-graph.js +179 -0
  82. package/dist/audit/relationships/graph/relationship-graph.js.map +7 -0
  83. package/dist/audit/relationships/model/balance-assessor.js +49 -0
  84. package/dist/audit/relationships/model/balance-assessor.js.map +7 -0
  85. package/dist/audit/relationships/model/coverage-analyzer.js +34 -0
  86. package/dist/audit/relationships/model/coverage-analyzer.js.map +7 -0
  87. package/dist/audit/relationships/model/duplicate-detector.js +68 -0
  88. package/dist/audit/relationships/model/duplicate-detector.js.map +7 -0
  89. package/dist/audit/relationships/model/gap-analyzer.js +41 -0
  90. package/dist/audit/relationships/model/gap-analyzer.js.map +7 -0
  91. package/dist/audit/relationships/model/orchestrator.js +126 -0
  92. package/dist/audit/relationships/model/orchestrator.js.map +7 -0
  93. package/dist/audit/relationships/spec/orchestrator.js +157 -0
  94. package/dist/audit/relationships/spec/orchestrator.js.map +7 -0
  95. package/dist/audit/reports/index.js +5 -0
  96. package/dist/audit/reports/index.js.map +7 -0
  97. package/dist/audit/reports/report-generator.js +118 -0
  98. package/dist/audit/reports/report-generator.js.map +7 -0
  99. package/dist/audit/snapshot-storage.js +163 -0
  100. package/dist/audit/snapshot-storage.js.map +7 -0
  101. package/dist/audit/types.js +21 -0
  102. package/dist/audit/types.js.map +7 -0
  103. package/dist/cli.js +223 -92
  104. package/dist/cli.js.map +3 -3
  105. package/dist/coding-agents/agents/claude-code.js +147 -0
  106. package/dist/coding-agents/agents/claude-code.js.map +7 -0
  107. package/dist/coding-agents/agents/index.js +5 -0
  108. package/dist/coding-agents/agents/index.js.map +7 -0
  109. package/dist/coding-agents/agents/types.js +1 -0
  110. package/dist/coding-agents/agents/types.js.map +7 -0
  111. package/dist/coding-agents/base-chat-client.js +45 -0
  112. package/dist/coding-agents/base-chat-client.js.map +7 -0
  113. package/dist/coding-agents/chat-utils.js +23 -0
  114. package/dist/coding-agents/chat-utils.js.map +7 -0
  115. package/dist/coding-agents/claude-code-client.js +246 -0
  116. package/dist/coding-agents/claude-code-client.js.map +7 -0
  117. package/dist/coding-agents/copilot-client.js +209 -0
  118. package/dist/coding-agents/copilot-client.js.map +7 -0
  119. package/dist/commands/add.js +95 -33
  120. package/dist/commands/add.js.map +2 -2
  121. package/dist/commands/analyzer.js +511 -0
  122. package/dist/commands/analyzer.js.map +7 -0
  123. package/dist/commands/audit-diff.js +49 -0
  124. package/dist/commands/audit-diff.js.map +7 -0
  125. package/dist/commands/audit-snapshots.js +62 -0
  126. package/dist/commands/audit-snapshots.js.map +7 -0
  127. package/dist/commands/audit.js +81 -0
  128. package/dist/commands/audit.js.map +7 -0
  129. package/dist/commands/catalog.js +248 -0
  130. package/dist/commands/catalog.js.map +7 -0
  131. package/dist/commands/changeset.js +577 -66
  132. package/dist/commands/changeset.js.map +2 -2
  133. package/dist/commands/chat.js +106 -83
  134. package/dist/commands/chat.js.map +2 -2
  135. package/dist/commands/claude.js +74 -0
  136. package/dist/commands/claude.js.map +7 -0
  137. package/dist/commands/conformance.js +71 -68
  138. package/dist/commands/conformance.js.map +2 -2
  139. package/dist/commands/copilot.js +75 -0
  140. package/dist/commands/copilot.js.map +7 -0
  141. package/dist/commands/delete.js +125 -11
  142. package/dist/commands/delete.js.map +3 -3
  143. package/dist/commands/discover-logic.js +44 -0
  144. package/dist/commands/discover-logic.js.map +7 -0
  145. package/dist/commands/docs.js +87 -0
  146. package/dist/commands/docs.js.map +7 -0
  147. package/dist/commands/element.js +14 -20
  148. package/dist/commands/element.js.map +2 -2
  149. package/dist/commands/export.js +13 -3
  150. package/dist/commands/export.js.map +2 -2
  151. package/dist/commands/import.js +51 -0
  152. package/dist/commands/import.js.map +7 -0
  153. package/dist/commands/info.js +30 -24
  154. package/dist/commands/info.js.map +2 -2
  155. package/dist/commands/init.js +27 -11
  156. package/dist/commands/init.js.map +2 -2
  157. package/dist/commands/list.js +63 -13
  158. package/dist/commands/list.js.map +3 -3
  159. package/dist/commands/relationship.js +225 -37
  160. package/dist/commands/relationship.js.map +2 -2
  161. package/dist/commands/report.js +54 -0
  162. package/dist/commands/report.js.map +7 -0
  163. package/dist/commands/reports.js +45 -0
  164. package/dist/commands/reports.js.map +7 -0
  165. package/dist/commands/schema.js +135 -0
  166. package/dist/commands/schema.js.map +7 -0
  167. package/dist/commands/search.js +40 -12
  168. package/dist/commands/search.js.map +2 -2
  169. package/dist/commands/show.js +58 -27
  170. package/dist/commands/show.js.map +2 -2
  171. package/dist/commands/stats.js +35 -0
  172. package/dist/commands/stats.js.map +7 -0
  173. package/dist/commands/trace.js +39 -16
  174. package/dist/commands/trace.js.map +2 -2
  175. package/dist/commands/update.js +141 -14
  176. package/dist/commands/update.js.map +2 -2
  177. package/dist/commands/upgrade.js +210 -46
  178. package/dist/commands/upgrade.js.map +3 -3
  179. package/dist/commands/validate.js +142 -23
  180. package/dist/commands/validate.js.map +3 -3
  181. package/dist/commands/version.js +8 -12
  182. package/dist/commands/version.js.map +2 -2
  183. package/dist/commands/visualize.js +162 -25
  184. package/dist/commands/visualize.js.map +2 -2
  185. package/dist/core/base-snapshot-manager.js +84 -0
  186. package/dist/core/base-snapshot-manager.js.map +7 -0
  187. package/dist/core/changeset-exporter.js +305 -0
  188. package/dist/core/changeset-exporter.js.map +7 -0
  189. package/dist/core/changeset-validator.js +41 -0
  190. package/dist/core/changeset-validator.js.map +7 -0
  191. package/dist/core/changeset.js +88 -173
  192. package/dist/core/changeset.js.map +2 -2
  193. package/dist/core/dependency-tracker.js +4 -2
  194. package/dist/core/dependency-tracker.js.map +2 -2
  195. package/dist/core/element.js +98 -27
  196. package/dist/core/element.js.map +2 -2
  197. package/dist/core/golden-copy-cache.js +290 -0
  198. package/dist/core/golden-copy-cache.js.map +7 -0
  199. package/dist/core/graph-model.js +266 -0
  200. package/dist/core/graph-model.js.map +7 -0
  201. package/dist/core/layer.js +159 -16
  202. package/dist/core/layer.js.map +2 -2
  203. package/dist/core/layers.js +32 -0
  204. package/dist/core/layers.js.map +7 -0
  205. package/dist/core/manifest.js +32 -11
  206. package/dist/core/manifest.js.map +2 -2
  207. package/dist/core/migration-registry.js +56 -1
  208. package/dist/core/migration-registry.js.map +2 -2
  209. package/dist/core/model.js +424 -217
  210. package/dist/core/model.js.map +3 -3
  211. package/dist/core/mutation-handler.js +179 -0
  212. package/dist/core/mutation-handler.js.map +7 -0
  213. package/dist/core/reference-registry.js +29 -21
  214. package/dist/core/reference-registry.js.map +2 -2
  215. package/dist/core/relationship-catalog.js +189 -0
  216. package/dist/core/relationship-catalog.js.map +7 -0
  217. package/dist/core/relationship-registry.js.map +2 -2
  218. package/dist/core/relationships.js.map +1 -1
  219. package/dist/core/report-data-model.js +285 -0
  220. package/dist/core/report-data-model.js.map +7 -0
  221. package/dist/core/spec-data-service.js +185 -0
  222. package/dist/core/spec-data-service.js.map +7 -0
  223. package/dist/core/spec-loader-types.js +1 -0
  224. package/dist/core/spec-loader-types.js.map +7 -0
  225. package/dist/core/spec-loader.js +234 -0
  226. package/dist/core/spec-loader.js.map +7 -0
  227. package/dist/core/staged-changeset-storage.js +282 -0
  228. package/dist/core/staged-changeset-storage.js.map +7 -0
  229. package/dist/core/staging-area.js +1002 -0
  230. package/dist/core/staging-area.js.map +7 -0
  231. package/dist/core/stats-collector.js +169 -0
  232. package/dist/core/stats-collector.js.map +7 -0
  233. package/dist/core/virtual-projection.js +443 -0
  234. package/dist/core/virtual-projection.js.map +7 -0
  235. package/dist/export/archimate-exporter.js +99 -60
  236. package/dist/export/archimate-exporter.js.map +2 -2
  237. package/dist/export/audit-formatters.js +479 -0
  238. package/dist/export/audit-formatters.js.map +7 -0
  239. package/dist/export/diff-formatters.js +99 -0
  240. package/dist/export/diff-formatters.js.map +7 -0
  241. package/dist/export/export-manager.js.map +2 -2
  242. package/dist/export/graphml-exporter.js +44 -27
  243. package/dist/export/graphml-exporter.js.map +2 -2
  244. package/dist/export/index.js +4 -0
  245. package/dist/export/index.js.map +2 -2
  246. package/dist/export/json-schema-exporter.js +55 -42
  247. package/dist/export/json-schema-exporter.js.map +2 -2
  248. package/dist/export/markdown-exporter.js +92 -70
  249. package/dist/export/markdown-exporter.js.map +2 -2
  250. package/dist/export/markdown-generator.js +248 -0
  251. package/dist/export/markdown-generator.js.map +7 -0
  252. package/dist/export/markdown-utils.js +30 -0
  253. package/dist/export/markdown-utils.js.map +7 -0
  254. package/dist/export/mermaid-markdown-exporter.js +37 -0
  255. package/dist/export/mermaid-markdown-exporter.js.map +7 -0
  256. package/dist/export/openapi-exporter.js +119 -71
  257. package/dist/export/openapi-exporter.js.map +2 -2
  258. package/dist/export/plantuml-exporter.js +104 -39
  259. package/dist/export/plantuml-exporter.js.map +2 -2
  260. package/dist/export/report-formatters.js +111 -0
  261. package/dist/export/report-formatters.js.map +7 -0
  262. package/dist/export/stats-formatters.js +98 -0
  263. package/dist/export/stats-formatters.js.map +7 -0
  264. package/dist/export/types.js +2 -14
  265. package/dist/export/types.js.map +2 -2
  266. package/dist/export/verify-formatters.js +153 -0
  267. package/dist/export/verify-formatters.js.map +7 -0
  268. package/dist/generated/compiled-validators.js +17 -0
  269. package/dist/generated/compiled-validators.js.map +7 -0
  270. package/dist/generated/index.js +31 -0
  271. package/dist/generated/index.js.map +7 -0
  272. package/dist/generated/layer-registry.js +190 -0
  273. package/dist/generated/layer-registry.js.map +7 -0
  274. package/dist/generated/layer-types.js +7 -0
  275. package/dist/generated/layer-types.js.map +7 -0
  276. package/dist/generated/node-types.js +1719 -0
  277. package/dist/generated/node-types.js.map +7 -0
  278. package/dist/generated/relationship-index.js +14552 -0
  279. package/dist/generated/relationship-index.js.map +7 -0
  280. package/dist/import/archimate-importer.js +166 -0
  281. package/dist/import/archimate-importer.js.map +7 -0
  282. package/dist/import/index.js +47 -0
  283. package/dist/import/index.js.map +7 -0
  284. package/dist/import/openapi-importer.js +143 -0
  285. package/dist/import/openapi-importer.js.map +7 -0
  286. package/dist/import/types.js +1 -0
  287. package/dist/import/types.js.map +7 -0
  288. package/dist/integrations/base-manager.js +311 -0
  289. package/dist/integrations/base-manager.js.map +7 -0
  290. package/dist/integrations/claude-manager.js +360 -0
  291. package/dist/integrations/claude-manager.js.map +7 -0
  292. package/dist/integrations/claude_code/agents/dr-advisor.md +253 -0
  293. package/dist/integrations/claude_code/agents/dr-architect.md +278 -0
  294. package/dist/integrations/claude_code/agents/dr-extractor.md +286 -0
  295. package/dist/integrations/claude_code/commands/dr-changeset.md +657 -0
  296. package/dist/integrations/claude_code/commands/dr-design.md +373 -0
  297. package/dist/integrations/claude_code/commands/dr-info.md +132 -0
  298. package/dist/integrations/claude_code/commands/dr-init.md +251 -0
  299. package/dist/integrations/claude_code/commands/dr-map.md +936 -0
  300. package/dist/integrations/claude_code/commands/dr-model.md +493 -0
  301. package/dist/integrations/claude_code/commands/dr-relate.md +814 -0
  302. package/dist/integrations/claude_code/commands/dr-sync.md +279 -0
  303. package/dist/integrations/claude_code/commands/dr-validate.md +654 -0
  304. package/dist/integrations/claude_code/commands/dr-verify.md +559 -0
  305. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +903 -0
  306. package/dist/integrations/claude_code/docs/QUICK_START.md +271 -0
  307. package/dist/integrations/claude_code/docs/README.md +347 -0
  308. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +550 -0
  309. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +620 -0
  310. package/dist/integrations/claude_code/skills/dr_03_security_layer/SKILL.md +642 -0
  311. package/dist/integrations/claude_code/skills/dr_04_application_layer/SKILL.md +911 -0
  312. package/dist/integrations/claude_code/skills/dr_05_technology_layer/SKILL.md +836 -0
  313. package/dist/integrations/claude_code/skills/dr_06_api_layer/SKILL.md +933 -0
  314. package/dist/integrations/claude_code/skills/dr_07_data_model_layer/SKILL.md +210 -0
  315. package/dist/integrations/claude_code/skills/dr_08_dataset_layer/SKILL.md +319 -0
  316. package/dist/integrations/claude_code/skills/dr_09_ux_layer/SKILL.md +319 -0
  317. package/dist/integrations/claude_code/skills/dr_10_navigation_layer/SKILL.md +318 -0
  318. package/dist/integrations/claude_code/skills/dr_11_apm_layer/SKILL.md +273 -0
  319. package/dist/integrations/claude_code/skills/dr_12_testing_layer/SKILL.md +273 -0
  320. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +187 -0
  321. package/dist/integrations/claude_code/skills/dr_codebase_memory/SKILL.md +590 -0
  322. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +295 -0
  323. package/dist/integrations/copilot-manager.js +328 -0
  324. package/dist/integrations/copilot-manager.js.map +7 -0
  325. package/dist/integrations/github_copilot/agents/dr-advisor.md +243 -0
  326. package/dist/integrations/github_copilot/agents/dr-architect.md +1567 -0
  327. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +491 -0
  328. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +539 -0
  329. package/dist/integrations/github_copilot/skills/dr_03_security_layer/SKILL.md +667 -0
  330. package/dist/integrations/github_copilot/skills/dr_04_application_layer/SKILL.md +670 -0
  331. package/dist/integrations/github_copilot/skills/dr_05_technology_layer/SKILL.md +660 -0
  332. package/dist/integrations/github_copilot/skills/dr_06_api_layer/SKILL.md +855 -0
  333. package/dist/integrations/github_copilot/skills/dr_07_data_model_layer/SKILL.md +171 -0
  334. package/dist/integrations/github_copilot/skills/dr_08_dataset_layer/SKILL.md +216 -0
  335. package/dist/integrations/github_copilot/skills/dr_09_ux_layer/SKILL.md +230 -0
  336. package/dist/integrations/github_copilot/skills/dr_10_navigation_layer/SKILL.md +228 -0
  337. package/dist/integrations/github_copilot/skills/dr_11_apm_layer/SKILL.md +234 -0
  338. package/dist/integrations/github_copilot/skills/dr_12_testing_layer/SKILL.md +230 -0
  339. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +187 -0
  340. package/dist/integrations/hash-utils.js +51 -0
  341. package/dist/integrations/hash-utils.js.map +7 -0
  342. package/dist/integrations/types.js +16 -0
  343. package/dist/integrations/types.js.map +7 -0
  344. package/dist/reports/model-layer-report-generator.js +278 -0
  345. package/dist/reports/model-layer-report-generator.js.map +7 -0
  346. package/dist/reports/model-report-data.js +57 -0
  347. package/dist/reports/model-report-data.js.map +7 -0
  348. package/dist/reports/model-report-orchestrator.js +103 -0
  349. package/dist/reports/model-report-orchestrator.js.map +7 -0
  350. package/dist/schemas/bundled/analyzers/cbm.json +595 -0
  351. package/dist/schemas/bundled/analyzers/manifest.json +9 -0
  352. package/dist/schemas/bundled/api.json +3411 -0
  353. package/dist/schemas/bundled/apm.json +2371 -0
  354. package/dist/schemas/bundled/application.json +1253 -0
  355. package/dist/schemas/bundled/base.json +1622 -0
  356. package/dist/schemas/bundled/business.json +1279 -0
  357. package/dist/schemas/bundled/data-model.json +1298 -0
  358. package/dist/schemas/bundled/data-store.json +2025 -0
  359. package/dist/schemas/bundled/manifest.json +93 -0
  360. package/dist/schemas/bundled/motivation.json +1360 -0
  361. package/dist/schemas/bundled/navigation.json +1874 -0
  362. package/dist/schemas/bundled/security.json +3488 -0
  363. package/dist/schemas/bundled/technology.json +2067 -0
  364. package/dist/schemas/bundled/testing.json +3120 -0
  365. package/dist/schemas/bundled/ux.json +3592 -0
  366. package/dist/server/schemas.js +202 -0
  367. package/dist/server/schemas.js.map +7 -0
  368. package/dist/server/server.js +1336 -252
  369. package/dist/server/server.js.map +3 -3
  370. package/dist/server/telemetry-middleware.js +22 -15
  371. package/dist/server/telemetry-middleware.js.map +2 -2
  372. package/dist/server-entry.js +65 -0
  373. package/dist/server-entry.js.map +7 -0
  374. package/dist/telemetry/config.js +89 -0
  375. package/dist/telemetry/config.js.map +7 -0
  376. package/dist/telemetry/console-interceptor.js.map +1 -1
  377. package/dist/telemetry/detect.js +24 -0
  378. package/dist/telemetry/detect.js.map +7 -0
  379. package/dist/telemetry/fetch-otlp-exporter.js +112 -0
  380. package/dist/telemetry/fetch-otlp-exporter.js.map +7 -0
  381. package/dist/telemetry/index.js +153 -3
  382. package/dist/telemetry/index.js.map +2 -2
  383. package/dist/telemetry/resilient-exporter.js +22 -8
  384. package/dist/telemetry/resilient-exporter.js.map +2 -2
  385. package/dist/telemetry/resilient-log-exporter.js +17 -8
  386. package/dist/telemetry/resilient-log-exporter.js.map +2 -2
  387. package/dist/telemetry/test-instrumentation.js.map +2 -2
  388. package/dist/types/index.js +84 -0
  389. package/dist/types/index.js.map +3 -3
  390. package/dist/types/source-reference.js +1 -0
  391. package/dist/types/source-reference.js.map +7 -0
  392. package/dist/utils/chat-logger.js +292 -0
  393. package/dist/utils/chat-logger.js.map +7 -0
  394. package/dist/utils/claude-stream.js +8 -0
  395. package/dist/utils/claude-stream.js.map +7 -0
  396. package/dist/utils/date-utils.js +7 -0
  397. package/dist/utils/date-utils.js.map +7 -0
  398. package/dist/utils/element-utils.js.map +1 -1
  399. package/dist/utils/errors.js +88 -15
  400. package/dist/utils/errors.js.map +3 -3
  401. package/dist/utils/export-python-annotations.js +82 -0
  402. package/dist/utils/export-python-annotations.js.map +7 -0
  403. package/dist/utils/file-io.js +7 -2
  404. package/dist/utils/file-io.js.map +2 -2
  405. package/dist/utils/file-lock.js +156 -0
  406. package/dist/utils/file-lock.js.map +7 -0
  407. package/dist/utils/id-generator.js +18 -0
  408. package/dist/utils/id-generator.js.map +7 -0
  409. package/dist/utils/layer-name-formatter.js +16 -0
  410. package/dist/utils/layer-name-formatter.js.map +7 -0
  411. package/dist/utils/markdown-anchor.js +7 -0
  412. package/dist/utils/markdown-anchor.js.map +7 -0
  413. package/dist/utils/markdown-link.js +12 -0
  414. package/dist/utils/markdown-link.js.map +7 -0
  415. package/dist/utils/markdown-table.js +17 -0
  416. package/dist/utils/markdown-table.js.map +7 -0
  417. package/dist/utils/mermaid-utils.js +11 -0
  418. package/dist/utils/mermaid-utils.js.map +7 -0
  419. package/dist/utils/project-paths.js.map +2 -2
  420. package/dist/utils/source-reference.js +52 -0
  421. package/dist/utils/source-reference.js.map +7 -0
  422. package/dist/utils/spec-installer.js +40 -53
  423. package/dist/utils/spec-installer.js.map +2 -2
  424. package/dist/utils/spec-version.js +5 -1
  425. package/dist/utils/spec-version.js.map +2 -2
  426. package/dist/utils/string-utils.js +12 -0
  427. package/dist/utils/string-utils.js.map +7 -0
  428. package/dist/utils/table-formatting.js +19 -0
  429. package/dist/utils/table-formatting.js.map +7 -0
  430. package/dist/validators/index.js +4 -0
  431. package/dist/validators/index.js.map +2 -2
  432. package/dist/validators/naming-validator.js +20 -23
  433. package/dist/validators/naming-validator.js.map +2 -2
  434. package/dist/validators/reference-validator.js +23 -38
  435. package/dist/validators/reference-validator.js.map +2 -2
  436. package/dist/validators/relationship-schema-validator.js +243 -0
  437. package/dist/validators/relationship-schema-validator.js.map +7 -0
  438. package/dist/validators/schema-validator.js +168 -68
  439. package/dist/validators/schema-validator.js.map +2 -2
  440. package/dist/validators/semantic-validator.js +36 -60
  441. package/dist/validators/semantic-validator.js.map +2 -2
  442. package/dist/validators/types.js.map +2 -2
  443. package/dist/validators/validation-formatter.js +159 -0
  444. package/dist/validators/validation-formatter.js.map +7 -0
  445. package/dist/validators/validator.js +24 -38
  446. package/dist/validators/validator.js.map +2 -2
  447. package/dist/viewer/README.md +139 -0
  448. package/dist/viewer/assets/main-CY0Xufuj.css +1 -0
  449. package/dist/viewer/assets/main-DtgErnwF.js +81 -0
  450. package/dist/viewer/assets/vendor-CxKvDp2x.js +17 -0
  451. package/dist/viewer/favicon.svg +11 -0
  452. package/dist/viewer/fonts/inter/Inter-Black.woff2 +0 -0
  453. package/dist/viewer/fonts/inter/Inter-Bold.woff2 +0 -0
  454. package/dist/viewer/fonts/inter/Inter-ExtraBold.woff2 +0 -0
  455. package/dist/viewer/fonts/inter/Inter-Light.woff2 +0 -0
  456. package/dist/viewer/fonts/inter/Inter-Medium.woff2 +0 -0
  457. package/dist/viewer/fonts/inter/Inter-Regular.woff2 +0 -0
  458. package/dist/viewer/fonts/inter/Inter-SemiBold.woff2 +0 -0
  459. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2 +0 -0
  460. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
  461. package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-SemiBold.woff2 +0 -0
  462. package/dist/viewer/index.html +15 -0
  463. package/dist/viewer/manifest.json +99 -0
  464. package/dist/viewer/version.json +1 -0
  465. package/package.json +42 -16
  466. package/PYTHON_CLI_PARITY.md +0 -265
  467. package/PYTHON_CLI_STRUCTURE_UPDATE.md +0 -246
  468. package/biome.json +0 -42
  469. package/bunfig.toml +0 -3
  470. package/dist/ai/claude-client.js +0 -71
  471. package/dist/ai/claude-client.js.map +0 -7
  472. package/dist/ai/context-provider.js +0 -129
  473. package/dist/ai/context-provider.js.map +0 -7
  474. package/dist/ai/tools.js +0 -231
  475. package/dist/ai/tools.js.map +0 -7
  476. package/dist/commands/migrate.js +0 -36
  477. package/dist/commands/migrate.js.map +0 -7
  478. package/dist/commands/project.js +0 -74
  479. package/dist/commands/project.js.map +0 -7
  480. package/dist/core/active-changeset.js +0 -52
  481. package/dist/core/active-changeset.js.map +0 -7
  482. package/dist/core/projection-engine.js +0 -288
  483. package/dist/core/projection-engine.js.map +0 -7
  484. package/dist/schemas/bundled/01-motivation-layer.schema.json +0 -942
  485. package/dist/schemas/bundled/02-business-layer.schema.json +0 -1293
  486. package/dist/schemas/bundled/03-security-layer.schema.json +0 -2177
  487. package/dist/schemas/bundled/04-application-layer.schema.json +0 -1328
  488. package/dist/schemas/bundled/05-technology-layer.schema.json +0 -1465
  489. package/dist/schemas/bundled/06-api-layer.schema.json +0 -1743
  490. package/dist/schemas/bundled/07-data-model-layer.schema.json +0 -1253
  491. package/dist/schemas/bundled/08-datastore-layer.schema.json +0 -892
  492. package/dist/schemas/bundled/09-ux-layer.schema.json +0 -1506
  493. package/dist/schemas/bundled/10-navigation-layer.schema.json +0 -843
  494. package/dist/schemas/bundled/11-apm-observability-layer.schema.json +0 -1430
  495. package/dist/schemas/bundled/12-testing-layer.schema.json +0 -1091
  496. package/dist/schemas/bundled/common/layer-extensions.schema.json +0 -266
  497. package/dist/schemas/bundled/common/predicates.schema.json +0 -493
  498. package/dist/schemas/bundled/common/relationships.schema.json +0 -791
  499. package/dist/schemas/bundled/common/source-references.schema.json +0 -71
  500. package/dist/schemas/bundled/link-registry.json +0 -1839
  501. package/dist/schemas/bundled/link-registry.schema.json +0 -339
  502. package/dist/schemas/bundled/relationship-catalog.json +0 -1302
  503. package/dist/schemas/bundled/relationship-type.schema.json +0 -221
  504. package/dist/utils/model-path.js +0 -22
  505. package/dist/utils/model-path.js.map +0 -7
  506. package/docs/TEST-INSTRUMENTATION.md +0 -405
  507. package/docs/telemetry.md +0 -427
  508. package/test-debug.js +0 -33
  509. package/test-special.mjs +0 -46
  510. package/test_runner.ts +0 -7
@@ -0,0 +1,81 @@
1
+ var rN=Object.defineProperty,lN=Object.defineProperties;var oN=Object.getOwnPropertyDescriptors;var nu=Object.getOwnPropertySymbols;var F1=Object.prototype.hasOwnProperty,H1=Object.prototype.propertyIsEnumerable;var $1=e=>{throw TypeError(e)},bh=Math.pow,vh=(e,t,a)=>t in e?rN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,R=(e,t)=>{for(var a in t||(t={}))F1.call(t,a)&&vh(e,a,t[a]);if(nu)for(var a of nu(t))H1.call(t,a)&&vh(e,a,t[a]);return e},Y=(e,t)=>lN(e,oN(t));var fe=(e,t)=>{var a={};for(var s in e)F1.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&nu)for(var s of nu(e))t.indexOf(s)<0&&H1.call(e,s)&&(a[s]=e[s]);return a};var cN=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dt=(e,t,a)=>vh(e,typeof t!="symbol"?t+"":t,a),xh=(e,t,a)=>t.has(e)||$1("Cannot "+a);var Q=(e,t,a)=>(xh(e,t,"read from private field"),a?a.call(e):t.get(e)),Te=(e,t,a)=>t.has(e)?$1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),_e=(e,t,a,s)=>(xh(e,t,"write to private field"),s?s.call(e,a):t.set(e,a),a),Ve=(e,t,a)=>(xh(e,t,"access private method"),a);var au=(e,t,a,s)=>({set _(l){_e(e,t,l,a)},get _(){return Q(e,t,s)}});var ze=(e,t,a)=>new Promise((s,l)=>{var c=h=>{try{u(a.next(h))}catch(m){l(m)}},o=h=>{try{u(a.throw(h))}catch(m){l(m)}},u=h=>h.done?s(h.value):Promise.resolve(h.value).then(c,o);u((a=a.apply(e,t)).next())});import{r as Ym,a as tx,g as uN,b as D,R as ae,c as qu}from"./vendor-CxKvDp2x.js";var L5=cN(Xp=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const o of c.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function a(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();var _h={exports:{}},to={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var P1;function dN(){if(P1)return to;P1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,l,c){var o=null;if(c!==void 0&&(o=""+c),l.key!==void 0&&(o=""+l.key),"key"in l){c={};for(var u in l)u!=="key"&&(c[u]=l[u])}else c=l;return l=c.ref,{$$typeof:e,type:s,key:o,ref:l!==void 0?l:null,props:c}}return to.Fragment=t,to.jsx=a,to.jsxs=a,to}var q1;function fN(){return q1||(q1=1,_h.exports=dN()),_h.exports}var f=fN(),Sh={exports:{}},no={},wh={exports:{}},Ch={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var V1;function hN(){return V1||(V1=1,(function(e){function t(H,X){var P=H.length;H.push(X);e:for(;0<P;){var re=P-1>>>1,T=H[re];if(0<l(T,X))H[re]=X,H[P]=T,P=re;else break e}}function a(H){return H.length===0?null:H[0]}function s(H){if(H.length===0)return null;var X=H[0],P=H.pop();if(P!==X){H[0]=P;e:for(var re=0,T=H.length,ce=T>>>1;re<ce;){var he=2*(re+1)-1,M=H[he],se=he+1,pe=H[se];if(0>l(M,P))se<T&&0>l(pe,M)?(H[re]=pe,H[se]=P,re=se):(H[re]=M,H[he]=P,re=he);else if(se<T&&0>l(pe,P))H[re]=pe,H[se]=P,re=se;else break e}}return X}function l(H,X){var P=H.sortIndex-X.sortIndex;return P!==0?P:H.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var h=[],m=[],g=1,p=null,v=3,x=!1,_=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate!="undefined"?setImmediate:null;function E(H){for(var X=a(m);X!==null;){if(X.callback===null)s(m);else if(X.startTime<=H)s(m),X.sortIndex=X.expirationTime,t(h,X);else break;X=a(m)}}function O(H){if(S=!1,E(H),!_)if(a(h)!==null)_=!0,z||(z=!0,F());else{var X=a(m);X!==null&&K(O,X.startTime-H)}}var z=!1,I=-1,B=5,q=-1;function A(){return w?!0:!(e.unstable_now()-q<B)}function U(){if(w=!1,z){var H=e.unstable_now();q=H;var X=!0;try{e:{_=!1,S&&(S=!1,k(I),I=-1),x=!0;var P=v;try{t:{for(E(H),p=a(h);p!==null&&!(p.expirationTime>H&&A());){var re=p.callback;if(typeof re=="function"){p.callback=null,v=p.priorityLevel;var T=re(p.expirationTime<=H);if(H=e.unstable_now(),typeof T=="function"){p.callback=T,E(H),X=!0;break t}p===a(h)&&s(h),E(H)}else s(h);p=a(h)}if(p!==null)X=!0;else{var ce=a(m);ce!==null&&K(O,ce.startTime-H),X=!1}}break e}finally{p=null,v=P,x=!1}X=void 0}}finally{X?F():z=!1}}}var F;if(typeof j=="function")F=function(){j(U)};else if(typeof MessageChannel!="undefined"){var $=new MessageChannel,V=$.port2;$.port1.onmessage=U,F=function(){V.postMessage(null)}}else F=function(){C(U,0)};function K(H,X){I=C(function(){H(e.unstable_now())},X)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(H){switch(v){case 1:case 2:case 3:var X=3;break;default:X=v}var P=v;v=X;try{return H()}finally{v=P}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var P=v;v=H;try{return X()}finally{v=P}},e.unstable_scheduleCallback=function(H,X,P){var re=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?re+P:re):P=re,H){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=P+T,H={id:g++,callback:X,priorityLevel:H,startTime:P,expirationTime:T,sortIndex:-1},P>re?(H.sortIndex=P,t(m,H),a(h)===null&&H===a(m)&&(S?(k(I),I=-1):S=!0,K(O,P-re))):(H.sortIndex=T,t(h,H),_||x||(_=!0,z||(z=!0,F()))),H},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(H){var X=v;return function(){var P=v;v=X;try{return H.apply(this,arguments)}finally{v=P}}}})(Ch)),Ch}var G1;function mN(){return G1||(G1=1,wh.exports=hN()),wh.exports}/**
18
+ * @license React
19
+ * react-dom-client.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var K1;function pN(){if(K1)return no;K1=1;var e=mN(),t=Ym(),a=tx();function s(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)i+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,r=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(r=i.return),n=i.return;while(n)}return i.tag===3?r:null}function o(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function u(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(s(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(s(188));return i!==n?null:n}for(var r=n,d=i;;){var y=r.return;if(y===null)break;var b=y.alternate;if(b===null){if(d=y.return,d!==null){r=d;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===r)return h(y),n;if(b===d)return h(y),i;b=b.sibling}throw Error(s(188))}if(r.return!==d.return)r=y,d=b;else{for(var N=!1,L=y.child;L;){if(L===r){N=!0,r=y,d=b;break}if(L===d){N=!0,d=y,r=b;break}L=L.sibling}if(!N){for(L=b.child;L;){if(L===r){N=!0,r=b,d=y;break}if(L===d){N=!0,d=b,r=y;break}L=L.sibling}if(!N)throw Error(s(189))}}if(r.alternate!==d)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?n:i}function g(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=g(n),i!==null)return i;n=n.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),A=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function F(n){return n===null||typeof n!="object"?null:(n=U&&n[U]||n["@@iterator"],typeof n=="function"?n:null)}var $=Symbol.for("react.client.reference");function V(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===$?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case z:return"SuspenseList";case q:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case j:return n.displayName||"Context";case k:return(n._context.displayName||"Context")+".Consumer";case E:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case I:return i=n.displayName||null,i!==null?i:V(n.type)||"Memo";case B:i=n._payload,n=n._init;try{return V(n(i))}catch(r){}}return null}var K=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},re=[],T=-1;function ce(n){return{current:n}}function he(n){0>T||(n.current=re[T],re[T]=null,T--)}function M(n,i){T++,re[T]=n.current,n.current=i}var se=ce(null),pe=ce(null),ge=ce(null),Se=ce(null);function xe(n,i){switch(M(ge,i),M(pe,n),M(se,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?c1(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=c1(i),n=u1(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}he(se),M(se,n)}function Ue(){he(se),he(pe),he(ge)}function rt(n){n.memoizedState!==null&&M(Se,n);var i=se.current,r=u1(i,n.type);i!==r&&(M(pe,n),M(se,r))}function _t(n){pe.current===n&&(he(se),he(pe)),Se.current===n&&(he(Se),Zl._currentValue=P)}var Wt,tt;function Oe(n){if(Wt===void 0)try{throw Error()}catch(r){var i=r.stack.trim().match(/\n( *(at )?)/);Wt=i&&i[1]||"",tt=-1<r.stack.indexOf(`
26
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
27
+ `+Wt+n+tt}var qe=!1;function gt(n,i){if(!n||qe)return"";qe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ie){var te=ie}Reflect.construct(n,[],de)}else{try{de.call()}catch(ie){te=ie}n.call(de.prototype)}}else{try{throw Error()}catch(ie){te=ie}(de=n())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),N=b[0],L=b[1];if(N&&L){var G=N.split(`
28
+ `),ee=L.split(`
29
+ `);for(y=d=0;d<G.length&&!G[d].includes("DetermineComponentFrameRoot");)d++;for(;y<ee.length&&!ee[y].includes("DetermineComponentFrameRoot");)y++;if(d===G.length||y===ee.length)for(d=G.length-1,y=ee.length-1;1<=d&&0<=y&&G[d]!==ee[y];)y--;for(;1<=d&&0<=y;d--,y--)if(G[d]!==ee[y]){if(d!==1||y!==1)do if(d--,y--,0>y||G[d]!==ee[y]){var oe=`
30
+ `+G[d].replace(" at new "," at ");return n.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",n.displayName)),oe}while(1<=d&&0<=y);break}}}finally{qe=!1,Error.prepareStackTrace=r}return(r=n?n.displayName||n.name:"")?Oe(r):""}function je(n,i){switch(n.tag){case 26:case 27:case 5:return Oe(n.type);case 16:return Oe("Lazy");case 13:return n.child!==i&&i!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return gt(n.type,!1);case 11:return gt(n.type.render,!1);case 1:return gt(n.type,!0);case 31:return Oe("Activity");default:return""}}function lt(n){try{var i="",r=null;do i+=je(n,r),r=n,n=n.return;while(n);return i}catch(d){return`
31
+ Error generating stack: `+d.message+`
32
+ `+d.stack}}var Fe=Object.prototype.hasOwnProperty,ua=e.unstable_scheduleCallback,da=e.unstable_cancelCallback,Ca=e.unstable_shouldYield,ei=e.unstable_requestPaint,Tt=e.unstable_now,Qi=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,ke=e.unstable_IdlePriority,yt=e.log,St=e.unstable_setDisableYieldValue,kt=null,wt=null;function ft(n){if(typeof yt=="function"&&St(n),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(kt,n)}catch(i){}}var ot=Math.clz32?Math.clz32:$o,fa=Math.log,en=Math.LN2;function $o(n){return n>>>=0,n===0?32:31-(fa(n)/en|0)|0}var Ps=256,qs=262144,Yi=4194304;function rn(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Na(n,i,r){var d=n.pendingLanes;if(d===0)return 0;var y=0,b=n.suspendedLanes,N=n.pingedLanes;n=n.warmLanes;var L=d&134217727;return L!==0?(d=L&~b,d!==0?y=rn(d):(N&=L,N!==0?y=rn(N):r||(r=L&~n,r!==0&&(y=rn(r))))):(L=d&~b,L!==0?y=rn(L):N!==0?y=rn(N):r||(r=d&~n,r!==0&&(y=rn(r)))),y===0?0:i!==0&&i!==y&&(i&b)===0&&(b=y&-y,r=i&-i,b>=r||b===32&&(r&4194048)!==0)?i:y}function In(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function Vs(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Gs(){var n=Yi;return Yi<<=1,(Yi&62914560)===0&&(Yi=4194304),n}function cl(n){for(var i=[],r=0;31>r;r++)i.push(n);return i}function Xi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function cd(n,i,r,d,y,b){var N=n.pendingLanes;n.pendingLanes=r,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=r,n.entangledLanes&=r,n.errorRecoveryDisabledLanes&=r,n.shellSuspendCounter=0;var L=n.entanglements,G=n.expirationTimes,ee=n.hiddenUpdates;for(r=N&~r;0<r;){var oe=31-ot(r),de=1<<oe;L[oe]=0,G[oe]=-1;var te=ee[oe];if(te!==null)for(ee[oe]=null,oe=0;oe<te.length;oe++){var ie=te[oe];ie!==null&&(ie.lane&=-536870913)}r&=~de}d!==0&&ul(n,d,0),b!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=b&~(N&~i))}function ul(n,i,r){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-ot(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|r&261930}function dl(n,i){var r=n.entangledLanes|=i;for(n=n.entanglements;r;){var d=31-ot(r),y=1<<d;y&i|n[d]&i&&(n[d]|=i),r&=~y}}function ti(n,i){var r=i&-i;return r=(r&42)!==0?1:Ks(r),(r&(n.suspendedLanes|i))!==0?0:r}function Ks(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fl(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Po(){var n=X.p;return n!==0?n:(n=window.event,n===void 0?32:D1(n.type))}function ni(n,i){var r=X.p;try{return X.p=n,i()}finally{X.p=r}}var na=Math.random().toString(36).slice(2),ne="__reactFiber$"+na,be="__reactProps$"+na,Re="__reactContainer$"+na,He="__reactEvents$"+na,Lt="__reactListeners$"+na,ha="__reactHandles$"+na,ja="__reactResources$"+na,ln="__reactMarker$"+na;function aa(n){delete n[ne],delete n[be],delete n[He],delete n[Lt],delete n[ha]}function ai(n){var i=n[ne];if(i)return i;for(var r=n.parentNode;r;){if(i=r[Re]||r[ne]){if(r=i.alternate,i.child!==null||r!==null&&r.child!==null)for(n=y1(n);n!==null;){if(r=n[ne])return r;n=y1(n)}return i}n=r,r=n.parentNode}return null}function Qs(n){if(n=n[ne]||n[Re]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function hl(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(s(33))}function Ys(n){var i=n[ja];return i||(i=n[ja]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Vt(n){n[ln]=!0}var Zp=new Set,Jp={};function Zi(n,i){Xs(n,i),Xs(n+"Capture",i)}function Xs(n,i){for(Jp[n]=i,n=0;n<i.length;n++)Zp.add(i[n])}var ZS=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]*$"),Wp={},eg={};function JS(n){return Fe.call(eg,n)?!0:Fe.call(Wp,n)?!1:ZS.test(n)?eg[n]=!0:(Wp[n]=!0,!1)}function qo(n,i,r){if(JS(i))if(r===null)n.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+r)}}function Vo(n,i,r){if(r===null)n.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+r)}}function Ea(n,i,r,d){if(d===null)n.removeAttribute(r);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttributeNS(i,r,""+d)}}function Un(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function tg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function WS(n,i,r){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof d!="undefined"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,b=d.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return y.call(this)},set:function(N){r=""+N,b.call(this,N)}}),Object.defineProperty(n,i,{enumerable:d.enumerable}),{getValue:function(){return r},setValue:function(N){r=""+N},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function ud(n){if(!n._valueTracker){var i=tg(n)?"checked":"value";n._valueTracker=WS(n,i,""+n[i])}}function ng(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var r=i.getValue(),d="";return n&&(d=tg(n)?n.checked?"true":"false":n.value),n=d,n!==r?(i.setValue(n),!0):!1}function Go(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(i){return n.body}}var ew=/[\n"\\]/g;function Bn(n){return n.replace(ew,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function dd(n,i,r,d,y,b,N,L){n.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?n.type=N:n.removeAttribute("type"),i!=null?N==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Un(i)):n.value!==""+Un(i)&&(n.value=""+Un(i)):N!=="submit"&&N!=="reset"||n.removeAttribute("value"),i!=null?fd(n,N,Un(i)):r!=null?fd(n,N,Un(r)):d!=null&&n.removeAttribute("value"),y==null&&b!=null&&(n.defaultChecked=!!b),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?n.name=""+Un(L):n.removeAttribute("name")}function ag(n,i,r,d,y,b,N,L){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(n.type=b),i!=null||r!=null){if(!(b!=="submit"&&b!=="reset"||i!=null)){ud(n);return}r=r!=null?""+Un(r):"",i=i!=null?""+Un(i):r,L||i===n.value||(n.value=i),n.defaultValue=i}d=d!=null?d:y,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=L?n.checked:!!d,n.defaultChecked=!!d,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(n.name=N),ud(n)}function fd(n,i,r){i==="number"&&Go(n.ownerDocument)===n||n.defaultValue===""+r||(n.defaultValue=""+r)}function Zs(n,i,r,d){if(n=n.options,i){i={};for(var y=0;y<r.length;y++)i["$"+r[y]]=!0;for(r=0;r<n.length;r++)y=i.hasOwnProperty("$"+n[r].value),n[r].selected!==y&&(n[r].selected=y),y&&d&&(n[r].defaultSelected=!0)}else{for(r=""+Un(r),i=null,y=0;y<n.length;y++){if(n[y].value===r){n[y].selected=!0,d&&(n[y].defaultSelected=!0);return}i!==null||n[y].disabled||(i=n[y])}i!==null&&(i.selected=!0)}}function ig(n,i,r){if(i!=null&&(i=""+Un(i),i!==n.value&&(n.value=i),r==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=r!=null?""+Un(r):""}function sg(n,i,r,d){if(i==null){if(d!=null){if(r!=null)throw Error(s(92));if(K(d)){if(1<d.length)throw Error(s(93));d=d[0]}r=d}r==null&&(r=""),i=r}r=Un(i),n.defaultValue=r,d=n.textContent,d===r&&d!==""&&d!==null&&(n.value=d),ud(n)}function Js(n,i){if(i){var r=n.firstChild;if(r&&r===n.lastChild&&r.nodeType===3){r.nodeValue=i;return}}n.textContent=i}var tw=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 rg(n,i,r){var d=i.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,r):typeof r!="number"||r===0||tw.has(i)?i==="float"?n.cssFloat=r:n[i]=(""+r).trim():n[i]=r+"px"}function lg(n,i,r){if(i!=null&&typeof i!="object")throw Error(s(62));if(n=n.style,r!=null){for(var d in r)!r.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var y in i)d=i[y],i.hasOwnProperty(y)&&r[y]!==d&&rg(n,y,d)}else for(var b in i)i.hasOwnProperty(b)&&rg(n,b,i[b])}function hd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 nw=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"],["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"]]),aw=/^[\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 Ko(n){return aw.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ka(){}var md=null;function pd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ws=null,er=null;function og(n){var i=Qs(n);if(i&&(n=i.stateNode)){var r=n[be]||null;e:switch(n=i.stateNode,i.type){case"input":if(dd(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),i=r.name,r.type==="radio"&&i!=null){for(r=n;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Bn(""+i)+'"][type="radio"]'),i=0;i<r.length;i++){var d=r[i];if(d!==n&&d.form===n.form){var y=d[be]||null;if(!y)throw Error(s(90));dd(d,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<r.length;i++)d=r[i],d.form===n.form&&ng(d)}break e;case"textarea":ig(n,r.value,r.defaultValue);break e;case"select":i=r.value,i!=null&&Zs(n,!!r.multiple,i,!1)}}}var gd=!1;function cg(n,i,r){if(gd)return n(i,r);gd=!0;try{var d=n(i);return d}finally{if(gd=!1,(Ws!==null||er!==null)&&(Lc(),Ws&&(i=Ws,n=er,er=Ws=null,og(i),n)))for(i=0;i<n.length;i++)og(n[i])}}function ml(n,i){var r=n.stateNode;if(r===null)return null;var d=r[be]||null;if(d===null)return null;r=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(r&&typeof r!="function")throw Error(s(231,i,typeof r));return r}var Ra=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),yd=!1;if(Ra)try{var pl={};Object.defineProperty(pl,"passive",{get:function(){yd=!0}}),window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch(n){yd=!1}var ii=null,vd=null,Qo=null;function ug(){if(Qo)return Qo;var n,i=vd,r=i.length,d,y="value"in ii?ii.value:ii.textContent,b=y.length;for(n=0;n<r&&i[n]===y[n];n++);var N=r-n;for(d=1;d<=N&&i[r-d]===y[b-d];d++);return Qo=y.slice(n,1<d?1-d:void 0)}function Yo(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Xo(){return!0}function dg(){return!1}function fn(n){function i(r,d,y,b,N){this._reactName=r,this._targetInst=y,this.type=d,this.nativeEvent=b,this.target=N,this.currentTarget=null;for(var L in n)n.hasOwnProperty(L)&&(r=n[L],this[L]=r?r(b):b[L]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Xo:dg,this.isPropagationStopped=dg,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),i}var Ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zo=fn(Ji),gl=p({},Ji,{view:0,detail:0}),iw=fn(gl),bd,xd,yl,Jo=p({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==yl&&(yl&&n.type==="mousemove"?(bd=n.screenX-yl.screenX,xd=n.screenY-yl.screenY):xd=bd=0,yl=n),bd)},movementY:function(n){return"movementY"in n?n.movementY:xd}}),fg=fn(Jo),sw=p({},Jo,{dataTransfer:0}),rw=fn(sw),lw=p({},gl,{relatedTarget:0}),_d=fn(lw),ow=p({},Ji,{animationName:0,elapsedTime:0,pseudoElement:0}),cw=fn(ow),uw=p({},Ji,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),dw=fn(uw),fw=p({},Ji,{data:0}),hg=fn(fw),hw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mw={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"},pw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gw(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=pw[n])?!!i[n]:!1}function Sd(){return gw}var yw=p({},gl,{key:function(n){if(n.key){var i=hw[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Yo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?mw[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sd,charCode:function(n){return n.type==="keypress"?Yo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Yo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),vw=fn(yw),bw=p({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mg=fn(bw),xw=p({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sd}),_w=fn(xw),Sw=p({},Ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),ww=fn(Sw),Cw=p({},Jo,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Nw=fn(Cw),jw=p({},Ji,{newState:0,oldState:0}),Ew=fn(jw),kw=[9,13,27,32],wd=Ra&&"CompositionEvent"in window,vl=null;Ra&&"documentMode"in document&&(vl=document.documentMode);var Rw=Ra&&"TextEvent"in window&&!vl,pg=Ra&&(!wd||vl&&8<vl&&11>=vl),gg=" ",yg=!1;function vg(n,i){switch(n){case"keyup":return kw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var tr=!1;function Tw(n,i){switch(n){case"compositionend":return bg(i);case"keypress":return i.which!==32?null:(yg=!0,gg);case"textInput":return n=i.data,n===gg&&yg?null:n;default:return null}}function Mw(n,i){if(tr)return n==="compositionend"||!wd&&vg(n,i)?(n=ug(),Qo=vd=ii=null,tr=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return pg&&i.locale!=="ko"?null:i.data;default:return null}}var Aw={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 xg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!Aw[n.type]:i==="textarea"}function _g(n,i,r,d){Ws?er?er.push(d):er=[d]:Ws=d,i=Hc(i,"onChange"),0<i.length&&(r=new Zo("onChange","change",null,r,d),n.push({event:r,listeners:i}))}var bl=null,xl=null;function Dw(n){a1(n,0)}function Wo(n){var i=hl(n);if(ng(i))return n}function Sg(n,i){if(n==="change")return i}var wg=!1;if(Ra){var Cd;if(Ra){var Nd="oninput"in document;if(!Nd){var Cg=document.createElement("div");Cg.setAttribute("oninput","return;"),Nd=typeof Cg.oninput=="function"}Cd=Nd}else Cd=!1;wg=Cd&&(!document.documentMode||9<document.documentMode)}function Ng(){bl&&(bl.detachEvent("onpropertychange",jg),xl=bl=null)}function jg(n){if(n.propertyName==="value"&&Wo(xl)){var i=[];_g(i,xl,n,pd(n)),cg(Dw,i)}}function Lw(n,i,r){n==="focusin"?(Ng(),bl=i,xl=r,bl.attachEvent("onpropertychange",jg)):n==="focusout"&&Ng()}function Ow(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Wo(xl)}function zw(n,i){if(n==="click")return Wo(i)}function Iw(n,i){if(n==="input"||n==="change")return Wo(i)}function Uw(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Nn=typeof Object.is=="function"?Object.is:Uw;function _l(n,i){if(Nn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var r=Object.keys(n),d=Object.keys(i);if(r.length!==d.length)return!1;for(d=0;d<r.length;d++){var y=r[d];if(!Fe.call(i,y)||!Nn(n[y],i[y]))return!1}return!0}function Eg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function kg(n,i){var r=Eg(n);n=0;for(var d;r;){if(r.nodeType===3){if(d=n+r.textContent.length,n<=i&&d>=i)return{node:r,offset:i-n};n=d}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Eg(r)}}function Rg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Rg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Tg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Go(n.document);i instanceof n.HTMLIFrameElement;){try{var r=typeof i.contentWindow.location.href=="string"}catch(d){r=!1}if(r)n=i.contentWindow;else break;i=Go(n.document)}return i}function jd(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var Bw=Ra&&"documentMode"in document&&11>=document.documentMode,nr=null,Ed=null,Sl=null,kd=!1;function Mg(n,i,r){var d=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kd||nr==null||nr!==Go(d)||(d=nr,"selectionStart"in d&&jd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Sl&&_l(Sl,d)||(Sl=d,d=Hc(Ed,"onSelect"),0<d.length&&(i=new Zo("onSelect","select",null,i,r),n.push({event:i,listeners:d}),i.target=nr)))}function Wi(n,i){var r={};return r[n.toLowerCase()]=i.toLowerCase(),r["Webkit"+n]="webkit"+i,r["Moz"+n]="moz"+i,r}var ar={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionrun:Wi("Transition","TransitionRun"),transitionstart:Wi("Transition","TransitionStart"),transitioncancel:Wi("Transition","TransitionCancel"),transitionend:Wi("Transition","TransitionEnd")},Rd={},Ag={};Ra&&(Ag=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function es(n){if(Rd[n])return Rd[n];if(!ar[n])return n;var i=ar[n],r;for(r in i)if(i.hasOwnProperty(r)&&r in Ag)return Rd[n]=i[r];return n}var Dg=es("animationend"),Lg=es("animationiteration"),Og=es("animationstart"),Fw=es("transitionrun"),Hw=es("transitionstart"),$w=es("transitioncancel"),zg=es("transitionend"),Ig=new Map,Td="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");Td.push("scrollEnd");function ia(n,i){Ig.set(n,i),Zi(i,[n])}var ec=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Fn=[],ir=0,Md=0;function tc(){for(var n=ir,i=Md=ir=0;i<n;){var r=Fn[i];Fn[i++]=null;var d=Fn[i];Fn[i++]=null;var y=Fn[i];Fn[i++]=null;var b=Fn[i];if(Fn[i++]=null,d!==null&&y!==null){var N=d.pending;N===null?y.next=y:(y.next=N.next,N.next=y),d.pending=y}b!==0&&Ug(r,y,b)}}function nc(n,i,r,d){Fn[ir++]=n,Fn[ir++]=i,Fn[ir++]=r,Fn[ir++]=d,Md|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function Ad(n,i,r,d){return nc(n,i,r,d),ac(n)}function ts(n,i){return nc(n,null,null,i),ac(n)}function Ug(n,i,r){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r);for(var y=!1,b=n.return;b!==null;)b.childLanes|=r,d=b.alternate,d!==null&&(d.childLanes|=r),b.tag===22&&(n=b.stateNode,n===null||n._visibility&1||(y=!0)),n=b,b=b.return;return n.tag===3?(b=n.stateNode,y&&i!==null&&(y=31-ot(r),n=b.hiddenUpdates,d=n[y],d===null?n[y]=[i]:d.push(i),i.lane=r|536870912),b):null}function ac(n){if(50<ql)throw ql=0,$f=null,Error(s(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var sr={};function Pw(n,i,r,d){this.tag=n,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(n,i,r,d){return new Pw(n,i,r,d)}function Dd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ta(n,i){var r=n.alternate;return r===null?(r=jn(n.tag,i,n.key,n.mode),r.elementType=n.elementType,r.type=n.type,r.stateNode=n.stateNode,r.alternate=n,n.alternate=r):(r.pendingProps=i,r.type=n.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=n.flags&65011712,r.childLanes=n.childLanes,r.lanes=n.lanes,r.child=n.child,r.memoizedProps=n.memoizedProps,r.memoizedState=n.memoizedState,r.updateQueue=n.updateQueue,i=n.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},r.sibling=n.sibling,r.index=n.index,r.ref=n.ref,r.refCleanup=n.refCleanup,r}function Bg(n,i){n.flags&=65011714;var r=n.alternate;return r===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=r.childLanes,n.lanes=r.lanes,n.child=r.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=r.memoizedProps,n.memoizedState=r.memoizedState,n.updateQueue=r.updateQueue,n.type=r.type,i=r.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function ic(n,i,r,d,y,b){var N=0;if(d=n,typeof n=="function")Dd(n)&&(N=1);else if(typeof n=="string")N=QC(n,r,se.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case q:return n=jn(31,r,i,y),n.elementType=q,n.lanes=b,n;case S:return ns(r.children,y,b,i);case w:N=8,y|=24;break;case C:return n=jn(12,r,i,y|2),n.elementType=C,n.lanes=b,n;case O:return n=jn(13,r,i,y),n.elementType=O,n.lanes=b,n;case z:return n=jn(19,r,i,y),n.elementType=z,n.lanes=b,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case j:N=10;break e;case k:N=9;break e;case E:N=11;break e;case I:N=14;break e;case B:N=16,d=null;break e}N=29,r=Error(s(130,n===null?"null":typeof n,"")),d=null}return i=jn(N,r,i,y),i.elementType=n,i.type=d,i.lanes=b,i}function ns(n,i,r,d){return n=jn(7,n,d,i),n.lanes=r,n}function Ld(n,i,r){return n=jn(6,n,null,i),n.lanes=r,n}function Fg(n){var i=jn(18,null,null,0);return i.stateNode=n,i}function Od(n,i,r){return i=jn(4,n.children!==null?n.children:[],n.key,i),i.lanes=r,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Hg=new WeakMap;function Hn(n,i){if(typeof n=="object"&&n!==null){var r=Hg.get(n);return r!==void 0?r:(i={value:n,source:i,stack:lt(i)},Hg.set(n,i),i)}return{value:n,source:i,stack:lt(i)}}var rr=[],lr=0,sc=null,wl=0,$n=[],Pn=0,si=null,ma=1,pa="";function Ma(n,i){rr[lr++]=wl,rr[lr++]=sc,sc=n,wl=i}function $g(n,i,r){$n[Pn++]=ma,$n[Pn++]=pa,$n[Pn++]=si,si=n;var d=ma;n=pa;var y=32-ot(d)-1;d&=~(1<<y),r+=1;var b=32-ot(i)+y;if(30<b){var N=y-y%5;b=(d&(1<<N)-1).toString(32),d>>=N,y-=N,ma=1<<32-ot(i)+y|r<<y|d,pa=b+n}else ma=1<<b|r<<y|d,pa=n}function zd(n){n.return!==null&&(Ma(n,1),$g(n,1,0))}function Id(n){for(;n===sc;)sc=rr[--lr],rr[lr]=null,wl=rr[--lr],rr[lr]=null;for(;n===si;)si=$n[--Pn],$n[Pn]=null,pa=$n[--Pn],$n[Pn]=null,ma=$n[--Pn],$n[Pn]=null}function Pg(n,i){$n[Pn++]=ma,$n[Pn++]=pa,$n[Pn++]=si,ma=i.id,pa=i.overflow,si=n}var Yt=null,Nt=null,Je=!1,ri=null,qn=!1,Ud=Error(s(519));function li(n){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cl(Hn(i,n)),Ud}function qg(n){var i=n.stateNode,r=n.type,d=n.memoizedProps;switch(i[ne]=n,i[be]=d,r){case"dialog":Ke("cancel",i),Ke("close",i);break;case"iframe":case"object":case"embed":Ke("load",i);break;case"video":case"audio":for(r=0;r<Gl.length;r++)Ke(Gl[r],i);break;case"source":Ke("error",i);break;case"img":case"image":case"link":Ke("error",i),Ke("load",i);break;case"details":Ke("toggle",i);break;case"input":Ke("invalid",i),ag(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ke("invalid",i);break;case"textarea":Ke("invalid",i),sg(i,d.value,d.defaultValue,d.children)}r=d.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||i.textContent===""+r||d.suppressHydrationWarning===!0||l1(i.textContent,r)?(d.popover!=null&&(Ke("beforetoggle",i),Ke("toggle",i)),d.onScroll!=null&&Ke("scroll",i),d.onScrollEnd!=null&&Ke("scrollend",i),d.onClick!=null&&(i.onclick=ka),i=!0):i=!1,i||li(n,!0)}function Vg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:Yt=Yt.return}}function or(n){if(n!==Yt)return!1;if(!Je)return Vg(n),Je=!0,!1;var i=n.tag,r;if((r=i!==3&&i!==27)&&((r=i===5)&&(r=n.type,r=!(r!=="form"&&r!=="button")||ah(n.type,n.memoizedProps)),r=!r),r&&Nt&&li(n),Vg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Nt=g1(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Nt=g1(n)}else i===27?(i=Nt,_i(n.type)?(n=oh,oh=null,Nt=n):Nt=i):Nt=Yt?Gn(n.stateNode.nextSibling):null;return!0}function as(){Nt=Yt=null,Je=!1}function Bd(){var n=ri;return n!==null&&(gn===null?gn=n:gn.push.apply(gn,n),ri=null),n}function Cl(n){ri===null?ri=[n]:ri.push(n)}var Fd=ce(null),is=null,Aa=null;function oi(n,i,r){M(Fd,i._currentValue),i._currentValue=r}function Da(n){n._currentValue=Fd.current,he(Fd)}function Hd(n,i,r){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===r)break;n=n.return}}function $d(n,i,r,d){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var b=y.dependencies;if(b!==null){var N=y.child;b=b.firstContext;e:for(;b!==null;){var L=b;b=y;for(var G=0;G<i.length;G++)if(L.context===i[G]){b.lanes|=r,L=b.alternate,L!==null&&(L.lanes|=r),Hd(b.return,r,n),d||(N=null);break e}b=L.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(s(341));N.lanes|=r,b=N.alternate,b!==null&&(b.lanes|=r),Hd(N,r,n),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===n){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function cr(n,i,r,d){n=null;for(var y=i,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var L=y.type;Nn(y.pendingProps.value,N.value)||(n!==null?n.push(L):n=[L])}}else if(y===Se.current){if(N=y.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(Zl):n=[Zl])}y=y.return}n!==null&&$d(i,n,r,d),i.flags|=262144}function rc(n){for(n=n.firstContext;n!==null;){if(!Nn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ss(n){is=n,Aa=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Xt(n){return Gg(is,n)}function lc(n,i){return is===null&&ss(n),Gg(n,i)}function Gg(n,i){var r=i._currentValue;if(i={context:i,memoizedValue:r,next:null},Aa===null){if(n===null)throw Error(s(308));Aa=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Aa=Aa.next=i;return r}var qw=typeof AbortController!="undefined"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(r,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(r){return r()})}},Vw=e.unstable_scheduleCallback,Gw=e.unstable_NormalPriority,It={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pd(){return{controller:new qw,data:new Map,refCount:0}}function Nl(n){n.refCount--,n.refCount===0&&Vw(Gw,function(){n.controller.abort()})}var jl=null,qd=0,ur=0,dr=null;function Kw(n,i){if(jl===null){var r=jl=[];qd=0,ur=Qf(),dr={status:"pending",value:void 0,then:function(d){r.push(d)}}}return qd++,i.then(Kg,Kg),i}function Kg(){if(--qd===0&&jl!==null){dr!==null&&(dr.status="fulfilled");var n=jl;jl=null,ur=0,dr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function Qw(n,i){var r=[],d={status:"pending",value:null,reason:null,then:function(y){r.push(y)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var y=0;y<r.length;y++)(0,r[y])(i)},function(y){for(d.status="rejected",d.reason=y,y=0;y<r.length;y++)(0,r[y])(void 0)}),d}var Qg=H.S;H.S=function(n,i){Mv=Tt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Kw(n,i),Qg!==null&&Qg(n,i)};var rs=ce(null);function Vd(){var n=rs.current;return n!==null?n:vt.pooledCache}function oc(n,i){i===null?M(rs,rs.current):M(rs,i.pool)}function Yg(){var n=Vd();return n===null?null:{parent:It._currentValue,pool:n}}var fr=Error(s(460)),Gd=Error(s(474)),cc=Error(s(542)),uc={then:function(){}};function Xg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Zg(n,i,r){switch(r=n[r],r===void 0?n.push(i):r!==i&&(i.then(ka,ka),i=r),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n;default:if(typeof i.status=="string")i.then(ka,ka);else{if(n=vt,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=d}},function(d){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n}throw os=i,fr}}function ls(n){try{var i=n._init;return i(n._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(os=r,fr):r}}var os=null;function Jg(){if(os===null)throw Error(s(459));var n=os;return os=null,n}function Wg(n){if(n===fr||n===cc)throw Error(s(483))}var hr=null,El=0;function dc(n){var i=El;return El+=1,hr===null&&(hr=[]),Zg(hr,n,i)}function kl(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function fc(n,i){throw i.$$typeof===v?Error(s(525)):(n=Object.prototype.toString.call(i),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ey(n){function i(J,Z){if(n){var W=J.deletions;W===null?(J.deletions=[Z],J.flags|=16):W.push(Z)}}function r(J,Z){if(!n)return null;for(;Z!==null;)i(J,Z),Z=Z.sibling;return null}function d(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function y(J,Z){return J=Ta(J,Z),J.index=0,J.sibling=null,J}function b(J,Z,W){return J.index=W,n?(W=J.alternate,W!==null?(W=W.index,W<Z?(J.flags|=67108866,Z):W):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function N(J){return n&&J.alternate===null&&(J.flags|=67108866),J}function L(J,Z,W,ue){return Z===null||Z.tag!==6?(Z=Ld(W,J.mode,ue),Z.return=J,Z):(Z=y(Z,W),Z.return=J,Z)}function G(J,Z,W,ue){var Me=W.type;return Me===S?oe(J,Z,W.props.children,ue,W.key):Z!==null&&(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===B&&ls(Me)===Z.type)?(Z=y(Z,W.props),kl(Z,W),Z.return=J,Z):(Z=ic(W.type,W.key,W.props,null,J.mode,ue),kl(Z,W),Z.return=J,Z)}function ee(J,Z,W,ue){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==W.containerInfo||Z.stateNode.implementation!==W.implementation?(Z=Od(W,J.mode,ue),Z.return=J,Z):(Z=y(Z,W.children||[]),Z.return=J,Z)}function oe(J,Z,W,ue,Me){return Z===null||Z.tag!==7?(Z=ns(W,J.mode,ue,Me),Z.return=J,Z):(Z=y(Z,W),Z.return=J,Z)}function de(J,Z,W){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Ld(""+Z,J.mode,W),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return W=ic(Z.type,Z.key,Z.props,null,J.mode,W),kl(W,Z),W.return=J,W;case _:return Z=Od(Z,J.mode,W),Z.return=J,Z;case B:return Z=ls(Z),de(J,Z,W)}if(K(Z)||F(Z))return Z=ns(Z,J.mode,W,null),Z.return=J,Z;if(typeof Z.then=="function")return de(J,dc(Z),W);if(Z.$$typeof===j)return de(J,lc(J,Z),W);fc(J,Z)}return null}function te(J,Z,W,ue){var Me=Z!==null?Z.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Me!==null?null:L(J,Z,""+W,ue);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===Me?G(J,Z,W,ue):null;case _:return W.key===Me?ee(J,Z,W,ue):null;case B:return W=ls(W),te(J,Z,W,ue)}if(K(W)||F(W))return Me!==null?null:oe(J,Z,W,ue,null);if(typeof W.then=="function")return te(J,Z,dc(W),ue);if(W.$$typeof===j)return te(J,Z,lc(J,W),ue);fc(J,W)}return null}function ie(J,Z,W,ue,Me){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(W)||null,L(Z,J,""+ue,Me);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return J=J.get(ue.key===null?W:ue.key)||null,G(Z,J,ue,Me);case _:return J=J.get(ue.key===null?W:ue.key)||null,ee(Z,J,ue,Me);case B:return ue=ls(ue),ie(J,Z,W,ue,Me)}if(K(ue)||F(ue))return J=J.get(W)||null,oe(Z,J,ue,Me,null);if(typeof ue.then=="function")return ie(J,Z,W,dc(ue),Me);if(ue.$$typeof===j)return ie(J,Z,W,lc(Z,ue),Me);fc(Z,ue)}return null}function we(J,Z,W,ue){for(var Me=null,nt=null,Ne=Z,Pe=Z=0,Xe=null;Ne!==null&&Pe<W.length;Pe++){Ne.index>Pe?(Xe=Ne,Ne=null):Xe=Ne.sibling;var at=te(J,Ne,W[Pe],ue);if(at===null){Ne===null&&(Ne=Xe);break}n&&Ne&&at.alternate===null&&i(J,Ne),Z=b(at,Z,Pe),nt===null?Me=at:nt.sibling=at,nt=at,Ne=Xe}if(Pe===W.length)return r(J,Ne),Je&&Ma(J,Pe),Me;if(Ne===null){for(;Pe<W.length;Pe++)Ne=de(J,W[Pe],ue),Ne!==null&&(Z=b(Ne,Z,Pe),nt===null?Me=Ne:nt.sibling=Ne,nt=Ne);return Je&&Ma(J,Pe),Me}for(Ne=d(Ne);Pe<W.length;Pe++)Xe=ie(Ne,J,Pe,W[Pe],ue),Xe!==null&&(n&&Xe.alternate!==null&&Ne.delete(Xe.key===null?Pe:Xe.key),Z=b(Xe,Z,Pe),nt===null?Me=Xe:nt.sibling=Xe,nt=Xe);return n&&Ne.forEach(function(ji){return i(J,ji)}),Je&&Ma(J,Pe),Me}function Le(J,Z,W,ue){if(W==null)throw Error(s(151));for(var Me=null,nt=null,Ne=Z,Pe=Z=0,Xe=null,at=W.next();Ne!==null&&!at.done;Pe++,at=W.next()){Ne.index>Pe?(Xe=Ne,Ne=null):Xe=Ne.sibling;var ji=te(J,Ne,at.value,ue);if(ji===null){Ne===null&&(Ne=Xe);break}n&&Ne&&ji.alternate===null&&i(J,Ne),Z=b(ji,Z,Pe),nt===null?Me=ji:nt.sibling=ji,nt=ji,Ne=Xe}if(at.done)return r(J,Ne),Je&&Ma(J,Pe),Me;if(Ne===null){for(;!at.done;Pe++,at=W.next())at=de(J,at.value,ue),at!==null&&(Z=b(at,Z,Pe),nt===null?Me=at:nt.sibling=at,nt=at);return Je&&Ma(J,Pe),Me}for(Ne=d(Ne);!at.done;Pe++,at=W.next())at=ie(Ne,J,Pe,at.value,ue),at!==null&&(n&&at.alternate!==null&&Ne.delete(at.key===null?Pe:at.key),Z=b(at,Z,Pe),nt===null?Me=at:nt.sibling=at,nt=at);return n&&Ne.forEach(function(sN){return i(J,sN)}),Je&&Ma(J,Pe),Me}function pt(J,Z,W,ue){if(typeof W=="object"&&W!==null&&W.type===S&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:e:{for(var Me=W.key;Z!==null;){if(Z.key===Me){if(Me=W.type,Me===S){if(Z.tag===7){r(J,Z.sibling),ue=y(Z,W.props.children),ue.return=J,J=ue;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===B&&ls(Me)===Z.type){r(J,Z.sibling),ue=y(Z,W.props),kl(ue,W),ue.return=J,J=ue;break e}r(J,Z);break}else i(J,Z);Z=Z.sibling}W.type===S?(ue=ns(W.props.children,J.mode,ue,W.key),ue.return=J,J=ue):(ue=ic(W.type,W.key,W.props,null,J.mode,ue),kl(ue,W),ue.return=J,J=ue)}return N(J);case _:e:{for(Me=W.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===W.containerInfo&&Z.stateNode.implementation===W.implementation){r(J,Z.sibling),ue=y(Z,W.children||[]),ue.return=J,J=ue;break e}else{r(J,Z);break}else i(J,Z);Z=Z.sibling}ue=Od(W,J.mode,ue),ue.return=J,J=ue}return N(J);case B:return W=ls(W),pt(J,Z,W,ue)}if(K(W))return we(J,Z,W,ue);if(F(W)){if(Me=F(W),typeof Me!="function")throw Error(s(150));return W=Me.call(W),Le(J,Z,W,ue)}if(typeof W.then=="function")return pt(J,Z,dc(W),ue);if(W.$$typeof===j)return pt(J,Z,lc(J,W),ue);fc(J,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Z!==null&&Z.tag===6?(r(J,Z.sibling),ue=y(Z,W),ue.return=J,J=ue):(r(J,Z),ue=Ld(W,J.mode,ue),ue.return=J,J=ue),N(J)):r(J,Z)}return function(J,Z,W,ue){try{El=0;var Me=pt(J,Z,W,ue);return hr=null,Me}catch(Ne){if(Ne===fr||Ne===cc)throw Ne;var nt=jn(29,Ne,null,J.mode);return nt.lanes=ue,nt.return=J,nt}finally{}}}var cs=ey(!0),ty=ey(!1),ci=!1;function Kd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ui(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function di(n,i,r){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(it&2)!==0){var y=d.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),d.pending=i,i=ac(n),Ug(n,null,r),i}return nc(n,d,i,r),ac(n)}function Rl(n,i,r){if(i=i.updateQueue,i!==null&&(i=i.shared,(r&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,r|=d,i.lanes=r,dl(n,r)}}function Yd(n,i){var r=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,r===d)){var y=null,b=null;if(r=r.firstBaseUpdate,r!==null){do{var N={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};b===null?y=b=N:b=b.next=N,r=r.next}while(r!==null);b===null?y=b=i:b=b.next=i}else y=b=i;r={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},n.updateQueue=r;return}n=r.lastBaseUpdate,n===null?r.firstBaseUpdate=i:n.next=i,r.lastBaseUpdate=i}var Xd=!1;function Tl(){if(Xd){var n=dr;if(n!==null)throw n}}function Ml(n,i,r,d){Xd=!1;var y=n.updateQueue;ci=!1;var b=y.firstBaseUpdate,N=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var G=L,ee=G.next;G.next=null,N===null?b=ee:N.next=ee,N=G;var oe=n.alternate;oe!==null&&(oe=oe.updateQueue,L=oe.lastBaseUpdate,L!==N&&(L===null?oe.firstBaseUpdate=ee:L.next=ee,oe.lastBaseUpdate=G))}if(b!==null){var de=y.baseState;N=0,oe=ee=G=null,L=b;do{var te=L.lane&-536870913,ie=te!==L.lane;if(ie?(Ye&te)===te:(d&te)===te){te!==0&&te===ur&&(Xd=!0),oe!==null&&(oe=oe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var we=n,Le=L;te=i;var pt=r;switch(Le.tag){case 1:if(we=Le.payload,typeof we=="function"){de=we.call(pt,de,te);break e}de=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Le.payload,te=typeof we=="function"?we.call(pt,de,te):we,te==null)break e;de=p({},de,te);break e;case 2:ci=!0}}te=L.callback,te!==null&&(n.flags|=64,ie&&(n.flags|=8192),ie=y.callbacks,ie===null?y.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:L.tag,payload:L.payload,callback:L.callback,next:null},oe===null?(ee=oe=ie,G=de):oe=oe.next=ie,N|=te;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;ie=L,L=ie.next,ie.next=null,y.lastBaseUpdate=ie,y.shared.pending=null}}while(!0);oe===null&&(G=de),y.baseState=G,y.firstBaseUpdate=ee,y.lastBaseUpdate=oe,b===null&&(y.shared.lanes=0),gi|=N,n.lanes=N,n.memoizedState=de}}function ny(n,i){if(typeof n!="function")throw Error(s(191,n));n.call(i)}function ay(n,i){var r=n.callbacks;if(r!==null)for(n.callbacks=null,n=0;n<r.length;n++)ny(r[n],i)}var mr=ce(null),hc=ce(0);function iy(n,i){n=$a,M(hc,n),M(mr,i),$a=n|i.baseLanes}function Zd(){M(hc,$a),M(mr,mr.current)}function Jd(){$a=hc.current,he(mr),he(hc)}var En=ce(null),Vn=null;function fi(n){var i=n.alternate;M(Ot,Ot.current&1),M(En,n),Vn===null&&(i===null||mr.current!==null||i.memoizedState!==null)&&(Vn=n)}function Wd(n){M(Ot,Ot.current),M(En,n),Vn===null&&(Vn=n)}function sy(n){n.tag===22?(M(Ot,Ot.current),M(En,n),Vn===null&&(Vn=n)):hi()}function hi(){M(Ot,Ot.current),M(En,En.current)}function kn(n){he(En),Vn===n&&(Vn=null),he(Ot)}var Ot=ce(0);function mc(n){for(var i=n;i!==null;){if(i.tag===13){var r=i.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||rh(r)||lh(r)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var La=0,$e=null,ht=null,Ut=null,pc=!1,pr=!1,us=!1,gc=0,Al=0,gr=null,Yw=0;function Mt(){throw Error(s(321))}function ef(n,i){if(i===null)return!1;for(var r=0;r<i.length&&r<n.length;r++)if(!Nn(n[r],i[r]))return!1;return!0}function tf(n,i,r,d,y,b){return La=b,$e=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=n===null||n.memoizedState===null?$y:yf,us=!1,b=r(d,y),us=!1,pr&&(b=ly(i,r,d,y)),ry(n),b}function ry(n){H.H=Ol;var i=ht!==null&&ht.next!==null;if(La=0,Ut=ht=$e=null,pc=!1,Al=0,gr=null,i)throw Error(s(300));n===null||Bt||(n=n.dependencies,n!==null&&rc(n)&&(Bt=!0))}function ly(n,i,r,d){$e=n;var y=0;do{if(pr&&(gr=null),Al=0,pr=!1,25<=y)throw Error(s(301));if(y+=1,Ut=ht=null,n.updateQueue!=null){var b=n.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}H.H=Py,b=i(r,d)}while(pr);return b}function Xw(){var n=H.H,i=n.useState()[0];return i=typeof i.then=="function"?Dl(i):i,n=n.useState()[0],(ht!==null?ht.memoizedState:null)!==n&&($e.flags|=1024),i}function nf(){var n=gc!==0;return gc=0,n}function af(n,i,r){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~r}function sf(n){if(pc){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}pc=!1}La=0,Ut=ht=$e=null,pr=!1,Al=gc=0,gr=null}function on(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?$e.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function zt(){if(ht===null){var n=$e.alternate;n=n!==null?n.memoizedState:null}else n=ht.next;var i=Ut===null?$e.memoizedState:Ut.next;if(i!==null)Ut=i,ht=n;else{if(n===null)throw $e.alternate===null?Error(s(467)):Error(s(310));ht=n,n={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Ut===null?$e.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function yc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dl(n){var i=Al;return Al+=1,gr===null&&(gr=[]),n=Zg(gr,n,i),i=$e,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?$y:yf),n}function vc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Dl(n);if(n.$$typeof===j)return Xt(n)}throw Error(s(438,String(n)))}function rf(n){var i=null,r=$e.updateQueue;if(r!==null&&(i=r.memoCache),i==null){var d=$e.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),r===null&&(r=yc(),$e.updateQueue=r),r.memoCache=i,r=i.data[i.index],r===void 0)for(r=i.data[i.index]=Array(n),d=0;d<n;d++)r[d]=A;return i.index++,r}function Oa(n,i){return typeof i=="function"?i(n):i}function bc(n){var i=zt();return lf(i,ht,n)}function lf(n,i,r){var d=n.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=r;var y=n.baseQueue,b=d.pending;if(b!==null){if(y!==null){var N=y.next;y.next=b.next,b.next=N}i.baseQueue=y=b,d.pending=null}if(b=n.baseState,y===null)n.memoizedState=b;else{i=y.next;var L=N=null,G=null,ee=i,oe=!1;do{var de=ee.lane&-536870913;if(de!==ee.lane?(Ye&de)===de:(La&de)===de){var te=ee.revertLane;if(te===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),de===ur&&(oe=!0);else if((La&te)===te){ee=ee.next,te===ur&&(oe=!0);continue}else de={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(L=G=de,N=b):G=G.next=de,$e.lanes|=te,gi|=te;de=ee.action,us&&r(b,de),b=ee.hasEagerState?ee.eagerState:r(b,de)}else te={lane:de,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(L=G=te,N=b):G=G.next=te,$e.lanes|=de,gi|=de;ee=ee.next}while(ee!==null&&ee!==i);if(G===null?N=b:G.next=L,!Nn(b,n.memoizedState)&&(Bt=!0,oe&&(r=dr,r!==null)))throw r;n.memoizedState=b,n.baseState=N,n.baseQueue=G,d.lastRenderedState=b}return y===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function of(n){var i=zt(),r=i.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var d=r.dispatch,y=r.pending,b=i.memoizedState;if(y!==null){r.pending=null;var N=y=y.next;do b=n(b,N.action),N=N.next;while(N!==y);Nn(b,i.memoizedState)||(Bt=!0),i.memoizedState=b,i.baseQueue===null&&(i.baseState=b),r.lastRenderedState=b}return[b,d]}function oy(n,i,r){var d=$e,y=zt(),b=Je;if(b){if(r===void 0)throw Error(s(407));r=r()}else r=i();var N=!Nn((ht||y).memoizedState,r);if(N&&(y.memoizedState=r,Bt=!0),y=y.queue,df(dy.bind(null,d,y,n),[n]),y.getSnapshot!==i||N||Ut!==null&&Ut.memoizedState.tag&1){if(d.flags|=2048,yr(9,{destroy:void 0},uy.bind(null,d,y,r,i),null),vt===null)throw Error(s(349));b||(La&127)!==0||cy(d,i,r)}return r}function cy(n,i,r){n.flags|=16384,n={getSnapshot:i,value:r},i=$e.updateQueue,i===null?(i=yc(),$e.updateQueue=i,i.stores=[n]):(r=i.stores,r===null?i.stores=[n]:r.push(n))}function uy(n,i,r,d){i.value=r,i.getSnapshot=d,fy(i)&&hy(n)}function dy(n,i,r){return r(function(){fy(i)&&hy(n)})}function fy(n){var i=n.getSnapshot;n=n.value;try{var r=i();return!Nn(n,r)}catch(d){return!0}}function hy(n){var i=ts(n,2);i!==null&&yn(i,n,2)}function cf(n){var i=on();if(typeof n=="function"){var r=n;if(n=r(),us){ft(!0);try{r()}finally{ft(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:n},i}function my(n,i,r,d){return n.baseState=r,lf(n,ht,typeof d=="function"?d:Oa)}function Zw(n,i,r,d,y){if(Sc(n))throw Error(s(485));if(n=i.action,n!==null){var b={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){b.listeners.push(N)}};H.T!==null?r(!0):b.isTransition=!1,d(b),r=i.pending,r===null?(b.next=i.pending=b,py(i,b)):(b.next=r.next,i.pending=r.next=b)}}function py(n,i){var r=i.action,d=i.payload,y=n.state;if(i.isTransition){var b=H.T,N={};H.T=N;try{var L=r(y,d),G=H.S;G!==null&&G(N,L),gy(n,i,L)}catch(ee){uf(n,i,ee)}finally{b!==null&&N.types!==null&&(b.types=N.types),H.T=b}}else try{b=r(y,d),gy(n,i,b)}catch(ee){uf(n,i,ee)}}function gy(n,i,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(d){yy(n,i,d)},function(d){return uf(n,i,d)}):yy(n,i,r)}function yy(n,i,r){i.status="fulfilled",i.value=r,vy(i),n.state=r,i=n.pending,i!==null&&(r=i.next,r===i?n.pending=null:(r=r.next,i.next=r,py(n,r)))}function uf(n,i,r){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=r,vy(i),i=i.next;while(i!==d)}n.action=null}function vy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function by(n,i){return i}function xy(n,i){if(Je){var r=vt.formState;if(r!==null){e:{var d=$e;if(Je){if(Nt){t:{for(var y=Nt,b=qn;y.nodeType!==8;){if(!b){y=null;break t}if(y=Gn(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){Nt=Gn(y.nextSibling),d=y.data==="F!";break e}}li(d)}d=!1}d&&(i=r[0])}}return r=on(),r.memoizedState=r.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:by,lastRenderedState:i},r.queue=d,r=By.bind(null,$e,d),d.dispatch=r,d=cf(!1),b=gf.bind(null,$e,!1,d.queue),d=on(),y={state:i,dispatch:null,action:n,pending:null},d.queue=y,r=Zw.bind(null,$e,y,b,r),y.dispatch=r,d.memoizedState=n,[i,r,!1]}function _y(n){var i=zt();return Sy(i,ht,n)}function Sy(n,i,r){if(i=lf(n,i,by)[0],n=bc(Oa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Dl(i)}catch(N){throw N===fr?cc:N}else d=i;i=zt();var y=i.queue,b=y.dispatch;return r!==i.memoizedState&&($e.flags|=2048,yr(9,{destroy:void 0},Jw.bind(null,y,r),null)),[d,b,n]}function Jw(n,i){n.action=i}function wy(n){var i=zt(),r=ht;if(r!==null)return Sy(i,r,n);zt(),i=i.memoizedState,r=zt();var d=r.queue.dispatch;return r.memoizedState=n,[i,d,!1]}function yr(n,i,r,d){return n={tag:n,create:r,deps:d,inst:i,next:null},i=$e.updateQueue,i===null&&(i=yc(),$e.updateQueue=i),r=i.lastEffect,r===null?i.lastEffect=n.next=n:(d=r.next,r.next=n,n.next=d,i.lastEffect=n),n}function Cy(){return zt().memoizedState}function xc(n,i,r,d){var y=on();$e.flags|=n,y.memoizedState=yr(1|i,{destroy:void 0},r,d===void 0?null:d)}function _c(n,i,r,d){var y=zt();d=d===void 0?null:d;var b=y.memoizedState.inst;ht!==null&&d!==null&&ef(d,ht.memoizedState.deps)?y.memoizedState=yr(i,b,r,d):($e.flags|=n,y.memoizedState=yr(1|i,b,r,d))}function Ny(n,i){xc(8390656,8,n,i)}function df(n,i){_c(2048,8,n,i)}function Ww(n){$e.flags|=4;var i=$e.updateQueue;if(i===null)i=yc(),$e.updateQueue=i,i.events=[n];else{var r=i.events;r===null?i.events=[n]:r.push(n)}}function jy(n){var i=zt().memoizedState;return Ww({ref:i,nextImpl:n}),function(){if((it&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Ey(n,i){return _c(4,2,n,i)}function ky(n,i){return _c(4,4,n,i)}function Ry(n,i){if(typeof i=="function"){n=n();var r=i(n);return function(){typeof r=="function"?r():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ty(n,i,r){r=r!=null?r.concat([n]):null,_c(4,4,Ry.bind(null,i,n),r)}function ff(){}function My(n,i){var r=zt();i=i===void 0?null:i;var d=r.memoizedState;return i!==null&&ef(i,d[1])?d[0]:(r.memoizedState=[n,i],n)}function Ay(n,i){var r=zt();i=i===void 0?null:i;var d=r.memoizedState;if(i!==null&&ef(i,d[1]))return d[0];if(d=n(),us){ft(!0);try{n()}finally{ft(!1)}}return r.memoizedState=[d,i],d}function hf(n,i,r){return r===void 0||(La&1073741824)!==0&&(Ye&261930)===0?n.memoizedState=i:(n.memoizedState=r,n=Dv(),$e.lanes|=n,gi|=n,r)}function Dy(n,i,r,d){return Nn(r,i)?r:mr.current!==null?(n=hf(n,r,d),Nn(n,i)||(Bt=!0),n):(La&42)===0||(La&1073741824)!==0&&(Ye&261930)===0?(Bt=!0,n.memoizedState=r):(n=Dv(),$e.lanes|=n,gi|=n,i)}function Ly(n,i,r,d,y){var b=X.p;X.p=b!==0&&8>b?b:8;var N=H.T,L={};H.T=L,gf(n,!1,i,r);try{var G=y(),ee=H.S;if(ee!==null&&ee(L,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var oe=Qw(G,d);Ll(n,i,oe,Mn(n))}else Ll(n,i,d,Mn(n))}catch(de){Ll(n,i,{then:function(){},status:"rejected",reason:de},Mn())}finally{X.p=b,N!==null&&L.types!==null&&(N.types=L.types),H.T=N}}function eC(){}function mf(n,i,r,d){if(n.tag!==5)throw Error(s(476));var y=Oy(n).queue;Ly(n,y,i,P,r===null?eC:function(){return zy(n),r(d)})}function Oy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:P},next:null};var r={};return i.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:r},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function zy(n){var i=Oy(n);i.next===null&&(i=n.alternate.memoizedState),Ll(n,i.next.queue,{},Mn())}function pf(){return Xt(Zl)}function Iy(){return zt().memoizedState}function Uy(){return zt().memoizedState}function tC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var r=Mn();n=ui(r);var d=di(i,n,r);d!==null&&(yn(d,i,r),Rl(d,i,r)),i={cache:Pd()},n.payload=i;return}i=i.return}}function nC(n,i,r){var d=Mn();r={lane:d,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Sc(n)?Fy(i,r):(r=Ad(n,i,r,d),r!==null&&(yn(r,n,d),Hy(r,i,d)))}function By(n,i,r){var d=Mn();Ll(n,i,r,d)}function Ll(n,i,r,d){var y={lane:d,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Sc(n))Fy(i,y);else{var b=n.alternate;if(n.lanes===0&&(b===null||b.lanes===0)&&(b=i.lastRenderedReducer,b!==null))try{var N=i.lastRenderedState,L=b(N,r);if(y.hasEagerState=!0,y.eagerState=L,Nn(L,N))return nc(n,i,y,0),vt===null&&tc(),!1}catch(G){}finally{}if(r=Ad(n,i,y,d),r!==null)return yn(r,n,d),Hy(r,i,d),!0}return!1}function gf(n,i,r,d){if(d={lane:2,revertLane:Qf(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Sc(n)){if(i)throw Error(s(479))}else i=Ad(n,r,d,2),i!==null&&yn(i,n,2)}function Sc(n){var i=n.alternate;return n===$e||i!==null&&i===$e}function Fy(n,i){pr=pc=!0;var r=n.pending;r===null?i.next=i:(i.next=r.next,r.next=i),n.pending=i}function Hy(n,i,r){if((r&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,r|=d,i.lanes=r,dl(n,r)}}var Ol={readContext:Xt,use:vc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};Ol.useEffectEvent=Mt;var $y={readContext:Xt,use:vc,useCallback:function(n,i){return on().memoizedState=[n,i===void 0?null:i],n},useContext:Xt,useEffect:Ny,useImperativeHandle:function(n,i,r){r=r!=null?r.concat([n]):null,xc(4194308,4,Ry.bind(null,i,n),r)},useLayoutEffect:function(n,i){return xc(4194308,4,n,i)},useInsertionEffect:function(n,i){xc(4,2,n,i)},useMemo:function(n,i){var r=on();i=i===void 0?null:i;var d=n();if(us){ft(!0);try{n()}finally{ft(!1)}}return r.memoizedState=[d,i],d},useReducer:function(n,i,r){var d=on();if(r!==void 0){var y=r(i);if(us){ft(!0);try{r(i)}finally{ft(!1)}}}else y=i;return d.memoizedState=d.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},d.queue=n,n=n.dispatch=nC.bind(null,$e,n),[d.memoizedState,n]},useRef:function(n){var i=on();return n={current:n},i.memoizedState=n},useState:function(n){n=cf(n);var i=n.queue,r=By.bind(null,$e,i);return i.dispatch=r,[n.memoizedState,r]},useDebugValue:ff,useDeferredValue:function(n,i){var r=on();return hf(r,n,i)},useTransition:function(){var n=cf(!1);return n=Ly.bind(null,$e,n.queue,!0,!1),on().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,r){var d=$e,y=on();if(Je){if(r===void 0)throw Error(s(407));r=r()}else{if(r=i(),vt===null)throw Error(s(349));(Ye&127)!==0||cy(d,i,r)}y.memoizedState=r;var b={value:r,getSnapshot:i};return y.queue=b,Ny(dy.bind(null,d,b,n),[n]),d.flags|=2048,yr(9,{destroy:void 0},uy.bind(null,d,b,r,i),null),r},useId:function(){var n=on(),i=vt.identifierPrefix;if(Je){var r=pa,d=ma;r=(d&~(1<<32-ot(d)-1)).toString(32)+r,i="_"+i+"R_"+r,r=gc++,0<r&&(i+="H"+r.toString(32)),i+="_"}else r=Yw++,i="_"+i+"r_"+r.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:pf,useFormState:xy,useActionState:xy,useOptimistic:function(n){var i=on();i.memoizedState=i.baseState=n;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=r,i=gf.bind(null,$e,!0,r),r.dispatch=i,[n,i]},useMemoCache:rf,useCacheRefresh:function(){return on().memoizedState=tC.bind(null,$e)},useEffectEvent:function(n){var i=on(),r={impl:n};return i.memoizedState=r,function(){if((it&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},yf={readContext:Xt,use:vc,useCallback:My,useContext:Xt,useEffect:df,useImperativeHandle:Ty,useInsertionEffect:Ey,useLayoutEffect:ky,useMemo:Ay,useReducer:bc,useRef:Cy,useState:function(){return bc(Oa)},useDebugValue:ff,useDeferredValue:function(n,i){var r=zt();return Dy(r,ht.memoizedState,n,i)},useTransition:function(){var n=bc(Oa)[0],i=zt().memoizedState;return[typeof n=="boolean"?n:Dl(n),i]},useSyncExternalStore:oy,useId:Iy,useHostTransitionStatus:pf,useFormState:_y,useActionState:_y,useOptimistic:function(n,i){var r=zt();return my(r,ht,n,i)},useMemoCache:rf,useCacheRefresh:Uy};yf.useEffectEvent=jy;var Py={readContext:Xt,use:vc,useCallback:My,useContext:Xt,useEffect:df,useImperativeHandle:Ty,useInsertionEffect:Ey,useLayoutEffect:ky,useMemo:Ay,useReducer:of,useRef:Cy,useState:function(){return of(Oa)},useDebugValue:ff,useDeferredValue:function(n,i){var r=zt();return ht===null?hf(r,n,i):Dy(r,ht.memoizedState,n,i)},useTransition:function(){var n=of(Oa)[0],i=zt().memoizedState;return[typeof n=="boolean"?n:Dl(n),i]},useSyncExternalStore:oy,useId:Iy,useHostTransitionStatus:pf,useFormState:wy,useActionState:wy,useOptimistic:function(n,i){var r=zt();return ht!==null?my(r,ht,n,i):(r.baseState=n,[n,r.queue.dispatch])},useMemoCache:rf,useCacheRefresh:Uy};Py.useEffectEvent=jy;function vf(n,i,r,d){i=n.memoizedState,r=r(d,i),r=r==null?i:p({},i,r),n.memoizedState=r,n.lanes===0&&(n.updateQueue.baseState=r)}var bf={enqueueSetState:function(n,i,r){n=n._reactInternals;var d=Mn(),y=ui(d);y.payload=i,r!=null&&(y.callback=r),i=di(n,y,d),i!==null&&(yn(i,n,d),Rl(i,n,d))},enqueueReplaceState:function(n,i,r){n=n._reactInternals;var d=Mn(),y=ui(d);y.tag=1,y.payload=i,r!=null&&(y.callback=r),i=di(n,y,d),i!==null&&(yn(i,n,d),Rl(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var r=Mn(),d=ui(r);d.tag=2,i!=null&&(d.callback=i),i=di(n,d,r),i!==null&&(yn(i,n,r),Rl(i,n,r))}};function qy(n,i,r,d,y,b,N){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,b,N):i.prototype&&i.prototype.isPureReactComponent?!_l(r,d)||!_l(y,b):!0}function Vy(n,i,r,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(r,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(r,d),i.state!==n&&bf.enqueueReplaceState(i,i.state,null)}function ds(n,i){var r=i;if("ref"in i){r={};for(var d in i)d!=="ref"&&(r[d]=i[d])}if(n=n.defaultProps){r===i&&(r=p({},r));for(var y in n)r[y]===void 0&&(r[y]=n[y])}return r}function Gy(n){ec(n)}function Ky(n){console.error(n)}function Qy(n){ec(n)}function wc(n,i){try{var r=n.onUncaughtError;r(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function Yy(n,i,r){try{var d=n.onCaughtError;d(r.value,{componentStack:r.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function xf(n,i,r){return r=ui(r),r.tag=3,r.payload={element:null},r.callback=function(){wc(n,i)},r}function Xy(n){return n=ui(n),n.tag=3,n}function Zy(n,i,r,d){var y=r.type.getDerivedStateFromError;if(typeof y=="function"){var b=d.value;n.payload=function(){return y(b)},n.callback=function(){Yy(i,r,d)}}var N=r.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(n.callback=function(){Yy(i,r,d),typeof y!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var L=d.stack;this.componentDidCatch(d.value,{componentStack:L!==null?L:""})})}function aC(n,i,r,d,y){if(r.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=r.alternate,i!==null&&cr(i,r,y,!0),r=En.current,r!==null){switch(r.tag){case 31:case 13:return Vn===null?Oc():r.alternate===null&&At===0&&(At=3),r.flags&=-257,r.flags|=65536,r.lanes=y,d===uc?r.flags|=16384:(i=r.updateQueue,i===null?r.updateQueue=new Set([d]):i.add(d),Vf(n,d,y)),!1;case 22:return r.flags|=65536,d===uc?r.flags|=16384:(i=r.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},r.updateQueue=i):(r=i.retryQueue,r===null?i.retryQueue=new Set([d]):r.add(d)),Vf(n,d,y)),!1}throw Error(s(435,r.tag))}return Vf(n,d,y),Oc(),!1}if(Je)return i=En.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,d!==Ud&&(n=Error(s(422),{cause:d}),Cl(Hn(n,r)))):(d!==Ud&&(i=Error(s(423),{cause:d}),Cl(Hn(i,r))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,d=Hn(d,r),y=xf(n.stateNode,d,y),Yd(n,y),At!==4&&(At=2)),!1;var b=Error(s(520),{cause:d});if(b=Hn(b,r),Pl===null?Pl=[b]:Pl.push(b),At!==4&&(At=2),i===null)return!0;d=Hn(d,r),r=i;do{switch(r.tag){case 3:return r.flags|=65536,n=y&-y,r.lanes|=n,n=xf(r.stateNode,d,n),Yd(r,n),!1;case 1:if(i=r.type,b=r.stateNode,(r.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(yi===null||!yi.has(b))))return r.flags|=65536,y&=-y,r.lanes|=y,y=Xy(y),Zy(y,n,r,d),Yd(r,y),!1}r=r.return}while(r!==null);return!1}var _f=Error(s(461)),Bt=!1;function Zt(n,i,r,d){i.child=n===null?ty(i,null,r,d):cs(i,n.child,r,d)}function Jy(n,i,r,d,y){r=r.render;var b=i.ref;if("ref"in d){var N={};for(var L in d)L!=="ref"&&(N[L]=d[L])}else N=d;return ss(i),d=tf(n,i,r,N,b,y),L=nf(),n!==null&&!Bt?(af(n,i,y),za(n,i,y)):(Je&&L&&zd(i),i.flags|=1,Zt(n,i,d,y),i.child)}function Wy(n,i,r,d,y){if(n===null){var b=r.type;return typeof b=="function"&&!Dd(b)&&b.defaultProps===void 0&&r.compare===null?(i.tag=15,i.type=b,ev(n,i,b,d,y)):(n=ic(r.type,null,d,i,i.mode,y),n.ref=i.ref,n.return=i,i.child=n)}if(b=n.child,!Rf(n,y)){var N=b.memoizedProps;if(r=r.compare,r=r!==null?r:_l,r(N,d)&&n.ref===i.ref)return za(n,i,y)}return i.flags|=1,n=Ta(b,d),n.ref=i.ref,n.return=i,i.child=n}function ev(n,i,r,d,y){if(n!==null){var b=n.memoizedProps;if(_l(b,d)&&n.ref===i.ref)if(Bt=!1,i.pendingProps=d=b,Rf(n,y))(n.flags&131072)!==0&&(Bt=!0);else return i.lanes=n.lanes,za(n,i,y)}return Sf(n,i,r,d,y)}function tv(n,i,r,d){var y=d.children,b=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(b=b!==null?b.baseLanes|r:r,n!==null){for(d=i.child=n.child,y=0;d!==null;)y=y|d.lanes|d.childLanes,d=d.sibling;d=y&~b}else d=0,i.child=null;return nv(n,i,b,r,d)}if((r&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&oc(i,b!==null?b.cachePool:null),b!==null?iy(i,b):Zd(),sy(i);else return d=i.lanes=536870912,nv(n,i,b!==null?b.baseLanes|r:r,r,d)}else b!==null?(oc(i,b.cachePool),iy(i,b),hi(),i.memoizedState=null):(n!==null&&oc(i,null),Zd(),hi());return Zt(n,i,y,r),i.child}function zl(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function nv(n,i,r,d,y){var b=Vd();return b=b===null?null:{parent:It._currentValue,pool:b},i.memoizedState={baseLanes:r,cachePool:b},n!==null&&oc(i,null),Zd(),sy(i),n!==null&&cr(n,i,d,!0),i.childLanes=y,null}function Cc(n,i){return i=jc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function av(n,i,r){return cs(i,n.child,null,r),n=Cc(i,i.pendingProps),n.flags|=2,kn(i),i.memoizedState=null,n}function iC(n,i,r){var d=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Je){if(d.mode==="hidden")return n=Cc(i,d),i.lanes=536870912,zl(null,n);if(Wd(i),(n=Nt)?(n=p1(n,qn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:si!==null?{id:ma,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},r=Fg(n),r.return=i,i.child=r,Yt=i,Nt=null)):n=null,n===null)throw li(i);return i.lanes=536870912,null}return Cc(i,d)}var b=n.memoizedState;if(b!==null){var N=b.dehydrated;if(Wd(i),y)if(i.flags&256)i.flags&=-257,i=av(n,i,r);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(s(558));else if(Bt||cr(n,i,r,!1),y=(r&n.childLanes)!==0,Bt||y){if(d=vt,d!==null&&(N=ti(d,r),N!==0&&N!==b.retryLane))throw b.retryLane=N,ts(n,N),yn(d,n,N),_f;Oc(),i=av(n,i,r)}else n=b.treeContext,Nt=Gn(N.nextSibling),Yt=i,Je=!0,ri=null,qn=!1,n!==null&&Pg(i,n),i=Cc(i,d),i.flags|=4096;return i}return n=Ta(n.child,{mode:d.mode,children:d.children}),n.ref=i.ref,i.child=n,n.return=i,n}function Nc(n,i){var r=i.ref;if(r===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(n===null||n.ref!==r)&&(i.flags|=4194816)}}function Sf(n,i,r,d,y){return ss(i),r=tf(n,i,r,d,void 0,y),d=nf(),n!==null&&!Bt?(af(n,i,y),za(n,i,y)):(Je&&d&&zd(i),i.flags|=1,Zt(n,i,r,y),i.child)}function iv(n,i,r,d,y,b){return ss(i),i.updateQueue=null,r=ly(i,d,r,y),ry(n),d=nf(),n!==null&&!Bt?(af(n,i,b),za(n,i,b)):(Je&&d&&zd(i),i.flags|=1,Zt(n,i,r,b),i.child)}function sv(n,i,r,d,y){if(ss(i),i.stateNode===null){var b=sr,N=r.contextType;typeof N=="object"&&N!==null&&(b=Xt(N)),b=new r(d,b),i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=bf,i.stateNode=b,b._reactInternals=i,b=i.stateNode,b.props=d,b.state=i.memoizedState,b.refs={},Kd(i),N=r.contextType,b.context=typeof N=="object"&&N!==null?Xt(N):sr,b.state=i.memoizedState,N=r.getDerivedStateFromProps,typeof N=="function"&&(vf(i,r,N,d),b.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(N=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),N!==b.state&&bf.enqueueReplaceState(b,b.state,null),Ml(i,d,b,y),Tl(),b.state=i.memoizedState),typeof b.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){b=i.stateNode;var L=i.memoizedProps,G=ds(r,L);b.props=G;var ee=b.context,oe=r.contextType;N=sr,typeof oe=="object"&&oe!==null&&(N=Xt(oe));var de=r.getDerivedStateFromProps;oe=typeof de=="function"||typeof b.getSnapshotBeforeUpdate=="function",L=i.pendingProps!==L,oe||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(L||ee!==N)&&Vy(i,b,d,N),ci=!1;var te=i.memoizedState;b.state=te,Ml(i,d,b,y),Tl(),ee=i.memoizedState,L||te!==ee||ci?(typeof de=="function"&&(vf(i,r,de,d),ee=i.memoizedState),(G=ci||qy(i,r,G,d,te,ee,N))?(oe||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(i.flags|=4194308)):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=ee),b.props=d,b.state=ee,b.context=N,d=G):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{b=i.stateNode,Qd(n,i),N=i.memoizedProps,oe=ds(r,N),b.props=oe,de=i.pendingProps,te=b.context,ee=r.contextType,G=sr,typeof ee=="object"&&ee!==null&&(G=Xt(ee)),L=r.getDerivedStateFromProps,(ee=typeof L=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N!==de||te!==G)&&Vy(i,b,d,G),ci=!1,te=i.memoizedState,b.state=te,Ml(i,d,b,y),Tl();var ie=i.memoizedState;N!==de||te!==ie||ci||n!==null&&n.dependencies!==null&&rc(n.dependencies)?(typeof L=="function"&&(vf(i,r,L,d),ie=i.memoizedState),(oe=ci||qy(i,r,oe,d,te,ie,G)||n!==null&&n.dependencies!==null&&rc(n.dependencies))?(ee||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,ie,G),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,ie,G)),typeof b.componentDidUpdate=="function"&&(i.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof b.componentDidUpdate!="function"||N===n.memoizedProps&&te===n.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&te===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ie),b.props=d,b.state=ie,b.context=G,d=oe):(typeof b.componentDidUpdate!="function"||N===n.memoizedProps&&te===n.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&te===n.memoizedState||(i.flags|=1024),d=!1)}return b=d,Nc(n,i),d=(i.flags&128)!==0,b||d?(b=i.stateNode,r=d&&typeof r.getDerivedStateFromError!="function"?null:b.render(),i.flags|=1,n!==null&&d?(i.child=cs(i,n.child,null,y),i.child=cs(i,null,r,y)):Zt(n,i,r,y),i.memoizedState=b.state,n=i.child):n=za(n,i,y),n}function rv(n,i,r,d){return as(),i.flags|=256,Zt(n,i,r,d),i.child}var wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cf(n){return{baseLanes:n,cachePool:Yg()}}function Nf(n,i,r){return n=n!==null?n.childLanes&~r:0,i&&(n|=Tn),n}function lv(n,i,r){var d=i.pendingProps,y=!1,b=(i.flags&128)!==0,N;if((N=b)||(N=n!==null&&n.memoizedState===null?!1:(Ot.current&2)!==0),N&&(y=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,n===null){if(Je){if(y?fi(i):hi(),(n=Nt)?(n=p1(n,qn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:si!==null?{id:ma,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},r=Fg(n),r.return=i,i.child=r,Yt=i,Nt=null)):n=null,n===null)throw li(i);return lh(n)?i.lanes=32:i.lanes=536870912,null}var L=d.children;return d=d.fallback,y?(hi(),y=i.mode,L=jc({mode:"hidden",children:L},y),d=ns(d,y,r,null),L.return=i,d.return=i,L.sibling=d,i.child=L,d=i.child,d.memoizedState=Cf(r),d.childLanes=Nf(n,N,r),i.memoizedState=wf,zl(null,d)):(fi(i),jf(i,L))}var G=n.memoizedState;if(G!==null&&(L=G.dehydrated,L!==null)){if(b)i.flags&256?(fi(i),i.flags&=-257,i=Ef(n,i,r)):i.memoizedState!==null?(hi(),i.child=n.child,i.flags|=128,i=null):(hi(),L=d.fallback,y=i.mode,d=jc({mode:"visible",children:d.children},y),L=ns(L,y,r,null),L.flags|=2,d.return=i,L.return=i,d.sibling=L,i.child=d,cs(i,n.child,null,r),d=i.child,d.memoizedState=Cf(r),d.childLanes=Nf(n,N,r),i.memoizedState=wf,i=zl(null,d));else if(fi(i),lh(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var ee=N.dgst;N=ee,d=Error(s(419)),d.stack="",d.digest=N,Cl({value:d,source:null,stack:null}),i=Ef(n,i,r)}else if(Bt||cr(n,i,r,!1),N=(r&n.childLanes)!==0,Bt||N){if(N=vt,N!==null&&(d=ti(N,r),d!==0&&d!==G.retryLane))throw G.retryLane=d,ts(n,d),yn(N,n,d),_f;rh(L)||Oc(),i=Ef(n,i,r)}else rh(L)?(i.flags|=192,i.child=n.child,i=null):(n=G.treeContext,Nt=Gn(L.nextSibling),Yt=i,Je=!0,ri=null,qn=!1,n!==null&&Pg(i,n),i=jf(i,d.children),i.flags|=4096);return i}return y?(hi(),L=d.fallback,y=i.mode,G=n.child,ee=G.sibling,d=Ta(G,{mode:"hidden",children:d.children}),d.subtreeFlags=G.subtreeFlags&65011712,ee!==null?L=Ta(ee,L):(L=ns(L,y,r,null),L.flags|=2),L.return=i,d.return=i,d.sibling=L,i.child=d,zl(null,d),d=i.child,L=n.child.memoizedState,L===null?L=Cf(r):(y=L.cachePool,y!==null?(G=It._currentValue,y=y.parent!==G?{parent:G,pool:G}:y):y=Yg(),L={baseLanes:L.baseLanes|r,cachePool:y}),d.memoizedState=L,d.childLanes=Nf(n,N,r),i.memoizedState=wf,zl(n.child,d)):(fi(i),r=n.child,n=r.sibling,r=Ta(r,{mode:"visible",children:d.children}),r.return=i,r.sibling=null,n!==null&&(N=i.deletions,N===null?(i.deletions=[n],i.flags|=16):N.push(n)),i.child=r,i.memoizedState=null,r)}function jf(n,i){return i=jc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function jc(n,i){return n=jn(22,n,null,i),n.lanes=0,n}function Ef(n,i,r){return cs(i,n.child,null,r),n=jf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function ov(n,i,r){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Hd(n.return,i,r)}function kf(n,i,r,d,y,b){var N=n.memoizedState;N===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:r,tailMode:y,treeForkCount:b}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=d,N.tail=r,N.tailMode=y,N.treeForkCount=b)}function cv(n,i,r){var d=i.pendingProps,y=d.revealOrder,b=d.tail;d=d.children;var N=Ot.current,L=(N&2)!==0;if(L?(N=N&1|2,i.flags|=128):N&=1,M(Ot,N),Zt(n,i,d,r),d=Je?wl:0,!L&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&ov(n,r,i);else if(n.tag===19)ov(n,r,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(r=i.child,y=null;r!==null;)n=r.alternate,n!==null&&mc(n)===null&&(y=r),r=r.sibling;r=y,r===null?(y=i.child,i.child=null):(y=r.sibling,r.sibling=null),kf(i,!1,y,r,b,d);break;case"backwards":case"unstable_legacy-backwards":for(r=null,y=i.child,i.child=null;y!==null;){if(n=y.alternate,n!==null&&mc(n)===null){i.child=y;break}n=y.sibling,y.sibling=r,r=y,y=n}kf(i,!0,r,null,b,d);break;case"together":kf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function za(n,i,r){if(n!==null&&(i.dependencies=n.dependencies),gi|=i.lanes,(r&i.childLanes)===0)if(n!==null){if(cr(n,i,r,!1),(r&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(s(153));if(i.child!==null){for(n=i.child,r=Ta(n,n.pendingProps),i.child=r,r.return=i;n.sibling!==null;)n=n.sibling,r=r.sibling=Ta(n,n.pendingProps),r.return=i;r.sibling=null}return i.child}function Rf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&rc(n)))}function sC(n,i,r){switch(i.tag){case 3:xe(i,i.stateNode.containerInfo),oi(i,It,n.memoizedState.cache),as();break;case 27:case 5:rt(i);break;case 4:xe(i,i.stateNode.containerInfo);break;case 10:oi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Wd(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(fi(i),i.flags|=128,null):(r&i.child.childLanes)!==0?lv(n,i,r):(fi(i),n=za(n,i,r),n!==null?n.sibling:null);fi(i);break;case 19:var y=(n.flags&128)!==0;if(d=(r&i.childLanes)!==0,d||(cr(n,i,r,!1),d=(r&i.childLanes)!==0),y){if(d)return cv(n,i,r);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),M(Ot,Ot.current),d)break;return null;case 22:return i.lanes=0,tv(n,i,r,i.pendingProps);case 24:oi(i,It,n.memoizedState.cache)}return za(n,i,r)}function uv(n,i,r){if(n!==null)if(n.memoizedProps!==i.pendingProps)Bt=!0;else{if(!Rf(n,r)&&(i.flags&128)===0)return Bt=!1,sC(n,i,r);Bt=(n.flags&131072)!==0}else Bt=!1,Je&&(i.flags&1048576)!==0&&$g(i,wl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(n=ls(i.elementType),i.type=n,typeof n=="function")Dd(n)?(d=ds(n,d),i.tag=1,i=sv(null,i,n,d,r)):(i.tag=0,i=Sf(null,i,n,d,r));else{if(n!=null){var y=n.$$typeof;if(y===E){i.tag=11,i=Jy(null,i,n,d,r);break e}else if(y===I){i.tag=14,i=Wy(null,i,n,d,r);break e}}throw i=V(n)||n,Error(s(306,i,""))}}return i;case 0:return Sf(n,i,i.type,i.pendingProps,r);case 1:return d=i.type,y=ds(d,i.pendingProps),sv(n,i,d,y,r);case 3:e:{if(xe(i,i.stateNode.containerInfo),n===null)throw Error(s(387));d=i.pendingProps;var b=i.memoizedState;y=b.element,Qd(n,i),Ml(i,d,null,r);var N=i.memoizedState;if(d=N.cache,oi(i,It,d),d!==b.cache&&$d(i,[It],r,!0),Tl(),d=N.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=b,i.memoizedState=b,i.flags&256){i=rv(n,i,d,r);break e}else if(d!==y){y=Hn(Error(s(424)),i),Cl(y),i=rv(n,i,d,r);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Nt=Gn(n.firstChild),Yt=i,Je=!0,ri=null,qn=!0,r=ty(i,null,d,r),i.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(as(),d===y){i=za(n,i,r);break e}Zt(n,i,d,r)}i=i.child}return i;case 26:return Nc(n,i),n===null?(r=_1(i.type,null,i.pendingProps,null))?i.memoizedState=r:Je||(r=i.type,n=i.pendingProps,d=$c(ge.current).createElement(r),d[ne]=i,d[be]=n,Jt(d,r,n),Vt(d),i.stateNode=d):i.memoizedState=_1(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return rt(i),n===null&&Je&&(d=i.stateNode=v1(i.type,i.pendingProps,ge.current),Yt=i,qn=!0,y=Nt,_i(i.type)?(oh=y,Nt=Gn(d.firstChild)):Nt=y),Zt(n,i,i.pendingProps.children,r),Nc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Je&&((y=d=Nt)&&(d=OC(d,i.type,i.pendingProps,qn),d!==null?(i.stateNode=d,Yt=i,Nt=Gn(d.firstChild),qn=!1,y=!0):y=!1),y||li(i)),rt(i),y=i.type,b=i.pendingProps,N=n!==null?n.memoizedProps:null,d=b.children,ah(y,b)?d=null:N!==null&&ah(y,N)&&(i.flags|=32),i.memoizedState!==null&&(y=tf(n,i,Xw,null,null,r),Zl._currentValue=y),Nc(n,i),Zt(n,i,d,r),i.child;case 6:return n===null&&Je&&((n=r=Nt)&&(r=zC(r,i.pendingProps,qn),r!==null?(i.stateNode=r,Yt=i,Nt=null,n=!0):n=!1),n||li(i)),null;case 13:return lv(n,i,r);case 4:return xe(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=cs(i,null,d,r):Zt(n,i,d,r),i.child;case 11:return Jy(n,i,i.type,i.pendingProps,r);case 7:return Zt(n,i,i.pendingProps,r),i.child;case 8:return Zt(n,i,i.pendingProps.children,r),i.child;case 12:return Zt(n,i,i.pendingProps.children,r),i.child;case 10:return d=i.pendingProps,oi(i,i.type,d.value),Zt(n,i,d.children,r),i.child;case 9:return y=i.type._context,d=i.pendingProps.children,ss(i),y=Xt(y),d=d(y),i.flags|=1,Zt(n,i,d,r),i.child;case 14:return Wy(n,i,i.type,i.pendingProps,r);case 15:return ev(n,i,i.type,i.pendingProps,r);case 19:return cv(n,i,r);case 31:return iC(n,i,r);case 22:return tv(n,i,r,i.pendingProps);case 24:return ss(i),d=Xt(It),n===null?(y=Vd(),y===null&&(y=vt,b=Pd(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=r),y=b),i.memoizedState={parent:d,cache:y},Kd(i),oi(i,It,y)):((n.lanes&r)!==0&&(Qd(n,i),Ml(i,null,null,r),Tl()),y=n.memoizedState,b=i.memoizedState,y.parent!==d?(y={parent:d,cache:d},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),oi(i,It,d)):(d=b.cache,oi(i,It,d),d!==y.cache&&$d(i,[It],r,!0))),Zt(n,i,i.pendingProps.children,r),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Ia(n){n.flags|=4}function Tf(n,i,r,d,y){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(Iv())n.flags|=8192;else throw os=uc,Gd}else n.flags&=-16777217}function dv(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!j1(i))if(Iv())n.flags|=8192;else throw os=uc,Gd}function Ec(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?Gs():536870912,n.lanes|=i,_r|=i)}function Il(n,i){if(!Je)switch(n.tailMode){case"hidden":i=n.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?n.tail=null:r.sibling=null;break;case"collapsed":r=n.tail;for(var d=null;r!==null;)r.alternate!==null&&(d=r),r=r.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function jt(n){var i=n.alternate!==null&&n.alternate.child===n.child,r=0,d=0;if(i)for(var y=n.child;y!==null;)r|=y.lanes|y.childLanes,d|=y.subtreeFlags&65011712,d|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)r|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=d,n.childLanes=r,i}function rC(n,i,r){var d=i.pendingProps;switch(Id(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(i),null;case 1:return jt(i),null;case 3:return r=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Da(It),Ue(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(or(i)?Ia(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Bd())),jt(i),null;case 26:var y=i.type,b=i.memoizedState;return n===null?(Ia(i),b!==null?(jt(i),dv(i,b)):(jt(i),Tf(i,y,null,d,r))):b?b!==n.memoizedState?(Ia(i),jt(i),dv(i,b)):(jt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==d&&Ia(i),jt(i),Tf(i,y,n,d,r)),null;case 27:if(_t(i),r=ge.current,y=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&Ia(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return jt(i),null}n=se.current,or(i)?qg(i):(n=v1(y,d,r),i.stateNode=n,Ia(i))}return jt(i),null;case 5:if(_t(i),y=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&Ia(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return jt(i),null}if(b=se.current,or(i))qg(i);else{var N=$c(ge.current);switch(b){case 1:b=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=N.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?N.createElement("select",{is:d.is}):N.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?N.createElement(y,{is:d.is}):N.createElement(y)}}b[ne]=i,b[be]=d;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)b.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=b;e:switch(Jt(b,y,d),y){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Ia(i)}}return jt(i),Tf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,r),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&Ia(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(s(166));if(n=ge.current,or(i)){if(n=i.stateNode,r=i.memoizedProps,d=null,y=Yt,y!==null)switch(y.tag){case 27:case 5:d=y.memoizedProps}n[ne]=i,n=!!(n.nodeValue===r||d!==null&&d.suppressHydrationWarning===!0||l1(n.nodeValue,r)),n||li(i,!0)}else n=$c(n).createTextNode(d),n[ne]=i,i.stateNode=n}return jt(i),null;case 31:if(r=i.memoizedState,n===null||n.memoizedState!==null){if(d=or(i),r!==null){if(n===null){if(!d)throw Error(s(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[ne]=i}else as(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),n=!1}else r=Bd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=r),n=!0;if(!n)return i.flags&256?(kn(i),i):(kn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return jt(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=or(i),d!==null&&d.dehydrated!==null){if(n===null){if(!y)throw Error(s(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(s(317));y[ne]=i}else as(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),y=!1}else y=Bd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(kn(i),i):(kn(i),null)}return kn(i),(i.flags&128)!==0?(i.lanes=r,i):(r=d!==null,n=n!==null&&n.memoizedState!==null,r&&(d=i.child,y=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(y=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==y&&(d.flags|=2048)),r!==n&&r&&(i.child.flags|=8192),Ec(i,i.updateQueue),jt(i),null);case 4:return Ue(),n===null&&Jf(i.stateNode.containerInfo),jt(i),null;case 10:return Da(i.type),jt(i),null;case 19:if(he(Ot),d=i.memoizedState,d===null)return jt(i),null;if(y=(i.flags&128)!==0,b=d.rendering,b===null)if(y)Il(d,!1);else{if(At!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(b=mc(n),b!==null){for(i.flags|=128,Il(d,!1),n=b.updateQueue,i.updateQueue=n,Ec(i,n),i.subtreeFlags=0,n=r,r=i.child;r!==null;)Bg(r,n),r=r.sibling;return M(Ot,Ot.current&1|2),Je&&Ma(i,d.treeForkCount),i.child}n=n.sibling}d.tail!==null&&Tt()>Ac&&(i.flags|=128,y=!0,Il(d,!1),i.lanes=4194304)}else{if(!y)if(n=mc(b),n!==null){if(i.flags|=128,y=!0,n=n.updateQueue,i.updateQueue=n,Ec(i,n),Il(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!Je)return jt(i),null}else 2*Tt()-d.renderingStartTime>Ac&&r!==536870912&&(i.flags|=128,y=!0,Il(d,!1),i.lanes=4194304);d.isBackwards?(b.sibling=i.child,i.child=b):(n=d.last,n!==null?n.sibling=b:i.child=b,d.last=b)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Tt(),n.sibling=null,r=Ot.current,M(Ot,y?r&1|2:r&1),Je&&Ma(i,d.treeForkCount),n):(jt(i),null);case 22:case 23:return kn(i),Jd(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(r&536870912)!==0&&(i.flags&128)===0&&(jt(i),i.subtreeFlags&6&&(i.flags|=8192)):jt(i),r=i.updateQueue,r!==null&&Ec(i,r.retryQueue),r=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==r&&(i.flags|=2048),n!==null&&he(rs),null;case 24:return r=null,n!==null&&(r=n.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Da(It),jt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function lC(n,i){switch(Id(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Da(It),Ue(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return _t(i),null;case 31:if(i.memoizedState!==null){if(kn(i),i.alternate===null)throw Error(s(340));as()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(kn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(s(340));as()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return he(Ot),null;case 4:return Ue(),null;case 10:return Da(i.type),null;case 22:case 23:return kn(i),Jd(),n!==null&&he(rs),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Da(It),null;case 25:return null;default:return null}}function fv(n,i){switch(Id(i),i.tag){case 3:Da(It),Ue();break;case 26:case 27:case 5:_t(i);break;case 4:Ue();break;case 31:i.memoizedState!==null&&kn(i);break;case 13:kn(i);break;case 19:he(Ot);break;case 10:Da(i.type);break;case 22:case 23:kn(i),Jd(),n!==null&&he(rs);break;case 24:Da(It)}}function Ul(n,i){try{var r=i.updateQueue,d=r!==null?r.lastEffect:null;if(d!==null){var y=d.next;r=y;do{if((r.tag&n)===n){d=void 0;var b=r.create,N=r.inst;d=b(),N.destroy=d}r=r.next}while(r!==y)}}catch(L){ut(i,i.return,L)}}function mi(n,i,r){try{var d=i.updateQueue,y=d!==null?d.lastEffect:null;if(y!==null){var b=y.next;d=b;do{if((d.tag&n)===n){var N=d.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,y=i;var G=r,ee=L;try{ee()}catch(oe){ut(y,G,oe)}}}d=d.next}while(d!==b)}}catch(oe){ut(i,i.return,oe)}}function hv(n){var i=n.updateQueue;if(i!==null){var r=n.stateNode;try{ay(i,r)}catch(d){ut(n,n.return,d)}}}function mv(n,i,r){r.props=ds(n.type,n.memoizedProps),r.state=n.memoizedState;try{r.componentWillUnmount()}catch(d){ut(n,i,d)}}function Bl(n,i){try{var r=n.ref;if(r!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof r=="function"?n.refCleanup=r(d):r.current=d}}catch(y){ut(n,i,y)}}function ga(n,i){var r=n.ref,d=n.refCleanup;if(r!==null)if(typeof d=="function")try{d()}catch(y){ut(n,i,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(y){ut(n,i,y)}else r.current=null}function pv(n){var i=n.type,r=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":r.autoFocus&&d.focus();break e;case"img":r.src?d.src=r.src:r.srcSet&&(d.srcset=r.srcSet)}}catch(y){ut(n,n.return,y)}}function Mf(n,i,r){try{var d=n.stateNode;RC(d,n.type,r,i),d[be]=i}catch(y){ut(n,n.return,y)}}function gv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&_i(n.type)||n.tag===4}function Af(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||gv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&_i(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Df(n,i,r){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(n,i):(i=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,i.appendChild(n),r=r._reactRootContainer,r!=null||i.onclick!==null||(i.onclick=ka));else if(d!==4&&(d===27&&_i(n.type)&&(r=n.stateNode,i=null),n=n.child,n!==null))for(Df(n,i,r),n=n.sibling;n!==null;)Df(n,i,r),n=n.sibling}function kc(n,i,r){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?r.insertBefore(n,i):r.appendChild(n);else if(d!==4&&(d===27&&_i(n.type)&&(r=n.stateNode),n=n.child,n!==null))for(kc(n,i,r),n=n.sibling;n!==null;)kc(n,i,r),n=n.sibling}function yv(n){var i=n.stateNode,r=n.memoizedProps;try{for(var d=n.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);Jt(i,d,r),i[ne]=n,i[be]=r}catch(b){ut(n,n.return,b)}}var Ua=!1,Ft=!1,Lf=!1,vv=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function oC(n,i){if(n=n.containerInfo,th=Yc,n=Tg(n),jd(n)){if("selectionStart"in n)var r={start:n.selectionStart,end:n.selectionEnd};else e:{r=(r=n.ownerDocument)&&r.defaultView||window;var d=r.getSelection&&r.getSelection();if(d&&d.rangeCount!==0){r=d.anchorNode;var y=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{r.nodeType,b.nodeType}catch(Le){r=null;break e}var N=0,L=-1,G=-1,ee=0,oe=0,de=n,te=null;t:for(;;){for(var ie;de!==r||y!==0&&de.nodeType!==3||(L=N+y),de!==b||d!==0&&de.nodeType!==3||(G=N+d),de.nodeType===3&&(N+=de.nodeValue.length),(ie=de.firstChild)!==null;)te=de,de=ie;for(;;){if(de===n)break t;if(te===r&&++ee===y&&(L=N),te===b&&++oe===d&&(G=N),(ie=de.nextSibling)!==null)break;de=te,te=de.parentNode}de=ie}r=L===-1||G===-1?null:{start:L,end:G}}else r=null}r=r||{start:0,end:0}}else r=null;for(nh={focusedElem:n,selectionRange:r},Yc=!1,Gt=i;Gt!==null;)if(i=Gt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Gt=n;else for(;Gt!==null;){switch(i=Gt,b=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(r=0;r<n.length;r++)y=n[r],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&b!==null){n=void 0,r=i,y=b.memoizedProps,b=b.memoizedState,d=r.stateNode;try{var we=ds(r.type,y);n=d.getSnapshotBeforeUpdate(we,b),d.__reactInternalSnapshotBeforeUpdate=n}catch(Le){ut(r,r.return,Le)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,r=n.nodeType,r===9)sh(n);else if(r===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":sh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=i.sibling,n!==null){n.return=i.return,Gt=n;break}Gt=i.return}}function bv(n,i,r){var d=r.flags;switch(r.tag){case 0:case 11:case 15:Fa(n,r),d&4&&Ul(5,r);break;case 1:if(Fa(n,r),d&4)if(n=r.stateNode,i===null)try{n.componentDidMount()}catch(N){ut(r,r.return,N)}else{var y=ds(r.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(y,i,n.__reactInternalSnapshotBeforeUpdate)}catch(N){ut(r,r.return,N)}}d&64&&hv(r),d&512&&Bl(r,r.return);break;case 3:if(Fa(n,r),d&64&&(n=r.updateQueue,n!==null)){if(i=null,r.child!==null)switch(r.child.tag){case 27:case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}try{ay(n,i)}catch(N){ut(r,r.return,N)}}break;case 27:i===null&&d&4&&yv(r);case 26:case 5:Fa(n,r),i===null&&d&4&&pv(r),d&512&&Bl(r,r.return);break;case 12:Fa(n,r);break;case 31:Fa(n,r),d&4&&Sv(n,r);break;case 13:Fa(n,r),d&4&&wv(n,r),d&64&&(n=r.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(r=yC.bind(null,r),IC(n,r))));break;case 22:if(d=r.memoizedState!==null||Ua,!d){i=i!==null&&i.memoizedState!==null||Ft,y=Ua;var b=Ft;Ua=d,(Ft=i)&&!b?Ha(n,r,(r.subtreeFlags&8772)!==0):Fa(n,r),Ua=y,Ft=b}break;case 30:break;default:Fa(n,r)}}function xv(n){var i=n.alternate;i!==null&&(n.alternate=null,xv(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&aa(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Rt=null,hn=!1;function Ba(n,i,r){for(r=r.child;r!==null;)_v(n,i,r),r=r.sibling}function _v(n,i,r){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(kt,r)}catch(b){}switch(r.tag){case 26:Ft||ga(r,i),Ba(n,i,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Ft||ga(r,i);var d=Rt,y=hn;_i(r.type)&&(Rt=r.stateNode,hn=!1),Ba(n,i,r),Ql(r.stateNode),Rt=d,hn=y;break;case 5:Ft||ga(r,i);case 6:if(d=Rt,y=hn,Rt=null,Ba(n,i,r),Rt=d,hn=y,Rt!==null)if(hn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(r.stateNode)}catch(b){ut(r,i,b)}else try{Rt.removeChild(r.stateNode)}catch(b){ut(r,i,b)}break;case 18:Rt!==null&&(hn?(n=Rt,h1(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,r.stateNode),Rr(n)):h1(Rt,r.stateNode));break;case 4:d=Rt,y=hn,Rt=r.stateNode.containerInfo,hn=!0,Ba(n,i,r),Rt=d,hn=y;break;case 0:case 11:case 14:case 15:mi(2,r,i),Ft||mi(4,r,i),Ba(n,i,r);break;case 1:Ft||(ga(r,i),d=r.stateNode,typeof d.componentWillUnmount=="function"&&mv(r,i,d)),Ba(n,i,r);break;case 21:Ba(n,i,r);break;case 22:Ft=(d=Ft)||r.memoizedState!==null,Ba(n,i,r),Ft=d;break;default:Ba(n,i,r)}}function Sv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Rr(n)}catch(r){ut(i,i.return,r)}}}function wv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Rr(n)}catch(r){ut(i,i.return,r)}}function cC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new vv),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new vv),i;default:throw Error(s(435,n.tag))}}function Rc(n,i){var r=cC(n);i.forEach(function(d){if(!r.has(d)){r.add(d);var y=vC.bind(null,n,d);d.then(y,y)}})}function mn(n,i){var r=i.deletions;if(r!==null)for(var d=0;d<r.length;d++){var y=r[d],b=n,N=i,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(_i(L.type)){Rt=L.stateNode,hn=!1;break e}break;case 5:Rt=L.stateNode,hn=!1;break e;case 3:case 4:Rt=L.stateNode.containerInfo,hn=!0;break e}L=L.return}if(Rt===null)throw Error(s(160));_v(b,N,y),Rt=null,hn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Cv(i,n),i=i.sibling}var sa=null;function Cv(n,i){var r=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:mn(i,n),pn(n),d&4&&(mi(3,n,n.return),Ul(3,n),mi(5,n,n.return));break;case 1:mn(i,n),pn(n),d&512&&(Ft||r===null||ga(r,r.return)),d&64&&Ua&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(r=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=r===null?d:r.concat(d))));break;case 26:var y=sa;if(mn(i,n),pn(n),d&512&&(Ft||r===null||ga(r,r.return)),d&4){var b=r!==null?r.memoizedState:null;if(d=n.memoizedState,r===null)if(d===null)if(n.stateNode===null){e:{d=n.type,r=n.memoizedProps,y=y.ownerDocument||y;t:switch(d){case"title":b=y.getElementsByTagName("title")[0],(!b||b[ln]||b[ne]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(d),y.head.insertBefore(b,y.querySelector("head > title"))),Jt(b,d,r),b[ne]=n,Vt(b),d=b;break e;case"link":var N=C1("link","href",y).get(d+(r.href||""));if(N){for(var L=0;L<N.length;L++)if(b=N[L],b.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&b.getAttribute("rel")===(r.rel==null?null:r.rel)&&b.getAttribute("title")===(r.title==null?null:r.title)&&b.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){N.splice(L,1);break t}}b=y.createElement(d),Jt(b,d,r),y.head.appendChild(b);break;case"meta":if(N=C1("meta","content",y).get(d+(r.content||""))){for(L=0;L<N.length;L++)if(b=N[L],b.getAttribute("content")===(r.content==null?null:""+r.content)&&b.getAttribute("name")===(r.name==null?null:r.name)&&b.getAttribute("property")===(r.property==null?null:r.property)&&b.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&b.getAttribute("charset")===(r.charSet==null?null:r.charSet)){N.splice(L,1);break t}}b=y.createElement(d),Jt(b,d,r),y.head.appendChild(b);break;default:throw Error(s(468,d))}b[ne]=n,Vt(b),d=b}n.stateNode=d}else N1(y,n.type,n.stateNode);else n.stateNode=w1(y,d,n.memoizedProps);else b!==d?(b===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):b.count--,d===null?N1(y,n.type,n.stateNode):w1(y,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Mf(n,n.memoizedProps,r.memoizedProps)}break;case 27:mn(i,n),pn(n),d&512&&(Ft||r===null||ga(r,r.return)),r!==null&&d&4&&Mf(n,n.memoizedProps,r.memoizedProps);break;case 5:if(mn(i,n),pn(n),d&512&&(Ft||r===null||ga(r,r.return)),n.flags&32){y=n.stateNode;try{Js(y,"")}catch(we){ut(n,n.return,we)}}d&4&&n.stateNode!=null&&(y=n.memoizedProps,Mf(n,y,r!==null?r.memoizedProps:y)),d&1024&&(Lf=!0);break;case 6:if(mn(i,n),pn(n),d&4){if(n.stateNode===null)throw Error(s(162));d=n.memoizedProps,r=n.stateNode;try{r.nodeValue=d}catch(we){ut(n,n.return,we)}}break;case 3:if(Vc=null,y=sa,sa=Pc(i.containerInfo),mn(i,n),sa=y,pn(n),d&4&&r!==null&&r.memoizedState.isDehydrated)try{Rr(i.containerInfo)}catch(we){ut(n,n.return,we)}Lf&&(Lf=!1,Nv(n));break;case 4:d=sa,sa=Pc(n.stateNode.containerInfo),mn(i,n),pn(n),sa=d;break;case 12:mn(i,n),pn(n);break;case 31:mn(i,n),pn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 13:mn(i,n),pn(n),n.child.flags&8192&&n.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Mc=Tt()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 22:y=n.memoizedState!==null;var G=r!==null&&r.memoizedState!==null,ee=Ua,oe=Ft;if(Ua=ee||y,Ft=oe||G,mn(i,n),Ft=oe,Ua=ee,pn(n),d&8192)e:for(i=n.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(r===null||G||Ua||Ft||fs(n)),r=null,i=n;;){if(i.tag===5||i.tag===26){if(r===null){G=r=i;try{if(b=G.stateNode,y)N=b.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=G.stateNode;var de=G.memoizedProps.style,te=de!=null&&de.hasOwnProperty("display")?de.display:null;L.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(we){ut(G,G.return,we)}}}else if(i.tag===6){if(r===null){G=i;try{G.stateNode.nodeValue=y?"":G.memoizedProps}catch(we){ut(G,G.return,we)}}}else if(i.tag===18){if(r===null){G=i;try{var ie=G.stateNode;y?m1(ie,!0):m1(G.stateNode,!1)}catch(we){ut(G,G.return,we)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;r===i&&(r=null),i=i.return}r===i&&(r=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=n.updateQueue,d!==null&&(r=d.retryQueue,r!==null&&(d.retryQueue=null,Rc(n,r))));break;case 19:mn(i,n),pn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Rc(n,d)));break;case 30:break;case 21:break;default:mn(i,n),pn(n)}}function pn(n){var i=n.flags;if(i&2){try{for(var r,d=n.return;d!==null;){if(gv(d)){r=d;break}d=d.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var y=r.stateNode,b=Af(n);kc(n,b,y);break;case 5:var N=r.stateNode;r.flags&32&&(Js(N,""),r.flags&=-33);var L=Af(n);kc(n,L,N);break;case 3:case 4:var G=r.stateNode.containerInfo,ee=Af(n);Df(n,ee,G);break;default:throw Error(s(161))}}catch(oe){ut(n,n.return,oe)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Nv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;Nv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Fa(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)bv(n,i.alternate,i),i=i.sibling}function fs(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:mi(4,i,i.return),fs(i);break;case 1:ga(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&mv(i,i.return,r),fs(i);break;case 27:Ql(i.stateNode);case 26:case 5:ga(i,i.return),fs(i);break;case 22:i.memoizedState===null&&fs(i);break;case 30:fs(i);break;default:fs(i)}n=n.sibling}}function Ha(n,i,r){for(r=r&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,y=n,b=i,N=b.flags;switch(b.tag){case 0:case 11:case 15:Ha(y,b,r),Ul(4,b);break;case 1:if(Ha(y,b,r),d=b,y=d.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ee){ut(d,d.return,ee)}if(d=b,y=d.updateQueue,y!==null){var L=d.stateNode;try{var G=y.shared.hiddenCallbacks;if(G!==null)for(y.shared.hiddenCallbacks=null,y=0;y<G.length;y++)ny(G[y],L)}catch(ee){ut(d,d.return,ee)}}r&&N&64&&hv(b),Bl(b,b.return);break;case 27:yv(b);case 26:case 5:Ha(y,b,r),r&&d===null&&N&4&&pv(b),Bl(b,b.return);break;case 12:Ha(y,b,r);break;case 31:Ha(y,b,r),r&&N&4&&Sv(y,b);break;case 13:Ha(y,b,r),r&&N&4&&wv(y,b);break;case 22:b.memoizedState===null&&Ha(y,b,r),Bl(b,b.return);break;case 30:break;default:Ha(y,b,r)}i=i.sibling}}function Of(n,i){var r=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==r&&(n!=null&&n.refCount++,r!=null&&Nl(r))}function zf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Nl(n))}function ra(n,i,r,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)jv(n,i,r,d),i=i.sibling}function jv(n,i,r,d){var y=i.flags;switch(i.tag){case 0:case 11:case 15:ra(n,i,r,d),y&2048&&Ul(9,i);break;case 1:ra(n,i,r,d);break;case 3:ra(n,i,r,d),y&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Nl(n)));break;case 12:if(y&2048){ra(n,i,r,d),n=i.stateNode;try{var b=i.memoizedProps,N=b.id,L=b.onPostCommit;typeof L=="function"&&L(N,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){ut(i,i.return,G)}}else ra(n,i,r,d);break;case 31:ra(n,i,r,d);break;case 13:ra(n,i,r,d);break;case 23:break;case 22:b=i.stateNode,N=i.alternate,i.memoizedState!==null?b._visibility&2?ra(n,i,r,d):Fl(n,i):b._visibility&2?ra(n,i,r,d):(b._visibility|=2,vr(n,i,r,d,(i.subtreeFlags&10256)!==0||!1)),y&2048&&Of(N,i);break;case 24:ra(n,i,r,d),y&2048&&zf(i.alternate,i);break;default:ra(n,i,r,d)}}function vr(n,i,r,d,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var b=n,N=i,L=r,G=d,ee=N.flags;switch(N.tag){case 0:case 11:case 15:vr(b,N,L,G,y),Ul(8,N);break;case 23:break;case 22:var oe=N.stateNode;N.memoizedState!==null?oe._visibility&2?vr(b,N,L,G,y):Fl(b,N):(oe._visibility|=2,vr(b,N,L,G,y)),y&&ee&2048&&Of(N.alternate,N);break;case 24:vr(b,N,L,G,y),y&&ee&2048&&zf(N.alternate,N);break;default:vr(b,N,L,G,y)}i=i.sibling}}function Fl(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var r=n,d=i,y=d.flags;switch(d.tag){case 22:Fl(r,d),y&2048&&Of(d.alternate,d);break;case 24:Fl(r,d),y&2048&&zf(d.alternate,d);break;default:Fl(r,d)}i=i.sibling}}var Hl=8192;function br(n,i,r){if(n.subtreeFlags&Hl)for(n=n.child;n!==null;)Ev(n,i,r),n=n.sibling}function Ev(n,i,r){switch(n.tag){case 26:br(n,i,r),n.flags&Hl&&n.memoizedState!==null&&YC(r,sa,n.memoizedState,n.memoizedProps);break;case 5:br(n,i,r);break;case 3:case 4:var d=sa;sa=Pc(n.stateNode.containerInfo),br(n,i,r),sa=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Hl,Hl=16777216,br(n,i,r),Hl=d):br(n,i,r));break;default:br(n,i,r)}}function kv(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function $l(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var d=i[r];Gt=d,Tv(d,n)}kv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Rv(n),n=n.sibling}function Rv(n){switch(n.tag){case 0:case 11:case 15:$l(n),n.flags&2048&&mi(9,n,n.return);break;case 3:$l(n);break;case 12:$l(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,Tc(n)):$l(n);break;default:$l(n)}}function Tc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var d=i[r];Gt=d,Tv(d,n)}kv(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:mi(8,i,i.return),Tc(i);break;case 22:r=i.stateNode,r._visibility&2&&(r._visibility&=-3,Tc(i));break;default:Tc(i)}n=n.sibling}}function Tv(n,i){for(;Gt!==null;){var r=Gt;switch(r.tag){case 0:case 11:case 15:mi(8,r,i);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var d=r.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Nl(r.memoizedState.cache)}if(d=r.child,d!==null)d.return=r,Gt=d;else e:for(r=n;Gt!==null;){d=Gt;var y=d.sibling,b=d.return;if(xv(d),d===r){Gt=null;break e}if(y!==null){y.return=b,Gt=y;break e}Gt=b}}}var uC={getCacheForType:function(n){var i=Xt(It),r=i.data.get(n);return r===void 0&&(r=n(),i.data.set(n,r)),r},cacheSignal:function(){return Xt(It).controller.signal}},dC=typeof WeakMap=="function"?WeakMap:Map,it=0,vt=null,Ge=null,Ye=0,ct=0,Rn=null,pi=!1,xr=!1,If=!1,$a=0,At=0,gi=0,hs=0,Uf=0,Tn=0,_r=0,Pl=null,gn=null,Bf=!1,Mc=0,Mv=0,Ac=1/0,Dc=null,yi=null,$t=0,vi=null,Sr=null,Pa=0,Ff=0,Hf=null,Av=null,ql=0,$f=null;function Mn(){return(it&2)!==0&&Ye!==0?Ye&-Ye:H.T!==null?Qf():Po()}function Dv(){if(Tn===0)if((Ye&536870912)===0||Je){var n=qs;qs<<=1,(qs&3932160)===0&&(qs=262144),Tn=n}else Tn=536870912;return n=En.current,n!==null&&(n.flags|=32),Tn}function yn(n,i,r){(n===vt&&(ct===2||ct===9)||n.cancelPendingCommit!==null)&&(wr(n,0),bi(n,Ye,Tn,!1)),Xi(n,r),((it&2)===0||n!==vt)&&(n===vt&&((it&2)===0&&(hs|=r),At===4&&bi(n,Ye,Tn,!1)),ya(n))}function Lv(n,i,r){if((it&6)!==0)throw Error(s(327));var d=!r&&(i&127)===0&&(i&n.expiredLanes)===0||In(n,i),y=d?mC(n,i):qf(n,i,!0),b=d;do{if(y===0){xr&&!d&&bi(n,i,0,!1);break}else{if(r=n.current.alternate,b&&!fC(r)){y=qf(n,i,!1),b=!1;continue}if(y===2){if(b=i,n.errorRecoveryDisabledLanes&b)var N=0;else N=n.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var L=n;y=Pl;var G=L.current.memoizedState.isDehydrated;if(G&&(wr(L,N).flags|=256),N=qf(L,N,!1),N!==2){if(If&&!G){L.errorRecoveryDisabledLanes|=b,hs|=b,y=4;break e}b=gn,gn=y,b!==null&&(gn===null?gn=b:gn.push.apply(gn,b))}y=N}if(b=!1,y!==2)continue}}if(y===1){wr(n,0),bi(n,i,0,!0);break}e:{switch(d=n,b=y,b){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:bi(d,i,Tn,!pi);break e;case 2:gn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(y=Mc+300-Tt(),10<y)){if(bi(d,i,Tn,!pi),Na(d,0,!0)!==0)break e;Pa=i,d.timeoutHandle=d1(Ov.bind(null,d,r,gn,Dc,Bf,i,Tn,hs,_r,pi,b,"Throttled",-0,0),y);break e}Ov(d,r,gn,Dc,Bf,i,Tn,hs,_r,pi,b,null,-0,0)}}break}while(!0);ya(n)}function Ov(n,i,r,d,y,b,N,L,G,ee,oe,de,te,ie){if(n.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ka},Ev(i,b,de);var we=(b&62914560)===b?Mc-Tt():(b&4194048)===b?Mv-Tt():0;if(we=XC(de,we),we!==null){Pa=b,n.cancelPendingCommit=we(Pv.bind(null,n,i,b,r,d,y,N,L,G,oe,de,null,te,ie)),bi(n,b,N,!ee);return}}Pv(n,i,b,r,d,y,N,L,G)}function fC(n){for(var i=n;;){var r=i.tag;if((r===0||r===11||r===15)&&i.flags&16384&&(r=i.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var d=0;d<r.length;d++){var y=r[d],b=y.getSnapshot;y=y.value;try{if(!Nn(b(),y))return!1}catch(N){return!1}}if(r=i.child,i.subtreeFlags&16384&&r!==null)r.return=i,i=r;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function bi(n,i,r,d){i&=~Uf,i&=~hs,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var y=i;0<y;){var b=31-ot(y),N=1<<b;d[b]=-1,y&=~N}r!==0&&ul(n,r,i)}function Lc(){return(it&6)===0?(Vl(0),!1):!0}function Pf(){if(Ge!==null){if(ct===0)var n=Ge.return;else n=Ge,Aa=is=null,sf(n),hr=null,El=0,n=Ge;for(;n!==null;)fv(n.alternate,n),n=n.return;Ge=null}}function wr(n,i){var r=n.timeoutHandle;r!==-1&&(n.timeoutHandle=-1,AC(r)),r=n.cancelPendingCommit,r!==null&&(n.cancelPendingCommit=null,r()),Pa=0,Pf(),vt=n,Ge=r=Ta(n.current,null),Ye=i,ct=0,Rn=null,pi=!1,xr=In(n,i),If=!1,_r=Tn=Uf=hs=gi=At=0,gn=Pl=null,Bf=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var y=31-ot(d),b=1<<y;i|=n[y],d&=~b}return $a=i,tc(),r}function zv(n,i){$e=null,H.H=Ol,i===fr||i===cc?(i=Jg(),ct=3):i===Gd?(i=Jg(),ct=4):ct=i===_f?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,Ge===null&&(At=1,wc(n,Hn(i,n.current)))}function Iv(){var n=En.current;return n===null?!0:(Ye&4194048)===Ye?Vn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?n===Vn:!1}function Uv(){var n=H.H;return H.H=Ol,n===null?Ol:n}function Bv(){var n=H.A;return H.A=uC,n}function Oc(){At=4,pi||(Ye&4194048)!==Ye&&En.current!==null||(xr=!0),(gi&134217727)===0&&(hs&134217727)===0||vt===null||bi(vt,Ye,Tn,!1)}function qf(n,i,r){var d=it;it|=2;var y=Uv(),b=Bv();(vt!==n||Ye!==i)&&(Dc=null,wr(n,i)),i=!1;var N=At;e:do try{if(ct!==0&&Ge!==null){var L=Ge,G=Rn;switch(ct){case 8:Pf(),N=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(i=!0);var ee=ct;if(ct=0,Rn=null,Cr(n,L,G,ee),r&&xr){N=0;break e}break;default:ee=ct,ct=0,Rn=null,Cr(n,L,G,ee)}}hC(),N=At;break}catch(oe){zv(n,oe)}while(!0);return i&&n.shellSuspendCounter++,Aa=is=null,it=d,H.H=y,H.A=b,Ge===null&&(vt=null,Ye=0,tc()),N}function hC(){for(;Ge!==null;)Fv(Ge)}function mC(n,i){var r=it;it|=2;var d=Uv(),y=Bv();vt!==n||Ye!==i?(Dc=null,Ac=Tt()+500,wr(n,i)):xr=In(n,i);e:do try{if(ct!==0&&Ge!==null){i=Ge;var b=Rn;t:switch(ct){case 1:ct=0,Rn=null,Cr(n,i,b,1);break;case 2:case 9:if(Xg(b)){ct=0,Rn=null,Hv(i);break}i=function(){ct!==2&&ct!==9||vt!==n||(ct=7),ya(n)},b.then(i,i);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:Xg(b)?(ct=0,Rn=null,Hv(i)):(ct=0,Rn=null,Cr(n,i,b,7));break;case 5:var N=null;switch(Ge.tag){case 26:N=Ge.memoizedState;case 5:case 27:var L=Ge;if(N?j1(N):L.stateNode.complete){ct=0,Rn=null;var G=L.sibling;if(G!==null)Ge=G;else{var ee=L.return;ee!==null?(Ge=ee,zc(ee)):Ge=null}break t}}ct=0,Rn=null,Cr(n,i,b,5);break;case 6:ct=0,Rn=null,Cr(n,i,b,6);break;case 8:Pf(),At=6;break e;default:throw Error(s(462))}}pC();break}catch(oe){zv(n,oe)}while(!0);return Aa=is=null,H.H=d,H.A=y,it=r,Ge!==null?0:(vt=null,Ye=0,tc(),At)}function pC(){for(;Ge!==null&&!Ca();)Fv(Ge)}function Fv(n){var i=uv(n.alternate,n,$a);n.memoizedProps=n.pendingProps,i===null?zc(n):Ge=i}function Hv(n){var i=n,r=i.alternate;switch(i.tag){case 15:case 0:i=iv(r,i,i.pendingProps,i.type,void 0,Ye);break;case 11:i=iv(r,i,i.pendingProps,i.type.render,i.ref,Ye);break;case 5:sf(i);default:fv(r,i),i=Ge=Bg(i,$a),i=uv(r,i,$a)}n.memoizedProps=n.pendingProps,i===null?zc(n):Ge=i}function Cr(n,i,r,d){Aa=is=null,sf(i),hr=null,El=0;var y=i.return;try{if(aC(n,y,i,r,Ye)){At=1,wc(n,Hn(r,n.current)),Ge=null;return}}catch(b){if(y!==null)throw Ge=y,b;At=1,wc(n,Hn(r,n.current)),Ge=null;return}i.flags&32768?(Je||d===1?n=!0:xr||(Ye&536870912)!==0?n=!1:(pi=n=!0,(d===2||d===9||d===3||d===6)&&(d=En.current,d!==null&&d.tag===13&&(d.flags|=16384))),$v(i,n)):zc(i)}function zc(n){var i=n;do{if((i.flags&32768)!==0){$v(i,pi);return}n=i.return;var r=rC(i.alternate,i,$a);if(r!==null){Ge=r;return}if(i=i.sibling,i!==null){Ge=i;return}Ge=i=n}while(i!==null);At===0&&(At=5)}function $v(n,i){do{var r=lC(n.alternate,n);if(r!==null){r.flags&=32767,Ge=r;return}if(r=n.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!i&&(n=n.sibling,n!==null)){Ge=n;return}Ge=n=r}while(n!==null);At=6,Ge=null}function Pv(n,i,r,d,y,b,N,L,G){n.cancelPendingCommit=null;do Ic();while($t!==0);if((it&6)!==0)throw Error(s(327));if(i!==null){if(i===n.current)throw Error(s(177));if(b=i.lanes|i.childLanes,b|=Md,cd(n,r,b,N,L,G),n===vt&&(Ge=vt=null,Ye=0),Sr=i,vi=n,Pa=r,Ff=b,Hf=y,Av=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,bC(Ee,function(){return Qv(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,y=X.p,X.p=2,N=it,it|=4;try{oC(n,i,r)}finally{it=N,X.p=y,H.T=d}}$t=1,qv(),Vv(),Gv()}}function qv(){if($t===1){$t=0;var n=vi,i=Sr,r=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||r){r=H.T,H.T=null;var d=X.p;X.p=2;var y=it;it|=4;try{Cv(i,n);var b=nh,N=Tg(n.containerInfo),L=b.focusedElem,G=b.selectionRange;if(N!==L&&L&&L.ownerDocument&&Rg(L.ownerDocument.documentElement,L)){if(G!==null&&jd(L)){var ee=G.start,oe=G.end;if(oe===void 0&&(oe=ee),"selectionStart"in L)L.selectionStart=ee,L.selectionEnd=Math.min(oe,L.value.length);else{var de=L.ownerDocument||document,te=de&&de.defaultView||window;if(te.getSelection){var ie=te.getSelection(),we=L.textContent.length,Le=Math.min(G.start,we),pt=G.end===void 0?Le:Math.min(G.end,we);!ie.extend&&Le>pt&&(N=pt,pt=Le,Le=N);var J=kg(L,Le),Z=kg(L,pt);if(J&&Z&&(ie.rangeCount!==1||ie.anchorNode!==J.node||ie.anchorOffset!==J.offset||ie.focusNode!==Z.node||ie.focusOffset!==Z.offset)){var W=de.createRange();W.setStart(J.node,J.offset),ie.removeAllRanges(),Le>pt?(ie.addRange(W),ie.extend(Z.node,Z.offset)):(W.setEnd(Z.node,Z.offset),ie.addRange(W))}}}}for(de=[],ie=L;ie=ie.parentNode;)ie.nodeType===1&&de.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<de.length;L++){var ue=de[L];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Yc=!!th,nh=th=null}finally{it=y,X.p=d,H.T=r}}n.current=i,$t=2}}function Vv(){if($t===2){$t=0;var n=vi,i=Sr,r=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||r){r=H.T,H.T=null;var d=X.p;X.p=2;var y=it;it|=4;try{bv(n,i.alternate,i)}finally{it=y,X.p=d,H.T=r}}$t=3}}function Gv(){if($t===4||$t===3){$t=0,ei();var n=vi,i=Sr,r=Pa,d=Av;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$t=5:($t=0,Sr=vi=null,Kv(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(yi=null),fl(r),i=i.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(kt,i,void 0,(i.current.flags&128)===128)}catch(G){}if(d!==null){i=H.T,y=X.p,X.p=2,H.T=null;try{for(var b=n.onRecoverableError,N=0;N<d.length;N++){var L=d[N];b(L.value,{componentStack:L.stack})}}finally{H.T=i,X.p=y}}(Pa&3)!==0&&Ic(),ya(n),y=n.pendingLanes,(r&261930)!==0&&(y&42)!==0?n===$f?ql++:(ql=0,$f=n):ql=0,Vl(0)}}function Kv(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Nl(i)))}function Ic(){return qv(),Vv(),Gv(),Qv()}function Qv(){if($t!==5)return!1;var n=vi,i=Ff;Ff=0;var r=fl(Pa),d=H.T,y=X.p;try{X.p=32>r?32:r,H.T=null,r=Hf,Hf=null;var b=vi,N=Pa;if($t=0,Sr=vi=null,Pa=0,(it&6)!==0)throw Error(s(331));var L=it;if(it|=4,Rv(b.current),jv(b,b.current,N,r),it=L,Vl(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(kt,b)}catch(G){}return!0}finally{X.p=y,H.T=d,Kv(n,i)}}function Yv(n,i,r){i=Hn(r,i),i=xf(n.stateNode,i,2),n=di(n,i,2),n!==null&&(Xi(n,2),ya(n))}function ut(n,i,r){if(n.tag===3)Yv(n,n,r);else for(;i!==null;){if(i.tag===3){Yv(i,n,r);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(yi===null||!yi.has(d))){n=Hn(r,n),r=Xy(2),d=di(i,r,2),d!==null&&(Zy(r,d,i,n),Xi(d,2),ya(d));break}}i=i.return}}function Vf(n,i,r){var d=n.pingCache;if(d===null){d=n.pingCache=new dC;var y=new Set;d.set(i,y)}else y=d.get(i),y===void 0&&(y=new Set,d.set(i,y));y.has(r)||(If=!0,y.add(r),n=gC.bind(null,n,i,r),i.then(n,n))}function gC(n,i,r){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&r,n.warmLanes&=~r,vt===n&&(Ye&r)===r&&(At===4||At===3&&(Ye&62914560)===Ye&&300>Tt()-Mc?(it&2)===0&&wr(n,0):Uf|=r,_r===Ye&&(_r=0)),ya(n)}function Xv(n,i){i===0&&(i=Gs()),n=ts(n,i),n!==null&&(Xi(n,i),ya(n))}function yC(n){var i=n.memoizedState,r=0;i!==null&&(r=i.retryLane),Xv(n,r)}function vC(n,i){var r=0;switch(n.tag){case 31:case 13:var d=n.stateNode,y=n.memoizedState;y!==null&&(r=y.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(i),Xv(n,r)}function bC(n,i){return ua(n,i)}var Uc=null,Nr=null,Gf=!1,Bc=!1,Kf=!1,xi=0;function ya(n){n!==Nr&&n.next===null&&(Nr===null?Uc=Nr=n:Nr=Nr.next=n),Bc=!0,Gf||(Gf=!0,_C())}function Vl(n,i){if(!Kf&&Bc){Kf=!0;do for(var r=!1,d=Uc;d!==null;){if(n!==0){var y=d.pendingLanes;if(y===0)var b=0;else{var N=d.suspendedLanes,L=d.pingedLanes;b=(1<<31-ot(42|n)+1)-1,b&=y&~(N&~L),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(r=!0,e1(d,b))}else b=Ye,b=Na(d,d===vt?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||In(d,b)||(r=!0,e1(d,b));d=d.next}while(r);Kf=!1}}function xC(){Zv()}function Zv(){Bc=Gf=!1;var n=0;xi!==0&&MC()&&(n=xi);for(var i=Tt(),r=null,d=Uc;d!==null;){var y=d.next,b=Jv(d,i);b===0?(d.next=null,r===null?Uc=y:r.next=y,y===null&&(Nr=r)):(r=d,(n!==0||(b&3)!==0)&&(Bc=!0)),d=y}$t!==0&&$t!==5||Vl(n),xi!==0&&(xi=0)}function Jv(n,i){for(var r=n.suspendedLanes,d=n.pingedLanes,y=n.expirationTimes,b=n.pendingLanes&-62914561;0<b;){var N=31-ot(b),L=1<<N,G=y[N];G===-1?((L&r)===0||(L&d)!==0)&&(y[N]=Vs(L,i)):G<=i&&(n.expiredLanes|=L),b&=~L}if(i=vt,r=Ye,r=Na(n,n===i?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,r===0||n===i&&(ct===2||ct===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&da(d),n.callbackNode=null,n.callbackPriority=0;if((r&3)===0||In(n,r)){if(i=r&-r,i===n.callbackPriority)return i;switch(d!==null&&da(d),fl(r)){case 2:case 8:r=ve;break;case 32:r=Ee;break;case 268435456:r=ke;break;default:r=Ee}return d=Wv.bind(null,n),r=ua(r,d),n.callbackPriority=i,n.callbackNode=r,i}return d!==null&&d!==null&&da(d),n.callbackPriority=2,n.callbackNode=null,2}function Wv(n,i){if($t!==0&&$t!==5)return n.callbackNode=null,n.callbackPriority=0,null;var r=n.callbackNode;if(Ic()&&n.callbackNode!==r)return null;var d=Ye;return d=Na(n,n===vt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(Lv(n,d,i),Jv(n,Tt()),n.callbackNode!=null&&n.callbackNode===r?Wv.bind(null,n):null)}function e1(n,i){if(Ic())return null;Lv(n,i,!0)}function _C(){DC(function(){(it&6)!==0?ua(le,xC):Zv()})}function Qf(){if(xi===0){var n=ur;n===0&&(n=Ps,Ps<<=1,(Ps&261888)===0&&(Ps=256)),xi=n}return xi}function t1(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ko(""+n)}function n1(n,i){var r=i.ownerDocument.createElement("input");return r.name=i.name,r.value=i.value,n.id&&r.setAttribute("form",n.id),i.parentNode.insertBefore(r,i),n=new FormData(n),r.parentNode.removeChild(r),n}function SC(n,i,r,d,y){if(i==="submit"&&r&&r.stateNode===y){var b=t1((y[be]||null).action),N=d.submitter;N&&(i=(i=N[be]||null)?t1(i.formAction):N.getAttribute("formAction"),i!==null&&(b=i,N=null));var L=new Zo("action","action",null,d,y);n.push({event:L,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(xi!==0){var G=N?n1(y,N):new FormData(y);mf(r,{pending:!0,data:G,method:y.method,action:b},null,G)}}else typeof b=="function"&&(L.preventDefault(),G=N?n1(y,N):new FormData(y),mf(r,{pending:!0,data:G,method:y.method,action:b},b,G))},currentTarget:y}]})}}for(var Yf=0;Yf<Td.length;Yf++){var Xf=Td[Yf],wC=Xf.toLowerCase(),CC=Xf[0].toUpperCase()+Xf.slice(1);ia(wC,"on"+CC)}ia(Dg,"onAnimationEnd"),ia(Lg,"onAnimationIteration"),ia(Og,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(Fw,"onTransitionRun"),ia(Hw,"onTransitionStart"),ia($w,"onTransitionCancel"),ia(zg,"onTransitionEnd"),Xs("onMouseEnter",["mouseout","mouseover"]),Xs("onMouseLeave",["mouseout","mouseover"]),Xs("onPointerEnter",["pointerout","pointerover"]),Xs("onPointerLeave",["pointerout","pointerover"]),Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gl="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(" "),NC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gl));function a1(n,i){i=(i&4)!==0;for(var r=0;r<n.length;r++){var d=n[r],y=d.event;d=d.listeners;e:{var b=void 0;if(i)for(var N=d.length-1;0<=N;N--){var L=d[N],G=L.instance,ee=L.currentTarget;if(L=L.listener,G!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ee;try{b(y)}catch(oe){ec(oe)}y.currentTarget=null,b=G}else for(N=0;N<d.length;N++){if(L=d[N],G=L.instance,ee=L.currentTarget,L=L.listener,G!==b&&y.isPropagationStopped())break e;b=L,y.currentTarget=ee;try{b(y)}catch(oe){ec(oe)}y.currentTarget=null,b=G}}}}function Ke(n,i){var r=i[He];r===void 0&&(r=i[He]=new Set);var d=n+"__bubble";r.has(d)||(i1(i,n,2,!1),r.add(d))}function Zf(n,i,r){var d=0;i&&(d|=4),i1(r,n,d,i)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Jf(n){if(!n[Fc]){n[Fc]=!0,Zp.forEach(function(r){r!=="selectionchange"&&(NC.has(r)||Zf(r,!1,n),Zf(r,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Fc]||(i[Fc]=!0,Zf("selectionchange",!1,i))}}function i1(n,i,r,d){switch(D1(i)){case 2:var y=WC;break;case 8:y=eN;break;default:y=hh}r=y.bind(null,i,r,n),y=void 0,!yd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),d?y!==void 0?n.addEventListener(i,r,{capture:!0,passive:y}):n.addEventListener(i,r,!0):y!==void 0?n.addEventListener(i,r,{passive:y}):n.addEventListener(i,r,!1)}function Wf(n,i,r,d,y){var b=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var N=d.tag;if(N===3||N===4){var L=d.stateNode.containerInfo;if(L===y)break;if(N===4)for(N=d.return;N!==null;){var G=N.tag;if((G===3||G===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;L!==null;){if(N=ai(L),N===null)return;if(G=N.tag,G===5||G===6||G===26||G===27){d=b=N;continue e}L=L.parentNode}}d=d.return}cg(function(){var ee=b,oe=pd(r),de=[];e:{var te=Ig.get(n);if(te!==void 0){var ie=Zo,we=n;switch(n){case"keypress":if(Yo(r)===0)break e;case"keydown":case"keyup":ie=vw;break;case"focusin":we="focus",ie=_d;break;case"focusout":we="blur",ie=_d;break;case"beforeblur":case"afterblur":ie=_d;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=rw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=_w;break;case Dg:case Lg:case Og:ie=cw;break;case zg:ie=ww;break;case"scroll":case"scrollend":ie=iw;break;case"wheel":ie=Nw;break;case"copy":case"cut":case"paste":ie=dw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=mg;break;case"toggle":case"beforetoggle":ie=Ew}var Le=(i&4)!==0,pt=!Le&&(n==="scroll"||n==="scrollend"),J=Le?te!==null?te+"Capture":null:te;Le=[];for(var Z=ee,W;Z!==null;){var ue=Z;if(W=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||W===null||J===null||(ue=ml(Z,J),ue!=null&&Le.push(Kl(Z,ue,W))),pt)break;Z=Z.return}0<Le.length&&(te=new ie(te,we,null,r,oe),de.push({event:te,listeners:Le}))}}if((i&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",te&&r!==md&&(we=r.relatedTarget||r.fromElement)&&(ai(we)||we[Re]))break e;if((ie||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(we=r.relatedTarget||r.toElement,ie=ee,we=we?ai(we):null,we!==null&&(pt=c(we),Le=we.tag,we!==pt||Le!==5&&Le!==27&&Le!==6)&&(we=null)):(ie=null,we=ee),ie!==we)){if(Le=fg,ue="onMouseLeave",J="onMouseEnter",Z="mouse",(n==="pointerout"||n==="pointerover")&&(Le=mg,ue="onPointerLeave",J="onPointerEnter",Z="pointer"),pt=ie==null?te:hl(ie),W=we==null?te:hl(we),te=new Le(ue,Z+"leave",ie,r,oe),te.target=pt,te.relatedTarget=W,ue=null,ai(oe)===ee&&(Le=new Le(J,Z+"enter",we,r,oe),Le.target=W,Le.relatedTarget=pt,ue=Le),pt=ue,ie&&we)t:{for(Le=jC,J=ie,Z=we,W=0,ue=J;ue;ue=Le(ue))W++;ue=0;for(var Me=Z;Me;Me=Le(Me))ue++;for(;0<W-ue;)J=Le(J),W--;for(;0<ue-W;)Z=Le(Z),ue--;for(;W--;){if(J===Z||Z!==null&&J===Z.alternate){Le=J;break t}J=Le(J),Z=Le(Z)}Le=null}else Le=null;ie!==null&&s1(de,te,ie,Le,!1),we!==null&&pt!==null&&s1(de,pt,we,Le,!0)}}e:{if(te=ee?hl(ee):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var nt=Sg;else if(xg(te))if(wg)nt=Iw;else{nt=Ow;var Ne=Lw}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&hd(ee.elementType)&&(nt=Sg):nt=zw;if(nt&&(nt=nt(n,ee))){_g(de,nt,r,oe);break e}Ne&&Ne(n,te,ee),n==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&fd(te,"number",te.value)}switch(Ne=ee?hl(ee):window,n){case"focusin":(xg(Ne)||Ne.contentEditable==="true")&&(nr=Ne,Ed=ee,Sl=null);break;case"focusout":Sl=Ed=nr=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,Mg(de,r,oe);break;case"selectionchange":if(Bw)break;case"keydown":case"keyup":Mg(de,r,oe)}var Pe;if(wd)e:{switch(n){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else tr?vg(n,r)&&(Xe="onCompositionEnd"):n==="keydown"&&r.keyCode===229&&(Xe="onCompositionStart");Xe&&(pg&&r.locale!=="ko"&&(tr||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&tr&&(Pe=ug()):(ii=oe,vd="value"in ii?ii.value:ii.textContent,tr=!0)),Ne=Hc(ee,Xe),0<Ne.length&&(Xe=new hg(Xe,n,null,r,oe),de.push({event:Xe,listeners:Ne}),Pe?Xe.data=Pe:(Pe=bg(r),Pe!==null&&(Xe.data=Pe)))),(Pe=Rw?Tw(n,r):Mw(n,r))&&(Xe=Hc(ee,"onBeforeInput"),0<Xe.length&&(Ne=new hg("onBeforeInput","beforeinput",null,r,oe),de.push({event:Ne,listeners:Xe}),Ne.data=Pe)),SC(de,n,ee,r,oe)}a1(de,i)})}function Kl(n,i,r){return{instance:n,listener:i,currentTarget:r}}function Hc(n,i){for(var r=i+"Capture",d=[];n!==null;){var y=n,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=ml(n,r),y!=null&&d.unshift(Kl(n,y,b)),y=ml(n,i),y!=null&&d.push(Kl(n,y,b))),n.tag===3)return d;n=n.return}return[]}function jC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function s1(n,i,r,d,y){for(var b=i._reactName,N=[];r!==null&&r!==d;){var L=r,G=L.alternate,ee=L.stateNode;if(L=L.tag,G!==null&&G===d)break;L!==5&&L!==26&&L!==27||ee===null||(G=ee,y?(ee=ml(r,b),ee!=null&&N.unshift(Kl(r,ee,G))):y||(ee=ml(r,b),ee!=null&&N.push(Kl(r,ee,G)))),r=r.return}N.length!==0&&n.push({event:i,listeners:N})}var EC=/\r\n?/g,kC=/\u0000|\uFFFD/g;function r1(n){return(typeof n=="string"?n:""+n).replace(EC,`
33
+ `).replace(kC,"")}function l1(n,i){return i=r1(i),r1(n)===i}function mt(n,i,r,d,y,b){switch(r){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Js(n,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Js(n,""+d);break;case"className":Vo(n,"class",d);break;case"tabIndex":Vo(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Vo(n,r,d);break;case"style":lg(n,d,b);break;case"data":if(i!=="object"){Vo(n,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||r!=="href")){n.removeAttribute(r);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(r);break}d=Ko(""+d),n.setAttribute(r,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(r,"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}else typeof b=="function"&&(r==="formAction"?(i!=="input"&&mt(n,i,"name",y.name,y,null),mt(n,i,"formEncType",y.formEncType,y,null),mt(n,i,"formMethod",y.formMethod,y,null),mt(n,i,"formTarget",y.formTarget,y,null)):(mt(n,i,"encType",y.encType,y,null),mt(n,i,"method",y.method,y,null),mt(n,i,"target",y.target,y,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(r);break}d=Ko(""+d),n.setAttribute(r,d);break;case"onClick":d!=null&&(n.onclick=ka);break;case"onScroll":d!=null&&Ke("scroll",n);break;case"onScrollEnd":d!=null&&Ke("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(r=d.__html,r!=null){if(y.children!=null)throw Error(s(60));n.innerHTML=r}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}r=Ko(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(r,""+d):n.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(r,""):n.removeAttribute(r);break;case"capture":case"download":d===!0?n.setAttribute(r,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(r,d):n.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(r,d):n.removeAttribute(r);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(r):n.setAttribute(r,d);break;case"popover":Ke("beforetoggle",n),Ke("toggle",n),qo(n,"popover",d);break;case"xlinkActuate":Ea(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ea(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ea(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ea(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ea(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ea(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ea(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ea(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ea(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":qo(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=nw.get(r)||r,qo(n,r,d))}}function eh(n,i,r,d,y,b){switch(r){case"style":lg(n,d,b);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(r=d.__html,r!=null){if(y.children!=null)throw Error(s(60));n.innerHTML=r}}break;case"children":typeof d=="string"?Js(n,d):(typeof d=="number"||typeof d=="bigint")&&Js(n,""+d);break;case"onScroll":d!=null&&Ke("scroll",n);break;case"onScrollEnd":d!=null&&Ke("scrollend",n);break;case"onClick":d!=null&&(n.onclick=ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jp.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(y=r.endsWith("Capture"),i=r.slice(2,y?r.length-7:void 0),b=n[be]||null,b=b!=null?b[r]:null,typeof b=="function"&&n.removeEventListener(i,b,y),typeof d=="function")){typeof b!="function"&&b!==null&&(r in n?n[r]=null:n.hasAttribute(r)&&n.removeAttribute(r)),n.addEventListener(i,d,y);break e}r in n?n[r]=d:d===!0?n.setAttribute(r,""):qo(n,r,d)}}}function Jt(n,i,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",n),Ke("load",n);var d=!1,y=!1,b;for(b in r)if(r.hasOwnProperty(b)){var N=r[b];if(N!=null)switch(b){case"src":d=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:mt(n,i,b,N,r,null)}}y&&mt(n,i,"srcSet",r.srcSet,r,null),d&&mt(n,i,"src",r.src,r,null);return;case"input":Ke("invalid",n);var L=b=N=y=null,G=null,ee=null;for(d in r)if(r.hasOwnProperty(d)){var oe=r[d];if(oe!=null)switch(d){case"name":y=oe;break;case"type":N=oe;break;case"checked":G=oe;break;case"defaultChecked":ee=oe;break;case"value":b=oe;break;case"defaultValue":L=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(s(137,i));break;default:mt(n,i,d,oe,r,null)}}ag(n,b,L,G,ee,N,y,!1);return;case"select":Ke("invalid",n),d=N=b=null;for(y in r)if(r.hasOwnProperty(y)&&(L=r[y],L!=null))switch(y){case"value":b=L;break;case"defaultValue":N=L;break;case"multiple":d=L;default:mt(n,i,y,L,r,null)}i=b,r=N,n.multiple=!!d,i!=null?Zs(n,!!d,i,!1):r!=null&&Zs(n,!!d,r,!0);return;case"textarea":Ke("invalid",n),b=y=d=null;for(N in r)if(r.hasOwnProperty(N)&&(L=r[N],L!=null))switch(N){case"value":d=L;break;case"defaultValue":y=L;break;case"children":b=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:mt(n,i,N,L,r,null)}sg(n,d,y,b);return;case"option":for(G in r)if(r.hasOwnProperty(G)&&(d=r[G],d!=null))switch(G){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:mt(n,i,G,d,r,null)}return;case"dialog":Ke("beforetoggle",n),Ke("toggle",n),Ke("cancel",n),Ke("close",n);break;case"iframe":case"object":Ke("load",n);break;case"video":case"audio":for(d=0;d<Gl.length;d++)Ke(Gl[d],n);break;case"image":Ke("error",n),Ke("load",n);break;case"details":Ke("toggle",n);break;case"embed":case"source":case"link":Ke("error",n),Ke("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in r)if(r.hasOwnProperty(ee)&&(d=r[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:mt(n,i,ee,d,r,null)}return;default:if(hd(i)){for(oe in r)r.hasOwnProperty(oe)&&(d=r[oe],d!==void 0&&eh(n,i,oe,d,r,void 0));return}}for(L in r)r.hasOwnProperty(L)&&(d=r[L],d!=null&&mt(n,i,L,d,r,null))}function RC(n,i,r,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,N=null,L=null,G=null,ee=null,oe=null;for(ie in r){var de=r[ie];if(r.hasOwnProperty(ie)&&de!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":G=de;default:d.hasOwnProperty(ie)||mt(n,i,ie,null,d,de)}}for(var te in d){var ie=d[te];if(de=r[te],d.hasOwnProperty(te)&&(ie!=null||de!=null))switch(te){case"type":b=ie;break;case"name":y=ie;break;case"checked":ee=ie;break;case"defaultChecked":oe=ie;break;case"value":N=ie;break;case"defaultValue":L=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,i));break;default:ie!==de&&mt(n,i,te,ie,d,de)}}dd(n,N,L,G,ee,oe,b,y);return;case"select":ie=N=L=te=null;for(b in r)if(G=r[b],r.hasOwnProperty(b)&&G!=null)switch(b){case"value":break;case"multiple":ie=G;default:d.hasOwnProperty(b)||mt(n,i,b,null,d,G)}for(y in d)if(b=d[y],G=r[y],d.hasOwnProperty(y)&&(b!=null||G!=null))switch(y){case"value":te=b;break;case"defaultValue":L=b;break;case"multiple":N=b;default:b!==G&&mt(n,i,y,b,d,G)}i=L,r=N,d=ie,te!=null?Zs(n,!!r,te,!1):!!d!=!!r&&(i!=null?Zs(n,!!r,i,!0):Zs(n,!!r,r?[]:"",!1));return;case"textarea":ie=te=null;for(L in r)if(y=r[L],r.hasOwnProperty(L)&&y!=null&&!d.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:mt(n,i,L,null,d,y)}for(N in d)if(y=d[N],b=r[N],d.hasOwnProperty(N)&&(y!=null||b!=null))switch(N){case"value":te=y;break;case"defaultValue":ie=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(s(91));break;default:y!==b&&mt(n,i,N,y,d,b)}ig(n,te,ie);return;case"option":for(var we in r)if(te=r[we],r.hasOwnProperty(we)&&te!=null&&!d.hasOwnProperty(we))switch(we){case"selected":n.selected=!1;break;default:mt(n,i,we,null,d,te)}for(G in d)if(te=d[G],ie=r[G],d.hasOwnProperty(G)&&te!==ie&&(te!=null||ie!=null))switch(G){case"selected":n.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:mt(n,i,G,te,d,ie)}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 Le in r)te=r[Le],r.hasOwnProperty(Le)&&te!=null&&!d.hasOwnProperty(Le)&&mt(n,i,Le,null,d,te);for(ee in d)if(te=d[ee],ie=r[ee],d.hasOwnProperty(ee)&&te!==ie&&(te!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,i));break;default:mt(n,i,ee,te,d,ie)}return;default:if(hd(i)){for(var pt in r)te=r[pt],r.hasOwnProperty(pt)&&te!==void 0&&!d.hasOwnProperty(pt)&&eh(n,i,pt,void 0,d,te);for(oe in d)te=d[oe],ie=r[oe],!d.hasOwnProperty(oe)||te===ie||te===void 0&&ie===void 0||eh(n,i,oe,te,d,ie);return}}for(var J in r)te=r[J],r.hasOwnProperty(J)&&te!=null&&!d.hasOwnProperty(J)&&mt(n,i,J,null,d,te);for(de in d)te=d[de],ie=r[de],!d.hasOwnProperty(de)||te===ie||te==null&&ie==null||mt(n,i,de,te,d,ie)}function o1(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,r=performance.getEntriesByType("resource"),d=0;d<r.length;d++){var y=r[d],b=y.transferSize,N=y.initiatorType,L=y.duration;if(b&&L&&o1(N)){for(N=0,L=y.responseEnd,d+=1;d<r.length;d++){var G=r[d],ee=G.startTime;if(ee>L)break;var oe=G.transferSize,de=G.initiatorType;oe&&o1(de)&&(G=G.responseEnd,N+=oe*(G<L?1:(L-ee)/(G-ee)))}if(--d,i+=8*(b+N)/(y.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var th=null,nh=null;function $c(n){return n.nodeType===9?n:n.ownerDocument}function c1(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function u1(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function ah(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ih=null;function MC(){var n=window.event;return n&&n.type==="popstate"?n===ih?!1:(ih=n,!0):(ih=null,!1)}var d1=typeof setTimeout=="function"?setTimeout:void 0,AC=typeof clearTimeout=="function"?clearTimeout:void 0,f1=typeof Promise=="function"?Promise:void 0,DC=typeof queueMicrotask=="function"?queueMicrotask:typeof f1!="undefined"?function(n){return f1.resolve(null).then(n).catch(LC)}:d1;function LC(n){setTimeout(function(){throw n})}function _i(n){return n==="head"}function h1(n,i){var r=i,d=0;do{var y=r.nextSibling;if(n.removeChild(r),y&&y.nodeType===8)if(r=y.data,r==="/$"||r==="/&"){if(d===0){n.removeChild(y),Rr(i);return}d--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")d++;else if(r==="html")Ql(n.ownerDocument.documentElement);else if(r==="head"){r=n.ownerDocument.head,Ql(r);for(var b=r.firstChild;b;){var N=b.nextSibling,L=b.nodeName;b[ln]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&b.rel.toLowerCase()==="stylesheet"||r.removeChild(b),b=N}}else r==="body"&&Ql(n.ownerDocument.body);r=y}while(r);Rr(i)}function m1(n,i){var r=n;n=0;do{var d=r.nextSibling;if(r.nodeType===1?i?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(i?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),d&&d.nodeType===8)if(r=d.data,r==="/$"){if(n===0)break;n--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||n++;r=d}while(r)}function sh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var r=i;switch(i=i.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":sh(r),aa(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}n.removeChild(r)}}function OC(n,i,r,d){for(;n.nodeType===1;){var y=r;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ln])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(b=n.getAttribute("rel"),b==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(b!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(b=n.getAttribute("src"),(b!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===b)return n}else return n;if(n=Gn(n.nextSibling),n===null)break}return null}function zC(n,i,r){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Gn(n.nextSibling),n===null))return null;return n}function p1(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Gn(n.nextSibling),n===null))return null;return n}function rh(n){return n.data==="$?"||n.data==="$~"}function lh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function IC(n,i){var r=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||r.readyState!=="loading")i();else{var d=function(){i(),r.removeEventListener("DOMContentLoaded",d)};r.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Gn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var oh=null;function g1(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var r=n.data;if(r==="/$"||r==="/&"){if(i===0)return Gn(n.nextSibling);i--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||i++}n=n.nextSibling}return null}function y1(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var r=n.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(i===0)return n;i--}else r!=="/$"&&r!=="/&"||i++}n=n.previousSibling}return null}function v1(n,i,r){switch(i=$c(r),n){case"html":if(n=i.documentElement,!n)throw Error(s(452));return n;case"head":if(n=i.head,!n)throw Error(s(453));return n;case"body":if(n=i.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function Ql(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);aa(n)}var Kn=new Map,b1=new Set;function Pc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var qa=X.d;X.d={f:UC,r:BC,D:FC,C:HC,L:$C,m:PC,X:VC,S:qC,M:GC};function UC(){var n=qa.f(),i=Lc();return n||i}function BC(n){var i=Qs(n);i!==null&&i.tag===5&&i.type==="form"?zy(i):qa.r(n)}var jr=typeof document=="undefined"?null:document;function x1(n,i,r){var d=jr;if(d&&typeof i=="string"&&i){var y=Bn(i);y='link[rel="'+n+'"][href="'+y+'"]',typeof r=="string"&&(y+='[crossorigin="'+r+'"]'),b1.has(y)||(b1.add(y),n={rel:n,crossOrigin:r,href:i},d.querySelector(y)===null&&(i=d.createElement("link"),Jt(i,"link",n),Vt(i),d.head.appendChild(i)))}}function FC(n){qa.D(n),x1("dns-prefetch",n,null)}function HC(n,i){qa.C(n,i),x1("preconnect",n,i)}function $C(n,i,r){qa.L(n,i,r);var d=jr;if(d&&n&&i){var y='link[rel="preload"][as="'+Bn(i)+'"]';i==="image"&&r&&r.imageSrcSet?(y+='[imagesrcset="'+Bn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(y+='[imagesizes="'+Bn(r.imageSizes)+'"]')):y+='[href="'+Bn(n)+'"]';var b=y;switch(i){case"style":b=Er(n);break;case"script":b=kr(n)}Kn.has(b)||(n=p({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:n,as:i},r),Kn.set(b,n),d.querySelector(y)!==null||i==="style"&&d.querySelector(Yl(b))||i==="script"&&d.querySelector(Xl(b))||(i=d.createElement("link"),Jt(i,"link",n),Vt(i),d.head.appendChild(i)))}}function PC(n,i){qa.m(n,i);var r=jr;if(r&&n){var d=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Bn(d)+'"][href="'+Bn(n)+'"]',b=y;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=kr(n)}if(!Kn.has(b)&&(n=p({rel:"modulepreload",href:n},i),Kn.set(b,n),r.querySelector(y)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Xl(b)))return}d=r.createElement("link"),Jt(d,"link",n),Vt(d),r.head.appendChild(d)}}}function qC(n,i,r){qa.S(n,i,r);var d=jr;if(d&&n){var y=Ys(d).hoistableStyles,b=Er(n);i=i||"default";var N=y.get(b);if(!N){var L={loading:0,preload:null};if(N=d.querySelector(Yl(b)))L.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":i},r),(r=Kn.get(b))&&ch(n,r);var G=N=d.createElement("link");Vt(G),Jt(G,"link",n),G._p=new Promise(function(ee,oe){G.onload=ee,G.onerror=oe}),G.addEventListener("load",function(){L.loading|=1}),G.addEventListener("error",function(){L.loading|=2}),L.loading|=4,qc(N,i,d)}N={type:"stylesheet",instance:N,count:1,state:L},y.set(b,N)}}}function VC(n,i){qa.X(n,i);var r=jr;if(r&&n){var d=Ys(r).hoistableScripts,y=kr(n),b=d.get(y);b||(b=r.querySelector(Xl(y)),b||(n=p({src:n,async:!0},i),(i=Kn.get(y))&&uh(n,i),b=r.createElement("script"),Vt(b),Jt(b,"link",n),r.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function GC(n,i){qa.M(n,i);var r=jr;if(r&&n){var d=Ys(r).hoistableScripts,y=kr(n),b=d.get(y);b||(b=r.querySelector(Xl(y)),b||(n=p({src:n,async:!0,type:"module"},i),(i=Kn.get(y))&&uh(n,i),b=r.createElement("script"),Vt(b),Jt(b,"link",n),r.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(y,b))}}function _1(n,i,r,d){var y=(y=ge.current)?Pc(y):null;if(!y)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(i=Er(r.href),r=Ys(y).hoistableStyles,d=r.get(i),d||(d={type:"style",instance:null,count:0,state:null},r.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){n=Er(r.href);var b=Ys(y).hoistableStyles,N=b.get(n);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(n,N),(b=y.querySelector(Yl(n)))&&!b._p&&(N.instance=b,N.state.loading=5),Kn.has(n)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Kn.set(n,r),b||KC(y,n,r,N.state))),i&&d===null)throw Error(s(528,""));return N}if(i&&d!==null)throw Error(s(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=kr(r),r=Ys(y).hoistableScripts,d=r.get(i),d||(d={type:"script",instance:null,count:0,state:null},r.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Er(n){return'href="'+Bn(n)+'"'}function Yl(n){return'link[rel="stylesheet"]['+n+"]"}function S1(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function KC(n,i,r,d){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=n.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Jt(i,"link",r),Vt(i),n.head.appendChild(i))}function kr(n){return'[src="'+Bn(n)+'"]'}function Xl(n){return"script[async]"+n}function w1(n,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var d=n.querySelector('style[data-href~="'+Bn(r.href)+'"]');if(d)return i.instance=d,Vt(d),d;var y=p({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Vt(d),Jt(d,"style",y),qc(d,r.precedence,n),i.instance=d;case"stylesheet":y=Er(r.href);var b=n.querySelector(Yl(y));if(b)return i.state.loading|=4,i.instance=b,Vt(b),b;d=S1(r),(y=Kn.get(y))&&ch(d,y),b=(n.ownerDocument||n).createElement("link"),Vt(b);var N=b;return N._p=new Promise(function(L,G){N.onload=L,N.onerror=G}),Jt(b,"link",d),i.state.loading|=4,qc(b,r.precedence,n),i.instance=b;case"script":return b=kr(r.src),(y=n.querySelector(Xl(b)))?(i.instance=y,Vt(y),y):(d=r,(y=Kn.get(b))&&(d=p({},r),uh(d,y)),n=n.ownerDocument||n,y=n.createElement("script"),Vt(y),Jt(y,"link",d),n.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,qc(d,r.precedence,n));return i.instance}function qc(n,i,r){for(var d=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=d.length?d[d.length-1]:null,b=y,N=0;N<d.length;N++){var L=d[N];if(L.dataset.precedence===i)b=L;else if(b!==y)break}b?b.parentNode.insertBefore(n,b.nextSibling):(i=r.nodeType===9?r.head:r,i.insertBefore(n,i.firstChild))}function ch(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Vc=null;function C1(n,i,r){if(Vc===null){var d=new Map,y=Vc=new Map;y.set(r,d)}else y=Vc,d=y.get(r),d||(d=new Map,y.set(r,d));if(d.has(n))return d;for(d.set(n,null),r=r.getElementsByTagName(n),y=0;y<r.length;y++){var b=r[y];if(!(b[ln]||b[ne]||n==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var N=b.getAttribute(i)||"";N=n+N;var L=d.get(N);L?L.push(b):d.set(N,[b])}}return d}function N1(n,i,r){n=n.ownerDocument||n,n.head.insertBefore(r,i==="title"?n.querySelector("head > title"):null)}function QC(n,i,r){if(r===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function j1(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function YC(n,i,r,d){if(r.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var y=Er(d.href),b=i.querySelector(Yl(y));if(b){i=b._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Gc.bind(n),i.then(n,n)),r.state.loading|=4,r.instance=b,Vt(b);return}b=i.ownerDocument||i,d=S1(d),(y=Kn.get(y))&&ch(d,y),b=b.createElement("link"),Vt(b);var N=b;N._p=new Promise(function(L,G){N.onload=L,N.onerror=G}),Jt(b,"link",d),r.instance=b}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(n.count++,r=Gc.bind(n),i.addEventListener("load",r),i.addEventListener("error",r))}}var dh=0;function XC(n,i){return n.stylesheets&&n.count===0&&Qc(n,n.stylesheets),0<n.count||0<n.imgCount?function(r){var d=setTimeout(function(){if(n.stylesheets&&Qc(n,n.stylesheets),n.unsuspend){var b=n.unsuspend;n.unsuspend=null,b()}},6e4+i);0<n.imgBytes&&dh===0&&(dh=62500*TC());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Qc(n,n.stylesheets),n.unsuspend)){var b=n.unsuspend;n.unsuspend=null,b()}},(n.imgBytes>dh?50:800)+i);return n.unsuspend=r,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(y)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Kc=null;function Qc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Kc=new Map,i.forEach(ZC,n),Kc=null,Gc.call(n))}function ZC(n,i){if(!(i.state.loading&4)){var r=Kc.get(n);if(r)var d=r.get(null);else{r=new Map,Kc.set(n,r);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var N=y[b];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(r.set(N.dataset.precedence,N),d=N)}d&&r.set(null,d)}y=i.instance,N=y.getAttribute("data-precedence"),b=r.get(N)||d,b===d&&r.set(null,y),r.set(N,y),this.count++,d=Gc.bind(this),y.addEventListener("load",d),y.addEventListener("error",d),b?b.parentNode.insertBefore(y,b.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),i.state.loading|=4}}var Zl={$$typeof:j,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function JC(n,i,r,d,y,b,N,L,G){this.tag=1,this.containerInfo=n,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=cl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cl(0),this.hiddenUpdates=cl(null),this.identifierPrefix=d,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function E1(n,i,r,d,y,b,N,L,G,ee,oe,de){return n=new JC(n,i,r,N,G,ee,oe,de,L),i=1,b===!0&&(i|=24),b=jn(3,null,null,i),n.current=b,b.stateNode=n,i=Pd(),i.refCount++,n.pooledCache=i,i.refCount++,b.memoizedState={element:d,isDehydrated:r,cache:i},Kd(b),n}function k1(n){return n?(n=sr,n):sr}function R1(n,i,r,d,y,b){y=k1(y),d.context===null?d.context=y:d.pendingContext=y,d=ui(i),d.payload={element:r},b=b===void 0?null:b,b!==null&&(d.callback=b),r=di(n,d,i),r!==null&&(yn(r,n,i),Rl(r,n,i))}function T1(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var r=n.retryLane;n.retryLane=r!==0&&r<i?r:i}}function fh(n,i){T1(n,i),(n=n.alternate)&&T1(n,i)}function M1(n){if(n.tag===13||n.tag===31){var i=ts(n,67108864);i!==null&&yn(i,n,67108864),fh(n,67108864)}}function A1(n){if(n.tag===13||n.tag===31){var i=Mn();i=Ks(i);var r=ts(n,i);r!==null&&yn(r,n,i),fh(n,i)}}var Yc=!0;function WC(n,i,r,d){var y=H.T;H.T=null;var b=X.p;try{X.p=2,hh(n,i,r,d)}finally{X.p=b,H.T=y}}function eN(n,i,r,d){var y=H.T;H.T=null;var b=X.p;try{X.p=8,hh(n,i,r,d)}finally{X.p=b,H.T=y}}function hh(n,i,r,d){if(Yc){var y=mh(d);if(y===null)Wf(n,i,d,Xc,r),L1(n,d);else if(nN(y,n,i,r,d))d.stopPropagation();else if(L1(n,d),i&4&&-1<tN.indexOf(n)){for(;y!==null;){var b=Qs(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var N=rn(b.pendingLanes);if(N!==0){var L=b;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var G=1<<31-ot(N);L.entanglements[1]|=G,N&=~G}ya(b),(it&6)===0&&(Ac=Tt()+500,Vl(0))}}break;case 31:case 13:L=ts(b,2),L!==null&&yn(L,b,2),Lc(),fh(b,2)}if(b=mh(d),b===null&&Wf(n,i,d,Xc,r),b===y)break;y=b}y!==null&&d.stopPropagation()}else Wf(n,i,d,null,r)}}function mh(n){return n=pd(n),ph(n)}var Xc=null;function ph(n){if(Xc=null,n=ai(n),n!==null){var i=c(n);if(i===null)n=null;else{var r=i.tag;if(r===13){if(n=o(i),n!==null)return n;n=null}else if(r===31){if(n=u(i),n!==null)return n;n=null}else if(r===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Xc=n,null}function D1(n){switch(n){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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qi()){case le:return 2;case ve:return 8;case Ee:case Ze:return 32;case ke:return 268435456;default:return 32}default:return 32}}var gh=!1,Si=null,wi=null,Ci=null,Jl=new Map,Wl=new Map,Ni=[],tN="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 L1(n,i){switch(n){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":wi=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":Jl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wl.delete(i.pointerId)}}function eo(n,i,r,d,y,b){return n===null||n.nativeEvent!==b?(n={blockedOn:i,domEventName:r,eventSystemFlags:d,nativeEvent:b,targetContainers:[y]},i!==null&&(i=Qs(i),i!==null&&M1(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),n)}function nN(n,i,r,d,y){switch(i){case"focusin":return Si=eo(Si,n,i,r,d,y),!0;case"dragenter":return wi=eo(wi,n,i,r,d,y),!0;case"mouseover":return Ci=eo(Ci,n,i,r,d,y),!0;case"pointerover":var b=y.pointerId;return Jl.set(b,eo(Jl.get(b)||null,n,i,r,d,y)),!0;case"gotpointercapture":return b=y.pointerId,Wl.set(b,eo(Wl.get(b)||null,n,i,r,d,y)),!0}return!1}function O1(n){var i=ai(n.target);if(i!==null){var r=c(i);if(r!==null){if(i=r.tag,i===13){if(i=o(r),i!==null){n.blockedOn=i,ni(n.priority,function(){A1(r)});return}}else if(i===31){if(i=u(r),i!==null){n.blockedOn=i,ni(n.priority,function(){A1(r)});return}}else if(i===3&&r.stateNode.current.memoizedState.isDehydrated){n.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Zc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var r=mh(n.nativeEvent);if(r===null){r=n.nativeEvent;var d=new r.constructor(r.type,r);md=d,r.target.dispatchEvent(d),md=null}else return i=Qs(r),i!==null&&M1(i),n.blockedOn=r,!1;i.shift()}return!0}function z1(n,i,r){Zc(n)&&r.delete(i)}function aN(){gh=!1,Si!==null&&Zc(Si)&&(Si=null),wi!==null&&Zc(wi)&&(wi=null),Ci!==null&&Zc(Ci)&&(Ci=null),Jl.forEach(z1),Wl.forEach(z1)}function Jc(n,i){n.blockedOn===i&&(n.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aN)))}var Wc=null;function I1(n){Wc!==n&&(Wc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wc===n&&(Wc=null);for(var i=0;i<n.length;i+=3){var r=n[i],d=n[i+1],y=n[i+2];if(typeof d!="function"){if(ph(d||r)===null)continue;break}var b=Qs(r);b!==null&&(n.splice(i,3),i-=3,mf(b,{pending:!0,data:y,method:r.method,action:d},d,y))}}))}function Rr(n){function i(G){return Jc(G,n)}Si!==null&&Jc(Si,n),wi!==null&&Jc(wi,n),Ci!==null&&Jc(Ci,n),Jl.forEach(i),Wl.forEach(i);for(var r=0;r<Ni.length;r++){var d=Ni[r];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Ni.length&&(r=Ni[0],r.blockedOn===null);)O1(r),r.blockedOn===null&&Ni.shift();if(r=(n.ownerDocument||n).$$reactFormReplay,r!=null)for(d=0;d<r.length;d+=3){var y=r[d],b=r[d+1],N=y[be]||null;if(typeof b=="function")N||I1(r);else if(N){var L=null;if(b&&b.hasAttribute("formAction")){if(y=b,N=b[be]||null)L=N.formAction;else if(ph(y)!==null)continue}else L=N.action;typeof L=="function"?r[d+1]=L:(r.splice(d,3),d-=3),I1(r)}}}function U1(){function n(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),d||setTimeout(r,20)}function r(){if(!d&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(r,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function yh(n){this._internalRoot=n}eu.prototype.render=yh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(s(409));var r=i.current,d=Mn();R1(r,d,n,i,null,null)},eu.prototype.unmount=yh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;R1(n.current,2,null,n,null,null),Lc(),i[Re]=null}};function eu(n){this._internalRoot=n}eu.prototype.unstable_scheduleHydration=function(n){if(n){var i=Po();n={blockedOn:null,target:n,priority:i};for(var r=0;r<Ni.length&&i!==0&&i<Ni[r].priority;r++);Ni.splice(r,0,n),r===0&&O1(n)}};var B1=t.version;if(B1!=="19.2.4")throw Error(s(527,B1,"19.2.4"));X.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=m(i),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var iN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{kt=tu.inject(iN),wt=tu}catch(n){}}return no.createRoot=function(n,i){if(!l(n))throw Error(s(299));var r=!1,d="",y=Gy,b=Ky,N=Qy;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(b=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=E1(n,1,!1,null,null,r,d,null,y,b,N,U1),n[Re]=i.current,Jf(n),new yh(i)},no.hydrateRoot=function(n,i,r){if(!l(n))throw Error(s(299));var d=!1,y="",b=Gy,N=Ky,L=Qy,G=null;return r!=null&&(r.unstable_strictMode===!0&&(d=!0),r.identifierPrefix!==void 0&&(y=r.identifierPrefix),r.onUncaughtError!==void 0&&(b=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(L=r.onRecoverableError),r.formState!==void 0&&(G=r.formState)),i=E1(n,1,!0,i,r!=null?r:null,d,y,G,b,N,L,U1),i.context=k1(null),r=i.current,d=Mn(),d=Ks(d),y=ui(d),y.callback=null,di(r,y,d),r=d,i.current.lanes=r,Xi(i,r),ya(i),n[Re]=i.current,Jf(n),new eu(i)},no.version="19.2.4",no}var Q1;function gN(){if(Q1)return Sh.exports;Q1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sh.exports=pN(),Sh.exports}var yN=gN();const vN=uN(yN),dm=new WeakMap,bN=new WeakMap,ju={current:[]};let Nh=!1,bo=0;const mo=new Set,iu=new Map;function nx(e){for(const t of e){if(ju.current.includes(t))continue;ju.current.push(t),t.recompute();const a=bN.get(t);if(a)for(const s of a){const l=dm.get(s);l!=null&&l.length&&nx(l)}}}function xN(e){const t={prevVal:e.prevState,currentVal:e.state};for(const a of e.listeners)a(t)}function _N(e){const t={prevVal:e.prevState,currentVal:e.state};for(const a of e.listeners)a(t)}function ax(e){var t;if(bo>0&&!iu.has(e)&&iu.set(e,e.prevState),mo.add(e),!(bo>0)&&!Nh)try{for(Nh=!0;mo.size>0;){const a=Array.from(mo);mo.clear();for(const s of a){const l=(t=iu.get(s))!=null?t:s.prevState;s.prevState=l,xN(s)}for(const s of a){const l=dm.get(s);l&&(ju.current.push(s),nx(l))}for(const s of a){const l=dm.get(s);if(l)for(const c of l)_N(c)}}}finally{Nh=!1,ju.current=[],iu.clear()}}function SN(e){bo++;try{e()}finally{if(bo--,bo===0){const t=mo.values().next().value;t&&ax(t)}}}function wN(e){return typeof e=="function"}class CN{constructor(t,a){this.listeners=new Set,this.subscribe=s=>{var l,c;this.listeners.add(s);const o=(c=(l=this.options)==null?void 0:l.onSubscribe)==null?void 0:c.call(l,s,this);return()=>{this.listeners.delete(s),o==null||o()}},this.prevState=t,this.state=t,this.options=a}setState(t){var a,s,l;this.prevState=this.state,(a=this.options)!=null&&a.updateFn?this.state=this.options.updateFn(this.prevState)(t):wN(t)?this.state=t(this.prevState):this.state=t,(l=(s=this.options)==null?void 0:s.onUpdate)==null||l.call(s),ax(this)}}const qi="__TSR_index",Y1="popstate",X1="beforeunload";function NN(e){let t=e.getLocation();const a=new Set,s=o=>{t=e.getLocation(),a.forEach(u=>u({location:t,action:o}))},l=o=>{var u;(u=e.notifyOnIndexChange)==null||u?s(o):t=e.getLocation()},c=m=>ze(null,null,function*(){var g=m,{task:o,navigateOpts:u}=g,h=fe(g,["task","navigateOpts"]);var _,S,w,C;if((_=u==null?void 0:u.ignoreBlocker)!=null?_:!1){o();return}const v=(w=(S=e.getBlockers)==null?void 0:S.call(e))!=null?w:[],x=h.type==="PUSH"||h.type==="REPLACE";if(typeof document!="undefined"&&v.length&&x)for(const k of v){const j=No(h.path,h.state);if(yield k.blockerFn({currentLocation:t,nextLocation:j,action:h.type})){(C=e.onBlocked)==null||C.call(e);return}}o()});return{get location(){return t},get length(){return e.getLength()},subscribers:a,subscribe:o=>(a.add(o),()=>{a.delete(o)}),push:(o,u,h)=>{const m=t.state[qi];u=Z1(m+1,u),c({task:()=>{e.pushState(o,u),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:o,state:u})},replace:(o,u,h)=>{const m=t.state[qi];u=Z1(m,u),c({task:()=>{e.replaceState(o,u),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:o,state:u})},go:(o,u)=>{c({task:()=>{e.go(o),l({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{c({task:()=>{var u;e.back((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),l({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{c({task:()=>{var u;e.forward((u=o==null?void 0:o.ignoreBlocker)!=null?u:!1),l({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[qi]!==0,createHref:o=>e.createHref(o),block:o=>{var h,m;if(!e.setBlockers)return()=>{};const u=(m=(h=e.getBlockers)==null?void 0:h.call(e))!=null?m:[];return e.setBlockers([...u,o]),()=>{var p,v,x;const g=(v=(p=e.getBlockers)==null?void 0:p.call(e))!=null?v:[];(x=e.setBlockers)==null||x.call(e,g.filter(_=>_!==o))}},flush:()=>{var o;return(o=e.flush)==null?void 0:o.call(e)},destroy:()=>{var o;return(o=e.destroy)==null?void 0:o.call(e)},notify:s}}function Z1(e,t){t||(t={});const a=Xm();return Y(R({},t),{key:a,__TSR_key:a,[qi]:e})}function ix(e){var B,q,A,U,F;const t=(B=e==null?void 0:e.window)!=null?B:typeof document!="undefined"?window:void 0,a=t.history.pushState,s=t.history.replaceState;let l=[];const c=()=>l,o=$=>l=$,u=(q=e==null?void 0:e.createHref)!=null?q:($=>$),h=(A=e==null?void 0:e.parseLocation)!=null?A:(()=>No(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((U=t.history.state)!=null&&U.__TSR_key)&&!((F=t.history.state)!=null&&F.key)){const $=Xm();t.history.replaceState({[qi]:0,key:$,__TSR_key:$},"")}let m=h(),g,p=!1,v=!1,x=!1,_=!1;const S=()=>m;let w,C;const k=()=>{w&&(I._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),I._ignoreSubscribers=!1,w=void 0,C=void 0,g=void 0)},j=($,V,K)=>{const H=u(V);C||(g=m),m=No(V,K),w={href:H,state:K,isPush:(w==null?void 0:w.isPush)||$==="push"},C||(C=Promise.resolve().then(()=>k()))},E=$=>{m=h(),I.notify({type:$})},O=()=>ze(null,null,function*(){if(v){v=!1;return}const $=h(),V=$.state[qi]-m.state[qi],K=V===1,H=V===-1,X=!K&&!H||p;p=!1;const P=X?"GO":H?"BACK":"FORWARD",re=X?{type:"GO",index:V}:{type:H?"BACK":"FORWARD"};if(x)x=!1;else{const T=c();if(typeof document!="undefined"&&T.length){for(const ce of T)if(yield ce.blockerFn({currentLocation:m,nextLocation:$,action:P})){v=!0,t.history.go(1),I.notify(re);return}}}m=h(),I.notify(re)}),z=$=>{var H;if(_){_=!1;return}let V=!1;const K=c();if(typeof document!="undefined"&&K.length)for(const X of K){const P=(H=X.enableBeforeUnload)!=null?H:!0;if(P===!0){V=!0;break}if(typeof P=="function"&&P()===!0){V=!0;break}}if(V)return $.preventDefault(),$.returnValue=""},I=NN({getLocation:S,getLength:()=>t.history.length,pushState:($,V)=>j("push",$,V),replaceState:($,V)=>j("replace",$,V),back:$=>($&&(x=!0),_=!0,t.history.back()),forward:$=>{$&&(x=!0),_=!0,t.history.forward()},go:$=>{p=!0,t.history.go($)},createHref:$=>u($),flush:k,destroy:()=>{t.history.pushState=a,t.history.replaceState=s,t.removeEventListener(X1,z,{capture:!0}),t.removeEventListener(Y1,O)},onBlocked:()=>{g&&m!==g&&(m=g)},getBlockers:c,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(X1,z,{capture:!0}),t.addEventListener(Y1,O),t.history.pushState=function(...$){const V=a.apply(t.history,$);return I._ignoreSubscribers||E("PUSH"),V},t.history.replaceState=function(...$){const V=s.apply(t.history,$);return I._ignoreSubscribers||E("REPLACE"),V},I}function jN(e){const t=typeof document!="undefined"?window:void 0;return ix({window:t,parseLocation:()=>{var h;const a=t.location.hash.split("#").slice(1),s=(h=a[0])!=null?h:"/",l=t.location.search,c=a.slice(1),o=c.length===0?"":`#${c.join("#")}`,u=`${s}${l}${o}`;return No(u,t.history.state)},createHref:a=>`${t.location.pathname}${t.location.search}#${a}`})}function EN(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function No(e,t){const a=EN(e),s=a.indexOf("#"),l=a.indexOf("?"),c=Xm();return{href:a,pathname:a.substring(0,s>0?l>0?Math.min(s,l):s:l>0?l:a.length),hash:s>-1?a.substring(s):"",search:l>-1?a.slice(l,s===-1?void 0:s):"",state:t||{[qi]:0,key:c,__TSR_key:c}}}function Xm(){return(Math.random()+1).toString(36).substring(7)}const jh=!1;function xo(e){let t;return SN(()=>{t=e()}),t}function jo(e){return e[e.length-1]}function kN(e){return typeof e=="function"}function $i(e,t){return kN(e)?e(t):e}const RN=Object.prototype.hasOwnProperty,J1=Object.prototype.propertyIsEnumerable;function Dn(e,t,a=0){if(e===t)return e;if(a>500)return t;const s=t,l=tb(e)&&tb(s);if(!l&&!(Eu(e)&&Eu(s)))return s;const c=l?e:W1(e);if(!c)return s;const o=l?s:W1(s);if(!o)return s;const u=c.length,h=o.length,m=l?new Array(h):{};let g=0;for(let p=0;p<h;p++){const v=l?p:o[p],x=e[v],_=s[v];if(x===_){m[v]=x,(l?p<u:RN.call(e,v))&&g++;continue}if(x===null||_===null||typeof x!="object"||typeof _!="object"){m[v]=_;continue}const S=Dn(x,_,a+1);m[v]=S,S===x&&g++}return u===h&&g===u?e:m}function W1(e){const t=Object.getOwnPropertyNames(e);for(const l of t)if(!J1.call(e,l))return!1;const a=Object.getOwnPropertySymbols(e);if(a.length===0)return t;const s=t;for(const l of a){if(!J1.call(e,l))return!1;s.push(l)}return s}function Eu(e){if(!eb(e))return!1;const t=e.constructor;if(typeof t=="undefined")return!0;const a=t.prototype;return!(!eb(a)||!a.hasOwnProperty("isPrototypeOf"))}function eb(e){return Object.prototype.toString.call(e)==="[object Object]"}function tb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ts(e,t,a){var s;if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let l=0,c=e.length;l<c;l++)if(!Ts(e[l],t[l],a))return!1;return!0}if(Eu(e)&&Eu(t)){const l=(s=a==null?void 0:a.ignoreUndefined)!=null?s:!0;if(a!=null&&a.partial){for(const u in t)if((!l||t[u]!==void 0)&&!Ts(e[u],t[u],a))return!1;return!0}let c=0;if(!l)c=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&c++;let o=0;for(const u in t)if((!l||t[u]!==void 0)&&(o++,o>c||!Ts(e[u],t[u],a)))return!1;return c===o}return!1}function Yr(e){let t,a;const s=new Promise((l,c)=>{t=l,a=c});return s.status="pending",s.resolve=l=>{s.status="resolved",s.value=l,t(l),e==null||e(l)},s.reject=l=>{s.status="rejected",a(l)},s}function Or(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function TN(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function nb(e){let t;try{t=decodeURI(e)}catch(a){t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch(l){return s}})}return TN(t)}const sx=["http:","https:","mailto:","tel:"];function ku(e){if(!e)return!1;try{const t=new URL(e);return!sx.includes(t.protocol)}catch(t){return!1}}function ao(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let a=0,s="",l;for(;(l=t.exec(e))!==null;)s+=nb(e.slice(a,l.index))+l[0],a=t.lastIndex;s=s+nb(a?e.slice(a):e);let c=!1;return s.startsWith("//")&&(c=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:c}}function MN(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var AN="Invariant failed";function Ja(e,t){if(!e)throw new Error(AN)}function Ru(e){const t=new Map;let a,s;const l=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,s&&(s.next=c,c.prev=s)):(c.next.prev=void 0,a=c.next,c.next=void 0,s&&(c.prev=s,s.next=c)),s=c)};return{get(c){const o=t.get(c);if(o)return l(o),o.value},set(c,o){if(t.size>=e&&a){const h=a;t.delete(h.key),h.next&&(a=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const u=t.get(c);if(u)u.value=o,l(u);else{const h={key:c,value:o,prev:s};s&&(s.next=h),s=h,a||(a=h),t.set(c,h)}},clear(){t.clear(),a=void 0,s=void 0}}}const Xr=0,Ls=1,Os=2,Eo=3,vs=4,rx=5;function DN(e){const t=e.indexOf("{");if(t===-1)return null;const a=e.indexOf("}",t);return a===-1||t+1>=e.length?null:[t,a]}function Zm(e,t,a=new Uint16Array(6)){const s=e.indexOf("/",t),l=s===-1?e.length:s,c=e.substring(t,l);if(!c||!c.includes("$"))return a[0]=Xr,a[1]=t,a[2]=t,a[3]=l,a[4]=l,a[5]=l,a;if(c==="$"){const u=e.length;return a[0]=Os,a[1]=t,a[2]=t,a[3]=u,a[4]=u,a[5]=u,a}if(c.charCodeAt(0)===36)return a[0]=Ls,a[1]=t,a[2]=t+1,a[3]=l,a[4]=l,a[5]=l,a;const o=DN(c);if(o){const[u,h]=o,m=c.charCodeAt(u+1);if(m===45){if(u+2<c.length&&c.charCodeAt(u+2)===36){const g=u+3,p=h;if(g<p)return a[0]=Eo,a[1]=t+u,a[2]=t+g,a[3]=t+p,a[4]=t+h+1,a[5]=l,a}}else if(m===36){const g=u+1,p=u+2;return p===h?(a[0]=Os,a[1]=t+u,a[2]=t+g,a[3]=t+p,a[4]=t+h+1,a[5]=e.length,a):(a[0]=Ls,a[1]=t+u,a[2]=t+p,a[3]=t+h,a[4]=t+h+1,a[5]=l,a)}}return a[0]=Xr,a[1]=t,a[2]=t,a[3]=l,a[4]=l,a[5]=l,a}function Vu(e,t,a,s,l,c,o){var h,m,g,p,v,x,_,S,w,C,k,j,E,O,z,I,B,q,A,U,F,$,V,K,H,X,P,re,T,ce,he;o==null||o(a);let u=s;{const M=(h=a.fullPath)!=null?h:a.from,se=M.length,pe=(g=(m=a.options)==null?void 0:m.caseSensitive)!=null?g:e,ge=!!((v=(p=a.options)==null?void 0:p.params)!=null&&v.parse&&((_=(x=a.options)==null?void 0:x.skipRouteOnParseError)!=null&&_.params));for(;u<se;){const xe=Zm(M,u,t);let Ue;const rt=u,_t=xe[5];switch(u=_t+1,c++,xe[0]){case Xr:{const tt=M.substring(xe[2],xe[3]);if(pe){const Oe=(S=l.static)==null?void 0:S.get(tt);if(Oe)Ue=Oe;else{(w=l.static)!=null||(l.static=new Map);const qe=bs((C=a.fullPath)!=null?C:a.from);qe.parent=l,qe.depth=c,Ue=qe,l.static.set(tt,qe)}}else{const Oe=tt.toLowerCase(),qe=(k=l.staticInsensitive)==null?void 0:k.get(Oe);if(qe)Ue=qe;else{(j=l.staticInsensitive)!=null||(l.staticInsensitive=new Map);const gt=bs((E=a.fullPath)!=null?E:a.from);gt.parent=l,gt.depth=c,Ue=gt,l.staticInsensitive.set(Oe,gt)}}break}case Ls:{const tt=M.substring(rt,xe[1]),Oe=M.substring(xe[4],_t),qe=pe&&!!(tt||Oe),gt=tt?qe?tt:tt.toLowerCase():void 0,je=Oe?qe?Oe:Oe.toLowerCase():void 0,lt=!ge&&((O=l.dynamic)==null?void 0:O.find(Fe=>!Fe.skipOnParamError&&Fe.caseSensitive===qe&&Fe.prefix===gt&&Fe.suffix===je));if(lt)Ue=lt;else{const Fe=kh(Ls,(z=a.fullPath)!=null?z:a.from,qe,gt,je);Ue=Fe,Fe.depth=c,Fe.parent=l,(I=l.dynamic)!=null||(l.dynamic=[]),l.dynamic.push(Fe)}break}case Eo:{const tt=M.substring(rt,xe[1]),Oe=M.substring(xe[4],_t),qe=pe&&!!(tt||Oe),gt=tt?qe?tt:tt.toLowerCase():void 0,je=Oe?qe?Oe:Oe.toLowerCase():void 0,lt=!ge&&((B=l.optional)==null?void 0:B.find(Fe=>!Fe.skipOnParamError&&Fe.caseSensitive===qe&&Fe.prefix===gt&&Fe.suffix===je));if(lt)Ue=lt;else{const Fe=kh(Eo,(q=a.fullPath)!=null?q:a.from,qe,gt,je);Ue=Fe,Fe.parent=l,Fe.depth=c,(A=l.optional)!=null||(l.optional=[]),l.optional.push(Fe)}break}case Os:{const tt=M.substring(rt,xe[1]),Oe=M.substring(xe[4],_t),qe=pe&&!!(tt||Oe),gt=tt?qe?tt:tt.toLowerCase():void 0,je=Oe?qe?Oe:Oe.toLowerCase():void 0,lt=kh(Os,(U=a.fullPath)!=null?U:a.from,qe,gt,je);Ue=lt,lt.parent=l,lt.depth=c,(F=l.wildcard)!=null||(l.wildcard=[]),l.wildcard.push(lt)}}l=Ue}if(ge&&a.children&&!a.isRoot&&a.id&&a.id.charCodeAt(a.id.lastIndexOf("/")+1)===95){const xe=bs(($=a.fullPath)!=null?$:a.from);xe.kind=rx,xe.parent=l,c++,xe.depth=c,(V=l.pathless)!=null||(l.pathless=[]),l.pathless.push(xe),l=xe}const Se=(a.path||!a.children)&&!a.isRoot;if(Se&&M.endsWith("/")){const xe=bs((K=a.fullPath)!=null?K:a.from);xe.kind=vs,xe.parent=l,c++,xe.depth=c,l.index=xe,l=xe}l.parse=(P=(X=(H=a.options)==null?void 0:H.params)==null?void 0:X.parse)!=null?P:null,l.skipOnParamError=ge,l.parsingPriority=(ce=(T=(re=a.options)==null?void 0:re.skipRouteOnParseError)==null?void 0:T.priority)!=null?ce:0,Se&&!l.route&&(l.route=a,l.fullPath=(he=a.fullPath)!=null?he:a.from)}if(a.children)for(const M of a.children)Vu(e,t,M,u,l,c,o)}function Eh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ai(e){var t,a,s;if(e.pathless)for(const l of e.pathless)Ai(l);if(e.static)for(const l of e.static.values())Ai(l);if(e.staticInsensitive)for(const l of e.staticInsensitive.values())Ai(l);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(Eh);for(const l of e.dynamic)Ai(l)}if((a=e.optional)!=null&&a.length){e.optional.sort(Eh);for(const l of e.optional)Ai(l)}if((s=e.wildcard)!=null&&s.length){e.wildcard.sort(Eh);for(const l of e.wildcard)Ai(l)}}function bs(e){return{kind:Xr,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function kh(e,t,a,s,l){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:a,prefix:s,suffix:l}}function LN(e,t){const a=bs("/"),s=new Uint16Array(6);for(const l of e)Vu(!1,s,l,1,a,0);Ai(a),t.masksTree=a,t.flatCache=Ru(1e3)}function ON(e,t){e||(e="/");const a=t.flatCache.get(e);if(a)return a;const s=Jm(e,t.masksTree);return t.flatCache.set(e,s),s}function zN(e,t,a,s,l){e||(e="/"),s||(s="/");const c=t?`case\0${e}`:e;let o=l.singleCache.get(c);if(!o){o=bs("/");const u=new Uint16Array(6);Vu(t,u,{from:e},1,o,0),l.singleCache.set(c,o)}return Jm(s,o,a)}function IN(e,t,a=!1){const s=a?e:`nofuzz\0${e}`,l=t.matchCache.get(s);if(l!==void 0)return l;e||(e="/");let c;try{c=Jm(e,t.segmentTree,a)}catch(o){if(o instanceof URIError)c=null;else throw o}return c&&(c.branch=FN(c.route)),t.matchCache.set(s,c),c}function UN(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function BN(e,t=!1,a){const s=bs(e.fullPath),l=new Uint16Array(6),c={},o={};let u=0;return Vu(t,l,e,1,s,0,m=>{if(a==null||a(m,u),Ja(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,u!==0&&m.path){const g=UN(m.fullPath);(!o[g]||m.fullPath.endsWith("/"))&&(o[g]=m)}u++}),Ai(s),{processedTree:{segmentTree:s,singleCache:Ru(1e3),matchCache:Ru(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:o}}function Jm(e,t,a=!1){const s=e.split("/"),l=$N(e,s,t,a);if(!l)return null;const[c]=lx(e,s,l);return{route:l.node.route,rawParams:c,parsedParams:l.parsedParams}}function lx(e,t,a){var g,p,v,x,_,S,w,C,k,j,E,O,z,I,B,q,A,U,F,$;const s=HN(a.node);let l=null;const c={};let o=(p=(g=a.extract)==null?void 0:g.part)!=null?p:0,u=(x=(v=a.extract)==null?void 0:v.node)!=null?x:0,h=(S=(_=a.extract)==null?void 0:_.path)!=null?S:0,m=(C=(w=a.extract)==null?void 0:w.segment)!=null?C:0;for(;u<s.length;o++,u++,h++,m++){const V=s[u];if(V.kind===vs)break;if(V.kind===rx){m--,o--,h--;continue}const K=t[o],H=h;if(K&&(h+=K.length),V.kind===Ls){l!=null||(l=a.node.fullPath.split("/"));const X=l[m],P=(j=(k=V.prefix)==null?void 0:k.length)!=null?j:0;if(X.charCodeAt(P)===123){const T=(O=(E=V.suffix)==null?void 0:E.length)!=null?O:0,ce=X.substring(P+2,X.length-T-1),he=K.substring(P,K.length-T);c[ce]=decodeURIComponent(he)}else{const T=X.substring(1);c[T]=decodeURIComponent(K)}}else if(V.kind===Eo){if(a.skipped&1<<u){o--,h=H-1;continue}l!=null||(l=a.node.fullPath.split("/"));const X=l[m],P=(I=(z=V.prefix)==null?void 0:z.length)!=null?I:0,re=(q=(B=V.suffix)==null?void 0:B.length)!=null?q:0,T=X.substring(P+3,X.length-re-1),ce=V.suffix||V.prefix?K.substring(P,K.length-re):K;ce&&(c[T]=decodeURIComponent(ce))}else if(V.kind===Os){const X=V,P=e.substring(H+((U=(A=X.prefix)==null?void 0:A.length)!=null?U:0),e.length-(($=(F=X.suffix)==null?void 0:F.length)!=null?$:0)),re=decodeURIComponent(P);c["*"]=re,c._splat=re;break}}return a.rawParams&&Object.assign(c,a.rawParams),[c,{part:o,node:u,path:h,segment:m}]}function FN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function HN(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function $N(e,t,a,s){var p;if(e==="/"&&a.index)return{node:a.index,skipped:0};const l=!jo(t),c=l&&e!=="/",o=t.length-(l?1:0),u=[{node:a,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,g=null;for(;u.length;){const v=u.pop(),{node:x,index:_,skipped:S,depth:w,statics:C,dynamics:k,optionals:j}=v;let{extract:E,rawParams:O,parsedParams:z}=v;if(x.skipOnParamError){if(!Rh(e,t,v))continue;O=v.rawParams,E=v.extract,z=v.parsedParams}s&&x.route&&x.kind!==vs&&io(m,v)&&(m=v);const I=_===o;if(I&&(x.route&&!c&&io(g,v)&&(g=v),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const B=I?void 0:t[_];let q;if(I&&x.index){const A={node:x.index,index:_,skipped:S,depth:w+1,statics:C,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z};let U=!0;if(x.index.skipOnParamError&&(Rh(e,t,A)||(U=!1)),U){if(C===o&&!k&&!j&&!S)return A;io(g,A)&&(g=A)}}if(x.wildcard&&io(h,v))for(const A of x.wildcard){const{prefix:U,suffix:F}=A;if(U&&(I||!(A.caseSensitive?B:q!=null?q:q=B.toLowerCase()).startsWith(U)))continue;if(F){if(I)continue;const V=t.slice(_).join("/").slice(-F.length);if((A.caseSensitive?V:V.toLowerCase())!==F)continue}const $={node:A,index:o,skipped:S,depth:w,statics:C,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z};if(!(A.skipOnParamError&&!Rh(e,t,$))){h=$;break}}if(x.optional){const A=S|1<<w,U=w+1;for(let F=x.optional.length-1;F>=0;F--){const $=x.optional[F];u.push({node:$,index:_,skipped:A,depth:U,statics:C,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z})}if(!I)for(let F=x.optional.length-1;F>=0;F--){const $=x.optional[F],{prefix:V,suffix:K}=$;if(V||K){const H=$.caseSensitive?B:q!=null?q:q=B.toLowerCase();if(V&&!H.startsWith(V)||K&&!H.endsWith(K))continue}u.push({node:$,index:_+1,skipped:S,depth:U,statics:C,dynamics:k,optionals:j+1,extract:E,rawParams:O,parsedParams:z})}}if(!I&&x.dynamic&&B)for(let A=x.dynamic.length-1;A>=0;A--){const U=x.dynamic[A],{prefix:F,suffix:$}=U;if(F||$){const V=U.caseSensitive?B:q!=null?q:q=B.toLowerCase();if(F&&!V.startsWith(F)||$&&!V.endsWith($))continue}u.push({node:U,index:_+1,skipped:S,depth:w+1,statics:C,dynamics:k+1,optionals:j,extract:E,rawParams:O,parsedParams:z})}if(!I&&x.staticInsensitive){const A=x.staticInsensitive.get(q!=null?q:q=B.toLowerCase());A&&u.push({node:A,index:_+1,skipped:S,depth:w+1,statics:C+1,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z})}if(!I&&x.static){const A=x.static.get(B);A&&u.push({node:A,index:_+1,skipped:S,depth:w+1,statics:C+1,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z})}if(x.pathless){const A=w+1;for(let U=x.pathless.length-1;U>=0;U--){const F=x.pathless[U];u.push({node:F,index:_,skipped:S,depth:A,statics:C,dynamics:k,optionals:j,extract:E,rawParams:O,parsedParams:z})}}}if(g&&h)return io(h,g)?g:h;if(g)return g;if(h)return h;if(s&&m){let v=m.index;for(let _=0;_<m.index;_++)v+=t[_].length;const x=v===e.length?"/":e.slice(v);return(p=m.rawParams)!=null||(m.rawParams={}),m.rawParams["**"]=decodeURIComponent(x),m}return null}function Rh(e,t,a){try{const[s,l]=lx(e,t,a);a.rawParams=s,a.extract=l;const c=a.node.parse(s);return a.parsedParams=Object.assign({},a.parsedParams,c),!0}catch(s){return null}}function io(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===vs)>(e.node.kind===vs)||t.node.kind===vs==(e.node.kind===vs)&&t.depth>e.depth))):!0}function bu(e){return Wm(e.filter(t=>t!==void 0).join("/"))}function Wm(e){return e.replace(/\/{2,}/g,"/")}function ox(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Xa(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function cx(e){return Xa(ox(e))}function Tu(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function PN(e,t,a){return Tu(e,a)===Tu(t,a)}function qN({base:e,to:t,trailingSlash:a="never",cache:s}){const l=t.startsWith("/"),c=!l&&t===".";let o;if(s){o=l?t:c?e:e+"\0"+t;const p=s.get(o);if(p)return p}let u;if(c)u=e.split("/");else if(l)u=t.split("/");else{for(u=e.split("/");u.length>1&&jo(u)==="";)u.pop();const p=t.split("/");for(let v=0,x=p.length;v<x;v++){const _=p[v];_===""?v?v===x-1&&u.push(_):u=[_]:_===".."?u.pop():_==="."||u.push(_)}}u.length>1&&(jo(u)===""?a==="never"&&u.pop():a==="always"&&u.push(""));let h,m="";for(let p=0;p<u.length;p++){p>0&&(m+="/");const v=u[p];if(!v)continue;h=Zm(v,0,h);const x=h[0];if(x===Xr){m+=v;continue}const _=h[5],S=v.substring(0,h[1]),w=v.substring(h[4],_),C=v.substring(h[2],h[3]);x===Ls?m+=S||w?`${S}{$${C}}${w}`:`$${C}`:x===Os?m+=S||w?`${S}{$}${w}`:"$":m+=`${S}{-$${C}}${w}`}m=Wm(m);const g=m||"/";return o&&s&&s.set(o,g),g}function VN(e){const t=new Map(e.map(l=>[encodeURIComponent(l),l])),a=Array.from(t.keys()).map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(a,"g");return l=>l.replace(s,c=>{var o;return(o=t.get(c))!=null?o:c})}function Th(e,t,a){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(l=>ab(l,a)).join("/"):ab(s,a)}function Mh(l){var c=l,{path:e,params:t,decoder:a}=c,s=fe(c,["path","params","decoder"]);var x,_;let o=!1;const u={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:u,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:u,isMissingParams:o};const h=e.length;let m=0,g,p="";for(;m<h;){const S=m;g=Zm(e,S,g);const w=g[5];if(m=w+1,S===w)continue;const C=g[0];if(C===Xr){p+="/"+e.substring(S,w);continue}if(C===Os){const k=t._splat;u._splat=k,u["*"]=k;const j=e.substring(S,g[1]),E=e.substring(g[4],w);if(!k){o=!0,(j||E)&&(p+="/"+j+E);continue}const O=Th("_splat",t,a);p+="/"+j+O+E;continue}if(C===Ls){const k=e.substring(g[2],g[3]);!o&&!(k in t)&&(o=!0),u[k]=t[k];const j=e.substring(S,g[1]),E=e.substring(g[4],w),O=(x=Th(k,t,a))!=null?x:"undefined";p+="/"+j+O+E;continue}if(C===Eo){const k=e.substring(g[2],g[3]),j=t[k];if(j==null)continue;u[k]=j;const E=e.substring(S,g[1]),O=e.substring(g[4],w),z=(_=Th(k,t,a))!=null?_:"";p+="/"+E+z+O;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:u,interpolatedPath:p||"/",isMissingParams:o}}function ab(e,t){var s;const a=encodeURIComponent(e);return(s=t==null?void 0:t(a))!=null?s:a}function Ln(e){return!!(e!=null&&e.isNotFound)}function GN(){try{if(typeof window!="undefined"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch(e){}}const fm="tsr-scroll-restoration-v1_3",KN=(e,t)=>{let a;return(...s)=>{a||(a=setTimeout(()=>{e(...s),a=null},t))}};function QN(){const e=GN();if(!e)return null;const t=e.getItem(fm);let a=t?JSON.parse(t):{};return{state:a,set:s=>{a=$i(s,a)||a;try{e.setItem(fm,JSON.stringify(a))}catch(l){console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const su=QN(),YN=e=>e.state.__TSR_key||e.href;function XN(e){const t=[];let a;for(;a=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(a.children,e)+1})`),e=a;return`${t.reverse().join(" > ")}`.toLowerCase()}let Mu=!1;function ZN({storageKey:e,key:t,behavior:a,shouldScrollRestoration:s,scrollToTopSelectors:l,location:c}){var m,g,p;let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(v){console.error(v);return}const u=t||((m=window.history.state)==null?void 0:m.__TSR_key),h=o[u];Mu=!0;e:{if(s&&h&&Object.keys(h).length>0){for(const _ in h){const S=h[_];if(_==="window")window.scrollTo({top:S.scrollY,left:S.scrollX,behavior:a});else if(_){const w=document.querySelector(_);w&&(w.scrollLeft=S.scrollX,w.scrollTop=S.scrollY)}}break e}const v=(c!=null?c:window.location).hash.split("#",2)[1];if(v){const _=(p=(g=window.history.state)==null?void 0:g.__hashScrollIntoViewOptions)!=null?p:!0;if(_){const S=document.getElementById(v);S&&S.scrollIntoView(_)}break e}const x={top:0,left:0,behavior:a};if(window.scrollTo(x),l)for(const _ of l){if(_==="window")continue;const S=typeof _=="function"?_():document.querySelector(_);S&&S.scrollTo(x)}}Mu=!1}function JN(e,t){var c;if(!su||(((c=e.options.scrollRestoration)!=null?c:!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!su))return;e.isScrollRestorationSetup=!0,Mu=!1;const s=e.options.getScrollRestorationKey||YN;window.history.scrollRestoration="manual";const l=o=>{if(Mu||!e.isScrollRestoring)return;let u="";if(o.target===document||o.target===window)u="window";else{const m=o.target.getAttribute("data-scroll-restoration-id");m?u=`[data-scroll-restoration-id="${m}"]`:u=XN(o.target)}const h=s(e.state.location);su.set(m=>{const g=m[h]||(m[h]={}),p=g[u]||(g[u]={});if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return m})};typeof document!="undefined"&&document.addEventListener("scroll",KN(l,100),!0),e.subscribe("onRendered",o=>{const u=s(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(ZN({storageKey:fm,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&su.set(h=>(h[u]||(h[u]={}),h)))})}function WN(e){var t;if(typeof document!="undefined"&&document.querySelector){const a=(t=e.state.location.state.__hashScrollIntoViewOptions)!=null?t:!0;if(a&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(a)}}}function ej(e,t=String){const a=new URLSearchParams;for(const s in e){const l=e[s];l!==void 0&&a.set(s,t(l))}return a.toString()}function Ah(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function tj(e){const t=new URLSearchParams(e),a={};for(const[s,l]of t.entries()){const c=a[s];c==null?a[s]=Ah(l):Array.isArray(c)?c.push(Ah(l)):a[s]=[c,Ah(l)]}return a}const nj=ij(JSON.parse),aj=sj(JSON.stringify,JSON.parse);function ij(e){return t=>{t[0]==="?"&&(t=t.substring(1));const a=tj(t);for(const s in a){const l=a[s];if(typeof l=="string")try{a[s]=e(l)}catch(c){}}return a}}function sj(e,t){const a=typeof t=="function";function s(l){if(typeof l=="object"&&l!==null)try{return e(l)}catch(c){}else if(a&&typeof l=="string")try{return t(l),e(l)}catch(c){}return l}return l=>{const c=ej(l,s);return c?`?${c}`:""}}const Xn="__root__";function rj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&ku(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${sx.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch(s){}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const a=new Response(null,{status:e.statusCode,headers:t});if(a.options=e,e.throw)throw a;return a}function Wn(e){return e instanceof Response&&!!e.options}const xu=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},Gu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(a=>a.id===t)),zr=(e,t,a=!0)=>{var c;const s=R({},(c=e.router.options.context)!=null?c:{}),l=a?t:t-1;for(let o=0;o<=l;o++){const u=e.matches[o];if(!u)continue;const h=e.router.getMatch(u.id);h&&Object.assign(s,h.__routeContext,h.__beforeLoadContext)}return s},ux=(e,t)=>{var l,c,o;const a=(c=e.router.routesById[(l=t.routeId)!=null?l:""])!=null?c:e.router.routeTree;!a.options.notFoundComponent&&((o=e.router.options)!=null&&o.defaultNotFoundComponent)&&(a.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Ja(a.options.notFoundComponent);const s=e.matches.find(u=>u.routeId===a.id);Ja(s,"Could not find match for route: "+a.id),e.updateMatch(s.id,u=>Y(R({},u),{status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&a.parentRoute&&(t.routeId=a.parentRoute.id,ux(e,t))},Pi=(e,t,a)=>{var s,l,c;if(!(!Wn(a)&&!Ln(a))){if(Wn(a)&&a.redirectHandled&&!a.options.reloadDocument)throw a;if(t){(s=t._nonReactive.beforeLoadPromise)==null||s.resolve(),(l=t._nonReactive.loaderPromise)==null||l.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=Wn(a)?"redirected":"notFound";t._nonReactive.error=a,e.updateMatch(t.id,u=>Y(R({},u),{status:o,context:zr(e,t.index),isFetching:!1,error:a})),Ln(a)&&!a.routeId&&(a.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()}throw Wn(a)?(e.rendered=!0,a.options._fromLocation=e.location,a.redirectHandled=!0,a=e.router.resolveRedirect(a),a):(ux(e,a),a)}},dx=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,so=(e,t,a,s)=>{var u,h,m;const{id:l,routeId:c}=e.matches[t],o=e.router.looseRoutesById[c];if(a instanceof Promise)throw a;a.routerCode=s,(u=e.firstBadMatchIndex)!=null||(e.firstBadMatchIndex=t),Pi(e,e.router.getMatch(l),a);try{(m=(h=o.options).onError)==null||m.call(h,a)}catch(g){a=g,Pi(e,e.router.getMatch(l),a)}e.updateMatch(l,g=>{var p,v;return(p=g._nonReactive.beforeLoadPromise)==null||p.resolve(),g._nonReactive.beforeLoadPromise=void 0,(v=g._nonReactive.loadPromise)==null||v.resolve(),Y(R({},g),{error:a,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})})},fx=(e,t,a,s)=>{var o,u,h;if(s._nonReactive.pendingTimeout!==void 0)return;const l=(o=a.options.pendingMs)!=null?o:e.router.options.defaultPendingMs;if(!!(e.onReady&&!Gu(e,t)&&(a.options.loader||a.options.beforeLoad||px(a))&&typeof l=="number"&&l!==1/0&&((h=a.options.pendingComponent)!=null?h:(u=e.router.options)!=null&&u.defaultPendingComponent))){const m=setTimeout(()=>{xu(e)},l);s._nonReactive.pendingTimeout=m}},lj=(e,t,a)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;fx(e,t,a,s);const l=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Pi(e,c,c.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(l):l()},oj=(e,t,a,s)=>{const l=e.router.getMatch(t),c=l._nonReactive.loadPromise;l._nonReactive.loadPromise=Yr(()=>{c==null||c.resolve()});const{paramsError:o,searchError:u}=l;o&&so(e,a,o,"PARSE_PARAMS"),u&&so(e,a,u,"VALIDATE_SEARCH"),fx(e,t,s,l);const h=new AbortController;let m=!1;const g=()=>{m||(m=!0,e.updateMatch(t,E=>Y(R({},E),{isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:h})))},p=()=>{var E;(E=l._nonReactive.beforeLoadPromise)==null||E.resolve(),l._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>Y(R({},O),{isFetching:!1}))};if(!s.options.beforeLoad){xo(()=>{g(),p()});return}l._nonReactive.beforeLoadPromise=Yr();const v=R(R({},zr(e,a,!1)),l.__routeContext),{search:x,params:_,cause:S}=l,w=Gu(e,t),C=R({search:x,abortController:h,params:_,preload:w,context:v,location:e.location,navigate:E=>e.router.navigate(Y(R({},E),{_fromLocation:e.location})),buildLocation:e.router.buildLocation,cause:w?"preload":S,matches:e.matches,routeId:s.id},e.router.options.additionalContext),k=E=>{if(E===void 0){xo(()=>{g(),p()});return}(Wn(E)||Ln(E))&&(g(),so(e,a,E,"BEFORE_LOAD")),xo(()=>{g(),e.updateMatch(t,O=>Y(R({},O),{__beforeLoadContext:E})),p()})};let j;try{if(j=s.options.beforeLoad(C),Or(j))return g(),j.catch(E=>{so(e,a,E,"BEFORE_LOAD")}).then(k)}catch(E){g(),so(e,a,E,"BEFORE_LOAD")}k(j)},cj=(e,t)=>{const{id:a,routeId:s}=e.matches[t],l=e.router.looseRoutesById[s],c=()=>u(),o=()=>oj(e,a,t,l),u=()=>{if(dx(e,a))return;const h=lj(e,a,l);return Or(h)?h.then(o):o()};return c()},uj=(e,t,a)=>{var c,o,u,h,m,g;const s=e.router.getMatch(t);if(!s||!a.options.head&&!a.options.scripts&&!a.options.headers)return;const l={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([(o=(c=a.options).head)==null?void 0:o.call(c,l),(h=(u=a.options).scripts)==null?void 0:h.call(u,l),(g=(m=a.options).headers)==null?void 0:g.call(m,l)]).then(([p,v,x])=>{const _=p==null?void 0:p.meta,S=p==null?void 0:p.links,w=p==null?void 0:p.scripts,C=p==null?void 0:p.styles;return{meta:_,links:S,headScripts:w,headers:x,scripts:v,styles:C}})},hx=(e,t,a,s)=>{const l=e.matchPromises[a-1],{params:c,loaderDeps:o,abortController:u,cause:h}=e.router.getMatch(t),m=zr(e,a),g=Gu(e,t);return R({params:c,deps:o,preload:!!g,parentMatchPromise:l,abortController:u,context:m,location:e.location,navigate:p=>e.router.navigate(Y(R({},p),{_fromLocation:e.location})),cause:g?"preload":h,route:s},e.router.options.additionalContext)},ib=(e,t,a,s)=>ze(null,null,function*(){var l,c,o,u,h,m,g;try{const p=e.router.getMatch(t);try{(!(jh!=null?jh:e.router.isServer)||p.ssr===!0)&&mx(s);const v=(c=(l=s.options).loader)==null?void 0:c.call(l,hx(e,t,a,s)),x=s.options.loader&&Or(v);if(!!(x||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||p._nonReactive.minPendingPromise)&&e.updateMatch(t,w=>Y(R({},w),{isFetching:"loader"})),s.options.loader){const w=x?yield v:v;Pi(e,e.router.getMatch(t),w),w!==void 0&&e.updateMatch(t,C=>Y(R({},C),{loaderData:w}))}s._lazyPromise&&(yield s._lazyPromise);const S=p._nonReactive.minPendingPromise;S&&(yield S),s._componentsPromise&&(yield s._componentsPromise),e.updateMatch(t,w=>Y(R({},w),{error:void 0,context:zr(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(v){let x=v;if((x==null?void 0:x.name)==="AbortError"){if(p.abortController.signal.aborted){(o=p._nonReactive.loaderPromise)==null||o.resolve(),p._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,S=>Y(R({},S),{status:S.status==="pending"?"success":S.status,isFetching:!1,context:zr(e,a)}));return}const _=p._nonReactive.minPendingPromise;_&&(yield _),Ln(v)&&(yield(h=(u=s.options.notFoundComponent)==null?void 0:u.preload)==null?void 0:h.call(u)),Pi(e,e.router.getMatch(t),v);try{(g=(m=s.options).onError)==null||g.call(m,v)}catch(S){x=S,Pi(e,e.router.getMatch(t),S)}e.updateMatch(t,S=>Y(R({},S),{error:x,context:zr(e,a),status:"error",isFetching:!1}))}}catch(p){const v=e.router.getMatch(t);v&&(v._nonReactive.loaderPromise=void 0),Pi(e,v,p)}}),dj=(e,t)=>ze(null,null,function*(){var g,p;function a(v,x,_,S){return ze(this,null,function*(){var z,I,B,q;const w=Date.now()-x.updatedAt,C=v?(I=(z=S.options.preloadStaleTime)!=null?z:e.router.options.defaultPreloadStaleTime)!=null?I:3e4:(q=(B=S.options.staleTime)!=null?B:e.router.options.defaultStaleTime)!=null?q:0,k=S.options.shouldReload,j=typeof k=="function"?k(hx(e,s,t,S)):k,{status:E,invalid:O}=_;c=E==="success"&&(O||(j!=null?j:w>C)),v&&S.options.preload===!1||(c&&!e.sync?(o=!0,ze(null,null,function*(){var A,U;try{yield ib(e,s,t,S);const F=e.router.getMatch(s);(A=F._nonReactive.loaderPromise)==null||A.resolve(),(U=F._nonReactive.loadPromise)==null||U.resolve(),F._nonReactive.loaderPromise=void 0}catch(F){Wn(F)&&(yield e.router.navigate(F.options))}})):(E!=="success"||c&&e.sync)&&(yield ib(e,s,t,S)))})}const{id:s,routeId:l}=e.matches[t];let c=!1,o=!1;const u=e.router.looseRoutesById[l];if(!dx(e,s)){const v=e.router.getMatch(s),x=Gu(e,s);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload)return v;yield v._nonReactive.loaderPromise;const _=e.router.getMatch(s),S=_._nonReactive.error||_.error;S&&Pi(e,_,S),_.status==="pending"&&(yield a(x,v,_,u))}else{const _=x&&!e.router.state.matches.some(w=>w.id===s),S=e.router.getMatch(s);S._nonReactive.loaderPromise=Yr(),_!==S.preload&&e.updateMatch(s,w=>Y(R({},w),{preload:_})),yield a(x,v,S,u)}}const h=e.router.getMatch(s);o||((g=h._nonReactive.loaderPromise)==null||g.resolve(),(p=h._nonReactive.loadPromise)==null||p.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,o||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const m=o?h.isFetching:!1;return m!==h.isFetching||h.invalid!==!1?(e.updateMatch(s,v=>Y(R({},v),{isFetching:m,invalid:!1})),e.router.getMatch(s)):h});function sb(e){return ze(this,null,function*(){var a;const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(s=>s._forcePending)&&xu(t);try{for(let h=0;h<t.matches.length;h++){const m=cj(t,h);Or(m)&&(yield m)}const s=(a=t.firstBadMatchIndex)!=null?a:t.matches.length;for(let h=0;h<s;h++)t.matchPromises.push(dj(t,h));const c=(yield Promise.allSettled(t.matchPromises)).filter(h=>h.status==="rejected").map(h=>h.reason);let o;for(const h of c){if(Wn(h))throw h;!o&&Ln(h)&&(o=h)}for(const h of t.matches){const{id:m,routeId:g}=h,p=t.router.looseRoutesById[g];try{const v=uj(t,m,p);if(v){const x=yield v;t.updateMatch(m,_=>R(R({},_),x))}}catch(v){console.error(`Error executing head for route ${g}:`,v)}}if(o)throw o;const u=xu(t);Or(u)&&(yield u)}catch(s){if(Ln(s)&&!t.preload){const l=xu(t);throw Or(l)&&(yield l),s}if(Wn(s))throw s}return t.matches})}function mx(e){return ze(this,null,function*(){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const l=t.options,{id:a}=l,s=fe(l,["id"]);Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{var s;const a=[];for(const l of gx){const c=(s=e.options[l])==null?void 0:s.preload;c&&a.push(c())}if(a.length)return Promise.all(a).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise})}function px(e){var t;for(const a of gx)if((t=e.options[a])!=null&&t.preload)return!0;return!1}const gx=["component","errorComponent","pendingComponent","notFoundComponent"];function fj(e){return{input:({url:t})=>{for(const a of e)t=hm(a,t);return t},output:({url:t})=>{for(let a=e.length-1;a>=0;a--)t=yx(e[a],t);return t}}}function hj(e){const t=cx(e.basepath),a=`/${t}`,s=`${a}/`,l=e.caseSensitive?a:a.toLowerCase(),c=e.caseSensitive?s:s.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===l?o.pathname="/":u.startsWith(c)&&(o.pathname=o.pathname.slice(a.length)),o},output:({url:o})=>(o.pathname=bu(["/",t,o.pathname]),o)}}function hm(e,t){var s;const a=(s=e==null?void 0:e.input)==null?void 0:s.call(e,{url:t});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return t}function yx(e,t){var s;const a=(s=e==null?void 0:e.output)==null?void 0:s.call(e,{url:t});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return t}function Ms(e){const t=e.resolvedLocation,a=e.location,s=(t==null?void 0:t.pathname)!==a.pathname,l=(t==null?void 0:t.href)!==a.href,c=(t==null?void 0:t.hash)!==a.hash;return{fromLocation:t,toLocation:a,pathChanged:s,hrefChanged:l,hashChanged:c}}class mj{constructor(t){var a,s,l,c;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=o=>o(),this.update=o=>{var w,C,k,j,E;o.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const u=this.options,h=(C=(w=this.basepath)!=null?w:u==null?void 0:u.basepath)!=null?C:"/",m=this.basepath===void 0,g=u==null?void 0:u.rewrite;if(this.options=R(R({},u),o),this.isServer=(k=this.options.isServer)!=null?k:typeof document=="undefined",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=VN(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ix()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let O;this.resolvePathCache=Ru(1e3),O=this.buildRouteTree(),this.setRoutes(O)}!this.__store&&this.latestLocation&&(this.__store=new CN(gj(this.latestLocation),{onUpdate:()=>{this.__store.state=Y(R({},this.state),{cachedMatches:this.state.cachedMatches.filter(O=>!["redirected"].includes(O.status))})}}),JN(this));let p=!1;const v=(j=this.options.basepath)!=null?j:"/",x=this.options.rewrite;if(m||h!==v||g!==x){this.basepath=v;const O=[],z=cx(v);z&&z!=="/"&&O.push(hj({basepath:v})),x&&O.push(x),this.rewrite=O.length===0?void 0:O.length===1?O[0]:fj(O),this.history&&this.updateLatestLocation(),p=!0}p&&this.__store&&(this.__store.state=Y(R({},this.state),{location:this.latestLocation})),typeof window!="undefined"&&"CSS"in window&&typeof((E=window.CSS)==null?void 0:E.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const o=BN(this.routeTree,this.options.caseSensitive,(u,h)=>{u.init({originalIndex:h})});return this.options.routeMasks&&LN(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,u)=>{const h={eventType:o,fn:u};return this.subscribers.add(h),()=>{this.subscribers.delete(h)}},this.emit=o=>{this.subscribers.forEach(u=>{u.eventType===o.type&&u.fn(o)})},this.parseLocation=(o,u)=>{const h=({pathname:v,search:x,hash:_,href:S,state:w})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(v)){const z=this.options.parseSearch(x),I=this.options.stringifySearch(z);return{href:v+I+_,publicHref:S,pathname:ao(v).path,external:!1,searchStr:I,search:Dn(u==null?void 0:u.search,z),hash:ao(_.slice(1)).path,state:Dn(u==null?void 0:u.state,w)}}const C=new URL(S,this.origin),k=hm(this.rewrite,C),j=this.options.parseSearch(k.search),E=this.options.stringifySearch(j);return k.search=E,{href:k.href.replace(k.origin,""),publicHref:S,pathname:ao(k.pathname).path,external:!!this.rewrite&&k.origin!==this.origin,searchStr:E,search:Dn(u==null?void 0:u.search,j),hash:ao(k.hash.slice(1)).path,state:Dn(u==null?void 0:u.state,w)}},m=h(o),{__tempLocation:g,__tempKey:p}=m.state;if(g&&(!p||p===this.tempLocationKey)){const v=h(g);return v.state.key=m.state.key,v.state.__TSR_key=m.state.__TSR_key,delete v.state.__tempLocation,Y(R({},v),{maskedLocation:m})}return m},this.resolvePathWithBase=(o,u)=>qN({base:o,to:Wm(u),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,u,h)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:u},h):this.matchRoutesInternal(o,u),this.getMatchedRoutes=o=>yj({pathname:o,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=o=>{const u=this.getMatch(o);u&&(u.abortController.abort(),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{var m;const o=this.state.matches.filter(g=>g.status==="pending"),u=this.state.matches.filter(g=>g.isFetching==="loader");new Set([...(m=this.state.pendingMatches)!=null?m:[],...o,...u]).forEach(g=>{this.cancelMatch(g.id)})},this.buildLocation=o=>{const u=(m={})=>{var X,P,re,T,ce;const g=m._fromLocation||this.pendingBuiltLocation||this.latestLocation,p=this.matchRoutesLightweight(g);m.from;const v=m.unsafeRelative==="path"?g.pathname:(X=m.from)!=null?X:p.fullPath,x=this.resolvePathWithBase(v,"."),_=p.search,S=R({},p.params),w=m.to?this.resolvePathWithBase(x,`${m.to}`):this.resolvePathWithBase(x,"."),C=m.params===!1||m.params===null?{}:((P=m.params)!=null?P:!0)===!0?S:Object.assign(S,$i(m.params,S)),k=Mh({path:w,params:C,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(k);let E=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:Xa(k))&&this.options.notFoundRoute&&(E=[...E,this.options.notFoundRoute]);let z=!1;if(Object.keys(C).length>0)for(const he of E){const M=(T=(re=he.options.params)==null?void 0:re.stringify)!=null?T:he.options.stringifyParams;M&&(z=!0,Object.assign(C,M(C)))}const I=o.leaveParams?w:ao(z?Mh({path:w,params:C,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:k).path;let B=_;if(o._includeValidateSearch&&((ce=this.options.search)!=null&&ce.strict)){const he={};E.forEach(M=>{if(M.options.validateSearch)try{Object.assign(he,_u(M.options.validateSearch,R(R({},he),B)))}catch(se){}}),B=he}B=vj({search:B,dest:m,destRoutes:E,_includeValidateSearch:o._includeValidateSearch}),B=Dn(_,B);const q=this.options.stringifySearch(B),A=m.hash===!0?g.hash:m.hash?$i(m.hash,g.hash):void 0,U=A?`#${A}`:"";let F=m.state===!0?g.state:m.state?$i(m.state,g.state):{};F=Dn(g.state,F);const $=`${I}${q}${U}`;let V,K,H=!1;if(this.rewrite){const he=new URL($,this.origin),M=yx(this.rewrite,he);V=he.href.replace(he.origin,""),M.origin!==this.origin?(K=M.href,H=!0):K=M.pathname+M.search+M.hash}else V=MN($),K=V;return{publicHref:K,href:V,pathname:I,search:B,searchStr:q,state:F,hash:A!=null?A:"",external:H,unmaskOnReload:m.unmaskOnReload}},h=(m={},g)=>{const p=u(m);let v=g?u(g):void 0;if(!v){const _={};if(this.options.routeMasks){const S=ON(p.pathname,this.processedTree);if(S){Object.assign(_,S.rawParams);const x=S.route,{from:w,params:C}=x,k=fe(x,["from","params"]),j=C===!1||C===null?{}:(C!=null?C:!0)===!0?_:Object.assign(_,$i(C,_));g=Y(R({from:o.from},k),{params:j}),v=u(g)}}}return v&&(p.maskedLocation=v),p};return o.mask?h(o,R({from:o.from},o.mask)):h(o)},this.commitLocation=m=>ze(this,null,function*(){var g=m,{viewTransition:o,ignoreBlocker:u}=g,h=fe(g,["viewTransition","ignoreBlocker"]);var S,w,C,k;const p=()=>{const j=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];j.forEach(O=>{h.state[O]=this.latestLocation.state[O]});const E=Ts(h.state,this.latestLocation.state);return j.forEach(O=>{delete h.state[O]}),E},v=Xa(this.latestLocation.href)===Xa(h.href),x=this.commitLocationPromise;if(this.commitLocationPromise=Yr(()=>{x==null||x.resolve()}),v&&p())this.load();else{let _=h,{maskedLocation:j,hashScrollIntoView:E}=_,O=fe(_,["maskedLocation","hashScrollIntoView"]);j&&(O=Y(R({},j),{state:Y(R({},j.state),{__tempKey:void 0,__tempLocation:Y(R({},O),{search:O.searchStr,state:Y(R({},O.state),{__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0})})})}),(w=(S=O.unmaskOnReload)!=null?S:this.options.unmaskOnReload)!=null&&w&&(O.state.__tempKey=this.tempLocationKey)),O.state.__hashScrollIntoViewOptions=(C=E!=null?E:this.options.defaultHashScrollIntoView)!=null?C:!0,this.shouldViewTransition=o,this.history[h.replace?"replace":"push"](O.publicHref,O.state,{ignoreBlocker:u})}return this.resetNextScroll=(k=h.resetScroll)!=null?k:!0,this.history.subscribers.size||this.load(),this.commitLocationPromise}),this.buildAndCommitLocation=(x={})=>{var _=x,{replace:o,resetScroll:u,hashScrollIntoView:h,viewTransition:m,ignoreBlocker:g,href:p}=_,v=fe(_,["replace","resetScroll","hashScrollIntoView","viewTransition","ignoreBlocker","href"]);if(p){const C=this.history.location.state.__TSR_index,k=No(p,{__TSR_index:o?C:C+1}),j=new URL(k.pathname,this.origin),E=hm(this.rewrite,j);v.to=E.pathname,v.search=this.options.parseSearch(k.search),v.hash=k.hash.slice(1)}const S=this.buildLocation(Y(R({},v),{_includeValidateSearch:!0}));this.pendingBuiltLocation=S;const w=this.commitLocation(Y(R({},S),{viewTransition:m,replace:o,resetScroll:u,hashScrollIntoView:h,ignoreBlocker:g}));return Promise.resolve().then(()=>{this.pendingBuiltLocation===S&&(this.pendingBuiltLocation=void 0)}),w},this.navigate=p=>ze(this,null,function*(){var v=p,{to:o,reloadDocument:u,href:h,publicHref:m}=v,g=fe(v,["to","reloadDocument","href","publicHref"]);var _,S;let x=!1;if(h)try{new URL(`${h}`),x=!0}catch(w){}if(x&&!u&&(u=!0),u){if(o!==void 0||!h){const C=this.buildLocation(R({to:o},g));h=h!=null?h:C.publicHref,m=m!=null?m:C.publicHref}const w=!x&&m?m:h;if(ku(w))return Promise.resolve();if(!g.ignoreBlocker){const C=this.history,k=(S=(_=C.getBlockers)==null?void 0:_.call(C))!=null?S:[];for(const j of k)if(j!=null&&j.blockerFn&&(yield j.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"})))return Promise.resolve()}return g.replace?window.location.replace(w):window.location.href=w,Promise.resolve()}return this.buildAndCommitLocation(Y(R({},g),{href:h,to:o,_isNavigate:!0}))}),this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const o=this.matchRoutes(this.latestLocation);this.__store.setState(u=>Y(R({},u),{status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:o,cachedMatches:u.cachedMatches.filter(h=>!o.some(m=>m.id===h.id))}))},this.load=o=>ze(this,null,function*(){let u,h,m;for(m=new Promise(p=>{this.startTransition(()=>ze(this,null,function*(){var v;try{this.beforeLoad();const x=this.latestLocation,_=this.state.resolvedLocation;this.state.redirect||this.emit(R({type:"onBeforeNavigate"},Ms({resolvedLocation:_,location:x}))),this.emit(R({type:"onBeforeLoad"},Ms({resolvedLocation:_,location:x}))),yield sb({router:this,sync:o==null?void 0:o.sync,matches:this.state.pendingMatches,location:x,updateMatch:this.updateMatch,onReady:()=>ze(this,null,function*(){this.startTransition(()=>{this.startViewTransition(()=>ze(this,null,function*(){let S=[],w=[],C=[];xo(()=>{this.__store.setState(k=>{const j=k.matches,E=k.pendingMatches||k.matches;return S=j.filter(O=>!E.some(z=>z.id===O.id)),w=E.filter(O=>!j.some(z=>z.id===O.id)),C=E.filter(O=>j.some(z=>z.id===O.id)),Y(R({},k),{isLoading:!1,loadedAt:Date.now(),matches:E,pendingMatches:void 0,cachedMatches:[...k.cachedMatches,...S.filter(O=>O.status!=="error"&&O.status!=="notFound")]})}),this.clearExpiredCache()}),[[S,"onLeave"],[w,"onEnter"],[C,"onStay"]].forEach(([k,j])=>{k.forEach(E=>{var O,z;(z=(O=this.looseRoutesById[E.routeId].options)[j])==null||z.call(O,E)})})}))})})})}catch(x){Wn(x)?(u=x,this.navigate(Y(R({},u.options),{replace:!0,ignoreBlocker:!0}))):Ln(x)&&(h=x),this.__store.setState(_=>Y(R({},_),{statusCode:u?u.status:h?404:_.matches.some(S=>S.status==="error")?500:200,redirect:u}))}this.latestLoadPromise===m&&((v=this.commitLocationPromise)==null||v.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()}))}),this.latestLoadPromise=m,yield m;this.latestLoadPromise&&m!==this.latestLoadPromise;)yield this.latestLoadPromise;let g;this.hasNotFoundMatch()?g=404:this.__store.state.matches.some(p=>p.status==="error")&&(g=500),g!==void 0&&this.__store.setState(p=>Y(R({},p),{statusCode:g}))}),this.startViewTransition=o=>{var h;const u=(h=this.shouldViewTransition)!=null?h:this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,u&&typeof document!="undefined"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let m;if(typeof u=="object"&&this.isViewTransitionTypesSupported){const g=this.latestLocation,p=this.state.resolvedLocation,v=typeof u.types=="function"?u.types(Ms({resolvedLocation:p,location:g})):u.types;if(v===!1){o();return}m={update:o,types:v}}else m=o;document.startViewTransition(m)}else o()},this.updateMatch=(o,u)=>{this.startTransition(()=>{var m;const h=(m=this.state.pendingMatches)!=null&&m.some(g=>g.id===o)?"pendingMatches":this.state.matches.some(g=>g.id===o)?"matches":this.state.cachedMatches.some(g=>g.id===o)?"cachedMatches":"";h&&this.__store.setState(g=>{var p;return Y(R({},g),{[h]:(p=g[h])==null?void 0:p.map(v=>v.id===o?u(v):v)})})})},this.getMatch=o=>{var h,m,g;const u=p=>p.id===o;return(g=(m=this.state.cachedMatches.find(u))!=null?m:(h=this.state.pendingMatches)==null?void 0:h.find(u))!=null?g:this.state.matches.find(u)},this.invalidate=o=>{const u=h=>{var m,g;return(g=(m=o==null?void 0:o.filter)==null?void 0:m.call(o,h))==null||g?R(Y(R({},h),{invalid:!0}),o!=null&&o.forcePending||h.status==="error"||h.status==="notFound"?{status:"pending",error:void 0}:void 0):h};return this.__store.setState(h=>{var m;return Y(R({},h),{matches:h.matches.map(u),cachedMatches:h.cachedMatches.map(u),pendingMatches:(m=h.pendingMatches)==null?void 0:m.map(u)})}),this.shouldViewTransition=!1,this.load({sync:o==null?void 0:o.sync})},this.getParsedLocationHref=o=>o.publicHref||"/",this.resolveRedirect=o=>{var h;const u=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){const m=(h=o.options._builtLocation)!=null?h:this.buildLocation(o.options),g=this.getParsedLocationHref(m);o.options.href=g,o.headers.set("Location",g)}else if(u)try{const m=new URL(u);if(this.origin&&m.origin===this.origin){const g=m.pathname+m.search+m.hash;o.options.href=g,o.headers.set("Location",g)}}catch(m){}return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{const u=o==null?void 0:o.filter;u!==void 0?this.__store.setState(h=>Y(R({},h),{cachedMatches:h.cachedMatches.filter(m=>!u(m))})):this.__store.setState(h=>Y(R({},h),{cachedMatches:[]}))},this.clearExpiredCache=()=>{const o=u=>{var v,x,_;const h=this.looseRoutesById[u.routeId];if(!h.options.loader)return!0;const m=(_=u.preload?(v=h.options.preloadGcTime)!=null?v:this.options.defaultPreloadGcTime:(x=h.options.gcTime)!=null?x:this.options.defaultGcTime)!=null?_:300*1e3;return u.status==="error"?!0:Date.now()-u.updatedAt>=m};this.clearCache({filter:o})},this.loadRouteChunk=mx,this.preloadRoute=o=>ze(this,null,function*(){var p;const u=this.buildLocation(o);let h=this.matchRoutes(u,{throwOnError:!0,preload:!0,dest:o});const m=new Set([...this.state.matches,...(p=this.state.pendingMatches)!=null?p:[]].map(v=>v.id)),g=new Set([...m,...this.state.cachedMatches.map(v=>v.id)]);xo(()=>{h.forEach(v=>{g.has(v.id)||this.__store.setState(x=>Y(R({},x),{cachedMatches:[...x.cachedMatches,v]}))})});try{return h=yield sb({router:this,matches:h,location:u,preload:!0,updateMatch:(v,x)=>{m.has(v)?h=h.map(_=>_.id===v?x(_):_):this.updateMatch(v,x)}}),h}catch(v){if(Wn(v))return v.options.reloadDocument?void 0:yield this.preloadRoute(Y(R({},v.options),{_fromLocation:u}));Ln(v)||console.error(v);return}}),this.matchRoute=(o,u)=>{var x,_,S;const h=Y(R({},o),{to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0}),m=this.buildLocation(h);if(u!=null&&u.pending&&this.state.status!=="pending")return!1;const p=((u==null?void 0:u.pending)===void 0?!this.state.isLoading:u.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,v=zN(m.pathname,(x=u==null?void 0:u.caseSensitive)!=null?x:!1,(_=u==null?void 0:u.fuzzy)!=null?_:!1,p.pathname,this.processedTree);return!v||o.params&&!Ts(v.rawParams,o.params,{partial:!0})?!1:(S=u==null?void 0:u.includeSearch)==null||S?Ts(p.search,m.search,{partial:!0})?v.rawParams:!1:v.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(o=>o.status==="notFound"||o.globalNotFound),this.update(Y(R({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0},t),{caseSensitive:(a=t.caseSensitive)!=null?a:!1,notFoundMode:(s=t.notFoundMode)!=null?s:"fuzzy",stringifySearch:(l=t.stringifySearch)!=null?l:aj,parseSearch:(c=t.parseSearch)!=null?c:nj})),typeof document!="undefined"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:a,processedTree:s}){this.routesById=t,this.routesByPath=a,this.processedTree=s;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)}get looseRoutesById(){return this.routesById}getParentContext(t){var l,c,o;return(t==null?void 0:t.id)?(o=(c=t.context)!=null?c:this.options.context)!=null?o:void 0:(l=this.options.context)!=null?l:void 0}matchRoutesInternal(t,a){var v,x,_,S,w,C,k,j,E,O;const s=this.getMatchedRoutes(t.pathname),{foundRoute:l,routeParams:c,parsedParams:o}=s;let{matchedRoutes:u}=s,h=!1;(l?l.path!=="/"&&c["**"]:Xa(t.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:h=!0);const m=h?xj(this.options.notFoundMode,u):void 0,g=new Array(u.length),p=new Map(this.state.matches.map(z=>[z.routeId,z]));for(let z=0;z<u.length;z++){const I=u[z],B=g[z-1];let q,A,U;{const se=(v=B==null?void 0:B.search)!=null?v:t.search,pe=(x=B==null?void 0:B._strictSearch)!=null?x:void 0;try{const ge=(_=_u(I.options.validateSearch,R({},se)))!=null?_:void 0;q=R(R({},se),ge),A=R(R({},pe),ge),U=void 0}catch(ge){let Se=ge;if(ge instanceof Au||(Se=new Au(ge.message,{cause:ge})),a!=null&&a.throwOnError)throw Se;q=se,A={},U=Se}}const F=(C=(w=(S=I.options).loaderDeps)==null?void 0:w.call(S,{search:q}))!=null?C:"",$=F?JSON.stringify(F):"",{interpolatedPath:V,usedParams:K}=Mh({path:I.fullPath,params:c,decoder:this.pathParamsDecoder,server:this.isServer}),H=I.id+V+$,X=this.getMatch(H),P=p.get(I.id),re=(k=X==null?void 0:X._strictParams)!=null?k:K;let T;if(!X)try{rb(I,K,o,re)}catch(se){if(Ln(se)||Wn(se)?T=se:T=new pj(se.message,{cause:se}),a!=null&&a.throwOnError)throw T}Object.assign(c,re);const ce=P?"stay":"enter";let he;if(X)he=Y(R({},X),{cause:ce,params:(j=P==null?void 0:P.params)!=null?j:c,_strictParams:re,search:Dn(P?P.search:X.search,q),_strictSearch:A});else{const se=I.options.loader||I.options.beforeLoad||I.lazyFn||px(I)?"pending":"success";he={id:H,ssr:I.options.ssr,index:z,routeId:I.id,params:(E=P==null?void 0:P.params)!=null?E:c,_strictParams:re,pathname:V,updatedAt:Date.now(),search:P?Dn(P.search,q):q,_strictSearch:A,searchError:void 0,status:se,isFetching:!1,error:void 0,paramsError:T,__routeContext:void 0,_nonReactive:{loadPromise:Yr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ce,loaderDeps:P?Dn(P.loaderDeps,F):F,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:I.options.staticData||{},fullPath:I.fullPath}}a!=null&&a.preload||(he.globalNotFound=m===I.id),he.searchError=U;const M=this.getParentContext(B);he.context=R(R(R({},M),he.__routeContext),he.__beforeLoadContext),g[z]=he}for(let z=0;z<g.length;z++){const I=g[z],B=this.looseRoutesById[I.routeId],q=this.getMatch(I.id),A=p.get(I.routeId);if(I.params=A?Dn(A.params,c):c,!q){const U=g[z-1],F=this.getParentContext(U);if(B.options.context){const $={deps:I.loaderDeps,params:I.params,context:F!=null?F:{},location:t,navigate:V=>this.navigate(Y(R({},V),{_fromLocation:t})),buildLocation:this.buildLocation,cause:I.cause,abortController:I.abortController,preload:!!I.preload,matches:g,routeId:B.id};I.__routeContext=(O=B.options.context($))!=null?O:void 0}I.context=R(R(R({},F),I.__routeContext),I.__beforeLoadContext)}}return g}matchRoutesLightweight(t){const{matchedRoutes:a,routeParams:s,parsedParams:l}=this.getMatchedRoutes(t.pathname),c=jo(a),o=R({},t.search);for(const g of a)try{Object.assign(o,_u(g.options.validateSearch,o))}catch(p){}const u=jo(this.state.matches),h=u&&u.routeId===c.id&&t.pathname===this.state.location.pathname;let m;if(h)m=u.params;else{const g=R({},s);for(const p of a)try{rb(p,s,l!=null?l:{},g)}catch(v){}m=g}return{matchedRoutes:a,fullPath:c.fullPath,search:o,params:m}}}class Au extends Error{}class pj extends Error{}function gj(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function _u(e,t){if(e==null)return{};if("~standard"in e){const a=e["~standard"].validate(t);if(a instanceof Promise)throw new Au("Async validation not supported");if(a.issues)throw new Au(JSON.stringify(a.issues,void 0,2),{cause:a});return a.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function yj({pathname:e,routesById:t,processedTree:a}){const s={},l=Xa(e);let c,o;const u=IN(l,a,!0);return u&&(c=u.route,Object.assign(s,u.rawParams),o=Object.assign({},u.parsedParams)),{matchedRoutes:(u==null?void 0:u.branch)||[t[Xn]],routeParams:s,foundRoute:c,parsedParams:o}}function vj({search:e,dest:t,destRoutes:a,_includeValidateSearch:s}){return bj(a)(e,t,s!=null?s:!1)}function bj(e){var l;const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const c of e){if("search"in c.options)(l=c.options.search)!=null&&l.middlewares&&t.middlewares.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const o=({search:u,next:h})=>{let m=u;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(m=c.options.preSearchFilters.reduce((p,v)=>v(p),u));const g=h(m);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((p,v)=>v(p),g):g};t.middlewares.push(o)}if(c.options.validateSearch){const o=({search:u,next:h})=>{var g;const m=h(u);if(!t._includeValidateSearch)return m;try{return R(R({},m),(g=_u(c.options.validateSearch,m))!=null?g:void 0)}catch(p){return m}};t.middlewares.push(o)}}const a=({search:c})=>{const o=t.dest;return o.search?o.search===!0?c:$i(o.search,c):{}};t.middlewares.push(a);const s=(c,o,u)=>{if(c>=u.length)return o;const h=u[c];return h({search:o,next:g=>s(c+1,g,u)})};return function(o,u,h){return t.dest=u,t._includeValidateSearch=h,s(0,o,t.middlewares)}}function xj(e,t){if(e!=="root")for(let a=t.length-1;a>=0;a--){const s=t[a];if(s.children)return s.id}return Xn}function rb(e,t,a,s){var c,o;const l=(o=(c=e.options.params)==null?void 0:c.parse)!=null?o:e.options.parseParams;if(l)if(e.options.skipRouteOnParseError)for(const u in t)u in a&&(s[u]=a[u]);else{const u=l(s);Object.assign(s,u)}}const _j="Error preloading route! ☝️";class vx{constructor(t){if(this.init=a=>{var m,g;this.originalIndex=a.originalIndex;const s=this.options,l=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(g=(m=this.options).getParentRoute)==null?void 0:g.call(m),l?this._path=Xn:this.parentRoute||Ja(!1);let c=l?Xn:s==null?void 0:s.path;c&&c!=="/"&&(c=ox(c));const o=(s==null?void 0:s.id)||c;let u=l?Xn:bu([this.parentRoute.id===Xn?"":this.parentRoute.id,o]);c===Xn&&(c="/"),u!==Xn&&(u=bu(["/",u]));const h=u===Xn?"/":bu([this.parentRoute.fullPath,c]);this._path=c,this._id=u,this._fullPath=h,this._to=Xa(h)},this.addChildren=a=>this._addFileChildren(a),this._addFileChildren=a=>(Array.isArray(a)&&(this.children=a),typeof a=="object"&&a!==null&&(this.children=Object.values(a)),this),this._addFileTypes=()=>this,this.updateLoader=a=>(Object.assign(this.options,a),this),this.update=a=>(Object.assign(this.options,a),this),this.lazy=a=>(this.lazyFn=a,this),this.redirect=a=>rj(R({from:this.fullPath},a)),this.options=t||{},this.isRoot=!(t!=null&&t.getParentRoute),t!=null&&t.id&&(t!=null&&t.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Sj extends vx{constructor(t){super(t)}}const ru=typeof window!="undefined"?D.useLayoutEffect:D.useEffect;function Dh(e){const t=D.useRef({value:e,prev:null}),a=t.current.value;return e!==a&&(t.current={value:e,prev:a}),t.current.prev}function wj(e,t,a={},s={}){D.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([c])=>{t(c)},a);return l.observe(e.current),()=>{l.disconnect()}},[t,a,s.disabled,e])}function Cj(e){const t=D.useRef(null);return D.useImperativeHandle(e,()=>t.current,[]),t}function ep(e){var a;const t=(a=e.errorComponent)!=null?a:tp;return f.jsx(Nj,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:l})=>s?D.createElement(t,{error:s,reset:l}):e.children})}class Nj extends D.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,a){a.error&&a.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,a){this.props.onCatch&&this.props.onCatch(t,a)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function tp({error:e}){const[t,a]=D.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>a(s=>!s),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function jj({children:e,fallback:t=null}){return bx()?f.jsx(ae.Fragment,{children:e}):f.jsx(ae.Fragment,{children:t})}function bx(){return ae.useSyncExternalStore(Ej,()=>!0,()=>!1)}function Ej(){return()=>{}}var Lh={exports:{}},Oh={},zh={exports:{}},Ih={};/**
34
+ * @license React
35
+ * use-sync-external-store-shim.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var lb;function kj(){if(lb)return Ih;lb=1;var e=Ym();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,l=e.useEffect,c=e.useLayoutEffect,o=e.useDebugValue;function u(p,v){var x=v(),_=s({inst:{value:x,getSnapshot:v}}),S=_[0].inst,w=_[1];return c(function(){S.value=x,S.getSnapshot=v,h(S)&&w({inst:S})},[p,x,v]),l(function(){return h(S)&&w({inst:S}),p(function(){h(S)&&w({inst:S})})},[p]),o(x),x}function h(p){var v=p.getSnapshot;p=p.value;try{var x=v();return!a(p,x)}catch(_){return!0}}function m(p,v){return v()}var g=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?m:u;return Ih.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Ih}var ob;function Rj(){return ob||(ob=1,zh.exports=kj()),zh.exports}/**
42
+ * @license React
43
+ * use-sync-external-store-shim/with-selector.production.js
44
+ *
45
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
46
+ *
47
+ * This source code is licensed under the MIT license found in the
48
+ * LICENSE file in the root directory of this source tree.
49
+ */var cb;function Tj(){if(cb)return Oh;cb=1;var e=Ym(),t=Rj();function a(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var s=typeof Object.is=="function"?Object.is:a,l=t.useSyncExternalStore,c=e.useRef,o=e.useEffect,u=e.useMemo,h=e.useDebugValue;return Oh.useSyncExternalStoreWithSelector=function(m,g,p,v,x){var _=c(null);if(_.current===null){var S={hasValue:!1,value:null};_.current=S}else S=_.current;_=u(function(){function C(z){if(!k){if(k=!0,j=z,z=v(z),x!==void 0&&S.hasValue){var I=S.value;if(x(I,z))return E=I}return E=z}if(I=E,s(j,z))return I;var B=v(z);return x!==void 0&&x(I,B)?(j=z,I):(j=z,E=B)}var k=!1,j,E,O=p===void 0?null:p;return[function(){return C(g())},O===null?void 0:function(){return C(O())}]},[g,p,v,x]);var w=l(m,_[0],_[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),h(w),w},Oh}var ub;function Mj(){return ub||(ub=1,Lh.exports=Tj()),Lh.exports}var Aj=Mj();function Dj(e,t=s=>s,a={}){var c;const s=(c=a.equal)!=null?c:Lj;return Aj.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function Lj(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,l]of e)if(!t.has(s)||!Object.is(l,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const a=db(e);if(a.length!==db(t).length)return!1;for(let s=0;s<a.length;s++)if(!Object.prototype.hasOwnProperty.call(t,a[s])||!Object.is(e[a[s]],t[a[s]]))return!1;return!0}function db(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Uh=D.createContext(null);function xx(){return typeof document=="undefined"?Uh:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Uh,Uh)}function ta(e){var a;const t=D.useContext(xx());return(a=e==null?void 0:e.warn)==null,t}function ea(e){const t=ta({warn:(e==null?void 0:e.router)===void 0}),a=(e==null?void 0:e.router)||t,s=D.useRef(void 0);return Dj(a.__store,l=>{var c;if(e!=null&&e.select){if((c=e.structuralSharing)!=null?c:a.options.defaultStructuralSharing){const o=Dn(s.current,e.select(l));return s.current=o,o}return e.select(l)}return l})}const Ku=D.createContext(void 0),Oj=D.createContext(void 0);function Sa(e){const t=D.useContext(e.from?Oj:Ku);return ea({select:s=>{var c;const l=s.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Ja(!(((c=e.shouldThrow)==null||c)&&!l),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),l!==void 0)return e.select?e.select(l):l},structuralSharing:e.structuralSharing})}function np(e){return Sa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ap(e){const s=e,{select:t}=s,a=fe(s,["select"]);return Sa(Y(R({},a),{select:l=>t?t(l.loaderDeps):l.loaderDeps}))}function Qu(e){return Sa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const a=e.strict===!1?t.params:t._strictParams;return e.select?e.select(a):a}})}function Yu(e){return Sa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ip(e){const t=ta();return D.useCallback(a=>{var s;return t.navigate(Y(R({},a),{from:(s=a.from)!=null?s:e==null?void 0:e.from}))},[e==null?void 0:e.from,t])}var zj=tx();function Ij(e,t){var ve,Ee,Ze;const a=ta(),s=Cj(t),le=e,{activeProps:l,inactiveProps:c,activeOptions:o,to:u,preload:h,preloadDelay:m,hashScrollIntoView:g,replace:p,startTransition:v,resetScroll:x,viewTransition:_,children:S,target:w,disabled:C,style:k,className:j,onClick:E,onFocus:O,onMouseEnter:z,onMouseLeave:I,onTouchStart:B,ignoreBlocker:q,params:A,search:U,hash:F,state:$,mask:V,reloadDocument:K,unsafeRelative:H,from:X,_fromLocation:P}=le,re=fe(le,["activeProps","inactiveProps","activeOptions","to","preload","preloadDelay","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","children","target","disabled","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","ignoreBlocker","params","search","hash","state","mask","reloadDocument","unsafeRelative","from","_fromLocation"]),T=bx(),ce=ea({select:ke=>ke.location.search,structuralSharing:!0}),he=e.from,M=D.useMemo(()=>Y(R({},e),{from:he}),[a,ce,he,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=D.useMemo(()=>a.buildLocation(R({},M)),[a,M]),pe=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,ge=se.maskedLocation?se.maskedLocation.external:se.external,Se=D.useMemo(()=>Pj(pe,ge,a.history,C),[C,ge,pe,a.history]),xe=D.useMemo(()=>{if(Se!=null&&Se.external)return ku(Se.href)?void 0:Se.href;if(!qj(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),ku(u)?void 0:u}catch(yt){}},[u,Se]),Ue=ea({select:ke=>{var yt;if(xe)return!1;if(o!=null&&o.exact){if(!PN(ke.location.pathname,se.pathname,a.basepath))return!1}else{const St=Tu(ke.location.pathname,a.basepath),kt=Tu(se.pathname,a.basepath);if(!(St.startsWith(kt)&&(St.length===kt.length||St[kt.length]==="/")))return!1}return((yt=o==null?void 0:o.includeSearch)==null||yt)&&!Ts(ke.location.search,se.search,{partial:!(o!=null&&o.exact),ignoreUndefined:!(o!=null&&o.explicitUndefined)})?!1:o!=null&&o.includeHash?T&&ke.location.hash===se.hash:!0}}),rt=Ue?(ve=$i(l,{}))!=null?ve:Uj:Bh,_t=Ue?Bh:(Ee=$i(c,{}))!=null?Ee:Bh,Wt=[j,rt.className,_t.className].filter(Boolean).join(" "),tt=(k||rt.style||_t.style)&&R(R(R({},k),rt.style),_t.style),[Oe,qe]=D.useState(!1),gt=D.useRef(!1),je=e.reloadDocument||xe?!1:h!=null?h:a.options.defaultPreload,lt=(Ze=m!=null?m:a.options.defaultPreloadDelay)!=null?Ze:0,Fe=D.useCallback(()=>{a.preloadRoute(R({},M)).catch(ke=>{console.warn(ke),console.warn(_j)})},[a,M]),ua=D.useCallback(ke=>{ke!=null&&ke.isIntersecting&&Fe()},[Fe]);wj(s,ua,$j,{disabled:!!C||je!=="viewport"}),D.useEffect(()=>{gt.current||!C&&je==="render"&&(Fe(),gt.current=!0)},[C,Fe,je]);const da=ke=>{const yt=ke.currentTarget.getAttribute("target"),St=w!==void 0?w:yt;if(!C&&!Vj(ke)&&!ke.defaultPrevented&&(!St||St==="_self")&&ke.button===0){ke.preventDefault(),zj.flushSync(()=>{qe(!0)});const kt=a.subscribe("onResolved",()=>{kt(),qe(!1)});a.navigate(Y(R({},M),{replace:p,resetScroll:x,hashScrollIntoView:g,startTransition:v,viewTransition:_,ignoreBlocker:q}))}};if(xe)return R(R(R(R(R(R(R(R(R(R(Y(R({},re),{ref:s,href:xe}),S&&{children:S}),w&&{target:w}),C&&{disabled:C}),k&&{style:k}),j&&{className:j}),E&&{onClick:E}),O&&{onFocus:O}),z&&{onMouseEnter:z}),I&&{onMouseLeave:I}),B&&{onTouchStart:B});const Ca=ke=>{C||je&&Fe()},ei=Ca,Tt=ke=>{if(!(C||!je))if(!lt)Fe();else{const yt=ke.target;if(ro.has(yt))return;const St=setTimeout(()=>{ro.delete(yt),Fe()},lt);ro.set(yt,St)}},Qi=ke=>{if(C||!je||!lt)return;const yt=ke.target,St=ro.get(yt);St&&(clearTimeout(St),ro.delete(yt))};return R(R(R(R(R(Y(R(R(R({},re),rt),_t),{href:Se==null?void 0:Se.href,ref:s,onClick:lo([E,da]),onFocus:lo([O,Ca]),onMouseEnter:lo([z,Tt]),onMouseLeave:lo([I,Qi]),onTouchStart:lo([B,ei]),disabled:!!C,target:w}),tt&&{style:tt}),Wt&&{className:Wt}),C&&Bj),Ue&&Fj),T&&Oe&&Hj)}const Bh={},Uj={className:"active"},Bj={role:"link","aria-disabled":!0},Fj={"data-status":"active","aria-current":"page"},Hj={"data-transitioning":"transitioning"},ro=new WeakMap,$j={rootMargin:"100px"},lo=e=>t=>{for(const a of e)if(a){if(t.defaultPrevented)return;a(t)}};function Pj(e,t,a,s){if(!s)return t?{href:e,external:!0}:{href:a.createHref(e)||"/",external:!1}}function qj(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const _x=D.forwardRef((e,t)=>{const u=e,{_asChild:a}=u,s=fe(u,["_asChild"]),h=Ij(s,t),{type:l}=h,c=fe(h,["type"]),o=typeof s.children=="function"?s.children({isActive:c["data-status"]==="active"}):s.children;if(!a){const m=c,{disabled:g}=m,p=fe(m,["disabled"]);return D.createElement("a",p,o)}return D.createElement(a,c,o)});function Vj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Gj extends vx{constructor(t){super(t),this.useMatch=a=>Sa({select:a==null?void 0:a.select,from:this.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Sa(Y(R({},a),{from:this.id,select:s=>a!=null&&a.select?a.select(s.context):s.context})),this.useSearch=a=>Yu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useParams=a=>Qu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useLoaderDeps=a=>ap(Y(R({},a),{from:this.id})),this.useLoaderData=a=>np(Y(R({},a),{from:this.id})),this.useNavigate=()=>ip({from:this.fullPath}),this.Link=ae.forwardRef((a,s)=>f.jsx(_x,R({ref:s,from:this.fullPath},a))),this.$$typeof=Symbol.for("react.memo")}}function sp(e){return new Gj(e)}class Kj extends Sj{constructor(t){super(t),this.useMatch=a=>Sa({select:a==null?void 0:a.select,from:this.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Sa(Y(R({},a),{from:this.id,select:s=>a!=null&&a.select?a.select(s.context):s.context})),this.useSearch=a=>Yu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useParams=a=>Qu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.id}),this.useLoaderDeps=a=>ap(Y(R({},a),{from:this.id})),this.useLoaderData=a=>np(Y(R({},a),{from:this.id})),this.useNavigate=()=>ip({from:this.fullPath}),this.Link=ae.forwardRef((a,s)=>f.jsx(_x,R({ref:s,from:this.fullPath},a))),this.$$typeof=Symbol.for("react.memo")}}function Qj(e){return new Kj(e)}function fb(e){return typeof e=="object"?new hb(e,{silent:!0}).createRoute(e):new hb(e,{silent:!0}).createRoute}class hb{constructor(t,a){this.path=t,this.createRoute=s=>{this.silent;const l=sp(s);return l.isRoot=!1,l},this.silent=a==null?void 0:a.silent}}class mb{constructor(t){this.useMatch=a=>Sa({select:a==null?void 0:a.select,from:this.options.id,structuralSharing:a==null?void 0:a.structuralSharing}),this.useRouteContext=a=>Sa({from:this.options.id,select:s=>a!=null&&a.select?a.select(s.context):s.context}),this.useSearch=a=>Yu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.options.id}),this.useParams=a=>Qu({select:a==null?void 0:a.select,structuralSharing:a==null?void 0:a.structuralSharing,from:this.options.id}),this.useLoaderDeps=a=>ap(Y(R({},a),{from:this.options.id})),this.useLoaderData=a=>np(Y(R({},a),{from:this.options.id})),this.useNavigate=()=>{const a=ta();return ip({from:a.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function pb(e){return typeof e=="object"?new mb(e):t=>new mb(R({id:e},t))}function Yj(){const e=ta(),t=D.useRef({router:e,mounted:!1}),[a,s]=D.useState(!1),{hasPendingMatches:l,isLoading:c}=ea({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),o=Dh(c),u=c||a||l,h=Dh(u),m=c||l,g=Dh(m);return e.startTransition=p=>{s(!0),D.startTransition(()=>{p(),s(!1)})},D.useEffect(()=>{const p=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Xa(e.latestLocation.publicHref)!==Xa(v.publicHref)&&e.commitLocation(Y(R({},v),{replace:!0})),()=>{p()}},[e,e.history]),ru(()=>{if(typeof window!="undefined"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},ze(null,null,function*(){try{yield e.load()}catch(v){console.error(v)}})},[e]),ru(()=>{o&&!c&&e.emit(R({type:"onLoad"},Ms(e.state)))},[o,e,c]),ru(()=>{g&&!m&&e.emit(R({type:"onBeforeRouteMount"},Ms(e.state)))},[m,g,e]),ru(()=>{if(h&&!u){const p=Ms(e.state);e.emit(R({type:"onResolved"},p)),e.__store.setState(v=>Y(R({},v),{status:"idle",resolvedLocation:v.location})),p.hrefChanged&&WN(e)}},[u,h,e]),null}function Xj(e){const t=ea({select:a=>`not-found-${a.location.pathname}-${a.status}`});return f.jsx(ep,{getResetKey:()=>t,onCatch:(a,s)=>{var l;if(Ln(a))(l=e.onCatch)==null||l.call(e,a,s);else throw a},errorComponent:({error:a})=>{var s;if(Ln(a))return(s=e.fallback)==null?void 0:s.call(e,a);throw a},children:e.children})}function Zj(){return f.jsx("p",{children:"Not Found"})}function Dr(e){return f.jsx(f.Fragment,{children:e.children})}function Sx(e,t,a){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,R({},a)):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,R({},a)):f.jsx(Zj,{})}function Jj(){return ta().isScrollRestoring,null}const wx=D.memo(function({matchId:t}){var S,w,C,k,j,E,O,z,I;const a=ta(),s=ea({select:B=>{var U;const q=B.matches.findIndex(F=>F.id===t),A=B.matches[q];return Ja(A),{routeId:A.routeId,ssr:A.ssr,_displayPending:A._displayPending,resetKey:B.loadedAt,parentRouteId:(U=B.matches[q-1])==null?void 0:U.routeId}},structuralSharing:!0}),l=a.routesById[s.routeId],c=(S=l.options.pendingComponent)!=null?S:a.options.defaultPendingComponent,o=c?f.jsx(c,{}):null,u=(w=l.options.errorComponent)!=null?w:a.options.defaultErrorComponent,h=(C=l.options.onCatch)!=null?C:a.options.defaultOnCatch,m=l.isRoot?(j=l.options.notFoundComponent)!=null?j:(k=a.options.notFoundRoute)==null?void 0:k.options.component:l.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",p=(!l.isRoot||l.options.wrapInSuspense||g)&&((z=(E=l.options.wrapInSuspense)!=null?E:c)!=null?z:(O=l.options.errorComponent)!=null&&O.preload||g)?D.Suspense:Dr,v=u?ep:Dr,x=m?Xj:Dr,_=l.isRoot&&(I=l.options.shellComponent)!=null?I:Dr;return f.jsxs(_,{children:[f.jsx(Ku.Provider,{value:t,children:f.jsx(p,{fallback:o,children:f.jsx(v,{getResetKey:()=>s.resetKey,errorComponent:u||tp,onCatch:(B,q)=>{if(Ln(B))throw B;h==null||h(B,q)},children:f.jsx(x,{fallback:B=>{if(!m||B.routeId&&B.routeId!==s.routeId||!B.routeId&&!l.isRoot)throw B;return D.createElement(m,B)},children:g||s._displayPending?f.jsx(jj,{fallback:o,children:f.jsx(gb,{matchId:t})}):f.jsx(gb,{matchId:t})})})})}),s.parentRouteId===Xn&&a.options.scrollRestoration?f.jsxs(f.Fragment,{children:[f.jsx(Wj,{}),f.jsx(Jj,{})]}):null]})});function Wj(){const e=ta(),t=D.useRef(void 0);return f.jsx("script",{suppressHydrationWarning:!0,ref:a=>{a&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit(R({type:"onRendered"},Ms(e.state))),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const gb=D.memo(function({matchId:t}){var h,m,g,p,v;const a=ta(),{match:s,key:l,routeId:c}=ea({select:x=>{var j;const _=x.matches.find(E=>E.id===t),S=_.routeId,w=(j=a.routesById[S].options.remountDeps)!=null?j:a.options.defaultRemountDeps,C=w==null?void 0:w({routeId:S,loaderDeps:_.loaderDeps,params:_._strictParams,search:_._strictSearch});return{key:C?JSON.stringify(C):void 0,routeId:S,match:{id:_.id,status:_.status,error:_.error,invalid:_.invalid,_forcePending:_._forcePending,_displayPending:_._displayPending}}},structuralSharing:!0}),o=a.routesById[c],u=D.useMemo(()=>{var _;const x=(_=o.options.component)!=null?_:a.options.defaultComponent;return x?f.jsx(x,{},l):f.jsx(Cx,{})},[l,o.options.component,a.options.defaultComponent]);if(s._displayPending)throw(h=a.getMatch(s.id))==null?void 0:h._nonReactive.displayPendingPromise;if(s._forcePending)throw(m=a.getMatch(s.id))==null?void 0:m._nonReactive.minPendingPromise;if(s.status==="pending"){const x=(g=o.options.pendingMinMs)!=null?g:a.options.defaultPendingMinMs;if(x){const _=a.getMatch(s.id);if(_&&!_._nonReactive.minPendingPromise){const S=Yr();_._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),_._nonReactive.minPendingPromise=void 0},x)}}throw(p=a.getMatch(s.id))==null?void 0:p._nonReactive.loadPromise}if(s.status==="notFound")return Ja(Ln(s.error)),Sx(a,o,s.error);if(s.status==="redirected")throw Ja(Wn(s.error)),(v=a.getMatch(s.id))==null?void 0:v._nonReactive.loadPromise;if(s.status==="error")throw s.error;return u}),Cx=D.memo(function(){const t=ta(),a=D.useContext(Ku),s=ea({select:m=>{var g;return(g=m.matches.find(p=>p.id===a))==null?void 0:g.routeId}}),l=t.routesById[s],c=ea({select:m=>{const p=m.matches.find(v=>v.id===a);return Ja(p),p.globalNotFound}}),o=ea({select:m=>{var v;const g=m.matches,p=g.findIndex(x=>x.id===a);return(v=g[p+1])==null?void 0:v.id}}),u=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(c)return Sx(t,l,void 0);if(!o)return null;const h=f.jsx(wx,{matchId:o});return s===Xn?f.jsx(D.Suspense,{fallback:u,children:h}):h});function eE(){var o;const e=ta(),a=(o=e.routesById[Xn].options.pendingComponent)!=null?o:e.options.defaultPendingComponent,s=a?f.jsx(a,{}):null,l=typeof document!="undefined"&&e.ssr?Dr:D.Suspense,c=f.jsxs(l,{fallback:s,children:[f.jsx(Yj,{}),f.jsx(tE,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:c}):c}function tE(){const e=ta(),t=ea({select:l=>{var c;return(c=l.matches[0])==null?void 0:c.id}}),a=ea({select:l=>l.loadedAt}),s=t?f.jsx(wx,{matchId:t}):null;return f.jsx(Ku.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:f.jsx(ep,{getResetKey:()=>a,errorComponent:tp,onCatch:l=>{l.message||l.toString()},children:s})})}const nE=e=>new aE(e);class aE extends mj{constructor(t){super(t)}}typeof globalThis!="undefined"?(globalThis.createFileRoute=fb,globalThis.createLazyFileRoute=pb):typeof window!="undefined"&&(window.createFileRoute=fb,window.createLazyFileRoute=pb);function iE(s){var l=s,{router:e,children:t}=l,a=fe(l,["router","children"]);Object.keys(a).length>0&&e.update(Y(R(R({},e.options),a),{context:R(R({},e.options.context),a.context)}));const c=xx(),o=f.jsx(c.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:o}):o}function sE(a){var s=a,{router:e}=s,t=fe(s,["router"]);return f.jsx(iE,Y(R({router:e},t),{children:f.jsx(eE,{})}))}var al=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(){}},rE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Di,Qm,q0,lE=(q0=class{constructor(){Te(this,Di,rE);Te(this,Qm,!1)}setTimeoutProvider(e){_e(this,Di,e)}setTimeout(e,t){return Q(this,Di).setTimeout(e,t)}clearTimeout(e){Q(this,Di).clearTimeout(e)}setInterval(e,t){return Q(this,Di).setInterval(e,t)}clearInterval(e){Q(this,Di).clearInterval(e)}},Di=new WeakMap,Qm=new WeakMap,q0),xs=new lE;function oE(e){setTimeout(e,0)}var zs=typeof window=="undefined"||"Deno"in globalThis;function un(){}function cE(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vi(e,t){return typeof e=="function"?e(t):e}function Zn(e,t){return typeof e=="function"?e(t):e}function yb(e,t){const{type:a="all",exact:s,fetchStatus:l,predicate:c,queryKey:o,stale:u}=e;if(o){if(s){if(t.queryHash!==rp(o,t.options))return!1}else if(!ko(t.queryKey,o))return!1}if(a!=="all"){const h=t.isActive();if(a==="active"&&!h||a==="inactive"&&h)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||l&&l!==t.state.fetchStatus||c&&!c(t))}function vb(e,t){const{exact:a,status:s,predicate:l,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(a){if(Is(t.options.mutationKey)!==Is(c))return!1}else if(!ko(t.options.mutationKey,c))return!1}return!(s&&t.state.status!==s||l&&!l(t))}function rp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Is)(e)}function Is(e){return JSON.stringify(e,(t,a)=>pm(a)?Object.keys(a).sort().reduce((s,l)=>(s[l]=a[l],s),{}):a)}function ko(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(a=>ko(e[a],t[a])):!1}var uE=Object.prototype.hasOwnProperty;function jx(e,t,a=0){if(e===t)return e;if(a>500)return t;const s=bb(e)&&bb(t);if(!s&&!(pm(e)&&pm(t)))return t;const c=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),u=o.length,h=s?new Array(u):{};let m=0;for(let g=0;g<u;g++){const p=s?g:o[g],v=e[p],x=t[p];if(v===x){h[p]=v,(s?g<c:uE.call(e,p))&&m++;continue}if(v===null||x===null||typeof v!="object"||typeof x!="object"){h[p]=x;continue}const _=jx(v,x,a+1);h[p]=_,_===v&&m++}return c===u&&m===c?e:h}function Du(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const a in e)if(e[a]!==t[a])return!1;return!0}function bb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pm(e){if(!xb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const a=t.prototype;return!(!xb(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function xb(e){return Object.prototype.toString.call(e)==="[object Object]"}function dE(e){return new Promise(t=>{xs.setTimeout(t,e)})}function gm(e,t,a){return typeof a.structuralSharing=="function"?a.structuralSharing(e,t):a.structuralSharing!==!1?jx(e,t):t}function fE(e,t,a=0){const s=[...e,t];return a&&s.length>a?s.slice(1):s}function hE(e,t,a=0){const s=[t,...e];return a&&s.length>a?s.slice(0,-1):s}var lp=Symbol();function Ex(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function op(e,t){return typeof e=="function"?e(...t):!!e}function mE(e,t,a){let s=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l!=null||(l=t()),s||(s=!0,l.aborted?a():l.addEventListener("abort",a,{once:!0})),l)}),e}var _s,Li,Ir,V0,pE=(V0=class extends al{constructor(){super();Te(this,_s);Te(this,Li);Te(this,Ir);_e(this,Ir,t=>{if(!zs&&window.addEventListener){const a=()=>t();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){Q(this,Li)||this.setEventListener(Q(this,Ir))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,Li))==null||t.call(this),_e(this,Li,void 0))}setEventListener(t){var a;_e(this,Ir,t),(a=Q(this,Li))==null||a.call(this),_e(this,Li,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){Q(this,_s)!==t&&(_e(this,_s,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(a=>{a(t)})}isFocused(){var t;return typeof Q(this,_s)=="boolean"?Q(this,_s):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},_s=new WeakMap,Li=new WeakMap,Ir=new WeakMap,V0),cp=new pE;function ym(){let e,t;const a=new Promise((l,c)=>{e=l,t=c});a.status="pending",a.catch(()=>{});function s(l){Object.assign(a,l),delete a.resolve,delete a.reject}return a.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},a.reject=l=>{s({status:"rejected",reason:l}),t(l)},a}var gE=oE;function yE(){let e=[],t=0,a=u=>{u()},s=u=>{u()},l=gE;const c=u=>{t?e.push(u):l(()=>{a(u)})},o=()=>{const u=e;e=[],u.length&&l(()=>{s(()=>{u.forEach(h=>{a(h)})})})};return{batch:u=>{let h;t++;try{h=u()}finally{t--,t||o()}return h},batchCalls:u=>(...h)=>{c(()=>{u(...h)})},schedule:c,setNotifyFunction:u=>{a=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{l=u}}}var qt=yE(),Ur,Oi,Br,G0,vE=(G0=class extends al{constructor(){super();Te(this,Ur,!0);Te(this,Oi);Te(this,Br);_e(this,Br,t=>{if(!zs&&window.addEventListener){const a=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",s)}}})}onSubscribe(){Q(this,Oi)||this.setEventListener(Q(this,Br))}onUnsubscribe(){var t;this.hasListeners()||((t=Q(this,Oi))==null||t.call(this),_e(this,Oi,void 0))}setEventListener(t){var a;_e(this,Br,t),(a=Q(this,Oi))==null||a.call(this),_e(this,Oi,t(this.setOnline.bind(this)))}setOnline(t){Q(this,Ur)!==t&&(_e(this,Ur,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return Q(this,Ur)}},Ur=new WeakMap,Oi=new WeakMap,Br=new WeakMap,G0),Lu=new vE;function bE(e){return Math.min(1e3*bh(2,e),3e4)}function kx(e){return(e!=null?e:"online")==="online"?Lu.isOnline():!0}var vm=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Rx(e){let t=!1,a=0,s;const l=ym(),c=()=>l.status!=="pending",o=S=>{var w;if(!c()){const C=new vm(S);v(C),(w=e.onCancel)==null||w.call(e,C)}},u=()=>{t=!0},h=()=>{t=!1},m=()=>cp.isFocused()&&(e.networkMode==="always"||Lu.isOnline())&&e.canRun(),g=()=>kx(e.networkMode)&&e.canRun(),p=S=>{c()||(s==null||s(),l.resolve(S))},v=S=>{c()||(s==null||s(),l.reject(S))},x=()=>new Promise(S=>{var w;s=C=>{(c()||m())&&S(C)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;s=void 0,c()||(S=e.onContinue)==null||S.call(e)}),_=()=>{if(c())return;let S;const w=a===0?e.initialPromise:void 0;try{S=w!=null?w:e.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(p).catch(C=>{var z,I,B;if(c())return;const k=(z=e.retry)!=null?z:zs?0:3,j=(I=e.retryDelay)!=null?I:bE,E=typeof j=="function"?j(a,C):j,O=k===!0||typeof k=="number"&&a<k||typeof k=="function"&&k(a,C);if(t||!O){v(C);return}a++,(B=e.onFail)==null||B.call(e,a,C),dE(E).then(()=>m()?void 0:x()).then(()=>{t?v(C):_()})})};return{promise:l,status:()=>l.status,cancel:o,continue:()=>(s==null||s(),l),cancelRetry:u,continueRetry:h,canStart:g,start:()=>(g()?_():x().then(_),l)}}var Ss,K0,Tx=(K0=class{constructor(){Te(this,Ss)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&_e(this,Ss,xs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e!=null?e:zs?1/0:300*1e3)}clearGcTimeout(){Q(this,Ss)&&(xs.clearTimeout(Q(this,Ss)),_e(this,Ss,void 0))}},Ss=new WeakMap,K0),ws,Fr,Yn,Cs,Qt,Do,Ns,la,Va,Q0,xE=(Q0=class extends Tx{constructor(t){var a;super();Te(this,la);Te(this,ws);Te(this,Fr);Te(this,Yn);Te(this,Cs);Te(this,Qt);Te(this,Do);Te(this,Ns);_e(this,Ns,!1),_e(this,Do,t.defaultOptions),this.setOptions(t.options),this.observers=[],_e(this,Cs,t.client),_e(this,Yn,Q(this,Cs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,ws,Sb(this.options)),this.state=(a=t.state)!=null?a:Q(this,ws),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Q(this,Qt))==null?void 0:t.promise}setOptions(t){if(this.options=R(R({},Q(this,Do)),t),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Sb(this.options);a.data!==void 0&&(this.setState(_b(a.data,a.dataUpdatedAt)),_e(this,ws,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,Yn).remove(this)}setData(t,a){const s=gm(this.state.data,t,this.options);return Ve(this,la,Va).call(this,{data:s,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),s}setState(t,a){Ve(this,la,Va).call(this,{type:"setState",state:t,setStateOptions:a})}cancel(t){var s,l;const a=(s=Q(this,Qt))==null?void 0:s.promise;return(l=Q(this,Qt))==null||l.cancel(t),a?a.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Q(this,ws))}isActive(){return this.observers.some(t=>Zn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Vi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Nx(this.state.dataUpdatedAt,t)}onFocus(){var a;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(a=Q(this,Qt))==null||a.continue()}onOnline(){var a;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(a=Q(this,Qt))==null||a.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Q(this,Yn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(a=>a!==t),this.observers.length||(Q(this,Qt)&&(Q(this,Ns)?Q(this,Qt).cancel({revert:!0}):Q(this,Qt).cancelRetry()),this.scheduleGc()),Q(this,Yn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ve(this,la,Va).call(this,{type:"invalidate"})}fetch(t,a){return ze(this,null,function*(){var h,m,g,p,v,x,_,S,w,C,k,j;if(this.state.fetchStatus!=="idle"&&((h=Q(this,Qt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Qt))return Q(this,Qt).continueRetry(),Q(this,Qt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(O=>O.options.queryFn);E&&this.setOptions(E.options)}const s=new AbortController,l=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(_e(this,Ns,!0),s.signal)})},c=()=>{const E=Ex(this.options,a),z=(()=>{const I={client:Q(this,Cs),queryKey:this.queryKey,meta:this.meta};return l(I),I})();return _e(this,Ns,!1),this.options.persister?this.options.persister(E,z,this):E(z)},u=(()=>{const E={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:Q(this,Cs),state:this.state,fetchFn:c};return l(E),E})();(m=this.options.behavior)==null||m.onFetch(u,this),_e(this,Fr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&Ve(this,la,Va).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),_e(this,Qt,Rx({initialPromise:a==null?void 0:a.initialPromise,fn:u.fetchFn,onCancel:E=>{E instanceof vm&&E.revert&&this.setState(Y(R({},Q(this,Fr)),{fetchStatus:"idle"})),s.abort()},onFail:(E,O)=>{Ve(this,la,Va).call(this,{type:"failed",failureCount:E,error:O})},onPause:()=>{Ve(this,la,Va).call(this,{type:"pause"})},onContinue:()=>{Ve(this,la,Va).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const E=yield Q(this,Qt).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(v=Q(this,Yn).config).onSuccess)==null||x.call(v,E,this),(S=(_=Q(this,Yn).config).onSettled)==null||S.call(_,E,this.state.error,this),E}catch(E){if(E instanceof vm){if(E.silent)return Q(this,Qt).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ve(this,la,Va).call(this,{type:"error",error:E}),(C=(w=Q(this,Yn).config).onError)==null||C.call(w,E,this),(j=(k=Q(this,Yn).config).onSettled)==null||j.call(k,this.state.data,E,this),E}finally{this.scheduleGc()}})}},ws=new WeakMap,Fr=new WeakMap,Yn=new WeakMap,Cs=new WeakMap,Qt=new WeakMap,Do=new WeakMap,Ns=new WeakMap,la=new WeakSet,Va=function(t){const a=s=>{var l;switch(t.type){case"failed":return Y(R({},s),{fetchFailureCount:t.failureCount,fetchFailureReason:t.error});case"pause":return Y(R({},s),{fetchStatus:"paused"});case"continue":return Y(R({},s),{fetchStatus:"fetching"});case"fetch":return Y(R(R({},s),Mx(s.data,this.options)),{fetchMeta:(l=t.meta)!=null?l:null});case"success":const c=R(Y(R(R({},s),_b(t.data,t.dataUpdatedAt)),{dataUpdateCount:s.dataUpdateCount+1}),!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return _e(this,Fr,t.manual?c:void 0),c;case"error":const o=t.error;return Y(R({},s),{error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0});case"invalidate":return Y(R({},s),{isInvalidated:!0});case"setState":return R(R({},s),t.state)}};this.state=a(this.state),qt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Q(this,Yn).notify({query:this,type:"updated",action:t})})},Q0);function Mx(e,t){return R({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kx(t.networkMode)?"fetching":"paused"},e===void 0&&{error:null,status:"pending"})}function _b(e,t){return{data:e,dataUpdatedAt:t!=null?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,a=t!==void 0,s=a?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:a?s!=null?s:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var bn,We,Lo,cn,js,Hr,Ga,zi,Oo,$r,Pr,Es,ks,Ii,qr,st,po,bm,xm,_m,Sm,wm,Cm,Nm,Ax,Y0,_E=(Y0=class extends al{constructor(t,a){super();Te(this,st);Te(this,bn);Te(this,We);Te(this,Lo);Te(this,cn);Te(this,js);Te(this,Hr);Te(this,Ga);Te(this,zi);Te(this,Oo);Te(this,$r);Te(this,Pr);Te(this,Es);Te(this,ks);Te(this,Ii);Te(this,qr,new Set);this.options=a,_e(this,bn,t),_e(this,zi,null),_e(this,Ga,ym()),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,We).addObserver(this),wb(Q(this,We),this.options)?Ve(this,st,po).call(this):this.updateResult(),Ve(this,st,Sm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(Q(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(Q(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ve(this,st,wm).call(this),Ve(this,st,Cm).call(this),Q(this,We).removeObserver(this)}setOptions(t){const a=this.options,s=Q(this,We);if(this.options=Q(this,bn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zn(this.options.enabled,Q(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ve(this,st,Nm).call(this),Q(this,We).setOptions(this.options),a._defaulted&&!Du(this.options,a)&&Q(this,bn).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,We),observer:this});const l=this.hasListeners();l&&Cb(Q(this,We),s,this.options,a)&&Ve(this,st,po).call(this),this.updateResult(),l&&(Q(this,We)!==s||Zn(this.options.enabled,Q(this,We))!==Zn(a.enabled,Q(this,We))||Vi(this.options.staleTime,Q(this,We))!==Vi(a.staleTime,Q(this,We)))&&Ve(this,st,bm).call(this);const c=Ve(this,st,xm).call(this);l&&(Q(this,We)!==s||Zn(this.options.enabled,Q(this,We))!==Zn(a.enabled,Q(this,We))||c!==Q(this,Ii))&&Ve(this,st,_m).call(this,c)}getOptimisticResult(t){const a=Q(this,bn).getQueryCache().build(Q(this,bn),t),s=this.createResult(a,t);return wE(this,s)&&(_e(this,cn,s),_e(this,Hr,this.options),_e(this,js,Q(this,We).state)),s}getCurrentResult(){return Q(this,cn)}trackResult(t,a){return new Proxy(t,{get:(s,l)=>(this.trackProp(l),a==null||a(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Q(this,Ga).status==="pending"&&Q(this,Ga).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(t){Q(this,qr).add(t)}getCurrentQuery(){return Q(this,We)}refetch(a={}){var t=fe(a,[]);return this.fetch(R({},t))}fetchOptimistic(t){const a=Q(this,bn).defaultQueryOptions(t),s=Q(this,bn).getQueryCache().build(Q(this,bn),a);return s.fetch().then(()=>this.createResult(s,a))}fetch(t){var a;return Ve(this,st,po).call(this,Y(R({},t),{cancelRefetch:(a=t.cancelRefetch)!=null?a:!0})).then(()=>(this.updateResult(),Q(this,cn)))}createResult(t,a){var q;const s=Q(this,We),l=this.options,c=Q(this,cn),o=Q(this,js),u=Q(this,Hr),m=t!==s?t.state:Q(this,Lo),{state:g}=t;let p=R({},g),v=!1,x;if(a._optimisticResults){const A=this.hasListeners(),U=!A&&wb(t,a),F=A&&Cb(t,s,a,l);(U||F)&&(p=R(R({},p),Mx(g.data,t.options))),a._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:_,errorUpdatedAt:S,status:w}=p;x=p.data;let C=!1;if(a.placeholderData!==void 0&&x===void 0&&w==="pending"){let A;c!=null&&c.isPlaceholderData&&a.placeholderData===(u==null?void 0:u.placeholderData)?(A=c.data,C=!0):A=typeof a.placeholderData=="function"?a.placeholderData((q=Q(this,Pr))==null?void 0:q.state.data,Q(this,Pr)):a.placeholderData,A!==void 0&&(w="success",x=gm(c==null?void 0:c.data,A,a),v=!0)}if(a.select&&x!==void 0&&!C)if(c&&x===(o==null?void 0:o.data)&&a.select===Q(this,Oo))x=Q(this,$r);else try{_e(this,Oo,a.select),x=a.select(x),x=gm(c==null?void 0:c.data,x,a),_e(this,$r,x),_e(this,zi,null)}catch(A){_e(this,zi,A)}Q(this,zi)&&(_=Q(this,zi),x=Q(this,$r),S=Date.now(),w="error");const k=p.fetchStatus==="fetching",j=w==="pending",E=w==="error",O=j&&k,z=x!==void 0,B={status:w,fetchStatus:p.fetchStatus,isPending:j,isSuccess:w==="success",isError:E,isInitialLoading:O,isLoading:O,data:x,dataUpdatedAt:p.dataUpdatedAt,error:_,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!j,isLoadingError:E&&!z,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&z,isStale:up(t,a),refetch:this.refetch,promise:Q(this,Ga),isEnabled:Zn(a.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=B.data!==void 0,U=B.status==="error"&&!A,F=K=>{U?K.reject(B.error):A&&K.resolve(B.data)},$=()=>{const K=_e(this,Ga,B.promise=ym());F(K)},V=Q(this,Ga);switch(V.status){case"pending":t.queryHash===s.queryHash&&F(V);break;case"fulfilled":(U||B.data!==V.value)&&$();break;case"rejected":(!U||B.error!==V.reason)&&$();break}}return B}updateResult(){const t=Q(this,cn),a=this.createResult(Q(this,We),this.options);if(_e(this,js,Q(this,We).state),_e(this,Hr,this.options),Q(this,js).data!==void 0&&_e(this,Pr,Q(this,We)),Du(a,t))return;_e(this,cn,a);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!Q(this,qr).size)return!0;const o=new Set(c!=null?c:Q(this,qr));return this.options.throwOnError&&o.add("error"),Object.keys(Q(this,cn)).some(u=>{const h=u;return Q(this,cn)[h]!==t[h]&&o.has(h)})};Ve(this,st,Ax).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ve(this,st,Sm).call(this)}},bn=new WeakMap,We=new WeakMap,Lo=new WeakMap,cn=new WeakMap,js=new WeakMap,Hr=new WeakMap,Ga=new WeakMap,zi=new WeakMap,Oo=new WeakMap,$r=new WeakMap,Pr=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ii=new WeakMap,qr=new WeakMap,st=new WeakSet,po=function(t){Ve(this,st,Nm).call(this);let a=Q(this,We).fetch(this.options,t);return t!=null&&t.throwOnError||(a=a.catch(un)),a},bm=function(){Ve(this,st,wm).call(this);const t=Vi(this.options.staleTime,Q(this,We));if(zs||Q(this,cn).isStale||!mm(t))return;const s=Nx(Q(this,cn).dataUpdatedAt,t)+1;_e(this,Es,xs.setTimeout(()=>{Q(this,cn).isStale||this.updateResult()},s))},xm=function(){var t;return(t=typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,We)):this.options.refetchInterval)!=null?t:!1},_m=function(t){Ve(this,st,Cm).call(this),_e(this,Ii,t),!(zs||Zn(this.options.enabled,Q(this,We))===!1||!mm(Q(this,Ii))||Q(this,Ii)===0)&&_e(this,ks,xs.setInterval(()=>{(this.options.refetchIntervalInBackground||cp.isFocused())&&Ve(this,st,po).call(this)},Q(this,Ii)))},Sm=function(){Ve(this,st,bm).call(this),Ve(this,st,_m).call(this,Ve(this,st,xm).call(this))},wm=function(){Q(this,Es)&&(xs.clearTimeout(Q(this,Es)),_e(this,Es,void 0))},Cm=function(){Q(this,ks)&&(xs.clearInterval(Q(this,ks)),_e(this,ks,void 0))},Nm=function(){const t=Q(this,bn).getQueryCache().build(Q(this,bn),this.options);if(t===Q(this,We))return;const a=Q(this,We);_e(this,We,t),_e(this,Lo,t.state),this.hasListeners()&&(a==null||a.removeObserver(this),t.addObserver(this))},Ax=function(t){qt.batch(()=>{t.listeners&&this.listeners.forEach(a=>{a(Q(this,cn))}),Q(this,bn).getQueryCache().notify({query:Q(this,We),type:"observerResultsUpdated"})})},Y0);function SE(e,t){return Zn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function wb(e,t){return SE(e,t)||e.state.data!==void 0&&jm(e,t,t.refetchOnMount)}function jm(e,t,a){if(Zn(t.enabled,e)!==!1&&Vi(t.staleTime,e)!=="static"){const s=typeof a=="function"?a(e):a;return s==="always"||s!==!1&&up(e,t)}return!1}function Cb(e,t,a,s){return(e!==t||Zn(s.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&up(e,a)}function up(e,t){return Zn(t.enabled,e)!==!1&&e.isStaleByTime(Vi(t.staleTime,e))}function wE(e,t){return!Du(e.getCurrentResult(),t)}function Nb(e){return{onFetch:(t,a)=>{var g,p,v,x,_;const s=t.options,l=(v=(p=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,c=((x=t.state.data)==null?void 0:x.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const m=()=>ze(null,null,function*(){var j;let S=!1;const w=E=>{mE(E,()=>t.signal,()=>S=!0)},C=Ex(t.options,t.fetchOptions),k=(E,O,z)=>ze(null,null,function*(){if(S)return Promise.reject();if(O==null&&E.pages.length)return Promise.resolve(E);const B=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:O,direction:z?"backward":"forward",meta:t.options.meta};return w(F),F})(),q=yield C(B),{maxPages:A}=t.options,U=z?hE:fE;return{pages:U(E.pages,q,A),pageParams:U(E.pageParams,O,A)}});if(l&&c.length){const E=l==="backward",O=E?CE:jb,z={pages:c,pageParams:o},I=O(s,z);u=yield k(z,I,E)}else{const E=e!=null?e:c.length;do{const O=h===0?(j=o[0])!=null?j:s.initialPageParam:jb(s,u);if(h>0&&O==null)break;u=yield k(u,O),h++}while(h<E)}return u});t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},a)}:t.fetchFn=m}}}function jb(e,{pages:t,pageParams:a}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,a[s],a):void 0}function CE(e,{pages:t,pageParams:a}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,a[0],a):void 0}var zo,ba,tn,Rs,xa,Mi,X0,NE=(X0=class extends Tx{constructor(t){super();Te(this,xa);Te(this,zo);Te(this,ba);Te(this,tn);Te(this,Rs);_e(this,zo,t.client),this.mutationId=t.mutationId,_e(this,tn,t.mutationCache),_e(this,ba,[]),this.state=t.state||Dx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Q(this,ba).includes(t)||(Q(this,ba).push(t),this.clearGcTimeout(),Q(this,tn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,ba,Q(this,ba).filter(a=>a!==t)),this.scheduleGc(),Q(this,tn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Q(this,ba).length||(this.state.status==="pending"?this.scheduleGc():Q(this,tn).remove(this))}continue(){var t,a;return(a=(t=Q(this,Rs))==null?void 0:t.continue())!=null?a:this.execute(this.state.variables)}execute(t){return ze(this,null,function*(){var o,u,h,m,g,p,v,x,_,S,w,C,k,j,E,O,z,I,B;const a=()=>{Ve(this,xa,Mi).call(this,{type:"continue"})},s={client:Q(this,zo),meta:this.options.meta,mutationKey:this.options.mutationKey};_e(this,Rs,Rx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(q,A)=>{Ve(this,xa,Mi).call(this,{type:"failed",failureCount:q,error:A})},onPause:()=>{Ve(this,xa,Mi).call(this,{type:"pause"})},onContinue:a,retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,tn).canRun(this)}));const l=this.state.status==="pending",c=!Q(this,Rs).canStart();try{if(l)a();else{Ve(this,xa,Mi).call(this,{type:"pending",variables:t,isPaused:c}),Q(this,tn).config.onMutate&&(yield Q(this,tn).config.onMutate(t,this,s));const A=yield(h=(u=this.options).onMutate)==null?void 0:h.call(u,t,s);A!==this.state.context&&Ve(this,xa,Mi).call(this,{type:"pending",context:A,variables:t,isPaused:c})}const q=yield Q(this,Rs).start();return yield(g=(m=Q(this,tn).config).onSuccess)==null?void 0:g.call(m,q,t,this.state.context,this,s),yield(v=(p=this.options).onSuccess)==null?void 0:v.call(p,q,t,this.state.context,s),yield(_=(x=Q(this,tn).config).onSettled)==null?void 0:_.call(x,q,null,this.state.variables,this.state.context,this,s),yield(w=(S=this.options).onSettled)==null?void 0:w.call(S,q,null,t,this.state.context,s),Ve(this,xa,Mi).call(this,{type:"success",data:q}),q}catch(q){try{yield(k=(C=Q(this,tn).config).onError)==null?void 0:k.call(C,q,t,this.state.context,this,s)}catch(A){Promise.reject(A)}try{yield(E=(j=this.options).onError)==null?void 0:E.call(j,q,t,this.state.context,s)}catch(A){Promise.reject(A)}try{yield(z=(O=Q(this,tn).config).onSettled)==null?void 0:z.call(O,void 0,q,this.state.variables,this.state.context,this,s)}catch(A){Promise.reject(A)}try{yield(B=(I=this.options).onSettled)==null?void 0:B.call(I,void 0,q,t,this.state.context,s)}catch(A){Promise.reject(A)}throw Ve(this,xa,Mi).call(this,{type:"error",error:q}),q}finally{Q(this,tn).runNext(this)}})}},zo=new WeakMap,ba=new WeakMap,tn=new WeakMap,Rs=new WeakMap,xa=new WeakSet,Mi=function(t){const a=s=>{switch(t.type){case"failed":return Y(R({},s),{failureCount:t.failureCount,failureReason:t.error});case"pause":return Y(R({},s),{isPaused:!0});case"continue":return Y(R({},s),{isPaused:!1});case"pending":return Y(R({},s),{context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()});case"success":return Y(R({},s),{data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return Y(R({},s),{data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"})}};this.state=a(this.state),qt.batch(()=>{Q(this,ba).forEach(s=>{s.onMutationUpdate(t)}),Q(this,tn).notify({mutation:this,type:"updated",action:t})})},X0);function Dx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ka,oa,Io,Z0,jE=(Z0=class extends al{constructor(t={}){super();Te(this,Ka);Te(this,oa);Te(this,Io);this.config=t,_e(this,Ka,new Set),_e(this,oa,new Map),_e(this,Io,0)}build(t,a,s){const l=new NE({client:t,mutationCache:this,mutationId:++au(this,Io)._,options:t.defaultMutationOptions(a),state:s});return this.add(l),l}add(t){Q(this,Ka).add(t);const a=lu(t);if(typeof a=="string"){const s=Q(this,oa).get(a);s?s.push(t):Q(this,oa).set(a,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Q(this,Ka).delete(t)){const a=lu(t);if(typeof a=="string"){const s=Q(this,oa).get(a);if(s)if(s.length>1){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}else s[0]===t&&Q(this,oa).delete(a)}}this.notify({type:"removed",mutation:t})}canRun(t){const a=lu(t);if(typeof a=="string"){const s=Q(this,oa).get(a),l=s==null?void 0:s.find(c=>c.state.status==="pending");return!l||l===t}else return!0}runNext(t){var s,l;const a=lu(t);if(typeof a=="string"){const c=(s=Q(this,oa).get(a))==null?void 0:s.find(o=>o!==t&&o.state.isPaused);return(l=c==null?void 0:c.continue())!=null?l:Promise.resolve()}else return Promise.resolve()}clear(){qt.batch(()=>{Q(this,Ka).forEach(t=>{this.notify({type:"removed",mutation:t})}),Q(this,Ka).clear(),Q(this,oa).clear()})}getAll(){return Array.from(Q(this,Ka))}find(t){const a=R({exact:!0},t);return this.getAll().find(s=>vb(a,s))}findAll(t={}){return this.getAll().filter(a=>vb(t,a))}notify(t){qt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}resumePausedMutations(){const t=this.getAll().filter(a=>a.state.isPaused);return qt.batch(()=>Promise.all(t.map(a=>a.continue().catch(un))))}},Ka=new WeakMap,oa=new WeakMap,Io=new WeakMap,Z0);function lu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Qa,Ui,xn,Ya,Za,Su,Em,J0,EE=(J0=class extends al{constructor(a,s){super();Te(this,Za);Te(this,Qa);Te(this,Ui);Te(this,xn);Te(this,Ya);_e(this,Qa,a),this.setOptions(s),this.bindMethods(),Ve(this,Za,Su).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){var l;const s=this.options;this.options=Q(this,Qa).defaultMutationOptions(a),Du(this.options,s)||Q(this,Qa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,xn),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Is(s.mutationKey)!==Is(this.options.mutationKey)?this.reset():((l=Q(this,xn))==null?void 0:l.state.status)==="pending"&&Q(this,xn).setOptions(this.options)}onUnsubscribe(){var a;this.hasListeners()||(a=Q(this,xn))==null||a.removeObserver(this)}onMutationUpdate(a){Ve(this,Za,Su).call(this),Ve(this,Za,Em).call(this,a)}getCurrentResult(){return Q(this,Ui)}reset(){var a;(a=Q(this,xn))==null||a.removeObserver(this),_e(this,xn,void 0),Ve(this,Za,Su).call(this),Ve(this,Za,Em).call(this)}mutate(a,s){var l;return _e(this,Ya,s),(l=Q(this,xn))==null||l.removeObserver(this),_e(this,xn,Q(this,Qa).getMutationCache().build(Q(this,Qa),this.options)),Q(this,xn).addObserver(this),Q(this,xn).execute(a)}},Qa=new WeakMap,Ui=new WeakMap,xn=new WeakMap,Ya=new WeakMap,Za=new WeakSet,Su=function(){var s,l;const a=(l=(s=Q(this,xn))==null?void 0:s.state)!=null?l:Dx();_e(this,Ui,Y(R({},a),{isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}))},Em=function(a){qt.batch(()=>{var s,l,c,o,u,h,m,g;if(Q(this,Ya)&&this.hasListeners()){const p=Q(this,Ui).variables,v=Q(this,Ui).context,x={client:Q(this,Qa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((a==null?void 0:a.type)==="success"){try{(l=(s=Q(this,Ya)).onSuccess)==null||l.call(s,a.data,p,v,x)}catch(_){Promise.reject(_)}try{(o=(c=Q(this,Ya)).onSettled)==null||o.call(c,a.data,null,p,v,x)}catch(_){Promise.reject(_)}}else if((a==null?void 0:a.type)==="error"){try{(h=(u=Q(this,Ya)).onError)==null||h.call(u,a.error,p,v,x)}catch(_){Promise.reject(_)}try{(g=(m=Q(this,Ya)).onSettled)==null||g.call(m,void 0,a.error,p,v,x)}catch(_){Promise.reject(_)}}}this.listeners.forEach(p=>{p(Q(this,Ui))})})},J0),_a,W0,kE=(W0=class extends al{constructor(t={}){super();Te(this,_a);this.config=t,_e(this,_a,new Map)}build(t,a,s){var u;const l=a.queryKey,c=(u=a.queryHash)!=null?u:rp(l,a);let o=this.get(c);return o||(o=new xE({client:t,queryKey:l,queryHash:c,options:t.defaultQueryOptions(a),state:s,defaultOptions:t.getQueryDefaults(l)}),this.add(o)),o}add(t){Q(this,_a).has(t.queryHash)||(Q(this,_a).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const a=Q(this,_a).get(t.queryHash);a&&(t.destroy(),a===t&&Q(this,_a).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Q(this,_a).get(t)}getAll(){return[...Q(this,_a).values()]}find(t){const a=R({exact:!0},t);return this.getAll().find(s=>yb(a,s))}findAll(t={}){const a=this.getAll();return Object.keys(t).length>0?a.filter(s=>yb(t,s)):a}notify(t){qt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}onFocus(){qt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_a=new WeakMap,W0),Dt,Bi,Fi,Vr,Gr,Hi,Kr,Qr,ex,RE=(ex=class{constructor(e={}){Te(this,Dt);Te(this,Bi);Te(this,Fi);Te(this,Vr);Te(this,Gr);Te(this,Hi);Te(this,Kr);Te(this,Qr);_e(this,Dt,e.queryCache||new kE),_e(this,Bi,e.mutationCache||new jE),_e(this,Fi,e.defaultOptions||{}),_e(this,Vr,new Map),_e(this,Gr,new Map),_e(this,Hi,0)}mount(){au(this,Hi)._++,Q(this,Hi)===1&&(_e(this,Kr,cp.subscribe(e=>ze(this,null,function*(){e&&(yield this.resumePausedMutations(),Q(this,Dt).onFocus())}))),_e(this,Qr,Lu.subscribe(e=>ze(this,null,function*(){e&&(yield this.resumePausedMutations(),Q(this,Dt).onOnline())}))))}unmount(){var e,t;au(this,Hi)._--,Q(this,Hi)===0&&((e=Q(this,Kr))==null||e.call(this),_e(this,Kr,void 0),(t=Q(this,Qr))==null||t.call(this),_e(this,Qr,void 0))}isFetching(e){return Q(this,Dt).findAll(Y(R({},e),{fetchStatus:"fetching"})).length}isMutating(e){return Q(this,Bi).findAll(Y(R({},e),{status:"pending"})).length}getQueryData(e){var a;const t=this.defaultQueryOptions({queryKey:e});return(a=Q(this,Dt).get(t.queryHash))==null?void 0:a.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),a=Q(this,Dt).build(this,t),s=a.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&a.isStaleByTime(Vi(t.staleTime,a))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return Q(this,Dt).findAll(e).map(({queryKey:t,state:a})=>{const s=a.data;return[t,s]})}setQueryData(e,t,a){const s=this.defaultQueryOptions({queryKey:e}),l=Q(this,Dt).get(s.queryHash),c=l==null?void 0:l.state.data,o=cE(t,c);if(o!==void 0)return Q(this,Dt).build(this,s).setData(o,Y(R({},a),{manual:!0}))}setQueriesData(e,t,a){return qt.batch(()=>Q(this,Dt).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,a)]))}getQueryState(e){var a;const t=this.defaultQueryOptions({queryKey:e});return(a=Q(this,Dt).get(t.queryHash))==null?void 0:a.state}removeQueries(e){const t=Q(this,Dt);qt.batch(()=>{t.findAll(e).forEach(a=>{t.remove(a)})})}resetQueries(e,t){const a=Q(this,Dt);return qt.batch(()=>(a.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(R({type:"active"},e),t)))}cancelQueries(e,t={}){const a=R({revert:!0},t),s=qt.batch(()=>Q(this,Dt).findAll(e).map(l=>l.cancel(a)));return Promise.all(s).then(un).catch(un)}invalidateQueries(e,t={}){return qt.batch(()=>{var a,s;return Q(this,Dt).findAll(e).forEach(l=>{l.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries(Y(R({},e),{type:(s=(a=e==null?void 0:e.refetchType)!=null?a:e==null?void 0:e.type)!=null?s:"active"}),t)})}refetchQueries(e,t={}){var l;const a=Y(R({},t),{cancelRefetch:(l=t.cancelRefetch)!=null?l:!0}),s=qt.batch(()=>Q(this,Dt).findAll(e).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let o=c.fetch(void 0,a);return a.throwOnError||(o=o.catch(un)),c.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const a=Q(this,Dt).build(this,t);return a.isStaleByTime(Vi(t.staleTime,a))?a.fetch(t):Promise.resolve(a.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=Nb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=Nb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Lu.isOnline()?Q(this,Bi).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,Dt)}getMutationCache(){return Q(this,Bi)}getDefaultOptions(){return Q(this,Fi)}setDefaultOptions(e){_e(this,Fi,e)}setQueryDefaults(e,t){Q(this,Vr).set(Is(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Q(this,Vr).values()],a={};return t.forEach(s=>{ko(e,s.queryKey)&&Object.assign(a,s.defaultOptions)}),a}setMutationDefaults(e,t){Q(this,Gr).set(Is(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Q(this,Gr).values()],a={};return t.forEach(s=>{ko(e,s.mutationKey)&&Object.assign(a,s.defaultOptions)}),a}defaultQueryOptions(e){if(e._defaulted)return e;const t=Y(R(R(R({},Q(this,Fi).queries),this.getQueryDefaults(e.queryKey)),e),{_defaulted:!0});return t.queryHash||(t.queryHash=rp(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===lp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:Y(R(R(R({},Q(this,Fi).mutations),(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey)),e),{_defaulted:!0})}clear(){Q(this,Dt).clear(),Q(this,Bi).clear()}},Dt=new WeakMap,Bi=new WeakMap,Fi=new WeakMap,Vr=new WeakMap,Gr=new WeakMap,Hi=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,ex),Lx=D.createContext(void 0),il=e=>{const t=D.useContext(Lx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TE=({client:e,children:t})=>(D.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Lx.Provider,{value:e,children:t})),Ox=D.createContext(!1),ME=()=>D.useContext(Ox);Ox.Provider;function AE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DE=D.createContext(AE()),LE=()=>D.useContext(DE),OE=(e,t,a)=>{const s=a!=null&&a.state.error&&typeof e.throwOnError=="function"?op(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},zE=e=>{D.useEffect(()=>{e.clearReset()},[e])},IE=({result:e,errorResetBoundary:t,throwOnError:a,query:s,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||op(a,[e.error,s])),UE=e=>{if(e.suspense){const a=l=>l==="static"?l:Math.max(l!=null?l:1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...l)=>a(s(...l)):a(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},BE=(e,t)=>e.isLoading&&e.isFetching&&!t,FE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Eb=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function HE(e,t,a){var v,x,_,S;const s=ME(),l=LE(),c=il(),o=c.defaultQueryOptions(e);(x=(v=c.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||x.call(v,o);const u=c.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",UE(o),OE(o,l,u),zE(l);const h=!c.getQueryCache().get(o.queryHash),[m]=D.useState(()=>new t(c,o)),g=m.getOptimisticResult(o),p=!s&&e.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(w=>{const C=p?m.subscribe(qt.batchCalls(w)):un;return m.updateResult(),C},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),D.useEffect(()=>{m.setOptions(o)},[o,m]),FE(o,g))throw Eb(o,m,l);if(IE({result:g,errorResetBoundary:l,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw g.error;if((S=(_=c.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||S.call(_,o,g),o.experimental_prefetchInRender&&!zs&&BE(g,s)){const w=h?Eb(o,m,l):u==null?void 0:u.promise;w==null||w.catch(un).finally(()=>{m.updateResult()})}return o.notifyOnChangeProps?g:m.trackResult(g)}function sl(e,t){return HE(e,_E)}function Xu(e,t){const a=il(),[s]=D.useState(()=>new EE(a,e));D.useEffect(()=>{s.setOptions(e)},[s,e]);const l=D.useSyncExternalStore(D.useCallback(o=>s.subscribe(qt.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=D.useCallback((o,u)=>{s.mutate(o,u).catch(un)},[s]);if(l.error&&op(s.options.throwOnError,[l.error]))throw l.error;return Y(R({},l),{mutate:c,mutateAsync:l.mutate})}const $E="dr_auth_token";function PE(){const e=window.fetch;window.fetch=function(...t){const[a,s]=t,l=typeof window!="undefined"?localStorage.getItem($E):null,c=s||{};if(l&&!c.headers)c.headers={Authorization:`Bearer ${l}`};else if(l&&c.headers){const o=c.headers;o.Authorization||(o.Authorization=`Bearer ${l}`)}return e(a,c)},console.log("[FetchInterceptor] Installed - will add Authorization header to all requests")}var qE={};class VE{constructor(t){dt(this,"baseUrl");dt(this,"token",null);this.baseUrl=t,this.loadToken()}loadToken(){typeof window!="undefined"&&(this.token=localStorage.getItem("dr_auth_token"))}setToken(t){this.token=t}getBaseUrl(){return this.baseUrl}getHeaders(){const t={"Content-Type":"application/json"};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}gethealth(){return ze(this,null,function*(){const s=`${this.getBaseUrl()}/health`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,l);if(!c.ok){const o=yield c.text();throw new Error(`GET /health failed: ${c.status} ${o}`)}return c.json()})}getapimodel(){return ze(this,null,function*(){const s=`${this.getBaseUrl()}/api/model`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,l);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/model failed: ${c.status} ${o}`)}return c.json()})}getapilayerslayerName(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s=`/api/layers/${encodeURIComponent(t)}`,l=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/layers/:layerName failed: ${o.status} ${u}`)}return o.json()})}getapispec(){return ze(this,null,function*(){const s=`${this.getBaseUrl()}/api/spec`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,l);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/spec failed: ${c.status} ${o}`)}return c.json()})}getapiannotations(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s="/api/annotations",l=new URLSearchParams;t&&Object.entries(t).forEach(([h,m])=>{m!=null&&l.append(h,m)});const c=l.toString()?`${a}${s}?${l.toString()}`:`${a}${s}`,o={method:"GET",headers:this.getHeaders(),credentials:"include"},u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`GET /api/annotations failed: ${u.status} ${h}`)}return u.json()})}postapiannotations(t){return ze(this,null,function*(){const l=`${this.getBaseUrl()}/api/annotations`,c={method:"POST",headers:this.getHeaders(),credentials:"include"};t&&(c.body=JSON.stringify(t));const o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`POST /api/annotations failed: ${o.status} ${u}`)}return o.json()})}getapiannotationsannotationId(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}`,l=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId failed: ${o.status} ${u}`)}return o.json()})}putapiannotationsannotationId(t,a){return ze(this,null,function*(){const s=this.getBaseUrl(),l=`/api/annotations/${encodeURIComponent(t)}`,c=`${s}${l}`,o={method:"PUT",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PUT /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}patchapiannotationsannotationId(t,a){return ze(this,null,function*(){const s=this.getBaseUrl(),l=`/api/annotations/${encodeURIComponent(t)}`,c=`${s}${l}`,o={method:"PATCH",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`PATCH /api/annotations/:annotationId failed: ${u.status} ${h}`)}return u.json()})}deleteapiannotationsannotationId(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}`,l=`${a}${s}`,c={method:"DELETE",headers:this.getHeaders(),credentials:"include"},o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`DELETE /api/annotations/:annotationId failed: ${o.status} ${u}`)}if(o.status!==204)return o.json()})}getapiannotationsannotationIdreplies(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s=`/api/annotations/${encodeURIComponent(t)}/replies`,l=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/annotations/:annotationId/replies failed: ${o.status} ${u}`)}return o.json()})}postapiannotationsannotationIdreplies(t,a){return ze(this,null,function*(){const s=this.getBaseUrl(),l=`/api/annotations/${encodeURIComponent(t)}/replies`,c=`${s}${l}`,o={method:"POST",headers:this.getHeaders(),credentials:"include"};a&&(o.body=JSON.stringify(a));const u=yield fetch(c,o);if(!u.ok){const h=yield u.text();throw new Error(`POST /api/annotations/:annotationId/replies failed: ${u.status} ${h}`)}return u.json()})}getapichangesets(){return ze(this,null,function*(){const s=`${this.getBaseUrl()}/api/changesets`,l={method:"GET",headers:this.getHeaders(),credentials:"include"},c=yield fetch(s,l);if(!c.ok){const o=yield c.text();throw new Error(`GET /api/changesets failed: ${c.status} ${o}`)}return c.json()})}getapichangesetschangesetId(t){return ze(this,null,function*(){const a=this.getBaseUrl(),s=`/api/changesets/${encodeURIComponent(t)}`,l=`${a}${s}`,c={method:"GET",headers:this.getHeaders(),credentials:"include"},o=yield fetch(l,c);if(!o.ok){const u=yield o.text();throw new Error(`GET /api/changesets/:changesetId failed: ${o.status} ${u}`)}return o.json()})}}let Fh=null;function Bs(e){if(!Fh){const t=typeof window!="undefined"?window.location.origin:qE.API_URL||"http://localhost:8080";Fh=new VE(t)}return Fh}const Zu=Bs();function GE(e){return sl({queryKey:["getapimodel"],queryFn:()=>Zu.getapimodel()})}function KE(e){return sl({queryKey:["getapispec"],queryFn:()=>Zu.getapispec()})}function QE(e){return sl({queryKey:["getapichangesets"],queryFn:()=>Zu.getapichangesets()})}function YE(e,t){return sl(R({queryKey:["getapichangesetschangesetId",e],queryFn:()=>Zu.getapichangesetschangesetId(e)},t))}function XE(){return new RE({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1e3*60*10,retry:1},mutations:{retry:0}}})}const _o="dr_auth_token";function kb(){if(typeof window=="undefined")return null;const e=localStorage.getItem(_o);if(e)return console.log("[Auth] Token loaded from localStorage"),e;const t=ZE();return t?(console.log("[Auth] Token loaded from cookie"),t):(console.log("[Auth] No token found - running in development mode"),null)}function ZE(){if(typeof document=="undefined")return null;const e=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${_o}=`));if(!e)return null;try{return decodeURIComponent(e.split("=")[1]||"")}catch(t){return e.split("=")[1]||null}}const dp=qu((e,t)=>({token:kb(),isAuthenticated:!!kb(),setToken:a=>{typeof window!="undefined"&&(a?localStorage.setItem(_o,a):localStorage.removeItem(_o)),e({token:a,isAuthenticated:!!a}),console.log("[Auth] Token updated:",a?"present":"cleared")},clearToken:()=>{typeof window!="undefined"&&localStorage.removeItem(_o),e({token:null,isAuthenticated:!1}),console.log("[Auth] Token cleared from store and localStorage")},getAuthHeaders:()=>{const{token:a}=t();return a?{Authorization:`Bearer ${a}`}:{}},getAuthQueryParams:()=>{const{token:a}=t();return a?{token:a}:{}}}));function JE(){const e=Yu({strict:!1}),t=dp(a=>a.setToken);return D.useEffect(()=>{const a=e==null?void 0:e.token,s=window.location.hash.slice(1)||"/model/graph";a&&(console.log("[AuthRoute] Storing token in localStorage"),localStorage.setItem("dr_auth_token",a),t(a),console.log("[AuthRoute] Updated authStore with new token")),window.location.hash=s},[e==null?void 0:e.token,t]),f.jsx("div",{className:"flex items-center justify-center h-screen",children:f.jsx("p",{className:"text-gray-500","data-testid":"auth-loading",children:"Authenticating..."})})}const WE={dashboard:"M3 3 L10 3 L10 10 L3 10 Z M14 3 L21 3 L21 10 L14 10 Z M14 14 L21 14 L21 21 L14 21 Z M3 14 L10 14 L10 21 L3 21 Z",schema:"M3 12 L9 6 L21 6 M3 12 L9 18 L21 18 M3 12 C4.7 12 6 10.3 6 8 C6 5.7 4.7 4 3 4 C1.3 4 0 5.7 0 8 C0 10.3 1.3 12 3 12 M21 6 C22.7 6 24 4.3 24 2 C24 0.3 22.7 0 21 0 C19.3 0 18 0.3 18 2 C18 4.3 19.3 6 21 6 M21 18 C22.7 18 24 16.3 24 14 C24 12.3 22.7 11 21 11 C19.3 11 18 12.3 18 14 C18 16.3 19.3 18 21 18",data:"M12 5 C18.6 5 24 6.3 24 8 L24 8 L24 16 C24 17.7 18.6 19 12 19 C5.4 19 0 17.7 0 16 L0 8 C0 6.3 5.4 5 12 5 M3 5 L3 14 L21 14 L21 5 M3 11 L3 19 L21 19 L21 11",pipeline:"M2 12 L6 12 L6 6 L18 6 L18 12 L22 12 M8 12 L16 12 M12 9 L15 12 L12 15",graph:"M6 10 C8.8 10 11 7.8 11 5 C11 2.2 8.8 0 6 0 C3.2 0 1 2.2 1 5 C1 7.8 3.2 10 6 10 M18 10 C20.8 10 23 7.8 23 5 C23 2.2 20.8 0 18 0 C15.2 0 13 2.2 13 5 C13 7.8 15.2 10 18 10 M12 18 C14.8 18 17 15.8 17 13 C17 10.2 14.8 8 12 8 C9.2 8 7 10.2 7 13 C7 15.8 9.2 18 12 18 M8 8 L16 16 M16 8 L8 16 M12 9 L12 15",search:"M10.6 14.8 C14.2 14.8 17.2 11.5 17.2 7.4 C17.2 3 14.2 0 10.6 0 C6.9 0 3 3 3 7.4 C3 11.5 6.9 14.8 10.6 14.8 M19.8 19.2 L16.7 16.3",bell:"M6.55 9.7 C6.55 3.7 11.15 0 11.15 0 C11.15 0 15.75 3.7 15.75 9.7 C15.75 12 17.25 13.4 17.25 13.4 L4.6 13.4 C4.6 13.4 6.55 12 6.55 9.7 M9.4 19.4 C9.73 19.8 10.8 20.1 10.95 20.1 C11.1 20.1 12.18 19.8 12.5 19.4",plus:"M12 5 L12 19 M5 12 L19 12",check:"M2 12 L8 18 L22 4",x:"M3 3 L21 21 M21 3 L3 21",chevronDown:"M6 9 L12 15 L18 9",chevronUp:"M18 15 L12 9 L6 15",chevronLeft:"M15 6 L9 12 L15 18",chevronRight:"M9 6 L15 12 L9 18",menu:"M3 6 L21 6 M3 12 L21 12 M3 18 L21 18",settings:"M12 1.5 C12.4 1.5 12.7 1.8 12.7 2.2 L12.7 4 C14.2 4.4 15.6 5.3 16.7 6.6 L18 5.4 C18.4 5.1 19 5.1 19.3 5.4 C19.7 5.7 19.7 6.3 19.3 6.6 L18 7.8 C19.2 8.9 20.2 10.3 20.6 12 L22.4 12 C22.9 12 23.2 12.3 23.2 12.8 C23.2 13.3 22.9 13.6 22.4 13.6 L20.6 13.6 C20.2 15.3 19.2 16.7 18 17.8 L19.3 19 C19.7 19.3 19.7 19.9 19.3 20.2 C19 20.5 18.4 20.5 18 20.2 L16.7 19 C15.6 20.3 14.2 21.2 12.7 21.6 L12.7 23.4 C12.7 23.8 12.4 24.1 12 24.1 C11.6 24.1 11.3 23.8 11.3 23.4 L11.3 21.6 C9.8 21.2 8.4 20.3 7.3 19 L6 20.2 C5.6 20.5 5 20.5 4.7 20.2 C4.3 19.9 4.3 19.3 4.7 19 L6 17.8 C4.8 16.7 3.8 15.3 3.4 13.6 L1.6 13.6 C1.1 13.6 0.8 13.3 0.8 12.8 C0.8 12.3 1.1 12 1.6 12 L3.4 12 C3.8 10.3 4.8 8.9 6 7.8 L4.7 6.6 C4.3 6.3 4.3 5.7 4.7 5.4 C5 5.1 5.6 5.1 6 5.4 L7.3 6.6 C8.4 5.3 9.8 4.4 11.3 4 L11.3 2.2 C11.3 1.8 11.6 1.5 12 1.5 Z M12 8.5 C10.6 8.5 9.5 9.6 9.5 11 C9.5 12.4 10.6 13.5 12 13.5 C13.4 13.5 14.5 12.4 14.5 11 C14.5 9.6 13.4 8.5 12 8.5 Z",alert:"M12 2 L2 20 L22 20 Z M12 9 L12 13 M12 17 L12.01 17",trash:"M3 6 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 6 M1 6 L23 6 M7 6 L7 4 C7 2.9 7.9 2 9 2 L15 2 C16.1 2 17 2.9 17 4 L17 6 M9 11 L9 17 M15 11 L15 17",edit:"M3 17.25 L3 21 L6.75 21 L17.81 9.94 L14.06 6.19 Z M20.71 7.04 C21.1 6.65 21.1 6.02 20.71 5.63 L18.37 3.29 C17.98 2.9 17.35 2.9 16.96 3.29 L15.12 5.12 L18.87 8.87 Z",download:"M12 2 L12 13 M5 10 L12 17 L19 10",upload:"M12 22 L12 11 M5 14 L12 7 L19 14",eye:"M12 5 C7 5 2.73 8.11 1 12.46 C2.73 16.89 7 20 12 20 C17 20 21.27 16.89 23 12.46 C21.27 8.11 17 5 12 5 Z M12 16 C14.2 16 16 14.2 16 12 C16 9.8 14.2 8 12 8 C9.8 8 8 9.8 8 12 C8 14.2 9.8 16 12 16 Z",eyeOff:"M12 5.69 C8.5 5.69 5.2 7.6 3.2 10.4 M21 19 L2 2 M9.88 9.88 C9.4 10.5 9 11.2 9 12 C9 14.21 10.79 16 13 16 C13.8 16 14.5 15.6 15.12 15.12 M18.8 10.4 C20.8 7.6 17.5 5.69 12 5.69",clock:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M12 20 C7.58 20 4 16.42 4 12 C4 7.58 7.58 4 12 4 C16.42 4 20 7.58 20 12 C20 16.42 16.42 20 12 20 Z M13 7 L11 7 L11 13 L16.25 15.85 L17 14.32 L13 12 Z",calendar:"M5 2 L5 4 L19 4 L19 2 M3 4 L3 20 C3 21.1 3.9 22 5 22 L19 22 C20.1 22 21 21.1 21 20 L21 4 M7 11 L7 13 L9 13 L9 11 L7 11 Z M12 11 L12 13 L14 13 L14 11 L12 11 Z M17 11 L17 13 L19 13 L19 11 L17 11 Z",filter:"M3 6 L21 6 L18 13 L18 20 L6 20 L6 13 Z",link:"M10 11 C10.8 10.3 12 10.2 12.7 10.2 L20 10.2 C21 10.2 21.8 11 21.8 12 L21.8 19 C21.8 20 21 20.8 20 20.8 L12.7 20.8 C11.7 20.8 10.9 20 10.9 19 L10.9 12 C10.9 11.9 10.91 11.8 10.92 11.7 M7 11 C7.8 10.3 6.5 10.2 5.8 10.2 L1 10.2 C0.1 10.2 0.2 11 0.2 12 L0.2 19 C0.2 20 0.9 20.8 1.8 20.8 L5.8 20.8 C6.8 20.8 7.6 20 7.6 19 L7.6 12 C7.6 11.9 7.59 11.8 7.58 11.7",lock:"M7 10 L7 7 C7 4.24 9.24 2 12 2 C14.76 2 17 4.24 17 7 L17 10 M5 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 Z",unlock:"M7 10 L19 10 L19 20 C19 21.1 18.1 22 17 22 L7 22 C5.9 22 5 21.1 5 20 L5 10 L5 7 C5 4.24 7.24 2 10 2 C12.76 2 15 4.24 15 7 L13 7 C13 5.34 11.66 4 10 4 C8.34 4 7 5.34 7 7 Z",user:"M12 12 C13.66 12 15 10.66 15 9 C15 7.34 13.66 6 12 6 C10.34 6 9 7.34 9 9 C9 10.66 10.34 12 12 12 Z M12 22 C16.42 22 21 20 21 16 L21 14 C21 11.79 19.21 10 17 10 L7 10 C4.79 10 3 11.79 3 14 L3 16 C3 20 7.58 22 12 22 Z",copy:"M16 1 L4 1 C2.9 1 2 1.9 2 3 L2 17 L4 17 L4 3 L16 3 Z M20 5 L8 5 C6.9 5 6 5.9 6 7 L6 21 C6 22.1 6.9 23 8 23 L20 23 C21.1 23 22 22.1 22 21 L22 7 C22 5.9 21.1 5 20 5 Z",info:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 17 L11 17 L11 11 L13 11 Z M13 9 L11 9 L11 7 L13 7 Z",help:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M13 19 L11 19 L11 17 L13 17 Z M15.07 10.25 C14.29 11.29 13.5 12 13 12.9 L13 14 L11 14 L11 13 C11 11.52 11.79 10.29 12.93 9.07 C13.62 8.29 14.29 7.5 14.29 6.5 C14.29 5.42 13.47 4.6 12.4 4.6 C11.4 4.6 10.6 5.36 10.6 6.3 L8.6 6.2 C8.72 4.5 10.09 3.1 12.4 3.1 C14.84 3.1 16.3 4.5 16.3 6.42 C16.3 7.8 15.66 8.9 15.07 10.25 Z",spinner:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 M12 2 C6.48 2 2 6.48 2 12",loading:"M12 2 C6.48 2 2 6.48 2 12",moreVertical:"M12 8 C13.1 8 14 7.1 14 6 C14 4.9 13.1 4 12 4 C10.9 4 10 4.9 10 6 C10 7.1 10.9 8 12 8 Z M12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 Z M12 20 C13.1 20 14 19.1 14 18 C14 16.9 13.1 16 12 16 C10.9 16 10 16.9 10 18 C10 19.1 10.9 20 12 20 Z",moreHorizontal:"M6 10 C4.9 10 4 10.9 4 12 C4 13.1 4.9 14 6 14 C7.1 14 8 13.1 8 12 C8 10.9 7.1 10 6 10 Z M18 10 C16.9 10 16 10.9 16 12 C16 13.1 16.9 14 18 14 C19.1 14 20 13.1 20 12 C20 10.9 19.1 10 18 10 Z M12 10 C10.9 10 10 10.9 10 12 C10 13.1 10.9 14 12 14 C13.1 14 14 13.1 14 12 C14 10.9 13.1 10 12 10 Z",reload:"M7 7 C4.24 7 2 9.24 2 12 C2 14.56 3.68 16.73 6 17.73 L6 15.95 C4.29 15.16 3 13.32 3 11.13 C3 8.82 4.82 7 7 7 Z M17 7 C19.76 7 22 9.24 22 12 C22 14.13 20.71 15.97 18.7 16.76 L18.7 18.54 C21.32 17.54 23 15.56 23 13 C23 10.24 20.76 8 18 8 Z M11.5 5 L14.5 8 L8.5 8 Z M8.5 16 L14.5 16 L11.5 19 Z",arrowRight:"M5 12 L19 12 M13 6 L19 12 L13 18",arrowLeft:"M19 12 L5 12 M11 6 L5 12 L11 18",arrowUp:"M12 19 L12 5 M6 11 L12 5 L18 11",arrowDown:"M12 5 L12 19 M6 13 L12 19 L18 13",star:"M12 2 L15.09 10.26 L24 10.26 L17.55 15.13 L19.64 23.39 L12 18.53 L4.36 23.39 L6.45 15.13 L0 10.26 L8.91 10.26 Z",heart:"M20.84 4.61 C20.02 3.78 18.98 3.37 17.93 3.37 C16.88 3.37 15.84 3.78 15.02 4.61 L12 7.63 L8.98 4.61 C7.30 2.92 4.71 2.92 3.02 4.61 C1.33 6.30 1.33 8.88 3.02 10.57 L12 19.58 L20.99 10.57 C22.68 8.88 22.68 6.30 20.84 4.61 Z",palette:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 12 C8.1 12 9 11.1 9 10 C9 8.9 8.1 8 7 8 C5.9 8 5 8.9 5 10 C5 11.1 5.9 12 7 12 Z M17 12 C18.1 12 19 11.1 19 10 C19 8.9 18.1 8 17 8 C15.9 8 15 8.9 15 10 C15 11.1 15.9 12 17 12 Z M12 17 C10.9 17 10 16.1 10 15 C10 13.9 10.9 13 12 13 C13.1 13 14 13.9 14 15 C14 16.1 13.1 17 12 17 Z M7 17 C5.9 17 5 16.1 5 15 C5 13.9 5.9 13 7 13 C8.1 13 9 13.9 9 15 C9 16.1 8.1 17 7 17 Z M17 17 C15.9 17 15 16.1 15 15 C15 13.9 15.9 13 17 13 C18.1 13 19 13.9 19 15 C19 16.1 18.1 17 17 17 Z",component:"M5 3 L19 3 L19 9 L5 9 Z M5 11 L19 11 L19 17 L5 17 Z M3 20 L21 20",table:"M3 4 L21 4 M3 4 L3 20 L21 20 L21 4 M3 8 L21 8 M3 12 L21 12 M3 16 L21 16 M8 4 L8 20 M13 4 L13 20 M18 4 L18 20",layout:"M3 3 L21 3 L21 21 L3 21 Z M3 8 L21 8 M3 3 L3 21 M8 8 L8 21",moon:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",sun:"M12 3v2M12 19v2M5.64 5.64l1.42 1.42M16.95 16.95l1.41 1.41M3 12h2M19 12h2M5.64 18.36l1.41-1.41M16.95 7.05l1.41-1.41M12 7a5 5 0 1 0 0 10A5 5 0 0 0 12 7z","bar-chart":"M3 3 L3 20 L21 20 M5 16 L5 9 M12 16 L12 5 M19 16 L19 8","trending-up":"M23 6 L13.5 15.5 M23 6 L23 13 L16 13 M1 23 L6.5 17.5 L13 24 L23 6","trending-down":"M23 18 L13.5 8.5 M23 18 L23 11 L16 11 M1 1 L6.5 6.5 L13 0 L23 18",send:"M16 8 L2 5 L9.5 12 L2 19 L16 16 M7 12 L16 12",bot:"M12 2 C6.48 2 2 6.48 2 12 C2 17.52 6.48 22 12 22 C17.52 22 22 17.52 22 12 C22 6.48 17.52 2 12 2 Z M7 8 L7 10 L9 10 L9 8 Z M15 8 L15 10 L17 10 L17 8 Z M9 14 L15 14 M12 14 L12 18",paperclip:"M12.5 2 C9.46 2 7 4.46 7 7.5 C7 10.54 9.46 13 12.5 13 L18 13 C18.55 13 19 12.55 19 12 C19 11.45 18.55 11 18 11 L12.5 11 C10.57 11 9 9.43 9 7.5 C9 5.57 10.57 4 12.5 4 C14.43 4 16 5.57 16 7.5 L16 15 C16 18.31 13.31 21 10 21 C6.69 21 4 18.31 4 15 L4 7 C4 5.9 4.9 5 6 5 C7.1 5 8 5.9 8 7 L8 15 C8 16.1 8.9 17 10 17 C11.1 17 12 16.1 12 15 L12 7.5","pie-chart":"M21.21 15.89 L12 12 L12 2.69 A10 10 0 0 1 21.21 15.89 M12 12 L5.5 5.5 A10 10 0 0 0 2 12 M2 12 A10 10 0 0 0 12 22 A10 10 0 0 0 12 12",slash:"M21 3 L3 21",file:"M14 2 L6 2 C4.9 2 4 2.9 4 4 L4 20 C4 21.1 4.9 22 6 22 L18 22 C19.1 22 20 21.1 20 20 L20 8 Z M14 2 L14 8 L20 8 M16 13 L8 13 M16 17 L8 17 M10 9 L8 9",zap:"M13 2 L3 14 L12 14 L11 22 L21 10 L12 10 Z",hardDrive:"M22 12 L2 12 M2 9 C2 7.9 2.9 7 4 7 L20 7 C21.1 7 22 7.9 22 9 L22 19 C22 20.1 21.1 21 20 21 L4 21 C2.9 21 2 20.1 2 19 Z M6 17 L6.01 17",folder:"M20 20 C21.1 20 22 19.1 22 18 L22 8 C22 6.9 21.1 6 20 6 L12.1 6 C11.43 6 10.8 5.68 10.41 5.13 L9.6 3.9 C9.22 3.34 8.59 3 7.93 3 L4 3 C2.9 3 2 3.9 2 5 L2 18 C2 19.1 2.9 20 4 20 Z",tag:"M12.59 2.59 C12.21 2.21 11.7 2 11.17 2 L4 2 C2.9 2 2 2.9 2 4 L2 11.17 C2 11.7 2.21 12.21 2.59 12.59 L11.29 21.29 C12.07 22.07 13.34 22.07 14.12 21.29 L20.7 14.71 C21.48 13.93 21.48 12.66 20.7 11.88 Z M7.5 7.5 L7.51 7.5",gitBranch:"M6 3 L6 15 M6 6 C7.66 6 9 4.66 9 3 C9 1.34 7.66 0 6 0 C4.34 0 3 1.34 3 3 C3 4.66 4.34 6 6 6 Z M6 24 C7.66 24 9 22.66 9 21 C9 19.34 7.66 18 6 18 C4.34 18 3 19.34 3 21 C3 22.66 4.34 24 6 24 Z M18 9 C19.66 9 21 7.66 21 6 C21 4.34 19.66 3 18 3 C16.34 3 15 4.34 15 6 C15 7.66 16.34 9 18 9 Z M18 9 C18 13 15 15 9 15"},Ce=ae.forwardRef((o,c)=>{var u=o,{name:e,size:t=24,className:a="","aria-label":s}=u,l=fe(u,["name","size","className","aria-label"]);const h=WE[e];return h?f.jsx("svg",Y(R({ref:c,viewBox:"0 0 24 24",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":s?void 0:!0,"aria-label":s,className:a},l),{children:f.jsx("path",{d:h})})):(console.warn(`Icon "${e}" does not exist in ICONS map`),null)});Ce.displayName="Icon";function ek(e){return e.split(" ").slice(0,2).map(t=>t[0]).join("").toUpperCase()}const go={amber:"linear-gradient(135deg, rgb(var(--accent-primary)), rgb(var(--accent-primary-deep)))",emerald:"linear-gradient(135deg, rgb(var(--status-emerald)), rgb(var(--semantic-emerald-fg)))",rose:"linear-gradient(135deg, rgb(var(--status-rose)), rgb(var(--status-rose-deep)))",cyan:"linear-gradient(135deg, rgb(var(--status-cyan)), rgb(var(--status-cyan-deep)))",violet:"linear-gradient(135deg, rgb(var(--status-violet)), rgb(var(--semantic-violet-fg)))",neutral:"linear-gradient(135deg, rgb(var(--status-neutral)), rgb(var(--semantic-neutral-fg)))"},Rb=Object.keys(go);function tk(e){let t=0;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a);t=(t<<5)-t+s,t=t&t}return Math.abs(t)}function nk(e){const t=tk(e)%Rb.length;return Rb[t]}function ak(e,t){if(e&&e in go)return go[e];if(e)return e;if(t){const a=nk(t);return go[a]}return go.amber}const ik=ae.forwardRef((p,g)=>{var v=p,{name:e,src:t,size:a="md",shape:s="circle",status:l,color:c,decorative:o,className:u="",style:h}=v,m=fe(v,["name","src","size","shape","status","color","decorative","className","style"]);const[x,_]=D.useState(!1),S=ek(e),w=!t||x,C=["avatar",`avatar--${a}`,`avatar--${s}`,u].filter(Boolean).join(" "),k=w?{background:ak(c,e)}:{display:"none"},j=w?{display:"none"}:{};return f.jsxs("div",Y(R({ref:g,className:C,style:h,role:o?void 0:"img","aria-label":o?void 0:l?`${e} (${l})`:e,"aria-hidden":o?"true":void 0},m),{children:[f.jsx("div",{className:"avatar__initials",style:k,children:S}),t&&f.jsx("img",{className:"avatar__image",src:t,alt:"",onError:()=>_(!0),style:j}),l&&f.jsx("div",{className:`avatar__status avatar__status--${l}`,"aria-label":l})]}))});ik.displayName="Avatar";const an=ae.forwardRef((h,u)=>{var m=h,{variant:e="primary",size:t="md",icon:a,className:s="",disabled:l,type:c="button"}=m,o=fe(m,["variant","size","icon","className","disabled","type"]);const g=["btn",`btn--${e}`,`btn--${t}`,a?"btn--icon":"",s].filter(Boolean).join(" ");return f.jsx("button",R({ref:u,type:c,disabled:l,className:g},o))});an.displayName="Button";const wn=ae.forwardRef((o,c)=>{var u=o,{variant:e="neutral",form:t="default",className:a="",children:s}=u,l=fe(u,["variant","form","className","children"]);const h=["chip",`chip--${t}`,t==="default"&&`chip--${e}`,a].filter(Boolean).join(" ");return f.jsxs("span",Y(R({ref:c,className:h},l),{children:[t==="default"&&f.jsx("span",{className:"chip__dot"}),t==="env"&&f.jsx("span",{className:"chip__dot chip__dot--env"}),s]}))});wn.displayName="Chip";const fp=ae.forwardRef((c,l)=>{var o=c,{color:e="cyan",pulse:t=!1,className:a=""}=o,s=fe(o,["color","pulse","className"]);const u=["badge",`badge--${e}`,t&&"badge--pulse",a].filter(Boolean).join(" ");return f.jsx("span",R({ref:l,className:u},s))});fp.displayName="Badge";const zx=ae.forwardRef((o,c)=>{var u=o,{color:e="cyan",pulse:t=!1,className:a="",role:s="img"}=u,l=fe(u,["color","pulse","className","role"]);const h=["status-badge",`status-badge--${e}`,t&&"status-badge--pulse",a].filter(Boolean).join(" ");return f.jsx("div",R({ref:c,role:s,className:h},l))});zx.displayName="StatusBadge";const Ro=ae.forwardRef((c,l)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=fe(o,["mono","error","className"]);const u=["text-input",e&&"text-input--mono",t&&"text-input--error",a].filter(Boolean).join(" ");return f.jsx("input",R({type:"text",ref:l,className:u},s))});Ro.displayName="TextInput";const hp=ae.forwardRef((c,l)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=fe(o,["mono","error","className"]);const u=["text-area",e&&"text-area--mono",t&&"text-area--error",a].filter(Boolean).join(" ");return f.jsx("textarea",R({ref:l,className:u},s))});hp.displayName="TextArea";const sk=ae.forwardRef((c,l)=>{var o=c,{mono:e=!1,error:t=!1,className:a=""}=o,s=fe(o,["mono","error","className"]);const u=["number-input",e&&"number-input--mono",t&&"number-input--error",a].filter(Boolean).join(" ");return f.jsx("input",R({ref:l,type:"number",className:u},s))});sk.displayName="NumberInput";const rk="[data-dropdown-item]:not([data-disabled])";function Ju({triggerRef:e,panelRef:t,isOpen:a,onClose:s,itemSelector:l=rk,restoreFocus:c=!0}){const[o,u]=D.useState(null),h=D.useRef(!1),m=D.useCallback(()=>{const g=t.current;return g?Array.from(g.querySelectorAll(l)).map(p=>p.getAttribute("data-dropdown-item")).filter(p=>p!==null&&p.length>0):[]},[t,l]);return D.useEffect(()=>{var g;if(a&&!h.current){h.current=!0;const p=m();u(v=>{var x;return v&&p.includes(v)?v:(x=p[0])!=null?x:null})}else!a&&h.current&&(h.current=!1,u(null),c&&((g=e.current)==null||g.focus()))},[a,m,c,e]),D.useEffect(()=>{if(!a)return;const g=v=>{const x=v.target,_=e.current,S=t.current;_!=null&&_.contains(x)||S!=null&&S.contains(x)||s()},p=v=>{v.key==="Escape"&&(v.preventDefault(),s())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",p)}},[a,s,e,t]),D.useEffect(()=>{if(!a)return;const g=e.current,p=t.current,v=x=>{var _;const S=m();if(S.length===0)return;const w=S.indexOf(o!=null?o:""),C=S.length-1,k=(_=x.target)==null?void 0:_.hasAttribute("data-dropdown-item");switch(x.key){case"ArrowDown":{x.preventDefault();const j=w<C?w+1:0;u(S[j]);break}case"ArrowUp":{x.preventDefault();const j=w>0?w-1:C;u(S[j]);break}case"Tab":{if(!k)return;x.preventDefault();const j=x.shiftKey?-1:1,E=(w+j+S.length)%S.length;u(S[E]);break}case"Home":{x.preventDefault(),u(S[0]);break}case"End":{x.preventDefault(),u(S[C]);break}}};return g==null||g.addEventListener("keydown",v),p==null||p.addEventListener("keydown",v),()=>{g==null||g.removeEventListener("keydown",v),p==null||p.removeEventListener("keydown",v)}},[a,o,m,e,t]),{focusedValue:o,setFocusedValue:u}}const Wu=(e="bottom-start")=>`dropdown-panel--placement-${e}`,Ix=D.createContext(void 0);function Ux(e){const t=D.useContext(Ix);if(!t)throw new Error(`${e} must be used inside <Select>`);return t}const Bx=ae.forwardRef((e,t)=>{var he;const{placeholder:a="Select…",error:s=!1,disabled:l=!1,id:c,name:o,className:u="",ariaLabel:h,children:m,placement:g="bottom-start"}=e,p=e["data-testid"],v=e.multiple?"multi":"single",x=v==="single"&&e.value!==void 0,_=v==="multi"&&e.values!==void 0,[S,w]=D.useState(v==="single"&&(he=e.defaultValue)!=null?he:""),[C,k]=D.useState(()=>{var M;return new Set(v==="multi"?(M=e.defaultValues)!=null?M:[]:[])}),j=D.useMemo(()=>{var M,se;if(v==="single"){const pe=x?(M=e.value)!=null?M:"":S;return pe?new Set([pe]):new Set}return _?new Set((se=e.values)!=null?se:[]):C},[v,x,_,e.value,e.values,S,C]),[E,O]=D.useState(!1),z=D.useRef(null),I=D.useRef(null),B=D.useRef(null),[q,A]=D.useState(new Map),U=D.useCallback((M,se)=>(A(pe=>{if(pe.get(M)===se)return pe;const ge=new Map(pe);return ge.set(M,se),ge}),()=>{A(pe=>{if(!pe.has(M))return pe;const ge=new Map(pe);return ge.delete(M),ge})}),[]),F=D.useCallback(M=>{l||O(M)},[l]),$=D.useCallback(()=>O(!1),[]),{focusedValue:V,setFocusedValue:K}=Ju({triggerRef:z,panelRef:I,isOpen:E,onClose:$});D.useEffect(()=>{if(E&&j.size>0&&!V){const M=j.values().next().value;M&&K(M)}},[E,j,V,K]);const H=D.useCallback(M=>{var se,pe;if(v==="single")x||w(M),(se=e.onChange)==null||se.call(e,M),O(!1);else{const ge=new Set(j);ge.has(M)?ge.delete(M):ge.add(M),_||k(ge),(pe=e.onValuesChange)==null||pe.call(e,Array.from(ge))}},[v,x,_,j,e]),X={mode:v,isOpen:E,onOpenChange:F,selectedValues:j,onValueChange:H,focusedValue:V,setFocusedValue:K,registerItem:U,panelRef:I},P=D.useMemo(()=>{var ge,Se;if(j.size===0)return f.jsx("span",{className:"select__placeholder",children:a});if(v==="single"){const xe=j.values().next().value;return f.jsx("span",{className:"select__value",children:(ge=q.get(xe))!=null?ge:xe})}const M=Array.from(j),se=M[0],pe=(Se=q.get(se))!=null?Se:se;return M.length===1?f.jsx("span",{className:"select__value",children:pe}):f.jsxs("span",{className:"select__value",children:[pe," ",f.jsxs("span",{className:"select__value-count",children:["+",M.length-1]})]})},[j,q,v,a]),re=M=>{E||(M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),F(!0))},T=o&&j.size>0?Array.from(j).map(M=>f.jsx("input",{type:"hidden",name:o,value:M},M)):null,ce=M=>{z.current=M,typeof t=="function"?t(M):t&&(t.current=M)};return f.jsx(Ix.Provider,{value:X,children:f.jsxs("div",{ref:B,className:["select",s&&"select--error",l&&"select--disabled",u].filter(Boolean).join(" "),"data-testid":p,children:[f.jsxs("button",{ref:ce,id:c,type:"button",className:"select__trigger","aria-haspopup":"listbox","aria-expanded":E,"aria-invalid":s||void 0,"aria-label":h,disabled:l,onClick:()=>F(!E),onKeyDown:re,children:[P,f.jsx(Ce,{name:"chevronDown",size:14,className:`select__chevron ${E?"select__chevron--open":""}`})]}),T,f.jsx("div",{ref:I,role:"listbox","aria-multiselectable":v==="multi"?!0:void 0,className:`dropdown-panel ${Wu(g)} select__panel`,hidden:!E,children:m})]})})});Bx.displayName="Select";function lk({value:e,icon:t,description:a,disabled:s=!1,children:l}){const{selectedValues:c,onValueChange:o,focusedValue:u,setFocusedValue:h,registerItem:m,mode:g}=Ux("Select.Item"),p=D.useRef(null),v=c.has(e),x=u===e;return D.useEffect(()=>m(e,l),[e,l,m]),D.useEffect(()=>{var _;x&&((_=p.current)==null||_.focus())},[x]),f.jsxs("button",{ref:p,type:"button",role:"option","aria-selected":v,tabIndex:x?0:-1,"data-dropdown-item":e,"data-disabled":s||void 0,disabled:s,onClick:()=>o(e),onMouseEnter:()=>!s&&h(e),className:["dropdown-item",v&&"dropdown-item--selected",x&&"dropdown-item--focused",s&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[t?f.jsx("span",{className:"dropdown-item__leading",children:f.jsx(Ce,{name:t,size:16})}):null,f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:l}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]}),g==="single"&&v&&f.jsx("span",{className:"dropdown-item__trailing",children:f.jsx(Ce,{name:"check",size:14})})]})}function ok({value:e,description:t,disabled:a=!1,children:s}){const{selectedValues:l,onValueChange:c,focusedValue:o,setFocusedValue:u,registerItem:h}=Ux("Select.CheckboxItem"),m=D.useRef(null),g=l.has(e),p=o===e;return D.useEffect(()=>h(e,s),[e,s,h]),D.useEffect(()=>{var v;p&&((v=m.current)==null||v.focus())},[p]),f.jsxs("button",{ref:m,type:"button",role:"option","aria-selected":g,tabIndex:p?0:-1,"data-dropdown-item":e,"data-disabled":a||void 0,disabled:a,onClick:()=>c(e),onMouseEnter:()=>!a&&u(e),className:["dropdown-item",p&&"dropdown-item--focused",a&&"dropdown-item--disabled"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:g,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:s}),t&&f.jsx("span",{className:"dropdown-item__description",children:t})]})]})}function ck(){return f.jsx("div",{role:"separator",className:"dropdown-separator"})}function uk({children:e}){return f.jsx("div",{className:"dropdown-section-title",children:e})}const Ou=Object.assign(Bx,{Item:lk,CheckboxItem:ok,Separator:ck,SectionTitle:uk}),dk=ae.forwardRef((c,l)=>{var o=c,{indeterminate:e=!1,className:t="","aria-checked":a}=o,s=fe(o,["indeterminate","className","aria-checked"]);const u=ae.useRef(null),h=ae.useCallback(g=>{u.current=g,typeof l=="function"?l(g):l&&(l.current=g)},[l]);ae.useEffect(()=>{u.current&&(u.current.indeterminate=e)},[e]);const m=["tri-state",e&&"tri-state--indeterminate",t].filter(Boolean).join(" ");return f.jsx("input",Y(R({ref:h,type:"checkbox",className:m},s),{"aria-checked":a!=null?a:e?"mixed":s.checked!==void 0?!!s.checked:void 0}))});dk.displayName="TriState";const fk=ae.forwardRef((p,g)=>{var v=p,{label:e,htmlFor:t,required:a=!1,disabled:s=!1,error:l,errorId:c,hint:o,children:u,className:h=""}=v,m=fe(v,["label","htmlFor","required","disabled","error","errorId","hint","children","className"]);const x=["field",s?"field--disabled":"",h].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:g,className:x},m),{children:[e&&f.jsxs("label",{className:"field__label",htmlFor:t,children:[f.jsx("span",{children:e}),a&&f.jsx("span",{className:"field__required",children:"*"}),o&&f.jsx("span",{className:"field__hint",children:o})]}),f.jsx("div",{className:"field__input",children:u}),l&&f.jsx("div",{className:"field__error",id:c,children:l})]}))});fk.displayName="Field";const To={emerald:"rgb(16 185 129)",amber:"rgb(245 158 11)",rose:"rgb(244 63 94)",cyan:"rgb(34 211 238)",violet:"rgb(139 92 246)",neutral:"rgb(var(--canvas-fg-2))"};function hk(e){return e in To?To[e]:e}function mk(e){return e.map(([t,a],s)=>(s?"L":"M")+t.toFixed(2)+","+a.toFixed(2)).join(" ")}const mp=ae.forwardRef((g,m)=>{var p=g,{data:e,width:t=88,height:a=28,color:s="emerald",area:l=!0,label:c,className:o="",style:u}=p,h=fe(p,["data","width","height","color","area","label","className","style"]);const v=ae.useId(),x=ae.useMemo(()=>{if(!e||e.length<2)return null;const C=Math.min(...e),k=Math.max(...e),j=e.map((z,I)=>[I/(e.length-1)*t,a-2-(z-C)/(k-C||1)*(a-4)]),E=mk(j),O=`${E} L${t},${a} L0,${a} Z`;return{line:E,fill:O}},[e,t,a]);if(!x)return null;const _=hk(String(s)),{line:S,fill:w}=x;return f.jsxs("svg",Y(R({ref:m,role:"img","aria-label":c!=null?c:"trend sparkline",width:t,height:a,viewBox:`0 0 ${t} ${a}`,preserveAspectRatio:"none",style:R({display:"block"},u),className:o},h),{children:[l&&f.jsx("defs",{children:f.jsxs("linearGradient",{id:v,x1:"0",y1:"0",x2:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:_,stopOpacity:"0.22"}),f.jsx("stop",{offset:"100%",stopColor:_,stopOpacity:"0"})]})}),l&&f.jsx("path",{d:w,fill:`url(#${v})`}),f.jsx("path",{d:S,stroke:_,strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}))});mp.displayName="Sparkline";const wu=ae.forwardRef((v,p)=>{var x=v,{label:e="",value:t="",delta:a,color:s="cyan",icon:l,sparkData:c,meta:o,metaIcon:u,className:h="","aria-label":m}=x,g=fe(x,["label","value","delta","color","icon","sparkData","meta","metaIcon","className","aria-label"]);const _=["stat-tile",`stat-tile--${s}`,h].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:p,className:_,"aria-label":m!=null?m:`${e}: ${t}`},g),{children:[f.jsxs("div",{className:"stat-tile__header",children:[f.jsx("div",{className:"stat-tile__label",children:e}),l&&f.jsx(Ce,{name:l,size:14,"aria-hidden":"true"})]}),f.jsx("div",{className:"stat-tile__value",children:t}),(a||o)&&f.jsxs("div",{className:"stat-tile__footer",children:[a&&f.jsxs("span",{className:`stat-tile__delta stat-tile__delta--${a.direction||"up"}`,children:[f.jsxs("span",{className:"stat-tile__delta-value",children:[a.direction==="down"?"−":"+",Math.abs(a.value)]}),a.label&&f.jsx("span",{className:"stat-tile__delta-label",children:a.label})]}),o&&f.jsxs("div",{className:"stat-tile__meta",children:[u&&f.jsx(Ce,{name:u,size:12,"aria-hidden":"true"}),f.jsx("span",{className:"stat-tile__meta-text",children:o})]})]}),c&&f.jsx("div",{className:"stat-tile__sparkline",children:f.jsx(mp,{data:c,width:88,height:28,color:s||"cyan"})})]}))});wu.displayName="StatTile";const pk=ae.forwardRef((c,l)=>{var o=c,{columns:e=4,className:t="",children:a}=o,s=fe(o,["columns","className","children"]);const u=["stat-grid",`stat-grid--cols-${e}`,t].filter(Boolean).join(" ");return f.jsx("div",Y(R({ref:l,className:u},s),{children:a}))});pk.displayName="StatGrid";const On=ae.forwardRef((c,l)=>{var o=c,{className:e="",children:t,tone:a="amber"}=o,s=fe(o,["className","children","tone"]);const u=["version-pill",`version-pill--${a}`,e].filter(Boolean).join(" ");return f.jsx("span",Y(R({ref:l,className:u},s),{children:t}))});On.displayName="VersionPill";const pp=ae.forwardRef((u,o)=>{var h=u,{value:e,onChange:t,options:a,disabled:s=!1,className:l=""}=h,c=fe(h,["value","onChange","options","disabled","className"]);const m=["segmented-control",s?"segmented-control--disabled":"",l].filter(Boolean).join(" "),g=D.useRef([]),p=D.useCallback((_,S)=>{var w;const C=a.map((E,O)=>E.disabled?null:O).filter(E=>E!==null),k=C.indexOf(S);let j;_.key==="ArrowRight"||_.key==="ArrowDown"?(_.preventDefault(),j=C[(k+1)%C.length]):(_.key==="ArrowLeft"||_.key==="ArrowUp")&&(_.preventDefault(),j=C[(k-1+C.length)%C.length]),j!==void 0&&((w=g.current[j])==null||w.focus(),t(a[j].value))},[a,t]),v=a.some(_=>_.value===e),x=a.findIndex(_=>!_.disabled);return f.jsx("div",Y(R({ref:o,className:m,role:"radiogroup"},c),{children:a.map((_,S)=>{const w=e===_.value,C=w||!v&&S===x?0:-1;return f.jsx("button",{ref:k=>{g.current[S]=k},className:`segmented-control__segment ${w?"segmented-control__segment--active":""}`,onClick:()=>!s&&!_.disabled&&t(_.value),onKeyDown:k=>p(k,S),type:"button",role:"radio","aria-checked":w,disabled:s||_.disabled,tabIndex:C,children:_.label},_.value)})}))});pp.displayName="SegmentedControl";const gk=ae.forwardRef((v,p)=>{var x=v,{columns:e,data:t,rowKey:a,selectable:s=!1,selectedRows:l=[],onSelectRows:c,onRowClick:o,onSort:u,emptyState:h,className:m=""}=x,g=fe(x,["columns","data","rowKey","selectable","selectedRows","onSelectRows","onRowClick","onSort","emptyState","className"]);const[_,S]=D.useState(null),[w,C]=D.useState("asc"),k=D.useRef(null),j=t.length>0&&l.length===t.length,E=l.length>0&&l.length<t.length;D.useEffect(()=>{k.current&&(k.current.indeterminate=E)},[E]);const O=(U,F)=>typeof a=="function"?a(U,F):U[a],z=()=>{j?c==null||c([]):c==null||c(t.map((U,F)=>O(U,F)))},I=U=>{l.includes(U)?c==null||c(l.filter(F=>F!==U)):c==null||c([...l,U])},B=U=>{_===U?w==="asc"?(C("desc"),u==null||u(U,"desc")):(S(null),u==null||u(U,null)):(S(U),C("asc"),u==null||u(U,"asc"))},q=(U,F)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),B(F))},A=["table",m].filter(Boolean).join(" ");return f.jsxs("table",Y(R({ref:p,className:A},g),{children:[f.jsx("thead",{className:"table__head",children:f.jsxs("tr",{className:"table__row",children:[s&&f.jsx("th",{className:"table__header table__header--checkbox",style:{width:"30px"},children:f.jsx("input",{ref:k,type:"checkbox",className:"table__checkbox",checked:j,onChange:z,"aria-label":"Select all rows"})}),e.map(U=>{const F=String(U.key),$=_===F,V=$?w==="asc"?"ascending":"descending":U.sortable?"none":void 0;return f.jsx("th",{className:`table__header ${U.sortable?"table__header--sortable":""}`,style:{width:U.width},"aria-sort":V,tabIndex:U.sortable?0:void 0,onClick:()=>U.sortable&&B(F),onKeyDown:U.sortable?K=>q(K,F):void 0,children:f.jsxs("div",{className:"table__header-content",children:[U.label,$&&f.jsx(Ce,{name:w==="asc"?"chevronUp":"chevronDown",size:14,className:"table__sort-icon"})]})},F)})]})}),f.jsx("tbody",{className:"table__body",children:t.length===0&&h?f.jsx("tr",{className:"table__row",children:f.jsx("td",{className:"table__cell table__cell--empty",colSpan:e.length+(s?1:0),children:h})}):t.map((U,F)=>{const $=O(U,F),V=l.includes($),K=!!o;return f.jsxs("tr",{"data-row-key":$,className:["table__row",V?"table__row--selected":"",K?"table__row--clickable":""].filter(Boolean).join(" "),onClick:K?()=>o(U,$):void 0,onKeyDown:K?H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),o(U,$))}:void 0,tabIndex:K?0:void 0,children:[s&&f.jsx("td",{className:"table__cell table__cell--checkbox",children:f.jsx("input",{type:"checkbox",className:"table__checkbox",checked:V,"aria-label":`Select row ${$}`,onChange:()=>I($),onClick:H=>H.stopPropagation()})}),e.map(H=>f.jsx("td",{className:"table__cell",children:H.render?H.render(U[H.key],U,F):U[H.key]},`${$}-${String(H.key)}`))]},$)})})]}))});gk.displayName="Table";const yk=ae.forwardRef((g,m)=>{var p=g,{icon:e,label:t,count:a,active:s=!1,depth:l=0,onClick:c,className:o="",type:u="button"}=p,h=fe(p,["icon","label","count","active","depth","onClick","className","type"]);const v=["nav-item",s&&"nav-item--active",l===1&&"nav-item--depth-1",o].filter(Boolean).join(" ");return f.jsxs("button",Y(R({ref:m,type:u,className:v,onClick:c,"aria-current":s?"page":void 0},h),{children:[l===0&&e&&f.jsx(Ce,{name:e,size:16,className:"nav-item__icon"}),f.jsx("span",{className:"nav-item__label",children:t}),a!==void 0&&f.jsx("span",{className:"nav-item__count",children:a})]}))});yk.displayName="NavItem";const gp=ae.forwardRef((h,u)=>{var m=h,{title:e,version:t,collapsed:a=!1,action:s,className:l="","aria-label":c}=m,o=fe(m,["title","version","collapsed","action","className","aria-label"]);const g=["app-title",a&&"app-title--collapsed",l].filter(Boolean).join(" "),p=c!=null?c:t?`${e} ${t}`:e;return f.jsxs("div",Y(R({ref:u,className:g,"aria-label":p,role:"banner"},o),{children:[f.jsx("div",{className:"app-title__mark","aria-hidden":"true"}),!a&&f.jsxs("div",{className:"app-title__text",children:[f.jsx("div",{className:"app-title__name",children:e}),t&&f.jsx("span",{className:"app-title__version",children:t})]}),s&&f.jsx("div",{className:"app-title__action",children:s})]}))});gp.displayName="AppTitle";const Fx=ae.forwardRef((_,x)=>{var S=_,{sections:e,activeItemId:t,collapsed:a=!1,onCollapse:s,onSelectItem:l,defaultExpandedIds:c,expandedIds:o,onExpandedChange:u,showCollapseToggle:h=!0,appTitle:m,footer:g,className:p=""}=S,v=fe(S,["sections","activeItemId","collapsed","onCollapse","onSelectItem","defaultExpandedIds","expandedIds","onExpandedChange","showCollapseToggle","appTitle","footer","className"]);var I;const w=o!==void 0,[C,k]=D.useState(()=>new Set(c)),j=w?new Set(o):C,E=B=>{const q=new Set(j);q.has(B)?q.delete(B):q.add(B),w||k(q),u==null||u(Array.from(q))},O=["sidebar",a&&"sidebar--collapsed",p].filter(Boolean).join(" "),z=f.jsx("button",{type:"button",className:"sidebar__toggle",onClick:()=>s==null?void 0:s(!a),"aria-label":a?"Expand sidebar":"Collapse sidebar",children:f.jsx(Ce,{name:a?"chevronRight":"chevronLeft",size:16})});return f.jsxs("div",Y(R({ref:x,className:O},v),{children:[m?f.jsxs(f.Fragment,{children:[f.jsx(gp,Y(R({},m),{collapsed:a,action:a?m.action:(I=m.action)!=null?I:z})),a&&z]}):h&&z,f.jsx("nav",{className:"sidebar__nav","aria-label":"Sidebar navigation",children:e.map(B=>f.jsxs("div",{className:"sidebar__section",children:[!a&&f.jsx("div",{className:"sidebar__section-title",children:B.title}),f.jsx("div",{className:"sidebar__items",children:B.items.map(q=>{const A=q.children&&q.children.length>0,U=j.has(q.id),F=t===q.id;return f.jsxs(ae.Fragment,{children:[f.jsxs("button",{type:"button",className:`sidebar__item ${F?"sidebar__item--active":""}`,onClick:()=>{A?E(q.id):l==null||l(q.id)},title:a?q.label:void 0,"aria-current":F?"page":void 0,"aria-expanded":A?U:void 0,children:[q.icon&&f.jsx(Ce,{name:q.icon,size:18,className:"sidebar__item-icon"}),!a&&f.jsx("span",{className:"sidebar__item-label",children:q.label}),!a&&q.count!==void 0&&f.jsx("span",{className:"sidebar__item-count",children:q.count}),!a&&A&&f.jsx(Ce,{name:"chevronRight",size:14,className:`sidebar__item-chevron ${U?"sidebar__item-chevron--open":""}`})]}),!a&&A&&U&&q.children.map($=>f.jsxs("button",{type:"button",className:`sidebar__item sidebar__item--child ${t===$.id?"sidebar__item--active":""}`,onClick:()=>l==null?void 0:l($.id),"aria-current":t===$.id?"page":void 0,children:[f.jsx("span",{className:"sidebar__item-label",children:$.label}),$.count!==void 0&&f.jsx("span",{className:"sidebar__item-count",children:$.count})]},$.id))]},q.id)})})]},B.title))}),g&&f.jsx("div",{className:"sidebar__footer",children:g})]}))});Fx.displayName="Sidebar";const Hx=ae.forwardRef((m,h)=>{var g=m,{breadcrumbs:e,searchPlaceholder:t="Search…",onSearch:a,leadingContent:s,searchHint:l,children:c,className:o=""}=g,u=fe(g,["breadcrumbs","searchPlaceholder","onSearch","leadingContent","searchHint","children","className"]);const p=["topbar",o].filter(Boolean).join(" "),v=e?e.length-1:-1;return f.jsxs("div",Y(R({ref:h,className:p},u),{children:[s&&f.jsx("div",{className:"topbar__leading",children:s}),f.jsx("div",{className:"topbar__breadcrumbs",children:e&&e.length>0&&f.jsx("nav",{className:"breadcrumbs","aria-label":"Breadcrumb",children:e.map((x,_)=>f.jsxs(ae.Fragment,{children:[_>0&&f.jsx("span",{className:"breadcrumbs__separator","aria-hidden":"true",children:"/"}),x.href?f.jsx("a",{href:x.href,className:"breadcrumbs__link","aria-current":_===v?"page":void 0,children:x.label}):x.onClick?f.jsx("button",{type:"button",className:"breadcrumbs__link breadcrumbs__link--button",onClick:x.onClick,"aria-current":_===v?"page":void 0,children:x.label}):f.jsx("span",{className:"breadcrumbs__link breadcrumbs__link--static","aria-current":_===v?"page":void 0,children:x.label})]},_))})}),f.jsxs("div",{className:"topbar__actions",children:[a&&f.jsxs("div",{className:"topbar__search-wrap",children:[f.jsx("input",{type:"search",placeholder:t,"aria-label":t,className:"topbar__search",onChange:x=>a(x.target.value)}),l&&f.jsx("span",{className:"topbar__search-hint",children:l})]}),c]})]}))});Hx.displayName="Topbar";const vk=ae.forwardRef((o,c)=>{var u=o,{tabs:e=[],activeTabId:t="",onSelectTab:a,className:s=""}=u,l=fe(u,["tabs","activeTabId","onSelectTab","className"]);const h=["tab-bar",s].filter(Boolean).join(" "),m=D.useRef([]),g=D.useCallback((p,v)=>{var x;const _=e.map((C,k)=>C.disabled?-1:k).filter(C=>C!==-1),S=_.indexOf(v);let w;p.key==="ArrowRight"?w=_[(S+1)%_.length]:p.key==="ArrowLeft"?w=_[(S-1+_.length)%_.length]:p.key==="Home"?w=_[0]:p.key==="End"&&(w=_[_.length-1]),w!==void 0&&(p.preventDefault(),(x=m.current[w])==null||x.focus(),a==null||a(e[w].id))},[e,a]);return f.jsx("div",Y(R({ref:c,className:h,role:"tablist"},l),{children:f.jsx("div",{className:"tab-bar__tabs",children:e.map((p,v)=>f.jsxs("button",{type:"button",ref:x=>{m.current[v]=x},role:"tab","aria-selected":t===p.id,"aria-disabled":p.disabled,tabIndex:p.disabled?-1:t===p.id?0:-1,className:["tab-bar__tab",t===p.id?"tab-bar__tab--active":"",p.disabled?"tab-bar__tab--disabled":""].filter(Boolean).join(" "),onClick:()=>!p.disabled&&(a==null?void 0:a(p.id)),onKeyDown:x=>g(x,v),children:[f.jsx("span",{className:"tab-bar__tab-label",children:p.label}),p.count!==void 0&&f.jsx(wn,{form:"id-tag",children:p.count})]},p.id))})}))});vk.displayName="TabBar";const $x=ae.forwardRef((h,u)=>{var m=h,{left:e,center:t,right:a,className:s="",role:l="banner","aria-label":c="Application titlebar"}=m,o=fe(m,["left","center","right","className","role","aria-label"]);const g=["titlebar",s].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:u,className:g,role:l,"aria-label":c},o),{children:[e&&f.jsx("div",{className:"titlebar__slot titlebar__slot--left",children:e}),t&&f.jsx("div",{className:"titlebar__slot titlebar__slot--center",children:t}),a&&f.jsx("div",{className:"titlebar__slot titlebar__slot--right",children:a})]}))});$x.displayName="Titlebar";const bk=e=>typeof e=="object"&&e!==null&&"kind"in e,xk=e=>e.map((t,a)=>{switch(t.kind){case"divider":return f.jsx("div",{className:"statusbar__divider"},a);case"pulse":return f.jsxs("div",{className:"statusbar__item statusbar__item--pulse",children:[f.jsx("div",{className:`statusbar__pulse statusbar__pulse--${t.tone}`}),t.mono?f.jsx("span",{className:"statusbar__label statusbar__label--mono",children:t.label}):f.jsx("span",{className:"statusbar__label",children:t.label})]},a);case"icon":return f.jsxs("div",{className:`statusbar__item ${t.mono?"statusbar__item--mono":""}`,"aria-label":t.label,children:[f.jsx(Ce,{name:t.icon,size:14}),t.label&&f.jsx("span",{className:"statusbar__label",children:t.label})]},a);default:return t}}),yp=ae.forwardRef((o,c)=>{var u=o,{left:e,center:t,right:a,className:s=""}=u,l=fe(u,["left","center","right","className"]);const h=["statusbar",s].filter(Boolean).join(" "),m=g=>g?Array.isArray(g)&&g.length>0&&bk(g[0])?xk(g):g:null;return f.jsxs("div",Y(R({ref:c,role:"status",className:h},l),{children:[e&&f.jsx("div",{className:"statusbar__slot statusbar__slot--left statusbar__left",children:m(e)}),t&&f.jsx("div",{className:"statusbar__slot statusbar__slot--center",children:m(t)}),a&&f.jsx("div",{className:"statusbar__slot statusbar__slot--right statusbar__right",children:m(a)})]}))});yp.displayName="Statusbar";const _k=ae.forwardRef((m,h)=>{var g=m,{titlebar:e,appTitle:t,topbar:a,sidebar:s,statusbar:l,children:c,className:o=""}=g,u=fe(g,["titlebar","appTitle","topbar","sidebar","statusbar","children","className"]);const p=["shell-layout",o].filter(Boolean).join(" "),U=e!=null?e:{},{hide:v}=U,x=fe(U,["hide"]),_=e&&!e.hide,F=t!=null?t:{},{hide:S}=F,w=fe(F,["hide"]),C=t&&!t.hide,$=a!=null?a:{},{hide:k}=$,j=fe($,["hide"]),E=a&&!a.hide,V=s!=null?s:{},{hide:O}=V,z=fe(V,["hide"]),I=s&&!s.hide,K=l!=null?l:{},{hide:B}=K,q=fe(K,["hide"]),A=l&&!l.hide;return f.jsxs("div",Y(R({ref:h,className:p},u),{children:[_&&f.jsx($x,R({},x)),f.jsxs("div",{className:"shell-layout__main",children:[I?f.jsx("div",{className:"shell-layout__sidebar-col",children:f.jsx(Fx,Y(R({},z),{appTitle:C?w:z.appTitle}))}):C?f.jsx(gp,R({},w)):null,f.jsxs("div",{className:"shell-layout__content",children:[E&&f.jsx(Hx,R({},j)),f.jsx("main",{className:"shell-layout__canvas",children:c})]})]}),A&&f.jsx(yp,R({},q))]}))});_k.displayName="ShellLayout";const Sk=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'];function ed(e,t,a){var c;const s=D.useRef(null),l=(c=a==null?void 0:a.mode)!=null?c:"modal";D.useEffect(()=>{if(!t||!e.current)return;s.current=document.activeElement;const o=()=>e.current?Array.from(e.current.querySelectorAll(Sk.join(","))):[],u=m=>{if(m.key!=="Tab")return;const g=o();if(g.length===0)return;const p=g[0],v=g[g.length-1];m.shiftKey?document.activeElement===p&&(m.preventDefault(),v.focus()):document.activeElement===v&&(m.preventDefault(),p.focus())},h=o();return h.length>0&&l==="modal"&&h[0].focus(),e.current.addEventListener("keydown",u),()=>{var m;(m=e.current)==null||m.removeEventListener("keydown",u);const g=s.current;g&&document.body.contains(g)&&g.focus()}},[e,t,l])}let ou=0,cu=null;function vp(e){D.useEffect(()=>{if(e)return ou===0&&(cu=document.body.style.overflow,document.body.style.overflow="hidden"),ou++,()=>{ou--,ou===0&&cu!==null&&(document.body.style.overflow=cu,cu=null)}},[e])}const bp=ae.forwardRef((p,g)=>{var v=p,{isOpen:e,onClose:t,title:a,subtitle:s,children:l,footer:c,hintFooter:o,size:u="md",className:h=""}=v,m=fe(v,["isOpen","onClose","title","subtitle","children","footer","hintFooter","size","className"]);const x=ae.useId(),_=D.useRef(null),S=D.useRef(null);D.useImperativeHandle(g,()=>S.current),ed(S,e),vp(e),D.useEffect(()=>{const C=k=>{k.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e,t]);const w=C=>{C.target===_.current&&t()};return e?f.jsx("div",{ref:_,className:"modal-backdrop",onClick:w,children:f.jsxs("div",Y(R({ref:S,className:["modal",`modal--${u}`,h].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":a?x:void 0},m),{children:[a&&f.jsxs("div",{className:"modal__header",children:[f.jsxs("div",{className:"modal__header-text",children:[f.jsx("div",{id:x,className:"modal__title",children:a}),s&&f.jsx("div",{className:"modal__subtitle",children:s})]}),f.jsx("button",{type:"button",className:"modal__close",onClick:t,"aria-label":"Close dialog",children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsx("div",{className:"modal__body",children:l}),c&&f.jsx("div",{className:"modal__footer",children:c}),o&&f.jsx("div",{className:"modal__foot-hint",children:o})]}))}):null});bp.displayName="Modal";const Px=ae.forwardRef(({isOpen:e,onClose:t,onConfirm:a,title:s,subtitle:l,message:c,confirmLabel:o="Confirm",cancelLabel:u="Cancel",variant:h="danger"},m)=>f.jsxs(bp,{ref:m,isOpen:e,onClose:t,title:s,subtitle:l,children:[f.jsx("div",{className:"confirm-dialog__message",children:c}),f.jsxs("div",{className:"confirm-dialog__footer",children:[f.jsx(an,{variant:"ghost",size:"sm",onClick:t,children:u}),f.jsx(an,{variant:h,size:"sm",onClick:a,children:o})]})]}));Px.displayName="ConfirmDialog";function Hh({icon:e,title:t,description:a,onClick:s}){return f.jsxs("button",{type:"button",className:"workspace-switcher-dialog__action-tile",onClick:s,children:[f.jsx("div",{className:"workspace-switcher-dialog__action-icon",children:f.jsx(Ce,{name:e,size:20})}),f.jsx("div",{className:"workspace-switcher-dialog__action-title",children:t}),f.jsx("div",{className:"workspace-switcher-dialog__action-desc",children:a})]})}const wk=ae.forwardRef(({isOpen:e,onClose:t,title:a="Switch Workspace",current:s,recent:l=[],onOpenFolder:c,onNewWorkspace:o,onCloneFromGit:u,onPickRecent:h},m)=>f.jsx(bp,{ref:m,isOpen:e,onClose:t,title:a,size:"lg",children:f.jsxs("div",{className:"workspace-switcher-dialog__content",children:[(c||o||u)&&f.jsxs("div",{className:"workspace-switcher-dialog__tiles",children:[c&&f.jsx(Hh,{icon:"folder",title:"Open folder…",description:"Point to an existing workspace directory",onClick:c}),o&&f.jsx(Hh,{icon:"plus",title:"New workspace…",description:"Initialize a fresh local workspace",onClick:o}),u&&f.jsx(Hh,{icon:"gitBranch",title:"Clone from git…",description:"Pull a workspace from a remote repository",onClick:u})]}),l.length>0&&f.jsxs("div",{className:"workspace-switcher-dialog__recent",children:[f.jsx("div",{className:"workspace-switcher-dialog__recent-header",children:"Recent"}),f.jsx("div",{className:"workspace-switcher-dialog__recent-list",children:l.map(g=>{const p=(s==null?void 0:s.id)===g.id;return f.jsxs("button",{type:"button",className:`workspace-switcher-dialog__recent-item ${p?"workspace-switcher-dialog__recent-item--current":""}`,"aria-current":p?!0:void 0,onClick:()=>h(g),children:[f.jsxs("div",{className:"workspace-switcher-dialog__recent-main",children:[f.jsx("span",{className:"workspace-switcher-dialog__recent-name",children:g.name}),p&&f.jsx("span",{className:"workspace-switcher-dialog__open-badge",children:"open"})]}),f.jsxs("div",{className:"workspace-switcher-dialog__recent-meta",children:[g.path&&f.jsx("span",{className:"workspace-switcher-dialog__recent-path",children:g.path}),(g.classCount!=null||g.individualCount!=null)&&f.jsxs("span",{className:"workspace-switcher-dialog__recent-stats",children:[g.classCount!=null&&`${g.classCount} cls`,g.classCount!=null&&g.individualCount!=null&&" · ",g.individualCount!=null&&`${g.individualCount} ind`]})]})]},g.id)})})]})]})}));wk.displayName="WorkspaceSwitcherDialog";const qx=D.createContext(void 0);function td(){const e=D.useContext(qx);if(!e)throw new Error("FilterDropdown components must be used within FilterDropdown");return e}const Vx=ae.forwardRef(({mode:e="checkbox",children:t,onChange:a,className:s="",defaultValue:l,value:c,placement:o="bottom-start"},u)=>{const[h,m]=D.useState(!1),g=c!==void 0,[p,v]=D.useState(new Set(l!=null?l:[])),x=g?new Set(c):p,_=D.useRef(null),S=D.useRef(null),w=D.useRef(null),C=D.useCallback(()=>m(!1),[]),{focusedValue:k,setFocusedValue:j}=Ju({triggerRef:_,panelRef:S,isOpen:h,onClose:C}),E=D.useCallback(I=>{m(I)},[]),O=D.useCallback((I,B)=>{const q=new Set(x);B?(e==="radio"&&q.clear(),q.add(I)):q.delete(I),g||v(q),a==null||a(Array.from(q)),e==="radio"&&B&&m(!1)},[x,e,a,g]),z={isOpen:h,onOpenChange:E,mode:e,selectedValues:x,onValueChange:O,focusedValue:k,setFocusedValue:j,triggerRef:_,panelRef:S,placement:o};return f.jsx(qx.Provider,{value:z,children:f.jsx("div",{ref:I=>{w.current=I,typeof u=="function"?u(I):u&&(u.current=I)},className:`filter-dropdown ${s}`.trim(),children:t})})});Vx.displayName="FilterDropdown";function Ck(s){var l=s,{label:e,summary:t}=l,a=fe(l,["label","summary"]);const{isOpen:c,onOpenChange:o,triggerRef:u,mode:h}=td();return f.jsxs("button",Y(R({ref:u,type:"button"},a),{className:"filter-dropdown__trigger",onClick:()=>o(!c),"aria-haspopup":h==="radio"?"dialog":"listbox","aria-expanded":c,children:[f.jsx("span",{className:"filter-dropdown__label",children:e}),f.jsx("span",{className:"filter-dropdown__summary",children:t}),f.jsx(Ce,{name:"chevronDown",size:14,className:`filter-dropdown__chevron ${c?"filter-dropdown__chevron--open":""}`})]}))}function Nk(l){var c=l,{children:e,className:t="",style:a}=c,s=fe(c,["children","className","style"]);const{isOpen:o,mode:u,panelRef:h,placement:m}=td();return f.jsx("div",Y(R({ref:h,className:`dropdown-panel ${Wu(m)} filter-dropdown__panel ${t}`.trim(),role:u==="checkbox"?"listbox":"radiogroup","aria-multiselectable":u==="checkbox"?!0:void 0,hidden:!o,style:o?a:void 0},s),{children:e}))}function jk({title:e,children:t}){return f.jsxs("div",{className:"dropdown-section",children:[e&&f.jsx("div",{className:"dropdown-section-title",children:e}),f.jsx("div",{className:"filter-dropdown__section-content",children:t})]})}function Ek({value:e,label:t,description:a}){const{selectedValues:s,onValueChange:l,focusedValue:c,setFocusedValue:o,mode:u}=td(),h=D.useRef(null),m=s.has(e),g=c===e;return D.useEffect(()=>{var p;g&&((p=h.current)==null||p.focus())},[g]),f.jsxs("button",{ref:h,type:"button",role:u==="checkbox"?"option":void 0,"aria-selected":m,tabIndex:g?0:-1,"data-dropdown-item":e,onClick:()=>l(e,!m),onMouseEnter:()=>o(e),className:["dropdown-item",g&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"checkbox",className:"dropdown-item__checkbox",checked:m,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:t}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]})]})}function kk({value:e,label:t,description:a}){const{selectedValues:s,onValueChange:l,focusedValue:c,setFocusedValue:o}=td(),u=D.useRef(null),h=s.has(e),m=c===e;return D.useEffect(()=>{var g;m&&((g=u.current)==null||g.focus())},[m]),f.jsxs("button",{ref:u,type:"button",role:"radio","aria-checked":h,tabIndex:m?0:-1,"data-dropdown-item":e,onClick:()=>l(e,!0),onMouseEnter:()=>o(e),className:["dropdown-item",m&&"dropdown-item--focused"].filter(Boolean).join(" "),children:[f.jsx("span",{className:"dropdown-item__leading",children:f.jsx("input",{type:"radio",className:"dropdown-item__radio",checked:h,readOnly:!0,tabIndex:-1,"aria-hidden":"true"})}),f.jsxs("span",{className:"dropdown-item__body",children:[f.jsx("span",{className:"dropdown-item__label",children:t}),a&&f.jsx("span",{className:"dropdown-item__description",children:a})]})]})}Object.assign(Vx,{Trigger:Ck,Panel:Nk,Section:jk,Checkbox:Ek,Radio:kk});const Rk={success:"check",error:"x",warning:"alert",info:"info"},Tk={success:"emerald",error:"rose",warning:"amber",info:"cyan"},Gx=ae.forwardRef((g,m)=>{var p=g,{isOpen:e,onClose:t,title:a,subtitle:s,variant:l="info",icon:c,duration:o=4e3,className:u=""}=p,h=fe(p,["isOpen","onClose","title","subtitle","variant","icon","duration","className"]);if(D.useEffect(()=>{if(e&&o){const _=setTimeout(t,o);return()=>clearTimeout(_)}},[e,o,t]),!e)return null;const v=c||Rk[l],x=Tk[l];return f.jsxs("div",Y(R({ref:m,className:["toast",`toast--${l}`,u].filter(Boolean).join(" "),role:l==="error"||l==="warning"?"alert":"status","aria-live":l==="error"||l==="warning"?"assertive":"polite","aria-atomic":"true"},h),{children:[f.jsx("div",{className:`toast__icon toast__icon--${x}`,children:f.jsx(Ce,{name:v,size:12})}),f.jsxs("div",{className:"toast__content",children:[a&&f.jsx("div",{className:"toast__title",children:a}),s&&f.jsx("div",{className:"toast__subtitle",children:s})]}),f.jsx("button",{type:"button",className:"toast__close",onClick:t,"aria-label":"Dismiss notification",children:f.jsx(Ce,{name:"x",size:14})})]}))});Gx.displayName="Toast";const Mk=ae.forwardRef(({isOpen:e,onClose:t,commands:a=[],placeholder:s="Search commands…",emptyMessage:l="No commands found"},c)=>{const[o,u]=D.useState(""),[h,m]=D.useState(0),g=D.useRef(null),p=D.useRef(null),v=ae.useId(),x=ae.useId();D.useImperativeHandle(c,()=>p.current),ed(p,e),vp(e);const _=D.useMemo(()=>{const C=o.toLowerCase();return a.filter(k=>{var E;var j;return k.label.toLowerCase().includes(C)||((E=(j=k.description)==null?void 0:j.toLowerCase().includes(C))!=null?E:!1)})},[a,o]),S=D.useMemo(()=>{const C=[],k=new Map;return _.forEach((j,E)=>{k.has(j.group)||(k.set(j.group,[]),C.push(j.group)),k.get(j.group).push({cmd:j,index:E})}),C.map(j=>({name:j,items:k.get(j)}))},[_]);D.useEffect(()=>{e?setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0):(u(""),m(0))},[e]),D.useEffect(()=>{const C=k=>{e&&(k.key==="Escape"?t():k.key==="ArrowDown"?(k.preventDefault(),_.length>0&&m(j=>(j+1)%_.length)):k.key==="ArrowUp"?(k.preventDefault(),_.length>0&&m(j=>(j-1+_.length)%_.length)):k.key==="Enter"&&(k.preventDefault(),_[h]&&(_[h].onSelect(),t(),u(""))))};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,t,_,h]);const w=C=>{C.target===C.currentTarget&&t()};return e?f.jsx("div",{ref:p,className:"command-palette-backdrop",onClick:w,children:f.jsxs("div",{className:"command-palette",role:"dialog","aria-modal":"true","aria-labelledby":x,children:[f.jsx("span",{id:x,className:"command-palette__sr-title",children:"Command palette"}),f.jsxs("div",{className:"command-palette__header",children:[f.jsx(Ce,{name:"search",size:16}),f.jsx("input",{ref:g,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":v,"aria-activedescendant":_[h]?`${v}-${_[h].id}`:void 0,"aria-label":s,className:"command-palette__input",placeholder:s,value:o,onChange:C=>{u(C.target.value),m(0)}})]}),f.jsx("div",{id:v,role:"listbox",className:"command-palette__list",children:_.length===0?f.jsx("div",{className:"command-palette__empty",children:l}):S.map(C=>{var k;return f.jsxs("div",{className:"command-palette__group",role:"group",children:[C.name&&f.jsx("div",{className:"command-palette__group-header","aria-hidden":"true",children:C.name}),C.items.map(({cmd:j,index:E})=>f.jsxs("button",{type:"button",id:`${v}-${j.id}`,role:"option","aria-selected":E===h,className:["command-palette__item",E===h&&"command-palette__item--selected"].filter(Boolean).join(" "),onClick:()=>{j.onSelect(),t(),u("")},children:[j.icon&&f.jsx(Ce,{name:j.icon,size:16}),f.jsxs("div",{className:"command-palette__item-content",children:[f.jsx("div",{className:"command-palette__item-label",children:j.label}),j.description&&f.jsx("div",{className:"command-palette__item-description",children:j.description})]})]},j.id))]},(k=C.name)!=null?k:"__ungrouped")})})]})}):null});Mk.displayName="CommandPalette";const Kx=ae.forwardRef((g,m)=>{var p=g,{title:e,subtitle:t,headerAction:a,footer:s,bordered:l=!0,noPadding:c=!1,className:o="",children:u}=p,h=fe(p,["title","subtitle","headerAction","footer","bordered","noPadding","className","children"]);const v=["panel",!l&&"panel--no-border",o].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:m,className:v},h),{children:[(e||t||a)&&f.jsxs("div",{className:"panel__header",children:[f.jsxs("div",{className:"panel__header-left",children:[e&&f.jsx("div",{className:"panel__title",children:e}),t&&f.jsx("div",{className:"panel__subtitle",children:t})]}),a&&f.jsx("div",{className:"panel__header-action",children:a})]}),u!=null&&f.jsx("div",{className:c?"panel__body panel__body--no-padding":"panel__body",children:u}),s&&f.jsx("div",{className:"panel__footer",children:s})]}))});Kx.displayName="Panel";const Ak=ae.forwardRef((m,h)=>{var g=m,{isOpen:e,onClose:t,title:a,position:s="right",width:l="320px",children:c,className:o=""}=g,u=fe(g,["isOpen","onClose","title","position","width","children","className"]);const p=ae.useId(),v=D.useRef(null);D.useImperativeHandle(h,()=>v.current),ed(v,e),vp(e),D.useEffect(()=>{const _=S=>{S.key==="Escape"&&e&&t()};if(e)return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[e,t]);const x=_=>{_.target===_.currentTarget&&t()};return e?f.jsx("div",{className:"drawer-backdrop",onClick:x,children:f.jsxs("div",Y(R({ref:v,className:["drawer",`drawer--${s}`,o].filter(Boolean).join(" "),style:{width:l},role:"dialog","aria-modal":"true","aria-labelledby":a?p:void 0},u),{children:[f.jsxs("div",{className:["drawer__header",a?"":"drawer__header--no-title"].filter(Boolean).join(" "),children:[a&&f.jsx("h2",{id:p,className:"drawer__title",children:a}),f.jsx("button",{type:"button",className:"drawer__close",onClick:t,"aria-label":"Close drawer",children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsx("div",{className:"drawer__body",children:c})]}))}):null});Ak.displayName="Drawer";const Dk=ae.forwardRef((v,p)=>{var x=v,{direction:e="horizontal",initialSplitPercent:t=50,splitPercent:a,onSplitChange:s,minSize:l=200,maxSize:c=800,first:o,second:u,dividerLabel:h,className:m=""}=x,g=fe(x,["direction","initialSplitPercent","splitPercent","onSplitChange","minSize","maxSize","first","second","dividerLabel","className"]);const[_,S]=D.useState(t),w=D.useRef(null),C=a!==void 0,k=C?a:_,j=D.useCallback((q,A)=>{const U=l/A*100,F=c/A*100;return Math.max(U,Math.min(q,F))},[l,c]),E=D.useCallback(q=>{C||S(q),s==null||s(q)},[C,s]),O=D.useCallback(q=>A=>{q.forEach(U=>{typeof U=="function"?U(A):U&&(U.current=A)})},[]),z=D.useCallback(()=>{const q=U=>{if(!w.current)return;const F=w.current.getBoundingClientRect(),$=e==="horizontal",V=$?U.clientX-F.left:U.clientY-F.top,K=$?F.width:F.height,H=V/K*100;E(j(H,K))},A=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",q),document.addEventListener("mouseup",A)},[e,j,E]),I=D.useCallback(q=>{if(!w.current)return;const A=q.shiftKey?10:2,U=e==="horizontal",F=w.current.getBoundingClientRect(),$=U?F.width:F.height;q.key==="ArrowLeft"||q.key==="ArrowUp"?(q.preventDefault(),E(j(k-A,$))):(q.key==="ArrowRight"||q.key==="ArrowDown")&&(q.preventDefault(),E(j(k+A,$)))},[e,k,j,E]),B=["split-pane",`split-pane--${e}`,m].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:O([w,p]),className:B},g),{children:[f.jsx("div",{className:"split-pane__first",style:e==="horizontal"?{width:`${k}%`}:{height:`${k}%`},children:o}),f.jsx("div",{role:"separator","aria-orientation":e==="horizontal"?"vertical":"horizontal","aria-valuenow":Math.round(k),"aria-valuemin":0,"aria-valuemax":100,"aria-label":h!=null?h:e==="horizontal"?"Horizontal divider":"Vertical divider",tabIndex:0,className:`split-pane__divider split-pane__divider--${e}`,onMouseDown:z,onKeyDown:I}),f.jsx("div",{className:"split-pane__second",style:e==="horizontal"?{width:`${100-k}%`}:{height:`${100-k}%`},children:u})]}))});Dk.displayName="SplitPane";const Qx=D.createContext(void 0),Yx=()=>{const e=D.useContext(Qx);if(!e)throw new Error("InspectorPanel.Section must be used within an InspectorPanel");return e},Xx=ae.forwardRef((u,o)=>{var h=u,{title:e,count:t,actions:a,children:s,className:l=""}=h,c=fe(h,["title","count","actions","children","className"]);Yx();const m=["inspector-panel__section",l].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:o,className:m},c),{children:[f.jsxs("div",{className:"inspector-panel__section-header",children:[f.jsxs("div",{className:"inspector-panel__section-title",children:[f.jsx("span",{children:e}),t!==void 0&&f.jsxs("span",{className:"inspector-panel__section-count",children:["· ",t]})]}),a&&f.jsx("div",{className:"inspector-panel__section-actions",children:a})]}),s&&f.jsx("div",{className:"inspector-panel__section-content",children:s})]}))});Xx.displayName="InspectorPanel.Section";const Zx=ae.forwardRef((m,h)=>{var g=m,{title:e,count:t,actionIcon:a,actionLabel:s,onAction:l,rows:c,className:o=""}=g,u=fe(g,["title","count","actionIcon","actionLabel","onAction","rows","className"]);Yx();const p=["inspector-panel__property-section",o].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:h,className:p},u),{children:[f.jsxs("div",{className:"inspector-panel__property-section-header",children:[f.jsx("span",{className:"inspector-panel__property-section-title",children:e}),t!==void 0&&f.jsx("span",{className:"inspector-panel__property-section-count",children:t}),l&&f.jsx("button",{className:"inspector-panel__property-section-action",onClick:l,type:"button","aria-label":s,children:a})]}),c.length>0&&f.jsx("div",{className:"inspector-panel__property-rows",children:c.map(v=>f.jsxs("div",{className:"inspector-panel__property-row",children:[f.jsx("span",{className:"inspector-panel__property-key",children:v.key}),f.jsx("span",{className:"inspector-panel__property-value",children:v.value}),v.usageCount!==void 0&&f.jsxs("span",{className:"inspector-panel__property-usage",children:["used ",v.usageCount]})]},v.key))})]}))});Zx.displayName="InspectorPanel.PropertySection";const Jx=ae.forwardRef((m,h)=>{var g=m,{eyebrow:e="",title:t,id:a,version:s,actions:l,children:c,className:o=""}=g,u=fe(g,["eyebrow","title","id","version","actions","children","className"]);const p=["inspector-panel",o].filter(Boolean).join(" ");return f.jsx(Qx.Provider,{value:!0,children:f.jsxs("div",Y(R({ref:h,className:p},u),{children:[f.jsxs("div",{className:"inspector-panel__head",children:[e&&f.jsx("div",{className:"inspector-panel__eyebrow",children:e}),f.jsx("div",{className:"inspector-panel__title",children:t}),f.jsxs("div",{className:"inspector-panel__id-version",children:[f.jsx("span",{className:"inspector-panel__id",children:a}),s!==void 0&&f.jsx(On,{children:s})]}),l&&f.jsx("div",{className:"inspector-panel__actions",children:l})]}),f.jsx("div",{className:"inspector-panel__body",children:c})]}))})});Jx.displayName="InspectorPanel";Object.assign(Jx,{Section:Xx,PropertySection:Zx});const Lk=ae.forwardRef((o,c)=>{var u=o,{rows:e=[],keyWidth:t,className:a="",style:s}=u,l=fe(u,["rows","keyWidth","className","style"]);const h=["kv-grid",a].filter(Boolean).join(" "),m=t?Y(R({},s),{gridTemplateColumns:`${typeof t=="number"?`${t}px`:t} 1fr`}):s;return f.jsx("dl",Y(R({ref:c,className:h,style:m},l),{children:e.map(g=>f.jsxs(ae.Fragment,{children:[f.jsx("dt",{className:"kv-grid__key",children:g.key}),f.jsx("dd",{className:"kv-grid__value",children:g.value})]},g.key))}))});Lk.displayName="KVGrid";const Ok=ae.forwardRef((h,u)=>{var m=h,{label:e,width:t,height:a,viewBox:s,className:l="",children:c}=m,o=fe(m,["label","width","height","viewBox","className","children"]);return f.jsx("svg",Y(R({ref:u,role:"img","aria-label":e,width:t,height:a,viewBox:s,className:l,style:{display:"block"}},o),{children:c}))});Ok.displayName="ChartWrapper";const Zr=["#22D3EE","#10B981","#F59E0B","#818CF8","#8B5CF6","#F43F5E"],Tb=Zr,Gi={light:{fg1:"#0B1220",fg2:"#475569",fg3:"#64748B",fg4:"#94A3B8",grid:"#EEF1F4",border:"#E5E9EE",card:"#FFFFFF",inset:"#F7F9FB"},dark:{fg1:"#E2E8F0",fg2:"#94A3B8",fg3:"#64748B",fg4:"#475569",grid:"#1B2949",border:"#243763",card:"#1B2949",inset:"#13203A"}};function Jr(e){return Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":Number.isInteger(e)?String(e):e.toFixed(1)}const Mb="#F59E0B",zk="#B45309",Ik="#1B2949",Uk="#2A3A5C",Bk="#E6EDF3",Fk="#A6B1BD",Hk=ae.forwardRef((k,C)=>{var j=k,{series:e,colors:t,xLabels:a,width:s=480,height:l=200,area:c=!1,axes:o=!1,grid:u=!1,ticks:h=4,threshold:m,markers:g,tooltip:p=!1,tone:v="light",padding:x,className:_="",style:S}=j,w=fe(j,["series","colors","xLabels","width","height","area","axes","grid","ticks","threshold","markers","tooltip","tone","padding","className","style"]);var M;const E=Gi[v],O=ae.useId(),z=t!=null?t:e.length===1?[Zr[0]]:Zr,I=R({top:8,right:p?12:8,bottom:o?22:6,left:o?30:6},x),B=s-I.left-I.right,q=l-I.top-I.bottom,A=e.flat();if(A.length===0)return null;let U=Math.min(...A),F=Math.max(...A);const $=F-U||1;U-=$*.08,F+=$*.08,m&&(U=Math.min(U,m.value),F=Math.max(F,m.value));const V=Math.max(...e.map(se=>se.length)),K=se=>I.left+(V<=1?B/2:se/(V-1)*B),H=se=>I.top+q-(se-U)/(F-U)*q,X=[];for(let se=0;se<=h;se++)X.push(U+se/h*(F-U));const[P,re]=ae.useState(null);function T(se){const pe=se.currentTarget.getBoundingClientRect(),ge=(se.clientX-pe.left)/pe.width*s,Se=Math.max(0,Math.min(V-1,Math.round((ge-I.left)/B*(V-1))));re(Se)}function ce(se){return se.map(([pe,ge],Se)=>(Se?"L":"M")+pe.toFixed(2)+","+ge.toFixed(2)).join(" ")}const he=e.map(se=>se.map((pe,ge)=>[K(ge),H(pe)]));return f.jsxs("svg",Y(R({ref:C,width:s,height:l,viewBox:`0 0 ${s} ${l}`,className:_,role:"img","aria-label":(M=w["aria-label"])!=null?M:"Line chart",style:R({display:"block",cursor:p?"crosshair":"default"},S),onMouseMove:p?T:void 0,onMouseLeave:p?()=>re(null):void 0},w),{children:[u&&X.map((se,pe)=>f.jsx("line",{x1:I.left,x2:s-I.right,y1:H(se),y2:H(se),stroke:E.grid,strokeWidth:"1"},"g"+pe)),o&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:I.left,x2:I.left,y1:I.top,y2:I.top+q,stroke:E.border,strokeWidth:"1"}),f.jsx("line",{x1:I.left,x2:s-I.right,y1:I.top+q,y2:I.top+q,stroke:E.border,strokeWidth:"1"}),X.map((se,pe)=>f.jsx("text",{x:I.left-6,y:H(se)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:E.fg3,children:Jr(se)},"yt"+pe)),a&&a.map((se,pe)=>f.jsx("text",{x:K(pe),y:I.top+q+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:E.fg3,children:se},"xt"+pe))]}),m&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:I.left,x2:s-I.right,y1:H(m.value),y2:H(m.value),stroke:E.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),m.label&&f.jsx("text",{x:s-I.right-4,y:H(m.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:E.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:m.label})]}),g&&g.map((se,pe)=>f.jsxs("g",{children:[f.jsx("line",{x1:K(se.x),x2:K(se.x),y1:I.top-2,y2:I.top+q,stroke:Mb,strokeWidth:"1",strokeDasharray:"2 2"}),f.jsx("circle",{cx:K(se.x),cy:I.top+4,r:"3",fill:Mb}),se.label&&f.jsx("text",{x:K(se.x)+6,y:I.top+7,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:zk,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:se.label})]},"mk"+pe)),he.map((se,pe)=>{const ge=z[pe%z.length],Se=ce(se),xe=`${Se} L${se[se.length-1][0].toFixed(2)},${I.top+q} L${se[0][0].toFixed(2)},${I.top+q} Z`,Ue=`${O}-lg${pe}`;return f.jsxs("g",{children:[c&&f.jsxs(f.Fragment,{children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:Ue,x1:"0",y1:"0",x2:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:ge,stopOpacity:"0.22"}),f.jsx("stop",{offset:"100%",stopColor:ge,stopOpacity:"0"})]})}),f.jsx("path",{d:xe,fill:`url(#${Ue})`})]}),f.jsx("path",{d:Se,stroke:ge,strokeWidth:p?1.75:1.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]},"s"+pe)}),p&&P!==null&&(()=>{const se=18+e.length*16;let pe=K(P)+10;pe+132>s-4&&(pe=K(P)-132-10);const ge=I.top+4;return f.jsxs("g",{children:[f.jsx("line",{x1:K(P),x2:K(P),y1:I.top,y2:I.top+q,stroke:E.fg3,strokeWidth:"1",strokeDasharray:"2 3"}),e.map((Se,xe)=>Se[P]!=null&&f.jsx("circle",{cx:K(P),cy:H(Se[P]),r:"3",fill:E.card,stroke:z[xe%z.length],strokeWidth:"1.75"},"h"+xe)),f.jsx("rect",{x:pe,y:ge,width:132,height:se,rx:"6",fill:Ik,stroke:Uk}),f.jsx("text",{x:pe+9,y:ge+13,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:Fk,style:{textTransform:"uppercase",letterSpacing:"0.10em"},children:a?a[P]:`t${P}`}),e.map((Se,xe)=>f.jsxs("g",{children:[f.jsx("rect",{x:pe+9,y:ge+22+xe*16,width:"6",height:"6",rx:"1",fill:z[xe%z.length]}),f.jsx("text",{x:pe+20,y:ge+28+xe*16,fontFamily:"JetBrains Mono, monospace",fontSize:"10.5",fill:Bk,children:Se[P]!=null?Jr(Se[P]):"—"})]},"tt"+xe))]})})()]}))});Hk.displayName="LineChart";const $k=ae.forwardRef((x,v)=>{var _=x,{series:e,xLabels:t=[],yMin:a,yMax:s,yTickCount:l=5,legend:c=!1,width:o=400,height:u=200,tone:h="light",ariaLabel:m,className:g=""}=_,p=fe(_,["series","xLabels","yMin","yMax","yTickCount","legend","width","height","tone","ariaLabel","className"]);const S=Gi[h],w=X=>f.jsx("div",Y(R({ref:v,className:g,style:{width:o,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:S.fg3,fontSize:"12px"}},p),{children:X}));if(!e||e.length===0)return w("No data");let C=1/0,k=-1/0,j=0;if(e.forEach(X=>{if(X.data&&X.data.length>0){X.data.length>j&&(j=X.data.length);for(let P=0;P<X.data.length;P++){const re=X.data[P];re<C&&(C=re),re>k&&(k=re)}}}),j===0)return w("No data");const E=isFinite(C)&&isFinite(k),O=a!==void 0?a:E?Math.min(0,C):0,z=(s!==void 0?s:E?k:1)-O||1,I={top:8,right:10,bottom:22,left:36},B=o-I.left-I.right,q=u-I.top-I.bottom,A=X=>I.top+q-(X-O)/z*q,U=A(Math.max(O,0)),F=Array.from({length:l},(X,P)=>{const re=l===1?1:l-1,T=O+z*P/re;return{value:T,y:A(T)}}),$=B/j,V=$*.18,K=Math.max(1,($-V*2)/e.length),H=(X,P)=>X.color?To[X.color]:Tb[P%Tb.length];return f.jsxs("div",Y(R({ref:v,style:{display:"flex",flexDirection:"column",gap:"8px"},className:g},p),{children:[f.jsxs("svg",{role:"img","aria-label":m!=null?m:e.map(X=>X.name).join(", "),width:o,height:u,viewBox:`0 0 ${o} ${u}`,style:{display:"block"},children:[m&&f.jsx("title",{children:m}),F.map((X,P)=>f.jsxs("g",{children:[f.jsx("line",{x1:I.left,x2:o-I.right,y1:X.y,y2:X.y,stroke:S.grid,strokeWidth:"1"}),f.jsx("text",{x:I.left-6,y:X.y+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:Jr(X.value)})]},`y-${P}`)),f.jsx("line",{x1:I.left,x2:I.left,y1:I.top,y2:I.top+q,stroke:S.border,strokeWidth:"1"}),f.jsx("line",{x1:I.left,x2:o-I.right,y1:I.top+q,y2:I.top+q,stroke:S.border,strokeWidth:"1"}),e.map((X,P)=>{const re=H(X,P);return f.jsx("g",{children:X.data.map((T,ce)=>{const he=I.left+ce*$+V+P*K,M=A(T),se=Math.min(M,U),pe=Math.abs(U-M);return f.jsx("rect",{x:he,y:se,width:Math.max(1,K-1),height:Math.max(0,pe),fill:re,rx:"1"},`bar-${P}-${ce}`)})},`series-${P}`)}),t.map((X,P)=>f.jsx("text",{x:I.left+(P+.5)*$,y:I.top+q+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:X},`x-${P}`))]}),c&&f.jsx("div",{style:{display:"flex",gap:"12px",fontSize:"12px",flexWrap:"wrap",color:S.fg2},children:e.map((X,P)=>f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[f.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"1px",backgroundColor:H(X,P)}}),f.jsx("span",{children:X.name})]},`legend-${P}`))})]}))});$k.displayName="BarChart";const Pk=ae.forwardRef((S,_)=>{var w=S,{values:e,xLabels:t,color:a,width:s=480,height:l=200,axes:c=!1,grid:o=!1,ticks:u=4,threshold:h,tone:m="light",label:g,className:p="",style:v}=w,x=fe(w,["values","xLabels","color","width","height","axes","grid","ticks","threshold","tone","label","className","style"]);const C=Gi[m],k=a!=null?a:Zr[2],j={top:8,right:8,bottom:c?22:6,left:c?30:6},E=s-j.left-j.right,O=l-j.top-j.bottom;if(!e||e.length===0)return null;const z=Math.max(...e,h?h.value:0),I=e.length,B=Math.max(2,E/I*.22),q=(E-B*(I-1))/I,A=F=>j.top+O-F/(z||1)*O,U=[];for(let F=0;F<=u;F++)U.push(F/u*z);return f.jsxs("svg",Y(R({ref:_,role:"img","aria-label":g,width:s,height:l,viewBox:`0 0 ${s} ${l}`,className:p,style:R({display:"block"},v)},x),{children:[o&&U.map((F,$)=>f.jsx("line",{x1:j.left,x2:s-j.right,y1:A(F),y2:A(F),stroke:C.grid,strokeWidth:"1"},"g"+$)),c&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:j.left,x2:j.left,y1:j.top,y2:j.top+O,stroke:C.border,strokeWidth:"1"}),f.jsx("line",{x1:j.left,x2:s-j.right,y1:j.top+O,y2:j.top+O,stroke:C.border,strokeWidth:"1"}),U.map((F,$)=>f.jsx("text",{x:j.left-6,y:A(F)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:C.fg3,children:Jr(F)},"yt"+$))]}),e.map((F,$)=>{const V=j.left+$*(q+B),K=A(F);return f.jsxs("g",{children:[f.jsx("rect",{x:V,y:K,width:q,height:j.top+O-K,fill:k,rx:"1"}),c&&t&&t[$]!==void 0&&f.jsx("text",{x:V+q/2,y:j.top+O+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:C.fg3,children:t[$]})]},$)}),h&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:j.left,x2:s-j.right,y1:A(h.value),y2:A(h.value),stroke:C.fg3,strokeWidth:"1",strokeDasharray:"3 3"}),h.label&&f.jsx("text",{x:s-j.right-4,y:A(h.value)-4,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:C.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:h.label})]})]}))});Pk.displayName="BarV";const qk="#22D3EE",Vk=ae.forwardRef((v,p)=>{var x=v,{items:e,width:t=320,height:a=200,tone:s="light",showValues:l=!0,valueFormat:c,maxValue:o,label:u,className:h="",style:m}=x,g=fe(x,["items","width","height","tone","showValues","valueFormat","maxValue","label","className","style"]);const _=Gi[s],S={top:4,right:36,bottom:4,left:92},w=t-S.left-S.right,C=a-S.top-S.bottom;if(!e||e.length===0)return null;const k=o!=null?o:Math.max(...e.map(z=>z.value)),j=C/e.length,E=Math.min(j*.62,14),O=c!=null?c:Jr;return f.jsx("svg",Y(R({ref:p,role:"img","aria-label":u!=null?u:"Horizontal bar chart",width:t,height:a,viewBox:`0 0 ${t} ${a}`,className:h,style:R({display:"block"},m)},g),{children:e.map((z,I)=>{var U;const B=S.top+I*j+(j-E)/2,q=z.value/(k||1)*w,A=(U=z.color)!=null?U:qk;return f.jsxs("g",{children:[f.jsx("text",{x:S.left-10,y:B+E*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,children:z.label}),f.jsx("rect",{x:S.left,y:B,width:w,height:E,fill:_.inset,rx:"2"}),f.jsx("rect",{x:S.left,y:B,width:q,height:E,fill:A,rx:"2"}),l&&f.jsx("text",{x:S.left+q+6,y:B+E*.78,fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:_.fg2,fontWeight:"500",children:O(z.value)})]},z.label)})}))});Vk.displayName="BarH";const Gk=ae.forwardRef((_,x)=>{var S=_,{stacks:e,colors:t,width:a=480,height:s=200,axes:l=!1,grid:c=!1,ticks:o=4,normalized:u=!1,tone:h="light",label:m="Stacked bar chart",className:g="",style:p}=S,v=fe(S,["stacks","colors","width","height","axes","grid","ticks","normalized","tone","label","className","style"]);const w=Gi[h],C=t!=null?t:Zr,k={top:8,right:8,bottom:l?22:6,left:l?30:6},j=a-k.left-k.right,E=s-k.top-k.bottom;if(!e||e.length===0)return null;const O=e.map(F=>F.parts.reduce(($,V)=>$+V,0)),z=u?1:Math.max(...O),I=e.length,B=Math.max(2,j/I*.22),q=(j-B*(I-1))/I,A=[];for(let F=0;F<=o;F++)A.push(F/o*z);const U=F=>k.top+E-F/(z||1)*E;return f.jsxs("svg",Y(R({ref:x,role:"img","aria-label":m,width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:g,style:R({display:"block"},p)},v),{children:[c&&A.map((F,$)=>f.jsx("line",{x1:k.left,x2:a-k.right,y1:U(F),y2:U(F),stroke:w.grid,strokeWidth:"1"},"g"+$)),l&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:k.left,x2:k.left,y1:k.top,y2:k.top+E,stroke:w.border,strokeWidth:"1"}),f.jsx("line",{x1:k.left,x2:a-k.right,y1:k.top+E,y2:k.top+E,stroke:w.border,strokeWidth:"1"}),A.map((F,$)=>f.jsx("text",{x:k.left-6,y:U(F)+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,children:u?`${Math.round(F*100)}%`:Jr(F)},"yt"+$))]}),e.map((F,$)=>{const V=k.left+$*(q+B),K=O[$]||1;let H=0;return f.jsxs("g",{children:[F.parts.map((X,P)=>{const re=(u?X/K:X)/(z||1)*E,T=k.top+E-H-re;return H+=re,f.jsx("rect",{x:V,y:T,width:q,height:re,fill:C[P%C.length]},P)}),l&&f.jsx("text",{x:V+q/2,y:k.top+E+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,children:F.label})]},$)})]}))});Gk.displayName="StackedBar";const Kk=ae.forwardRef((_,x)=>{var S=_,{slices:e,colors:t,width:a=160,height:s=160,thickness:l=14,gap:c=.03,centerValue:o,centerLabel:u,"aria-label":h,tone:m="light",className:g="",style:p}=S,v=fe(S,["slices","colors","width","height","thickness","gap","centerValue","centerLabel","aria-label","tone","className","style"]);const w=Gi[m],C=t!=null?t:Zr;if(!e||e.length===0)return null;const k=a/2,j=s/2,E=Math.min(a,s)/2-4,O=E-l,z=e.reduce(($,V)=>$+V.value,0)||1;function I($,V){const K=Math.cos($),H=Math.sin($),X=Math.cos(V),P=Math.sin(V),re=V-$>Math.PI?1:0;return[`M ${k+E*K} ${j+E*H}`,`A ${E} ${E} 0 ${re} 1 ${k+E*X} ${j+E*P}`,`L ${k+O*X} ${j+O*P}`,`A ${O} ${O} 0 ${re} 0 ${k+O*K} ${j+O*H}`,"Z"].join(" ")}const B=e.length>1?c:0;let q=-Math.PI/2;const A=e.map(($,V)=>{var P;const K=$.value/z*Math.PI*2,H=q+B/2;let X=q+K-B/2;return X-H>=Math.PI*2-1e-6&&(X=H+Math.PI*2-1e-6),X<=H&&(X=H+1e-4),q+=K,{d:I(H,X),color:(P=$.color)!=null?P:C[V%C.length]}}),U=Math.min(a,s)*.22,F=j+Math.min(a,s)*.18;return f.jsxs("svg",Y(R({ref:x,role:"img","aria-label":h!=null?h:"Donut chart",width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:g,style:R({display:"block"},p)},v),{children:[A.map(($,V)=>f.jsx("path",{d:$.d,fill:$.color},V)),o!=null&&f.jsx("text",{x:k,y:j+1,textAnchor:"middle",fontFamily:"Inter, sans-serif",fontSize:U,fontWeight:"700",fill:w.fg1,style:{letterSpacing:"-0.02em",fontVariantNumeric:"tabular-nums"},children:o}),u!=null&&f.jsx("text",{x:k,y:F,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:w.fg3,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:u})]}))});Kk.displayName="Donut";const Qk=ae.forwardRef((x,v)=>{var _=x,{data:e,baseColor:t="#10B981",xLabels:a,yLabels:s,width:l=480,height:c=120,axes:o=!1,tone:u="light",ariaLabel:h,className:m="",style:g}=_,p=fe(_,["data","baseColor","xLabels","yLabels","width","height","axes","tone","ariaLabel","className","style"]);const S=Gi[u];if(!e||e.length===0)return null;const w=e.length,C=e[0].length,k={top:4,right:8,bottom:o?18:4,left:o?28:4},j=(l-k.left-k.right)/C,E=(c-k.top-k.bottom)/w,O=e.flat().filter(A=>A!=null),z=O.length?Math.min(...O):0,I=O.length?Math.max(...O):1,B=t.replace("#","");function q(A){if(A==null)return S.inset;const U=(A-z)/(I-z||1),F=Math.round((.12+U*.88)*255).toString(16).padStart(2,"0");return`#${B}${F}`}return f.jsxs("svg",Y(R({ref:v,role:"img","aria-label":h!=null?h:"Heatmap",width:l,height:c,viewBox:`0 0 ${l} ${c}`,className:m,style:R({display:"block"},g)},p),{children:[h&&f.jsx("title",{children:h}),e.map((A,U)=>A.map((F,$)=>f.jsx("rect",{x:k.left+$*j+1,y:k.top+U*E+1,width:Math.max(0,j-2),height:Math.max(0,E-2),fill:q(F),rx:"2"},`${U}-${$}`))),o&&s&&s.map((A,U)=>f.jsx("text",{x:k.left-6,y:k.top+U*E+E/2+3,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:S.fg3,children:A},"y"+U)),o&&a&&a.map((A,U)=>f.jsx("text",{x:k.left+U*j+j/2,y:c-k.bottom+12,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:S.fg3,children:A},"x"+U))]}))});Qk.displayName="Heatmap";const Yk="#B45309",$h={ok:"#10B981",warn:"#F59E0B",error:"#F43F5E",idle:"",info:"#22D3EE"},Xk=ae.forwardRef((x,v)=>{var _=x,{tracks:e,range:t=[0,100],width:a=480,height:s=160,axes:l=!1,xLabels:c,marker:o,tone:u="light","aria-label":h,className:m="",style:g}=_,p=fe(_,["tracks","range","width","height","axes","xLabels","marker","tone","aria-label","className","style"]);const S=Gi[u];if(!e||e.length===0)return null;const w={top:6,right:8,bottom:l?22:6,left:92},C=a-w.left-w.right,k=s-w.top-w.bottom,j=k/e.length,E=Math.min(j*.6,14),O=I=>w.left+(I-t[0])/(t[1]-t[0]||1)*C;function z(I){var B;return I==="idle"?S.border:(B=$h[I])!=null?B:I}return f.jsxs("svg",Y(R({ref:v,role:"img","aria-label":h,width:a,height:s,viewBox:`0 0 ${a} ${s}`,className:m,style:R({display:"block"},g)},p),{children:[e.map((I,B)=>{const q=w.top+B*j+(j-E)/2;return f.jsxs("g",{children:[f.jsx("text",{x:w.left-10,y:q+E*.78,textAnchor:"end",fontFamily:"JetBrains Mono, monospace",fontSize:"11",fill:S.fg2,children:I.label}),f.jsx("rect",{x:w.left,y:q,width:C,height:E,fill:S.inset,rx:"2"}),I.segments.map((A,U)=>f.jsx("rect",{x:O(A.start),y:q,width:Math.max(2,O(A.end)-O(A.start)),height:E,fill:z(A.kind),rx:"2"},U))]},B)}),l&&c&&c.map((I,B)=>f.jsx("text",{x:w.left+B/(c.length-1)*C,y:w.top+k+14,textAnchor:"middle",fontFamily:"JetBrains Mono, monospace",fontSize:"10",fill:S.fg3,children:I},"x"+B)),o&&f.jsxs(f.Fragment,{children:[f.jsx("line",{x1:O(o.x),x2:O(o.x),y1:w.top-2,y2:w.top+k+2,stroke:$h.warn,strokeWidth:"1",strokeDasharray:"2 2"}),f.jsx("circle",{cx:O(o.x),cy:w.top-2,r:"3",fill:$h.warn}),o.label&&f.jsx("text",{x:O(o.x)+6,y:w.top+2,fontFamily:"JetBrains Mono, monospace",fontSize:"9.5",fill:Yk,style:{textTransform:"uppercase",letterSpacing:"0.08em"},children:o.label})]})]}))});Xk.displayName="StatusTimeline";const xp=ae.forwardRef((u,o)=>{var h=u,{percent:e,color:t="emerald",height:a=6,label:s,className:l=""}=h,c=fe(h,["percent","color","height","label","className"]);const m=Number.isNaN(e)?0:Math.min(Math.max(e,0),100),g=`progress-bar--${t}`;return f.jsx("div",Y(R({ref:o,className:`progress-bar ${g} ${l}`.trim(),style:{height:`${a}px`},role:"progressbar","aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},c),{children:f.jsx("div",{className:"progress-bar__fill",style:{width:`${m}%`}})}))});xp.displayName="ProgressBar";const Zk=ae.forwardRef((p,g)=>{var v=p,{label:e,value:t,unit:a,percent:s,sparklineData:l=[],color:c="emerald",progressLabel:o,className:u="","aria-label":h}=v,m=fe(v,["label","value","unit","percent","sparklineData","color","progressLabel","className","aria-label"]);return f.jsxs("div",Y(R({ref:g,role:"row","aria-label":h!=null?h:e,className:`metric-row ${u}`.trim()},m),{children:[f.jsx("div",{className:"metric-row__label",children:e}),f.jsx("div",{className:"metric-row__progress",children:f.jsx(xp,{percent:s,color:c,height:6,label:o!=null?o:e})}),f.jsx("div",{className:"metric-row__sparkline",children:f.jsx(mp,{data:l,width:60,height:18,color:c})}),f.jsxs("div",{className:"metric-row__value",children:[t,a&&f.jsx("span",{className:"metric-row__unit",children:a})]})]}))});Zk.displayName="MetricRow";const _p=ae.forwardRef((h,u)=>{var m=h,{eyebrow:e,title:t,idChip:a,subtitle:s,actions:l,className:c=""}=m,o=fe(m,["eyebrow","title","idChip","subtitle","actions","className"]);const g=["page-header",c].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:u,className:g,role:"banner"},o),{children:[f.jsxs("div",{className:"page-header__text",children:[e&&f.jsx("div",{className:"page-header__eyebrow","data-testid":"page-header-eyebrow",children:e}),f.jsxs("h1",{className:"page-header__title","data-testid":"page-header-title",children:[t,a&&f.jsx(wn,{form:"id-tag",className:"page-header__id-chip","data-testid":"page-header-id-chip",children:a})]}),s&&f.jsx("div",{className:"page-header__subtitle","data-testid":"page-header-subtitle",children:s})]}),l&&f.jsx("div",{className:"page-header__actions","data-testid":"page-header-actions",children:l})]}))});_p.displayName="PageHeader";const Jk=ae.forwardRef((x,v)=>{var _=x,{filters:e=[],value:t,defaultValue:a="",onSearchChange:s,onFilterRemove:l,onClearAll:c,searchPlaceholder:o="Search...",children:u,showingCount:h,totalCount:m,className:g=""}=_,p=fe(_,["filters","value","defaultValue","onSearchChange","onFilterRemove","onClearAll","searchPlaceholder","children","showingCount","totalCount","className"]);const S=t!==void 0,[w,C]=D.useState(a),k=S?t:w,j=I=>{const B=I.target.value;S||C(B),s==null||s(B)},E=()=>{S||C(""),c==null||c()},O=["filter-bar",g].filter(Boolean).join(" "),z=ae.Children.count(u)>0;return f.jsxs("div",Y(R({ref:v,className:O,"data-testid":"filter-bar"},p),{children:[f.jsxs("div",{className:"filter-bar__controls",children:[f.jsxs("div",{className:"filter-bar__search-wrapper",role:"search",children:[f.jsx(Ce,{name:"search",size:16,className:"filter-bar__search-icon"}),f.jsx("input",{type:"text","aria-label":"Search",placeholder:o,value:k,onChange:j,className:"filter-bar__search-input","data-testid":"filter-bar-search"})]}),z&&f.jsx("div",{className:"filter-bar__children",children:u}),h!==void 0&&m!==void 0&&f.jsxs("div",{className:"filter-bar__caption",children:["Showing ",h," of ",m]})]}),e.length>0&&f.jsxs("div",{className:"filter-bar__chips","data-testid":"filter-bar-chips",children:[c&&f.jsx("button",{type:"button",className:"filter-bar__clear-all",onClick:E,"data-testid":"filter-bar-clear-all",children:"Clear all"}),e.map(I=>f.jsxs(wn,{variant:"neutral",className:"filter-bar__chip","data-testid":`filter-chip-${I.id}`,children:[f.jsx("span",{className:"filter-bar__chip-label",children:I.label}),f.jsx("button",{type:"button",className:"filter-bar__chip-close",onClick:()=>l==null?void 0:l(I.id),"aria-label":`Remove ${I.label} filter`,"data-testid":`filter-chip-close-${I.id}`,children:f.jsx(Ce,{name:"x",size:14})})]},I.id))]})]}))});Jk.displayName="FilterBar";const Wx=e=>{const t=typeof e=="string"?new Date(e):e,a=new Date().getTime()-t.getTime();if(Number.isNaN(a))return"";const s=Math.floor(a/6e4),l=Math.floor(a/36e5),c=Math.floor(a/864e5);return s<1?"just now":s<60?`${s}m ago`:l<24?`${l}h ago`:c<7?`${c}d ago`:t.toLocaleDateString()},Wk=e=>{const t=typeof e=="string"?new Date(e):e;if(Number.isNaN(t.getTime()))return"";const a=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${a}:${s}:${l}`},Wr=(e,t)=>{const a=typeof e=="string"?new Date(e):e,s=typeof t=="string"?new Date(t):t;return a.getFullYear()===s.getFullYear()&&a.getMonth()===s.getMonth()&&a.getDate()===s.getDate()},e_=e=>Wr(e,new Date),el=(e,t=0)=>{const a=typeof e=="string"?new Date(e):new Date(e);let s=a.getDay()-t;s<0&&(s+=7);const l=new Date(a);l.setDate(a.getDate()-s);const c=[];for(let o=0;o<7;o++){const u=new Date(l);u.setDate(l.getDate()+o),c.push(u)}return c},eR=8,t_=(e,t=0)=>{const a=typeof e=="string"?new Date(e):e;if(Number.isNaN(a.getTime()))return[];const s=new Date(a.getFullYear(),a.getMonth(),1),l=el(s,t),c=[];let o=new Date(l[0]);for(;c.length<eR;){const u=el(o,t);c.push(u);const h=u[u.length-1];if(h.getMonth()>a.getMonth()||h.getFullYear()>a.getFullYear())break;o=new Date(h),o.setDate(o.getDate()+1)}return c},tR=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"long",year:"numeric"}),km=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",day:"numeric"}),nR=(e,t)=>{const a=el(e,t),s=km(a[0]),l=km(a[6]);return`${s} – ${l}`},aR={create:"emerald",update:"cyan",delete:"rose",run:"amber"},iR=ae.forwardRef((c,l)=>{var o=c,{events:e=[],emptyState:t="No activity recorded",className:a=""}=o,s=fe(o,["events","emptyState","className"]);const u=["activity-timeline",a].filter(Boolean).join(" ");return e.length===0?f.jsx("div",Y(R({ref:l,className:u,"data-testid":"activity-timeline"},s),{children:f.jsx("div",{className:"activity-timeline__empty","data-testid":"activity-timeline-empty",children:t})})):f.jsx("div",Y(R({ref:l,className:u,"data-testid":"activity-timeline"},s),{children:f.jsx("div",{className:"activity-timeline__list",children:e.map(h=>f.jsxs("div",Y(R(R({className:["activity-timeline__event",h.onClick?"activity-timeline__event--clickable":""].filter(Boolean).join(" "),"data-testid":`activity-event-${h.id}`},h.kind&&{"data-kind":h.kind}),h.onClick&&{role:"button",tabIndex:0,onClick:()=>h.onClick(h),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h.onClick(h))}}),{children:[f.jsx("div",{className:"activity-timeline__dot-container",children:h.dotColor?f.jsx("div",{className:"activity-timeline__dot--custom",style:{backgroundColor:To[h.dotColor]},"data-testid":`activity-dot-custom-${h.id}`}):f.jsx(fp,{color:aR[h.type],className:"activity-timeline__dot","data-testid":`activity-dot-${h.type}`})}),f.jsxs("div",{className:"activity-timeline__content",children:[f.jsxs("div",{className:"activity-timeline__header",children:[h.kind&&f.jsx("span",{className:"activity-timeline__kind-label","data-testid":`activity-kind-tag-${h.id}`,children:h.kindLabel||h.kind}),f.jsx("div",{className:"activity-timeline__subject","data-testid":"activity-subject",children:h.headline||h.subject})]}),h.meta&&f.jsx("div",{className:"activity-timeline__meta","data-testid":"activity-meta",children:h.meta})]}),f.jsx("div",{className:"activity-timeline__timestamp","data-testid":"activity-timestamp",children:Wx(h.timestamp)})]}),h.id))})}))});iR.displayName="ActivityTimeline";const sR=ae.forwardRef((h,u)=>{var m=h,{entries:e=[],selectedId:t,onSelect:a,order:s="newest-first",emptyState:l="No versions available",className:c=""}=m,o=fe(m,["entries","selectedId","onSelect","order","emptyState","className"]);const g=D.useRef(null),p=ae.useMemo(()=>{const w=[...e];return s==="oldest-first"?w.reverse():w},[e,s]),v=p.findIndex(w=>w.id===t),x=w=>{a&&(w.key==="ArrowUp"?(w.preventDefault(),v>0&&a(p[v-1].id)):w.key==="ArrowDown"?(w.preventDefault(),v<p.length-1&&a(p[v+1].id)):(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v>=0&&a(p[v].id)))};D.useEffect(()=>{if(v>=0&&g.current&&t){const w=g.current.querySelector(`[data-version-id="${CSS.escape(t)}"]`);w&&w.scrollIntoView({block:"nearest"})}},[t,v]);const _=["version-timeline",c].filter(Boolean).join(" ");if(p.length===0)return f.jsx("div",Y(R({ref:u,className:_,"data-testid":"version-timeline"},o),{children:f.jsx("div",{className:"version-timeline__empty","data-testid":"version-timeline-empty",children:l})}));const S=p.length>1;return f.jsx("div",Y(R({ref:u,className:_,"data-testid":"version-timeline",role:"listbox",tabIndex:0,onKeyDown:x},o),{children:f.jsx("div",{className:"version-timeline__list",ref:g,children:p.map((w,C)=>f.jsxs("div",Y(R({className:["version-timeline__entry",t===w.id?"version-timeline__entry--selected":"",a?"version-timeline__entry--clickable":""].filter(Boolean).join(" "),"data-version-id":w.id,"data-testid":`version-entry-${w.id}`,role:"option","aria-selected":t===w.id},a&&{onClick:()=>a(w.id),tabIndex:0}),{children:[f.jsxs("div",{className:"version-timeline__rail",children:[S&&C<p.length-1&&f.jsx("div",{className:"version-timeline__connector"}),f.jsx("div",{className:["version-timeline__dot",w.head?"version-timeline__dot--head":"version-timeline__dot--hollow"].filter(Boolean).join(" "),"data-testid":`version-dot-${w.id}`})]}),f.jsxs("div",{className:"version-timeline__content",children:[f.jsxs("div",{className:"version-timeline__header",children:[f.jsx(On,{tone:"amber",className:"version-timeline__pill",children:w.label}),w.head&&f.jsx(wn,{variant:"amber",form:"default",className:"version-timeline__head-chip","data-testid":`version-head-${w.id}`,children:"head"})]}),w.headline&&f.jsx("div",{className:"version-timeline__headline","data-testid":`version-headline-${w.id}`,children:w.headline}),w.transition?f.jsxs("div",{className:"version-timeline__transition","data-testid":`version-transition-${w.id}`,children:[f.jsx("span",{className:"version-timeline__transition-label",children:w.transition.from}),f.jsx("span",{className:"version-timeline__transition-arrow",children:"→"}),f.jsx("span",{className:"version-timeline__transition-label",children:w.transition.to})]}):w.stats?f.jsxs("div",{className:"version-timeline__stats","data-testid":`version-stats-${w.id}`,children:[w.stats.added!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--added",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["+",w.stats.added]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.added} added`,children:[w.stats.added," added"]})]}),w.stats.removed!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--removed",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["−",w.stats.removed]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.removed} removed`,children:[w.stats.removed," removed"]})]}),w.stats.kept!==void 0&&f.jsxs("span",{className:"version-timeline__stat version-timeline__stat--kept",children:[f.jsxs("span",{className:"version-timeline__stat-symbol",children:["∩",w.stats.kept]}),f.jsxs("span",{className:"version-timeline__stat-label","aria-label":`${w.stats.kept} kept`,children:[w.stats.kept," kept"]})]})]}):null]}),f.jsx("div",{className:"version-timeline__timestamp","data-testid":`version-timestamp-${w.id}`,children:Wx(w.timestamp)})]}),w.id))})}))});sR.displayName="VersionTimeline";const Sp=({itemCount:e,itemHeight:t,containerHeight:a,overscan:s=5})=>{const l=D.useRef(null),c=D.useRef(null),[o,u]=D.useState([0,Math.ceil(a/t)]);return D.useEffect(()=>{const h=l.current,m=c.current;if(!h||!m)return;const g=()=>{const p=m.getBoundingClientRect(),v=h.getBoundingClientRect().top-p.top,x=Math.max(0,Math.floor(v/t)-s),_=Math.min(e,Math.ceil((v+a)/t)+s);u(S=>S[0]===x&&S[1]===_?S:[x,_])};return h.addEventListener("scroll",g,{passive:!0}),g(),()=>{h.removeEventListener("scroll",g)}},[e,t,a,s]),{visibleRange:o,containerRef:l,sentinelRef:c}},Tr=28,rR=400,n_=ae.forwardRef((u,o)=>{var h=u,{added:e=[],removed:t=[],kept:a=[],maxVisible:s=10,className:l=""}=h,c=fe(h,["added","removed","kept","maxVisible","className"]);const[m,g]=D.useState(!1),p=e.length>0||t.length>0||a.length>0,v=a.length>s&&!m,x=m?a:a.slice(0,s),_=a.length-x.length,S=Math.max(e.length,t.length,v?s+1:a.length),{visibleRange:w,containerRef:C,sentinelRef:k}=Sp({itemCount:S,itemHeight:Tr,containerHeight:rR}),[j,E]=w,O=["hash-set-diff",l].filter(Boolean).join(" ");return p?f.jsxs("div",Y(R({ref:o,className:O,role:"table"},c),{children:[f.jsxs("div",{className:"hash-set-diff__header",role:"row",children:[f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--added",role:"cell",children:[f.jsx(On,{tone:"emerald",className:"hash-set-diff__pill",children:"Added"}),f.jsx("span",{className:"hash-set-diff__count",children:e.length})]}),f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--removed",role:"cell",children:[f.jsx(On,{tone:"rose",className:"hash-set-diff__pill",children:"Removed"}),f.jsx("span",{className:"hash-set-diff__count",children:t.length})]}),f.jsxs("div",{className:"hash-set-diff__column hash-set-diff__column--kept",role:"cell",children:[f.jsx(On,{className:"hash-set-diff__pill",children:"Kept"}),f.jsx("span",{className:"hash-set-diff__count",children:a.length})]})]}),f.jsx("div",{className:"hash-set-diff__viewport",ref:C,children:f.jsxs("div",{className:"hash-set-diff__content",style:{height:S*Tr,position:"relative"},children:[f.jsx("div",{ref:k,style:{position:"absolute",top:0,left:0,width:"1px",height:`${S*Tr}px`,visibility:"hidden",pointerEvents:"none"}}),f.jsx("div",{style:{height:j*Tr}}),Array.from({length:Math.min(E-j,S-j)}).map((z,I)=>{const B=j+I,q=B<e.length?e[B]:null,A=B<t.length?t[B]:null;let U=null,F=!1;return v&&B===s?F=!0:B<x.length&&(U=x[B]),f.jsxs("div",{className:"hash-set-diff__row",style:{height:Tr},role:"row",children:[f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--added",role:"cell",children:q&&f.jsx("div",{className:"hash-set-diff__item",children:q})}),f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--removed",role:"cell",children:A&&f.jsx("div",{className:"hash-set-diff__item",children:A})}),f.jsx("div",{className:"hash-set-diff__cell hash-set-diff__cell--kept",role:"cell",children:F?f.jsxs("button",{type:"button",className:"hash-set-diff__expand-button",onClick:()=>g(!0),"aria-label":`Show ${_} more kept items`,children:["… ",_," more carried forward"]}):U&&f.jsx("div",{className:"hash-set-diff__item",children:U})})]},B)}),f.jsx("div",{style:{height:Math.max(0,(S-E)*Tr)}})]})})]})):f.jsx("div",Y(R({ref:o,className:O},c),{children:f.jsx("div",{className:"hash-set-diff__empty",children:"No changes between these versions"})}))});n_.displayName="HashSetDiff";const Mr=24,lR=500,wp=ae.forwardRef((l,s)=>{var c=l,{lines:e=[],className:t=""}=c,a=fe(c,["lines","className"]);const{visibleRange:o,containerRef:u,sentinelRef:h}=Sp({itemCount:e.length,itemHeight:Mr,containerHeight:lR}),[m,g]=o,p=["side-by-side-diff",t].filter(Boolean).join(" ");return e.length>0?f.jsxs("div",Y(R({ref:s,className:p,role:"table"},a),{children:[f.jsxs("div",{className:"side-by-side-diff__header",role:"row",children:[f.jsx("div",{className:"side-by-side-diff__gutter",role:"cell"}),f.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:f.jsx(On,{tone:"emerald",className:"side-by-side-diff__pill side-by-side-diff__pill--added",children:"Version 2 (Added)"})}),f.jsx("div",{role:"cell",className:"side-by-side-diff__header-cell",children:f.jsx(On,{tone:"rose",className:"side-by-side-diff__pill side-by-side-diff__pill--removed",children:"Version 1 (Removed)"})})]}),f.jsx("div",{className:"side-by-side-diff__viewport",ref:u,children:f.jsxs("div",{className:"side-by-side-diff__content",style:{height:e.length*Mr,position:"relative"},children:[f.jsx("div",{ref:h,style:{position:"absolute",top:0,left:0,width:"1px",height:`${e.length*Mr}px`,visibility:"hidden",pointerEvents:"none"}}),f.jsx("div",{style:{height:m*Mr}}),e.slice(m,g).map((v,x)=>{const _=m+x,S=v.type==="hunk",w=v.type==="added",C=v.type==="removed";return f.jsx("div",{className:["side-by-side-diff__row",`side-by-side-diff__row--${v.type}`].filter(Boolean).join(" "),style:{height:Mr},role:"row",children:S?f.jsx("div",{className:"side-by-side-diff__hunk",role:"cell",children:v.content}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:["side-by-side-diff__gutter",w&&"side-by-side-diff__gutter--added",C&&"side-by-side-diff__gutter--removed"].filter(Boolean).join(" "),role:"cell",children:f.jsx("span",{className:"sr-only",children:w?"added":C?"removed":""})}),f.jsx("div",{className:["side-by-side-diff__line",w&&"side-by-side-diff__line--added",C&&"side-by-side-diff__line--removed"].filter(Boolean).join(" "),role:"cell",children:f.jsx("span",{className:"side-by-side-diff__content",children:v.content})})]})},_)}),f.jsx("div",{style:{height:Math.max(0,(e.length-g)*Mr)}})]})})]})):f.jsx("div",Y(R({ref:s,className:p},a),{children:f.jsx("div",{className:"side-by-side-diff__empty",children:"No changes between these versions"})}))});wp.displayName="SideBySideDiff";const Cp=D.createContext(null),a_=ae.forwardRef((o,c)=>{var u=o,{mode:e="hash-set",onModeChange:t,children:a,className:s=""}=u,l=fe(u,["mode","onModeChange","children","className"]);const[h,m]=D.useState(e);D.useEffect(()=>{m(e)},[e]);const g=x=>{m(x),t==null||t(x)},p=x=>{var _,S,w,C,k;const j=Array.from(((_=x.currentTarget.closest('[role="tablist"]'))==null?void 0:_.querySelectorAll('[role="tab"]'))||[]),E=j.indexOf(x.currentTarget);if(x.key==="ArrowLeft"){x.preventDefault();const O=E>0?E-1:j.length-1;(S=j[O])==null||S.focus()}else if(x.key==="ArrowRight"){x.preventDefault();const O=E<j.length-1?E+1:0;(w=j[O])==null||w.focus()}else x.key==="Home"?(x.preventDefault(),(C=j[0])==null||C.focus()):x.key==="End"&&(x.preventDefault(),(k=j[j.length-1])==null||k.focus())},v=["diff-viewer",s].filter(Boolean).join(" ");return f.jsx(Cp.Provider,{value:h,children:f.jsxs("div",Y(R({ref:c,className:v,role:"region","aria-label":"Diff Viewer","data-testid":"diff-viewer"},l),{children:[f.jsxs("div",{className:"diff-viewer__header",role:"tablist",children:[f.jsx("button",{type:"button",id:"diff-viewer-hash-set-tab",role:"tab","aria-selected":h==="hash-set","aria-controls":"diff-viewer-hash-set-panel",className:["diff-viewer__tab",h==="hash-set"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("hash-set"),onKeyDown:p,children:"Hash Set"}),f.jsx("button",{type:"button",id:"diff-viewer-side-by-side-tab",role:"tab","aria-selected":h==="side-by-side","aria-controls":"diff-viewer-side-by-side-panel",className:["diff-viewer__tab",h==="side-by-side"&&"diff-viewer__tab--active"].filter(Boolean).join(" "),onClick:()=>g("side-by-side"),onKeyDown:p,children:"Side by Side"})]}),f.jsxs("div",{className:"diff-viewer__content","data-testid":"diff-viewer-content",children:[h==="hash-set"&&f.jsx("div",{id:"diff-viewer-hash-set-panel",role:"tabpanel","aria-labelledby":"diff-viewer-hash-set-tab",className:"diff-viewer__panel diff-viewer__panel--hash-set",children:a}),h==="side-by-side"&&f.jsx("div",{id:"diff-viewer-side-by-side-panel",role:"tabpanel","aria-labelledby":"diff-viewer-side-by-side-tab",className:"diff-viewer__panel diff-viewer__panel--side-by-side",children:a})]})]}))})});a_.displayName="DiffViewer";function i_(h){var m=h,{added:e,removed:t,kept:a,maxVisible:s,label:l="Changes",labelTone:c="amber",className:o=""}=m,u=fe(m,["added","removed","kept","maxVisible","label","labelTone","className"]);return D.useContext(Cp)!=="hash-set"?null:f.jsxs("div",Y(R({className:["diff-viewer-hash-set",o].filter(Boolean).join(" ")},u),{children:[l&&f.jsx("div",{className:"diff-viewer-hash-set__header",children:f.jsx(On,{tone:c,className:"diff-viewer-hash-set__label",children:l})}),f.jsx(n_,{added:e,removed:t,kept:a,maxVisible:s})]}))}i_.displayName="DiffViewerHashSet";function s_(u){var h=u,{lines:e,addedLabel:t="Version 2 (Added)",removedLabel:a="Version 1 (Removed)",addedLabelTone:s="emerald",removedLabelTone:l="rose",className:c=""}=h,o=fe(h,["lines","addedLabel","removedLabel","addedLabelTone","removedLabelTone","className"]);return D.useContext(Cp)!=="side-by-side"?null:f.jsxs("div",Y(R({className:["diff-viewer-side-by-side",c].filter(Boolean).join(" ")},o),{children:[(t||a)&&f.jsx("div",{className:"diff-viewer-side-by-side__header",children:f.jsxs("div",{className:"diff-viewer-side-by-side__labels",children:[t&&f.jsx(On,{tone:s,className:"diff-viewer-side-by-side__label",children:t}),a&&f.jsx(On,{tone:l,className:"diff-viewer-side-by-side__label",children:a})]})}),f.jsx(wp,{lines:e})]}))}s_.displayName="DiffViewerSideBySide";Object.assign(a_,{HashSet:i_,SideBySide:s_});const oR={error:"rose",warn:"amber",info:"cyan",success:"emerald"},cR=ae.forwardRef((c,l)=>{var o=c,{alerts:e=[],onDismiss:t,className:a=""}=o,s=fe(o,["alerts","onDismiss","className"]);const u=["alert-strip",a].filter(Boolean).join(" ");return e.length===0?null:f.jsx("div",Y(R({ref:l,className:u,"data-testid":"alert-strip"},s),{children:e.map(h=>f.jsxs("div",{className:"alert-strip__alert","data-testid":`alert-${h.id}`,children:[f.jsx(fp,{color:oR[h.severity],"data-testid":`alert-severity-${h.severity}`}),f.jsx("div",{className:"alert-strip__message","data-testid":"alert-message",children:h.message}),t&&f.jsx("button",{type:"button",className:"alert-strip__dismiss",onClick:()=>t(h.id),"aria-label":`Dismiss alert: ${h.message}`,"data-testid":`alert-dismiss-${h.id}`,children:f.jsx(Ce,{name:"x",size:16})})]},h.id))}))});cR.displayName="AlertStrip";const r_=ae.forwardRef((o,c)=>{var u=o,{icon:e,title:t,description:a,className:s=""}=u,l=fe(u,["icon","title","description","className"]);const h=["quick-access-tile",s].filter(Boolean).join(" ");return f.jsxs("button",Y(R({ref:c,type:"button",className:h,"data-testid":"quick-access-tile"},l),{children:[f.jsx("div",{className:"quick-access-tile__icon",children:f.jsx(Ce,{name:e,size:16})}),f.jsxs("div",{className:"quick-access-tile__body",children:[f.jsx("div",{className:"quick-access-tile__title",children:t}),a&&f.jsx("div",{className:"quick-access-tile__description",children:a})]}),f.jsx(Ce,{name:"chevronRight",size:13,className:"quick-access-tile__chev"})]}))});r_.displayName="QuickAccessTile";const uR=ae.forwardRef((o,c)=>{var u=o,{tiles:e,onAction:t,columns:a=4,className:s=""}=u,l=fe(u,["tiles","onAction","columns","className"]);const h=["quick-access-grid",s].filter(Boolean).join(" ");return f.jsx("div",Y(R({ref:c,className:h,style:{"--qa-columns":a},"data-testid":"quick-access-grid"},l),{children:e.map(m=>f.jsx(r_,{icon:m.icon,title:m.title,description:m.description,onClick:()=>t==null?void 0:t(m.id),"data-testid":`quick-access-tile-${m.id}`},m.id))}))});uR.displayName="QuickAccessGrid";const dR=ae.forwardRef((g,m)=>{var p=g,{icon:e,title:t,description:a,summary:s=[],onClick:l,className:c="",disabled:o,type:u="button"}=p,h=fe(p,["icon","title","description","summary","onClick","className","disabled","type"]);const v=["config-tile",o&&"config-tile--disabled",c].filter(Boolean).join(" ");return f.jsxs("button",Y(R({ref:m,type:u,className:v,onClick:l,disabled:o,"data-testid":"config-tile"},h),{children:[f.jsx("div",{className:"config-tile__icon",children:f.jsx(Ce,{name:e,size:24})}),f.jsxs("div",{className:"config-tile__content",children:[f.jsx("div",{className:"config-tile__title",children:t}),a&&f.jsx("div",{className:"config-tile__description",children:a}),s.length>0&&f.jsx("div",{className:"config-tile__summary",children:s.map((x,_)=>f.jsxs(ae.Fragment,{children:[f.jsx("div",{className:"config-tile__summary-key",children:x.label}),f.jsx("div",{className:"config-tile__summary-value",children:x.value})]},_))})]}),f.jsx("div",{className:"config-tile__chevron",children:f.jsx(Ce,{name:"chevronRight",size:16})})]}))});dR.displayName="ConfigTile";const fR=e=>/^https?:\/\//.test(e)||e.startsWith("/"),l_=ae.forwardRef((p,g)=>{var v=p,{role:e,senderName:t,timestamp:a,body:s,avatar:l,badge:c,toolBlock:o,thinkingBlock:u,className:h=""}=v,m=fe(v,["role","senderName","timestamp","body","avatar","badge","toolBlock","thinkingBlock","className"]);const x=l&&fR(l)?f.jsx("img",{src:l,alt:t,className:"chat-message__avatar-img"}):l||t.slice(0,2).toUpperCase();return f.jsxs("div",Y(R({ref:g,className:["chat-message",`chat-message--${e}`,h].filter(Boolean).join(" "),"data-testid":`chat-message-${e}`},m),{children:[f.jsx("div",{className:"chat-message__avatar",children:x}),f.jsxs("div",{className:"chat-message__content",children:[f.jsxs("div",{className:"chat-message__meta",children:[f.jsx("span",{className:"chat-message__sender",children:t}),c&&f.jsx("span",{className:"chat-message__badge",children:c}),f.jsx("span",{className:"chat-message__timestamp",children:a})]}),f.jsx("div",{className:"chat-message__body",children:s}),u&&f.jsx(c_,{content:u.content}),o&&f.jsx(o_,{name:o.name,status:o.status,output:o.output})]})]}))});l_.displayName="ChatMessage";const o_=ae.forwardRef((h,u)=>{var m=h,{name:e,status:t,output:a=[],defaultCollapsed:s=!1,onToggleCollapsed:l,className:c=""}=m,o=fe(m,["name","status","output","defaultCollapsed","onToggleCollapsed","className"]);const[g,p]=ae.useState(s),v=ae.useId(),x=ae.useCallback(()=>{const S=!g;p(S),l==null||l(S)},[g,l]),_=t==="running"?"amber":t==="success"?"emerald":"rose";return f.jsxs("div",Y(R({ref:u,className:["tool-block",c].filter(Boolean).join(" "),"data-testid":"tool-block"},o),{children:[f.jsxs("button",{type:"button",className:"tool-block__header",onClick:x,"aria-expanded":!g,"aria-controls":a.length>0?v:void 0,children:[f.jsx(Ce,{name:g?"chevronRight":"chevronDown",size:12,className:"tool-block__toggle-icon"}),f.jsx("span",{className:"tool-block__name",children:e}),f.jsx("span",{className:`tool-block__status tool-block__status--${_}`,children:t==="running"?"running":t==="success"?"success":"error"})]}),!g&&a.length>0&&f.jsx("div",{id:v,className:"tool-block__output",children:a.map((S,w)=>f.jsxs("div",{className:"tool-block__output-row",children:[S.key&&f.jsx("span",{className:"tool-block__key",children:S.key}),f.jsx("span",{className:"tool-block__value",children:S.value})]},w))})]}))});o_.displayName="ToolBlock";const c_=ae.forwardRef((u,o)=>{var h=u,{content:e,label:t="thinking",defaultCollapsed:a=!1,onToggleCollapsed:s,className:l=""}=h,c=fe(h,["content","label","defaultCollapsed","onToggleCollapsed","className"]);const[m,g]=ae.useState(a),p=ae.useId(),v=ae.useCallback(()=>{const x=!m;g(x),s==null||s(x)},[m,s]);return f.jsxs("div",Y(R({ref:o,className:["thinking-block",l].filter(Boolean).join(" "),"data-testid":"thinking-block"},c),{children:[f.jsxs("button",{type:"button",className:"thinking-block__header",onClick:v,"aria-expanded":!m,"aria-controls":m?void 0:p,children:[f.jsx(Ce,{name:m?"chevronRight":"chevronDown",size:12,className:"thinking-block__toggle-icon"}),f.jsx("span",{className:"thinking-block__label",children:t})]}),!m&&f.jsx("div",{id:p,className:"thinking-block__content",children:e})]}))});c_.displayName="ThinkingBlock";const hR=ae.forwardRef((l,s)=>{var c=l,{label:e,className:t=""}=c,a=fe(c,["label","className"]);return f.jsxs("div",Y(R({ref:s,role:"separator","aria-label":e,className:["chat-divider",t].filter(Boolean).join(" "),"data-testid":"chat-divider"},a),{children:[f.jsx("span",{className:"chat-divider__line"}),f.jsx("span",{className:"chat-divider__label","aria-hidden":"true",children:e}),f.jsx("span",{className:"chat-divider__line"})]}))});hR.displayName="ChatDivider";const u_=ae.forwardRef((u,o)=>{var h=u,{suggestions:e,onSelect:t,selected:a,className:s="","aria-label":l="Suggestions"}=h,c=fe(h,["suggestions","onSelect","selected","className","aria-label"]);if(!e||e.length===0)return null;const m=a!==void 0;return f.jsx("div",Y(R({ref:o,role:"group","aria-label":l,className:["chat-suggestions",s].filter(Boolean).join(" "),"data-testid":"chat-suggestions"},c),{children:e.map(g=>{const p=g===a,v=m&&!p;return f.jsx("button",{className:["chat-suggestions__pill",p?"chat-suggestions__pill--selected":"",v?"chat-suggestions__pill--disabled":""].filter(Boolean).join(" "),onClick:()=>!v&&t(g),type:"button",disabled:v,"aria-pressed":p,children:g},g)})}))});u_.displayName="ChatSuggestions";const mR=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`id-${Math.random().toString(36).slice(2,11)}-${Date.now()}`,d_=ae.forwardRef((S,_)=>{var w=S,{placeholder:e="Type a message...",value:t,onChange:a,onSubmit:s,onContextChange:l,onAttachmentChange:c,scopeLabel:o,contextItems:u=[],attachments:h=[],disabled:m=!1,loading:g=!1,label:p="Message",className:v}=w,x=fe(w,["placeholder","value","onChange","onSubmit","onContextChange","onAttachmentChange","scopeLabel","contextItems","attachments","disabled","loading","label","className"]);const C=D.useRef(null),k=D.useRef(null);D.useEffect(()=>{if(C.current){C.current.style.height="auto";const B=Math.min(C.current.scrollHeight,200);C.current.style.height=`${B}px`}},[t]);const j=B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),t.trim()&&!m&&!g&&s(t,u))},E=()=>{t.trim()&&!m&&!g&&s(t,u)},O=B=>{const q=u.filter(A=>A.id!==B);l==null||l(q)},z=B=>{if(!B.target.files)return;const q=Array.from(B.target.files).map(U=>({id:mR(),name:U.name,size:U.size})),A=[...h,...q];c==null||c(A),k.current&&(k.current.value="")},I=B=>{const q=h.filter(A=>A.id!==B);c==null||c(q)};return f.jsxs("div",Y(R({ref:_,className:["chat-composer",m&&"chat-composer--disabled",v].filter(Boolean).join(" ")},x),{children:[f.jsxs("div",{className:"chat-composer__tools",children:[o&&f.jsxs("span",{className:"chat-composer__scope",children:["talking to ",f.jsx("b",{children:o})]}),u.map(B=>f.jsxs("div",{className:"chat-composer__context-pill",children:[f.jsx("span",{className:"chat-composer__context-label",children:B.label}),f.jsx("button",{className:"chat-composer__context-remove",onClick:()=>O(B.id),"aria-label":`Remove ${B.label}`,type:"button",children:f.jsx(Ce,{name:"x",size:10})})]},B.id)),h.map(B=>f.jsxs("div",{className:"chat-composer__attachment-pill",children:[f.jsx(Ce,{name:"paperclip",size:10}),f.jsx("span",{className:"chat-composer__attachment-label",children:B.name}),f.jsx("button",{className:"chat-composer__attachment-remove",onClick:()=>I(B.id),"aria-label":`Remove ${B.name}`,type:"button",children:f.jsx(Ce,{name:"x",size:10})})]},B.id))]}),f.jsxs("div",{className:"chat-composer__input-wrapper",children:[f.jsx("textarea",{ref:C,className:"chat-composer__input",placeholder:e,value:t,onChange:B=>a(B.target.value),onKeyDown:j,rows:2,disabled:m,"aria-label":p}),f.jsxs("div",{className:"chat-composer__footer",children:[f.jsx("div",{className:"chat-composer__footer-start",children:f.jsxs("span",{className:"chat-composer__hint",children:[f.jsx("b",{children:"↵"})," send · ",f.jsx("b",{children:"⇧↵"})," newline"]})}),f.jsxs("div",{className:"chat-composer__footer-end",children:[f.jsx("input",{ref:k,type:"file",multiple:!0,onChange:z,className:"chat-composer__file-input","aria-label":"Attach files"}),f.jsx("button",{className:"chat-composer__attach-button",onClick:()=>{var B;return(B=k.current)==null?void 0:B.click()},type:"button","aria-label":"Attach files",disabled:m,children:f.jsx(Ce,{name:"paperclip",size:12})}),f.jsxs(an,{variant:"primary",size:"sm",onClick:E,disabled:!t.trim()||m||g,children:[f.jsx(Ce,{name:"send",size:12}),"send"]})]})]})]})]}))});d_.displayName="ChatComposer";const f_=ae.forwardRef((m,h)=>{var g=m,{children:e,bots:t=[],activeBotId:a,onBotChange:s,autoScroll:l=!0,composer:c,className:o=""}=g,u=fe(g,["children","bots","activeBotId","onBotChange","autoScroll","composer","className"]);const p=D.useRef(null);return D.useEffect(()=>{l&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[e,l]),f.jsxs("div",Y(R({ref:h,className:["chat-container",o].filter(Boolean).join(" ")},u),{children:[t&&t.length>0&&f.jsx("div",{className:"chat-container__bot-tabs",role:"group","aria-label":"Bot tabs",children:t.map(v=>f.jsxs("button",{type:"button",className:["chat-container__bot-tab",a===v.id&&"chat-container__bot-tab--active"].filter(Boolean).join(" "),onClick:()=>s==null?void 0:s(v.id),"aria-pressed":a===v.id,"aria-label":`${v.label} — ${v.role}`,children:[f.jsxs("span",{className:"chat-container__bot-label",children:[f.jsx("span",{className:["chat-container__bot-status",`chat-container__bot-status--${v.status}`].filter(Boolean).join(" ")}),v.label]}),f.jsx("span",{className:"chat-container__bot-role",children:v.role})]},v.id))}),f.jsx("div",{ref:p,className:"chat-container__thread",role:"log","aria-live":"polite","aria-atomic":"false",children:f.jsx("div",{className:"chat-container__messages",children:e})}),c]}))});f_.displayName="ChatContainer";function pR(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const gR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vR={};function Ab(e,t){return(vR.jsx?yR:gR).test(e)}const bR=/[ \t\n\f\r]/g;function xR(e){return typeof e=="object"?e.type==="text"?Db(e.value):!1:Db(e)}function Db(e){return e.replace(bR,"")===""}class Uo{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function h_(e,t){const a={},s={};for(const l of e)Object.assign(a,l.property),Object.assign(s,l.normal);return new Uo(a,s,t)}function Rm(e){return e.toLowerCase()}class Cn{constructor(t,a){this.attribute=a,this.property=t}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let _R=0;const Be=Fs(),Ht=Fs(),Tm=Fs(),ye=Fs(),bt=Fs(),As=Fs(),An=Fs();function Fs(){return bh(2,++_R)}const Mm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:Ht,commaOrSpaceSeparated:An,commaSeparated:As,number:ye,overloadedBoolean:Tm,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Ph=Object.keys(Mm);class Np extends Cn{constructor(t,a,s,l){let c=-1;if(super(t,a),Lb(this,"space",l),typeof s=="number")for(;++c<Ph.length;){const o=Ph[c];Lb(this,Ph[c],(s&Mm[o])===Mm[o])}}}Np.prototype.defined=!0;function Lb(e,t,a){a&&(e[t]=a)}function rl(e){const t={},a={};for(const[s,l]of Object.entries(e.properties)){const c=new Np(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(c.mustUseProperty=!0),t[s]=c,a[Rm(s)]=s,a[Rm(c.attribute)]=s}return new Uo(t,a,e.space)}const m_=rl({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:bt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:ye,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:bt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Ht,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function p_(e,t){return t in e?e[t]:t}function g_(e,t){return p_(e,t.toLowerCase())}const SR=rl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:As,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:bt,autoFocus:Be,autoPlay:Be,blocking:bt,capture:null,charSet:null,checked:Be,cite:null,className:bt,closedBy:null,colorSpace:null,cols:ye,colSpan:ye,command:null,commandFor:null,content:null,contentEditable:Ht,controls:Be,controlsList:bt,coords:ye|As,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Tm,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:bt,height:ye,hidden:Tm,high:ye,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:bt,itemRef:bt,itemScope:Be,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Be,optimum:ye,pattern:null,ping:bt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:bt,required:Be,reversed:Be,rows:ye,rowSpan:ye,sandbox:bt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:Ht,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:As,part:bt,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:g_}),wR=rl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:An,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:As,g2:As,glyphName:As,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:p_}),y_=rl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),v_=rl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:g_}),b_=rl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),CR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NR=/[A-Z]/g,Ob=/-[a-z]/g,jR=/^data[-\w.:]+$/i;function ER(e,t){const a=Rm(t);let s=t,l=Cn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&jR.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(Ob,RR);s="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!Ob.test(c)){let o=c.replace(NR,kR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}l=Np}return new l(s,t)}function kR(e){return"-"+e.toLowerCase()}function RR(e){return e.charAt(1).toUpperCase()}const TR=h_([m_,SR,y_,v_,b_],"html"),jp=h_([m_,wR,y_,v_,b_],"svg");function MR(e){return e.join(" ").trim()}var zu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ep={},zb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,AR=/\n/g,DR=/^\s*/,LR=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,OR=/^:\s*/,zR=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,IR=/^[;\s]*/,UR=/^\s+|\s+$/g,BR=`
50
+ `,Ib="/",Ub="*",ys="",FR="comment",HR="declaration";function $R(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,s=1;function l(_){var S=_.match(AR);S&&(a+=S.length);var w=_.lastIndexOf(BR);s=~w?_.length-w:s+_.length}function c(){var _={line:a,column:s};return function(S){return S.position=new o(_),m(),S}}function o(_){this.start=_,this.end={line:a,column:s},this.source=t.source}o.prototype.content=e;function u(_){var S=new Error(t.source+":"+a+":"+s+": "+_);if(S.reason=_,S.filename=t.source,S.line=a,S.column=s,S.source=e,!t.silent)throw S}function h(_){var S=_.exec(e);if(S){var w=S[0];return l(w),e=e.slice(w.length),S}}function m(){h(DR)}function g(_){var S;for(_=_||[];S=p();)S!==!1&&_.push(S);return _}function p(){var _=c();if(!(Ib!=e.charAt(0)||Ub!=e.charAt(1))){for(var S=2;ys!=e.charAt(S)&&(Ub!=e.charAt(S)||Ib!=e.charAt(S+1));)++S;if(S+=2,ys===e.charAt(S-1))return u("End of comment missing");var w=e.slice(2,S-2);return s+=2,l(w),e=e.slice(S),s+=2,_({type:FR,comment:w})}}function v(){var _=c(),S=h(LR);if(S){if(p(),!h(OR))return u("property missing ':'");var w=h(zR),C=_({type:HR,property:Bb(S[0].replace(zb,ys)),value:w?Bb(w[0].replace(zb,ys)):ys});return h(IR),C}}function x(){var _=[];g(_);for(var S;S=v();)S!==!1&&(_.push(S),g(_));return _}return m(),x()}function Bb(e){return e?e.replace(UR,ys):ys}var PR=$R,qR=zu&&zu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.default=GR;const VR=qR(PR);function GR(e,t){let a=null;if(!e||typeof e!="string")return a;const s=(0,VR.default)(e),l=typeof t=="function";return s.forEach(c=>{if(c.type!=="declaration")return;const{property:o,value:u}=c;l?t(o,u,c):u&&(a=a||{},a[o]=u)}),a}var nd={};Object.defineProperty(nd,"__esModule",{value:!0});nd.camelCase=void 0;var KR=/^--[a-zA-Z0-9_-]+$/,QR=/-([a-z])/g,YR=/^[^-]+$/,XR=/^-(webkit|moz|ms|o|khtml)-/,ZR=/^-(ms)-/,JR=function(e){return!e||YR.test(e)||KR.test(e)},WR=function(e,t){return t.toUpperCase()},Fb=function(e,t){return"".concat(t,"-")},eT=function(e,t){return t===void 0&&(t={}),JR(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ZR,Fb):e=e.replace(XR,Fb),e.replace(QR,WR))};nd.camelCase=eT;var tT=zu&&zu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nT=tT(Ep),aT=nd;function Am(e,t){var a={};return!e||typeof e!="string"||(0,nT.default)(e,function(s,l){s&&l&&(a[(0,aT.camelCase)(s,t)]=l)}),a}Am.default=Am;var iT=Am;const sT=x_(iT),__=S_("end"),kp=S_("start");function S_(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function rT(e){const t=kp(e),a=__(e);if(t&&a)return{start:t,end:a}}function So(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hb(e.position):"start"in e||"end"in e?Hb(e):"line"in e||"column"in e?Dm(e):""}function Dm(e){return $b(e&&e.line)+":"+$b(e&&e.column)}function Hb(e){return Dm(e&&e.start)+"-"+Dm(e&&e.end)}function $b(e){return e&&typeof e=="number"?e:1}class sn extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let l="",c={},o=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c=R({},a)),typeof t=="string"?l=t:!c.cause&&t&&(o=!0,l=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?c.ruleId=s:(c.source=s.slice(0,h),c.ruleId=s.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const u=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=u?u.line:void 0,this.name=So(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=o&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sn.prototype.file="";sn.prototype.name="";sn.prototype.reason="";sn.prototype.message="";sn.prototype.stack="";sn.prototype.column=void 0;sn.prototype.line=void 0;sn.prototype.ancestors=void 0;sn.prototype.cause=void 0;sn.prototype.fatal=void 0;sn.prototype.place=void 0;sn.prototype.ruleId=void 0;sn.prototype.source=void 0;const Rp={}.hasOwnProperty,lT=new Map,oT=/[A-Z]/g,cT=new Set(["table","tbody","thead","tfoot","tr"]),uT=new Set(["td","th"]),w_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=bT(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=vT(a,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jp:TR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=C_(l,e,void 0);return c&&typeof c!="string"?c:l.create(e,l.Fragment,{children:c||void 0},void 0)}function C_(e,t,a){if(t.type==="element")return fT(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pT(e,t,a);if(t.type==="mdxjsEsm")return mT(e,t);if(t.type==="root")return gT(e,t,a);if(t.type==="text")return yT(e,t)}function fT(e,t,a){const s=e.schema;let l=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=jp,e.schema=l),e.ancestors.push(t);const c=j_(e,t.tagName,!1),o=xT(e,t);let u=Mp(e,t);return cT.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!xR(h):!0})),N_(e,o,c,t),Tp(o,u),e.ancestors.pop(),e.schema=s,e.create(t,c,o,a)}function hT(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Mo(e,t.position)}function mT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Mo(e,t.position)}function pT(e,t,a){const s=e.schema;let l=s;t.name==="svg"&&s.space==="html"&&(l=jp,e.schema=l),e.ancestors.push(t);const c=t.name===null?e.Fragment:j_(e,t.name,!0),o=_T(e,t),u=Mp(e,t);return N_(e,o,c,t),Tp(o,u),e.ancestors.pop(),e.schema=s,e.create(t,c,o,a)}function gT(e,t,a){const s={};return Tp(s,Mp(e,t)),e.create(t,e.Fragment,s,a)}function yT(e,t){return t.value}function N_(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function Tp(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function vT(e,t,a){return s;function s(l,c,o,u){const h=Array.isArray(o.children)?a:t;return u?h(c,o,u):h(c,o)}}function bT(e,t){return a;function a(s,l,c,o){const u=Array.isArray(c.children),h=kp(s);return t(l,c,o,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function xT(e,t){const a={};let s,l;for(l in t.properties)if(l!=="children"&&Rp.call(t.properties,l)){const c=ST(e,l,t.properties[l]);if(c){const[o,u]=c;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&uT.has(t.tagName)?s=u:a[o]=u}}if(s){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function _T(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.data.estree.body[0];l.type;const c=l.expression;c.type;const o=c.properties[0];o.type,Object.assign(a,e.evaluater.evaluateExpression(o.argument))}else Mo(e,t.position);else{const l=s.name;let c;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,c=e.evaluater.evaluateExpression(o.expression)}else Mo(e,t.position);else c=s.value===null?!0:s.value;a[l]=c}return a}function Mp(e,t){const a=[];let s=-1;const l=e.passKeys?new Map:lT;for(;++s<t.children.length;){const c=t.children[s];let o;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=l.get(h)||0;o=h+"-"+m,l.set(h,m+1)}}const u=C_(e,c,o);u!==void 0&&a.push(u)}return a}function ST(e,t,a){const s=ER(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?pR(a):MR(a)),s.property==="style"){let l=typeof a=="object"?a:wT(e,String(a));return e.stylePropertyNameCase==="css"&&(l=CT(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?CR[s.property]||s.property:s.attribute,a]}}function wT(e,t){try{return sT(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,l=new sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=w_+"#cannot-parse-style-attribute",l}}function j_(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let c=-1,o;for(;++c<l.length;){const u=Ab(l[c])?{type:"Identifier",name:l[c]}:{type:"Literal",value:l[c]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(c&&u.type==="Literal"),optional:!1}:u}s=o}else s=Ab(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const l=s.value;return Rp.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Mo(e)}function Mo(e,t){const a=new sn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=w_+"#cannot-handle-mdx-estrees-without-createevaluater",a}function CT(e){const t={};let a;for(a in e)Rp.call(e,a)&&(t[NT(a)]=e[a]);return t}function NT(e){let t=e.replace(oT,jT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jT(e){return"-"+e.toLowerCase()}const qh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ET={};function Ap(e,t){const a=ET,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,l=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return E_(e,s,l)}function E_(e,t,a){if(kT(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Pb(e.children,t,a)}return Array.isArray(e)?Pb(e,t,a):""}function Pb(e,t,a){const s=[];let l=-1;for(;++l<e.length;)s[l]=E_(e[l],t,a);return s.join("")}function kT(e){return!!(e&&typeof e=="object")}const qb=document.createElement("i");function Dp(e){const t="&"+e+";";qb.innerHTML=t;const a=qb.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function zn(e,t,a,s){const l=e.length;let c=0,o;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,a=a>0?a:0,s.length<1e4)o=Array.from(s),o.unshift(t,a),e.splice(...o);else for(a&&e.splice(t,a);c<s.length;)o=s.slice(c,c+1e4),o.unshift(t,0),e.splice(...o),c+=1e4,t+=1e4}function Jn(e,t){return e.length>0?(zn(e,e.length,0,t),e):t}const Vb={}.hasOwnProperty;function k_(e){const t={};let a=-1;for(;++a<e.length;)RT(t,e[a]);return t}function RT(e,t){let a;for(a in t){const s=(Vb.call(e,a)?e[a]:void 0)||(e[a]={}),l=t[a];let c;if(l)for(c in l){Vb.call(s,c)||(s[c]=[]);const o=l[c];TT(s[c],Array.isArray(o)?o:o?[o]:[])}}}function TT(e,t){let a=-1;const s=[];for(;++a<t.length;)(t[a].add==="after"?e:s).push(t[a]);zn(e,0,0,s)}function R_(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function ca(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=Ki(/[A-Za-z]/),nn=Ki(/[\dA-Za-z]/),MT=Ki(/[#-'*+\--9=?A-Z^-~]/);function Iu(e){return e!==null&&(e<32||e===127)}const Lm=Ki(/\d/),AT=Ki(/[\dA-Fa-f]/),DT=Ki(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Qe(e){return e===-2||e===-1||e===32}const ad=Ki(new RegExp("\\p{P}|\\p{S}","u")),Us=Ki(/\s/);function Ki(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ll(e){const t=[];let a=-1,s=0,l=0;for(;++a<e.length;){const c=e.charCodeAt(a);let o="";if(c===37&&nn(e.charCodeAt(a+1))&&nn(e.charCodeAt(a+2)))l=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(o=String.fromCharCode(c));else if(c>55295&&c<57344){const u=e.charCodeAt(a+1);c<56320&&u>56319&&u<57344?(o=String.fromCharCode(c,u),l=1):o="�"}else o=String.fromCharCode(c);o&&(t.push(e.slice(s,a),encodeURIComponent(o)),s=a+l+1,o=""),l&&(a+=l,l=0)}return t.join("")+e.slice(s)}function et(e,t,a,s){const l=s?s-1:Number.POSITIVE_INFINITY;let c=0;return o;function o(h){return Qe(h)?(e.enter(a),u(h)):t(h)}function u(h){return Qe(h)&&c++<l?(e.consume(h),u):(e.exit(a),t(h))}}const LT={tokenize:OT};function OT(e){const t=e.attempt(this.parser.constructs.contentInitial,s,l);let a;return t;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,t,"linePrefix")}function l(u){return e.enter("paragraph"),c(u)}function c(u){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return De(u)?(e.consume(u),e.exit("chunkText"),c):(e.consume(u),o)}}const zT={tokenize:IT},Gb={tokenize:UT};function IT(e){const t=this,a=[];let s=0,l,c,o;return u;function u(j){if(s<a.length){const E=a[s];return t.containerState=E[1],e.attempt(E[0].continuation,h,m)(j)}return m(j)}function h(j){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&k();const E=t.events.length;let O=E,z;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){z=t.events[O][1].end;break}C(s);let I=E;for(;I<t.events.length;)t.events[I][1].end=R({},z),I++;return zn(t.events,O+1,0,t.events.slice(E)),t.events.length=I,m(j)}return u(j)}function m(j){if(s===a.length){if(!l)return v(j);if(l.currentConstruct&&l.currentConstruct.concrete)return _(j);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gb,g,p)(j)}function g(j){return l&&k(),C(s),v(j)}function p(j){return t.parser.lazy[t.now().line]=s!==a.length,o=t.now().offset,_(j)}function v(j){return t.containerState={},e.attempt(Gb,x,_)(j)}function x(j){return s++,a.push([t.currentConstruct,t.containerState]),v(j)}function _(j){if(j===null){l&&k(),C(0),e.consume(j);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:c}),S(j)}function S(j){if(j===null){w(e.exit("chunkFlow"),!0),C(0),e.consume(j);return}return De(j)?(e.consume(j),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,u):(e.consume(j),S)}function w(j,E){const O=t.sliceStream(j);if(E&&O.push(null),j.previous=c,c&&(c.next=j),c=j,l.defineSkip(j.start),l.write(O),t.parser.lazy[j.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<o&&(!l.events[z][1].end||l.events[z][1].end.offset>o))return;const I=t.events.length;let B=I,q,A;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(q){A=t.events[B][1].end;break}q=!0}for(C(s),z=I;z<t.events.length;)t.events[z][1].end=R({},A),z++;zn(t.events,B+1,0,t.events.slice(I)),t.events.length=z}}function C(j){let E=a.length;for(;E-- >j;){const O=a[E];t.containerState=O[1],O[0].exit.call(t,e)}a.length=j}function k(){l.write([null]),c=void 0,l=void 0,t.containerState._closeFlow=void 0}}function UT(e,t,a){return et(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tl(e){if(e===null||xt(e)||Us(e))return 1;if(ad(e))return 2}function id(e,t,a){const s=[];let l=-1;for(;++l<e.length;){const c=e[l].resolveAll;c&&!s.includes(c)&&(t=c(t,a),s.push(c))}return t}const Om={name:"attention",resolveAll:BT,tokenize:FT};function BT(e,t){let a=-1,s,l,c,o,u,h,m,g;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(s=a;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[s][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const p=R({},e[s][1].end),v=R({},e[a][1].start);Kb(p,-h),Kb(v,h),o={type:h>1?"strongSequence":"emphasisSequence",start:p,end:R({},e[s][1].end)},u={type:h>1?"strongSequence":"emphasisSequence",start:R({},e[a][1].start),end:v},c={type:h>1?"strongText":"emphasisText",start:R({},e[s][1].end),end:R({},e[a][1].start)},l={type:h>1?"strong":"emphasis",start:R({},o.start),end:R({},u.end)},e[s][1].end=R({},o.start),e[a][1].start=R({},u.end),m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Jn(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Jn(m,[["enter",l,t],["enter",o,t],["exit",o,t],["enter",c,t]]),m=Jn(m,id(t.parser.constructs.insideSpan.null,e.slice(s+1,a),t)),m=Jn(m,[["exit",c,t],["enter",u,t],["exit",u,t],["exit",l,t]]),e[a][1].end.offset-e[a][1].start.offset?(g=2,m=Jn(m,[["enter",e[a][1],t],["exit",e[a][1],t]])):g=0,zn(e,s-1,a-s+3,m),a=s+m.length-g-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function FT(e,t){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,l=tl(s);let c;return o;function o(h){return c=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===c)return e.consume(h),u;const m=e.exit("attentionSequence"),g=tl(h),p=!g||g===2&&l||a.includes(h),v=!l||l===2&&g||a.includes(s);return m._open=!!(c===42?p:p&&(l||!v)),m._close=!!(c===42?v:v&&(g||!p)),t(h)}}function Kb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const HT={name:"autolink",tokenize:$T};function $T(e,t,a){let s=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return dn(x)?(e.consume(x),o):x===64?a(x):m(x)}function o(x){return x===43||x===45||x===46||nn(x)?(s=1,u(x)):m(x)}function u(x){return x===58?(e.consume(x),s=0,h):(x===43||x===45||x===46||nn(x))&&s++<32?(e.consume(x),u):(s=0,m(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Iu(x)?a(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),g):MT(x)?(e.consume(x),m):a(x)}function g(x){return nn(x)?p(x):a(x)}function p(x){return x===46?(e.consume(x),s=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):v(x)}function v(x){if((x===45||nn(x))&&s++<63){const _=x===45?v:p;return e.consume(x),_}return a(x)}}const Bo={partial:!0,tokenize:PT};function PT(e,t,a){return s;function s(c){return Qe(c)?et(e,l,"linePrefix")(c):l(c)}function l(c){return c===null||De(c)?t(c):a(c)}}const T_={continuation:{tokenize:VT},exit:GT,name:"blockQuote",tokenize:qT};function qT(e,t,a){const s=this;return l;function l(o){if(o===62){const u=s.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),c}return a(o)}function c(o){return Qe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function VT(e,t,a){const s=this;return l;function l(o){return Qe(o)?et(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):c(o)}function c(o){return e.attempt(T_,t,a)(o)}}function GT(e){e.exit("blockQuote")}const M_={name:"characterEscape",tokenize:KT};function KT(e,t,a){return s;function s(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),l}function l(c){return DT(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(c)}}const A_={name:"characterReference",tokenize:QT};function QT(e,t,a){const s=this;let l=0,c,o;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,o=nn,g(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,o=AT,g):(e.enter("characterReferenceValue"),c=7,o=Lm,g(p))}function g(p){if(p===59&&l){const v=e.exit("characterReferenceValue");return o===nn&&!Dp(s.sliceSerialize(v))?a(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&l++<c?(e.consume(p),g):a(p)}}const Qb={partial:!0,tokenize:XT},Yb={concrete:!0,name:"codeFenced",tokenize:YT};function YT(e,t,a){const s=this,l={partial:!0,tokenize:O};let c=0,o=0,u;return h;function h(z){return m(z)}function m(z){const I=s.events[s.events.length-1];return c=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,u=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(z)}function g(z){return z===u?(o++,e.consume(z),g):o<3?a(z):(e.exit("codeFencedFenceSequence"),Qe(z)?et(e,p,"whitespace")(z):p(z))}function p(z){return z===null||De(z)?(e.exit("codeFencedFence"),s.interrupt?t(z):e.check(Qb,S,E)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===null||De(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(z)):Qe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,x,"whitespace")(z)):z===96&&z===u?a(z):(e.consume(z),v)}function x(z){return z===null||De(z)?p(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(z))}function _(z){return z===null||De(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(z)):z===96&&z===u?a(z):(e.consume(z),_)}function S(z){return e.attempt(l,E,w)(z)}function w(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return c>0&&Qe(z)?et(e,k,"linePrefix",c+1)(z):k(z)}function k(z){return z===null||De(z)?e.check(Qb,S,E)(z):(e.enter("codeFlowValue"),j(z))}function j(z){return z===null||De(z)?(e.exit("codeFlowValue"),k(z)):(e.consume(z),j)}function E(z){return e.exit("codeFenced"),t(z)}function O(z,I,B){let q=0;return A;function A(K){return z.enter("lineEnding"),z.consume(K),z.exit("lineEnding"),U}function U(K){return z.enter("codeFencedFence"),Qe(K)?et(z,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):F(K)}function F(K){return K===u?(z.enter("codeFencedFenceSequence"),$(K)):B(K)}function $(K){return K===u?(q++,z.consume(K),$):q>=o?(z.exit("codeFencedFenceSequence"),Qe(K)?et(z,V,"whitespace")(K):V(K)):B(K)}function V(K){return K===null||De(K)?(z.exit("codeFencedFence"),I(K)):B(K)}}}function XT(e,t,a){const s=this;return l;function l(o){return o===null?a(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c)}function c(o){return s.parser.lazy[s.now().line]?a(o):t(o)}}const Vh={name:"codeIndented",tokenize:JT},ZT={partial:!0,tokenize:WT};function JT(e,t,a){const s=this;return l;function l(m){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(m)}function c(m){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(m):a(m)}function o(m){return m===null?h(m):De(m)?e.attempt(ZT,o,h)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||De(m)?(e.exit("codeFlowValue"),o(m)):(e.consume(m),u)}function h(m){return e.exit("codeIndented"),t(m)}}function WT(e,t,a){const s=this;return l;function l(o){return s.parser.lazy[s.now().line]?a(o):De(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):et(e,c,"linePrefix",5)(o)}function c(o){const u=s.events[s.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):De(o)?l(o):a(o)}}const eM={name:"codeText",previous:nM,resolve:tM,tokenize:aM};function tM(e){let t=e.length-4,a=3,s,l;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=a;++s<t;)if(e[s][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(s=a-1,t++;++s<=t;)l===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(l=s):(s===t||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),t-=s-l-2,s=l+2),l=void 0);return e}function nM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aM(e,t,a){let s=0,l,c;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),s++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(c=e.enter("codeTextSequence"),l=0,g(p)):De(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||De(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function g(p){return p===96?(e.consume(p),l++,g):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(c.type="codeTextData",m(p))}}class iM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const s=a!=null?a:Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,a,s){const l=a||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&oo(this.left,s),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),oo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),oo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);oo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);oo(this.left,a.reverse())}}}function oo(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function D_(e){const t={};let a=-1,s,l,c,o,u,h,m;const g=new iM(e);for(;++a<g.length;){for(;a in t;)a=t[a];if(s=g.get(a),a&&s[1].type==="chunkFlow"&&g.get(a-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,sM(g,a)),a=t[a],m=!0);else if(s[1]._container){for(c=a,l=void 0;c--;)if(o=g.get(c),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),o[1].type="lineEnding",l=c);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;l&&(s[1].end=R({},g.get(l)[1].start),u=g.slice(l,a),u.unshift(s),g.splice(l,a-l+1,u))}}return zn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function sM(e,t){const a=e.get(t)[1],s=e.get(t)[2];let l=t-1;const c=[];let o=a._tokenizer;o||(o=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,h=[],m={};let g,p,v=-1,x=a,_=0,S=0;const w=[S];for(;x;){for(;e.get(++l)[1]!==x;);c.push(l),x._tokenizer||(g=s.sliceStream(x),x.next||g.push(null),p&&o.defineSkip(x.start),x._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),x._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=a;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(S=v+1,w.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(o.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),v=w.length;v--;){const C=u.slice(w[v],w[v+1]),k=c.pop();h.push([k,k+C.length-1]),e.splice(k,2,C)}for(h.reverse(),v=-1;++v<h.length;)m[_+h[v][0]]=_+h[v][1],_+=h[v][1]-h[v][0]-1;return m}const rM={resolve:oM,tokenize:cM},lM={partial:!0,tokenize:uM};function oM(e){return D_(e),e}function cM(e,t){let a;return s;function s(u){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),l(u)}function l(u){return u===null?c(u):De(u)?e.check(lM,o,c)(u):(e.consume(u),l)}function c(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,l}}function uM(e,t,a){const s=this;return l;function l(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,c,"linePrefix")}function c(o){if(o===null||De(o))return a(o);const u=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(s.parser.constructs.flow,a,t)(o)}}function L_(e,t,a,s,l,c,o,u,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(C){return C===60?(e.enter(s),e.enter(l),e.enter(c),e.consume(C),e.exit(c),v):C===null||C===32||C===41||Iu(C)?a(C):(e.enter(s),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(C))}function v(C){return C===62?(e.enter(c),e.consume(C),e.exit(c),e.exit(l),e.exit(s),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||De(C)?a(C):(e.consume(C),C===92?_:x)}function _(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function S(C){return!g&&(C===null||C===41||xt(C))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(s),t(C)):g<m&&C===40?(e.consume(C),g++,S):C===41?(e.consume(C),g--,S):C===null||C===32||C===40||Iu(C)?a(C):(e.consume(C),C===92?w:S)}function w(C){return C===40||C===41||C===92?(e.consume(C),S):S(C)}}function O_(e,t,a,s,l,c){const o=this;let u=0,h;return m;function m(x){return e.enter(s),e.enter(l),e.consume(x),e.exit(l),e.enter(c),g}function g(x){return u>999||x===null||x===91||x===93&&!h||x===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?a(x):x===93?(e.exit(c),e.enter(l),e.consume(x),e.exit(l),e.exit(s),t):De(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||De(x)||u++>999?(e.exit("chunkString"),g(x)):(e.consume(x),h||(h=!Qe(x)),x===92?v:p)}function v(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function z_(e,t,a,s,l,c){let o;return u;function u(v){return v===34||v===39||v===40?(e.enter(s),e.enter(l),e.consume(v),e.exit(l),o=v===40?41:v,h):a(v)}function h(v){return v===o?(e.enter(l),e.consume(v),e.exit(l),e.exit(s),t):(e.enter(c),m(v))}function m(v){return v===o?(e.exit(c),h(o)):v===null?a(v):De(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===o||v===null||De(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?p:g)}function p(v){return v===o||v===92?(e.consume(v),g):g(v)}}function wo(e,t){let a;return s;function s(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a=!0,s):Qe(l)?et(e,s,a?"linePrefix":"lineSuffix")(l):t(l)}}const dM={name:"definition",tokenize:hM},fM={partial:!0,tokenize:mM};function hM(e,t,a){const s=this;let l;return c;function c(x){return e.enter("definition"),o(x)}function o(x){return O_.call(s,e,u,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return l=ca(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):a(x)}function h(x){return xt(x)?wo(e,m)(x):m(x)}function m(x){return L_(e,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(fM,p,p)(x)}function p(x){return Qe(x)?et(e,v,"whitespace")(x):v(x)}function v(x){return x===null||De(x)?(e.exit("definition"),s.parser.defined.push(l),t(x)):a(x)}}function mM(e,t,a){return s;function s(u){return xt(u)?wo(e,l)(u):a(u)}function l(u){return z_(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function c(u){return Qe(u)?et(e,o,"whitespace")(u):o(u)}function o(u){return u===null||De(u)?t(u):a(u)}}const pM={name:"hardBreakEscape",tokenize:gM};function gM(e,t,a){return s;function s(c){return e.enter("hardBreakEscape"),e.consume(c),l}function l(c){return De(c)?(e.exit("hardBreakEscape"),t(c)):a(c)}}const yM={name:"headingAtx",resolve:vM,tokenize:bM};function vM(e,t){let a=e.length-2,s=3,l,c;return e[s][1].type==="whitespace"&&(s+=2),a-2>s&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&e[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},c={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},zn(e,s,a-s+1,[["enter",l,t],["enter",c,t],["exit",c,t],["exit",l,t]])),e}function bM(e,t,a){let s=0;return l;function l(g){return e.enter("atxHeading"),c(g)}function c(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&s++<6?(e.consume(g),o):g===null||xt(g)?(e.exit("atxHeadingSequence"),u(g)):a(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||De(g)?(e.exit("atxHeading"),t(g)):Qe(g)?et(e,u,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),u(g))}function m(g){return g===null||g===35||xt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),m)}}const xM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xb=["pre","script","style","textarea"],_M={concrete:!0,name:"htmlFlow",resolveTo:CM,tokenize:NM},SM={partial:!0,tokenize:EM},wM={partial:!0,tokenize:jM};function CM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function NM(e,t,a){const s=this;let l,c,o,u,h;return m;function m(M){return g(M)}function g(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),v):M===47?(e.consume(M),c=!0,S):M===63?(e.consume(M),l=3,s.interrupt?t:T):dn(M)?(e.consume(M),o=String.fromCharCode(M),w):a(M)}function v(M){return M===45?(e.consume(M),l=2,x):M===91?(e.consume(M),l=5,u=0,_):dn(M)?(e.consume(M),l=4,s.interrupt?t:T):a(M)}function x(M){return M===45?(e.consume(M),s.interrupt?t:T):a(M)}function _(M){const se="CDATA[";return M===se.charCodeAt(u++)?(e.consume(M),u===se.length?s.interrupt?t:F:_):a(M)}function S(M){return dn(M)?(e.consume(M),o=String.fromCharCode(M),w):a(M)}function w(M){if(M===null||M===47||M===62||xt(M)){const se=M===47,pe=o.toLowerCase();return!se&&!c&&Xb.includes(pe)?(l=1,s.interrupt?t(M):F(M)):xM.includes(o.toLowerCase())?(l=6,se?(e.consume(M),C):s.interrupt?t(M):F(M)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(M):c?k(M):j(M))}return M===45||nn(M)?(e.consume(M),o+=String.fromCharCode(M),w):a(M)}function C(M){return M===62?(e.consume(M),s.interrupt?t:F):a(M)}function k(M){return Qe(M)?(e.consume(M),k):A(M)}function j(M){return M===47?(e.consume(M),A):M===58||M===95||dn(M)?(e.consume(M),E):Qe(M)?(e.consume(M),j):A(M)}function E(M){return M===45||M===46||M===58||M===95||nn(M)?(e.consume(M),E):O(M)}function O(M){return M===61?(e.consume(M),z):Qe(M)?(e.consume(M),O):j(M)}function z(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(e.consume(M),h=M,I):Qe(M)?(e.consume(M),z):B(M)}function I(M){return M===h?(e.consume(M),h=null,q):M===null||De(M)?a(M):(e.consume(M),I)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||xt(M)?O(M):(e.consume(M),B)}function q(M){return M===47||M===62||Qe(M)?j(M):a(M)}function A(M){return M===62?(e.consume(M),U):a(M)}function U(M){return M===null||De(M)?F(M):Qe(M)?(e.consume(M),U):a(M)}function F(M){return M===45&&l===2?(e.consume(M),H):M===60&&l===1?(e.consume(M),X):M===62&&l===4?(e.consume(M),ce):M===63&&l===3?(e.consume(M),T):M===93&&l===5?(e.consume(M),re):De(M)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(SM,he,$)(M)):M===null||De(M)?(e.exit("htmlFlowData"),$(M)):(e.consume(M),F)}function $(M){return e.check(wM,V,he)(M)}function V(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return M===null||De(M)?$(M):(e.enter("htmlFlowData"),F(M))}function H(M){return M===45?(e.consume(M),T):F(M)}function X(M){return M===47?(e.consume(M),o="",P):F(M)}function P(M){if(M===62){const se=o.toLowerCase();return Xb.includes(se)?(e.consume(M),ce):F(M)}return dn(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),P):F(M)}function re(M){return M===93?(e.consume(M),T):F(M)}function T(M){return M===62?(e.consume(M),ce):M===45&&l===2?(e.consume(M),T):F(M)}function ce(M){return M===null||De(M)?(e.exit("htmlFlowData"),he(M)):(e.consume(M),ce)}function he(M){return e.exit("htmlFlow"),t(M)}}function jM(e,t,a){const s=this;return l;function l(o){return De(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),c):a(o)}function c(o){return s.parser.lazy[s.now().line]?a(o):t(o)}}function EM(e,t,a){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Bo,t,a)}}const kM={name:"htmlText",tokenize:RM};function RM(e,t,a){const s=this;let l,c,o;return u;function u(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),O):T===63?(e.consume(T),j):dn(T)?(e.consume(T),B):a(T)}function m(T){return T===45?(e.consume(T),g):T===91?(e.consume(T),c=0,_):dn(T)?(e.consume(T),k):a(T)}function g(T){return T===45?(e.consume(T),x):a(T)}function p(T){return T===null?a(T):T===45?(e.consume(T),v):De(T)?(o=p,X(T)):(e.consume(T),p)}function v(T){return T===45?(e.consume(T),x):p(T)}function x(T){return T===62?H(T):T===45?v(T):p(T)}function _(T){const ce="CDATA[";return T===ce.charCodeAt(c++)?(e.consume(T),c===ce.length?S:_):a(T)}function S(T){return T===null?a(T):T===93?(e.consume(T),w):De(T)?(o=S,X(T)):(e.consume(T),S)}function w(T){return T===93?(e.consume(T),C):S(T)}function C(T){return T===62?H(T):T===93?(e.consume(T),C):S(T)}function k(T){return T===null||T===62?H(T):De(T)?(o=k,X(T)):(e.consume(T),k)}function j(T){return T===null?a(T):T===63?(e.consume(T),E):De(T)?(o=j,X(T)):(e.consume(T),j)}function E(T){return T===62?H(T):j(T)}function O(T){return dn(T)?(e.consume(T),z):a(T)}function z(T){return T===45||nn(T)?(e.consume(T),z):I(T)}function I(T){return De(T)?(o=I,X(T)):Qe(T)?(e.consume(T),I):H(T)}function B(T){return T===45||nn(T)?(e.consume(T),B):T===47||T===62||xt(T)?q(T):a(T)}function q(T){return T===47?(e.consume(T),H):T===58||T===95||dn(T)?(e.consume(T),A):De(T)?(o=q,X(T)):Qe(T)?(e.consume(T),q):H(T)}function A(T){return T===45||T===46||T===58||T===95||nn(T)?(e.consume(T),A):U(T)}function U(T){return T===61?(e.consume(T),F):De(T)?(o=U,X(T)):Qe(T)?(e.consume(T),U):q(T)}function F(T){return T===null||T===60||T===61||T===62||T===96?a(T):T===34||T===39?(e.consume(T),l=T,$):De(T)?(o=F,X(T)):Qe(T)?(e.consume(T),F):(e.consume(T),V)}function $(T){return T===l?(e.consume(T),l=void 0,K):T===null?a(T):De(T)?(o=$,X(T)):(e.consume(T),$)}function V(T){return T===null||T===34||T===39||T===60||T===61||T===96?a(T):T===47||T===62||xt(T)?q(T):(e.consume(T),V)}function K(T){return T===47||T===62||xt(T)?q(T):a(T)}function H(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):a(T)}function X(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),P}function P(T){return Qe(T)?et(e,re,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):re(T)}function re(T){return e.enter("htmlTextData"),o(T)}}const Lp={name:"labelEnd",resolveAll:DM,resolveTo:LM,tokenize:OM},TM={tokenize:zM},MM={tokenize:IM},AM={tokenize:UM};function DM(e){let t=-1;const a=[];for(;++t<e.length;){const s=e[t][1];if(a.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",t+=l}}return e.length!==a.length&&zn(e,0,e.length,a),e}function LM(e,t){let a=e.length,s=0,l,c,o,u;for(;a--;)if(l=e[a][1],c){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[a][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(o){if(e[a][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(c=a,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(o=a);const h={type:e[c][1].type==="labelLink"?"link":"image",start:R({},e[c][1].start),end:R({},e[e.length-1][1].end)},m={type:"label",start:R({},e[c][1].start),end:R({},e[o][1].end)},g={type:"labelText",start:R({},e[c+s+2][1].end),end:R({},e[o-2][1].start)};return u=[["enter",h,t],["enter",m,t]],u=Jn(u,e.slice(c+1,c+s+3)),u=Jn(u,[["enter",g,t]]),u=Jn(u,id(t.parser.constructs.insideSpan.null,e.slice(c+s+4,o-3),t)),u=Jn(u,[["exit",g,t],e[o-2],e[o-1],["exit",m,t]]),u=Jn(u,e.slice(o+1)),u=Jn(u,[["exit",h,t]]),zn(e,c,e.length,u),e}function OM(e,t,a){const s=this;let l=s.events.length,c,o;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){c=s.events[l][1];break}return u;function u(v){return c?c._inactive?p(v):(o=s.parser.defined.includes(ca(s.sliceSerialize({start:c.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):a(v)}function h(v){return v===40?e.attempt(TM,g,o?g:p)(v):v===91?e.attempt(MM,g,o?m:p)(v):o?g(v):p(v)}function m(v){return e.attempt(AM,g,p)(v)}function g(v){return t(v)}function p(v){return c._balanced=!0,a(v)}}function zM(e,t,a){return s;function s(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),l}function l(p){return xt(p)?wo(e,c)(p):c(p)}function c(p){return p===41?g(p):L_(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return xt(p)?wo(e,h)(p):g(p)}function u(p){return a(p)}function h(p){return p===34||p===39||p===40?z_(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function m(p){return xt(p)?wo(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):a(p)}}function IM(e,t,a){const s=this;return l;function l(u){return O_.call(s,e,c,o,"reference","referenceMarker","referenceString")(u)}function c(u){return s.parser.defined.includes(ca(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(u):a(u)}function o(u){return a(u)}}function UM(e,t,a){return s;function s(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),l}function l(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):a(c)}}const BM={name:"labelStartImage",resolveAll:Lp.resolveAll,tokenize:FM};function FM(e,t,a){const s=this;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),c}function c(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):a(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(u):t(u)}}const HM={name:"labelStartLink",resolveAll:Lp.resolveAll,tokenize:$M};function $M(e,t,a){const s=this;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),c}function c(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(o):t(o)}}const Gh={name:"lineEnding",tokenize:PM};function PM(e,t){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),et(e,t,"linePrefix")}}const Cu={name:"thematicBreak",tokenize:qM};function qM(e,t,a){let s=0,l;return c;function c(m){return e.enter("thematicBreak"),o(m)}function o(m){return l=m,u(m)}function u(m){return m===l?(e.enter("thematicBreakSequence"),h(m)):s>=3&&(m===null||De(m))?(e.exit("thematicBreak"),t(m)):a(m)}function h(m){return m===l?(e.consume(m),s++,h):(e.exit("thematicBreakSequence"),Qe(m)?et(e,u,"whitespace")(m):u(m))}}const vn={continuation:{tokenize:QM},exit:XM,name:"list",tokenize:KM},VM={partial:!0,tokenize:ZM},GM={partial:!0,tokenize:YM};function KM(e,t,a){const s=this,l=s.events[s.events.length-1];let c=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,o=0;return u;function u(x){const _=s.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!s.containerState.marker||x===s.containerState.marker:Lm(x)){if(s.containerState.type||(s.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Cu,a,m)(x):m(x);if(!s.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return a(x)}function h(x){return Lm(x)&&++o<10?(e.consume(x),h):(!s.interrupt||o<2)&&(s.containerState.marker?x===s.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):a(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||x,e.check(Bo,s.interrupt?a:g,e.attempt(VM,v,p))}function g(x){return s.containerState.initialBlankLine=!0,c++,v(x)}function p(x){return Qe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):a(x)}function v(x){return s.containerState.size=c+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function QM(e,t,a){const s=this;return s.containerState._closeFlow=void 0,e.check(Bo,l,c);function l(u){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,et(e,t,"listItemIndent",s.containerState.size+1)(u)}function c(u){return s.containerState.furtherBlankLines||!Qe(u)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,o(u)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(GM,t,o)(u))}function o(u){return s.containerState._closeFlow=!0,s.interrupt=void 0,et(e,e.attempt(vn,t,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function YM(e,t,a){const s=this;return et(e,l,"listItemIndent",s.containerState.size+1);function l(c){const o=s.events[s.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===s.containerState.size?t(c):a(c)}}function XM(e){e.exit(this.containerState.type)}function ZM(e,t,a){const s=this;return et(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(c){const o=s.events[s.events.length-1];return!Qe(c)&&o&&o[1].type==="listItemPrefixWhitespace"?t(c):a(c)}}const Zb={name:"setextUnderline",resolveTo:JM,tokenize:WM};function JM(e,t){let a=e.length,s,l,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){s=a;break}e[a][1].type==="paragraph"&&(l=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const o={type:"setextHeading",start:R({},e[s][1].start),end:R({},e[e.length-1][1].end)};return e[l][1].type="setextHeadingText",c?(e.splice(l,0,["enter",o,t]),e.splice(c+1,0,["exit",e[s][1],t]),e[s][1].end=R({},e[c][1].end)):e[s][1]=o,e.push(["exit",o,t]),e}function WM(e,t,a){const s=this;let l;return c;function c(m){let g=s.events.length,p;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){p=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||p)?(e.enter("setextHeadingLine"),l=m,o(m)):a(m)}function o(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===l?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),Qe(m)?et(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||De(m)?(e.exit("setextHeadingLine"),t(m)):a(m)}}const eA={tokenize:tA};function tA(e){const t=this,a=e.attempt(Bo,s,e.attempt(this.parser.constructs.flowInitial,l,et(e,e.attempt(this.parser.constructs.flow,l,e.attempt(rM,l)),"linePrefix")));return a;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function l(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const nA={resolveAll:U_()},aA=I_("string"),iA=I_("text");function I_(e){return{resolveAll:U_(e==="text"?sA:void 0),tokenize:t};function t(a){const s=this,l=this.parser.constructs[e],c=a.attempt(l,o,u);return o;function o(g){return m(g)?c(g):u(g)}function u(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),h}function h(g){return m(g)?(a.exit("data"),c(g)):(a.consume(g),h)}function m(g){if(g===null)return!0;const p=l[g];let v=-1;if(p)for(;++v<p.length;){const x=p[v];if(!x.previous||x.previous.call(s,s.previous))return!0}return!1}}}function U_(e){return t;function t(a,s){let l=-1,c;for(;++l<=a.length;)c===void 0?a[l]&&a[l][1].type==="data"&&(c=l,l++):(!a[l]||a[l][1].type!=="data")&&(l!==c+2&&(a[c][1].end=a[l-1][1].end,a.splice(c+2,l-c-2),l=c+2),c=void 0);return e?e(a,s):a}}function sA(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const s=e[a-1][1],l=t.sliceStream(s);let c=l.length,o=-1,u=0,h;for(;c--;){const m=l[c];if(typeof m=="string"){for(o=m.length;m.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(m===-2)h=!0,u++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(u=0),u){const m={type:a===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?o:s.start._bufferIndex+o,_index:s.start._index+c,line:s.end.line,column:s.end.column-u,offset:s.end.offset-u},end:R({},s.end)};s.end=R({},m.start),s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(a,0,["enter",m,t],["exit",m,t]),a+=2)}a++}return e}const rA={42:vn,43:vn,45:vn,48:vn,49:vn,50:vn,51:vn,52:vn,53:vn,54:vn,55:vn,56:vn,57:vn,62:T_},lA={91:dM},oA={[-2]:Vh,[-1]:Vh,32:Vh},cA={35:yM,42:Cu,45:[Zb,Cu],60:_M,61:Zb,95:Cu,96:Yb,126:Yb},uA={38:A_,92:M_},dA={[-5]:Gh,[-4]:Gh,[-3]:Gh,33:BM,38:A_,42:Om,60:[HT,kM],91:HM,92:[pM,M_],93:Lp,95:Om,96:eM},fA={null:[Om,nA]},hA={null:[42,95]},mA={null:[]},pA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hA,contentInitial:lA,disable:mA,document:rA,flow:cA,flowInitial:oA,insideSpan:fA,string:uA,text:dA},Symbol.toStringTag,{value:"Module"}));function gA(e,t,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const l={},c=[];let o=[],u=[];const h={attempt:I(O),check:I(z),consume:k,enter:j,exit:E,interrupt:I(z,{interrupt:!0})},m={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:p};let g=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function p(U){return o=Jn(o,U),w(),o[o.length-1]!==null?[]:(B(t,0),m.events=id(c,m.events,m),m.events)}function v(U,F){return vA(x(U),F)}function x(U){return yA(o,U)}function _(){const{_bufferIndex:U,_index:F,line:$,column:V,offset:K}=s;return{_bufferIndex:U,_index:F,line:$,column:V,offset:K}}function S(U){l[U.line]=U.column,A()}function w(){let U;for(;s._index<o.length;){const F=o[s._index];if(typeof F=="string")for(U=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===U&&s._bufferIndex<F.length;)C(F.charCodeAt(s._bufferIndex));else C(F)}}function C(U){g=g(U)}function k(U){De(U)?(s.line++,s.column=1,s.offset+=U===-3?2:1,A()):U!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===o[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=U}function j(U,F){const $=F||{};return $.type=U,$.start=_(),m.events.push(["enter",$,m]),u.push($),$}function E(U){const F=u.pop();return F.end=_(),m.events.push(["exit",F,m]),F}function O(U,F){B(U,F.from)}function z(U,F){F.restore()}function I(U,F){return $;function $(V,K,H){let X,P,re,T;return Array.isArray(V)?he(V):"tokenize"in V?he([V]):ce(V);function ce(ge){return Se;function Se(xe){const Ue=xe!==null&&ge[xe],rt=xe!==null&&ge.null,_t=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(rt)?rt:rt?[rt]:[]];return he(_t)(xe)}}function he(ge){return X=ge,P=0,ge.length===0?H:M(ge[P])}function M(ge){return Se;function Se(xe){return T=q(),re=ge,ge.partial||(m.currentConstruct=ge),ge.name&&m.parser.constructs.disable.null.includes(ge.name)?pe():ge.tokenize.call(F?Object.assign(Object.create(m),F):m,h,se,pe)(xe)}}function se(ge){return U(re,T),K}function pe(ge){return T.restore(),++P<X.length?M(X[P]):H}}}function B(U,F){U.resolveAll&&!c.includes(U)&&c.push(U),U.resolve&&zn(m.events,F,m.events.length-F,U.resolve(m.events.slice(F),m)),U.resolveTo&&(m.events=U.resolveTo(m.events,m))}function q(){const U=_(),F=m.previous,$=m.currentConstruct,V=m.events.length,K=Array.from(u);return{from:V,restore:H};function H(){s=U,m.previous=F,m.currentConstruct=$,m.events.length=V,u=K,A()}}function A(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function yA(e,t){const a=t.start._index,s=t.start._bufferIndex,l=t.end._index,c=t.end._bufferIndex;let o;if(a===l)o=[e[a].slice(s,c)];else{if(o=e.slice(a,l),s>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(s):o.shift()}c>0&&o.push(e[l].slice(0,c))}return o}function vA(e,t){let a=-1;const s=[];let l;for(;++a<e.length;){const c=e[a];let o;if(typeof c=="string")o=c;else switch(c){case-5:{o="\r";break}case-4:{o=`
51
+ `;break}case-3:{o=`\r
52
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&l)continue;o=" ";break}default:o=String.fromCharCode(c)}l=c===-2,s.push(o)}return s.join("")}function bA(e){const t={constructs:k_([pA,...(e||{}).extensions||[]]),content:a(LT),defined:[],document:a(zT),flow:a(eA),lazy:{},string:a(aA),text:a(iA)};return t;function a(s){return l;function l(c){return gA(t,s,c)}}}function xA(e){for(;!D_(e););return e}const Jb=/[\0\t\n\r]/g;function _A(){let e=1,t="",a=!0,s;return l;function l(c,o,u){const h=[];let m,g,p,v,x;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(o||void 0).decode(c)),p=0,t="",a&&(c.charCodeAt(0)===65279&&p++,a=void 0);p<c.length;){if(Jb.lastIndex=p,m=Jb.exec(c),v=m&&m.index!==void 0?m.index:c.length,x=c.charCodeAt(v),!m){t=c.slice(p);break}if(x===10&&p===v&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),p<v&&(h.push(c.slice(p,v)),e+=v-p),x){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}p=v+1}return u&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}const SA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wA(e){return e.replace(SA,CA)}function CA(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),l=s===120||s===88;return R_(a.slice(l?2:1),l?16:10)}return Dp(a)||e}const B_={}.hasOwnProperty;function NA(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),jA(a)(xA(bA(a).document().write(_A()(e,t,!0))))}function jA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Fe),autolinkProtocol:q,autolinkEmail:q,atxHeading:c(qe),blockQuote:c(rt),characterEscape:q,characterReference:q,codeFenced:c(_t),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:c(_t,o),codeText:c(Wt,o),codeTextData:q,data:q,codeFlowValue:q,definition:c(tt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:c(Oe),hardBreakEscape:c(gt),hardBreakTrailing:c(gt),htmlFlow:c(je,o),htmlFlowData:q,htmlText:c(je,o),htmlTextData:q,image:c(lt),label:o,link:c(Fe),listItem:c(da),listItemValue:v,listOrdered:c(ua,p),listUnordered:c(ua),paragraph:c(Ca),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:c(qe),strong:c(ei),thematicBreak:c(Qi)},exit:{atxHeading:h(),atxHeadingSequence:O,autolink:h(),autolinkEmail:Ue,autolinkProtocol:xe,blockQuote:h(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ge,characterReference:Se,codeFenced:h(w),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:A,codeIndented:h(C),codeText:h(K),codeTextData:A,data:A,definition:h(),definitionDestinationString:E,definitionLabelString:k,definitionTitleString:j,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h($),htmlFlowData:A,htmlText:h(V),htmlTextData:A,image:h(X),label:re,labelText:P,lineEnding:U,link:h(H),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:se,resourceDestinationString:T,resourceTitleString:ce,resource:he,setextHeading:h(B),setextHeadingLineSequence:I,setextHeadingText:z,strong:h(),thematicBreak:h()}};F_(t,(e||{}).mdastExtensions||[]);const a={};return s;function s(le){let ve={type:"root",children:[]};const Ee={stack:[ve],tokenStack:[],config:t,enter:u,exit:m,buffer:o,resume:g,data:a},Ze=[];let ke=-1;for(;++ke<le.length;)if(le[ke][1].type==="listOrdered"||le[ke][1].type==="listUnordered")if(le[ke][0]==="enter")Ze.push(ke);else{const yt=Ze.pop();ke=l(le,yt,ke)}for(ke=-1;++ke<le.length;){const yt=t[le[ke][0]];B_.call(yt,le[ke][1].type)&&yt[le[ke][1].type].call(Object.assign({sliceSerialize:le[ke][2].sliceSerialize},Ee),le[ke][1])}if(Ee.tokenStack.length>0){const yt=Ee.tokenStack[Ee.tokenStack.length-1];(yt[1]||Wb).call(Ee,void 0,yt[0])}for(ve.position={start:Ei(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Ei(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)ve=t.transforms[ke](ve)||ve;return ve}function l(le,ve,Ee){let Ze=ve-1,ke=-1,yt=!1,St,kt,wt,ft;for(;++Ze<=Ee;){const ot=le[Ze];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?ke++:ke--,ft=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(St&&!ft&&!ke&&!wt&&(wt=Ze),ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ft=void 0}if(!ke&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||ke===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(St){let fa=Ze;for(kt=void 0;fa--;){const en=le[fa];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;kt&&(le[kt][1].type="lineEndingBlank",yt=!0),en[1].type="lineEnding",kt=fa}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}wt&&(!kt||wt<kt)&&(St._spread=!0),St.end=Object.assign({},kt?le[kt][1].start:ot[1].end),le.splice(kt||Ze,0,["exit",St,ot[2]]),Ze++,Ee++}if(ot[1].type==="listItemPrefix"){const fa={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};St=fa,le.splice(Ze,0,["enter",fa,ot[2]]),Ze++,Ee++,wt=void 0,ft=!0}}}return le[ve][1]._spread=yt,Ee}function c(le,ve){return Ee;function Ee(Ze){u.call(this,le(Ze),Ze),ve&&ve.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(le,ve,Ee){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ve,Ee||void 0]),le.position={start:Ei(ve.start),end:void 0}}function h(le){return ve;function ve(Ee){le&&le.call(this,Ee),m.call(this,Ee)}}function m(le,ve){const Ee=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==le.type&&(ve?ve.call(this,le,Ze[0]):(Ze[1]||Wb).call(this,le,Ze[0]));else throw new Error("Cannot close `"+le.type+"` ("+So({start:le.start,end:le.end})+"): it’s not open");Ee.position.end=Ei(le.end)}function g(){return Ap(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(le){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function x(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=le}function _(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=le}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.value=le.replace(/(\r?\n|\r)$/g,"")}function k(le){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=ca(this.sliceSerialize(le)).toLowerCase()}function j(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.title=le}function E(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.url=le}function O(le){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Ee=this.sliceSerialize(le).length;ve.depth=Ee}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function I(le){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function q(le){const ve=this.stack[this.stack.length-1].children;let Ee=ve[ve.length-1];(!Ee||Ee.type!=="text")&&(Ee=Tt(),Ee.position={start:Ei(le.start),end:void 0},ve.push(Ee)),this.stack.push(Ee)}function A(le){const ve=this.stack.pop();ve.value+=this.sliceSerialize(le),ve.position.end=Ei(le.end)}function U(le){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ve.children[ve.children.length-1];Ee.position.end=Ei(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(q.call(this,le),A.call(this,le))}function F(){this.data.atHardBreak=!0}function $(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.value=le}function V(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.value=le}function K(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.value=le}function H(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ve,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function X(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ve,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function P(le){const ve=this.sliceSerialize(le),Ee=this.stack[this.stack.length-2];Ee.label=wA(ve),Ee.identifier=ca(ve).toLowerCase()}function re(){const le=this.stack[this.stack.length-1],ve=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ze=le.children;Ee.children=Ze}else Ee.alt=ve}function T(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.url=le}function ce(){const le=this.resume(),ve=this.stack[this.stack.length-1];ve.title=le}function he(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function se(le){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=ca(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function pe(le){this.data.characterReferenceType=le.type}function ge(le){const ve=this.sliceSerialize(le),Ee=this.data.characterReferenceType;let Ze;Ee?(Ze=R_(ve,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Dp(ve);const ke=this.stack[this.stack.length-1];ke.value+=Ze}function Se(le){const ve=this.stack.pop();ve.position.end=Ei(le.end)}function xe(le){A.call(this,le);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(le)}function Ue(le){A.call(this,le);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(le)}function rt(){return{type:"blockquote",children:[]}}function _t(){return{type:"code",lang:null,meta:null,value:""}}function Wt(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function gt(){return{type:"break"}}function je(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function ua(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function da(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function Ca(){return{type:"paragraph",children:[]}}function ei(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Qi(){return{type:"thematicBreak"}}}function Ei(e){return{line:e.line,column:e.column,offset:e.offset}}function F_(e,t){let a=-1;for(;++a<t.length;){const s=t[a];Array.isArray(s)?F_(e,s):EA(e,s)}}function EA(e,t){let a;for(a in t)if(B_.call(t,a))switch(a){case"canContainEols":{const s=t[a];s&&e[a].push(...s);break}case"transforms":{const s=t[a];s&&e[a].push(...s);break}case"enter":case"exit":{const s=t[a];s&&Object.assign(e[a],s);break}}}function Wb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+So({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+So({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+So({start:t.start,end:t.end})+") is still open")}function kA(e){const t=this;t.parser=a;function a(s){return NA(s,Y(R(R({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function RA(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function TA(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
53
+ `}]}function MA(e,t){const a=t.value?t.value+`
54
+ `:"",s={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let c={type:"element",tagName:"code",properties:s,children:[{type:"text",value:a}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function AA(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function DA(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function LA(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),l=ll(s.toLowerCase()),c=e.footnoteOrder.indexOf(s);let o,u=e.footnoteCounts.get(s);u===void 0?(u=0,e.footnoteOrder.push(s),o=e.footnoteOrder.length):o=c+1,u+=1,e.footnoteCounts.set(s,u);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+l,id:a+"fnref-"+l+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function OA(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function zA(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function H_(e,t){const a=t.referenceType;let s="]";if(a==="collapsed"?s+="[]":a==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const l=e.all(t),c=l[0];c&&c.type==="text"?c.value="["+c.value:l.unshift({type:"text",value:"["});const o=l[l.length-1];return o&&o.type==="text"?o.value+=s:l.push({type:"text",value:s}),l}function IA(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return H_(e,t);const l={src:ll(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const c={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,c),e.applyData(t,c)}function UA(e,t){const a={src:ll(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function BA(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const s={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function FA(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return H_(e,t);const l={href:ll(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const c={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function HA(e,t){const a={href:ll(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function $A(e,t,a){const s=e.all(t),l=a?PA(a):$_(t),c={},o=[];if(typeof t.checked=="boolean"){const g=s[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},s.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let u=-1;for(;++u<s.length;){const g=s[u];(l||u!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
55
+ `}),g.type==="element"&&g.tagName==="p"&&!l?o.push(...g.children):o.push(g)}const h=s[s.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
56
+ `});const m={type:"element",tagName:"li",properties:c,children:o};return e.patch(t,m),e.applyData(t,m)}function PA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let s=-1;for(;!t&&++s<a.length;)t=$_(a[s])}return t}function $_(e){const t=e.spread;return t!=null?t:e.children.length>1}function qA(e,t){const a={},s=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++l<s.length;){const o=s[l];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)}function VA(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GA(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function KA(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function QA(e,t){const a=e.all(t),s=a.shift(),l=[];if(s){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],o),l.push(o)}if(a.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},u=kp(t.children[1]),h=__(t.children[t.children.length-1]);u&&h&&(o.position={start:u,end:h}),l.push(o)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function YA(e,t,a){const s=a?a.children:void 0,l=(s?s.indexOf(t):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,o=c?c.length:t.children.length;let u=-1;const h=[];for(;++u<o;){const g=t.children[u],p={},v=c?c[u]:void 0;v&&(p.align=v);let x={type:"element",tagName:l,properties:p,children:[]};g&&(x.children=e.all(g),e.patch(g,x),x=e.applyData(g,x)),h.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function XA(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const e0=9,t0=32;function ZA(e){const t=String(e),a=/\r?\n|\r/g;let s=a.exec(t),l=0;const c=[];for(;s;)c.push(n0(t.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=a.exec(t);return c.push(n0(t.slice(l),l>0,!1)),c.join("")}function n0(e,t,a){let s=0,l=e.length;if(t){let c=e.codePointAt(s);for(;c===e0||c===t0;)s++,c=e.codePointAt(s)}if(a){let c=e.codePointAt(l-1);for(;c===e0||c===t0;)l--,c=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function JA(e,t){const a={type:"text",value:ZA(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function WA(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const eD={blockquote:RA,break:TA,code:MA,delete:AA,emphasis:DA,footnoteReference:LA,heading:OA,html:zA,imageReference:IA,image:UA,inlineCode:BA,linkReference:FA,link:HA,listItem:$A,list:qA,paragraph:VA,root:GA,strong:KA,table:QA,tableCell:XA,tableRow:YA,text:JA,thematicBreak:WA,toml:uu,yaml:uu,definition:uu,footnoteDefinition:uu};function uu(){}const P_=-1,sd=0,Co=1,Uu=2,Op=3,zp=4,Ip=5,Up=6,q_=7,V_=8,tD=typeof self=="object"?self:globalThis,a0=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new tD[e](t)},nD=(e,t)=>{const a=(l,c)=>(e.set(c,l),l),s=l=>{if(e.has(l))return e.get(l);const[c,o]=t[l];switch(c){case sd:case P_:return a(o,l);case Co:{const u=a([],l);for(const h of o)u.push(s(h));return u}case Uu:{const u=a({},l);for(const[h,m]of o)u[s(h)]=s(m);return u}case Op:return a(new Date(o),l);case zp:{const{source:u,flags:h}=o;return a(new RegExp(u,h),l)}case Ip:{const u=a(new Map,l);for(const[h,m]of o)u.set(s(h),s(m));return u}case Up:{const u=a(new Set,l);for(const h of o)u.add(s(h));return u}case q_:{const{name:u,message:h}=o;return a(a0(u,h),l)}case V_:return a(BigInt(o),l);case"BigInt":return a(Object(BigInt(o)),l);case"ArrayBuffer":return a(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return a(new DataView(u),o)}}return a(a0(c,o),l)};return s},i0=e=>nD(new Map,e)(0),Ar="",{toString:aD}={},{keys:iD}=Object,co=e=>{const t=typeof e;if(t!=="object"||!e)return[sd,t];const a=aD.call(e).slice(8,-1);switch(a){case"Array":return[Co,Ar];case"Object":return[Uu,Ar];case"Date":return[Op,Ar];case"RegExp":return[zp,Ar];case"Map":return[Ip,Ar];case"Set":return[Up,Ar];case"DataView":return[Co,a]}return a.includes("Array")?[Co,a]:a.includes("Error")?[q_,a]:[Uu,a]},du=([e,t])=>e===sd&&(t==="function"||t==="symbol"),sD=(e,t,a,s)=>{const l=(o,u)=>{const h=s.push(o)-1;return a.set(u,h),h},c=o=>{if(a.has(o))return a.get(o);let[u,h]=co(o);switch(u){case sd:{let g=o;switch(h){case"bigint":u=V_,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return l([P_],o)}return l([u,g],o)}case Co:{if(h){let v=o;return h==="DataView"?v=new Uint8Array(o.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(o)),l([h,[...v]],o)}const g=[],p=l([u,g],o);for(const v of o)g.push(c(v));return p}case Uu:{if(h)switch(h){case"BigInt":return l([h,o.toString()],o);case"Boolean":case"Number":case"String":return l([h,o.valueOf()],o)}if(t&&"toJSON"in o)return c(o.toJSON());const g=[],p=l([u,g],o);for(const v of iD(o))(e||!du(co(o[v])))&&g.push([c(v),c(o[v])]);return p}case Op:return l([u,o.toISOString()],o);case zp:{const{source:g,flags:p}=o;return l([u,{source:g,flags:p}],o)}case Ip:{const g=[],p=l([u,g],o);for(const[v,x]of o)(e||!(du(co(v))||du(co(x))))&&g.push([c(v),c(x)]);return p}case Up:{const g=[],p=l([u,g],o);for(const v of o)(e||!du(co(v)))&&g.push(c(v));return p}}const{message:m}=o;return l([u,{name:h,message:m}],o)};return c},s0=(e,{json:t,lossy:a}={})=>{const s=[];return sD(!(t||a),!!t,new Map,s)(e),s},Bu=typeof structuredClone=="function"?((e,t)=>t&&("json"in t||"lossy"in t)?i0(s0(e,t)):structuredClone(e)):(e,t)=>i0(s0(e,t));function rD(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function lD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function oD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||rD,s=e.options.footnoteBackLabel||lD,l=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),p=String(m.identifier).toUpperCase(),v=ll(p.toLowerCase());let x=0;const _=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++x<=S;){_.length>0&&_.push({type:"text",value:" "});let k=typeof a=="string"?a:a(h,x);typeof k=="string"&&(k={type:"text",value:k}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(h,x),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const w=g[g.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const k=w.children[w.children.length-1];k&&k.type==="text"?k.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(..._)}else g.push(..._);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:Y(R({},Bu(o)),{id:"footnote-label"}),children:[{type:"text",value:l}]},{type:"text",value:`
57
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
58
+ `}]}}const rd=(function(e){if(e==null)return fD;if(typeof e=="function")return ld(e);if(typeof e=="object")return Array.isArray(e)?cD(e):uD(e);if(typeof e=="string")return dD(e);throw new Error("Expected function, string, or object as test")});function cD(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=rd(e[a]);return ld(s);function s(...l){let c=-1;for(;++c<t.length;)if(t[c].apply(this,l))return!0;return!1}}function uD(e){const t=e;return ld(a);function a(s){const l=s;let c;for(c in e)if(l[c]!==t[c])return!1;return!0}}function dD(e){return ld(t);function t(a){return a&&a.type===e}}function ld(e){return t;function t(a,s,l){return!!(hD(a)&&e.call(this,a,typeof s=="number"?s:void 0,l||void 0))}}function fD(){return!0}function hD(e){return e!==null&&typeof e=="object"&&"type"in e}const G_=[],mD=!0,zm=!1,pD="skip";function K_(e,t,a,s){let l;typeof t=="function"&&typeof a!="function"?(s=a,a=t):l=t;const c=rd(l),o=s?-1:1;u(e,void 0,[])();function u(h,m,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=G_,_,S,w;if((!t||c(h,m,g[g.length-1]||void 0))&&(x=gD(a(h,g)),x[0]===zm))return x;if("children"in h&&h.children){const C=h;if(C.children&&x[0]!==pD)for(S=(s?C.children.length:-1)+o,w=g.concat(C);S>-1&&S<C.children.length;){const k=C.children[S];if(_=u(k,S,w)(),_[0]===zm)return _;S=typeof _[1]=="number"?_[1]:S+o}}return x}}}function gD(e){return Array.isArray(e)?e:typeof e=="number"?[mD,e]:e==null?G_:[e]}function Bp(e,t,a,s){let l,c,o;typeof t=="function"&&typeof a!="function"?(c=void 0,o=t,l=a):(c=t,o=a,l=s),K_(e,c,u,l);function u(h,m){const g=m[m.length-1],p=g?g.children.indexOf(h):void 0;return o(h,p,g)}}const Im={}.hasOwnProperty,yD={};function vD(e,t){const a=t||yD,s=new Map,l=new Map,c=new Map,o=R(R({},eD),a.handlers),u={all:m,applyData:xD,definitionById:s,footnoteById:l,footnoteCounts:c,footnoteOrder:[],handlers:o,one:h,options:a,patch:bD,wrap:SD};return Bp(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?s:l,v=String(g.identifier).toUpperCase();p.has(v)||p.set(v,g)}}),u;function h(g,p){const v=g.type,x=u.handlers[v];if(Im.call(u.handlers,v)&&x)return x(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in g){const _=g,{children:S}=_,w=fe(_,["children"]),C=Bu(w);return C.children=u.all(g),C}return Bu(g)}return(u.options.unknownHandler||_D)(u,g,p)}function m(g){const p=[];if("children"in g){const v=g.children;let x=-1;for(;++x<v.length;){const _=u.one(v[x],g);if(_){if(x&&v[x-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=r0(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=r0(S.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function bD(e,t){e.position&&(t.position=rT(e))}function xD(e,t){let a=t;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,c=e.data.hProperties;if(typeof s=="string")if(a.type==="element")a.tagName=s;else{const o="children"in a?a.children:[a];a={type:"element",tagName:s,properties:{},children:o}}a.type==="element"&&c&&Object.assign(a.properties,Bu(c)),"children"in a&&a.children&&l!==null&&l!==void 0&&(a.children=l)}return a}function _D(e,t){const a=t.data||{},s="value"in t&&!(Im.call(a,"hProperties")||Im.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function SD(e,t){const a=[];let s=-1;for(t&&a.push({type:"text",value:`
59
+ `});++s<e.length;)s&&a.push({type:"text",value:`
60
+ `}),a.push(e[s]);return t&&e.length>0&&a.push({type:"text",value:`
61
+ `}),a}function r0(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function l0(e,t){const a=vD(e,t),s=a.one(e,void 0),l=oD(a),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&c.children.push({type:"text",value:`
62
+ `},l),c}function wD(e,t){return e&&"run"in e?function(a,s){return ze(this,null,function*(){const l=l0(a,R({file:s},t));yield e.run(l,s)})}:function(a,s){return l0(a,R({file:s},e||t))}}function o0(e){if(e)throw e}var Nu=Object.prototype.hasOwnProperty,Q_=Object.prototype.toString,c0=Object.defineProperty,u0=Object.getOwnPropertyDescriptor,d0=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Q_.call(e)==="[object Array]"},f0=function(e){if(!e||Q_.call(e)!=="[object Object]")return!1;var t=Nu.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&Nu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!a)return!1;var s;for(s in e);return typeof s>"u"||Nu.call(e,s)},h0=function(e,t){c0&&t.name==="__proto__"?c0(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},m0=function(e,t){if(t==="__proto__")if(Nu.call(e,t)){if(u0)return u0(e,t).value}else return;return e[t]},CD=function e(){var t,a,s,l,c,o,u=arguments[0],h=1,m=arguments.length,g=!1;for(typeof u=="boolean"&&(g=u,u=arguments[1]||{},h=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});h<m;++h)if(t=arguments[h],t!=null)for(a in t)s=m0(u,a),l=m0(t,a),u!==l&&(g&&l&&(f0(l)||(c=d0(l)))?(c?(c=!1,o=s&&d0(s)?s:[]):o=s&&f0(s)?s:{},h0(u,{name:a,newValue:e(g,o,l)})):typeof l<"u"&&h0(u,{name:a,newValue:l}));return u};const Kh=x_(CD);function Um(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ND(){const e=[],t={run:a,use:s};return t;function a(...l){let c=-1;const o=l.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...l);function u(h,...m){const g=e[++c];let p=-1;if(h){o(h);return}for(;++p<l.length;)(m[p]===null||m[p]===void 0)&&(m[p]=l[p]);l=m,g?jD(g,u)(...m):o(null,...m)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function jD(e,t){let a;return s;function s(...o){const u=e.length>o.length;let h;u&&o.push(l);try{h=e.apply(this,o)}catch(m){const g=m;if(u&&a)throw g;return l(g)}u||(h&&h.then&&typeof h.then=="function"?h.then(c,l):h instanceof Error?l(h):c(h))}function l(o,...u){a||(a=!0,t(o,...u))}function c(o){l(null,o)}}const va={basename:ED,dirname:kD,extname:RD,join:TD,sep:"/"};function ED(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fo(e);let a=0,s=-1,l=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(c){a=l+1;break}}else s<0&&(c=!0,s=l+1);return s<0?"":e.slice(a,s)}if(t===e)return"";let o=-1,u=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(c){a=l+1;break}}else o<0&&(c=!0,o=l+1),u>-1&&(e.codePointAt(l)===t.codePointAt(u--)?u<0&&(s=l):(u=-1,s=o));return a===s?s=o:s<0&&(s=e.length),e.slice(a,s)}function kD(e){if(Fo(e),e.length===0)return".";let t=-1,a=e.length,s;for(;--a;)if(e.codePointAt(a)===47){if(s){t=a;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function RD(e){Fo(e);let t=e.length,a=-1,s=0,l=-1,c=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){s=t+1;break}continue}a<0&&(o=!0,a=t+1),u===46?l<0?l=t:c!==1&&(c=1):l>-1&&(c=-1)}return l<0||a<0||c===0||c===1&&l===a-1&&l===s+1?"":e.slice(l,a)}function TD(...e){let t=-1,a;for(;++t<e.length;)Fo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":MD(a)}function MD(e){Fo(e);const t=e.codePointAt(0)===47;let a=AD(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function AD(e,t){let a="",s=0,l=-1,c=0,o=-1,u,h;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(l===o-1||c===1))if(l!==o-1&&c===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",s=0):(a=a.slice(0,h),s=a.length-1-a.lastIndexOf("/")),l=o,c=0;continue}}else if(a.length>0){a="",s=0,l=o,c=0;continue}}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(l+1,o):a=e.slice(l+1,o),s=o-l-1;l=o,c=0}else u===46&&c>-1?c++:c=-1}return a}function Fo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const DD={cwd:LD};function LD(){return"/"}function Bm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OD(e){if(typeof e=="string")e=new URL(e);else if(!Bm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zD(e)}function zD(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const s=t.codePointAt(a+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Qh=["history","path","basename","stem","extname","dirname"];class Y_{constructor(t){let a;t?Bm(t)?a={path:t}:typeof t=="string"||ID(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":DD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Qh.length;){const c=Qh[s];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let l;for(l in a)Qh.includes(l)||(this[l]=a[l])}get basename(){return typeof this.path=="string"?va.basename(this.path):void 0}set basename(t){Xh(t,"basename"),Yh(t,"basename"),this.path=va.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?va.dirname(this.path):void 0}set dirname(t){p0(this.basename,"dirname"),this.path=va.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?va.extname(this.path):void 0}set extname(t){if(Yh(t,"extname"),p0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=va.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bm(t)&&(t=OD(t)),Xh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?va.basename(this.path,this.extname):void 0}set stem(t){Xh(t,"stem"),Yh(t,"stem"),this.path=va.join(this.dirname||"",t+(this.extname||""))}fail(t,a,s){const l=this.message(t,a,s);throw l.fatal=!0,l}info(t,a,s){const l=this.message(t,a,s);return l.fatal=void 0,l}message(t,a,s){const l=new sn(t,a,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Yh(e,t){if(e&&e.includes(va.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+va.sep+"`")}function Xh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function p0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ID(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UD=(function(e){const t=this.constructor.prototype,a=t[e],s=function(){return a.apply(s,arguments)};return Object.setPrototypeOf(s,t),s}),BD={}.hasOwnProperty;class Fp extends UD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ND()}copy(){const t=new Fp;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];t.use(...s)}return t.data(Kh(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Wh("data",this.frozen),this.namespace[t]=a,this):BD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=a.call(t,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=fu(t),s=this.parser||this.Parser;return Zh("parse",s),s(String(a),a)}process(t,a){const s=this;return this.freeze(),Zh("process",this.parser||this.Parser),Jh("process",this.compiler||this.Compiler),a?l(void 0,a):new Promise(l);function l(c,o){const u=fu(t),h=s.parse(u);s.run(h,u,function(g,p,v){if(g||!p||!v)return m(g);const x=p,_=s.stringify(x,v);$D(_)?v.value=_:v.result=_,m(g,v)});function m(g,p){g||!p?o(g):c?c(p):a(void 0,p)}}}processSync(t){let a=!1,s;return this.freeze(),Zh("processSync",this.parser||this.Parser),Jh("processSync",this.compiler||this.Compiler),this.process(t,l),y0("processSync","process",a),s;function l(c,o){a=!0,o0(c),s=o}}run(t,a,s){g0(t),this.freeze();const l=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?c(void 0,s):new Promise(c);function c(o,u){const h=fu(a);l.run(t,h,m);function m(g,p,v){const x=p||t;g?u(g):o?o(x):s(void 0,x,v)}}}runSync(t,a){let s=!1,l;return this.run(t,a,c),y0("runSync","run",s),l;function c(o,u){o0(o),l=u,s=!0}}stringify(t,a){this.freeze();const s=fu(a),l=this.compiler||this.Compiler;return Jh("stringify",l),g0(t),l(t,s)}use(t,...a){const s=this.attachers,l=this.namespace;if(Wh("use",this.frozen),t!=null)if(typeof t=="function")h(t,a);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...p]=m;h(g,p)}else o(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function o(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(m.plugins),m.settings&&(l.settings=Kh(!0,l.settings,m.settings))}function u(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const p=m[g];c(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let p=-1,v=-1;for(;++p<s.length;)if(s[p][0]===m){v=p;break}if(v===-1)s.push([m,...g]);else if(g.length>0){let[x,..._]=g;const S=s[v][1];Um(S)&&Um(x)&&(x=Kh(!0,S,x)),s[v]=[m,x,..._]}}}}const FD=new Fp().freeze();function Zh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g0(e){if(!Um(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y0(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fu(e){return HD(e)?e:new Y_(e)}function HD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $D(e){return typeof e=="string"||PD(e)}function PD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",v0=[],b0={allowDangerousHtml:!0},VD=/^(https?|ircs?|mailto|xmpp)$/i,GD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function KD(e){const t=QD(e),a=YD(e);return XD(t.runSync(t.parse(a),a),e)}function QD(e){const t=e.rehypePlugins||v0,a=e.remarkPlugins||v0,s=e.remarkRehypeOptions?R(R({},e.remarkRehypeOptions),b0):b0;return FD().use(kA).use(a).use(wD,s).use(t)}function YD(e){const t=e.children||"",a=new Y_;return typeof t=="string"&&(a.value=t),a}function XD(e,t){const a=t.allowedElements,s=t.allowElement,l=t.components,c=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||ZD;for(const g of GD)Object.hasOwn(t,g.from)&&""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+qD+g.id;return Bp(e,m),dT(e,{Fragment:f.Fragment,components:l,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function m(g,p,v){if(g.type==="raw"&&v&&typeof p=="number")return o?v.children.splice(p,1):v.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let x;for(x in qh)if(Object.hasOwn(qh,x)&&Object.hasOwn(g.properties,x)){const _=g.properties[x],S=qh[x];(S===null||S.includes(g.tagName))&&(g.properties[x]=h(String(_||""),x,g))}}if(g.type==="element"){let x=a?!a.includes(g.tagName):c?c.includes(g.tagName):!1;if(!x&&s&&typeof p=="number"&&(x=!s(g,p,v)),x&&v&&typeof p=="number")return u&&g.children?v.children.splice(p,1,...g.children):v.children.splice(p,1),p}}}function ZD(e){const t=e.indexOf(":"),a=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||a!==-1&&t>a||s!==-1&&t>s||VD.test(e.slice(0,t))?e:""}function x0(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,l=a.indexOf(t);for(;l!==-1;)s++,l=a.indexOf(t,l+t.length);return s}function JD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WD(e,t,a){const s=rd((a||{}).ignore||[]),l=eL(t);let c=-1;for(;++c<l.length;)K_(e,"text",o);function o(h,m){let g=-1,p;for(;++g<m.length;){const v=m[g],x=p?p.children:void 0;if(s(v,x?x.indexOf(v):void 0,p))return;p=v}if(p)return u(h,m)}function u(h,m){const g=m[m.length-1],p=l[c][0],v=l[c][1];let x=0;const _=g.children.indexOf(h);let S=!1,w=[];p.lastIndex=0;let C=p.exec(h.value);for(;C;){const k=C.index,j={index:C.index,input:C.input,stack:[...m,h]};let E=v(...C,j);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=k+1:(x!==k&&w.push({type:"text",value:h.value.slice(x,k)}),Array.isArray(E)?w.push(...E):E&&w.push(E),x=k+C[0].length,S=!0),!p.global)break;C=p.exec(h.value)}return S?(x<h.value.length&&w.push({type:"text",value:h.value.slice(x)}),g.children.splice(_,1,...w)):w=[h],_+w.length}}function eL(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const l=a[s];t.push([tL(l[0]),nL(l[1])])}return t}function tL(e){return typeof e=="string"?new RegExp(JD(e),"g"):e}function nL(e){return typeof e=="function"?e:function(){return e}}const em="phrasing",tm=["autolink","link","image","label"];function aL(){return{transforms:[uL],enter:{literalAutolink:sL,literalAutolinkEmail:nm,literalAutolinkHttp:nm,literalAutolinkWww:nm},exit:{literalAutolink:cL,literalAutolinkEmail:oL,literalAutolinkHttp:rL,literalAutolinkWww:lL}}}function iL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:em,notInConstruct:tm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:em,notInConstruct:tm},{character:":",before:"[ps]",after:"\\/",inConstruct:em,notInConstruct:tm}]}}function sL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function nm(e){this.config.enter.autolinkProtocol.call(this,e)}function rL(e){this.config.exit.autolinkProtocol.call(this,e)}function lL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function oL(e){this.config.exit.autolinkEmail.call(this,e)}function cL(e){this.exit(e)}function uL(e){WD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,dL],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fL]],{ignore:["link","linkReference"]})}function dL(e,t,a,s,l){let c="";if(!X_(l)||(/^w/i.test(t)&&(a=t+a,t="",c="http://"),!hL(a)))return!1;const o=mL(a+s);if(!o[0])return!1;const u={type:"link",title:null,url:c+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function fL(e,t,a,s){return!X_(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function hL(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function mL(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],s=a.indexOf(")");const l=x0(e,"(");let c=x0(e,")");for(;s!==-1&&l>c;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),c++;return[e,a]}function X_(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Us(a)||ad(a))&&(!t||a!==47)}Z_.peek=wL;function pL(){this.buffer()}function gL(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yL(){this.buffer()}function vL(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function bL(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ca(this.sliceSerialize(e)).toLowerCase(),a.label=t}function xL(e){this.exit(e)}function _L(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ca(this.sliceSerialize(e)).toLowerCase(),a.label=t}function SL(e){this.exit(e)}function wL(){return"["}function Z_(e,t,a,s){const l=a.createTracker(s);let c=l.move("[^");const o=a.enter("footnoteReference"),u=a.enter("reference");return c+=l.move(a.safe(a.associationId(e),{after:"]",before:c})),u(),o(),c+=l.move("]"),c}function CL(){return{enter:{gfmFootnoteCallString:pL,gfmFootnoteCall:gL,gfmFootnoteDefinitionLabelString:yL,gfmFootnoteDefinition:vL},exit:{gfmFootnoteCallString:bL,gfmFootnoteCall:xL,gfmFootnoteDefinitionLabelString:_L,gfmFootnoteDefinition:SL}}}function NL(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:Z_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(s,l,c,o){const u=c.createTracker(o);let h=u.move("[^");const m=c.enter("footnoteDefinition"),g=c.enter("label");return h+=u.move(c.safe(c.associationId(s),{before:h,after:"]"})),g(),h+=u.move("]:"),s.children&&s.children.length>0&&(u.shift(4),h+=u.move((t?`
63
+ `:" ")+c.indentLines(c.containerFlow(s,u.current()),t?J_:jL))),m(),h}}function jL(e,t,a){return t===0?e:J_(e,t,a)}function J_(e,t,a){return(a?"":" ")+e}const EL=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];W_.peek=AL;function kL(){return{canContainEols:["delete"],enter:{strikethrough:TL},exit:{strikethrough:ML}}}function RL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EL}],handlers:{delete:W_}}}function TL(e){this.enter({type:"delete",children:[]},e)}function ML(e){this.exit(e)}function W_(e,t,a,s){const l=a.createTracker(s),c=a.enter("strikethrough");let o=l.move("~~");return o+=a.containerPhrasing(e,Y(R({},l.current()),{before:o,after:"~"})),o+=l.move("~~"),c(),o}function AL(){return"~"}function DL(e){return e.length}function LL(e,t){const a=t||{},s=(a.align||[]).concat(),l=a.stringLength||DL,c=[],o=[],u=[],h=[];let m=0,g=-1;for(;++g<e.length;){const S=[],w=[];let C=-1;for(e[g].length>m&&(m=e[g].length);++C<e[g].length;){const k=OL(e[g][C]);if(a.alignDelimiters!==!1){const j=l(k);w[C]=j,(h[C]===void 0||j>h[C])&&(h[C]=j)}S.push(k)}o[g]=S,u[g]=w}let p=-1;if(typeof s=="object"&&"length"in s)for(;++p<m;)c[p]=_0(s[p]);else{const S=_0(s);for(;++p<m;)c[p]=S}p=-1;const v=[],x=[];for(;++p<m;){const S=c[p];let w="",C="";S===99?(w=":",C=":"):S===108?w=":":S===114&&(C=":");let k=a.alignDelimiters===!1?1:Math.max(1,h[p]-w.length-C.length);const j=w+"-".repeat(k)+C;a.alignDelimiters!==!1&&(k=w.length+k+C.length,k>h[p]&&(h[p]=k),x[p]=k),v[p]=j}o.splice(1,0,v),u.splice(1,0,x),g=-1;const _=[];for(;++g<o.length;){const S=o[g],w=u[g];p=-1;const C=[];for(;++p<m;){const k=S[p]||"";let j="",E="";if(a.alignDelimiters!==!1){const O=h[p]-(w[p]||0),z=c[p];z===114?j=" ".repeat(O):z===99?O%2?(j=" ".repeat(O/2+.5),E=" ".repeat(O/2-.5)):(j=" ".repeat(O/2),E=j):E=" ".repeat(O)}a.delimiterStart!==!1&&!p&&C.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&k==="")&&(a.delimiterStart!==!1||p)&&C.push(" "),a.alignDelimiters!==!1&&C.push(j),C.push(k),a.alignDelimiters!==!1&&C.push(E),a.padding!==!1&&C.push(" "),(a.delimiterEnd!==!1||p!==m-1)&&C.push("|")}_.push(a.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return _.join(`
64
+ `)}function OL(e){return e==null?"":String(e)}function _0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function zL(e,t,a,s){const l=a.enter("blockquote"),c=a.createTracker(s);c.move("> "),c.shift(2);const o=a.indentLines(a.containerFlow(e,c.current()),IL);return l(),o}function IL(e,t,a){return">"+(a?"":" ")+e}function UL(e,t){return S0(e,t.inConstruct,!0)&&!S0(e,t.notInConstruct,!1)}function S0(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function w0(e,t,a,s){let l=-1;for(;++l<a.unsafe.length;)if(a.unsafe[l].character===`
65
+ `&&UL(a.stack,a.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
66
+ `}function BL(e,t){const a=String(e);let s=a.indexOf(t),l=s,c=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++c>o&&(o=c):c=1,l=s+t.length,s=a.indexOf(t,l);return o}function FL(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HL(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function $L(e,t,a,s){const l=HL(a),c=e.value||"",o=l==="`"?"GraveAccent":"Tilde";if(FL(e,a)){const p=a.enter("codeIndented"),v=a.indentLines(c,PL);return p(),v}const u=a.createTracker(s),h=l.repeat(Math.max(BL(c,l)+1,3)),m=a.enter("codeFenced");let g=u.move(h);if(e.lang){const p=a.enter(`codeFencedLang${o}`);g+=u.move(a.safe(e.lang,R({before:g,after:" ",encode:["`"]},u.current()))),p()}if(e.lang&&e.meta){const p=a.enter(`codeFencedMeta${o}`);g+=u.move(" "),g+=u.move(a.safe(e.meta,R({before:g,after:`
67
+ `,encode:["`"]},u.current()))),p()}return g+=u.move(`
68
+ `),c&&(g+=u.move(c+`
69
+ `)),g+=u.move(h),m(),g}function PL(e,t,a){return(a?"":" ")+e}function Hp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function qL(e,t,a,s){const l=Hp(a),c=l==='"'?"Quote":"Apostrophe",o=a.enter("definition");let u=a.enter("label");const h=a.createTracker(s);let m=h.move("[");return m+=h.move(a.safe(a.associationId(e),R({before:m,after:"]"},h.current()))),m+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,R({before:m,after:">"},h.current()))),m+=h.move(">")):(u=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,R({before:m,after:e.title?" ":`
70
+ `},h.current())))),u(),e.title&&(u=a.enter(`title${c}`),m+=h.move(" "+l),m+=h.move(a.safe(e.title,R({before:m,after:l},h.current()))),m+=h.move(l),u()),o(),m}function VL(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ao(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fu(e,t,a){const s=tl(e),l=tl(t);return s===void 0?l===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}eS.peek=GL;function eS(e,t,a,s){const l=VL(a),c=a.enter("emphasis"),o=a.createTracker(s),u=o.move(l);let h=o.move(a.containerPhrasing(e,R({after:l,before:u},o.current())));const m=h.charCodeAt(0),g=Fu(s.before.charCodeAt(s.before.length-1),m,l);g.inside&&(h=Ao(m)+h.slice(1));const p=h.charCodeAt(h.length-1),v=Fu(s.after.charCodeAt(0),p,l);v.inside&&(h=h.slice(0,-1)+Ao(p));const x=o.move(l);return c(),a.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+x}function GL(e,t,a){return a.options.emphasis||"*"}function KL(e,t){let a=!1;return Bp(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return a=!0,zm}),!!((!e.depth||e.depth<3)&&Ap(e)&&(t.options.setext||a))}function QL(e,t,a,s){const l=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(s);if(KL(e,a)){const g=a.enter("headingSetext"),p=a.enter("phrasing"),v=a.containerPhrasing(e,Y(R({},c.current()),{before:`
71
+ `,after:`
72
+ `}));return p(),g(),v+`
73
+ `+(l===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
74
+ `))+1))}const o="#".repeat(l),u=a.enter("headingAtx"),h=a.enter("phrasing");c.move(o+" ");let m=a.containerPhrasing(e,R({before:"# ",after:`
75
+ `},c.current()));return/^[\t ]/.test(m)&&(m=Ao(m.charCodeAt(0))+m.slice(1)),m=m?o+" "+m:o,a.options.closeAtx&&(m+=" "+o),h(),u(),m}tS.peek=YL;function tS(e){return e.value||""}function YL(){return"<"}nS.peek=XL;function nS(e,t,a,s){const l=Hp(a),c=l==='"'?"Quote":"Apostrophe",o=a.enter("image");let u=a.enter("label");const h=a.createTracker(s);let m=h.move("![");return m+=h.move(a.safe(e.alt,R({before:m,after:"]"},h.current()))),m+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,R({before:m,after:">"},h.current()))),m+=h.move(">")):(u=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,R({before:m,after:e.title?" ":")"},h.current())))),u(),e.title&&(u=a.enter(`title${c}`),m+=h.move(" "+l),m+=h.move(a.safe(e.title,R({before:m,after:l},h.current()))),m+=h.move(l),u()),m+=h.move(")"),o(),m}function XL(){return"!"}aS.peek=ZL;function aS(e,t,a,s){const l=e.referenceType,c=a.enter("imageReference");let o=a.enter("label");const u=a.createTracker(s);let h=u.move("![");const m=a.safe(e.alt,R({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=a.stack;a.stack=[],o=a.enter("reference");const p=a.safe(a.associationId(e),R({before:h,after:"]"},u.current()));return o(),a.stack=g,c(),l==="full"||!m||m!==p?h+=u.move(p+"]"):l==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function ZL(){return"!"}iS.peek=JL;function iS(e,t,a){let s=e.value||"",l="`",c=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++c<a.unsafe.length;){const o=a.unsafe[c],u=a.compilePattern(o);let h;if(o.atBreak)for(;h=u.exec(s);){let m=h.index;s.charCodeAt(m)===10&&s.charCodeAt(m-1)===13&&m--,s=s.slice(0,m)+" "+s.slice(h.index+1)}}return l+s+l}function JL(){return"`"}function sS(e,t){const a=Ap(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}rS.peek=WL;function rS(e,t,a,s){const l=Hp(a),c=l==='"'?"Quote":"Apostrophe",o=a.createTracker(s);let u,h;if(sS(e,a)){const g=a.stack;a.stack=[],u=a.enter("autolink");let p=o.move("<");return p+=o.move(a.containerPhrasing(e,R({before:p,after:">"},o.current()))),p+=o.move(">"),u(),a.stack=g,p}u=a.enter("link"),h=a.enter("label");let m=o.move("[");return m+=o.move(a.containerPhrasing(e,R({before:m,after:"]("},o.current()))),m+=o.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),m+=o.move("<"),m+=o.move(a.safe(e.url,R({before:m,after:">"},o.current()))),m+=o.move(">")):(h=a.enter("destinationRaw"),m+=o.move(a.safe(e.url,R({before:m,after:e.title?" ":")"},o.current())))),h(),e.title&&(h=a.enter(`title${c}`),m+=o.move(" "+l),m+=o.move(a.safe(e.title,R({before:m,after:l},o.current()))),m+=o.move(l),h()),m+=o.move(")"),u(),m}function WL(e,t,a){return sS(e,a)?"<":"["}lS.peek=e3;function lS(e,t,a,s){const l=e.referenceType,c=a.enter("linkReference");let o=a.enter("label");const u=a.createTracker(s);let h=u.move("[");const m=a.containerPhrasing(e,R({before:h,after:"]"},u.current()));h+=u.move(m+"]["),o();const g=a.stack;a.stack=[],o=a.enter("reference");const p=a.safe(a.associationId(e),R({before:h,after:"]"},u.current()));return o(),a.stack=g,c(),l==="full"||!m||m!==p?h+=u.move(p+"]"):l==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function e3(){return"["}function $p(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function t3(e){const t=$p(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function n3(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function oS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function a3(e,t,a,s){const l=a.enter("list"),c=a.bulletCurrent;let o=e.ordered?n3(a):$p(a);const u=e.ordered?o==="."?")":".":t3(a);let h=t&&a.bulletLastUsed?o===a.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),oS(a)===o&&g){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(o=u),a.bulletCurrent=o;const m=a.containerFlow(e,s);return a.bulletLastUsed=o,a.bulletCurrent=c,l(),m}function i3(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function s3(e,t,a,s){const l=i3(a);let c=a.bulletCurrent||$p(a);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let o=c.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const u=a.createTracker(s);u.move(c+" ".repeat(o-c.length)),u.shift(o);const h=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,u.current()),g);return h(),m;function g(p,v,x){return v?(x?"":" ".repeat(o))+p:(x?c:c+" ".repeat(o-c.length))+p}}function r3(e,t,a,s){const l=a.enter("paragraph"),c=a.enter("phrasing"),o=a.containerPhrasing(e,s);return c(),l(),o}const l3=rd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function o3(e,t,a,s){return(e.children.some(function(l){return l3(l)})?a.containerPhrasing:a.containerFlow).call(a,e,s)}function c3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}cS.peek=u3;function cS(e,t,a,s){const l=c3(a),c=a.enter("strong"),o=a.createTracker(s),u=o.move(l+l);let h=o.move(a.containerPhrasing(e,R({after:l,before:u},o.current())));const m=h.charCodeAt(0),g=Fu(s.before.charCodeAt(s.before.length-1),m,l);g.inside&&(h=Ao(m)+h.slice(1));const p=h.charCodeAt(h.length-1),v=Fu(s.after.charCodeAt(0),p,l);v.inside&&(h=h.slice(0,-1)+Ao(p));const x=o.move(l+l);return c(),a.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+x}function u3(e,t,a){return a.options.strong||"*"}function d3(e,t,a,s){return a.safe(e.value,s)}function f3(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function h3(e,t,a){const s=(oS(a)+(a.options.ruleSpaces?" ":"")).repeat(f3(a));return a.options.ruleSpaces?s.slice(0,-1):s}const uS={blockquote:zL,break:w0,code:$L,definition:qL,emphasis:eS,hardBreak:w0,heading:QL,html:tS,image:nS,imageReference:aS,inlineCode:iS,link:rS,linkReference:lS,list:a3,listItem:s3,paragraph:r3,root:o3,strong:cS,text:d3,thematicBreak:h3};function m3(){return{enter:{table:p3,tableData:C0,tableHeader:C0,tableRow:y3},exit:{codeText:v3,table:g3,tableData:am,tableHeader:am,tableRow:am}}}function p3(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function g3(e){this.exit(e),this.data.inTable=void 0}function y3(e){this.enter({type:"tableRow",children:[]},e)}function am(e){this.exit(e)}function C0(e){this.enter({type:"tableCell",children:[]},e)}function v3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,b3));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function b3(e,t){return t==="|"?t:e}function x3(e){const t=e||{},a=t.tableCellPadding,s=t.tablePipeAlign,l=t.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:o,tableCell:h,tableRow:u}};function o(x,_,S,w){return m(g(x,S,w),x.align)}function u(x,_,S,w){const C=p(x,S,w),k=m([C]);return k.slice(0,k.indexOf(`
77
+ `))}function h(x,_,S,w){const C=S.enter("tableCell"),k=S.enter("phrasing"),j=S.containerPhrasing(x,Y(R({},w),{before:c,after:c}));return k(),C(),j}function m(x,_){return LL(x,{align:_,alignDelimiters:s,padding:a,stringLength:l})}function g(x,_,S){const w=x.children;let C=-1;const k=[],j=_.enter("table");for(;++C<w.length;)k[C]=p(w[C],_,S);return j(),k}function p(x,_,S){const w=x.children;let C=-1;const k=[],j=_.enter("tableRow");for(;++C<w.length;)k[C]=h(w[C],x,_,S);return j(),k}function v(x,_,S){let w=uS.inlineCode(x,_,S);return S.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function _3(){return{exit:{taskListCheckValueChecked:N0,taskListCheckValueUnchecked:N0,paragraph:w3}}}function S3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:C3}}}function N0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w3(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const s=a.children[0];if(s&&s.type==="text"){const l=t.children;let c=-1,o;for(;++c<l.length;){const u=l[c];if(u.type==="paragraph"){o=u;break}}o===a&&(s.value=s.value.slice(1),s.value.length===0?a.children.shift():a.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function C3(e,t,a,s){const l=e.children[0],c=typeof e.checked=="boolean"&&l&&l.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",u=a.createTracker(s);c&&u.move(o);let h=uS.listItem(e,t,a,R(R({},s),u.current()));return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+o}}function N3(){return[aL(),CL(),kL(),m3(),_3()]}function j3(e){return{extensions:[iL(),NL(e),RL(),x3(e),S3()]}}const E3={tokenize:D3,partial:!0},dS={tokenize:L3,partial:!0},fS={tokenize:O3,partial:!0},hS={tokenize:z3,partial:!0},k3={tokenize:I3,partial:!0},mS={name:"wwwAutolink",tokenize:M3,previous:gS},pS={name:"protocolAutolink",tokenize:A3,previous:yS},Wa={name:"emailAutolink",tokenize:T3,previous:vS},wa={};function R3(){return{text:wa}}let ms=48;for(;ms<123;)wa[ms]=Wa,ms++,ms===58?ms=65:ms===91&&(ms=97);wa[43]=Wa;wa[45]=Wa;wa[46]=Wa;wa[95]=Wa;wa[72]=[Wa,pS];wa[104]=[Wa,pS];wa[87]=[Wa,mS];wa[119]=[Wa,mS];function T3(e,t,a){const s=this;let l,c;return o;function o(p){return!Fm(p)||!vS.call(s,s.previous)||Pp(s.events)?a(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return Fm(p)?(e.consume(p),u):p===64?(e.consume(p),h):a(p)}function h(p){return p===46?e.check(k3,g,m)(p):p===45||p===95||nn(p)?(c=!0,e.consume(p),h):g(p)}function m(p){return e.consume(p),l=!0,h}function g(p){return c&&l&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):a(p)}}function M3(e,t,a){const s=this;return l;function l(o){return o!==87&&o!==119||!gS.call(s,s.previous)||Pp(s.events)?a(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(E3,e.attempt(dS,e.attempt(fS,c),a),a)(o))}function c(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function A3(e,t,a){const s=this;let l="",c=!1;return o;function o(p){return(p===72||p===104)&&yS.call(s,s.previous)&&!Pp(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(p),e.consume(p),u):a(p)}function u(p){if(dn(p)&&l.length<5)return l+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const v=l.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return a(p)}function h(p){return p===47?(e.consume(p),c?m:(c=!0,h)):a(p)}function m(p){return p===null||Iu(p)||xt(p)||Us(p)||ad(p)?a(p):e.attempt(dS,e.attempt(fS,g),a)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function D3(e,t,a){let s=0;return l;function l(o){return(o===87||o===119)&&s<3?(s++,e.consume(o),l):o===46&&s===3?(e.consume(o),c):a(o)}function c(o){return o===null?a(o):t(o)}}function L3(e,t,a){let s,l,c;return o;function o(m){return m===46||m===95?e.check(hS,h,u)(m):m===null||xt(m)||Us(m)||m!==45&&ad(m)?h(m):(c=!0,e.consume(m),o)}function u(m){return m===95?s=!0:(l=s,s=void 0),e.consume(m),o}function h(m){return l||s||!c?a(m):t(m)}}function O3(e,t){let a=0,s=0;return l;function l(o){return o===40?(a++,e.consume(o),l):o===41&&s<a?c(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(hS,t,c)(o):o===null||xt(o)||Us(o)?t(o):(e.consume(o),l)}function c(o){return o===41&&s++,e.consume(o),l}}function z3(e,t,a){return s;function s(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),s):u===38?(e.consume(u),c):u===93?(e.consume(u),l):u===60||u===null||xt(u)||Us(u)?t(u):a(u)}function l(u){return u===null||u===40||u===91||xt(u)||Us(u)?t(u):s(u)}function c(u){return dn(u)?o(u):a(u)}function o(u){return u===59?(e.consume(u),s):dn(u)?(e.consume(u),o):a(u)}}function I3(e,t,a){return s;function s(c){return e.consume(c),l}function l(c){return nn(c)?a(c):t(c)}}function gS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function yS(e){return!dn(e)}function vS(e){return!(e===47||Fm(e))}function Fm(e){return e===43||e===45||e===46||e===95||nn(e)}function Pp(e){let t=e.length,a=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){a=!0;break}if(s._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const U3={tokenize:G3,partial:!0};function B3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:P3,continuation:{tokenize:q3},exit:V3}},text:{91:{name:"gfmFootnoteCall",tokenize:$3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:F3,resolveTo:H3}}}}function F3(e,t,a){const s=this;let l=s.events.length;const c=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o;for(;l--;){const h=s.events[l][1];if(h.type==="labelImage"){o=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!o||!o._balanced)return a(h);const m=ca(s.sliceSerialize({start:o.end,end:s.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function H3(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},u=[e[a+1],e[a+2],["enter",s,t],e[a+3],e[a+4],["enter",l,t],["exit",l,t],["enter",c,t],["enter",o,t],["exit",o,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(a,e.length-a+1,...u),e}function $3(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c=0,o;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?a(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(c>999||p===93&&!o||p===null||p===91||xt(p))return a(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return l.includes(ca(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(p)}return xt(p)||(o=!0),c++,e.consume(p),p===92?g:m}function g(p){return p===91||p===92||p===93?(e.consume(p),c++,m):m(p)}}function P3(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c,o=0,u;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):a(_)}function g(_){if(o>999||_===93&&!u||_===null||_===91||xt(_))return a(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=ca(s.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return xt(_)||(u=!0),o++,e.consume(_),_===92?p:g}function p(_){return _===91||_===92||_===93?(e.consume(_),o++,g):g(_)}function v(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),l.includes(c)||l.push(c),et(e,x,"gfmFootnoteDefinitionWhitespace")):a(_)}function x(_){return t(_)}}function q3(e,t,a){return e.check(Bo,t,e.attempt(U3,t,a))}function V3(e){e.exit("gfmFootnoteDefinition")}function G3(e,t,a){const s=this;return et(e,l,"gfmFootnoteDefinitionIndent",5);function l(c){const o=s.events[s.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(c):a(c)}}function K3(e){let t=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:l,resolveAll:s};return t==null&&(t=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,o){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let h=u;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[u][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[u][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[u][1].start)},p=[["enter",m,o],["enter",c[h][1],o],["exit",c[h][1],o],["enter",g,o]],v=o.parser.constructs.insideSpan.null;v&&zn(p,p.length,0,id(v,c.slice(h+1,u),o)),zn(p,p.length,0,[["exit",g,o],["enter",c[u][1],o],["exit",c[u][1],o],["exit",m,o]]),zn(c,h-1,u-h+3,p),u=h+p.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function l(c,o,u){const h=this.previous,m=this.events;let g=0;return p;function p(x){return h===126&&m[m.length-1][1].type!=="characterEscape"?u(x):(c.enter("strikethroughSequenceTemporary"),v(x))}function v(x){const _=tl(h);if(x===126)return g>1?u(x):(c.consume(x),g++,v);if(g<2&&!t)return u(x);const S=c.exit("strikethroughSequenceTemporary"),w=tl(x);return S._open=!w||w===2&&!!_,S._close=!_||_===2&&!!w,o(x)}}}class Q3{constructor(){this.map=[]}add(t,a,s){Y3(this,t,a,s)}consume(t){if(this.map.sort(function(c,o){return c[0]-o[0]}),this.map.length===0)return;let a=this.map.length;const s=[];for(;a>0;)a-=1,s.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];s.push(t.slice()),t.length=0;let l=s.pop();for(;l;){for(const c of l)t.push(c);l=s.pop()}this.map.length=0}}function Y3(e,t,a,s){let l=0;if(!(a===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=a,e.map[l][2].push(...s);return}l+=1}e.map.push([t,a,s])}}function X3(e,t){let a=!1;const s=[];for(;t<e.length;){const l=e[t];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=s.length-1;s[c]=s[c]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return s}function Z3(){return{flow:{null:{name:"table",tokenize:J3,resolveAll:W3}}}}function J3(e,t,a){const s=this;let l=0,c=0,o;return u;function u(A){let U=s.events.length-1;for(;U>-1;){const V=s.events[U][1].type;if(V==="lineEnding"||V==="linePrefix")U--;else break}const F=U>-1?s.events[U][1].type:null,$=F==="tableHead"||F==="tableRow"?z:h;return $===z&&s.parser.lazy[s.now().line]?a(A):$(A)}function h(A){return e.enter("tableHead"),e.enter("tableRow"),m(A)}function m(A){return A===124||(o=!0,c+=1),g(A)}function g(A){return A===null?a(A):De(A)?c>1?(c=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),x):a(A):Qe(A)?et(e,g,"whitespace")(A):(c+=1,o&&(o=!1,l+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(A)))}function p(A){return A===null||A===124||xt(A)?(e.exit("data"),g(A)):(e.consume(A),A===92?v:p)}function v(A){return A===92||A===124?(e.consume(A),p):p(A)}function x(A){return s.interrupt=!1,s.parser.lazy[s.now().line]?a(A):(e.enter("tableDelimiterRow"),o=!1,Qe(A)?et(e,_,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):_(A))}function _(A){return A===45||A===58?w(A):A===124?(o=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),S):O(A)}function S(A){return Qe(A)?et(e,w,"whitespace")(A):w(A)}function w(A){return A===58?(c+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),C):A===45?(c+=1,C(A)):A===null||De(A)?E(A):O(A)}function C(A){return A===45?(e.enter("tableDelimiterFiller"),k(A)):O(A)}function k(A){return A===45?(e.consume(A),k):A===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(A))}function j(A){return Qe(A)?et(e,E,"whitespace")(A):E(A)}function E(A){return A===124?_(A):A===null||De(A)?!o||l!==c?O(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):O(A)}function O(A){return a(A)}function z(A){return e.enter("tableRow"),I(A)}function I(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),I):A===null||De(A)?(e.exit("tableRow"),t(A)):Qe(A)?et(e,I,"whitespace")(A):(e.enter("data"),B(A))}function B(A){return A===null||A===124||xt(A)?(e.exit("data"),I(A)):(e.consume(A),A===92?q:B)}function q(A){return A===92||A===124?(e.consume(A),B):B(A)}}function W3(e,t){let a=-1,s=!0,l=0,c=[0,0,0,0],o=[0,0,0,0],u=!1,h=0,m,g,p;const v=new Q3;for(;++a<e.length;){const x=e[a],_=x[1];x[0]==="enter"?_.type==="tableHead"?(u=!1,h!==0&&(j0(v,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(a,0,[["enter",m,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(s=!0,p=void 0,c=[0,0,0,0],o=[0,a+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(a,0,[["enter",g,t]])),l=_.type==="tableDelimiterRow"?2:g?3:1):l&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(s=!1,o[2]===0&&(c[1]!==0&&(o[0]=o[1],p=hu(v,t,c,l,void 0,p),c=[0,0,0,0]),o[2]=a)):_.type==="tableCellDivider"&&(s?s=!1:(c[1]!==0&&(o[0]=o[1],p=hu(v,t,c,l,void 0,p)),c=o,o=[c[1],a,0,0])):_.type==="tableHead"?(u=!0,h=a):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=a,c[1]!==0?(o[0]=o[1],p=hu(v,t,c,l,a,p)):o[1]!==0&&(p=hu(v,t,o,l,a,p)),l=0):l&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(o[3]=a)}for(h!==0&&j0(v,t,h,m,g),v.consume(t.events),a=-1;++a<t.events.length;){const x=t.events[a];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=X3(t.events,a))}return e}function hu(e,t,a,s,l,c){const o=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",u="tableContent";a[0]!==0&&(c.end=Object.assign({},Lr(t.events,a[0])),e.add(a[0],0,[["exit",c,t]]));const h=Lr(t.events,a[1]);if(c={type:o,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",c,t]]),a[2]!==0){const m=Lr(t.events,a[2]),g=Lr(t.events,a[3]),p={type:u,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(a[2],0,[["enter",p,t]]),s!==2){const v=t.events[a[2]],x=t.events[a[3]];if(v[1].end=Object.assign({},x[1].end),v[1].type="chunkText",v[1].contentType="text",a[3]>a[2]+1){const _=a[2]+1,S=a[3]-a[2]-1;e.add(_,S,[])}}e.add(a[3]+1,0,[["exit",p,t]])}return l!==void 0&&(c.end=Object.assign({},Lr(t.events,l)),e.add(l,0,[["exit",c,t]]),c=void 0),c}function j0(e,t,a,s,l){const c=[],o=Lr(t.events,a);l&&(l.end=Object.assign({},o),c.push(["exit",l,t])),s.end=Object.assign({},o),c.push(["exit",s,t]),e.add(a+1,0,c)}function Lr(e,t){const a=e[t],s=a[0]==="enter"?"start":"end";return a[1][s]}const eO={name:"tasklistCheck",tokenize:nO};function tO(){return{text:{91:eO}}}function nO(e,t,a){const s=this;return l;function l(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return xt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),o):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),o):a(h)}function o(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):a(h)}function u(h){return De(h)?t(h):Qe(h)?e.check({tokenize:aO},t,a)(h):a(h)}}function aO(e,t,a){return et(e,s,"whitespace");function s(l){return l===null?a(l):t(l)}}function iO(e){return k_([R3(),B3(),K3(e),Z3(),tO()])}const sO={};function rO(e){const t=this,a=e||sO,s=t.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),c=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),o=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(iO(a)),c.push(N3()),o.push(j3(a))}const bS=D.memo(({content:e,isStreaming:t=!1,className:a,syntaxHighlighter:s})=>{const l=D.useMemo(()=>({p:({children:o})=>f.jsx("p",{className:"chat-markdown__p",children:o}),h1:({children:o})=>f.jsx("h1",{className:"chat-markdown__h1",children:o}),h2:({children:o})=>f.jsx("h2",{className:"chat-markdown__h2",children:o}),h3:({children:o})=>f.jsx("h3",{className:"chat-markdown__h3",children:o}),ul:({children:o})=>f.jsx("ul",{className:"chat-markdown__ul",children:o}),ol:({children:o})=>f.jsx("ol",{className:"chat-markdown__ol",children:o}),li:({children:o})=>f.jsx("li",{className:"chat-markdown__li",children:o}),blockquote:({children:o})=>f.jsx("blockquote",{className:"chat-markdown__blockquote",children:o}),a:({children:o,href:u})=>f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"chat-markdown__link",children:o}),table:({children:o})=>f.jsx("div",{className:"chat-markdown__table-wrapper",children:f.jsx("table",{className:"chat-markdown__table",children:o})}),thead:({children:o})=>f.jsx("thead",{className:"chat-markdown__thead",children:o}),tbody:({children:o})=>f.jsx("tbody",{className:"chat-markdown__tbody",children:o}),tr:({children:o})=>f.jsx("tr",{className:"chat-markdown__tr",children:o}),th:({children:o})=>f.jsx("th",{className:"chat-markdown__th",children:o}),td:({children:o})=>f.jsx("td",{className:"chat-markdown__td",children:o}),pre:({children:o})=>f.jsx(f.Fragment,{children:o}),code:({children:o,className:u})=>{const h=/language-(\w+)/.exec(u!=null?u:"");if(!h)return f.jsx("code",{className:"chat-markdown__code-inline",children:o});const m=h[1],g=String(o).replace(/\n$/,"");return s?f.jsx(f.Fragment,{children:s(g,m)}):f.jsx("pre",{className:"chat-markdown__pre",children:f.jsx("code",{className:"chat-markdown__code-block",children:o})})},hr:()=>f.jsx("hr",{className:"chat-markdown__hr"}),strong:({children:o})=>f.jsx("strong",{className:"chat-markdown__strong",children:o}),em:({children:o})=>f.jsx("em",{className:"chat-markdown__em",children:o})}),[s]),c=["chat-markdown",t&&"chat-markdown--streaming",a].filter(Boolean).join(" ");return f.jsx("div",{className:c,"aria-busy":t||void 0,children:f.jsx(KD,{remarkPlugins:[rO],components:l,children:e})})});bS.displayName="ChatMarkdownContent";const Hm=ae.forwardRef((v,p)=>{var x=v,{query:e,onQueryChange:t,results:a=[],onSelect:s,onClear:l,placeholder:c="Search entities...",disabled:o=!1,inputId:u,placement:h="bottom-start",className:m}=x,g=fe(x,["query","onQueryChange","results","onSelect","onClear","placeholder","disabled","inputId","placement","className"]);const[_,S]=D.useState(!1),w=D.useRef(null),C=D.useRef(null),k=D.useRef(null),j=ae.useId(),E=V=>`${j}-option-${V}`,O=D.useCallback(()=>S(!1),[]),{focusedValue:z,setFocusedValue:I}=Ju({triggerRef:w,panelRef:k,isOpen:_,onClose:O,restoreFocus:!1});D.useEffect(()=>{a.length===0?I(null):a.some(V=>V.id===z)||I(a[0].id)},[a,z,I]),D.useEffect(()=>{if(!_)return;const V=K=>{var H;if(K.key!=="Enter"||!((H=w.current)!=null&&H.contains(K.target)))return;const X=a.find(P=>P.id===z);X&&(K.preventDefault(),s(X),S(!1))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[_,a,z,s]),D.useImperativeHandle(p,()=>C.current);const B=V=>{o||(t(V.target.value),S(!0))},q=()=>{o||e.length>0&&a.length>0&&S(!0)},A=()=>{var V;l(),S(!1),(V=w.current)==null||V.focus()},U=V=>{s(V),S(!1)},F=_&&a.length>0,$=F&&z?E(z):void 0;return f.jsxs("div",Y(R({ref:C,className:["entity-picker",o&&"entity-picker--disabled",m].filter(Boolean).join(" ")},g),{children:[f.jsxs("div",{className:"entity-picker__input-wrapper",children:[f.jsx("input",{ref:w,id:u,type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":F,"aria-controls":j,"aria-activedescendant":$,className:"entity-picker__input",placeholder:c,value:e,disabled:o,onChange:B,onFocus:q,"data-testid":"entity-picker-input"}),e&&!o&&f.jsx("button",{type:"button",className:"entity-picker__clear",onClick:A,"aria-label":"Clear search","data-testid":"entity-picker-clear",children:f.jsx(Ce,{name:"x",size:16})})]}),F&&f.jsx("div",{ref:k,id:j,role:"listbox",className:`dropdown-panel ${Wu(h)} entity-picker__dropdown`,"data-testid":"entity-picker-dropdown",children:a.map(V=>{const K=V.id===z;return f.jsxs("div",{id:E(V.id),role:"option","aria-selected":K,"data-dropdown-item":V.id,className:["dropdown-item","entity-picker__result",K&&"dropdown-item--focused"].filter(Boolean).join(" "),onMouseEnter:()=>I(V.id),onMouseDown:H=>{H.preventDefault(),U(V)},"data-testid":`entity-picker-result-${V.id}`,children:[V.domain&&V.domainColor&&f.jsx(wn,{variant:V.domainColor,className:"entity-picker__badge",children:V.domain}),f.jsx("span",{className:"dropdown-item__label entity-picker__label",children:V.label})]},V.id)})})]}))});Hm.displayName="EntityPicker";const lO=ae.forwardRef((p,g)=>{var v=p,{rows:e,onChange:t,datatypeColumn:a=!1,datatypes:s=["string","number","boolean"],disabled:l=!1,keyPlaceholder:c="Key",valuePlaceholder:o="Value",addLabel:u="Add row",className:h}=v,m=fe(v,["rows","onChange","datatypeColumn","datatypes","disabled","keyPlaceholder","valuePlaceholder","addLabel","className"]);const x=ae.useId(),_=ae.useRef(0),S=(E,O)=>{t(e.map(z=>z.id===E?Y(R({},z),{key:O}):z))},w=(E,O)=>{t(e.map(z=>z.id===E?Y(R({},z),{value:O}):z))},C=(E,O)=>{t(e.map(z=>z.id===E?Y(R({},z),{datatype:O}):z))},k=E=>{t(e.filter(O=>O.id!==E))},j=()=>{const E=R({id:`${x}-${_.current++}`,key:"",value:""},a&&{datatype:"string"});t([...e,E])};return f.jsxs("div",Y(R({ref:g,className:["key-value-editor",a&&"key-value-editor--has-datatype",l&&"key-value-editor--disabled",h].filter(Boolean).join(" "),"data-testid":"key-value-editor"},m),{children:[f.jsxs("div",{className:"key-value-editor__table",children:[f.jsxs("div",{className:"key-value-editor__header",children:[f.jsx("div",{className:"key-value-editor__col key-value-editor__col--key",children:"Key"}),f.jsx("div",{className:"key-value-editor__col key-value-editor__col--value",children:"Value"}),a&&f.jsx("div",{className:"key-value-editor__col key-value-editor__col--datatype",children:"Type"}),f.jsx("div",{className:"key-value-editor__col key-value-editor__col--actions"})]}),e.map(E=>f.jsxs("div",{className:"key-value-editor__row","data-testid":`key-value-row-${E.id}`,children:[f.jsx(Ro,{className:"key-value-editor__input",placeholder:c,value:E.key,onChange:O=>S(E.id,O.target.value),disabled:l,"data-testid":`key-input-${E.id}`}),f.jsx(Ro,{className:"key-value-editor__input",placeholder:o,value:E.value,onChange:O=>w(E.id,O.target.value),disabled:l,"data-testid":`value-input-${E.id}`}),a&&f.jsx(Ou,{className:"key-value-editor__input key-value-editor__select",value:E.datatype||"string",onChange:O=>C(E.id,O),disabled:l,"data-testid":`datatype-select-${E.id}`,children:s.map(O=>f.jsx(Ou.Item,{value:O,children:O},O))}),f.jsx("button",{type:"button",className:"key-value-editor__remove-btn",onClick:()=>k(E.id),"aria-label":"Remove row",disabled:l,"data-testid":`remove-row-${E.id}`,children:f.jsx(Ce,{name:"trash",size:16})})]},E.id))]}),f.jsxs(an,{variant:"ghost",size:"sm",className:"key-value-editor__add-btn",onClick:j,disabled:l,"data-testid":"add-row-btn",children:[f.jsx(Ce,{name:"plus",size:16}),u]})]}))});lO.displayName="KeyValueEditor";const oO=ae.forwardRef((u,o)=>{var h=u,{items:e,onChange:t,primaryItemId:a,disabled:s=!1,className:l}=h,c=fe(h,["items","onChange","primaryItemId","disabled","className"]);const m=D.useCallback(p=>{if(p>0){const v=[...e];[v[p-1],v[p]]=[v[p],v[p-1]],t(v)}},[e,t]),g=D.useCallback(p=>{if(p<e.length-1){const v=[...e];[v[p],v[p+1]]=[v[p+1],v[p]],t(v)}},[e,t]);return f.jsx("div",Y(R({ref:o,className:["ordered-list",s&&"ordered-list--disabled",l].filter(Boolean).join(" "),role:"list","aria-disabled":s||void 0,"data-testid":"ordered-list"},c),{children:e.map((p,v)=>f.jsxs("div",{className:["ordered-list__item",a===p.id&&"ordered-list__item--primary"].filter(Boolean).join(" "),role:"listitem","data-testid":`ordered-item-${p.id}`,children:[f.jsxs("div",{className:"ordered-list__rank",children:[a===p.id&&f.jsx("div",{className:"ordered-list__primary-badge",title:"Primary item",children:f.jsx(Ce,{name:"star",size:10})}),f.jsx("div",{className:"ordered-list__index",children:v+1})]}),f.jsx("span",{className:"ordered-list__label",children:p.label}),f.jsxs("div",{className:"ordered-list__controls",children:[f.jsx(an,{variant:"ghost",size:"sm",disabled:s||v===0,onClick:()=>m(v),"aria-label":"Move up","data-testid":`move-up-${p.id}`,children:f.jsx(Ce,{name:"arrowUp",size:16})}),f.jsx(an,{variant:"ghost",size:"sm",disabled:s||v===e.length-1,onClick:()=>g(v),"aria-label":"Move down","data-testid":`move-down-${p.id}`,children:f.jsx(Ce,{name:"arrowDown",size:16})})]})]},p.id))}))});oO.displayName="OrderedList";const cO=ae.forwardRef((S,_)=>{var w=S,{value:e,onChange:t,sourceResults:a=[],targetResults:s=[],sourceQuery:l,onSourceQueryChange:c,targetQuery:o,onTargetQueryChange:u,predicates:h=["contains","relates to","depends on","is used by"],onSourceClear:m,onTargetClear:g,disabled:p=!1,className:v}=w,x=fe(w,["value","onChange","sourceResults","targetResults","sourceQuery","onSourceQueryChange","targetQuery","onTargetQueryChange","predicates","onSourceClear","onTargetClear","disabled","className"]);const C=ae.useId(),k=`${C}-source`,j=`${C}-predicate`,E=`${C}-target`,O=ae.useCallback(B=>{t(Y(R({},e),{source:B})),c("")},[t,c,e]),z=ae.useCallback(B=>{t(Y(R({},e),{target:B})),u("")},[t,u,e]),I=ae.useCallback(B=>{t(Y(R({},e),{predicate:B}))},[t,e]);return f.jsxs("div",Y(R({ref:_,className:["relationship-builder",v].filter(Boolean).join(" "),"data-testid":"relationship-builder"},x),{children:[f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:k,className:"relationship-builder__label",children:"Source"}),f.jsx(Hm,{inputId:k,query:l,onQueryChange:c,results:a,onSelect:O,onClear:m,placeholder:"Search source entity...",disabled:p}),e.source&&f.jsxs("div",{className:"relationship-builder__selected","data-testid":"source-selected",children:[e.source.domain&&f.jsx("span",{className:"relationship-builder__domain",children:e.source.domain}),f.jsx("span",{children:e.source.label})]})]}),f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:j,className:"relationship-builder__label",children:"Predicate"}),f.jsx(Ou,{id:j,value:e.predicate,placeholder:"Select relation type...",onChange:I,disabled:p,"data-testid":"predicate-select",children:h.map(B=>f.jsx(Ou.Item,{value:B,children:B},B))})]}),f.jsxs("div",{className:"relationship-builder__column",children:[f.jsx("label",{htmlFor:E,className:"relationship-builder__label",children:"Target"}),f.jsx(Hm,{inputId:E,query:o,onQueryChange:u,results:s,onSelect:z,onClear:g,placeholder:"Search target entity...",disabled:p}),e.target&&f.jsxs("div",{className:"relationship-builder__selected","data-testid":"target-selected",children:[e.target.domain&&f.jsx("span",{className:"relationship-builder__domain",children:e.target.domain}),f.jsx("span",{children:e.target.label})]})]})]}))});cO.displayName="RelationshipBuilder";const uO=e=>"type"in e&&e.type==="separator",xS=ae.forwardRef((m,h)=>{var g=m,{actions:e,onAction:t,trigger:a,triggerIcon:s="moreVertical",triggerLabel:l="Menu",placement:c="bottom-start",className:o}=g,u=fe(g,["actions","onAction","trigger","triggerIcon","triggerLabel","placement","className"]);const[p,v]=D.useState(!1),x=D.useRef(null),_=D.useRef(null),S=D.useRef(null),w=D.useCallback(()=>v(!1),[]),{focusedValue:C,setFocusedValue:k}=Ju({triggerRef:S,panelRef:_,isOpen:p,onClose:w});D.useImperativeHandle(h,()=>x.current);const j=D.useCallback(E=>{t(E),v(!1)},[t]);return f.jsxs("div",Y(R({ref:x,className:["row-menu",o].filter(Boolean).join(" "),"data-testid":"row-menu"},u),{children:[f.jsx("button",{ref:S,type:"button",className:"row-menu__trigger",onClick:()=>v(E=>!E),"aria-label":l,"aria-haspopup":"menu","aria-expanded":p,"data-testid":"row-menu-trigger",children:a||f.jsx(Ce,{name:s,size:16})}),p&&f.jsx("div",{ref:_,role:"menu","aria-label":l,className:`dropdown-panel ${Wu(c)} row-menu__dropdown`,"data-testid":"row-menu-dropdown",children:e.map((E,O)=>uO(E)?f.jsx("div",{role:"separator",className:"dropdown-separator","data-testid":`row-menu-separator-${O}`},`separator-${O}`):f.jsx(dO,{action:E,isFocused:C===E.id,onFocus:()=>k(E.id),onClick:()=>j(E.id)},E.id))})]}))});xS.displayName="RowMenu";function dO({action:e,isFocused:t,onFocus:a,onClick:s}){const l=D.useRef(null);return D.useEffect(()=>{var c;t&&((c=l.current)==null||c.focus())},[t]),f.jsxs("button",{ref:l,type:"button",role:"menuitem",tabIndex:t?0:-1,disabled:e.disabled,"data-dropdown-item":e.id,"data-disabled":e.disabled||void 0,onClick:s,onMouseEnter:()=>!e.disabled&&a(),className:["dropdown-item",e.danger&&"dropdown-item--danger",t&&"dropdown-item--focused",e.disabled&&"dropdown-item--disabled"].filter(Boolean).join(" "),"data-testid":`row-menu-action-${e.id}`,children:[e.icon&&f.jsx("span",{className:"dropdown-item__leading",children:f.jsx(Ce,{name:e.icon,size:16})}),f.jsx("span",{className:"dropdown-item__label",children:e.label})]})}const fO={running:"cyan",success:"emerald",idle:"neutral",failed:"rose"},hO=ae.forwardRef((v,p)=>{var x=v,{pipeline:e,onRun:t,onCancel:a,onOptions:s,compact:l=!1,selected:c=!1,headerAction:o,footerContent:u,flowLayout:h="fill",className:m}=x,g=fe(x,["pipeline","onRun","onCancel","onOptions","compact","selected","headerAction","footerContent","flowLayout","className"]);const _=fO[e.status];return f.jsxs("div",Y(R({ref:p,className:["pipeline-card",l&&"pipeline-card--compact",c&&"pipeline-card--selected",m].filter(Boolean).join(" "),"data-testid":"pipeline-card"},g),{children:[f.jsxs("div",{className:"pipeline-card__head",children:[f.jsxs("div",{className:"pipeline-card__head-top",children:[f.jsxs("div",{className:"pipeline-card__title-group",children:[f.jsx("div",{className:"pipeline-card__name-mono",children:e.name}),e.id&&f.jsx("div",{className:"pipeline-card__id-mono",children:e.id})]}),f.jsxs("div",{className:"pipeline-card__head-right",children:[f.jsxs("div",{className:"pipeline-card__head-chips",children:[f.jsx(wn,{variant:_,children:e.status}),e.target&&f.jsx(wn,{variant:"neutral",children:e.target}),e.tags&&e.tags.length>0&&f.jsx("div",{className:"pipeline-card__tags",children:e.tags.map(S=>f.jsx(wn,{variant:"neutral",children:S},S))})]}),f.jsxs("div",{className:"pipeline-card__head-actions",children:[o,t&&e.status!=="running"&&f.jsx("button",{type:"button",className:"pipeline-card__action-btn",onClick:t,"data-testid":"pipeline-run-btn",children:"Run"}),a&&e.status==="running"&&f.jsx("button",{type:"button",className:"pipeline-card__action-btn pipeline-card__action-btn--cancel",onClick:a,"data-testid":"pipeline-cancel-btn",children:"Cancel"}),s&&f.jsx("button",{type:"button","aria-label":"Pipeline options",className:"pipeline-card__kebab-btn",onClick:s,"data-testid":"pipeline-kebab-btn",children:f.jsx(Ce,{name:"moreVertical",size:16})})]})]})]}),e.description&&f.jsx("p",{className:"pipeline-card__description",children:e.description})]}),f.jsx("div",{className:"pipeline-card__flow","data-layout":h,children:e.flow.map((S,w)=>f.jsxs(ae.Fragment,{children:[f.jsxs("div",{className:"pipeline-card__node","data-color":S.color,children:[f.jsx("div",{className:"pipeline-card__icon-tile",children:typeof S.icon=="string"?f.jsx(Ce,{name:S.icon,size:16}):S.icon}),f.jsxs("div",{className:"pipeline-card__node-content",children:[f.jsx("div",{className:"pipeline-card__node-name",children:S.name}),S.label&&f.jsx("div",{className:"pipeline-card__node-label",children:S.label})]})]}),w<e.flow.length-1&&f.jsx("div",{className:"pipeline-card__arrow"})]},S.id))}),f.jsx("div",{className:"pipeline-card__foot",children:u!=null?u:f.jsxs("div",{className:"pipeline-card__foot-row",children:[f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"LAST RUN"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.lastRun||"—"})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"INGESTED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.ingested})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"CREATED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.created})]}),f.jsxs("div",{className:"pipeline-card__foot-col",children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"UPDATED"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.updated})]}),f.jsxs("div",{className:["pipeline-card__foot-col",Number(e.recent.errors)>0&&"pipeline-card__foot-col--error"].filter(Boolean).join(" "),children:[f.jsx("div",{className:"pipeline-card__foot-label",children:"ERRORS"}),f.jsx("div",{className:"pipeline-card__foot-value",children:e.recent.errors})]})]})})]}))});hO.displayName="PipelineCard";const mO=e=>{const t=[];let a=0;const s=/`([^`]+)`/g;let l;for(;(l=s.exec(e))!==null;)l.index>a&&t.push(e.substring(a,l.index)),t.push(f.jsx("code",{className:"form-callout__code",children:l[1]},`code-${l.index}`)),a=s.lastIndex;return a<e.length&&t.push(e.substring(a)),t.length>0?t:[e]},pO=ae.forwardRef((u,o)=>{var h=u,{variant:e="info",icon:t,children:a,className:s="",role:l}=h,c=fe(h,["variant","icon","children","className","role"]);const m=typeof a=="string"?mO(a):a,g=l!=null?l:e==="error"||e==="warn"?"alert":"note";return f.jsxs("div",Y(R({ref:o,className:["form-callout",`form-callout--${e}`,s].filter(Boolean).join(" "),"data-testid":"form-callout",role:g},c),{children:[t&&f.jsx("div",{className:"form-callout__icon",children:f.jsx(Ce,{name:t,size:16})}),f.jsx("div",{className:"form-callout__body",children:m})]}))});pO.displayName="FormCallout";function Hu(e,t,a,s,l,c){const o=l-e,u=c-t;if(o===0&&u===0)return{x:e,y:t};const h=Math.abs(o),m=Math.abs(u),g=a/2,p=s/2;if(h*p>m*g){const v=o>0?1:-1;return{x:e+v*g,y:t+u*g/h}}else{const v=u>0?1:-1;return{x:e+o*p/m,y:t+v*p}}}function _S(e,t,a=.28){const s=t.x-e.x,l=t.y-e.y,c=Math.hypot(s,l),o=-l/(c||1),u=s/(c||1),h=Math.min(80,c*a),m=(e.x+t.x)/2+o*h,g=(e.y+t.y)/2+u*h;return{d:`M ${e.x} ${e.y} Q ${m} ${g} ${t.x} ${t.y}`,mid:{x:(e.x+2*m+t.x)/4,y:(e.y+2*g+t.y)/4},angle:Math.atan2(t.y-g,t.x-m)}}function gO(e,t,a={}){const{iterations:s=300,springLength:l=160,springStrength:c=.04,repulsion:o=8e3,damping:u=.85,centerStrength:h=.005}=a;if(e.length===0)return new Map;const m=new Map(e.map(x=>[x.id,0])),g=new Map(e.map(x=>[x.id,0])),p=new Map(e.map(x=>[x.id,{x:x.x,y:x.y}])),v=new Map(e.map(x=>[x.id,x]));for(let x=0;x<s;x++){for(let _=0;_<e.length;_++)for(let S=_+1;S<e.length;S++){const w=e[_],C=e[S];if(w.pinned&&C.pinned)continue;const k=p.get(w.id),j=p.get(C.id),E=j.x-k.x||.1,O=j.y-k.y||.1,z=Math.max(Math.hypot(E,O),1),I=o/(z*z),B=E/z*I,q=O/z*I;w.pinned||(m.set(w.id,m.get(w.id)-B),g.set(w.id,g.get(w.id)-q)),C.pinned||(m.set(C.id,m.get(C.id)+B),g.set(C.id,g.get(C.id)+q))}for(const _ of t){const S=v.get(_.source),w=v.get(_.target);if(!S||!w||S.pinned&&w.pinned)continue;const C=p.get(S.id),k=p.get(w.id),j=k.x-C.x||.1,E=k.y-C.y||.1,O=Math.max(Math.hypot(j,E),1),z=c*(O-l),I=j/O*z,B=E/O*z;S.pinned||(m.set(S.id,m.get(S.id)+I),g.set(S.id,g.get(S.id)+B)),w.pinned||(m.set(w.id,m.get(w.id)-I),g.set(w.id,g.get(w.id)-B))}for(const _ of e){if(_.pinned)continue;const S=p.get(_.id),w=(m.get(_.id)-S.x*h)*u,C=(g.get(_.id)-S.y*h)*u;m.set(_.id,w),g.set(_.id,C),p.set(_.id,{x:S.x+w,y:S.y+C})}}return p}const yO=.25,vO=4,mu=.1,pu=20,E0=.95,k0=.1;function bO(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function SS({minZoom:e=yO,maxZoom:t=vO,bounds:a,onViewportChange:s}={}){const[l,c]=D.useState(1),[o,u]=D.useState({x:0,y:0}),h=D.useRef(1),m=D.useRef({x:0,y:0}),g=D.useRef(null),p=D.useRef(!1),v=D.useRef(),x=D.useRef(),_=D.useRef(null),S=D.useRef(null);D.useEffect(()=>{h.current=l},[l]),D.useEffect(()=>{m.current=o},[o]),D.useEffect(()=>{s==null||s({x:o.x,y:o.y,zoom:l})},[o,l,s]);const w=D.useCallback(($,V)=>{if(!a)return{x:$,y:V};const K=-a.maxX*h.current,H=-a.minX*h.current,X=-a.maxY*h.current,P=-a.minY*h.current;return{x:Math.max(K,Math.min(H,$)),y:Math.max(X,Math.min(P,V))}},[a]),C=D.useCallback($=>{var V;(V=v.current)==null||V.call(v,$)},[]),k=D.useCallback(()=>{var $;($=x.current)==null||$.call(x)},[]),j=D.useCallback(()=>{p.current||(document.addEventListener("pointermove",C),document.addEventListener("pointerup",k),p.current=!0)},[C,k]),E=D.useCallback(()=>{p.current&&(document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",k),p.current=!1)},[C,k]),O=D.useCallback($=>{if(!g.current)return;const V=$.clientX-g.current.lastX,K=$.clientY-g.current.lastY,H=performance.now(),X=Math.max(1,H-g.current.time)/1e3;g.current.vx=V/X,g.current.vy=K/X,g.current.time=H,g.current.lastX=$.clientX,g.current.lastY=$.clientY,_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{if(!g.current)return;const P=w(g.current.panX+($.clientX-g.current.x),g.current.panY+($.clientY-g.current.y));u(P),_.current=null})},[w]),z=D.useCallback(()=>{if(!g.current){E();return}const $=bO(),V=g.current.vx,K=g.current.vy,H=Math.sqrt(V*V+K*K);if(g.current=null,E(),$||H<k0)return;let X=V,P=K,re=m.current,T=performance.now();const ce=()=>{const he=performance.now(),M=(he-T)/1e3;if(T=he,X*=Math.pow(E0,M*60),P*=Math.pow(E0,M*60),Math.sqrt(X*X+P*P)<k0){S.current=null;return}re=w(re.x+X*M,re.y+P*M),u(re),S.current=requestAnimationFrame(ce)};S.current=requestAnimationFrame(ce)},[E,w]),I=D.useCallback($=>{S.current!==null&&(cancelAnimationFrame(S.current),S.current=null),g.current={x:$.clientX,y:$.clientY,lastX:$.clientX,lastY:$.clientY,panX:m.current.x,panY:m.current.y,vx:0,vy:0,time:performance.now()},j()},[j]);D.useEffect(()=>{v.current=O},[O]),D.useEffect(()=>{x.current=z},[z]),D.useEffect(()=>()=>{E(),_.current!==null&&cancelAnimationFrame(_.current),S.current!==null&&cancelAnimationFrame(S.current)},[E]);const B=D.useCallback($=>{$.preventDefault();const V=$.currentTarget.getBoundingClientRect(),K=$.clientX-V.left,H=$.clientY-V.top;if(!Number.isFinite(K)||!Number.isFinite(H))return;const X=$.deltaY>0?-mu:mu,P=h.current,re=Math.min(t,Math.max(e,P+X)),T=re-P,ce=w(m.current.x-K/P*T,m.current.y-H/P*T);_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{c(re),u(ce),_.current=null})},[w,e,t]),q=D.useCallback($=>{const V=$.key;let K=null,H=null;V==="+"||V==="="?($.preventDefault(),K=Math.min(t,h.current+mu)):V==="-"||V==="_"?($.preventDefault(),K=Math.max(e,h.current-mu)):V==="ArrowUp"?($.preventDefault(),H=w(m.current.x,m.current.y+pu)):V==="ArrowDown"?($.preventDefault(),H=w(m.current.x,m.current.y-pu)):V==="ArrowLeft"?($.preventDefault(),H=w(m.current.x+pu,m.current.y)):V==="ArrowRight"&&($.preventDefault(),H=w(m.current.x-pu,m.current.y)),(K!==null||H!==null)&&(_.current!==null&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{K!==null&&c(K),H!==null&&u(H),_.current=null}))},[w,e,t]),A=D.useCallback(($,V,K)=>{const H=Math.min(t,Math.max(e,$)),X=h.current,P=H-X;if(c(H),V!==void 0&&K!==void 0){const re=w(m.current.x-V/X*P,m.current.y-K/X*P);u(re)}},[w,e,t]),U=D.useCallback(($,V)=>{const K=w($,V);u(K)},[w]),F=D.useCallback(()=>{c(1),u({x:0,y:0})},[]);return{transform:`matrix(${l}, 0, 0, ${l}, ${o.x}, ${o.y})`,viewport:{x:o.x,y:o.y,zoom:l},bind:{onPointerDown:I,onWheel:B,onKeyDown:q,tabIndex:0,role:"region"},zoomTo:A,panTo:U,reset:F}}const wS=D.createContext(null);function CS(){const e=D.useContext(wS);if(!e)throw new Error("useGraphCanvas must be used within a GraphCanvas");return e}const NS=ae.forwardRef((g,m)=>{var p=g,{id:e,label:t,kind:a,domainColor:s="default",selected:l=!1,onSelect:c,className:o="",style:u}=p,h=fe(p,["id","label","kind","domainColor","selected","onSelect","className","style"]);const v=["graph-node",l&&"selected",o].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:m,className:v,"data-domain":s,"data-kind":a,onClick:x=>{x.stopPropagation(),c==null||c(e)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),c==null||c(e))},role:c?"button":void 0,tabIndex:c?0:void 0,"aria-pressed":c?l:void 0},h),{children:[f.jsx("span",{className:"graph-node__swatch"}),f.jsx("span",{className:"graph-node__label",children:t}),a&&f.jsx("span",{className:"graph-node__kind",children:a})]}))});NS.displayName="GraphNode";const uo=138,fo=30;function xO({id:e,sourceId:t,targetId:a,label:s,variant:l="default"}){const{getNodeRect:c}=CS(),o=D.useMemo(()=>{const v=c(t),x=c(a);if(!v||!x)return null;const _=Hu(v.x,v.y,v.width,v.height,x.x,x.y),S=Hu(x.x,x.y,x.width,x.height,v.x,v.y);return _S(_,S,.22)},[c,t,a]);if(!o)return null;const u=`arrow-${e}`,h=`arrow-rose-${e}`,m=`arrow-cyan-${e}`,g=l==="hot"?`url(#${m})`:l==="irrelevant"?`url(#${h})`:`url(#${u})`,p=["graph-edge",l!=="default"&&`graph-edge--${l}`].filter(Boolean).join(" ");return f.jsxs("g",{className:p,role:"presentation","aria-hidden":"true","data-testid":`graph-edge-${e}`,children:[f.jsxs("defs",{children:[f.jsx("marker",{id:u,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--graph-edge-strong, #94a3b8)"})}),f.jsx("marker",{id:h,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--status-rose))"})}),f.jsx("marker",{id:m,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--accent-primary))"})})]}),f.jsx("path",{className:"graph-edge__hit",d:o.d}),f.jsx("path",{className:"graph-edge__line",d:o.d,markerEnd:g}),s&&f.jsxs("g",{transform:`translate(${o.mid.x-(s.length*3.3+7)}, ${o.mid.y-9})`,className:"graph-edge__label",children:[f.jsx("rect",{width:s.length*6.6+14,height:"18",rx:"3",className:"graph-edge__label-bg"}),f.jsx("text",{x:s.length*3.3+7,y:"12",className:"graph-edge__label-text",children:s})]})]})}const jS=ae.forwardRef((m,h)=>{var g=m,{nodes:e=[],edges:t=[],selectedNodeId:a,onNodeSelect:s,renderNode:l,layout:c="manual",className:o=""}=g,u=fe(g,["nodes","edges","selectedNodeId","onNodeSelect","renderNode","layout","className"]);const[p,v]=D.useState(new Map),[x,_]=D.useState(new Map),S=D.useRef(null),w=D.useRef({}),C=D.useRef(!1),[k,j]=D.useState(null),{transform:E,viewport:O,bind:z,panTo:I}=SS({minZoom:.4,maxZoom:2.5}),B=D.useCallback(P=>{P.target instanceof Element&&P.target.closest(".graph-node, [data-no-drag]")||z.onPointerDown(P)},[z]),q=`grid${D.useId().replace(/:/g,"")}`;D.useLayoutEffect(()=>{const P=new Map;for(const re of e){const T=w.current[re.id];P.set(re.id,{width:(T==null?void 0:T.offsetWidth)||uo,height:(T==null?void 0:T.offsetHeight)||fo})}v(P)},[e]),D.useEffect(()=>{if(c!=="force"||p.size===0)return;const P=e.map((T,ce)=>{var se,pe,ge,Se;var he,M;return{id:T.id,x:(se=T.x)!=null?se:Math.cos(2*Math.PI*ce/e.length)*120,y:(pe=T.y)!=null?pe:Math.sin(2*Math.PI*ce/e.length)*120,width:(ge=(he=p.get(T.id))==null?void 0:he.width)!=null?ge:uo,height:(Se=(M=p.get(T.id))==null?void 0:M.height)!=null?Se:fo,pinned:T.x!==void 0&&T.y!==void 0}}),re=(t!=null?t:[]).map(T=>({source:T.sourceId,target:T.targetId}));_(gO(P,re))},[e,t,p,c]),D.useEffect(()=>{const P=S.current;if(!P)return;const re=new ResizeObserver(T=>{const{width:ce,height:he}=T[0].contentRect;ce>0&&he>0&&j({width:ce,height:he})});return re.observe(P),()=>re.disconnect()},[]),D.useEffect(()=>{var pe;if(C.current||!k||p.size===0||e.length===0||c==="force"&&x.size===0)return;let P=1/0,re=-1/0,T=1/0,ce=-1/0;for(const ge of e){const Se=ge.x!==void 0&&ge.y!==void 0?{x:ge.x,y:ge.y}:x.get(ge.id);if(!Se)continue;const xe=(pe=p.get(ge.id))!=null?pe:{width:uo,height:fo};P=Math.min(P,Se.x-xe.width/2),re=Math.max(re,Se.x+xe.width/2),T=Math.min(T,Se.y-xe.height/2),ce=Math.max(ce,Se.y+xe.height/2)}if(!Number.isFinite(P))return;const he=(P+re)/2,M=(T+ce)/2,se={x:k.width/2-he*O.zoom,y:k.height/2-M*O.zoom};C.current=!0,I(se.x,se.y)},[k,p,x,e,c,O.zoom,I]);const A=D.useCallback(P=>{var re;return P.x!==void 0&&P.y!==void 0?{x:P.x,y:P.y}:(re=x.get(P.id))!=null?re:{x:0,y:0}},[x]),U=D.useCallback(P=>{var he;const re=e.find(M=>M.id===P);if(!re)return null;const T=A(re),ce=(he=p.get(P))!=null?he:{width:uo,height:fo};return{x:T.x,y:T.y,width:ce.width,height:ce.height}},[e,p,A]),F=D.useCallback((P,re)=>l?l(P,re):f.jsx(NS,{id:P.id,label:P.label,kind:P.kind,domainColor:P.domainColor,selected:re,onSelect:s}),[l,s]),$=D.useMemo(()=>({getNodeRect:U,zoom:O.zoom,pan:{x:O.x,y:O.y},selectedNodeId:a}),[U,O,a]),V=P=>{typeof h=="function"?h(P):h&&(h.current=P),S.current=P},K=18*O.zoom,H=(O.x%K+K)%K,X=(O.y%K+K)%K;return f.jsxs("div",Y(R({ref:V,"aria-label":"Graph canvas",className:["graph-canvas",o].filter(Boolean).join(" "),onPointerDown:B,onWheel:z.onWheel,onKeyDown:z.onKeyDown,tabIndex:z.tabIndex,role:z.role},u),{children:[f.jsx("div",{className:"graph-measure","aria-hidden":"true",children:e.map(P=>f.jsx("div",{ref:re=>{w.current[P.id]=re},style:{display:"inline-block"},children:F(P,!1)},P.id))}),f.jsxs("svg",{className:"graph-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[f.jsx("defs",{children:f.jsx("pattern",{id:q,x:H,y:X,width:K,height:K,patternUnits:"userSpaceOnUse",children:f.jsx("circle",{cx:"0",cy:"0",r:Math.min(1,.5*O.zoom),className:"graph-grid-dot"})})}),f.jsx("rect",{width:"100%",height:"100%",fill:`url(#${q})`,className:"graph-grid"}),f.jsx(wS.Provider,{value:$,children:f.jsxs("g",{className:"graph-viewport","data-testid":"graph-viewport",transform:E,children:[f.jsx("g",{className:"graph-edges",children:t==null?void 0:t.map(P=>f.jsx(xO,{id:P.id,sourceId:P.sourceId,targetId:P.targetId,label:P.label,variant:P.variant},P.id))}),f.jsx("g",{className:"graph-nodes",children:e.map(P=>{var he;const re=A(P),T=(he=p.get(P.id))!=null?he:{width:uo,height:fo},ce=P.id===a;return f.jsx("g",{transform:`translate(${re.x} ${re.y})`,"data-node-id":P.id,"data-testid":`graph-node-${P.id}`,"data-domain":P.domainColor,className:ce?"selected":void 0,children:f.jsx("foreignObject",{x:-T.width/2,y:-T.height/2,width:T.width,height:T.height,overflow:"visible",children:F(P,ce)})},P.id)})})]})})]})]}))});jS.displayName="GraphCanvas";const _O=ae.forwardRef((h,u)=>{var m=h,{id:e,sourceId:t,targetId:a,label:s,variant:l="default",className:c=""}=m,o=fe(m,["id","sourceId","targetId","label","variant","className"]);const{getNodeRect:g}=CS(),p=D.useMemo(()=>{const C=g(t),k=g(a);if(!C)return console.warn(`GraphEdge: source node "${t}" not found`),null;if(!k)return console.warn(`GraphEdge: target node "${a}" not found`),null;const j=Hu(C.x,C.y,C.width,C.height,k.x,k.y),E=Hu(k.x,k.y,k.width,k.height,C.x,C.y);return _S(j,E,.22)},[g,t,a]);if(!p)return null;const v=["graph-edge",l!=="default"&&`graph-edge--${l}`,c].filter(Boolean).join(" "),x=`arrow-${e}`,_=`arrow-rose-${e}`,S=`arrow-cyan-${e}`,w=l==="hot"?`url(#${S})`:l==="irrelevant"?`url(#${_})`:`url(#${x})`;return f.jsxs("g",Y(R({ref:u,className:v,role:"presentation","aria-hidden":"true","data-testid":`graph-edge-${e}`},o),{children:[f.jsxs("defs",{children:[f.jsx("marker",{id:x,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--graph-edge-strong, #94a3b8)"})}),f.jsx("marker",{id:_,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--status-rose))"})}),f.jsx("marker",{id:S,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"rgb(var(--accent-primary))"})})]}),f.jsx("path",{className:"graph-edge__hit",d:p.d,"data-testid":`graph-edge-hit-${e}`}),f.jsx("path",{className:"graph-edge__line",d:p.d,markerEnd:w,"data-testid":`graph-edge-line-${e}`}),s&&f.jsxs("g",{className:"graph-edge__label",transform:`translate(${p.mid.x-(s.length*3.3+7)}, ${p.mid.y-9})`,children:[f.jsx("rect",{width:s.length*6.6+14,height:"18",rx:"3",className:"graph-edge__label-bg","data-testid":`graph-edge-label-bg-${e}`}),f.jsx("text",{x:s.length*3.3+7,y:"12",className:"graph-edge__label-text","data-testid":`graph-edge-label-text-${e}`,children:s})]})]}))});_O.displayName="GraphEdge";const ES=ae.forwardRef((u,o)=>{var h=u,{node:e,relationships:t=[],onNodeSelect:a,emptyStateText:s="Select a node to inspect.",className:l=""}=h,c=fe(h,["node","relationships","onNodeSelect","emptyStateText","className"]);const m=["graph-inspector",l].filter(Boolean).join(" ");if(!e)return f.jsx("div",Y(R({ref:o,className:m},c),{children:f.jsx("div",{className:"graph-inspector__empty","data-testid":"inspector-empty",children:s})}));const g=t.filter(v=>v.direction==="out"),p=t.filter(v=>v.direction==="in");return f.jsxs("div",Y(R({ref:o,className:m},c),{children:[f.jsxs("div",{className:"graph-inspector__head",children:[f.jsxs("div",{className:"graph-inspector__head-eyebrow",children:[e.kind&&f.jsx("span",{className:"graph-inspector__badge",children:e.kind}),e.domain&&f.jsx("span",{className:`graph-inspector__badge graph-inspector__badge--${e.domain}`,children:e.domain})]}),f.jsx("div",{className:"graph-inspector__title","data-testid":"inspector-title",children:e.title}),f.jsx("div",{className:"graph-inspector__id","data-testid":"inspector-id",children:e.id})]}),f.jsxs("div",{className:"graph-inspector__body",children:[e.description&&f.jsx("p",{className:"graph-inspector__description","data-testid":"inspector-description",children:e.description}),e.metadata&&Object.keys(e.metadata).length>0&&f.jsx("dl",{className:"graph-inspector__kv","data-testid":"inspector-metadata",children:Object.entries(e.metadata).map(([v,x])=>f.jsxs(ae.Fragment,{children:[f.jsx("dt",{children:v}),f.jsx("dd",{children:String(x)})]},v))}),g.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"graph-inspector__section-label",children:["Outgoing · ",g.length]}),f.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-outgoing",children:g.map(v=>f.jsxs("li",{className:"graph-inspector__rel",children:[f.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--out",children:"→"}),f.jsx("span",{className:"graph-inspector__rel-pred",children:v.predicate}),f.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":v.targetDomain,onClick:()=>a==null?void 0:a(v.target),"aria-label":`Navigate to ${v.targetTitle}`,"data-testid":`inspector-rel-${v.id}`,children:[f.jsx("span",{className:"graph-inspector__rel-swatch"}),f.jsx("span",{children:v.targetTitle})]})]},v.id))})]}),p.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"graph-inspector__section-label",children:["Incoming · ",p.length]}),f.jsx("ul",{className:"graph-inspector__rels","data-testid":"inspector-incoming",children:p.map(v=>f.jsxs("li",{className:"graph-inspector__rel",children:[f.jsx("span",{className:"graph-inspector__rel-dir graph-inspector__rel-dir--in",children:"←"}),f.jsx("span",{className:"graph-inspector__rel-pred",children:v.predicate}),f.jsxs("button",{type:"button",className:"graph-inspector__rel-target","data-domain":v.targetDomain,onClick:()=>a==null?void 0:a(v.target),"aria-label":`Navigate to ${v.targetTitle}`,"data-testid":`inspector-rel-${v.id}`,children:[f.jsx("span",{className:"graph-inspector__rel-swatch"}),f.jsx("span",{children:v.targetTitle})]})]},v.id))})]}),t.length===0&&f.jsx("div",{className:"graph-inspector__empty-mini",children:"No relationships yet."})]})]}))});ES.displayName="GraphInspector";const SO={ok:"rgb(var(--status-emerald))",warning:"rgb(var(--status-amber))",error:"rgb(var(--status-rose))",idle:"rgb(var(--status-neutral))"},wO=ae.forwardRef((v,p)=>{var x=v,{title:e,nodeRole:t="",status:a="idle",metrics:s=[],selected:l=!1,x:c,y:o,onSelect:u,className:h="",style:m}=x,g=fe(x,["title","nodeRole","status","metrics","selected","x","y","onSelect","className","style"]);const _=["topology-node",`topology-node--${a}`,l?"topology-node--selected":"",u?"topology-node--interactive":"",h].filter(Boolean).join(" "),S=R(R({},c!==void 0&&o!==void 0?{position:"absolute",left:`${c}px`,top:`${o}px`}:{}),m),w=e.replace(/\s+/g,"-").toLowerCase(),C=k=>{u&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),u())};return f.jsxs("div",Y(R({ref:p,className:_,style:S,"data-testid":`topology-node-${w}`,onClick:u,onKeyDown:C,tabIndex:u?0:void 0,"aria-selected":l,role:u?"button":void 0},g),{children:[f.jsxs("div",{className:"topology-node__head",children:[f.jsx("div",{className:"topology-node__title",children:e}),f.jsx("div",{className:"topology-node__status-dot",style:{backgroundColor:SO[a]},"data-testid":`topology-status-${w}`,"aria-label":`Status: ${a}`})]}),f.jsx("div",{className:"topology-node__role","data-testid":`topology-role-${w}`,children:t}),s.length>0&&f.jsx("div",{className:"topology-node__metrics","data-testid":`topology-metrics-${w}`,children:s.map((k,j)=>f.jsxs("div",{className:"topology-node__metric-row",children:[f.jsx("div",{className:"topology-node__metric-label",children:k.label}),f.jsxs("div",{className:"topology-node__metric-value",children:[k.value,k.unit&&f.jsx("span",{className:"topology-node__metric-unit",children:k.unit})]}),f.jsx("div",{className:"topology-node__metric-bar",children:f.jsx("div",{className:"topology-node__metric-fill",style:{width:`${Number.isFinite(k.percent)?Math.max(0,Math.min(100,k.percent)):0}%`,backgroundColor:k.color?`rgb(var(--status-${k.color}))`:"rgb(var(--accent-primary))"}})})]},j))})]}))});wO.displayName="TopologyNode";const R0={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",default:"var(--dom-default)"},CO=ae.forwardRef((v,p)=>{var x=v,{depth:e=0,domain:t,kind:a,label:s,meta:l,description:c,selected:o=!1,onSelect:u,showKind:h=!0,className:m=""}=x,g=fe(x,["depth","domain","kind","label","meta","description","selected","onSelect","showKind","className"]);const _=R0[t]||R0.default,S=["hierarchy-row",o&&"selected",u&&"interactive",m].filter(Boolean).join(" "),w=ae.useCallback(C=>{(C.key==="Enter"||C.key===" ")&&u&&(C.preventDefault(),u())},[u]);return f.jsxs("div",Y(R({ref:p,className:S,role:u?"button":void 0,tabIndex:u?0:void 0,"aria-pressed":u?o:void 0,onClick:u,onKeyDown:u?w:void 0,style:{"--hierarchy-depth":e,"--domain-color":_}},g),{children:[f.jsxs("div",{className:"hierarchy-row__left",children:[e>0&&f.jsx("div",{className:"hierarchy-row__connector"}),f.jsxs("div",{className:"hierarchy-row__pill",children:[f.jsx("div",{className:"hierarchy-row__swatch"}),h&&f.jsx("span",{className:"hierarchy-row__kind",children:a}),f.jsx("span",{className:"hierarchy-row__label",children:s}),l&&f.jsx("span",{className:"hierarchy-row__meta",children:l})]})]}),c&&f.jsx("div",{className:"hierarchy-row__right",children:f.jsx("span",{className:"hierarchy-row__description",children:c})})]}))});CO.displayName="HierarchyRow";const NO=ae.forwardRef((l,s)=>{var c=l,{className:e="",children:t}=c,a=fe(c,["className","children"]);const o=["hierarchy-tree",e].filter(Boolean).join(" ");return f.jsx("div",Y(R({ref:s,className:o},a),{children:t}))});NO.displayName="HierarchyTree";const jO=ae.forwardRef((o,c)=>{var u=o,{nodes:e,wrap:t=!1,className:a="","aria-label":s}=u,l=fe(u,["nodes","wrap","className","aria-label"]);if(e.length===0)return null;const h=["lineage-rail",t&&"lineage-rail--wrap",a].filter(Boolean).join(" "),m=s||`Lineage: ${e.map(g=>g.label).join(" → ")}`;return f.jsx("div",Y(R({ref:c,className:h,role:"list","aria-label":m},l),{children:e.map((g,p)=>{const v=p===0;return f.jsxs(ae.Fragment,{children:[p>0&&f.jsx("span",{className:"lineage-rail__arrow","aria-hidden":"true",children:"→"}),f.jsx(EO,{node:g,isHead:v})]},`${g.label}-${p}`)})}))});jO.displayName="LineageRail";const EO=({node:e,isHead:t})=>{const a=["lineage-rail__node",e.onClick&&"lineage-rail__node--interactive",t&&"lineage-rail__node--head"].filter(Boolean).join(" "),s=l=>{(l.key==="Enter"||l.key===" ")&&e.onClick&&(l.preventDefault(),e.onClick())};return f.jsxs(wn,{className:a,role:"listitem","aria-current":t?"step":void 0,onClick:e.onClick,onKeyDown:e.onClick?s:void 0,tabIndex:e.onClick?0:void 0,children:[e.icon&&f.jsx(Ce,{name:e.icon,size:14}),f.jsx("span",{className:"lineage-rail__label",children:e.label})]})},kO=ae.forwardRef((m,h)=>{var g=m,{thumb:e,title:t,subtitle:a,meta:s,badge:l,selected:c=!1,className:o=""}=g,u=fe(g,["thumb","title","subtitle","meta","badge","selected","className"]);const[p,v]=ae.useState(!1),[x,_]=ae.useState(!1);ae.useEffect(()=>{v(!1),_(!1)},[e.kind==="image"?e.src:null]);const S=["asset-card",c&&"asset-card--selected",o].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:h,className:S,"aria-selected":c},u),{children:[f.jsxs("div",{className:"asset-card__thumb-wrapper",children:[(()=>{if(e.kind==="doc")return f.jsxs("div",{className:"asset-card__thumb asset-card__thumb--doc",children:[f.jsx("div",{className:"asset-card__doc-page"}),f.jsx("div",{className:`asset-card__doc-tab asset-card__doc-tab--${e.ext.toLowerCase()}`,children:e.ext.toUpperCase()})]});if(e.kind==="cover")return f.jsx("div",{className:"asset-card__thumb asset-card__thumb--cover",style:{"--cover-gradient":e.gradient},children:f.jsx(Ce,{name:e.glyph,size:32,className:"asset-card__cover-glyph"})});if(e.kind==="image")return(p||!x&&!e.src)&&e.fallbackGlyph?f.jsx("div",{className:"asset-card__thumb asset-card__thumb--image-fallback",children:f.jsx(Ce,{name:e.fallbackGlyph,size:32,className:"asset-card__image-glyph"})}):f.jsx("div",{className:"asset-card__thumb asset-card__thumb--image",children:f.jsx("img",{src:e.src,alt:"",className:"asset-card__image",onLoad:()=>_(!0),onError:()=>v(!0),"aria-hidden":"true"})})})(),l&&f.jsx("div",{className:"asset-card__badge",children:l})]}),f.jsxs("div",{className:"asset-card__body",children:[f.jsx("div",{className:"asset-card__title",children:t}),a&&f.jsx("div",{className:"asset-card__subtitle",children:a}),s&&f.jsx("div",{className:"asset-card__meta",children:s})]})]}))});kO.displayName="AssetCard";const RO=ae.forwardRef((o,c)=>{var u=o,{columns:e=3,gap:t=14,className:a="",children:s}=u,l=fe(u,["columns","gap","className","children"]);const h=["asset-grid",a].filter(Boolean).join(" ");return f.jsx("div",Y(R({ref:c,className:h,style:{"--asset-columns":e,"--asset-gap":`${t}px`}},l),{children:s}))});RO.displayName="AssetGrid";const qp=(e,t=[])=>t.filter(a=>{const s=typeof a.startDate=="string"?new Date(a.startDate):new Date(a.startDate);return Wr(e,s)}),TO=({focusedDate:e,selectedDate:t,grid:a,events:s,calendarColors:l,weekStartsOn:c,onSelectDate:o,onSelectEvent:u,renderEvent:h,onKeyDown:m})=>{const g=typeof e=="string"?new Date(e):e,p=t?typeof t=="string"?new Date(t):t:null;let v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return c===1&&(v=v.slice(1).concat(v.slice(0,1))),f.jsxs("div",{className:"calendar-month",role:"grid",onKeyDown:m,tabIndex:0,children:[f.jsx("div",{className:"calendar-month__header",role:"row",children:v.map(x=>f.jsx("div",{className:"calendar-month__weekday",role:"columnheader",children:x.slice(0,3).toUpperCase()},x))}),a.map((x,_)=>f.jsx("div",{className:"calendar-month__week",role:"row",children:x.map((S,w)=>{const C=S.getMonth()!==g.getMonth(),k=Wr(S,g),j=p?Wr(S,p):!1,E=e_(S),O=qp(S,s),z=3,I=O.length-z;return f.jsxs("div",{className:`calendar-month__cell ${C?"calendar-month__cell--out-of-month":""} ${k?"calendar-month__cell--focused":""} ${j?"calendar-month__cell--selected":""}`,role:"gridcell",onClick:()=>!C&&(o==null?void 0:o(S)),onKeyDown:B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),!C&&(o==null||o(S)))},children:[f.jsx("div",{className:"calendar-month__date-number","aria-current":E?"date":void 0,children:E?f.jsx(wn,{variant:"amber",form:"default",children:S.getDate()}):f.jsx("span",{children:S.getDate()})}),f.jsxs("div",{className:"calendar-month__events",children:[O.slice(0,z).map(B=>{const q=(l==null?void 0:l[B.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-month__event-bar",style:{borderLeftColor:q},onClick:A=>{A.stopPropagation(),u==null||u(B.id)},role:"button",tabIndex:0,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),A.stopPropagation(),u==null||u(B.id))},children:h?h(B,q):f.jsx("span",{className:"calendar-month__event-title",children:B.title||"Event"})},B.id)}),I>0&&f.jsxs("div",{className:"calendar-month__event-overflow",children:["+",I," more"]})]})]},`${_}-${w}`)})},_))]})},MO=({focusedDate:e,weekStartsOn:t,events:a,calendarColors:s,onSelectDate:l,onSelectEvent:c,renderEvent:o})=>{const u=el(e,t);return f.jsx("div",{className:"calendar-week",children:f.jsx("div",{className:"calendar-week__days",children:u.map(h=>{const m=qp(h,a);return f.jsxs("div",{className:"calendar-week__day",role:"button",tabIndex:0,onClick:()=>l==null?void 0:l(h),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l==null||l(h))},children:[f.jsx("div",{className:"calendar-week__header",children:h.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),f.jsx("div",{className:"calendar-week__events",children:m.map(g=>{const p=(s==null?void 0:s[g.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-week__event",style:{borderLeftColor:p},role:"button",tabIndex:0,onClick:v=>{v.stopPropagation(),c==null||c(g.id)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c==null||c(g.id))},children:o?o(g,p):f.jsx("span",{children:g.title||"Event"})},g.id)})})]},h.toISOString())})})})},AO=({focusedDate:e,events:t,calendarColors:a,onSelectEvent:s,renderEvent:l})=>{const c=qp(e,t);return f.jsxs("div",{className:"calendar-day",children:[f.jsx("div",{className:"calendar-day__title",children:typeof e=="string"?new Date(e).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"}):e.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}),f.jsx("div",{className:"calendar-day__events",children:c.length===0?f.jsx("div",{className:"calendar-day__empty",children:"No events scheduled"}):c.map(o=>{const u=(a==null?void 0:a[o.calendarId])||"rgb(var(--status-cyan))";return f.jsx("div",{className:"calendar-day__event",style:{borderLeftColor:u},role:"button",tabIndex:0,onClick:()=>s==null?void 0:s(o.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),s==null||s(o.id))},children:l?l(o,u):f.jsx("span",{children:o.title||"Event"})},o.id)})})]})},DO=({focusedDate:e,events:t=[],calendarColors:a,onSelectEvent:s,renderEvent:l})=>{const c=typeof e=="string"?new Date(e):e,o=t.filter(u=>(typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate))>=c).sort((u,h)=>{const m=typeof u.startDate=="string"?new Date(u.startDate):new Date(u.startDate),g=typeof h.startDate=="string"?new Date(h.startDate):new Date(h.startDate);return m.getTime()-g.getTime()});return f.jsx("div",{className:"calendar-agenda",children:o.length===0?f.jsx("div",{className:"calendar-agenda__empty",children:"No upcoming events"}):f.jsx("div",{className:"calendar-agenda__list",children:o.map(u=>{const h=(a==null?void 0:a[u.calendarId])||"rgb(var(--status-cyan))";return f.jsxs("div",{className:"calendar-agenda__item",role:"button",tabIndex:0,onClick:()=>s==null?void 0:s(u.id),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s==null||s(u.id))},children:[f.jsx("div",{className:"calendar-agenda__date",style:{color:h},children:typeof u.startDate=="string"?new Date(u.startDate).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):u.startDate.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),f.jsx("div",{className:"calendar-agenda__content",children:l?l(u,h):f.jsx("span",{children:u.title||"Event"})})]},u.id)})})})},LO=ae.forwardRef((_,x)=>{var S=_,{view:e,focusedDate:t,selectedDate:a,events:s,calendarColors:l,weekStartsOn:c=0,onChangeView:o,onNavigate:u,onSelectDate:h,onSelectEvent:m,renderEvent:g,className:p=""}=S,v=fe(S,["view","focusedDate","selectedDate","events","calendarColors","weekStartsOn","onChangeView","onNavigate","onSelectDate","onSelectEvent","renderEvent","className"]);const w=typeof t=="string"?new Date(t):t,C=D.useMemo(()=>t_(w,c),[w.getTime(),c]),k=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"},{value:"agenda",label:"Agenda"}],j=D.useCallback(I=>{if(e!=="month")return;const B=new Date(w);if(I.key==="ArrowLeft"||I.key==="ArrowRight"||I.key==="ArrowUp"||I.key==="ArrowDown"){I.preventDefault();const q=I.key==="ArrowLeft"?-1:I.key==="ArrowRight"?1:I.key==="ArrowUp"?-7:7;B.setDate(B.getDate()+q),u==null||u(B)}else if(I.key==="PageUp")I.preventDefault(),B.setMonth(B.getMonth()-1),u==null||u(B);else if(I.key==="PageDown")I.preventDefault(),B.setMonth(B.getMonth()+1),u==null||u(B);else if(I.key==="Home"){I.preventDefault();const q=el(B,c);u==null||u(q[0])}else if(I.key==="End"){I.preventDefault();const q=el(B,c);u==null||u(q[6])}},[w.getTime(),u,e,c]),E=D.useCallback(()=>{const I=new Date(w);e==="month"?I.setMonth(I.getMonth()-1):e==="week"?I.setDate(I.getDate()-7):(e==="day"||e==="agenda")&&I.setDate(I.getDate()-1),u==null||u(I)},[w.getTime(),u,e]),O=D.useCallback(()=>{const I=new Date(w);e==="month"?I.setMonth(I.getMonth()+1):e==="week"?I.setDate(I.getDate()+7):(e==="day"||e==="agenda")&&I.setDate(I.getDate()+1),u==null||u(I)},[w.getTime(),u,e]),z=D.useCallback(()=>{u==null||u(new Date)},[u]);return f.jsxs("div",Y(R({ref:x,className:`calendar ${p}`.trim()},v),{children:[f.jsxs("div",{className:"calendar__header",children:[f.jsxs("div",{className:"calendar__title",children:[e==="month"&&tR(w),e==="week"&&nR(w,c),e==="day"&&km(w),e==="agenda"&&"Agenda"]}),f.jsxs("div",{className:"calendar__controls",children:[f.jsx(an,{variant:"secondary",size:"sm",onClick:E,"aria-label":"Previous",children:f.jsx(Ce,{name:"chevronLeft",size:16})}),f.jsx(an,{variant:"secondary",size:"sm",onClick:z,children:"Today"}),f.jsx(an,{variant:"secondary",size:"sm",onClick:O,"aria-label":"Next",children:f.jsx(Ce,{name:"chevronRight",size:16})})]})]}),f.jsx("div",{className:"calendar__view-selector",children:f.jsx(pp,{value:e,onChange:I=>o==null?void 0:o(I),options:k})}),f.jsxs("div",{className:"calendar__content",children:[e==="month"&&f.jsx(TO,{focusedDate:w,selectedDate:a,grid:C,events:s,calendarColors:l,weekStartsOn:c,onSelectDate:h,onSelectEvent:m,renderEvent:g,onKeyDown:j}),e==="week"&&f.jsx(MO,{focusedDate:w,weekStartsOn:c,events:s,calendarColors:l,onSelectDate:h,onSelectEvent:m,renderEvent:g}),e==="day"&&f.jsx(AO,{focusedDate:w,events:s,calendarColors:l,onSelectEvent:m,renderEvent:g}),e==="agenda"&&f.jsx(DO,{focusedDate:w,events:s,calendarColors:l,onSelectEvent:m,renderEvent:g})]})]}))});LO.displayName="Calendar";const OO=({card:e,isSelected:t,renderCard:a,onSelect:s,onCardPointerDown:l,onCardKeyDown:c})=>a?f.jsx("div",{className:`kanban-card ${t?"kanban-card--selected":""}`,onPointerDown:o=>l(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>s(e.id),tabIndex:0,role:"button","aria-pressed":t,children:a(e,t)}):f.jsxs("div",{className:`kanban-card ${t?"kanban-card--selected":""} ${e.done?"kanban-card--done":""}`,onPointerDown:o=>l(o,e.id),onKeyDown:o=>c(o,e.id),onClick:()=>s(e.id),tabIndex:0,role:"button","aria-pressed":t,children:[e.context&&f.jsx("div",{className:"kanban-card__context",children:e.context}),f.jsx("div",{className:"kanban-card__title",children:e.title}),e.version&&f.jsx("div",{className:"kanban-card__version",children:f.jsx(On,{children:e.version})}),(e.dueDate||e.badges)&&f.jsxs("div",{className:"kanban-card__meta",children:[e.dueDate&&f.jsx("div",{className:"kanban-card__due-date",children:e.dueDate}),e.badges&&e.badges.length>0&&f.jsx("div",{className:"kanban-card__badges",children:e.badges.map(o=>f.jsx("span",{className:"kanban-card__badge",children:o},o))})]}),e.blocked&&f.jsxs("div",{className:"kanban-card__blocked",children:[f.jsx(Ce,{name:"alert",size:16}),e.blocked]})]}),zO=({column:e,cards:t,selectedId:a,onSelectCard:s,renderCard:l,draggedCardId:c,insertionIndex:o,onCardPointerDown:u,onCardKeyDown:h})=>{const m=D.useRef(null),g=e.wipLimit&&t.length>e.wipLimit;return f.jsxs(Kx,{className:"kanban-column",noPadding:!0,children:[f.jsxs("div",{className:"kanban-column__header",children:[f.jsxs("div",{className:"kanban-column__header-left",children:[e.statusColor&&f.jsx("div",{className:"kanban-column__status-dot",style:{backgroundColor:To[e.statusColor]}}),f.jsx("div",{className:"kanban-column__title",children:e.title})]}),f.jsxs("div",{className:"kanban-column__header-right",children:[f.jsx(wn,{variant:"neutral",children:t.length}),g&&f.jsx("div",{className:"kanban-column__wip-warning",title:`Over WIP limit of ${e.wipLimit}`,children:f.jsx(Ce,{name:"alert",size:14})})]})]}),f.jsxs("div",{ref:m,className:"kanban-column__body",children:[t.length===0?f.jsx("div",{className:"kanban-column__empty",children:"Drop cards here"}):t.map((p,v)=>f.jsxs(ae.Fragment,{children:[c&&o===v&&f.jsx("div",{className:"kanban-column__insertion-line"}),f.jsx(OO,{card:p,isSelected:a===p.id,renderCard:l,onSelect:x=>s==null?void 0:s(x),onCardPointerDown:u,onCardKeyDown:h})]},p.id)),c&&o===t.length&&f.jsx("div",{className:"kanban-column__insertion-line"})]})]})},IO=ae.forwardRef((m,h)=>{var g=m,{columns:e,cards:t,selectedId:a,onSelectCard:s,onMoveCard:l,renderCard:c,className:o=""}=g,u=fe(g,["columns","cards","selectedId","onSelectCard","onMoveCard","renderCard","className"]);const p=D.useRef(null),[v,x]=D.useState(null),[_,S]=D.useState(null),[w,C]=D.useState(null),k=D.useRef(null),j=D.useRef(null),E=D.useMemo(()=>{const A={};return e.forEach(U=>{A[U.id]=t.filter(F=>F.columnId===U.id)}),A},[e,t]),O=D.useCallback((A,U,F)=>{k.current&&(k.current.textContent=`Card "${A}" moved to ${U} at position ${F+1}`)},[]),z=D.useCallback((A,U)=>{const F=t.find(V=>V.id===U);if(!F)return;const $=A.currentTarget;$.setPointerCapture(A.pointerId),p.current={cardId:U,sourceColumnId:F.columnId,sourceIndex:E[F.columnId].findIndex(V=>V.id===U),offsetY:A.clientY,pointerId:A.pointerId,capturingElement:$},x(U),C(F.columnId)},[t,E]),I=D.useCallback(A=>{var U;if(!p.current||!((U=j.current)!=null&&U.getBoundingClientRect()))return;let F=null;for(const P of e){const re=document.querySelector(`[data-column-id="${CSS.escape(P.id)}"]`);if(re){const T=re.getBoundingClientRect();if(A.clientX>=T.left&&A.clientX<T.right){F=P,C(P.id);break}}}if(!F)return;const $=document.querySelector(`[data-column-id="${CSS.escape(F.id)}"] .kanban-column__body`);if(!$)return;const V=$.getBoundingClientRect(),K=A.clientY-V.top,H=$.querySelectorAll(".kanban-card");let X=0;for(let P=0;P<H.length;P++){const re=H[P].getBoundingClientRect(),T=re.top-V.top;if(K<T+re.height/2){X=P;break}else X=P+1}S(X)},[e]),B=D.useCallback(A=>{if(!p.current)return;const U=p.current;if(p.current=null,w&&_!==null){const F=e.find(V=>V.id===U.sourceColumnId),$=e.find(V=>V.id===w);if($&&F){const V=t.find(K=>K.id===U.cardId);V&&(l(U.cardId,w,_),O(V.title,$.title,_))}}if(x(null),S(null),C(null),U.capturingElement&&U.pointerId!==void 0)try{U.capturingElement.releasePointerCapture(U.pointerId)}catch(F){}},[e,t,w,_,l,O]),q=D.useCallback((A,U)=>{var F,$;const V=t.find(K=>K.id===U);if(V){if(A.key===" "){A.preventDefault();const K=p.current;if(K!=null&&K.isKeyboardGrab){l(K.cardId,K.sourceColumnId,K.sourceIndex);const H=e.find(X=>X.id===K.sourceColumnId);O(V.title,(H==null?void 0:H.title)||"",K.sourceIndex),p.current=null,x(null),S(null),C(null)}else{const H=E[V.columnId].findIndex(X=>X.id===U);p.current={cardId:U,sourceColumnId:V.columnId,sourceIndex:H,offsetY:0,isKeyboardGrab:!0,originalColumnId:V.columnId,originalIndex:H},x(U),C(V.columnId)}}else if(A.key==="ArrowUp"||A.key==="ArrowDown"||A.key==="ArrowLeft"||A.key==="ArrowRight"){A.preventDefault();const K=p.current;if(!K||!K.isKeyboardGrab)return;const H=e.findIndex(ce=>ce.id===K.sourceColumnId),X=E[K.sourceColumnId];if(!X){p.current=null,x(null),S(null),C(null);return}const P=K.sourceIndex;let re=K.sourceColumnId,T=P;A.key==="ArrowUp"&&P>0?T=P-1:A.key==="ArrowDown"&&P<X.length-1?T=P+1:A.key==="ArrowLeft"&&H>0?(re=e[H-1].id,T=0):A.key==="ArrowRight"&&H<e.length-1&&(re=e[H+1].id,T=0),p.current=Y(R({},K),{sourceColumnId:re,sourceIndex:T}),C(re),S(T),O(V.title,((F=e.find(ce=>ce.id===re))==null?void 0:F.title)||"",T)}else if(A.key==="Escape"){const K=p.current;K!=null&&K.isKeyboardGrab&&K.originalColumnId!==void 0&&K.originalIndex!==void 0&&(l(K.cardId,K.originalColumnId,K.originalIndex),O(V.title,(($=e.find(H=>H.id===K.originalColumnId))==null?void 0:$.title)||"",K.originalIndex)),p.current=null,x(null),S(null),C(null)}}},[t,E,e,l,O]);return f.jsxs("div",Y(R({ref:h,className:`kanban-board ${o}`,onPointerMove:I,onPointerUp:B},u),{children:[f.jsx("div",{ref:j,className:"kanban-board__columns",children:e.map(A=>f.jsx("div",{"data-column-id":A.id,className:"kanban-board__column-wrapper",children:f.jsx(zO,{column:A,cards:E[A.id]||[],selectedId:a,onSelectCard:U=>s==null?void 0:s(U),renderCard:c,draggedCardId:v||void 0,insertionIndex:w===A.id?_!=null?_:0:void 0,onCardPointerDown:z,onCardKeyDown:q})},A.id))}),f.jsx("div",{ref:k,className:"kanban-board__live-region",role:"status","aria-live":"polite","aria-atomic":"true"})]}))});IO.displayName="KanbanBoard";const UO=ae.forwardRef((h,u)=>{var m=h,{entries:e=[],follow:t=!0,maxRows:a=500,showOps:s=!1,className:l="","aria-label":c}=m,o=fe(m,["entries","follow","maxRows","showOps","className","aria-label"]);const g=D.useRef(null),p=D.useRef(null),[v,x]=D.useState(t);D.useEffect(()=>{u&&(typeof u=="function"?u(g.current):u.current=g.current)},[u]),D.useEffect(()=>{if(!t||!p.current)return;const C=new IntersectionObserver(k=>{k.forEach(j=>{j.isIntersecting&&x(!0)})},{threshold:.1});return C.observe(p.current),()=>{C.disconnect()}},[t]),D.useEffect(()=>{v&&t&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[e,t,v]),D.useEffect(()=>{if(!t||!g.current)return;const C=()=>{const{scrollTop:j,scrollHeight:E,clientHeight:O}=g.current;E-j-O<50||x(!1)},k=g.current;return k.addEventListener("scroll",C),()=>{k.removeEventListener("scroll",C)}},[t]);const _=e.slice(-a),S=C=>C.id?C.id:`log-${typeof C.timestamp=="string"?C.timestamp:C.timestamp.getTime()}-${C.level}-${C.message}-${C.op||""}-${C.target||""}`,w=["log-stream",l].filter(Boolean).join(" ");return f.jsxs("div",Y(R({ref:g,className:w,role:"log","aria-live":v&&t?"polite":void 0,"aria-label":c!=null?c:"Log stream"},o),{children:[f.jsx("div",{className:"log-stream__content",children:_.length===0?f.jsx("div",{className:"log-stream__empty",children:f.jsx("span",{className:"log-stream__empty-text",children:"No log entries"})}):_.map(C=>{const k=typeof C.timestamp=="string"?new Date(C.timestamp):C.timestamp,j=Wk(k),E=`log-stream__level log-stream__level--${C.level.toLowerCase()}`;return f.jsxs("div",{className:s?"log-stream__row log-stream__row--with-ops":"log-stream__row",children:[f.jsx("span",{className:"log-stream__time",children:j}),f.jsx("span",{className:E,children:C.level}),s&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"log-stream__op",children:C.op||""}),f.jsx("span",{className:"log-stream__target",children:C.target||""})]}),f.jsx("span",{className:"log-stream__message",children:C.message})]},S(C))})}),t&&f.jsx("div",{ref:p,className:"log-stream__sentinel"})]}))});UO.displayName="LogStream";function $m(e){const t=e.trim();if(/^#[0-9a-fA-F]{6}$/i.test(t))return t;if(/^#[0-9a-fA-F]{3}$/i.test(t)){const o=t.slice(1);return"#"+o[0]+o[0]+o[1]+o[1]+o[2]+o[2]}const a=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(a){const o=Math.max(0,Math.min(255,parseInt(a[1],10))),u=Math.max(0,Math.min(255,parseInt(a[2],10))),h=Math.max(0,Math.min(255,parseInt(a[3],10)));return"#"+[o,u,h].map(m=>m.toString(16).padStart(2,"0")).join("")}const s=t.match(/hsla?\s*\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%/);if(s){const o=parseFloat(s[1])/360,u=parseFloat(s[2])/100,h=parseFloat(s[3])/100,m=(1-Math.abs(2*h-1))*u,g=m*(1-Math.abs(o*6%2-1)),p=h-m/2;let v=0,x=0,_=0;o<1/6?(v=m,x=g):o<2/6?(v=g,x=m):o<3/6?(x=m,_=g):o<4/6?(x=g,_=m):o<5/6?(v=g,_=m):(v=m,_=g);const S=w=>Math.round((w+p)*255).toString(16).padStart(2,"0");return"#"+S(v)+S(x)+S(_)}const l={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",purple:"#800080",fuchsia:"#ff00ff"},c=t.toLowerCase();return c in l?l[c]:"#10b981"}function BO(e,t,a,s){const l=(e-t)/(a-t||1),c=Math.round((.12+l*.88)*255).toString(16).padStart(2,"0");return`${$m(s)}${c}`}function ki(e,t,a){const s=Math.pow(2,a),l=(t+180)/360*s*256,c=Math.max(-85.05112878,Math.min(85.05112878,e)),o=(1-Math.log(Math.tan(c*Math.PI/180)+1/Math.cos(c*Math.PI/180))/Math.PI)/2*s*256;return{x:l,y:o}}function FO(e,t,a){const s=Math.pow(2,a),l=e/(s*256)*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*(t/(s*256)))))*180/Math.PI,lng:l}}function HO({patternId:e,zoomLevel:t}){const a=32*Math.pow(2,t);return f.jsxs("pattern",{id:e,x:0,y:0,width:a,height:a,patternUnits:"userSpaceOnUse",children:[f.jsx("rect",{width:a,height:a,fill:"none",stroke:"rgb(var(--canvas-fg-3))",strokeWidth:"0.5",opacity:"0.3"}),f.jsx("circle",{cx:0,cy:0,r:1,fill:"rgb(var(--canvas-fg-3))",opacity:"0.4"})]})}function $O({pin:e,x:t,y:a,onClose:s}){const l=D.useRef(null);return ed(l,!0,{mode:"popup"}),D.useEffect(()=>{const c=o=>{o.key==="Escape"&&s()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[s]),f.jsxs("div",{ref:l,className:"map-popover",style:{left:`${t}px`,top:`${a}px`},role:"dialog",children:[e.label&&f.jsx("div",{className:"map-popover__label",children:e.label}),e.timestamp&&f.jsx("div",{className:"map-popover__timestamp",children:e.timestamp}),e.detail&&f.jsx("div",{className:"map-popover__detail",children:e.detail})]})}const PO=ae.forwardRef((C,w)=>{var k=C,{mode:e,pins:t=[],selectedPinId:a,onSelectPin:s,trackPoints:l=[],heatmapData:c=[],heatmapColor:o="#10b981",tileUrl:u,bounds:h,scaleBar:m=!1,minZoom:g=0,maxZoom:p=18,onViewportChange:v,onModeChange:x,className:_=""}=k,S=fe(k,["mode","pins","selectedPinId","onSelectPin","trackPoints","heatmapData","heatmapColor","tileUrl","bounds","scaleBar","minZoom","maxZoom","onViewportChange","onModeChange","className"]);const j=D.useRef(null),[E,O]=D.useState(null),[z,I]=D.useState(null),B=D.useRef(!1),q=D.useCallback(T=>{const ce=FO(T.x/T.zoom,T.y/T.zoom,Math.round(T.zoom*4));v==null||v({center:{lat:ce.lat,lng:ce.lng},zoom:T.zoom})},[v]),{transform:A,viewport:U,bind:F,panTo:$}=SS({minZoom:g,maxZoom:p,onViewportChange:q}),V=`map-grid-${D.useId().replace(/:/g,"")}`;D.useEffect(()=>{const T=j.current;if(!T)return;const ce=new ResizeObserver(he=>{const{width:M,height:se}=he[0].contentRect;M>0&&se>0&&O({width:M,height:se})});return ce.observe(T),()=>ce.disconnect()},[]),D.useEffect(()=>{if(B.current||!E||!h&&t.length===0&&l.length===0&&c.length===0)return;const T=[...t.map(je=>({lat:je.lat,lng:je.lng})),...l.map(je=>({lat:je.lat,lng:je.lng})),...c.map(je=>({lat:je.lat,lng:je.lng}))];let ce=null;if(h)ce={north:Math.max(h[0].lat,h[1].lat),south:Math.min(h[0].lat,h[1].lat),east:Math.max(h[0].lng,h[1].lng),west:Math.min(h[0].lng,h[1].lng)};else if(T.length>0){const je=T.map(Fe=>Fe.lat),lt=T.map(Fe=>Fe.lng);ce={north:Math.max(...je),south:Math.min(...je),east:Math.max(...lt),west:Math.min(...lt)}}if(!ce)return;const he=60,M=ki(ce.north,ce.west,10).y,se=ki(ce.south,ce.east,10).y,pe=ki(ce.north,ce.west,10).x,ge=ki(ce.north,ce.east,10).x,Se=Math.abs(se-M),xe=Math.abs(ge-pe);if(Se===0||xe===0||E.height<=he*2||E.width<=he*2){$(E.width/2,E.height/2),B.current=!0;return}const Ue=Math.log2((E.height-he*2)/Se),rt=Math.log2((E.width-he*2)/xe);if(!Number.isFinite(Ue)||!Number.isFinite(rt)){$(E.width/2,E.height/2),B.current=!0;return}const _t=Math.max(g,Math.min(p,Math.floor(Math.min(Ue,rt)))),Wt=(ce.north+ce.south)/2,tt=(ce.east+ce.west)/2,Oe=ki(Wt,tt,_t),qe=E.width/2-Oe.x*_t,gt=E.height/2-Oe.y*_t;$(qe,gt),B.current=!0},[E,h,t.length,l.length,c.length,g,p,$]);const K=D.useCallback(T=>{T.target instanceof Element&&(T.target.closest(".map-pin")||T.target.closest(".map-popover")||T.target.closest("[data-no-drag]"))||F.onPointerDown(T)},[F]),H=D.useCallback(()=>e!=="pins"||!t.length?null:f.jsx("div",{className:"map-pins","data-testid":"map-pins",style:{position:"absolute",inset:0,pointerEvents:"none"},children:t.map(T=>{const ce=ki(T.lat,T.lng,Math.round(U.zoom*4)),he=U.x+ce.x*U.zoom,M=U.y+ce.y*U.zoom;return f.jsxs("button",{type:"button",className:["map-pin",a===T.id&&"map-pin--selected"].filter(Boolean).join(" "),onClick:se=>{se.stopPropagation(),s==null||s(T.id);const pe=se.target.getBoundingClientRect();I({x:pe.right+8,y:pe.top})},"aria-label":`${T.label||"Pin"} at latitude ${T.lat.toFixed(4)}, longitude ${T.lng.toFixed(4)}${T.timestamp?` on ${T.timestamp}`:""}`,"data-testid":`map-pin-${T.id}`,"data-no-drag":!0,style:{position:"absolute",left:`${he}px`,top:`${M}px`,pointerEvents:"auto"},children:[f.jsx("span",{className:"map-pin__dot"}),T.label&&f.jsx("span",{className:"map-pin__label",children:T.label})]},T.id)})}),[e,t,U.zoom,U.x,U.y,a,s]),X=D.useCallback(()=>{if(e!=="track"||!l.length)return null;const T=l.map(ce=>ki(ce.lat,ce.lng,Math.round(U.zoom*4))).map((ce,he)=>`${he===0?"M":"L"} ${ce.x} ${ce.y}`).join(" ");return f.jsx("g",{className:"map-track","data-testid":"map-track",children:f.jsx("path",{d:T,className:"map-track__line"})})},[e,l,U.zoom]),P=D.useCallback(()=>{if(e!=="heatmap"||!c.length)return null;const T=c.map(M=>M.value).filter(M=>M!=null),ce=Math.min(...T),he=Math.max(...T);return f.jsx("g",{className:"map-heatmap","data-testid":"map-heatmap",children:c.map((M,se)=>{const pe=ki(M.lat,M.lng,Math.round(U.zoom*4)),ge=(M.value-ce)/(he-ce||1),Se=BO(M.value,ce,he,o);return f.jsx("circle",{cx:pe.x,cy:pe.y,r:8+ge*4,fill:Se,opacity:.6,"data-testid":`heatmap-point-${se}`},se)})})},[e,c,o,U.zoom]),re=D.useCallback(()=>{if(!u||!E)return null;const T=Math.min(Math.max(Math.floor(U.zoom*4),0),28),ce=Math.pow(2,T),he=Math.max(0,Math.floor(-U.x/(256*U.zoom))),M=Math.max(0,Math.floor(-U.y/(256*U.zoom))),se=Math.min(ce,Math.ceil((E.width-U.x)/(256*U.zoom))),pe=Math.min(ce,Math.ceil((E.height-U.y)/(256*U.zoom))),ge=typeof u=="function"?u:(xe,Ue,rt)=>u.replace("{x}",String(xe)).replace("{y}",String(Ue)).replace("{z}",String(rt)),Se=[];for(let xe=he;xe<se;xe++)for(let Ue=M;Ue<pe;Ue++){const rt=ge(xe,Ue,T);Se.push(f.jsx("image",{href:rt,x:xe*256,y:Ue*256,width:256,height:256,"data-testid":`tile-${xe}-${Ue}`},`${T}-${xe}-${Ue}`))}return Se},[u,E,U]);return f.jsxs("div",Y(R(Y(R({ref:T=>{typeof w=="function"?w(T):w&&(w.current=T),j.current=T},className:["map-canvas",_].filter(Boolean).join(" ")},F),{onPointerDown:K,role:"application","aria-label":"Map canvas"}),S),{children:[f.jsxs("svg",{className:"map-svg",width:"100%",height:"100%",style:{position:"absolute",inset:0,overflow:"visible"},children:[f.jsx("defs",{children:f.jsx(HO,{patternId:V,zoomLevel:U.zoom})}),u?f.jsx("g",{className:"map-tiles",transform:A,children:re()}):f.jsx("rect",{width:"100%",height:"100%",fill:`url(#${V})`,className:"map-grid"}),f.jsxs("g",{className:"map-viewport",transform:A,children:[X(),P()]})]}),H(),f.jsxs("div",{className:"map-overlay",children:[e==="track"&&f.jsx("div",{className:"map-legend",children:f.jsxs("div",{className:"map-legend__item",children:[f.jsx("div",{className:"map-legend__line",style:{backgroundColor:"rgb(var(--status-cyan))"}}),"Track"]})}),e==="heatmap"&&f.jsx("div",{className:"map-legend",children:f.jsxs("div",{className:"map-legend__item",children:[f.jsx("div",{className:"map-legend__gradient",style:{backgroundImage:`linear-gradient(to right, ${$m(o)}20, ${$m(o)}cc)`}}),"Density"]})}),x&&f.jsxs("div",{className:"map-mode-switch",children:[f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="pins"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("pins"),"aria-label":"Switch to pins mode",title:"Pins",children:"Pins"}),f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="track"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("track"),"aria-label":"Switch to track mode",title:"Track",children:"Track"}),f.jsx("button",{type:"button",className:["map-mode-switch__button",e==="heatmap"&&"map-mode-switch__button--active"].filter(Boolean).join(" "),onClick:()=>x("heatmap"),"aria-label":"Switch to heatmap mode",title:"Heatmap",children:"Heatmap"})]}),m&&f.jsx("div",{className:"map-scale-bar",children:f.jsxs("div",{className:"map-scale-bar__label",children:["Zoom: ",U.zoom.toFixed(1)]})})]}),a&&z&&(()=>{const T=t.find(ce=>ce.id===a);return T?f.jsx($O,{pin:T,x:z.x,y:z.y,onClose:()=>{s==null||s(null),I(null)}}):null})()]}))});PO.displayName="MapCanvas";const qO=e=>(typeof e=="string"?new Date(e):new Date(e)).toLocaleDateString("en-US",{month:"short",year:"numeric"}),VO=ae.forwardRef((h,u)=>{var m=h,{focusedDate:e,selectedDate:t,markers:a=[],weekStartsOn:s=0,onSelect:l,className:c=""}=m,o=fe(m,["focusedDate","selectedDate","markers","weekStartsOn","onSelect","className"]);const g=typeof e=="string"?new Date(e):new Date(e),p=t?typeof t=="string"?new Date(t):t:null,v=D.useMemo(()=>t_(g,s),[g.getTime(),s]),x=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];s===1&&x.push(x.shift());const _=S=>a.some(w=>Wr(S,w));return f.jsxs("div",Y(R({ref:u,className:`mini-calendar ${c}`.trim()},o),{children:[f.jsx("div",{className:"mini-calendar__header",children:f.jsx("div",{className:"mini-calendar__title",children:qO(g)})}),f.jsxs("div",{className:"mini-calendar__grid",children:[f.jsx("div",{className:"mini-calendar__weekdays",children:x.map(S=>f.jsx("div",{className:"mini-calendar__weekday",children:S.toUpperCase()},S))}),f.jsx("div",{className:"mini-calendar__dates",children:v.map(S=>S.map(w=>{const C=w.getMonth()!==g.getMonth(),k=p?Wr(w,p):!1,j=e_(w),E=_(w);return f.jsxs("button",{className:`mini-calendar__date ${C?"mini-calendar__date--out-of-month":""} ${k?"mini-calendar__date--selected":""} ${j?"mini-calendar__date--today":""} ${E?"mini-calendar__date--has-marker":""}`,onClick:()=>!C&&(l==null?void 0:l(w)),type:"button","aria-current":j?"date":void 0,"aria-selected":k,children:[f.jsx("span",{className:"mini-calendar__date-number",children:w.getDate()}),E&&f.jsx("span",{className:"mini-calendar__marker"})]},w.toISOString())}))})]})]}))});VO.displayName="MiniCalendar";const GO={life:"var(--dom-life)",climate:"var(--dom-climate)",software:"var(--dom-software)",data:"var(--dom-default)",infrastructure:"var(--dom-default)"},KO=e=>GO[e]||"var(--accent-primary)",QO=e=>{const t=["emerald","cyan","amber","rose","violet"],a=e.split("").reduce((s,l)=>s+l.charCodeAt(0),0);return t[a%t.length]},YO=ae.forwardRef((v,p)=>{var x=v,{domain:e,source:t,version:a,snippet:s,provenance:l,score:c,onOpen:o,actions:u,selected:h=!1,className:m=""}=x,g=fe(x,["domain","source","version","snippet","provenance","score","onOpen","actions","selected","className"]);const _=KO(e),S=QO(e),w=ae.useCallback(j=>{(j.key==="Enter"||j.key===" ")&&o&&(j.preventDefault(),o())},[o]),C=["result-card",h&&"result-card--selected",m].filter(Boolean).join(" "),k=a?`${t} v${a}`:t;return f.jsxs("div",Y(R({ref:p,className:C,role:"article","aria-label":k,tabIndex:o?0:void 0,onClick:o,onKeyDown:o?w:void 0,style:{"--domain-color":_}},g),{children:[f.jsxs("div",{className:"result-card__header",children:[f.jsxs("div",{className:"result-card__header-left",children:[f.jsx("div",{className:`result-card__domain-dot result-card__domain-dot--${S}`}),f.jsx("span",{className:"result-card__source",children:t}),a&&f.jsx(On,{children:a})]}),c!==void 0&&f.jsx("span",{className:"result-card__score-label",children:c.toFixed(2)})]}),c!==void 0&&f.jsx("div",{className:"result-card__score-bar",children:f.jsx(xp,{percent:c*100,color:"amber",height:4})}),f.jsx("div",{className:"result-card__snippet",children:s}),l&&Object.values(l).some(j=>j!==void 0)&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"result-card__divider"}),f.jsxs("div",{className:"result-card__provenance",children:[l.collection&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Collection"}),f.jsx("span",{className:"result-card__provenance-value",children:l.collection})]}),l.document&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Document"}),f.jsx("span",{className:"result-card__provenance-value",children:l.document})]}),l.section&&f.jsxs("span",{className:"result-card__provenance-field",children:[f.jsx("span",{className:"result-card__provenance-label",children:"Section"}),f.jsx("span",{className:"result-card__provenance-value",children:l.section})]})]})]}),u&&u.length>0&&f.jsx("div",{className:"result-card__actions",children:u.map((j,E)=>f.jsx(an,{variant:"ghost",size:"sm",icon:!!j.icon,title:j.label,onClick:O=>{O.stopPropagation(),j.onClick()},children:j.icon?f.jsx(Ce,{name:j.icon,size:16}):j.label},E))})]}))});YO.displayName="ResultCard";const XO=/^[0-9a-fA-F]+$/;function kS(e){let t;typeof atob=="function"?t=atob(e):t=globalThis.Buffer.from(e,"base64").toString("binary");let a="";for(let s=0;s<t.length;s++)a+=t.charCodeAt(s).toString(16).padStart(2,"0");return a}function im(e,t){if(!e)return"";if(XO.test(e)&&e.length===t)return e.toLowerCase();try{return kS(e).toLowerCase()}catch(a){return e.toLowerCase()}}function ZO(e){return!e||/^0+$/.test(e)?null:e}const sm=["UNSPECIFIED","INTERNAL","SERVER","CLIENT","PRODUCER","CONSUMER"];function JO(e){var t,a;if(typeof e=="number")return(t=sm[e])!=null?t:"UNSPECIFIED";if(typeof e=="string"){if(/^\d+$/.test(e))return(a=sm[Number(e)])!=null?a:"UNSPECIFIED";const s=e.replace(/^SPAN_KIND_/,"").toUpperCase();return sm.includes(s)?s:"UNSPECIFIED"}return"UNSPECIFIED"}function WO(e){const t=typeof e=="string"&&/^\d+$/.test(e)?Number(e):e;return t===2||t==="STATUS_CODE_ERROR"?"error":"ok"}function gu(e){if(e==null||e==="")return null;try{return typeof e=="number"?Number.isFinite(e)?BigInt(Math.trunc(e)):null:BigInt(/[.eE]/.test(e)?e.split(/[.eE]/)[0]:e)}catch(t){return null}}function Vp(e){var t;if(!e)return"";if(e.stringValue!==void 0)return e.stringValue;if(e.boolValue!==void 0)return e.boolValue;if(e.intValue!==void 0){const a=Number(e.intValue);return Number.isSafeInteger(a)?a:String(e.intValue)}if(e.doubleValue!==void 0)return e.doubleValue;if(e.bytesValue!==void 0)try{return kS(e.bytesValue)}catch(a){return e.bytesValue}return e.arrayValue?JSON.stringify(((t=e.arrayValue.values)!=null?t:[]).map(Vp)):e.kvlistValue?JSON.stringify(Pm(e.kvlistValue.values)):""}function Pm(e){const t={};return(e!=null?e:[]).forEach(a=>{a&&a.key&&(t[a.key]=Vp(a.value))}),t}function rm(e,t){const a=(e!=null?e:[]).find(s=>s.key===t);return a?Vp(a.value):void 0}const e4=["http.response.status_code","http.status_code","rpc.grpc.status_code"];function t4(e,t={}){var p,v,x;const a=(p=t.serviceNameKey)!=null?p:"service.name",s=Array.isArray(e)?e:(v=e==null?void 0:e.resourceSpans)!=null?v:[],l={},c=[];if(s.forEach(_=>{var k,j,E,O;var S;const w=(S=_.resource)==null?void 0:S.attributes,C=String((k=rm(w,a))!=null?k:"unknown_service");if(!l[C]){const z=(j=rm(w,"host.name"))!=null?j:rm(w,"service.instance.id");l[C]={label:C,host:z!=null?String(z):void 0}}((O=(E=_.scopeSpans)!=null?E:_.instrumentationLibrarySpans)!=null?O:[]).forEach(z=>{var I;((I=z.spans)!=null?I:[]).forEach(B=>c.push({span:B,service:C}))})}),c.length===0)return{spans:[],services:l,meta:{traceId:""}};let o=null;c.forEach(({span:_})=>{const S=gu(_.startTimeUnixNano);S!==null&&(o===null||S<o)&&(o=S)});const u=o!=null?o:BigInt(0),h=c.map(({span:_,service:S})=>{var A,U,F,$;var w;const C=(A=gu(_.startTimeUnixNano))!=null?A:u,k=(U=gu(_.endTimeUnixNano))!=null?U:C,j=Number(C-u)/1e6,E=Number(k-C)/1e6,O=Pm(_.attributes);let z;const I=((F=_.events)!=null?F:[]).map(V=>{var P;const K=Pm(V.attributes),H=gu(V.timeUnixNano),X=H!==null?Number(H-u)/1e6:j;return V.name==="exception"&&!z&&(z={type:K["exception.type"]!=null?String(K["exception.type"]):void 0,message:K["exception.message"]!=null?String(K["exception.message"]):void 0,stacktrace:K["exception.stacktrace"]!=null?String(K["exception.stacktrace"]):void 0}),{time:X,name:(P=V.name)!=null?P:"event",attributes:K}});let B;for(const V of e4){const K=O[V];if(K!==void 0){B=typeof K=="boolean"?String(K):K;break}}const q={id:im(_.spanId,16),parentId:ZO(im(_.parentSpanId,16)),name:($=_.name)!=null?$:"(unnamed)",service:S,kind:JO(_.kind),start:j,duration:E,status:WO((w=_.status)==null?void 0:w.code),statusCode:B,attributes:O,exception:z,events:I.length?I:void 0};return t.deriveStatus?Y(R({},q),{status:t.deriveStatus(q)}):q}),m=(x=h.find(_=>_.parentId===null))!=null?x:h[0],g={traceId:im(c[0].span.traceId,32),name:m==null?void 0:m.name,rootService:m==null?void 0:m.service};return{spans:h,services:l,meta:g}}function n4(e){if(!e)return"";const t=e.split("-");return t.length===3?(t[1]+t[2]).toLowerCase():e.replace(/-/g,"").toLowerCase()}function a4(e,t){return t?"SERVER":e.namespace==="aws"||e.namespace==="remote"?"CLIENT":"INTERNAL"}function i4(e){return e.fault||e.error||e.throttle?"error":"ok"}function qm(e,t,a){if(a!=null){if(typeof a!="object"||Array.isArray(a)){e[t]=Array.isArray(a)?JSON.stringify(a):a;return}Object.entries(a).forEach(([s,l])=>{if(l==null)return;const c=t?`${t}.${s}`:s;typeof l=="object"&&!Array.isArray(l)?qm(e,c,l):e[c]=Array.isArray(l)?JSON.stringify(l):l})}}function s4(e){var t,a;const s={},l=(t=e.http)==null?void 0:t.request,c=(a=e.http)==null?void 0:a.response;if((l==null?void 0:l.method)!=null&&(s["http.request.method"]=l.method),(l==null?void 0:l.url)!=null&&(s["url.full"]=l.url),(l==null?void 0:l.user_agent)!=null&&(s["user_agent.original"]=l.user_agent),(l==null?void 0:l.client_ip)!=null&&(s["client.address"]=l.client_ip),(c==null?void 0:c.status)!=null&&(s["http.response.status_code"]=c.status),(c==null?void 0:c.content_length)!=null&&(s["http.response.body.size"]=c.content_length),e.sql){const o=e.sql;o.database_type!=null&&(s["db.system"]=o.database_type),o.sanitized_query!=null&&(s["db.statement"]=o.sanitized_query),o.url!=null&&(s["server.address"]=o.url),o.user!=null&&(s["db.user"]=o.user)}return e.namespace&&(s["aws.xray.namespace"]=e.namespace),e.throttle&&(s["aws.xray.throttle"]=!0),"origin"in e&&e.origin&&(s["cloud.platform"]=String(e.origin)),e.aws&&qm(s,"aws",e.aws),e.annotations&&Object.entries(e.annotations).forEach(([o,u])=>{s[o]=u}),e.metadata&&qm(s,"metadata",e.metadata),s}function r4(e){var o,u;var t,a,s,l;let c;if(e.cause&&typeof e.cause=="object"&&(t=e.cause.exceptions)!=null&&t.length){const h=e.cause.exceptions[0],m=(a=h.stack)!=null&&a.length?`${(o=h.type)!=null?o:"Error"}: ${(u=h.message)!=null?u:""}
78
+ `+h.stack.map(g=>{var p,v,x;return` at ${(p=g.label)!=null?p:"<anonymous>"} (${(v=g.path)!=null?v:"?"}:${(x=g.line)!=null?x:0})`}).join(`
79
+ `):void 0;c={type:h.type,message:h.message,stacktrace:m}}else typeof e.cause=="string"&&(c={type:"Error",message:`exception ${e.cause}`});return{exception:c,statusCode:(l=(s=e.http)==null?void 0:s.response)==null?void 0:l.status}}function RS(e){var t,a;if(e==null)return[];if(Array.isArray(e))return e.flatMap(RS);if(e.Traces||e.traces){const s=(t=e.Traces)!=null?t:e.traces;let l=s;return s.length>1&&(console.warn(`fromXRay: response has ${s.length} traces; using the first. Pass one trace at a time for the rest.`),l=s.slice(0,1)),l.flatMap(c=>{var o;return((o=c.Segments)!=null?o:[]).map(u=>typeof u.Document=="string"?JSON.parse(u.Document):u.Document)})}return e.Segments||e.segments?((a=e.Segments)!=null?a:e.segments).map(s=>typeof s.Document=="string"?JSON.parse(s.Document):s.Document):[e]}function l4(e,t={}){var p;const a=RS(e);if(a.length===0)return{spans:[],services:{},meta:{traceId:""}};const s=[],l={},c=(v,x,_,S)=>{var w;s.push({node:v,parentId:x,service:_,isRoot:S}),((w=v.subsegments)!=null?w:[]).forEach(C=>c(C,v.id,_,!1))};a.forEach(v=>{var S;const x=v.type==="subsegment",_=v.name;l[_]||(l[_]={label:_}),c(v,(S=v.parent_id)!=null?S:null,_,!x)});let o=1/0,u=-1/0;s.forEach(({node:v})=>{typeof v.start_time=="number"&&(o=Math.min(o,v.start_time)),typeof v.end_time=="number"&&(u=Math.max(u,v.end_time))}),Number.isFinite(o)||(o=0),Number.isFinite(u)||(u=o);const h=s.map(({node:v,parentId:x,service:_,isRoot:S})=>{var q,A,U,F;const w=typeof v.start_time=="number"?v.start_time:o,C=(w-o)*1e3,k=typeof v.end_time=="number"?v.end_time:u,j=Math.max(0,(k-w)*1e3),E=s4(v),{exception:O,statusCode:z}=r4(v),I=O?[{time:C,name:"exception",attributes:{"exception.type":(q=O.type)!=null?q:"","exception.message":(A=O.message)!=null?A:""}}]:void 0,B={id:String((U=v.id)!=null?U:"").toLowerCase(),parentId:x!=null?String(x).toLowerCase():null,name:String((F=v.name)!=null?F:"(unnamed)"),service:_,kind:a4(v,S),start:C,duration:j,status:i4(v),statusCode:z,attributes:E,exception:O,events:I};return t.deriveStatus?Y(R({},B),{status:t.deriveStatus(B)}):B}),m=(p=a.find(v=>v.type!=="subsegment"))!=null?p:a[0],g={traceId:n4(m.trace_id),name:m.name,rootService:m.name};return{spans:h,services:l,meta:g}}function o4(e){const t={};e.forEach(h=>{t[h.id]=Y(R({},h),{end:h.start+h.duration,depth:0,children:[],hasChildren:!1})});const a=[];e.forEach(h=>{const m=t[h.id];h.parentId&&t[h.parentId]&&h.parentId!==h.id?t[h.parentId].children.push(m):a.push(m)});const s=(h,m)=>h.start-m.start||h.end-m.end;a.sort(s);const l=[];let c=0;const o=(h,m)=>{h.depth=m,h.hasChildren=h.children.length>0,m>c&&(c=m),l.push(h),h.children.sort(s),h.children.forEach(g=>o(g,m+1))};a.forEach(h=>o(h,0));const u=l.reduce((h,m)=>m.end>h?m.end:h,0);return{byId:t,ordered:l,roots:a,total:u,maxDepth:c}}function TS(e){if(!e.children.length)return e.duration;const t=e.children.map(c=>[Math.max(c.start,e.start),Math.min(c.end,e.end)]).filter(([c,o])=>o>c).sort((c,o)=>c[0]-o[0]);let a=0,s=null,l=0;return t.forEach(([c,o])=>{s===null?(s=c,l=o):c<=l?l=Math.max(l,o):(a+=l-s,s=c,l=o)}),s!==null&&(a+=l-s),Math.max(0,e.duration-a)}function c4(e,t){const a=[],s=new Set;return e.forEach(l=>{if(l.parentId&&s.has(l.parentId)){s.add(l.id);return}a.push(l),t.has(l.id)&&s.add(l.id)}),a}function u4(e){let t=0;const a=s=>{s.children.forEach(l=>{t++,a(l)})};return a(e),t}const Vm=2;function MS(e,t,a=Vm){const s=Math.max(1e-6,t-e),l=100-2*a;return{x:c=>a+(c-e)/s*l,w:c=>Math.max(.5,c/s*l)}}function d4(e,t){const a=Math.max(1e-6,t-e)/8,s=Math.pow(10,Math.floor(Math.log10(a))),l=a/s,c=s*(l<1.5?1:l<3?2:l<7?5:10),o=[],u=Math.ceil(e/c-1e-9)*c;for(let h=u;h<=t+1e-6;h+=c)o.push(+h.toFixed(3));return{ticks:o,step:c}}function Sn(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(2)+" s":e>=10?e.toFixed(0)+" ms":e>=1?e.toFixed(1)+" ms":e.toFixed(2)+" ms"}const AS=["#22D3EE","#818CF8","#10B981","#8B5CF6","#14B8A6","#F59E0B","#38BDF8","#A3E635","#E879F9","#2DD4BF"];function f4(e){let t=2166136261;for(let a=0;a<e.length;a++)t^=e.charCodeAt(a),t=Math.imul(t,16777619)>>>0;return t>>>0}function h4(e,t=AS){return t[f4(e)%t.length]}function m4(e,t,a,s=AS){var l;return(a==null?void 0:a(e))||((l=t==null?void 0:t[e])==null?void 0:l.color)||h4(e,s)}function p4(e,t){var a;return((a=t==null?void 0:t[e])==null?void 0:a.label)||e}const g4={SERVER:"server",CLIENT:"client",INTERNAL:"internal",PRODUCER:"producer",CONSUMER:"consumer",UNSPECIFIED:"internal"},y4={ok:"OK",warn:"WARN",error:"ERROR"};function v4({model:e,resolveColor:t,selectedId:a}){const{ordered:s,total:l}=e,c=100,o=2,u=1,h=3,m=s.length,g=h*2+m*(o+u),p=s.findIndex(x=>x.id===a),v=ae.useMemo(()=>{const x=MS(0,l);return s.map((_,S)=>f.jsx("rect",{x:x.x(_.start),y:h+S*(o+u),width:x.w(_.duration),height:o,rx:"0.6",fill:_.status==="error"?"rgb(var(--status-error))":t(_.service),fillOpacity:.5},_.id))},[s,l,t]);return f.jsxs("svg",{className:"trace-detail__minimap",width:"100%",height:g,viewBox:`0 0 ${c} ${g}`,preserveAspectRatio:"none",children:[p>=0&&f.jsx("rect",{x:"0",y:h+p*(o+u)-1,width:c,height:o+2,className:"trace-detail__minimap-band"}),v]})}function T0({rows:e}){return f.jsx("div",{className:"trace-detail__kv",children:e.map(([t,a],s)=>f.jsxs(ae.Fragment,{children:[f.jsx("div",{className:"trace-detail__kv-key",title:t,children:t}),f.jsx("div",{className:"trace-detail__kv-val",title:typeof a=="string"?a:void 0,children:a})]},t+s))})}function ps({title:e,right:t,children:a}){return f.jsxs("div",{className:"trace-detail__section",children:[f.jsxs("div",{className:"trace-detail__section-head",children:[f.jsx("span",{className:"trace-detail__eyebrow",children:e}),t]}),f.jsx("div",{className:"trace-detail__section-body",children:a})]})}const DS=ae.forwardRef(function({span:e,model:t,traceId:a,resolveColor:s,serviceLabel:l,serviceHost:c,onClose:o,onSelect:u,renderAttributes:h,closeButtonRef:m},g){var I,B,q,A;var p;const v=s(e.service),x=t.total,_=TS(e),S=x>0?e.duration/x*100:0,w=e.duration>0?_/e.duration*100:0,C=e.parentId?t.byId[e.parentId]:null,k=(I=g4[e.kind])!=null?I:"internal",j=t.ordered.findIndex(U=>U.id===e.id)+1,E=e.attributes?Object.entries(e.attributes):[],O=((B=e.events)!=null?B:[]).filter(U=>U.name!=="exception"),z=({label:U,value:F,sub:$})=>f.jsxs("div",{className:"trace-detail__timing-row",children:[f.jsx("span",{className:"trace-detail__timing-label",children:U}),f.jsxs("span",{className:"trace-detail__timing-value",children:[F,$&&f.jsxs("span",{className:"trace-detail__timing-sub",children:[" ",$]})]})]});return f.jsxs("div",{className:"trace-detail",ref:g,role:"complementary","aria-label":`Span detail: ${e.name}`,onKeyDown:U=>{U.key==="Escape"&&(U.stopPropagation(),o())},children:[f.jsxs("div",{className:"trace-detail__head",children:[f.jsx("span",{className:"trace-detail__head-swatch",style:{background:v}}),f.jsxs("div",{className:"trace-detail__head-main",children:[f.jsxs("div",{className:"trace-detail__eyebrow",children:[l.toUpperCase()," · ",e.kind]}),f.jsx("div",{className:"trace-detail__title",children:e.name}),f.jsx("div",{className:"trace-detail__status-row",children:f.jsxs("span",{className:`trace-detail__status-pill trace-detail__status-pill--${e.status}`,children:[f.jsx("span",{className:"trace-detail__status-dot"}),y4[e.status],e.statusCode!=null&&e.statusCode!==0?` · ${e.statusCode}`:""]})})]}),f.jsx("button",{type:"button",className:"trace-detail__close",onClick:o,title:"Close panel","aria-label":"Close span detail",ref:m,children:f.jsx(Ce,{name:"x",size:14})})]}),f.jsxs("div",{className:"trace-detail__scroll",children:[f.jsxs(ps,{title:"TRACE MAP",children:[f.jsx("div",{className:"trace-detail__minimap-wrap",children:f.jsx(v4,{model:t,resolveColor:s,selectedId:e.id})}),f.jsxs("div",{className:"trace-detail__minimap-caption",children:["row ",j," of ",t.ordered.length]})]}),f.jsxs(ps,{title:"TIMING",children:[f.jsx(z,{label:"start offset",value:Sn(e.start)}),f.jsx(z,{label:"duration",value:Sn(e.duration)}),f.jsx(z,{label:"self time",value:Sn(_),sub:`· ${w.toFixed(0)}%`}),f.jsx(z,{label:"% of trace",value:`${S.toFixed(1)}%`}),f.jsxs("div",{className:"trace-detail__selfbar",children:[f.jsx("div",{className:"trace-detail__selfbar-self",style:{width:`${w}%`,background:v}}),f.jsx("div",{className:"trace-detail__selfbar-children"})]}),f.jsxs("div",{className:"trace-detail__selfbar-legend",children:[f.jsxs("span",{children:["SELF ",Sn(_)]}),f.jsxs("span",{children:["IN CHILDREN ",Sn(e.duration-_)]})]})]}),f.jsx(ps,{title:"IDENTITY",children:f.jsx(T0,{rows:[["span_id",e.id],["parent",C?f.jsx("button",{type:"button",className:"trace-detail__link",onClick:()=>u(C.id),title:C.name,children:C.name}):f.jsx("span",{className:"trace-detail__muted",children:"— root —"})],["service",f.jsxs("span",{className:"trace-detail__svc",title:l,children:[f.jsx("span",{className:"trace-detail__svc-dot",style:{background:v}}),l]})],...c?[["host",c]]:[],["kind",f.jsx("span",{className:`trace-detail__kind trace-detail__kind--${k}`,children:e.kind})],...a?[["trace_id",a]]:[]]})}),h?f.jsx(ps,{title:"ATTRIBUTES",children:h(e)}):E.length>0?f.jsx(ps,{title:"ATTRIBUTES",right:f.jsx("span",{className:"trace-detail__count",children:E.length}),children:f.jsx(T0,{rows:E.map(([U,F])=>[U,String(F)])})}):null,O.length>0&&f.jsx(ps,{title:"EVENTS",right:f.jsx("span",{className:"trace-detail__count",children:O.length}),children:f.jsx("div",{className:"trace-detail__events",children:O.map((U,F)=>f.jsxs("div",{className:"trace-detail__event",children:[f.jsx("span",{className:"trace-detail__event-time",children:Sn(U.time)}),f.jsx("span",{className:"trace-detail__event-name",children:U.name})]},F))})}),f.jsx(ps,{title:"STATUS",children:e.status==="error"&&e.exception?f.jsxs("div",{className:"trace-detail__error",children:[f.jsxs("div",{className:"trace-detail__error-head",children:[f.jsx(Ce,{name:"alert",size:14}),f.jsx("span",{children:(q=e.exception.type)!=null?q:"Error"})]}),e.exception.message&&f.jsx("div",{className:"trace-detail__error-msg",children:e.exception.message}),e.exception.stacktrace&&f.jsx("pre",{className:"trace-detail__error-stack",children:e.exception.stacktrace})]}):e.status==="warn"?f.jsxs("div",{className:"trace-detail__warn",children:[f.jsx(Ce,{name:"alert",size:13}),"degraded — ",String((A=(p=e.attributes)==null?void 0:p.note)!=null?A:"elevated latency on this span")]}):f.jsxs("div",{className:"trace-detail__ok",children:[f.jsx("span",{className:"trace-detail__ok-dot"}),"OK",e.statusCode?` · ${e.statusCode}`:""]})}),f.jsx("div",{className:"trace-detail__foot-spacer"})]})]})});DS.displayName="TraceDetailPanel";const M0=14,A0=16;function b4({node:e,rowHeight:t,treeWidth:a,selected:s,hovered:l,collapsed:c,color:o,onSelect:u,onHover:h,onToggle:m,registerRef:g}){const p=M0+e.depth*A0,v=[];for(let _=0;_<e.depth;_++)v.push(M0+_*A0+7);const x=["trace-viewer__tree-row",s&&"is-selected",l&&"is-hovered",e.status==="error"&&"is-error",e.status==="warn"&&"is-warn"].filter(Boolean).join(" ");return f.jsxs("div",{ref:_=>g(e.id,_),className:x,role:"treeitem","aria-level":e.depth+1,"aria-selected":s,"aria-expanded":e.hasChildren?!c:void 0,tabIndex:s?0:-1,style:{height:t,paddingLeft:p,width:a},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[v.map((_,S)=>f.jsx("span",{className:"trace-viewer__guide",style:{left:_}},S)),e.hasChildren?f.jsx("button",{type:"button",className:"trace-viewer__twisty"+(c?"":" is-open"),onClick:_=>{_.stopPropagation(),m(e.id)},tabIndex:-1,"aria-label":c?"Expand":"Collapse",children:f.jsx(Ce,{name:"chevronRight",size:13})}):f.jsx("span",{className:"trace-viewer__twisty trace-viewer__twisty--leaf",children:f.jsx("span",{className:"trace-viewer__leaf-dot"})}),f.jsx("span",{className:"trace-viewer__swatch",style:{background:o}}),f.jsx("span",{className:"trace-viewer__tree-name",children:e.name}),c&&e.hasChildren&&f.jsxs("span",{className:"trace-viewer__desc-count",children:["+",u4(e)]}),f.jsx("span",{className:"trace-viewer__tree-dur",children:Sn(e.duration)})]})}function x4({node:e,rowHeight:t,scaleX:a,scaleW:s,selected:l,hovered:c,color:o,onSelect:u,onHover:h}){const m=a(e.start),g=s(e.duration),p=m+g<68,v=e.status==="error",x=e.status==="warn",_=["trace-viewer__wf-row",l&&"is-selected",c&&"is-hovered"].filter(Boolean).join(" ");return f.jsxs("div",{className:_,style:{height:t},onClick:()=>u(e.id),onMouseEnter:()=>h(e.id),onMouseLeave:()=>h(null),children:[f.jsx("div",{className:"trace-viewer__bar"+(v?" is-error":"")+(l?" is-selected":""),style:{left:`${m}%`,width:`${g}%`,background:o},children:x&&f.jsx("span",{className:"trace-viewer__bar-warn"})}),v&&f.jsx("span",{className:"trace-viewer__bar-alert",style:{left:`calc(${m}% - 4px)`},children:f.jsx(Ce,{name:"alert",size:12})}),f.jsxs("span",{className:"trace-viewer__bar-label",style:p?{left:`calc(${m+g}% + 7px)`}:{right:`calc(${100-m}% + 7px)`},children:[f.jsx("span",{className:"trace-viewer__bar-dur"+(v?" is-error":x?" is-warn":""),children:Sn(e.duration)}),f.jsx("span",{className:"trace-viewer__bar-name",children:e.name})]})]})}const _4=ae.memo(function({model:e,resolveColor:t,resolveLabel:a}){const{ordered:s,total:l}=e,c=new Set(s.map(v=>v.service)),o=s.filter(v=>v.status==="error").length,u=s.filter(v=>v.status==="warn").length,h={};s.forEach(v=>{h[v.service]=(h[v.service]||0)+TS(v)});const m=Object.entries(h).sort((v,x)=>x[1]-v[1]),g=m.reduce((v,[,x])=>v+x,0)||1,p=({label:v,value:x,tone:_})=>f.jsxs("div",{className:"trace-viewer__stat"+(_?` trace-viewer__stat--${_}`:""),children:[f.jsx("span",{className:"trace-viewer__eyebrow",children:v}),f.jsx("span",{className:"trace-viewer__stat-value",children:x})]});return f.jsxs("div",{className:"trace-viewer__summary",children:[f.jsx(p,{label:"DURATION",value:Sn(l),tone:"accent"}),f.jsx(p,{label:"SPANS",value:s.length}),f.jsx(p,{label:"SERVICES",value:c.size}),f.jsx(p,{label:"ERRORS",value:o,tone:o?"error":void 0}),f.jsx(p,{label:"WARNINGS",value:u,tone:u?"warn":void 0}),f.jsxs("div",{className:"trace-viewer__svcbar-wrap",children:[f.jsx("span",{className:"trace-viewer__eyebrow",children:"TIME PER SERVICE · SELF"}),f.jsx("div",{className:"trace-viewer__svcbar",children:m.map(([v,x])=>f.jsx("div",{className:"trace-viewer__svcbar-seg",title:`${a(v)} · ${Sn(x)}`,style:{width:`${x/g*100}%`,background:t(v)}},v))}),f.jsx("div",{className:"trace-viewer__svc-legend",children:m.map(([v,x])=>f.jsxs("span",{className:"trace-viewer__svc-legend-item",children:[f.jsx("span",{className:"trace-viewer__svc-legend-dot",style:{background:t(v)}}),a(v),f.jsx("span",{className:"trace-viewer__svc-legend-val",children:Sn(x)})]},v))})]})]})}),S4=ae.forwardRef(function(B,I){var q=B,{trace:e,otlp:t,xray:a,selectedSpanId:s,defaultSelectedSpanId:l=null,onSelectSpan:c,collapsedSpanIds:o,defaultCollapsedSpanIds:u,onToggleSpan:h,showSummary:m=!0,showToolbar:g=!0,showDetailPanel:p=!0,treeWidth:v=336,detailPanelWidth:x=360,rowHeight:_=30,services:S,serviceColor:w,deriveStatus:C,renderAttributes:k,enableZoom:j=!0,virtualizeThreshold:E=80,className:O=""}=q,z=fe(q,["trace","otlp","xray","selectedSpanId","defaultSelectedSpanId","onSelectSpan","collapsedSpanIds","defaultCollapsedSpanIds","onToggleSpan","showSummary","showToolbar","showDetailPanel","treeWidth","detailPanelWidth","rowHeight","services","serviceColor","deriveStatus","renderAttributes","enableZoom","virtualizeThreshold","className"]);var A,U;const F=D.useMemo(()=>{let ne;return t?ne=t4(t):a?ne=l4(a):ne=e!=null?e:{spans:[]},C&&(ne=Y(R({},ne),{spans:ne.spans.map(be=>Y(R({},be),{status:C(be)}))})),ne},[t,a,e,C]),$=D.useMemo(()=>o4(F.spans),[F]),{ordered:V,byId:K,total:H}=$,X=D.useMemo(()=>{var ne;return R(R({},(ne=F.services)!=null?ne:{}),S!=null?S:{})},[F.services,S]),P=D.useCallback(ne=>m4(ne,X,w),[X,w]),re=D.useCallback(ne=>p4(ne,X),[X]),[T,ce]=D.useState(l),he=s!==void 0?s:T,M=he&&K[he]?he:null,se=D.useCallback(ne=>{s===void 0&&ce(ne),c==null||c(ne)},[s,c]),[pe,ge]=D.useState(()=>new Set(u!=null?u:[])),Se=D.useMemo(()=>o?new Set(o):pe,[o,pe]),xe=D.useCallback(ne=>{const be=!Se.has(ne);o===void 0&&ge(Re=>{const He=new Set(Re);return He.has(ne)?He.delete(ne):He.add(ne),He}),h==null||h(ne,be)},[Se,o,h]),Ue=D.useCallback(ne=>{var be;if(o!==void 0)return;const Re=[];let He=(be=K[ne])!=null&&be.parentId?K[K[ne].parentId]:null;for(;He;)Re.push(He.id),He=He.parentId?K[He.parentId]:null;Re.length&&ge(Lt=>{const ha=new Set(Lt);return Re.forEach(ja=>ha.delete(ja)),ha})},[K,o]),[rt,_t]=D.useState(null),[Wt,tt]=D.useState(null),Oe=Wt!=null?Wt:[0,H||1],qe=D.useMemo(()=>MS(Oe[0],Oe[1]),[Oe[0],Oe[1]]),gt=D.useMemo(()=>d4(Oe[0],Oe[1]).ticks,[Oe[0],Oe[1]]),je=D.useMemo(()=>c4(V,Se),[V,Se]),lt=D.useMemo(()=>{const ne=new Map;return je.forEach((be,Re)=>ne.set(be.id,Re)),ne},[je]),Fe=je.length*_,[ua,da]=D.useState(600),Ca=je.length>=E,{visibleRange:ei,containerRef:Tt,sentinelRef:Qi}=Sp({itemCount:je.length,itemHeight:_,containerHeight:ua,overscan:16}),le=Ca?Math.max(0,ei[0]):0,ve=Ca?Math.min(je.length,ei[1]):je.length,Ee=je.slice(le,ve);D.useEffect(()=>{const ne=Tt.current;if(!ne||typeof ResizeObserver>"u")return;const be=new ResizeObserver(()=>da(ne.clientHeight||600));return be.observe(ne),da(ne.clientHeight||600),()=>be.disconnect()},[Tt]);const Ze=D.useMemo(()=>{const ne=new Set;let be=M?K[M]:null;for(;be;)ne.add(be.id),be=be.parentId?K[be.parentId]:null;return ne},[M,K]),ke=D.useRef(new Map),yt=D.useCallback((ne,be)=>{be?ke.current.set(ne,be):ke.current.delete(ne)},[]),St=D.useRef(null),kt=D.useCallback(ne=>{const be=lt.get(ne),Re=Tt.current;if(be==null||!Re)return;const He=be*_,Lt=He+_;He<Re.scrollTop?Re.scrollTop=Math.max(0,He-_):Lt>Re.scrollTop+Re.clientHeight&&(Re.scrollTop=Lt-Re.clientHeight+_)},[lt,_,Tt]),wt=D.useCallback((ne,be=6)=>{const Re=ke.current.get(ne);if(Re){Re.focus();return}be>0&&requestAnimationFrame(()=>wt(ne,be-1))},[]);D.useEffect(()=>{M&&(kt(M),St.current===M&&(wt(M),St.current=null))},[M,kt,wt]);const ft=D.useCallback((ne,be=!0)=>{Ue(ne),be&&(St.current=ne),se(ne)},[Ue,se]),ot=D.useCallback(ne=>{var be;const Re=M!=null?M:(be=je[0])==null?void 0:be.id;if(!Re)return;const He=lt.get(Re);if(He==null)return;const Lt=K[Re];switch(ne.key){case"ArrowDown":ne.preventDefault(),je[He+1]&&ft(je[He+1].id);break;case"ArrowUp":ne.preventDefault(),je[He-1]&&ft(je[He-1].id);break;case"ArrowRight":ne.preventDefault(),Lt.hasChildren&&Se.has(Re)?xe(Re):je[He+1]&&je[He+1].parentId===Re&&ft(je[He+1].id);break;case"ArrowLeft":ne.preventDefault(),Lt.hasChildren&&!Se.has(Re)?xe(Re):Lt.parentId&&ft(Lt.parentId);break;case"Home":ne.preventDefault(),je[0]&&ft(je[0].id);break;case"End":ne.preventDefault(),je[je.length-1]&&ft(je[je.length-1].id);break;case"Enter":case" ":ne.preventDefault(),ft(Re);break;case"Escape":M&&(ne.preventDefault(),se(null));break}},[M,je,lt,K,Se,xe,ft,se]),fa=D.useMemo(()=>{const ne=new Map;return V.forEach((be,Re)=>ne.set(be.id,Re)),ne},[V]),en=D.useMemo(()=>V.filter(ne=>ne.status==="error").map(ne=>ne.id),[V]),$o=D.useCallback(ne=>{var ha,ja;if(!en.length)return;const be=ln=>{var aa;return(aa=fa.get(ln))!=null?aa:-1},Re=M?be(M):-1,He=en.map(be).sort((ln,aa)=>ln-aa);let Lt;ne===1?Lt=(ha=He.find(ln=>ln>Re))!=null?ha:He[0]:Lt=(ja=[...He].reverse().find(ln=>ln<Re))!=null?ja:He[He.length-1],Lt!=null&&ft(V[Lt].id)},[en,V,M,ft]),Ps=D.useCallback(()=>{o===void 0&&ge(new Set(V.filter(ne=>ne.hasChildren).map(ne=>ne.id)))},[o,V]),qs=D.useCallback(()=>{o===void 0&&ge(new Set)},[o]),Yi=D.useRef(null),[rn,Na]=D.useState(null),In=D.useRef(null),Vs=D.useCallback(ne=>{const be=Yi.current;if(!be)return 0;const Re=be.getBoundingClientRect();return Math.min(100,Math.max(0,(ne-Re.left)/Re.width*100))},[]),Gs=D.useCallback(ne=>{const be=100-2*Vm,Re=(ne-Vm)/be;return Oe[0]+Re*(Oe[1]-Oe[0])},[Oe]),cl=D.useCallback(ne=>{if(!j||H<=0)return;ne.currentTarget.setPointerCapture(ne.pointerId);const be=Vs(ne.clientX);In.current=be,Na({a:be,b:be})},[j,H,Vs]),Xi=D.useCallback(ne=>{In.current!=null&&Na({a:In.current,b:Vs(ne.clientX)})},[Vs]),cd=D.useCallback(()=>{if(In.current==null)return;const ne=rn;if(In.current=null,Na(null),!ne||Math.abs(ne.b-ne.a)<1.5)return;const be=Gs(Math.min(ne.a,ne.b)),Re=Gs(Math.max(ne.a,ne.b)),He=Math.max(0,Math.min(be,Re)),Lt=Math.min(H,Math.max(be,Re));Lt-He>H*.005&&tt([He,Lt])},[rn,Gs,H]),ul=D.useCallback(()=>{In.current=null,Na(null)},[]),dl=Wt!=null;D.useEffect(()=>{s===void 0&&T&&!K[T]&&ce(null)},[K,T,s]);const ti=M?K[M]:null,Ks=p&&!!ti,fl=D.useRef(null),Po=D.useCallback(()=>{const ne=M;se(null),ne&&wt(ne)},[M,se,wt]),ni=en.length,na=["trace-viewer",O].filter(Boolean).join(" ");return V.length?f.jsxs("div",Y(R({ref:I,className:na},z),{children:[m&&f.jsx(_4,{model:$,resolveColor:P,resolveLabel:re}),g&&f.jsxs("div",{className:"trace-viewer__toolbar",children:[f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:qs,title:"Expand all","aria-label":"Expand all",children:f.jsx(Ce,{name:"chevronDown",size:14})}),f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:Ps,title:"Collapse all","aria-label":"Collapse all",children:f.jsx(Ce,{name:"chevronRight",size:14})})]}),f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>$o(-1),disabled:!ni,title:"Previous error","aria-label":"Previous error",children:f.jsx(Ce,{name:"arrowUp",size:14})}),f.jsxs("span",{className:"trace-viewer__error-count"+(ni?" is-active":""),children:[ni," error",ni!==1?"s":""]}),f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>$o(1),disabled:!ni,title:"Next error","aria-label":"Next error",children:f.jsx(Ce,{name:"arrowDown",size:14})})]}),j&&f.jsxs("div",{className:"trace-viewer__toolbar-group",children:[f.jsx("button",{type:"button",className:"trace-viewer__tool-btn",onClick:()=>tt(null),disabled:!dl,title:"Reset zoom","aria-label":"Reset zoom",children:f.jsx(Ce,{name:"reload",size:14})}),f.jsx("span",{className:"trace-viewer__zoom-hint",children:dl?`${Sn(Oe[0])} – ${Sn(Oe[1])}`:"drag axis to zoom"})]})]}),f.jsxs("div",{className:"trace-viewer__body",children:[f.jsxs("div",{className:"trace-viewer__lane",children:[f.jsxs("div",{className:"trace-viewer__lane-head",style:{height:32},children:[f.jsxs("div",{className:"trace-viewer__tree-head",style:{width:v},children:[f.jsxs("span",{className:"trace-viewer__eyebrow",children:["SPAN · ",je.length,"/",V.length]}),f.jsx("span",{className:"trace-viewer__eyebrow",children:"DURATION"})]}),f.jsxs("div",{className:"trace-viewer__axis"+(j?" is-zoomable":""),ref:Yi,onPointerDown:cl,onPointerMove:Xi,onPointerUp:cd,onPointerCancel:ul,onLostPointerCapture:ul,onDoubleClick:()=>tt(null),children:[gt.map((ne,be)=>f.jsx("div",{className:"trace-viewer__tick-label",style:{left:`${qe.x(ne)}%`},children:ne===0?"0":Sn(ne)},be)),rn&&f.jsx("div",{className:"trace-viewer__brush",style:{left:`${Math.min(rn.a,rn.b)}%`,width:`${Math.abs(rn.b-rn.a)}%`}})]})]}),f.jsx("div",{className:"trace-viewer__scroll",ref:Tt,children:f.jsxs("div",{className:"trace-viewer__rows",style:{height:Fe},children:[f.jsx("div",{ref:Qi,className:"trace-viewer__sentinel"}),f.jsx("div",{className:"trace-viewer__tree",role:"tree","aria-label":"Span tree",tabIndex:0,onKeyDown:ot,style:{width:v,height:Fe},children:Ee.map((ne,be)=>{const Re=le+be;return f.jsx("div",{className:"trace-viewer__row-abs",style:{top:Re*_},children:f.jsx(b4,{node:ne,rowHeight:_,treeWidth:v,selected:M===ne.id,hovered:rt===ne.id,collapsed:Se.has(ne.id),color:P(ne.service),onSelect:He=>ft(He,!1),onHover:_t,onToggle:xe,registerRef:yt})},ne.id)})}),f.jsxs("div",{className:"trace-viewer__wf",style:{height:Fe},children:[gt.map((ne,be)=>f.jsx("div",{className:"trace-viewer__gridline",style:{left:`${qe.x(ne)}%`}},be)),f.jsx("svg",{className:"trace-viewer__connectors",width:"100%",height:Fe,viewBox:`0 0 100 ${Fe}`,preserveAspectRatio:"none",children:je.map(ne=>{if(!ne.parentId)return null;const be=lt.get(ne.id),Re=lt.get(ne.parentId);if(be==null||Re==null)return null;const He=Math.min(be,Re);if(Math.max(be,Re)<le-24||He>ve+24)return null;const Lt=K[ne.parentId],ha=qe.x(Lt.start),ja=qe.x(ne.start),ln=Re*_+_/2+5,aa=be*_+_/2,ai=Ze.has(ne.id)&&Ze.has(ne.parentId);return f.jsx("path",{d:`M ${ha} ${ln} L ${ha} ${aa} L ${ja} ${aa}`,className:"trace-viewer__connector"+(ai?" is-active":""),vectorEffect:"non-scaling-stroke"},ne.id)})}),Ee.map((ne,be)=>{const Re=le+be;return f.jsx("div",{className:"trace-viewer__row-abs",style:{top:Re*_},children:f.jsx(x4,{node:ne,rowHeight:_,scaleX:qe.x,scaleW:qe.w,selected:M===ne.id,hovered:rt===ne.id,color:P(ne.service),onSelect:He=>ft(He,!1),onHover:_t})},ne.id)})]})]})})]}),p&&f.jsx("div",{className:"trace-viewer__panel"+(Ks?" is-open":""),style:{width:Ks?x:0},children:ti&&f.jsx(DS,{span:ti,model:$,traceId:(A=F.meta)==null?void 0:A.traceId,resolveColor:P,serviceLabel:re(ti.service),serviceHost:(U=X[ti.service])==null?void 0:U.host,onClose:Po,onSelect:ne=>ft(ne,!1),renderAttributes:k,closeButtonRef:fl})})]})]})):f.jsx("div",Y(R({ref:I,className:na},z),{children:f.jsx("div",{className:"trace-viewer__empty",children:"No spans in this trace."})}))});S4.displayName="TraceViewer";const D0=typeof window!="undefined"?window.innerWidth>=1300:!1;function LS(e){typeof document!="undefined"&&document.body.classList.toggle("dark-canvas",e)}const ho=(e,t)=>`${e}:${t}`,Ie=qu(e=>({view:"model",layerId:null,selectedId:null,changesetId:null,canvasDark:!1,chatOpen:D0,wide:D0,expandedSections:new Set(["model"]),expandedLayers:new Set,setView:t=>e({view:t}),selectLayer:t=>e(a=>{const s=new Set(a.expandedLayers);return s.add(ho(a.view,t)),{layerId:t,selectedId:null,expandedSections:new Set(a.expandedSections).add(a.view),expandedLayers:s}}),selectNode:t=>e({selectedId:t}),selectGraphNode:t=>e(a=>({selectedId:t,expandedSections:new Set(a.expandedSections).add(a.view),expandedLayers:a.layerId?new Set(a.expandedLayers).add(ho(a.view,a.layerId)):a.expandedLayers})),navigateToElement:(t,a)=>e(s=>{const c=s.layerId===a?s.expandedLayers:new Set(s.expandedLayers).add(ho("model",a));return{view:"model",layerId:a,selectedId:t,expandedSections:new Set(s.expandedSections).add("model"),expandedLayers:c}}),navigateToSpecNode:(t,a)=>e(s=>{const c=s.layerId===a?s.expandedLayers:new Set(s.expandedLayers).add(ho("spec",a));return{view:"spec",layerId:a,selectedId:t,expandedSections:new Set(s.expandedSections).add("spec"),expandedLayers:c}}),selectChangeset:t=>e(a=>({view:"changesets",changesetId:t,expandedSections:new Set(a.expandedSections).add("changesets")})),toggleCanvasDark:()=>e(t=>{const a=!t.canvasDark;return LS(a),{canvasDark:a}}),toggleChat:()=>e(t=>({chatOpen:!t.chatOpen})),toggleSection:t=>e(a=>{const s=new Set(a.expandedSections);return s.has(t)?s.delete(t):s.add(t),{view:t,expandedSections:s}}),toggleLayer:(t,a)=>e(s=>{const l=ho(t,a),c=new Set(s.expandedLayers),o=c.has(l);return o?c.delete(l):c.add(l),{view:t,layerId:a,selectedId:o?s.selectedId:null,expandedSections:new Set(s.expandedSections).add(t),expandedLayers:c}}),setWide:t=>e({wide:t})}));typeof document!="undefined"&&LS(Ie.getState().canvasDark);typeof window!="undefined"&&window.addEventListener("resize",()=>{const e=window.innerWidth>=1300;e!==Ie.getState().wide&&Ie.getState().setWide(e)});const yo=qu(e=>({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null,setConnecting:()=>e({state:"connecting",lastError:null}),setConnected:()=>e({state:"connected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:new Date}),setDisconnected:()=>e({state:"disconnected",lastDisconnectedAt:new Date}),setReconnecting:(t,a)=>e({state:"reconnecting",reconnectAttempt:t,reconnectDelay:a}),setError:t=>e({state:"error",lastError:t}),reset:()=>e({state:"disconnected",reconnectAttempt:0,reconnectDelay:0,lastError:null,lastConnectedAt:null,lastDisconnectedAt:null})})),w4={connected:{label:"connected",color:"#10B981"},connecting:{label:"connecting",color:"#FBBF24"},reconnecting:{label:"reconnecting",color:"#FBBF24"},disconnected:{label:"disconnected",color:"#64748B"},error:{label:"disconnected",color:"#F43F5E"}},C4=[{value:"light",label:"light"},{value:"dark",label:"dark"}];function N4(){const e=Ie(o=>o.canvasDark),t=Ie(o=>o.toggleCanvasDark),a=Ie(o=>o.chatOpen),s=Ie(o=>o.toggleChat),l=yo(o=>o.state),c=w4[l];return f.jsxs("div",{style:{height:54,flex:"none",display:"flex",alignItems:"center",gap:18,padding:"0 16px",background:"rgb(var(--shell-bg-2))",borderBottom:"1px solid rgb(var(--shell-border))"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[f.jsx("div",{style:{width:24,height:24,borderRadius:6,background:"linear-gradient(135deg,#FBBF24,#B45309)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'JetBrains Mono',monospace",fontWeight:700,fontSize:12,color:"#1B1206"},children:"dr"}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",lineHeight:1.15},children:[f.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--shell-fg-1))"},children:"Documentation Robotics"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:"architecture viewer"})]})]}),f.jsx("div",{style:{flex:1}}),f.jsx(pp,{value:e?"dark":"light",onChange:o=>{o==="dark"!==e&&t()},options:C4,"aria-label":"Canvas theme"}),f.jsxs("button",{type:"button",onClick:s,"aria-pressed":a,style:{display:"flex",alignItems:"center",gap:7,padding:"6px 12px",borderRadius:7,fontSize:12,fontWeight:500,fontFamily:"inherit",cursor:"pointer",transition:"all .12s",background:a?"rgb(var(--shell-surface))":"transparent",color:a?"rgb(var(--shell-fg-1))":"rgb(var(--shell-fg-2))",border:a?"1px solid rgb(var(--shell-border-2))":"1px solid rgb(var(--shell-border))"},children:[f.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),"DrBot"]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,paddingLeft:4},"data-testid":"connection-status","data-state":l,children:[f.jsx("span",{style:{position:"relative",width:8,height:8},children:f.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:c.color}})}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-2))"},children:c.label})]})]})}const OS=["motivation","business","security","application","technology","api","data-model","data-store","ux","navigation","apm","testing"],zS={motivation:"#8B5CF6",business:"#F59E0B",security:"#F43F5E",application:"#818CF8",technology:"#22D3EE",api:"#10B981","data-model":"#2DD4BF","data-store":"#38BDF8",ux:"#F472B6",navigation:"#A78BFA",apm:"#FB923C",testing:"#4ADE80"},j4={motivation:"Motivation",business:"Business",security:"Security",application:"Application",technology:"Technology",api:"API","data-model":"Data Model","data-store":"Data Store",ux:"UX",navigation:"Navigation",apm:"APM",testing:"Testing"},E4={motivation:"ArchiMate 3.2",business:"ArchiMate 3.2",security:"NIST SP 800-53",application:"ArchiMate 3.2",technology:"ArchiMate 3.2",api:"OpenAPI 3.0","data-model":"JSON Schema Draft 7","data-store":"ISO/IEC 9075 (SQL)",ux:"HTML 5.3",navigation:"SPA Navigation Patterns",apm:"OpenTelemetry",testing:"IEEE 829-2008"},k4="#6B7280";function Gp(e){return e in zS}function R4(e){return e&&Gp(e)?zS[e]:k4}function nl(e){return e&&Gp(e)?j4[e]:e?e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}function IS(e){return e&&Gp(e)?E4[e]:""}const T4={nodes:[],links:[],countsByLayer:{},nodesByLayer:{},relCount:0};function Hs(){const e=GE(),t=e.data,a=D.useMemo(()=>{var c,o,u,h,m;if(!(t!=null&&t.nodes))return T4;const s={},l={};for(const g of t.nodes){const p=g.layer_id;p&&(s[p]=((c=s[p])!=null?c:0)+1,((o=l[p])!=null?o:l[p]=[]).push(g))}return{nodes:t.nodes,links:(u=t.links)!=null?u:[],countsByLayer:s,nodesByLayer:l,relCount:(m=(h=t.links)==null?void 0:h.length)!=null?m:0}},[t]);return Y(R({},e),{derived:a})}const M4={version:"",byLayer:{}};function ol(){const e=KE(),t=e.data,a=D.useMemo(()=>{var l,c,o,u;if(!(t!=null&&t.schemas))return M4;const s={};for(const h of Object.values(t.schemas)){const m=h,g=m.layer;if(!(g!=null&&g.id))continue;const p=(l=m.nodeSchemas)!=null?l:{},v=Object.keys(p);s[g.id]={typeCount:v.length,typeIds:v,typeTitles:v.map(x=>{var _,S;return(S=(_=p[x])==null?void 0:_.title)!=null?S:x}),standard:(o=(c=g.inspired_by)==null?void 0:c.standard)!=null?o:IS(g.id)}}return{version:(u=t.version)!=null?u:"",byLayer:s}},[t]);return Y(R({},e),{derived:a,raw:t})}const A4={add:{op:"add",label:"ADD",color:"#10B981",colorLight:"#047857",background:"rgba(16,185,129,0.12)"},update:{op:"update",label:"MOD",color:"#22D3EE",colorLight:"#0E7490",background:"rgba(34,211,238,0.12)"},delete:{op:"delete",label:"DEL",color:"#F43F5E",colorLight:"#BE123C",background:"rgba(244,63,94,0.12)"}};function US(e){const t=(e!=null?e:"").toLowerCase();return t.includes("delete")||t==="del"||t==="remove"?"delete":t.includes("add")||t==="create"?"add":"update"}function lm(e){var a;if(!e)return"element";const t=(a=e.type)!=null?a:e.predicate;return typeof t=="string"&&t.length>0?t:"element"}function $u(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map($u).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(a=>`${JSON.stringify(a)}:${$u(t[a])}`).join(",")}}`}function D4(e,t){if(!e||!t)return[];const a=new Set([...Object.keys(e),...Object.keys(t)]),s=[];for(const l of a)$u(e[l])!==$u(t[l])&&s.push(l);return s}function L4(e){var c,o,u;const t=US(e.type);if(t==="add")return((c=e.type)!=null?c:"").includes("relationship")?"Added relationship":`Added ${lm(e.after)}`;if(t==="delete")return((o=e.type)!=null?o:"").includes("relationship")?"Removed relationship":`Removed ${lm(e.before)}`;const a=D4(e.before,e.after);if(a.length===0)return`Updated ${lm((u=e.after)!=null?u:e.before)}`;const s=a.slice(0,3).join(", "),l=a.length>3?` +${a.length-3} more`:"";return`Changed ${s}${l}`}function O4(e,t){var l,c,o;const a=US(e.type),s=(l=e.elementId)!=null?l:"(unknown)";return{key:`${s}::${(c=e.sequenceNumber)!=null?c:t}`,op:a,meta:A4[a],elementId:s,layerName:(o=e.layerName)!=null?o:"",detail:L4(e),hasDiff:!!e.before||!!e.after,raw:e}}function z4(e){return e?e.map(O4):[]}function I4(e){const t=e.before?JSON.stringify(e.before,null,2):"",a=e.after?JSON.stringify(e.after,null,2):"",s=t?t.split(`
80
+ `):[],l=a?a.split(`
81
+ `):[],c=new Set(s),o=new Set(l),u=[];for(const h of s)o.has(h)||u.push({type:"removed",content:h});for(const h of l)c.has(h)||u.push({type:"added",content:h});return u}function U4(e,t){if(!t)return e;const{additions:a,modifications:s,deletions:l}=t;return`${a} additions · ${s} modifications · ${l} deletions in this changeset.`}const B4={list:[]};function Ho(){const e=QE(),t=e.data,a=D.useMemo(()=>{const s=t==null?void 0:t.changesets;if(!s)return B4;const l=Object.entries(s).map(([c,o])=>{var u,h,m,g;return{id:c,name:(u=o.name)!=null?u:c,status:(h=o.status)!=null?h:"unknown",created:(m=o.created)!=null?m:"",changesCount:(g=o.changes_count)!=null?g:0}});return l.sort((c,o)=>o.created.localeCompare(c.created)),{list:l}},[t]);return Y(R({},e),{derived:a})}const F4={additions:0,modifications:0,deletions:0};function BS(e){const t=YE(e!=null?e:"",{enabled:!!e}),a=t.data,s=D.useMemo(()=>{var l,c,o,u,h,m,g,p,v,x,_,S,w,C,k,j;return a?{id:(c=(l=a.id)!=null?l:e)!=null?c:"",name:(u=(o=a.name)!=null?o:a.id)!=null?u:"",status:(h=a.status)!=null?h:"unknown",created:(m=a.created)!=null?m:"",modified:(g=a.modified)!=null?g:"",baseSnapshot:(p=a.baseSnapshot)!=null?p:"",stats:{additions:(x=(v=a.stats)==null?void 0:v.additions)!=null?x:0,modifications:(S=(_=a.stats)==null?void 0:_.modifications)!=null?S:0,deletions:(C=(w=a.stats)==null?void 0:w.deletions)!=null?C:0},rows:z4(a.changes),changesCount:(j=(k=a.changes)==null?void 0:k.length)!=null?j:0}:null},[a,e]);return Y(R({},t),{detail:s,emptyStats:F4})}const H4=[{id:"model",label:"Model",icon:"graph"},{id:"spec",label:"Schema",icon:"schema"},{id:"changesets",label:"Changesets",icon:"clock"}];function FS({open:e}){return f.jsx("span",{style:{position:"absolute",right:12,top:0,bottom:0,display:"flex",alignItems:"center",pointerEvents:"none"},children:f.jsx("span",{className:`drv-chev${e?" drv-chev--open":""}`})})}function $4({section:e}){const t=Ie(u=>u.view),a=Ie(u=>u.expandedSections),s=Ie(u=>u.toggleSection),{derived:l}=Ho(),c=a.has(e.id),o=e.id==="changesets"?l.list.length:12;return f.jsxs("div",{style:{position:"relative"},children:[f.jsxs("button",{type:"button",className:`nav-item${t===e.id?" nav-item--active":""}`,onClick:()=>s(e.id),children:[f.jsx(Ce,{name:e.icon,size:16,className:"nav-item__icon"}),f.jsx("span",{className:"nav-item__label",children:e.label}),f.jsx("span",{className:"nav-item__count",children:o})]}),f.jsx(FS,{open:c})]})}function P4({sectionId:e,slug:t}){var C,k,j;const a=Ie(E=>E.view),s=Ie(E=>E.layerId),l=Ie(E=>E.selectedId),c=Ie(E=>E.expandedLayers),o=Ie(E=>E.toggleLayer),u=Ie(E=>E.selectNode),{derived:h}=Hs(),{derived:m}=ol(),g=`${e}:${t}`,p=c.has(g),v=a===e&&s===t,x=m.byLayer[t],_=(C=h.nodesByLayer[t])!=null?C:[],S=e==="spec"?(k=x==null?void 0:x.typeCount)!=null?k:0:_.length,w=e==="spec"?((j=x==null?void 0:x.typeIds)!=null?j:[]).map((E,O)=>{var z;return{id:`${t}.${E}`,label:(z=x==null?void 0:x.typeTitles[O])!=null?z:E}}):_.map(E=>({id:E.id,label:E.name}));return f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{position:"relative"},children:[f.jsxs("button",{type:"button",className:`nav-item nav-item--depth-1${v?" nav-item--active":""}`,onClick:()=>o(e,t),children:[f.jsx("span",{className:"nav-item__label",children:nl(t)}),f.jsx("span",{className:"nav-item__count",children:S})]}),f.jsx(FS,{open:p})]}),p&&w.map(E=>{const O=a===e&&s===t&&l===E.id;return f.jsx("div",{style:{position:"relative"},children:f.jsx("button",{type:"button",className:`nav-item nav-item--depth-1 drv-nav-l2${O?" nav-item--active":""}`,onClick:()=>u(E.id),title:E.label,children:f.jsx("span",{className:"nav-item__label",children:E.label})})},E.id)})]})}function q4(){const e=Ie(l=>l.view),t=Ie(l=>l.changesetId),a=Ie(l=>l.selectChangeset),{derived:s}=Ho();return s.list.length===0?f.jsx("div",{style:{padding:"8px 10px 8px 34px",fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-4))"},children:"no changesets"}):f.jsx(f.Fragment,{children:s.list.map(l=>{const c=e==="changesets"&&t===l.id;return f.jsx("div",{style:{position:"relative"},children:f.jsxs("button",{type:"button",className:`nav-item nav-item--depth-1${c?" nav-item--active":""}`,onClick:()=>a(l.id),title:l.name,children:[f.jsx("span",{className:"nav-item__label",children:l.name}),f.jsx("span",{className:"nav-item__count",children:l.changesCount})]})},l.id)})})}function V4(){const e=Ie(t=>t.expandedSections);return f.jsx("div",{className:"drv-scroll drv-noscroll",style:{flex:1,overflowY:"auto",padding:"8px"},"data-testid":"nav-tree",children:H4.map(t=>{const a=e.has(t.id);return f.jsxs("div",{children:[f.jsx($4,{section:t}),a&&t.id==="changesets"&&f.jsx(q4,{}),a&&t.id!=="changesets"&&OS.map(s=>f.jsx(P4,{sectionId:t.id,slug:s},s))]},t.id)})})}function G4(){const{derived:e}=Hs(),{derived:t}=ol(),a=e.relCount,s=t.version||"—";return f.jsxs("div",{style:{width:244,flex:"none",background:"rgb(var(--shell-bg-2))",borderRight:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"left-rail",children:[f.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 14px",borderBottom:"1px solid rgb(var(--shell-border))"},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--shell-fg-3))"},children:"Navigation"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},"data-testid":"rail-count"})]}),f.jsx(V4,{}),f.jsxs("div",{style:{flex:"none",padding:"10px 14px",borderTop:"1px solid rgb(var(--shell-border))",display:"flex",flexDirection:"column",gap:3},"data-testid":"rail-footer",children:[f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",color:"rgb(var(--shell-fg-3))"},children:["SPEC ",s]}),f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,color:"rgb(var(--shell-fg-4))"},children:["12 layers · ",a," rels"]})]})]})}const Gm={fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--shell-fg-3))"},L0=Y(R({},Gm),{color:"rgb(var(--shell-fg-4))"});function K4(){var u;const e=Ie(h=>h.layerId),{derived:t}=Hs(),{derived:a}=ol(),s=e&&(u=t.countsByLayer[e])!=null?u:0,l=e?nl(e).toLowerCase():"",c=e?`${s} ${l} elements`:`${t.nodes.length} elements`,o=a.version||"—";return f.jsx(yp,{style:{height:28},"data-testid":"status-bar",left:f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[f.jsx("span",{style:Gm,"data-testid":"status-elements",children:c}),f.jsx("span",{style:L0,children:"·"}),f.jsxs("span",{style:Gm,children:[t.relCount," refs indexed · 0 unresolved"]})]}),right:f.jsxs("span",{style:L0,children:["cli ",o," · refs ok"]})})}function Q4(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\./g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function HS(e){return`${e.layer_id}.${e.type}.${Q4(e.name)}`}function Kp(e){const t=new Map,a=new Map;for(const s of e.nodes)a.set(s.id,s),t.set(s.id,s),t.set(HS(s),s);return{byEndpoint:t,byUuid:a}}function Pu(e,t){return e.byEndpoint.get(t)}const O0=196,Y4=88;function $S(e){const t=e.length||1,a=Math.max(2,Math.min(4,Math.ceil(Math.sqrt(t)))),s=new Map;if(e.forEach((h,m)=>{const g=m%a,p=Math.floor(m/a);s.set(h,{x:g*O0+p%2*(O0*.18),y:p*Y4})}),s.size===0)return s;const l=[...s.values()].map(h=>h.x),c=[...s.values()].map(h=>h.y),o=(Math.min(...l)+Math.max(...l))/2,u=(Math.min(...c)+Math.max(...c))/2;for(const h of s.values())h.x-=o,h.y-=u;return s}function X4(e,t){var l;const a=(l=e.nodesByLayer[t])!=null?l:[],s=$S(a.map(c=>c.id));return a.map(c=>{const o=s.get(c.id);return{id:c.id,label:c.name,kind:c.type,domainColor:t,x:o?o.x:0,y:o?o.y:0}})}function Z4(e,t,a){const s=[];for(const l of e.links){const c=Pu(a,l.source),o=Pu(a,l.target);!c||!o||c.layer_id!==t||o.layer_id!==t||s.push({id:l.id,sourceId:c.id,targetId:o.id,label:l.type})}return s}function $s(e,t){var s;return(s=e==null?void 0:e.schemas)==null?void 0:s[`${t}.json`]}function PS(e,t){const a=`${e}.`;if(t.startsWith(a))return t.slice(a.length);const s=t.lastIndexOf(".");return s>=0?t.slice(s+1):t}function z0(e,t,a){var c,o,u;const s=PS(t,a),l=$s(e,t);return(u=(o=(c=l==null?void 0:l.nodeSchemas)==null?void 0:c[s])==null?void 0:o.title)!=null?u:s}function J4(e,t){var u;const a=$s(e,t),s=(u=a==null?void 0:a.nodeSchemas)!=null?u:{},l=Object.entries(s),c=l.map(([h])=>`${t}.${h}`),o=$S(c);return l.map(([h,m])=>{var v;const g=`${t}.${h}`,p=o.get(g);return{id:g,label:(v=m.title)!=null?v:h,kind:"spec node",domainColor:t,x:p?p.x:0,y:p?p.y:0}})}const W4={"many-to-many":"N:N","one-to-many":"1:N","many-to-one":"N:1","one-to-one":"1:1"};function e6(e){var t;return e&&(t=W4[e])!=null?t:""}function t6(e,t){var c;const a=$s(e,t),s=(c=a==null?void 0:a.relationshipSchemas)!=null?c:{},l=[];for(const o of Object.values(s))o.source_layer!==t||o.destination_layer!==t||o.source_spec_node_id!==o.destination_spec_node_id&&l.push({id:o.id,sourceId:o.source_spec_node_id,targetId:o.destination_spec_node_id,label:o.predicate});return l}function n6(e,t){var c;const a=$s(e,t),s=(c=a==null?void 0:a.relationshipSchemas)!=null?c:{};let l=0;for(const o of Object.values(s))o.source_layer===t&&o.destination_layer===t&&(l+=1);return l}function a6(e,t,a){var u;const s=$s(e,t),l=(u=s==null?void 0:s.relationshipSchemas)!=null?u:{},c=[];let o=0;for(const h of Object.values(l)){const m=e6(h.cardinality),g=m?`${h.predicate} ${m}`:h.predicate;h.source_spec_node_id===a?c.push({id:`out-${o++}-${h.id}`,target:h.destination_spec_node_id,targetTitle:z0(e,h.destination_layer,h.destination_spec_node_id),targetDomain:h.destination_layer,predicate:g,direction:"out"}):h.destination_spec_node_id===a&&c.push({id:`in-${o++}-${h.id}`,target:h.source_spec_node_id,targetTitle:z0(e,h.source_layer,h.source_spec_node_id),targetDomain:h.source_layer,predicate:g,direction:"in"})}return c}function i6(e,t,a){var g,p,v,x,_;const s=$s(e,t),l=PS(t,a),c=(g=s==null?void 0:s.nodeSchemas)==null?void 0:g[l];if(!c)return null;const o=(p=c.properties)==null?void 0:p.attributes,u=new Set((v=o==null?void 0:o.required)!=null?v:[]),h=Object.keys((x=o==null?void 0:o.properties)!=null?x:{}),m={};for(const S of h)m[S]=u.has(S)?"required":"—";return{id:a,title:(_=c.title)!=null?_:l,kind:"SPEC NODE",domain:t,description:c.description,metadata:m}}function s6(e,t){var l;const a=$s(e,t),s=Object.keys((l=a==null?void 0:a.nodeSchemas)!=null?l:{})[0];return s?`${t}.${s}`:void 0}function I0({message:e}){return f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"canvas-empty",children:e})}function r6(){var k;const e=Ie(j=>j.view),t=Ie(j=>j.layerId),a=Ie(j=>j.selectedId),s=Ie(j=>j.selectGraphNode),{derived:l}=Hs(),{derived:c,raw:o}=ol(),u=e==="spec",h=D.useMemo(()=>Kp(l),[l]),m=D.useMemo(()=>t?u?J4(o,t):X4(l,t):[],[u,o,l,t]),g=D.useMemo(()=>t?u?t6(o,t):Z4(l,t,h):[],[u,o,l,t,h]),p=t!=null?t:"",v=((k=c.byLayer[p])==null?void 0:k.standard)||IS(p),x=u?`META-MODEL${v?` · ${v}`:""}`:`INSTANCE MODEL${v?` · ${v}`:""}`,_=t?u?`${nl(p)} schema`:nl(p):u?"Schema":"Model",S=D.useMemo(()=>{var j,E,O;if(!t)return"";if(u){const z=(E=(j=c.byLayer[p])==null?void 0:j.typeCount)!=null?E:0,I=n6(o,p);return`${z} node types · ${I} relationships`}return`${(O=l.countsByLayer[p])!=null?O:0} elements`},[u,t,p,c,o,l]),w=u?"select a layer to view its schema":"select a layer to view its instance model",C=u?"no node types in this layer":"no elements in this layer";return f.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[f.jsx(_p,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:R4(p),display:"inline-block"}}),f.jsx("span",{children:x})]}),title:_,idChip:t!=null?t:e,actions:f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:S})}),f.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:t?m.length===0?f.jsx(I0,{message:C}):f.jsx(jS,{nodes:m,edges:g,selectedNodeId:a!=null?a:void 0,onNodeSelect:j=>s(j),layout:"manual",style:{position:"absolute",inset:0,width:"100%",height:"100%"}},`${e}:${t}`):f.jsx(I0,{message:w})})]})}const qS="You",l6=/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;function o6(e){return l6.test(e)}function od(e){return["annotations",e!=null?e:""]}function VS(e){return["annotation-replies",e]}function c6(e){return sl({queryKey:od(e),enabled:!!e,queryFn:()=>ze(null,null,function*(){var a;return(a=(yield Bs().getapiannotations({elementId:e})).annotations)!=null?a:[]})})}function u6(e,t=!0){return sl({queryKey:VS(e),enabled:t,queryFn:()=>ze(null,null,function*(){var s;return(s=(yield Bs().getapiannotationsannotationIdreplies(e)).replies)!=null?s:[]})})}function d6(){const e=il();return Xu({mutationFn:t=>{var a,s;return Bs().postapiannotations({elementId:t.elementId,author:(a=t.author)!=null?a:qS,content:t.content,tags:(s=t.tags)!=null?s:[]})},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:od(a.elementId)})}})}function f6(){const e=il();return Xu({mutationFn:t=>{const a={};return t.content!==void 0&&(a.content=t.content),t.tags!==void 0&&(a.tags=t.tags),t.resolved!==void 0&&(a.resolved=t.resolved),Bs().patchapiannotationsannotationId(t.id,a)},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:od(a.elementId)})}})}function h6(){const e=il();return Xu({mutationFn:t=>Bs().deleteapiannotationsannotationId(t.id),onSuccess:(t,a)=>{e.invalidateQueries({queryKey:od(a.elementId)})}})}function m6(){const e=il();return Xu({mutationFn:t=>{var a;return Bs().postapiannotationsannotationIdreplies(t.annotationId,{author:(a=t.author)!=null?a:qS,content:t.content})},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:VS(a.annotationId)})}})}function GS(e){const t=new Date(e).getTime();if(Number.isNaN(t))return e;const a=Date.now()-t,s=Math.round(a/1e3);if(s<45)return"just now";const l=Math.round(s/60);if(l<60)return`${l}m ago`;const c=Math.round(l/60);if(c<24)return`${c}h ago`;const o=Math.round(c/24);if(o<30)return`${o}d ago`;const u=Math.round(o/30);return u<12?`${u}mo ago`:`${Math.round(u/12)}y ago`}function p6(e){const t=new Set;for(const a of e.split(/[\s,]+/)){const s=a.trim().toLowerCase();s&&t.add(s)}return[...t]}const g6={display:"block",fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",fontWeight:500},Ds={fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},y6={background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,padding:"10px 12px"};function v6({elementId:e,notify:t}){const[a,s]=D.useState(""),[l,c]=D.useState(""),o=d6(),u=a.trim(),h=D.useMemo(()=>p6(l),[l]),m=h.filter(v=>!o6(v)),g=u.length>=1&&u.length<=5e3&&m.length===0&&!o.isPending,p=()=>{g&&o.mutate({elementId:e,content:u,tags:h},{onSuccess:()=>{s(""),c(""),t("success","Annotation added")},onError:()=>t("error","Failed to add annotation")})};return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[f.jsx(hp,{value:a,onChange:v=>s(v.target.value),placeholder:"Add an annotation…",rows:3,"aria-label":"New annotation content","data-testid":"annotation-add-content"}),f.jsx(Ro,{mono:!0,value:l,onChange:v=>c(v.target.value),placeholder:"tags (space or comma separated)",error:m.length>0,"aria-label":"New annotation tags","data-testid":"annotation-add-tags"}),m.length>0&&f.jsxs("span",{style:Y(R({},Ds),{color:"rgb(var(--status-rose))"}),children:["invalid tag",m.length>1?"s":"",": ",m.join(", ")]}),f.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:f.jsx(an,{variant:"accent",size:"sm",disabled:!g,onClick:p,"data-testid":"annotation-add-submit",children:o.isPending?"Adding…":"Add"})})]})}function b6({annotationId:e,expanded:t,notify:a}){const{data:s=[],isLoading:l}=u6(e,t),c=m6(),[o,u]=D.useState(""),h=o.trim(),m=h.length>=1&&h.length<=5e3&&!c.isPending,g=()=>{m&&c.mutate({annotationId:e,content:h},{onSuccess:()=>{u(""),a("success","Reply added")},onError:()=>a("error","Failed to add reply")})};return f.jsxs("div",{style:{marginTop:8,paddingLeft:12,borderLeft:"2px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:8},"data-testid":"annotation-replies",children:[l&&s.length===0?f.jsx("span",{style:Ds,children:"loading replies…"}):s.map(p=>f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:12,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:p.author}),f.jsx("span",{style:Ds,title:p.createdAt,children:GS(p.createdAt)})]}),f.jsx("p",{style:{margin:0,fontSize:12.5,lineHeight:1.5,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:p.content})]},p.id)),f.jsxs("div",{style:{display:"flex",gap:6,alignItems:"flex-start"},children:[f.jsx(Ro,{value:o,onChange:p=>u(p.target.value),placeholder:"Reply…","aria-label":"Reply content","data-testid":"annotation-reply-input",style:{flex:1},onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),g())}}),f.jsx(an,{variant:"secondary",size:"sm",disabled:!m,onClick:g,"data-testid":"annotation-reply-submit",children:"Reply"})]})]})}function x6({annotation:e,elementId:t,notify:a}){const s=f6(),l=h6(),[c,o]=D.useState(!1),[u,h]=D.useState(e.content),[m,g]=D.useState(!1),[p,v]=D.useState(!1),x=u.trim(),_=x.length>=1&&x.length<=5e3&&x!==e.content&&!s.isPending,S=()=>{_&&s.mutate({id:e.id,elementId:t,content:x},{onSuccess:()=>{o(!1),a("success","Annotation updated")},onError:()=>a("error","Failed to update annotation")})},w=()=>{s.mutate({id:e.id,elementId:t,resolved:!e.resolved},{onSuccess:()=>a("success",e.resolved?"Reopened":"Resolved"),onError:()=>a("error","Failed to update annotation")})},C=()=>{l.mutate({id:e.id,elementId:t},{onSuccess:()=>{g(!1),a("success","Annotation deleted")},onError:()=>{g(!1),a("error","Failed to delete annotation")}})},k=j=>{j==="edit"?(h(e.content),o(!0)):j==="resolve"?w():j==="delete"&&g(!0)};return f.jsxs("div",{style:y6,"data-testid":"annotation-item","data-resolved":e.resolved,children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[f.jsx("span",{style:{fontSize:12.5,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:e.author}),f.jsx("span",{style:Ds,title:e.createdAt,children:GS(e.createdAt)}),e.resolved&&f.jsx(wn,{variant:"emerald","data-testid":"annotation-resolved-chip",children:"resolved"}),f.jsx("div",{style:{marginLeft:"auto"},children:f.jsx(xS,{placement:"bottom-end",triggerLabel:"Annotation actions",actions:[{id:"edit",label:"Edit",icon:"edit"},{id:"resolve",label:e.resolved?"Reopen":"Resolve",icon:"check"},{type:"separator"},{id:"delete",label:"Delete",icon:"trash",danger:!0}],onAction:k})})]}),c?f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[f.jsx(hp,{value:u,onChange:j=>h(j.target.value),rows:3,"aria-label":"Edit annotation content","data-testid":"annotation-edit-content",autoFocus:!0}),f.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:6},children:[f.jsx(an,{variant:"ghost",size:"sm",onClick:()=>o(!1),"data-testid":"annotation-edit-cancel",children:"Cancel"}),f.jsx(an,{variant:"accent",size:"sm",disabled:!_,onClick:S,"data-testid":"annotation-edit-save",children:s.isPending?"Saving…":"Save"})]})]}):f.jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,color:"rgb(var(--canvas-fg-2))",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:e.content}),e.tags.length>0&&f.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:8},"data-testid":"annotation-tags",children:e.tags.map(j=>f.jsx(wn,{form:"id-tag",children:j},j))}),f.jsx("div",{style:{marginTop:8},children:f.jsx(an,{variant:"ghost",size:"sm",onClick:()=>v(j=>!j),"aria-expanded":p,"data-testid":"annotation-replies-toggle",children:p?"Hide replies":"Replies"})}),p&&f.jsx(b6,{annotationId:e.id,expanded:p,notify:a}),f.jsx(Px,{isOpen:m,onClose:()=>g(!1),onConfirm:C,title:"Delete annotation",message:"This permanently removes the annotation and its replies. Continue?",confirmLabel:l.isPending?"Deleting…":"Delete",variant:"danger"})]})}function _6({elementId:e}){const{data:t=[],isLoading:a,isError:s}=c6(e),[l,c]=D.useState({open:!1,variant:"success",title:""}),o=(u,h)=>c({open:!0,variant:u,title:h});return f.jsxs("section",{style:{padding:"16px",borderTop:"1px solid rgb(var(--canvas-border))",display:"flex",flexDirection:"column",gap:12},"data-testid":"annotations-section",children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:g6,children:"Annotations"}),f.jsxs("span",{style:Ds,"data-testid":"annotations-count",children:["· ",t.length]})]}),f.jsx(v6,{elementId:e,notify:o}),a?f.jsx("span",{style:Ds,children:"loading…"}):s?f.jsx("span",{style:Y(R({},Ds),{color:"rgb(var(--status-rose))"}),children:"failed to load annotations"}):t.length===0?f.jsx("span",{style:{fontSize:12.5,color:"rgb(var(--canvas-fg-3))"},"data-testid":"annotations-empty",children:"No annotations yet"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map(u=>f.jsx(x6,{annotation:u,elementId:e,notify:o},u.id))}),f.jsx(Gx,{isOpen:l.open,onClose:()=>c(u=>Y(R({},u),{open:!1})),variant:l.variant,title:l.title})]})}function S6(e,t,a){if(!a.byUuid.get(t))return[];const l=[];let c=0;for(const o of e.links){const u=Pu(a,o.source),h=Pu(a,o.target);!u||!h||(u.id===t?l.push({id:`out-${c++}-${o.id}`,target:h.id,targetTitle:h.name,targetDomain:h.layer_id,predicate:o.type,direction:"out"}):h.id===t&&l.push({id:`in-${c++}-${o.id}`,target:u.id,targetTitle:u.name,targetDomain:u.layer_id,predicate:o.type,direction:"in"}))}return l}function w6(e){var t;return(t=e==null?void 0:e.provenance)!=null?t:"authored"}function C6(e){var a,s;const t=(a=e==null?void 0:e.locations)==null?void 0:a.find(l=>l.symbol||l.file);return(s=t==null?void 0:t.symbol)!=null?s:t==null?void 0:t.file}function N6(e,t){const a=e.source_reference,s={layer:t,type:e.type,provenance:w6(a)},l=C6(a);return l&&(s.source=l),{id:e.id,title:e.name,kind:e.type,domain:e.layer_id,description:e.description,metadata:s}}function j6(e){const t=e.lastIndexOf(".");return t>0?e.slice(0,t):e}function E6(){const e=Ie(k=>k.view),t=Ie(k=>k.layerId),a=Ie(k=>k.selectedId),s=Ie(k=>k.navigateToElement),l=Ie(k=>k.navigateToSpecNode),{derived:c}=Hs(),{raw:o}=ol(),u=D.useMemo(()=>Kp(c),[c]),h=e==="spec",m=!h&&a?u.byUuid.get(a):void 0,g=D.useMemo(()=>m?N6(m,nl(m.layer_id)):null,[m]),p=D.useMemo(()=>m?S6(c,m.id,u):[],[c,m,u]),v=D.useMemo(()=>h&&t&&a?i6(o,t,a):null,[h,o,t,a]),x=D.useMemo(()=>h&&t&&a?a6(o,t,a):[],[h,o,t,a]),_=h?v:g,S=h?x:p,w=k=>{if(h){l(k,j6(k));return}const j=u.byUuid.get(k);j&&s(j.id,j.layer_id)},C=m?HS(m):null;return f.jsx("div",{style:{width:320,flex:"none",borderLeft:"1px solid rgb(var(--canvas-border))",background:"rgb(var(--canvas-surface))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"inspector",children:f.jsxs("div",{className:"drv-scroll",style:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column"},children:[f.jsx(ES,{node:_,relationships:S,onNodeSelect:w,emptyStateText:h?"Select a node type to inspect.":"Select an element to inspect.",style:{flex:"none",border:"none",borderRadius:0}}),C&&f.jsx(_6,{elementId:C})]})})}function k6(e){return e==="staged"?"#FBBF24":"#10B981"}function U0({message:e}){return f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-canvas-empty",children:e})}function R6({row:e}){const[t,a]=D.useState(!1),s=Ie(c=>c.canvasDark),l=t&&e.hasDiff?I4(e.raw):[];return f.jsxs("div",{style:{background:"rgb(var(--canvas-card))",border:"1px solid rgb(var(--canvas-border))",borderRadius:8,overflow:"hidden"},"data-testid":"changeset-row","data-op":e.op,children:[f.jsxs("div",{role:e.hasDiff?"button":void 0,tabIndex:e.hasDiff?0:void 0,onClick:e.hasDiff?()=>a(c=>!c):void 0,onKeyDown:e.hasDiff?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(o=>!o))}:void 0,style:{display:"flex",alignItems:"flex-start",gap:12,padding:"12px 14px",cursor:e.hasDiff?"pointer":"default"},children:[f.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.05em",textTransform:"uppercase",padding:"3px 8px",borderRadius:4,width:42,textAlign:"center",background:e.meta.background,color:s?e.meta.color:e.meta.colorLight},"data-testid":"changeset-op-badge",children:e.meta.label}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:3,minWidth:0,flex:1},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:e.elementId}),f.jsx("span",{style:{fontSize:12,color:"rgb(var(--canvas-fg-3))",lineHeight:1.45},children:e.detail})]}),e.layerName&&f.jsx("span",{style:{flex:"none",fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",alignSelf:"center"},children:e.layerName})]}),t&&e.hasDiff&&f.jsx("div",{style:{borderTop:"1px solid rgb(var(--canvas-border))",padding:"10px 14px 14px"},children:l.length>0?f.jsx(wp,{lines:l}):f.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:"no field-level changes"})})]})}function T6(){var u,h,m,g,p,v;const e=Ie(x=>x.changesetId),{derived:t}=Ho(),{detail:a}=BS(e),s=t.list.find(x=>x.id===e),l=(h=(u=a==null?void 0:a.name)!=null?u:s==null?void 0:s.name)!=null?h:"",c=(g=(m=a==null?void 0:a.status)!=null?m:s==null?void 0:s.status)!=null?g:"unknown",o=(v=(p=a==null?void 0:a.changesCount)!=null?p:s==null?void 0:s.changesCount)!=null?v:0;return f.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,background:"rgb(var(--canvas-bg))",borderTopLeftRadius:8,overflow:"hidden"},"data-testid":"canvas",children:[e&&f.jsx(_p,{style:{flex:"none",padding:"16px 22px 14px"},eyebrow:f.jsxs(f.Fragment,{children:[f.jsx("span",{style:{width:10,height:10,borderRadius:3,flex:"none",background:k6(c),display:"inline-block"}}),f.jsx("span",{children:"CHANGESET"})]}),title:l,idChip:c,actions:f.jsxs("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))"},children:[o," changes"]})}),f.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:e?a?f.jsxs("div",{className:"drv-scroll",style:{position:"absolute",inset:0,overflowY:"auto",padding:"20px 22px"},"data-testid":"changeset-list",children:[f.jsx("p",{style:{fontSize:13,color:"rgb(var(--canvas-fg-2))",margin:"0 0 18px 0",maxWidth:620,lineHeight:1.5},children:U4(a.name,a.stats)}),f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:760},children:a.rows.map(x=>f.jsx(R6,{row:x},x.key))})]}):f.jsx(U0,{message:"loading changeset…"}):f.jsx(U0,{message:"select a changeset to view its changes"})})]})}function B0(e){return e==="staged"?{color:"amber",label:"STAGED"}:e==="discarded"?{color:"neutral",label:"DISCARDED"}:e==="committed"?{color:"emerald",label:"COMMITTED"}:{color:"neutral",label:e.toUpperCase()}}function F0(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function om({label:e,value:t}){return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5},children:[f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:e}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:12,color:"rgb(var(--canvas-fg-1))",wordBreak:"break-all"},children:t})]})}function M6(){const e=Ie(a=>a.changesetId),{detail:t}=BS(e);return f.jsx("div",{style:{width:320,flex:"none",borderLeft:"1px solid rgb(var(--canvas-border))",background:"rgb(var(--canvas-surface))",display:"flex",flexDirection:"column",minHeight:0},"data-testid":"inspector",children:!e||!t?f.jsx("div",{style:{flex:1,display:"grid",placeItems:"center",padding:24,textAlign:"center",color:"rgb(var(--canvas-fg-3))",fontFamily:"'JetBrains Mono',monospace",fontSize:12},"data-testid":"changeset-inspector-empty",children:e?"loading changeset…":"Select a changeset to inspect."}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{flex:"none",padding:"16px 16px 14px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[f.jsx("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))",marginBottom:6},children:"CHANGESET"}),f.jsx("div",{style:{fontSize:16,fontWeight:600,color:"rgb(var(--canvas-fg-1))",lineHeight:1.3},children:t.name}),f.jsxs("div",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,color:"rgb(var(--canvas-fg-3))",marginTop:4},children:[t.changesCount," changes"]})]}),f.jsxs("div",{className:"drv-scroll",style:{flex:1,minHeight:0,overflowY:"auto",padding:16,display:"flex",flexDirection:"column",gap:16},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx(zx,{color:B0(t.status).color,"aria-label":t.status}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono',monospace",fontSize:11,letterSpacing:"0.06em",color:"rgb(var(--canvas-fg-2))"},children:B0(t.status).label})]}),f.jsxs("div",{style:{display:"flex",gap:8},children:[f.jsx(wu,{label:"Added",value:t.stats.additions,color:"emerald",style:{flex:1,padding:11}}),f.jsx(wu,{label:"Modified",value:t.stats.modifications,color:"cyan",style:{flex:1,padding:11}}),f.jsx(wu,{label:"Deleted",value:t.stats.deletions,color:"rose",style:{flex:1,padding:11}})]}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[f.jsx(om,{label:"Created",value:F0(t.created)}),f.jsx(om,{label:"Modified",value:F0(t.modified)}),t.baseSnapshot&&f.jsx(om,{label:"Base Snapshot",value:t.baseSnapshot})]})]})]})})}class Ae extends Error{constructor(t,a,s){super(a),this.code=t,this.context=s,this.name="ChatValidationError"}}function yu(e){if(typeof e!="string"||e.trim().length===0)throw new Ae("INVALID_MESSAGE_ID","Message ID must be a non-empty string",{id:e})}function KS(e){if(!e||typeof e!="object")throw new Ae("INVALID_CONTENT","Content must be an object",{content:e});const t=e,a=t.type;if(typeof a!="string")throw new Ae("INVALID_CONTENT_TYPE","Content must have a type field that is a string",{type:a});if(typeof t.timestamp!="string")throw new Ae("MISSING_TIMESTAMP","Content must have a timestamp field",{timestamp:t.timestamp});switch(a){case"text":{if(typeof t.content!="string")throw new Ae("INVALID_TEXT_CONTENT","Text content must have a content field that is a string",{content:t.content});break}case"tool_invocation":{if(typeof t.toolUseId!="string"||t.toolUseId.length===0)throw new Ae("INVALID_TOOL_USE_ID","Tool invocation must have a non-empty toolUseId",{toolUseId:t.toolUseId});if(typeof t.toolName!="string")throw new Ae("INVALID_TOOL_NAME","Tool invocation must have a toolName field",{toolName:t.toolName});if(!t.toolInput||typeof t.toolInput!="object")throw new Ae("INVALID_TOOL_INPUT","Tool invocation must have a toolInput field",{toolInput:t.toolInput});if(!t.status||typeof t.status!="object")throw new Ae("INVALID_TOOL_STATUS","Tool invocation must have a status field",{status:t.status});break}case"thinking":{if(typeof t.content!="string")throw new Ae("INVALID_THINKING_CONTENT","Thinking content must have a content field that is a string",{content:t.content});break}case"usage":{if(typeof t.inputTokens!="number")throw new Ae("INVALID_USAGE","Usage content must have an inputTokens field that is a number",{inputTokens:t.inputTokens});if(typeof t.outputTokens!="number")throw new Ae("INVALID_USAGE","Usage content must have an outputTokens field that is a number",{outputTokens:t.outputTokens});if(typeof t.totalTokens!="number")throw new Ae("INVALID_USAGE","Usage content must have a totalTokens field that is a number",{totalTokens:t.totalTokens});if(typeof t.totalCostUsd!="number")throw new Ae("INVALID_USAGE","Usage content must have a totalCostUsd field that is a number",{totalCostUsd:t.totalCostUsd});break}case"error":{if(typeof t.code!="string")throw new Ae("INVALID_ERROR","Error content must have a code field that is a string",{code:t.code});if(typeof t.message!="string")throw new Ae("INVALID_ERROR","Error content must have a message field that is a string",{message:t.message});break}default:throw new Ae("UNKNOWN_CONTENT_TYPE",`Unknown content type: ${a}. Must be one of: text, tool_invocation, thinking, usage, error`,{type:a})}}function A6(e){if(!e||typeof e!="object")throw new Ae("INVALID_MESSAGE","Message must be an object",{message:e});const t=e;if(typeof t.id!="string"||t.id.length===0)throw new Ae("INVALID_MESSAGE_ID","Message must have a non-empty id field",{id:t.id});if(typeof t.role!="string")throw new Ae("INVALID_ROLE","Message must have a role field that is a string",{role:t.role});const a=["user","assistant","system"];if(!a.includes(t.role))throw new Ae("INVALID_ROLE_VALUE",`Role must be one of: ${a.join(", ")}`,{role:t.role});if(typeof t.conversationId!="string"||t.conversationId.length===0)throw new Ae("INVALID_CONVERSATION_ID","Message must have a non-empty conversationId field",{conversationId:t.conversationId});if(typeof t.timestamp!="string"||t.timestamp.length===0)throw new Ae("INVALID_TIMESTAMP","Message must have a non-empty timestamp field",{timestamp:t.timestamp});if(!Array.isArray(t.parts))throw new Ae("INVALID_PARTS","Message must have a parts field that is an array",{parts:t.parts});for(let s=0;s<t.parts.length;s++)try{KS(t.parts[s])}catch(l){throw l instanceof Ae?new Ae(l.code,`Invalid content at parts[${s}]: ${l.message}`,Y(R({},l.context),{partIndex:s})):l}if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new Ae("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:t.isStreaming})}function D6(e){if(!e||typeof e!="object")throw new Ae("INVALID_SDK_STATUS","SDK status must be an object",{status:e});const t=e;if(typeof t.sdkAvailable!="boolean")throw new Ae("INVALID_SDK_AVAILABLE","sdkAvailable must be a boolean",{sdkAvailable:t.sdkAvailable});if(t.sdkVersion!==null&&typeof t.sdkVersion!="string")throw new Ae("INVALID_SDK_VERSION","sdkVersion must be a string or null",{sdkVersion:t.sdkVersion});if(t.errorMessage!==null&&typeof t.errorMessage!="string")throw new Ae("INVALID_ERROR_MESSAGE","errorMessage must be a string or null",{errorMessage:t.errorMessage})}function L6(e){if(e!==null&&(typeof e!="string"||e.length===0))throw new Ae("INVALID_CONVERSATION_ID","Conversation ID must be a non-empty string or null",{id:e})}function O6(e){if(e!==null&&typeof e!="string")throw new Ae("INVALID_ERROR_MESSAGE","Error message must be a string or null",{error:e})}function z6(e){if(!e||typeof e!="object")throw new Ae("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.id!==void 0&&(typeof t.id!="string"||t.id.length===0))throw new Ae("INVALID_ID_UPDATE","Updated id must be a non-empty string",{id:t.id});if(t.role!==void 0){const a=["user","assistant","system"];if(!a.includes(t.role))throw new Ae("INVALID_ROLE_UPDATE",`Updated role must be one of: ${a.join(", ")}`,{role:t.role})}if(t.conversationId!==void 0&&(typeof t.conversationId!="string"||t.conversationId.length===0))throw new Ae("INVALID_CONVERSATION_ID_UPDATE","Updated conversationId must be a non-empty string",{conversationId:t.conversationId});if(t.timestamp!==void 0&&typeof t.timestamp!="string")throw new Ae("INVALID_TIMESTAMP_UPDATE","Updated timestamp must be a string",{timestamp:t.timestamp});if(t.isStreaming!==void 0&&typeof t.isStreaming!="boolean")throw new Ae("INVALID_STREAMING_UPDATE","Updated isStreaming must be a boolean",{isStreaming:t.isStreaming});if(t.parts!==void 0)throw new Ae("INVALID_PARTS_UPDATE","Parts cannot be directly updated - use appendPart or appendTextContent instead",{parts:t.parts})}function I6(e){if(!e||typeof e!="object")throw new Ae("INVALID_UPDATES","Updates must be an object",{updates:e});const t=e;if(t.toolName!==void 0&&(typeof t.toolName!="string"||t.toolName.length===0))throw new Ae("INVALID_TOOL_NAME","Updated toolName must be a non-empty string",{toolName:t.toolName});if(t.toolInput!==void 0&&(typeof t.toolInput!="object"||t.toolInput===null))throw new Ae("INVALID_TOOL_INPUT","Updated toolInput must be an object",{toolInput:t.toolInput});if(t.status!==void 0){if(typeof t.status!="object"||t.status===null)throw new Ae("INVALID_TOOL_STATUS","Updated status must be an object",{status:t.status});const a=t.status,s=["executing","completed","failed"];if(!s.includes(a.state))throw new Ae("INVALID_STATUS_STATE",`Updated status state must be one of: ${s.join(", ")}`,{state:a.state})}}const _n=qu((e,t)=>({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null,setActiveConversationId:a=>{L6(a),e({activeConversationId:a})},setStreaming:a=>{if(typeof a!="boolean")throw new Ae("INVALID_STREAMING_FLAG","isStreaming must be a boolean",{isStreaming:a});e({isStreaming:a})},setSdkStatus:a=>{a!==null&&D6(a),e({sdkStatus:a})},setError:a=>{O6(a),e({error:a})},reset:()=>e({messages:[],activeConversationId:null,isStreaming:!1,sdkStatus:null,error:null}),addMessage:a=>{A6(a);const l=t();if(l.messages.length>=1e3)throw new Ae("MAX_MESSAGES_EXCEEDED","Cannot add message: maximum limit of 1000 messages reached",{currentCount:l.messages.length,maxLimit:1e3});l.activeConversationId&&a.conversationId!==l.activeConversationId&&console.warn(`Message conversationId "${a.conversationId}" does not match active conversationId "${l.activeConversationId}"`),e(c=>({messages:[...c.messages,a]}))},updateMessage:(a,s)=>{if(yu(a),z6(s),!t().messages.some(o=>o.id===a))throw new Ae("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{id:a});e(o=>({messages:o.messages.map(u=>u.id===a?R(R({},u),s):u)}))},deleteMessage:a=>{yu(a),e(s=>({messages:s.messages.filter(l=>l.id!==a)}))},appendPart:(a,s)=>{yu(a),KS(s);const o=t().messages.find(u=>u.id===a);if(!o)throw new Ae("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{messageId:a});if(o.parts.length>=500)throw new Ae("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:a,currentCount:o.parts.length,maxLimit:500});e(u=>({messages:u.messages.map(h=>{if(h.id===a){const m=Y(R({},s),{timestamp:s.timestamp&&s.timestamp.length>0?s.timestamp:new Date().toISOString()});return Y(R({},h),{parts:[...h.parts,m]})}return h})}))},appendTextContent:(a,s)=>{if(yu(a),typeof s!="string")throw new Ae("INVALID_TEXT_CONTENT","Content must be a string",{content:s});const o=t().messages.find(m=>m.id===a);if(!o)throw new Ae("MESSAGE_NOT_FOUND",`Message with id "${a}" not found`,{messageId:a});const u=o.parts[o.parts.length-1];if(!(u&&u.type==="text")&&o.parts.length>=500)throw new Ae("MAX_PARTS_EXCEEDED","Cannot append part: maximum limit of 500 parts per message reached",{messageId:a,currentCount:o.parts.length,maxLimit:500});e(m=>({messages:m.messages.map(g=>{if(g.id===a){const p=g.parts[g.parts.length-1];if(p&&p.type==="text"){const x=[...g.parts];return x[g.parts.length-1]=Y(R({},p),{content:p.content+s}),Y(R({},g),{parts:x})}const v={type:"text",content:s,timestamp:new Date().toISOString()};return Y(R({},g),{parts:[...g.parts,v]})}return g})}))},updateToolInvocation:(a,s)=>{if(typeof a!="string"||a.length===0)throw new Ae("INVALID_TOOL_USE_ID","toolUseId must be a non-empty string",{toolUseId:a});I6(s);const l=t();let c=!1;for(const o of l.messages){for(const u of o.parts)if(u.type==="tool_invocation"&&"toolUseId"in u&&u.toolUseId===a){c=!0;break}if(c)break}if(!c)throw new Ae("TOOL_NOT_FOUND",`Tool invocation with toolUseId "${a}" not found`,{toolUseId:a});e(o=>({messages:o.messages.map(u=>Y(R({},u),{parts:u.parts.map(h=>h.type==="tool_invocation"&&"toolUseId"in h&&h.toolUseId===a?R(R({},h),s):h)}))}))},getLastMessage:()=>{const a=t().messages;return a.length>0?a[a.length-1]:void 0},getMessagesByConversation:a=>t().messages.filter(s=>s.conversationId===a),getCurrentStreamingMessage:()=>{const a=t().messages;for(let s=a.length-1;s>=0;s--)if(a[s].isStreaming)return a[s]}})),U6="modulepreload",B6=function(e){return"/"+e},H0={},F6=function(t,a,s){let l=Promise.resolve();if(a&&a.length>0){let o=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));l=o(a.map(m=>{if(m=B6(m),m in H0)return;H0[m]=!0;const g=m.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":U6,g||(v.as="script"),v.crossOrigin="",v.href=m,h&&v.setAttribute("nonce",h),document.head.appendChild(v),g)return new Promise((x,_)=>{v.addEventListener("load",x),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return l.then(o=>{for(const u of o||[])u.status==="rejected"&&c(u.reason);return t().catch(c)})},Ct={JSONRPC_MESSAGE_PARSE_FAILED:"JSONRPC_001",JSONRPC_ATTACH_LISTENER_FAILED:"JSONRPC_002",JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED:"JSONRPC_003",JSONRPC_SEND_REQUEST_FAILED:"JSONRPC_004",JSONRPC_SEND_NOTIFICATION_FAILED:"JSONRPC_005",JSONRPC_NOTIFICATION_HANDLER_ERROR:"JSONRPC_006",JSONRPC_HANDLE_NOTIFICATION_ERROR:"JSONRPC_007",JSONRPC_MESSAGE_HANDLER_ERROR:"JSONRPC_008",JSONRPC_WEBSOCKET_LOAD_FAILED:"JSONRPC_009",JSONRPC_UNKNOWN_RESPONSE_ID:"JSONRPC_010",CHAT_GET_STATUS_FAILED:"CHAT_001",CHAT_SEND_FAILED:"CHAT_002",CHAT_CANCEL_FAILED:"CHAT_003",WS_CONNECTION_ERROR:"WS_001",WS_MESSAGE_PARSE_FAILED:"WS_002",WS_ERROR_EVENT:"WS_003",WS_EVENT_HANDLER_ERROR:"WS_004",WS_MAX_RECONNECT_ATTEMPTS:"WS_005",WS_SEND_FAILED:"WS_006",WS_NOT_CONNECTED:"WS_007",SPEC_CONVERSION_FAILED:"DATA_001",DATA_LOADER_SUCCESS_CALLBACK_FAILED:"DATA_002",DATA_LOADER_ERROR_CALLBACK_FAILED:"DATA_003",DATA_NORMALIZATION_FAILED:"DATA_004",DATA_LOADER_LOAD_FAILED:"DATA_005",ANNOTATION_CREATE_FAILED:"ANNOTATION_001",ANNOTATION_DELETE_FAILED:"ANNOTATION_002",ANNOTATION_RESOLVE_FAILED:"ANNOTATION_003",ANNOTATION_REPLY_FAILED:"ANNOTATION_004",ANNOTATION_DELETE_ROLLBACK_FAILED:"ANNOTATION_005",SESSION_STORAGE_PARSE_ERROR:"STORAGE_001",AUTH_COOKIE_DECODE_FAILED:"AUTH_001",AUTH_REQUEST_FAILED:"AUTH_002"};var me=(e=>(e.VALIDATION_ERROR="validation_error",e.NOT_FOUND="not_found",e.NETWORK_ERROR="network_error",e.TIMEOUT="timeout",e.UNAUTHORIZED="unauthorized",e.RATE_LIMITED="rate_limited",e.RESOURCE_EXHAUSTED="resource_exhausted",e.CONFLICT="conflict",e.EXTERNAL_SERVICE_ERROR="external_service_error",e.ASSERTION_FAILED="assertion_failed",e.INVALID_STATE="invalid_state",e.NOT_IMPLEMENTED="not_implemented",e.TYPE_ERROR="type_error",e.PARSE_ERROR="parse_error",e.LOGIC_ERROR="logic_error",e.NULL_REFERENCE="null_reference",e.INTERNAL_ERROR="internal_error",e))(me||{}),gs=(e=>(e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.CRITICAL="critical",e))(gs||{}),Qn=(e=>(e.RETRY="retry",e.EXPONENTIAL_BACKOFF="exponential_backoff",e.FALLBACK="fallback",e.USER_ACTION="user_action",e.RELOAD="reload",e.NONE="none",e))(Qn||{});const Kt={network:/network|fetch|offline|connection|timeout|ERR_NAME_NOT_RESOLVED|ERR_INTERNET_DISCONNECTED/i,timeout:/timeout|timed out|deadline|took too long/i,networkDetail:{dns:/dns|name.*not.*resolved|ERR_NAME_NOT_RESOLVED/i,timeout:/timeout|timed out|deadline/i},unauthorized:/401|unauthorized|forbidden|not authorized|credentials/i,notFound:/404|not found|does not exist|resource.*not.*found/i,rateLimited:/429|rate limit|too many requests|quota|throttle/i,conflict:/409|conflict|duplicate|already.*exists|constraint/i,serverError:/500|502|503|504|internal.*error|service.*unavailable|gateway/i,validation:/validation|must be|required|bad request|email.*valid|password.*valid|field.*invalid/i,parseError:/parse|syntax|unexpected token|json|xml|invalid.*format/i,typeError:/type|not a function|is not a|undefined|null|cannot read|cannot set/i,resourceExhausted:/out of memory|quota|storage|disk|heap|too large|maximum/i,assertionFailed:/assertion.*failed|assert.*failed/i,invalidState:/invalid state|invariant|unreachable|should not happen/i,externalService:/third.?party|external|webhook|provider|service.*failed/i};function H6(e,t,a,s){const l=Date.now(),c=a==null?void 0:a.stack,o=`${t} ${(a==null?void 0:a.message)||""}`.toLowerCase(),u=$6(o,a),h=P6(u,s),m=q6(u),g=V6(u,o),p=G6(u,g),v=g&&K6(u),x=X6(u,t),_=J6(s,u);return{errorId:e,message:t,originalError:a,category:u,severity:h,isExpectedFailure:m,isTransient:g,recoveryStrategy:p,canRetry:v,maxRetryAttempts:Q6(u),retryDelayMs:Y6(u),context:s,userFacingMessage:x,devMessage:Z6(u,t,a),timestamp:l,stackTrace:c,affectedFeatures:_}}function $6(e,t){return t instanceof TypeError?me.TYPE_ERROR:t instanceof SyntaxError?me.PARSE_ERROR:t instanceof RangeError?me.RESOURCE_EXHAUSTED:Kt.network.test(e)?Kt.networkDetail.timeout.test(e)?me.TIMEOUT:(Kt.networkDetail.dns.test(e),me.NETWORK_ERROR):Kt.timeout.test(e)?me.TIMEOUT:Kt.unauthorized.test(e)?me.UNAUTHORIZED:Kt.notFound.test(e)?me.NOT_FOUND:Kt.rateLimited.test(e)?me.RATE_LIMITED:Kt.conflict.test(e)?me.CONFLICT:Kt.serverError.test(e)?me.EXTERNAL_SERVICE_ERROR:Kt.assertionFailed.test(e)?me.ASSERTION_FAILED:Kt.validation.test(e)&&!Kt.invalidState.test(e)&&!Kt.assertionFailed.test(e)?me.VALIDATION_ERROR:Kt.invalidState.test(e)?me.INVALID_STATE:Kt.parseError.test(e)?me.PARSE_ERROR:Kt.typeError.test(e)?me.TYPE_ERROR:Kt.resourceExhausted.test(e)?me.RESOURCE_EXHAUSTED:Kt.externalService.test(e)?me.EXTERNAL_SERVICE_ERROR:me.INTERNAL_ERROR}function P6(e,t){return t!=null&&t.isCritical||e===me.ASSERTION_FAILED||e===me.INVALID_STATE||e===me.NULL_REFERENCE||e===me.TYPE_ERROR?gs.CRITICAL:e===me.UNAUTHORIZED||e===me.NETWORK_ERROR||e===me.TIMEOUT||e===me.EXTERNAL_SERVICE_ERROR?gs.HIGH:e===me.VALIDATION_ERROR||e===me.NOT_FOUND||e===me.PARSE_ERROR||e===me.CONFLICT?gs.MEDIUM:e===me.RATE_LIMITED||e===me.RESOURCE_EXHAUSTED?gs.LOW:gs.MEDIUM}function q6(e){return[me.VALIDATION_ERROR,me.NOT_FOUND,me.NETWORK_ERROR,me.TIMEOUT,me.UNAUTHORIZED,me.RATE_LIMITED,me.RESOURCE_EXHAUSTED,me.CONFLICT,me.EXTERNAL_SERVICE_ERROR,me.PARSE_ERROR].includes(e)}function V6(e,t){const a=[me.NETWORK_ERROR,me.TIMEOUT,me.RATE_LIMITED,me.EXTERNAL_SERVICE_ERROR];return e===me.RESOURCE_EXHAUSTED?!t.includes("permanent")&&!t.includes("quota"):a.includes(e)}function G6(e,t){return e===me.ASSERTION_FAILED||e===me.INVALID_STATE||e===me.NOT_IMPLEMENTED||e===me.TYPE_ERROR||e===me.NULL_REFERENCE||e===me.LOGIC_ERROR?Qn.NONE:e===me.NETWORK_ERROR&&t||e===me.TIMEOUT&&t||e===me.EXTERNAL_SERVICE_ERROR&&t||e===me.RATE_LIMITED?Qn.EXPONENTIAL_BACKOFF:e===me.UNAUTHORIZED||e===me.VALIDATION_ERROR||e===me.NOT_FOUND?Qn.USER_ACTION:e===me.CONFLICT?Qn.FALLBACK:(e===me.PARSE_ERROR,Qn.NONE)}function K6(e){return[me.NETWORK_ERROR,me.TIMEOUT,me.RATE_LIMITED,me.EXTERNAL_SERVICE_ERROR,me.RESOURCE_EXHAUSTED].includes(e)}function Q6(e){switch(e){case me.NETWORK_ERROR:case me.TIMEOUT:return 3;case me.EXTERNAL_SERVICE_ERROR:return 2;case me.RATE_LIMITED:return 1;case me.RESOURCE_EXHAUSTED:return 2;default:return}}function Y6(e){switch(e){case me.NETWORK_ERROR:return 500;case me.TIMEOUT:return 1e3;case me.EXTERNAL_SERVICE_ERROR:return 1e3;case me.RATE_LIMITED:return 5e3;case me.RESOURCE_EXHAUSTED:return 2e3;default:return}}function X6(e,t){switch(e){case me.NETWORK_ERROR:return"Network connection failed. Please check your internet connection.";case me.TIMEOUT:return"The operation took too long. Please try again.";case me.UNAUTHORIZED:return"Your session has expired. Please log in again.";case me.NOT_FOUND:return"The requested resource was not found.";case me.RATE_LIMITED:return"Too many requests. Please wait before trying again.";case me.RESOURCE_EXHAUSTED:return"System resources are temporarily exhausted. Please try again.";case me.VALIDATION_ERROR:return`Invalid input: ${t}`;case me.CONFLICT:return"This resource has been modified by someone else. Please refresh and try again.";case me.EXTERNAL_SERVICE_ERROR:return"External service is temporarily unavailable. Please try again.";case me.PARSE_ERROR:return"Unable to process the response. Please try again or contact support.";case me.ASSERTION_FAILED:case me.INVALID_STATE:case me.TYPE_ERROR:case me.NULL_REFERENCE:case me.INTERNAL_ERROR:return"An unexpected error occurred. Please refresh the page or contact support.";default:return"An error occurred. Please try again."}}function Z6(e,t,a){var c;return[`[${((c=Object.entries(me).find(([,o])=>o===e))==null?void 0:c[0])||"UNKNOWN"}] ${t}`,a!=null&&a.message?`Original: ${a.message}`:""].filter(Boolean).join(" | ")}function J6(e,t){const a=[];return e!=null&&e.feature&&typeof e.feature=="string"&&a.push(e.feature),e!=null&&e.layer&&typeof e.layer=="string"&&a.push(`${e.layer}_layer`),t===me.NETWORK_ERROR?a.push("data_sync","websocket","api_calls"):t===me.EXTERNAL_SERVICE_ERROR&&a.push("export","integrations"),[...new Set(a)]}function Et(e,t,a,s){const l=new Date().toISOString(),c=H6(e,t,s,a),o={errorId:e,message:t,timestamp:l,context:a||{},category:c.category,severity:c.severity,isExpectedFailure:c.isExpectedFailure,isTransient:c.isTransient,recoveryStrategy:c.recoveryStrategy,canRetry:c.canRetry,affectedFeatures:c.affectedFeatures};if(typeof window!="undefined")try{const u=window.__SENTRY__;if(u&&u.captureException){const h=s||new Error(t);h.errorId=e,h.context=a,h.category=c.category,h.severity=c.severity,h.isExpectedFailure=c.isExpectedFailure,h.isTransient=c.isTransient,h.recoveryStrategy=c.recoveryStrategy,u.setTag("error_id",e),u.setTag("error_category",c.category),u.setTag("error_severity",c.severity),u.setTag("is_expected",String(c.isExpectedFailure)),u.setTag("is_transient",String(c.isTransient)),u.captureException(h)}}catch(u){console.warn("[ErrorTracker] Failed to capture error in Sentry:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}if(e!==Ct.SESSION_STORAGE_PARSE_ERROR&&typeof sessionStorage!="undefined")try{const u="app:error_log",h=sessionStorage.getItem(u),m=h?JSON.parse(h):[];m.push(o),m.length>50&&m.shift(),sessionStorage.setItem(u,JSON.stringify(m))}catch(u){console.warn("[ErrorTracker] Failed to store error log in session storage:",u instanceof Error?u.message:String(u),{errorId:e,message:t})}return c}function vo(e,t){const a=new Date().toISOString();if(console.warn(e),typeof sessionStorage!="undefined")try{const s="app:warning_log",l=sessionStorage.getItem(s),c=l?JSON.parse(l):[];c.push({message:e,timestamp:a,context:t||{}}),c.length>50&&c.shift(),sessionStorage.setItem(s,JSON.stringify(c))}catch(s){console.warn("[ErrorTracker] Failed to store warning log in session storage:",s instanceof Error?s.message:String(s),{message:e})}}class Qp extends Error{constructor(t,a,s){super(s),this.code=t,this.rpcError=a,this.name="JsonRpcErrorResult",Object.setPrototypeOf(this,Qp.prototype)}}class W6{constructor(){dt(this,"pendingRequests",new Map);dt(this,"notificationHandlers",new Map);dt(this,"requestTimeout",3e4);dt(this,"requestIdCounter",1);dt(this,"messageListenerAttached",!1);dt(this,"messageListenerAttachmentInProgress",!1);dt(this,"cachedWebSocketClient",null);this.ensureMessageListenerAttached()}getWebSocketClient(){return ze(this,null,function*(){if(this.cachedWebSocketClient)return this.cachedWebSocketClient;try{const t=yield F6(()=>Promise.resolve().then(()=>w5),void 0);return this.cachedWebSocketClient=t.websocketClient,this.cachedWebSocketClient}catch(t){throw Et(Ct.JSONRPC_WEBSOCKET_LOAD_FAILED,"Failed to load WebSocket client - JSON-RPC communication will not be available",{},t instanceof Error?t:new Error(String(t))),t}})}ensureMessageListenerAttachedAsync(){return ze(this,null,function*(){if(!this.messageListenerAttached&&!this.messageListenerAttachmentInProgress){this.messageListenerAttachmentInProgress=!0;try{(yield this.getWebSocketClient()).on("message",a=>{try{if(!this.isValidJsonRpcMessage(a)){Et(Ct.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure - missing required fields",{message:String(a)});return}this.handleMessage(a)}catch(s){s instanceof TypeError?Et(Ct.JSONRPC_MESSAGE_PARSE_FAILED,"Invalid JSON-RPC message structure",{error:s instanceof Error?s.message:String(s),message:String(a)},s instanceof Error?s:new Error(String(s))):Et(Ct.JSONRPC_MESSAGE_HANDLER_ERROR,"Unexpected error while handling JSON-RPC message - possible programming bug",{error:s instanceof Error?s.message:String(s),errorType:s instanceof Error?s.constructor.name:typeof s,message:String(a),stack:s instanceof Error?s.stack:void 0},s instanceof Error?s:new Error(String(s)))}}),this.messageListenerAttached=!0}catch(t){Et(Ct.JSONRPC_ATTACH_LISTENER_FAILED,"Failed to attach message listener to WebSocket - JSON-RPC responses will not be received",{error:t instanceof Error?t.message:String(t)},t instanceof Error?t:new Error(String(t)))}finally{this.messageListenerAttachmentInProgress=!1}}})}ensureMessageListenerAttached(){this.messageListenerAttached||this.messageListenerAttachmentInProgress||this.ensureMessageListenerAttachedAsync().catch(t=>{Et(Ct.JSONRPC_ATTACH_LISTENER_BACKGROUND_FAILED,"Failed to attach message listener in background",{error:t instanceof Error?t.message:String(t)})})}sendRequest(t,a,s){return ze(this,null,function*(){const l=this.generateRequestId(),c={jsonrpc:"2.0",method:t,id:l};return a&&(c.params=a),new Promise((o,u)=>{const h=s!=null?s:this.requestTimeout,m=setTimeout(()=>{this.pendingRequests.delete(l),u(new Error(`JSON-RPC request timeout for method '${t}' after ${h}ms`))},h);this.pendingRequests.set(l,{id:l,method:t,resolve:g=>o(g),reject:u,timeout:m}),this._sendRequestMessage(c,l,m,u)})})}sendNotification(t,a){const s=R({jsonrpc:"2.0",method:t},a&&{params:a});this._sendNotificationMessage(s,t)}_sendRequestMessage(t,a,s,l){return ze(this,null,function*(){try{if(!(yield this.getWebSocketClient()).send(t)){this.pendingRequests.delete(a),clearTimeout(s);const u="Failed to send JSON-RPC request: WebSocket not connected";Et(Ct.JSONRPC_SEND_REQUEST_FAILED,u,{method:t.method}),l(new Error(u))}}catch(c){this.pendingRequests.delete(a),clearTimeout(s);const o=`Failed to send JSON-RPC request: ${c instanceof Error?c.message:"Unknown error"}`;Et(Ct.JSONRPC_SEND_REQUEST_FAILED,o,{error:c instanceof Error?c.message:String(c),method:t.method}),l(new Error(o))}})}_sendNotificationMessage(t,a){return ze(this,null,function*(){try{(yield this.getWebSocketClient()).send(t)||Et(Ct.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${a}': WebSocket not connected`,{method:a})}catch(s){Et(Ct.JSONRPC_SEND_NOTIFICATION_FAILED,`Failed to send notification for method '${a}'`,{error:s instanceof Error?s.message:String(s),method:a})}})}onNotification(t,a){this.notificationHandlers.has(t)||this.notificationHandlers.set(t,new Set);const s=this.notificationHandlers.get(t);return s.add(a),()=>{s.delete(a),s.size===0&&this.notificationHandlers.delete(t)}}handleMessage(t){"result"in t||"error"in t?this.handleResponse(t):"method"in t&&!("id"in t)&&this.handleNotification(t)}handleResponse(t){const{id:a}=t,s=this.pendingRequests.get(a);if(!s){const l=`Received JSON-RPC response for unknown request ID: ${a}. This may indicate a timing issue or protocol error.`;Et(Ct.JSONRPC_UNKNOWN_RESPONSE_ID,l,{responseId:a},new Error(l));return}if(this.pendingRequests.delete(a),clearTimeout(s.timeout),"result"in t)s.resolve(t.result);else if("error"in t){const l=this.createError(t.error,s.method);s.reject(l)}}handleNotification(t){const{method:a,params:s}=t;if(!a){vo("Received notification without method");return}const l=this.notificationHandlers.get(a);!l||l.size===0||l.forEach(c=>{try{const o=c(s!=null?s:{});o&&typeof o.then=="function"&&o.catch(u=>{Et(Ct.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${a}'`,{error:u instanceof Error?u.message:String(u),method:a})})}catch(o){Et(Ct.JSONRPC_NOTIFICATION_HANDLER_ERROR,`Error in notification handler for '${a}'`,{error:o instanceof Error?o.message:String(o),method:a})}})}createError(t,a){const s=`JSON-RPC Error (${t.code}): ${t.message} [method: ${a}]`;return new Qp(t.code,t,s)}generateRequestId(){return`req-${Date.now()}-${this.requestIdCounter++}`}clearPendingRequests(){this.pendingRequests.forEach(({timeout:a})=>{clearTimeout(a)});const t=new Error("WebSocket connection closed");this.pendingRequests.forEach(({reject:a})=>{a(t)}),this.pendingRequests.clear()}getPendingRequestCount(){return this.pendingRequests.size}static validateRequest(t){if(typeof t!="object"||t===null)return!1;const a=t;return a.jsonrpc==="2.0"&&typeof a.method=="string"&&(a.id===void 0||typeof a.id=="string"||typeof a.id=="number")}static validateResponse(t){if(typeof t!="object"||t===null)return!1;const a=t;return a.jsonrpc!=="2.0"||a.id===void 0&&a.id!==0?!1:"result"in a&&!("error"in a)||"error"in a&&!("result"in a)}isValidJsonRpcMessage(t){if(typeof t!="object"||t===null)return!1;const a=t;if(a.jsonrpc!=="2.0")return!1;const s="id"in a,l="method"in a,c="result"in a,o="error"in a;return s&&(c||o)?c&&!o||!c&&o:!!(l&&!s)}}const Ri=new W6;function e5(e,t,a){switch(e){case"executing":return{state:"executing"};case"completed":return{state:"completed",result:t};case"failed":return{state:"failed",error:a||"Unknown error"};default:return console.warn(`[ChatService] Unknown tool status: "${e}", treating as executing`),{state:"executing"}}}class t5{constructor(){dt(this,"currentConversationId",null);dt(this,"currentRequestId",null);this.setupNotificationHandlers()}setupNotificationHandlers(){Ri.onNotification("chat.response.chunk",t=>{this.handleResponseChunk(t)}),Ri.onNotification("chat.tool.invoke",t=>{this.handleToolInvoke(t)}),Ri.onNotification("chat.thinking",t=>{this.handleThinking(t)}),Ri.onNotification("chat.usage",t=>{this.handleUsage(t)}),Ri.onNotification("chat.error",t=>{this.handleError(t)})}getStatus(){return ze(this,null,function*(){var t,a,s,l,c,o;try{const u=yield Ri.sendRequest("chat.status",{}),h={sdkAvailable:(a=(t=u.sdkAvailable)!=null?t:u.sdk_available)!=null?a:!1,sdkVersion:(l=(s=u.sdkVersion)!=null?s:u.sdk_version)!=null?l:null,errorMessage:(o=(c=u.errorMessage)!=null?c:u.error_message)!=null?o:null};return _n.getState().setSdkStatus(h),h}catch(u){const h=u instanceof Error?u.message:"Unknown error";Et(Ct.CHAT_GET_STATUS_FAILED,"Failed to get status",{error:h});const m={sdkAvailable:!1,sdkVersion:null,errorMessage:h};throw _n.getState().setSdkStatus(m),u}})}sendMessage(t){return ze(this,null,function*(){if(!t.trim())throw new Error("Message cannot be empty");const a=_n.getState(),l={id:this.generateMessageId(),role:"user",conversationId:this.currentConversationId||this.generateConversationId(),timestamp:new Date().toISOString(),parts:[{type:"text",content:t,timestamp:new Date().toISOString()}]};this.currentConversationId=l.conversationId,a.setActiveConversationId(this.currentConversationId),a.addMessage(l);const c=this.generateMessageId(),o={id:c,role:"assistant",conversationId:l.conversationId,timestamp:new Date().toISOString(),parts:[],isStreaming:!0};a.addMessage(o),a.setStreaming(!0),a.setError(null);try{this.currentRequestId=this.generateRequestId();const u=yield Ri.sendRequest("chat.send",{message:t},6e4);return a.updateMessage(c,{isStreaming:!1}),a.setStreaming(!1),u}catch(u){a.setStreaming(!1);const h=u instanceof Error?u.message:"Unknown error";throw a.setError(h),Et(Ct.CHAT_SEND_FAILED,"Failed to send message",{error:h,message:t}),a.appendPart(c,{type:"error",code:"SEND_FAILED",message:h,timestamp:new Date().toISOString()}),u}})}cancelMessage(){return ze(this,null,function*(){const t=_n.getState();try{const a=yield Ri.sendRequest("chat.cancel",{},5e3);return t.setStreaming(!1),a}catch(a){const s=a instanceof Error?a.message:"Unknown error";throw Et(Ct.CHAT_CANCEL_FAILED,"Failed to cancel",{error:s}),t.setStreaming(!1),a}})}handleResponseChunk(t){const a=_n.getState(),s=a.getCurrentStreamingMessage();if(!s){vo("Received response chunk but no streaming message");return}a.appendTextContent(s.id,t.content)}handleToolInvoke(t){const a=_n.getState(),s=a.getCurrentStreamingMessage();if(!s){vo("Received tool invoke but no streaming message");return}const l=e5(t.status,t.result,t.error);s.parts.find(o=>o.type==="tool_invocation"&&o.toolUseId===t.tool_use_id)?a.updateToolInvocation(t.tool_use_id,{status:l}):a.appendPart(s.id,{type:"tool_invocation",toolUseId:t.tool_use_id,toolName:t.toolName,toolInput:t.toolInput,status:l,timestamp:t.timestamp||new Date().toISOString()})}handleThinking(t){const a=_n.getState(),s=a.getCurrentStreamingMessage();if(!s){vo("Received thinking but no streaming message");return}a.appendPart(s.id,{type:"thinking",content:t.content,timestamp:t.timestamp||new Date().toISOString()})}handleUsage(t){const a=_n.getState(),s=a.getCurrentStreamingMessage();if(!s){vo("Received usage but no streaming message");return}a.appendPart(s.id,{type:"usage",inputTokens:t.input_tokens,outputTokens:t.output_tokens,totalTokens:t.total_tokens,totalCostUsd:t.total_cost_usd,timestamp:t.timestamp||new Date().toISOString()})}handleError(t){const a=_n.getState(),s=t.message||"Unknown error";a.setError(s),a.setStreaming(!1);const l=a.getCurrentStreamingMessage();l&&a.appendPart(l.id,{type:"error",code:t.code||"UNKNOWN_ERROR",message:s,timestamp:t.timestamp||new Date().toISOString()})}generateMessageId(){return`msg-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateConversationId(){return`conv-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}getCurrentConversationId(){return this.currentConversationId}getCurrentRequestId(){return this.currentRequestId}reset(){this.currentConversationId=null,this.currentRequestId=null,_n.getState().reset()}}const n5=new t5;function a5(e){return e==="user"?"user":"bot"}function i5(e){return e==="user"?"You":"DrBot"}function s5(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function r5(e){switch(e.state){case"executing":return"running";case"completed":return"success";case"failed":return"error";default:return"running"}}function $0(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch(t){return String(e)}}function l5(e){var s;const t=[],a=(s=e.toolInput)!=null?s:{};for(const[l,c]of Object.entries(a))t.push({key:l,value:$0(c)});return e.status.state==="completed"&&e.status.result!==void 0?t.push({key:"result",value:$0(e.status.result)}):e.status.state==="failed"&&t.push({key:"error",value:e.status.error}),t}function o5(e){return{name:e.toolName,status:r5(e.status),output:l5(e)}}function c5(e){const t=typeof e.totalCostUsd=="number"&&e.totalCostUsd>0?` · $${e.totalCostUsd.toFixed(4)}`:"";return`${e.totalTokens} tokens (${e.inputTokens} in / ${e.outputTokens} out)${t}`}function u5(e){var g,p;const t=a5(e.role),a=i5(e.role),s=s5(e.timestamp),l=!!e.isStreaming,c=[];let o=0,u=null;const h=(v={})=>R({id:`${e.id}:${o++}`,role:t,senderName:a,timestamp:s,body:"",bodyKind:"markdown",isStreaming:l},v),m=()=>{u&&(c.push(u),u=null)};for(const v of e.parts)switch(v.type){case"text":{const x=(g=v.content)!=null?g:"";u&&u.bodyKind==="markdown"&&!u.toolBlock&&!u.thinkingBlock?u.body+=x:(m(),u=h({body:x}));break}case"thinking":{const x={content:(p=v.content)!=null?p:""};u&&u.bodyKind==="markdown"&&!u.thinkingBlock&&!u.toolBlock?(u.thinkingBlock=x,m()):(m(),c.push(h({thinkingBlock:x})));break}case"tool_invocation":{const x=o5(v);u&&u.bodyKind==="markdown"&&!u.toolBlock?(u.toolBlock=x,m()):(m(),c.push(h({toolBlock:x})));break}case"error":{m(),c.push(h({body:v.message,bodyKind:"error",isStreaming:!1}));break}case"usage":{m(),c.push(h({body:c5(v),bodyKind:"usage",isStreaming:!1}));break}}return m(),c.length===0&&c.push(h({})),c}function d5(e){const t=[];for(const a of e)t.push(...u5(a));return t}const cm=["What does this element do?","Show cross-layer references","Any unresolved references?","Explain the data-model layer"];function f5({row:e}){return e.bodyKind==="error"?f.jsx("span",{style:{color:"#F43F5E",fontSize:12.5,lineHeight:1.5},"data-testid":"chat-error-line",children:e.body}):e.bodyKind==="usage"?f.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10.5,color:"rgb(var(--canvas-fg-3))"},children:e.body}):f.jsx(bS,{content:e.body,isStreaming:e.isStreaming})}function h5(){const e=Ie(O=>O.view),t=Ie(O=>O.layerId),a=Ie(O=>O.selectedId),s=Ie(O=>O.changesetId),l=_n(O=>O.messages),c=_n(O=>O.isStreaming),o=_n(O=>O.error),{derived:u}=Hs(),{derived:h}=Ho(),m=D.useMemo(()=>Kp(u),[u]),g=e==="model"&&a?m.byUuid.get(a):void 0,p=g==null?void 0:g.name,v=t?nl(t):"",x=D.useMemo(()=>{if(e==="changesets"){const O=h.list.find(z=>z.id===s);return O?O.name:"changesets"}return p||(v?`${v} layer`:"meta-model")},[e,h.list,s,p,v]),_=D.useMemo(()=>p?[`What does ${p} do?`,"Show cross-layer references","Any unresolved references?",v?`Explain the ${v} layer`:cm[3]]:v?[...cm.slice(0,3),`Explain the ${v} layer`]:cm,[p,v]),S=D.useMemo(()=>d5(l),[l]),[w,C]=D.useState(""),k=O=>{const z=O.trim();!z||c||(C(""),n5.sendMessage(z).catch(()=>{}))},j=l.length<=1,E=f.jsxs(f.Fragment,{children:[o&&f.jsx("div",{role:"alert","data-testid":"chat-store-error",style:{flex:"none",margin:"6px 12px 0 12px",padding:"8px 10px",borderRadius:8,fontSize:12,lineHeight:1.45,color:"#F43F5E",background:"rgba(244,63,94,0.08)",border:"1px solid rgba(244,63,94,0.25)"},children:/-32001|sdk|not (?:installed|available)/i.test(o)?"No chat client is available on the server (the Claude SDK is not installed). The drawer is read-only until it is enabled.":o}),j&&f.jsx("div",{style:{flex:"none",padding:"10px 12px 6px 12px",borderTop:"1px solid rgb(var(--canvas-border))"},children:f.jsx(u_,{suggestions:_,onSelect:O=>k(O)})}),f.jsx("div",{style:{flex:"none",padding:"0 8px 10px 8px"},children:f.jsx(d_,{value:w,onChange:C,onSubmit:O=>k(O),scopeLabel:x,placeholder:"Ask about the model…",loading:c})})]});return f.jsx(f_,{composer:E,children:S.map(O=>f.jsx(l_,{role:O.role,senderName:O.senderName,timestamp:O.timestamp,body:f.jsx(f5,{row:O}),toolBlock:O.toolBlock,thinkingBlock:O.thinkingBlock},O.id))})}const P0={width:372,flex:"none",background:"rgb(var(--canvas-bg))",display:"flex",flexDirection:"column",minHeight:0,borderLeft:"1px solid rgb(var(--canvas-border))"},m5={position:"absolute",right:0,top:0,bottom:0,zIndex:30,boxShadow:"-16px 0 44px -22px rgba(0,0,0,0.5)"};function p5(){const e=Ie(s=>s.chatOpen),t=Ie(s=>s.wide);if(!e)return null;const a=t?P0:R(R({},P0),m5);return f.jsxs("div",{style:a,"data-testid":"chat-drawer","data-mode":t?"pane":"overlay",children:[f.jsxs("div",{style:{height:40,flex:"none",display:"flex",alignItems:"center",gap:8,padding:"0 16px",borderBottom:"1px solid rgb(var(--canvas-border))"},children:[f.jsx("span",{className:"drv-chat-pulse",style:{width:6,height:6,borderRadius:"50%",background:"#FBBF24",display:"inline-block"}}),f.jsx("span",{style:{fontSize:13,fontWeight:600,color:"rgb(var(--canvas-fg-1))"},children:"DrBot"}),f.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:10,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgb(var(--canvas-fg-3))"},children:"model assistant"})]}),f.jsx("div",{style:{flex:1,minHeight:0,position:"relative"},children:f.jsx("div",{style:{position:"absolute",inset:0},children:f.jsx(h5,{})})})]})}const vu="data-model",g5="I'm **DrBot**, scoped to the loaded architecture model. Select any element to inspect it, then ask me to explain it, trace its cross-layer references, or validate reference integrity.";function y5(){D.useEffect(()=>{var s;const e=_n.getState();if(e.messages.length>0)return;const t=new Date().toISOString(),a={id:`msg-greeting-${Date.now()}`,role:"assistant",conversationId:(s=e.activeConversationId)!=null?s:"greeting",timestamp:t,parts:[{type:"text",content:g5,timestamp:t}]};e.addMessage(a)},[])}function v5(){const e=Ie(g=>g.view),t=Ie(g=>g.layerId),a=Ie(g=>g.changesetId),s=Ie(g=>g.navigateToElement),l=Ie(g=>g.navigateToSpecNode),c=Ie(g=>g.selectChangeset),{derived:o}=Hs(),{derived:u,raw:h}=ol(),{derived:m}=Ho();D.useEffect(()=>{var g,p,v;if(e==="changesets"){if(a)return;const x=m.list[0];x&&c(x.id);return}if(!t){if(e==="model"){if(o.nodes.length===0)return;const x=(g=o.nodesByLayer[vu])!=null&&g.length?vu:Object.keys(o.nodesByLayer)[0];if(!x)return;const _=(p=o.nodesByLayer[x])==null?void 0:p[0];_&&s(_.id,x);return}if(e==="spec"){if(Object.keys(u.byLayer).length===0)return;const x=(v=u.byLayer[vu])!=null&&v.typeCount?vu:OS.find(S=>{var w;return(w=u.byLayer[S])==null?void 0:w.typeCount});if(!x)return;const _=s6(h,x);_&&l(_,x)}}},[e,t,a,o,u,h,m,s,l,c])}function b5(){const t=Ie(a=>a.view)==="changesets";return v5(),y5(),f.jsxs("div",{style:{height:"100vh",minWidth:880,display:"flex",flexDirection:"column",background:"rgb(var(--shell-bg))",color:"rgb(var(--shell-fg-1))",fontFamily:"Inter, system-ui, sans-serif",overflow:"hidden"},"data-testid":"app-shell",children:[f.jsx(N4,{}),f.jsxs("div",{style:{flex:1,display:"flex",minHeight:0,position:"relative"},children:[f.jsx(G4,{}),t?f.jsx(T6,{}):f.jsx(r6,{}),t?f.jsx(M6,{}):f.jsx(E6,{}),f.jsx(p5,{})]}),f.jsx(K4,{})]})}const x5=0,Ti=1,_5=2,S5=3;class QS{constructor(t,a=null){dt(this,"ws",null);dt(this,"url");dt(this,"token",null);dt(this,"reconnectAttempts",0);dt(this,"maxReconnectAttempts",10);dt(this,"reconnectDelay",1e3);dt(this,"maxReconnectDelay",3e4);dt(this,"reconnectTimer",null);dt(this,"heartbeatTimer",null);dt(this,"heartbeatInterval",3e4);dt(this,"eventHandlers",new Map);dt(this,"isIntentionallyClosed",!1);dt(this,"subscribedTopics",[]);dt(this,"mode","detecting");dt(this,"connectionTimeout",null);dt(this,"maxConnectionAttempts",3);dt(this,"connectionErrors",[]);this.url=t,this.token=a}setToken(t){this.token=t,console.log("[WebSocket] Token updated:",t?"present":"cleared")}getAuthProtocols(){if(this.token)return["token",this.token]}connect(){if(this.ws&&this.ws.readyState===Ti){console.log("[WebSocket] Already connected");return}if(this.mode==="rest"){console.log("[WebSocket] Using REST mode, skipping WebSocket connection"),this.emit("rest-mode",{});return}this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),this.isIntentionallyClosed=!1,this.mode==="detecting"&&console.log(`[WebSocket] Attempting WebSocket connection (attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts})...`);try{const t=this.getAuthProtocols();this.ws=new WebSocket(this.url,t),this.ws.onopen=this.handleOpen.bind(this),this.ws.onmessage=this.handleMessage.bind(this),this.ws.onerror=this.handleError.bind(this),this.ws.onclose=this.handleClose.bind(this),this.mode==="detecting"&&(this.connectionTimeout=setTimeout(()=>{this.ws&&this.ws.readyState!==Ti&&(console.log("[WebSocket] Connection timeout during detection phase"),this.ws.close())},3e3))}catch(t){this.mode==="detecting"?(console.debug("[WebSocket] Connection error during detection:",t),this.handleConnectionFailure(),this.connectionErrors.push(t instanceof Error?t:new Error(String(t)))):(Et(Ct.WS_CONNECTION_ERROR,"WebSocket connection error",{error:t instanceof Error?t.message:String(t)}),this.scheduleReconnect())}}getConnectionErrors(){return[...this.connectionErrors]}isTestEnvironment(){return Km()}triggerCloseForTesting(){this.isTestEnvironment()&&(this.ws&&this.ws.readyState===Ti?(console.log("[WebSocket] TEST: Forcing close event"),this.ws.close(1e3,"Test-triggered close")):console.warn("[WebSocket] TEST: Cannot close, not connected"))}simulateMaxReconnectAttemptsForTesting(){this.isTestEnvironment()&&(console.log("[WebSocket] TEST: Simulating max reconnect attempts"),this.reconnectAttempts=this.maxReconnectAttempts,Et(Ct.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached (TEST SIMULATION)",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts}))}disconnect(){this.isIntentionallyClosed=!0,this.stopHeartbeat(),this.cancelReconnect(),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.ws&&(this.ws.onopen=null,this.ws.onmessage=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.close(),this.ws=null),console.log("[WebSocket] Disconnected"),this.emit("disconnect",{})}subscribe(t){this.subscribedTopics=t,this.ws&&this.ws.readyState===Ti&&this.send({type:"subscribe",topics:t})}send(t){var a;if(this.ws&&this.ws.readyState===Ti)try{return this.ws.send(JSON.stringify(t)),!0}catch(s){return Et(Ct.WS_SEND_FAILED,"Failed to send WebSocket message",{error:s instanceof Error?s.message:String(s),message:t}),!1}else return Et(Ct.WS_NOT_CONNECTED,"Cannot send message, WebSocket not connected",{connectionState:(a=this.ws)==null?void 0:a.readyState,message:t}),!1}on(t,a){this.eventHandlers.has(t)||this.eventHandlers.set(t,new Set),this.eventHandlers.get(t).add(a)}off(t,a){const s=this.eventHandlers.get(t);s&&s.delete(a)}get isConnected(){return this.ws!==null&&this.ws.readyState===Ti}get connectionState(){if(!this.ws)return this.reconnectTimer?"reconnecting":"disconnected";switch(this.ws.readyState){case x5:return"connecting";case Ti:return"connected";case _5:case S5:return this.reconnectTimer?"reconnecting":"disconnected";default:return"disconnected"}}get transportMode(){return this.mode}handleConnectionFailure(){this.reconnectAttempts++,this.reconnectAttempts>=this.maxConnectionAttempts?(console.log("[WebSocket] Server does not support WebSocket, using REST mode"),this.connectionErrors.length>0&&(console.warn("[WebSocket] Connection attempts failed with the following errors:"),this.connectionErrors.forEach((t,a)=>{console.warn(` [${a+1}] ${t.message}`)})),this.mode="rest",this.reconnectAttempts=0,this.emit("rest-mode",{}),this.emit("connect",{})):setTimeout(()=>this.connect(),500)}handleOpen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),console.log("[WebSocket] Connected successfully"),this.mode="websocket",this.reconnectAttempts=0,this.reconnectDelay=1e3,this.startHeartbeat(),this.emit("connect",{}),this.subscribedTopics.length>0&&this.subscribe(this.subscribedTopics)}handleMessage(t){var a;try{const s=JSON.parse(t.data),l=(a=s.type)!=null?a:"message";console.log("[WebSocket] Received:",l),this.emit(l,s),l!=="message"&&this.emit("message",s)}catch(s){Et(Ct.WS_MESSAGE_PARSE_FAILED,"Failed to parse WebSocket message",{error:s instanceof Error?s.message:String(s),data:t.data})}}handleError(t){const a=Km();if(this.mode==="detecting"){const s=t instanceof ErrorEvent?t.message:String(t);this.connectionErrors.push(new Error(`[Attempt ${this.reconnectAttempts+1}/${this.maxConnectionAttempts}] ${s}`)),console.debug("[WebSocket] Connection error during detection (attempt %d/%d): %s",this.reconnectAttempts+1,this.maxConnectionAttempts,s)}else a?console.debug("[WebSocket] Error in test environment:",t):Et(Ct.WS_ERROR_EVENT,"WebSocket error event",{error:t instanceof ErrorEvent?t.message:String(t)});this.emit("error",{kind:"event",error:t})}handleClose(t){if(this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.mode==="detecting"){this.handleConnectionFailure();return}console.log(`[WebSocket] Closed (code: ${t.code}, reason: ${t.reason})`),this.stopHeartbeat(),this.emit("close",{code:t.code,reason:t.reason}),!this.isIntentionallyClosed&&this.mode!=="rest"&&this.scheduleReconnect()}scheduleReconnect(){if(this.isIntentionallyClosed)return;if(this.reconnectAttempts>=this.maxReconnectAttempts){Et(Ct.WS_MAX_RECONNECT_ATTEMPTS,"Max reconnection attempts reached",{attempts:this.reconnectAttempts}),this.emit("max-reconnect-attempts",{attempts:this.reconnectAttempts});return}this.reconnectAttempts++;const t=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);console.log(`[WebSocket] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`),this.emit("reconnecting",{attempt:this.reconnectAttempts,delay:t}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws&&this.ws.readyState===Ti&&this.send({type:"ping"})},this.heartbeatInterval)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}emit(t,a){const s=this.eventHandlers.get(t);s&&s.forEach(l=>{try{l(a)}catch(c){Et(Ct.WS_EVENT_HANDLER_ERROR,`Error in WebSocket event handler for '${t}'`,{error:c instanceof Error?c.message:String(c),event:t})}})}}function Km(){return typeof window=="undefined"?!1:!!(window.__PLAYWRIGHT__||window.__STORYBOOK_MOCK_WEBSOCKET__||window.__karma__||window.jasmine||window.jest)}let Pt;if(typeof window!="undefined"){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;Pt=new QS(t,null)}else{const e=new Map;Pt={setToken:()=>{},connect:()=>{setTimeout(()=>{const t=e.get("error");t&&t.forEach(s=>s({code:"SSR_ENVIRONMENT",message:"WebSocket not available in SSR/Node.js environment"}));const a=e.get("rest-mode");a&&a.forEach(s=>s({}))},0)},disconnect:()=>{},subscribe:()=>{},send:()=>(Et(Ct.WS_SEND_FAILED,"Cannot send message in SSR/Node.js environment - use REST API instead",{environment:"SSR/Node.js"}),!1),on:(t,a)=>{e.has(t)||e.set(t,new Set),e.get(t).add(a)},off:(t,a)=>{const s=e.get(t);s&&s.delete(a)},get isConnected(){return!1},get connectionState(){return"disconnected"},get transportMode(){return"rest"}}}typeof window!="undefined"&&Km()&&(window.__WEBSOCKET_CLIENT__=Pt);const w5=Object.freeze(Object.defineProperty({__proto__:null,WebSocketClient:QS,get websocketClient(){return Pt}},Symbol.toStringTag,{value:"Module"}));function C5(){const e=dp(g=>g.token),t=yo(g=>g.setConnected),a=yo(g=>g.setDisconnected),s=yo(g=>g.setReconnecting),l=yo(g=>g.setError),c=D.useCallback(()=>{console.log("[RootShell] WebSocket connected"),t(),Pt.transportMode==="websocket"&&Pt.subscribe(["model","changesets","annotations"])},[t]),o=D.useCallback(()=>{console.log("[RootShell] Using REST mode"),t()},[t]),u=D.useCallback(()=>{console.log("[RootShell] WebSocket disconnected"),a()},[a]),h=D.useCallback(g=>{s(g.attempt,g.delay)},[s]),m=D.useCallback(g=>{const p=g.kind==="event"?g.error:`${g.code}: ${g.message}`;console.error("[RootShell] WebSocket error:",p),l("Connection error")},[l]);return D.useEffect(()=>(console.log("[RootShell] Initializing WebSocket connection"),e&&(console.log("[RootShell] Setting authentication token for WebSocket"),Pt.setToken(e)),Pt.on("connect",c),Pt.on("disconnect",u),Pt.on("reconnecting",h),Pt.on("error",m),Pt.on("rest-mode",o),Pt.connect(),()=>{Pt.off("connect",c),Pt.off("disconnect",u),Pt.off("reconnecting",h),Pt.off("error",m),Pt.off("rest-mode",o),Pt.disconnect()}),[e,c,u,h,m,o]),f.jsx(Cx,{})}const N5={model:"model",spec:"spec",changesets:"changesets"},j5={model:"model",spec:"spec",changesets:"changesets"},E5={model:"graph",spec:"graph",changesets:"list"};function k5(){const{section:e}=Qu({strict:!1}),t=Ie(c=>c.view),a=Ie(c=>c.setView),s=D.useRef(!1),l=D.useRef(t);return D.useEffect(()=>{const c=e?N5[e]:void 0;c&&a(c)},[e,a]),D.useEffect(()=>{if(!s.current){s.current=!0,l.current=t;return}if(l.current===t)return;l.current=t;const c=j5[t];e!==c&&YS.navigate({to:"/$section/$view",params:{section:c,view:E5[c]}})},[t,e]),f.jsx(b5,{})}const Yp=Qj({component:C5}),R5=sp({getParentRoute:()=>Yp,path:"/",validateSearch:e=>({token:typeof e.token=="string"?e.token:void 0}),component:JE}),T5=sp({getParentRoute:()=>Yp,path:"/$section/$view",component:k5}),M5=Yp.addChildren([R5,T5]),YS=nE({routeTree:M5,history:jN()}),A5=new URLSearchParams(window.location.search),um=A5.get("token");if(um){console.log("[main] Found token in URL query string, storing to localStorage"),localStorage.setItem("dr_auth_token",um),dp.getState().setToken(um),console.log("[main] Updated authStore with new token");const e=window.location.pathname+window.location.hash;window.history.replaceState(null,"",e),console.log("[main] URL cleaned, removed token from query string")}PE();const XS=document.getElementById("root");if(!XS)throw new Error("Root element not found");const D5=XE();vN.createRoot(XS).render(f.jsx(ae.StrictMode,{children:f.jsx(TE,{client:D5,children:f.jsx(sE,{router:YS})})}))});export default L5();