@taico/taico 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/dist/agents/agent-tokens.controller.js +1 -1
  2. package/dist/agents/agent-tokens.controller.js.map +1 -1
  3. package/dist/agents/agents.controller.js +7 -1
  4. package/dist/agents/agents.controller.js.map +1 -1
  5. package/dist/agents/agents.service.js +44 -2
  6. package/dist/agents/agents.service.js.map +1 -1
  7. package/dist/agents/dto/patch-agent.dto.d.ts +7 -1
  8. package/dist/agents/dto/patch-agent.dto.js +73 -1
  9. package/dist/agents/dto/patch-agent.dto.js.map +1 -1
  10. package/dist/agents/dto/service/agents.service.types.d.ts +7 -1
  11. package/dist/app-init/agent/prompts.d.ts +2 -1
  12. package/dist/app-init/agent/prompts.js +22 -7
  13. package/dist/app-init/agent/prompts.js.map +1 -1
  14. package/dist/app-init/agent/taico.agent.d.ts +2 -0
  15. package/dist/app-init/agent/taico.agent.js +18 -0
  16. package/dist/app-init/agent/taico.agent.js.map +1 -0
  17. package/dist/app-init/app-init.runner.js +40 -11
  18. package/dist/app-init/app-init.runner.js.map +1 -1
  19. package/dist/app-init/mcp/context.mcp.js +1 -0
  20. package/dist/app-init/mcp/context.mcp.js.map +1 -1
  21. package/dist/app-init/mcp/elen.mcp.d.ts +2 -0
  22. package/dist/app-init/mcp/elen.mcp.js +12 -0
  23. package/dist/app-init/mcp/elen.mcp.js.map +1 -0
  24. package/dist/app-init/mcp/playwright.mcp.d.ts +2 -0
  25. package/dist/app-init/mcp/playwright.mcp.js +14 -0
  26. package/dist/app-init/mcp/playwright.mcp.js.map +1 -0
  27. package/dist/app-init/mcp/tasks.mcp.js +1 -0
  28. package/dist/app-init/mcp/tasks.mcp.js.map +1 -1
  29. package/dist/app.module.js +29 -1
  30. package/dist/app.module.js.map +1 -1
  31. package/dist/auth/core/scopes/all-api.scopes.js +2 -0
  32. package/dist/auth/core/scopes/all-api.scopes.js.map +1 -1
  33. package/dist/auth-journeys/entities/connection-authorization-flow.entity.js +4 -4
  34. package/dist/auth-journeys/entities/connection-authorization-flow.entity.js.map +1 -1
  35. package/dist/authorization-server/authorization.controller.js +26 -1
  36. package/dist/authorization-server/authorization.controller.js.map +1 -1
  37. package/dist/authorization-server/dto/authorization-request.dto.d.ts +1 -1
  38. package/dist/authorization-server/dto/authorization-request.dto.js +2 -2
  39. package/dist/authorization-server/dto/authorization-request.dto.js.map +1 -1
  40. package/dist/authorization-server/dto/authorization-request.dto.spec.d.ts +1 -0
  41. package/dist/authorization-server/dto/authorization-request.dto.spec.js +30 -0
  42. package/dist/authorization-server/dto/authorization-request.dto.spec.js.map +1 -0
  43. package/dist/authorization-server/dto/introspect-token-response.dto.d.ts +10 -10
  44. package/dist/authorization-server/dto/introspect-token-response.dto.js +21 -21
  45. package/dist/authorization-server/dto/introspect-token-response.dto.js.map +1 -1
  46. package/dist/authorization-server/dto/onboarding-request.dto.d.ts +6 -0
  47. package/dist/authorization-server/dto/onboarding-request.dto.js +57 -0
  48. package/dist/authorization-server/dto/onboarding-request.dto.js.map +1 -0
  49. package/dist/authorization-server/dto/onboarding-status-response.dto.d.ts +3 -0
  50. package/dist/authorization-server/dto/onboarding-status-response.dto.js +25 -0
  51. package/dist/authorization-server/dto/onboarding-status-response.dto.js.map +1 -0
  52. package/dist/authorization-server/dto/service/token.service.types.d.ts +26 -0
  53. package/dist/authorization-server/dto/service/token.service.types.js +3 -0
  54. package/dist/authorization-server/dto/service/token.service.types.js.map +1 -0
  55. package/dist/authorization-server/dto/user-response.dto.d.ts +1 -0
  56. package/dist/authorization-server/dto/user-response.dto.js +8 -0
  57. package/dist/authorization-server/dto/user-response.dto.js.map +1 -1
  58. package/dist/authorization-server/issued-access-token.service.d.ts +28 -0
  59. package/dist/authorization-server/issued-access-token.service.js +62 -19
  60. package/dist/authorization-server/issued-access-token.service.js.map +1 -1
  61. package/dist/authorization-server/token.service.d.ts +2 -3
  62. package/dist/authorization-server/token.service.js +6 -6
  63. package/dist/authorization-server/token.service.js.map +1 -1
  64. package/dist/authorization-server/web-auth.controller.d.ts +7 -0
  65. package/dist/authorization-server/web-auth.controller.js +129 -0
  66. package/dist/authorization-server/web-auth.controller.js.map +1 -1
  67. package/dist/common/utils/keyed-debounce-batch-processor.util.d.ts +17 -0
  68. package/dist/common/utils/keyed-debounce-batch-processor.util.js +76 -0
  69. package/dist/common/utils/keyed-debounce-batch-processor.util.js.map +1 -0
  70. package/dist/config/env.config.d.ts +6 -0
  71. package/dist/config/env.config.js +28 -0
  72. package/dist/config/env.config.js.map +1 -1
  73. package/dist/context/context.gateway.d.ts +15 -3
  74. package/dist/context/context.gateway.js +45 -9
  75. package/dist/context/context.gateway.js.map +1 -1
  76. package/dist/context/context.mcp.gateway.d.ts +3 -1
  77. package/dist/context/context.mcp.gateway.js +108 -28
  78. package/dist/context/context.mcp.gateway.js.map +1 -1
  79. package/dist/context/context.service.js +2 -0
  80. package/dist/context/context.service.js.map +1 -1
  81. package/dist/discovery/discovery.service.js +7 -0
  82. package/dist/discovery/discovery.service.js.map +1 -1
  83. package/dist/errors/http/error-catalog.js +84 -0
  84. package/dist/errors/http/error-catalog.js.map +1 -1
  85. package/dist/identity-provider/dto/actor-response.dto.d.ts +2 -0
  86. package/dist/identity-provider/dto/actor-response.dto.js +10 -0
  87. package/dist/identity-provider/dto/actor-response.dto.js.map +1 -1
  88. package/dist/identity-provider/errors/identity-provider.errors.d.ts +38 -0
  89. package/dist/identity-provider/errors/identity-provider.errors.js +70 -0
  90. package/dist/identity-provider/errors/identity-provider.errors.js.map +1 -0
  91. package/dist/identity-provider/identity-provider.service.d.ts +3 -0
  92. package/dist/identity-provider/identity-provider.service.js +71 -4
  93. package/dist/identity-provider/identity-provider.service.js.map +1 -1
  94. package/dist/identity-provider/user.entity.d.ts +1 -0
  95. package/dist/identity-provider/user.entity.js +5 -0
  96. package/dist/identity-provider/user.entity.js.map +1 -1
  97. package/dist/llm/llm.module.d.ts +2 -0
  98. package/dist/llm/llm.module.js +21 -0
  99. package/dist/llm/llm.module.js.map +1 -0
  100. package/dist/llm/openai-responses.service.d.ts +9 -0
  101. package/dist/llm/openai-responses.service.js +51 -0
  102. package/dist/llm/openai-responses.service.js.map +1 -0
  103. package/dist/mcp-registry/dto/create-server.dto.d.ts +4 -0
  104. package/dist/mcp-registry/dto/create-server.dto.js +39 -1
  105. package/dist/mcp-registry/dto/create-server.dto.js.map +1 -1
  106. package/dist/mcp-registry/dto/index.d.ts +1 -0
  107. package/dist/mcp-registry/dto/index.js +1 -0
  108. package/dist/mcp-registry/dto/index.js.map +1 -1
  109. package/dist/mcp-registry/dto/server-response.dto.d.ts +4 -0
  110. package/dist/mcp-registry/dto/server-response.dto.js +29 -0
  111. package/dist/mcp-registry/dto/server-response.dto.js.map +1 -1
  112. package/dist/mcp-registry/dto/service/mcp-registry.service.types.d.ts +27 -3
  113. package/dist/mcp-registry/dto/update-server.dto.d.ts +4 -0
  114. package/dist/mcp-registry/dto/update-server.dto.js +40 -0
  115. package/dist/mcp-registry/dto/update-server.dto.js.map +1 -1
  116. package/dist/mcp-registry/entities/mcp-server.entity.d.ts +4 -0
  117. package/dist/mcp-registry/entities/mcp-server.entity.js +17 -1
  118. package/dist/mcp-registry/entities/mcp-server.entity.js.map +1 -1
  119. package/dist/mcp-registry/errors/mcp-registry.errors.d.ts +4 -0
  120. package/dist/mcp-registry/errors/mcp-registry.errors.js +8 -1
  121. package/dist/mcp-registry/errors/mcp-registry.errors.js.map +1 -1
  122. package/dist/mcp-registry/mcp-registry.controller.js +12 -1
  123. package/dist/mcp-registry/mcp-registry.controller.js.map +1 -1
  124. package/dist/mcp-registry/mcp-registry.service.d.ts +2 -0
  125. package/dist/mcp-registry/mcp-registry.service.js +86 -10
  126. package/dist/mcp-registry/mcp-registry.service.js.map +1 -1
  127. package/dist/mcp-registry/mcp-server.types.d.ts +4 -0
  128. package/dist/mcp-registry/mcp-server.types.js +7 -0
  129. package/dist/mcp-registry/mcp-server.types.js.map +1 -0
  130. package/dist/meta/dto/create-project.dto.js +3 -2
  131. package/dist/meta/dto/create-project.dto.js.map +1 -1
  132. package/dist/meta/dto/patch-project.dto.js +3 -2
  133. package/dist/meta/dto/patch-project.dto.js.map +1 -1
  134. package/dist/meta/meta.module.js +2 -1
  135. package/dist/meta/meta.module.js.map +1 -1
  136. package/dist/meta/meta.service.d.ts +5 -1
  137. package/dist/meta/meta.service.js +63 -6
  138. package/dist/meta/meta.service.js.map +1 -1
  139. package/dist/meta/tag-usage.entity.d.ts +10 -0
  140. package/dist/meta/tag-usage.entity.js +58 -0
  141. package/dist/meta/tag-usage.entity.js.map +1 -0
  142. package/dist/meta/validators/is-git-url.validator.d.ts +6 -0
  143. package/dist/meta/validators/is-git-url.validator.js +47 -0
  144. package/dist/meta/validators/is-git-url.validator.js.map +1 -0
  145. package/dist/meta/validators/is-git-url.validator.spec.d.ts +1 -0
  146. package/dist/meta/validators/is-git-url.validator.spec.js +73 -0
  147. package/dist/meta/validators/is-git-url.validator.spec.js.map +1 -0
  148. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.d.ts +6 -0
  149. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.js +46 -0
  150. package/dist/migrations/1700000000001-AlignConnectionAuthFlowColumns.js.map +1 -0
  151. package/dist/migrations/{1700000000001-UpdateAgentTypeConstraint.d.ts → 1700000000002-UpdateAgentTypeConstraint.d.ts} +1 -1
  152. package/dist/migrations/{1700000000001-UpdateAgentTypeConstraint.js → 1700000000002-UpdateAgentTypeConstraint.js} +5 -5
  153. package/dist/migrations/{1700000000001-UpdateAgentTypeConstraint.js.map → 1700000000002-UpdateAgentTypeConstraint.js.map} +1 -1
  154. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.d.ts +5 -0
  155. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.js +60 -0
  156. package/dist/migrations/1739500000000-AddTaskBlueprintsAndScheduledTasks.js.map +1 -0
  157. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.d.ts +6 -0
  158. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.js +109 -0
  159. package/dist/migrations/1739750000000-RefactorThreadsForHeadlessConversations.js.map +1 -0
  160. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.d.ts +6 -0
  161. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.js +61 -0
  162. package/dist/migrations/1739844333000-RemoveRoleFromThreadMessage.js.map +1 -0
  163. package/dist/migrations/1740000000000-AddSecretsTable.d.ts +5 -0
  164. package/dist/migrations/1740000000000-AddSecretsTable.js +32 -0
  165. package/dist/migrations/1740000000000-AddSecretsTable.js.map +1 -0
  166. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.d.ts +5 -0
  167. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.js +52 -0
  168. package/dist/migrations/1740500000000-AddMcpServerTransportConfig.js.map +1 -0
  169. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.d.ts +6 -0
  170. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.js +52 -0
  171. package/dist/migrations/1741000000000-AddChatSessionIdToThreads.js.map +1 -0
  172. package/dist/migrations/1741100000000-AddTagUsageTable.d.ts +6 -0
  173. package/dist/migrations/1741100000000-AddTagUsageTable.js +67 -0
  174. package/dist/migrations/1741100000000-AddTagUsageTable.js.map +1 -0
  175. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.d.ts +5 -0
  176. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.js +69 -0
  177. package/dist/migrations/1741200000000-McpServerProvidedIdPartialUniqueIndex.js.map +1 -0
  178. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.d.ts +6 -0
  179. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.js +43 -0
  180. package/dist/migrations/1741300000000-AddHasSeenWalkthroughToUsers.js.map +1 -0
  181. package/dist/public/assets/index-DlrnfsdV.js +14 -0
  182. package/dist/public/assets/index-KcLmbe3v.css +1 -0
  183. package/dist/public/beta/assets/index-BeS9PvAQ.js +85 -0
  184. package/dist/public/beta/index.html +1 -1
  185. package/dist/public/index.html +2 -2
  186. package/dist/secrets/dto/http/create-secret.dto.d.ts +5 -0
  187. package/dist/secrets/dto/http/create-secret.dto.js +50 -0
  188. package/dist/secrets/dto/http/create-secret.dto.js.map +1 -0
  189. package/dist/secrets/dto/http/secret-params.dto.d.ts +3 -0
  190. package/dist/secrets/dto/http/secret-params.dto.js +27 -0
  191. package/dist/secrets/dto/http/secret-params.dto.js.map +1 -0
  192. package/dist/secrets/dto/http/secret-response.dto.d.ts +15 -0
  193. package/dist/secrets/dto/http/secret-response.dto.js +112 -0
  194. package/dist/secrets/dto/http/secret-response.dto.js.map +1 -0
  195. package/dist/secrets/dto/http/update-secret.dto.d.ts +5 -0
  196. package/dist/secrets/dto/http/update-secret.dto.js +54 -0
  197. package/dist/secrets/dto/http/update-secret.dto.js.map +1 -0
  198. package/dist/secrets/dto/service/secrets.service.types.d.ts +26 -0
  199. package/dist/secrets/dto/service/secrets.service.types.js +3 -0
  200. package/dist/secrets/dto/service/secrets.service.types.js.map +1 -0
  201. package/dist/secrets/errors/secrets.errors.d.ts +21 -0
  202. package/dist/secrets/errors/secrets.errors.js +43 -0
  203. package/dist/secrets/errors/secrets.errors.js.map +1 -0
  204. package/dist/secrets/secret.entity.d.ts +14 -0
  205. package/dist/secrets/secret.entity.js +75 -0
  206. package/dist/secrets/secret.entity.js.map +1 -0
  207. package/dist/secrets/secrets-encryption.service.d.ts +8 -0
  208. package/dist/secrets/secrets-encryption.service.js +130 -0
  209. package/dist/secrets/secrets-encryption.service.js.map +1 -0
  210. package/dist/secrets/secrets.controller.d.ts +18 -0
  211. package/dist/secrets/secrets.controller.js +160 -0
  212. package/dist/secrets/secrets.controller.js.map +1 -0
  213. package/dist/secrets/secrets.module.d.ts +2 -0
  214. package/dist/secrets/secrets.module.js +31 -0
  215. package/dist/secrets/secrets.module.js.map +1 -0
  216. package/dist/secrets/secrets.scopes.d.ts +16 -0
  217. package/dist/secrets/secrets.scopes.js +19 -0
  218. package/dist/secrets/secrets.scopes.js.map +1 -0
  219. package/dist/secrets/secrets.service.d.ts +17 -0
  220. package/dist/secrets/secrets.service.js +147 -0
  221. package/dist/secrets/secrets.service.js.map +1 -0
  222. package/dist/task-blueprints/dto/create-scheduled-task.dto.d.ts +5 -0
  223. package/dist/task-blueprints/dto/create-scheduled-task.dto.js +49 -0
  224. package/dist/task-blueprints/dto/create-scheduled-task.dto.js.map +1 -0
  225. package/dist/task-blueprints/dto/create-task-blueprint.dto.d.ts +7 -0
  226. package/dist/task-blueprints/dto/create-task-blueprint.dto.js +72 -0
  227. package/dist/task-blueprints/dto/create-task-blueprint.dto.js.map +1 -0
  228. package/dist/task-blueprints/dto/list-scheduled-tasks-query.dto.d.ts +5 -0
  229. package/dist/task-blueprints/dto/list-scheduled-tasks-query.dto.js +62 -0
  230. package/dist/task-blueprints/dto/list-scheduled-tasks-query.dto.js.map +1 -0
  231. package/dist/task-blueprints/dto/list-task-blueprints-query.dto.d.ts +4 -0
  232. package/dist/task-blueprints/dto/list-task-blueprints-query.dto.js +45 -0
  233. package/dist/task-blueprints/dto/list-task-blueprints-query.dto.js.map +1 -0
  234. package/dist/task-blueprints/dto/scheduled-task-list-response.dto.d.ts +9 -0
  235. package/dist/task-blueprints/dto/scheduled-task-list-response.dto.js +58 -0
  236. package/dist/task-blueprints/dto/scheduled-task-list-response.dto.js.map +1 -0
  237. package/dist/task-blueprints/dto/scheduled-task-params.dto.d.ts +3 -0
  238. package/dist/task-blueprints/dto/scheduled-task-params.dto.js +27 -0
  239. package/dist/task-blueprints/dto/scheduled-task-params.dto.js.map +1 -0
  240. package/dist/task-blueprints/dto/scheduled-task-response.dto.d.ts +15 -0
  241. package/dist/task-blueprints/dto/scheduled-task-response.dto.js +115 -0
  242. package/dist/task-blueprints/dto/scheduled-task-response.dto.js.map +1 -0
  243. package/dist/task-blueprints/dto/service/scheduled-tasks.service.types.d.ts +34 -0
  244. package/dist/task-blueprints/dto/service/scheduled-tasks.service.types.js +3 -0
  245. package/dist/task-blueprints/dto/service/scheduled-tasks.service.types.js.map +1 -0
  246. package/dist/task-blueprints/dto/service/task-blueprints.service.types.d.ts +41 -0
  247. package/dist/task-blueprints/dto/service/task-blueprints.service.types.js +3 -0
  248. package/dist/task-blueprints/dto/service/task-blueprints.service.types.js.map +1 -0
  249. package/dist/task-blueprints/dto/task-blueprint-list-response.dto.d.ts +9 -0
  250. package/dist/task-blueprints/dto/task-blueprint-list-response.dto.js +58 -0
  251. package/dist/task-blueprints/dto/task-blueprint-list-response.dto.js.map +1 -0
  252. package/dist/task-blueprints/dto/task-blueprint-params.dto.d.ts +3 -0
  253. package/dist/task-blueprints/dto/task-blueprint-params.dto.js +27 -0
  254. package/dist/task-blueprints/dto/task-blueprint-params.dto.js.map +1 -0
  255. package/dist/task-blueprints/dto/task-blueprint-response.dto.d.ts +17 -0
  256. package/dist/task-blueprints/dto/task-blueprint-response.dto.js +127 -0
  257. package/dist/task-blueprints/dto/task-blueprint-response.dto.js.map +1 -0
  258. package/dist/task-blueprints/dto/update-scheduled-task.dto.d.ts +4 -0
  259. package/dist/task-blueprints/dto/update-scheduled-task.dto.js +38 -0
  260. package/dist/task-blueprints/dto/update-scheduled-task.dto.js.map +1 -0
  261. package/dist/task-blueprints/dto/update-task-blueprint.dto.d.ts +7 -0
  262. package/dist/task-blueprints/dto/update-task-blueprint.dto.js +73 -0
  263. package/dist/task-blueprints/dto/update-task-blueprint.dto.js.map +1 -0
  264. package/dist/task-blueprints/errors/task-blueprints.errors.d.ts +16 -0
  265. package/dist/task-blueprints/errors/task-blueprints.errors.js +37 -0
  266. package/dist/task-blueprints/errors/task-blueprints.errors.js.map +1 -0
  267. package/dist/task-blueprints/scheduled-task.entity.d.ts +14 -0
  268. package/dist/task-blueprints/scheduled-task.entity.js +79 -0
  269. package/dist/task-blueprints/scheduled-task.entity.js.map +1 -0
  270. package/dist/task-blueprints/scheduled-tasks.controller.d.ts +16 -0
  271. package/dist/task-blueprints/scheduled-tasks.controller.js +144 -0
  272. package/dist/task-blueprints/scheduled-tasks.controller.js.map +1 -0
  273. package/dist/task-blueprints/scheduled-tasks.service.d.ts +24 -0
  274. package/dist/task-blueprints/scheduled-tasks.service.js +258 -0
  275. package/dist/task-blueprints/scheduled-tasks.service.js.map +1 -0
  276. package/dist/task-blueprints/task-blueprint.entity.d.ts +19 -0
  277. package/dist/task-blueprints/task-blueprint.entity.js +107 -0
  278. package/dist/task-blueprints/task-blueprint.entity.js.map +1 -0
  279. package/dist/task-blueprints/task-blueprints.controller.d.ts +19 -0
  280. package/dist/task-blueprints/task-blueprints.controller.js +169 -0
  281. package/dist/task-blueprints/task-blueprints.controller.js.map +1 -0
  282. package/dist/task-blueprints/task-blueprints.module.d.ts +2 -0
  283. package/dist/task-blueprints/task-blueprints.module.js +44 -0
  284. package/dist/task-blueprints/task-blueprints.module.js.map +1 -0
  285. package/dist/task-blueprints/task-blueprints.service.d.ts +30 -0
  286. package/dist/task-blueprints/task-blueprints.service.js +286 -0
  287. package/dist/task-blueprints/task-blueprints.service.js.map +1 -0
  288. package/dist/task-blueprints/task-scheduler.service.d.ts +9 -0
  289. package/dist/task-blueprints/task-scheduler.service.js +99 -0
  290. package/dist/task-blueprints/task-scheduler.service.js.map +1 -0
  291. package/dist/tasks/dto/service/tasks.service.types.d.ts +2 -0
  292. package/dist/tasks/tasks.controller.d.ts +1 -1
  293. package/dist/tasks/tasks.controller.js +23 -11
  294. package/dist/tasks/tasks.controller.js.map +1 -1
  295. package/dist/tasks/tasks.mcp.gateway.d.ts +3 -1
  296. package/dist/tasks/tasks.mcp.gateway.js +204 -50
  297. package/dist/tasks/tasks.mcp.gateway.js.map +1 -1
  298. package/dist/tasks/tasks.service.js +24 -0
  299. package/dist/tasks/tasks.service.js.map +1 -1
  300. package/dist/threads/chat.service.d.ts +35 -0
  301. package/dist/threads/chat.service.js +222 -0
  302. package/dist/threads/chat.service.js.map +1 -0
  303. package/dist/threads/dto/create-thread-message.dto.d.ts +3 -0
  304. package/dist/threads/dto/create-thread-message.dto.js +27 -0
  305. package/dist/threads/dto/create-thread-message.dto.js.map +1 -0
  306. package/dist/threads/dto/create-thread.dto.d.ts +1 -1
  307. package/dist/threads/dto/create-thread.dto.js +3 -2
  308. package/dist/threads/dto/create-thread.dto.js.map +1 -1
  309. package/dist/threads/dto/list-thread-messages-query.dto.d.ts +4 -0
  310. package/dist/threads/dto/list-thread-messages-query.dto.js +49 -0
  311. package/dist/threads/dto/list-thread-messages-query.dto.js.map +1 -0
  312. package/dist/threads/dto/list-thread-messages-response.dto.d.ts +9 -0
  313. package/dist/threads/dto/list-thread-messages-response.dto.js +58 -0
  314. package/dist/threads/dto/list-thread-messages-response.dto.js.map +1 -0
  315. package/dist/threads/dto/service/threads.service.types.d.ts +28 -2
  316. package/dist/threads/dto/thread-list-item-response.dto.d.ts +1 -0
  317. package/dist/threads/dto/thread-list-item-response.dto.js +10 -0
  318. package/dist/threads/dto/thread-list-item-response.dto.js.map +1 -1
  319. package/dist/threads/dto/thread-message-response.dto.d.ts +14 -0
  320. package/dist/threads/dto/thread-message-response.dto.js +103 -0
  321. package/dist/threads/dto/thread-message-response.dto.js.map +1 -0
  322. package/dist/threads/dto/thread-response.dto.d.ts +2 -1
  323. package/dist/threads/dto/thread-response.dto.js +16 -3
  324. package/dist/threads/dto/thread-response.dto.js.map +1 -1
  325. package/dist/threads/dto/update-thread.dto.js.map +1 -1
  326. package/dist/threads/events/threads.events.d.ts +56 -0
  327. package/dist/threads/events/threads.events.js +67 -0
  328. package/dist/threads/events/threads.events.js.map +1 -0
  329. package/dist/threads/openai-mcp-server-factory.service.d.ts +8 -0
  330. package/dist/threads/openai-mcp-server-factory.service.js +114 -0
  331. package/dist/threads/openai-mcp-server-factory.service.js.map +1 -0
  332. package/dist/threads/thread-message.entity.d.ts +11 -0
  333. package/dist/threads/thread-message.entity.js +59 -0
  334. package/dist/threads/thread-message.entity.js.map +1 -0
  335. package/dist/threads/thread-state-reconciler.service.d.ts +26 -0
  336. package/dist/threads/thread-state-reconciler.service.js +250 -0
  337. package/dist/threads/thread-state-reconciler.service.js.map +1 -0
  338. package/dist/threads/thread-title.service.d.ts +11 -0
  339. package/dist/threads/thread-title.service.js +75 -0
  340. package/dist/threads/thread-title.service.js.map +1 -0
  341. package/dist/threads/thread.entity.d.ts +4 -1
  342. package/dist/threads/thread.entity.js +13 -2
  343. package/dist/threads/thread.entity.js.map +1 -1
  344. package/dist/threads/threads-state.service.spec.js +1 -0
  345. package/dist/threads/threads-state.service.spec.js.map +1 -1
  346. package/dist/threads/threads.controller.d.ts +7 -0
  347. package/dist/threads/threads.controller.js +72 -0
  348. package/dist/threads/threads.controller.js.map +1 -1
  349. package/dist/threads/threads.gateway.d.ts +34 -0
  350. package/dist/threads/threads.gateway.js +224 -0
  351. package/dist/threads/threads.gateway.js.map +1 -0
  352. package/dist/threads/threads.module.js +21 -1
  353. package/dist/threads/threads.module.js.map +1 -1
  354. package/dist/threads/threads.service.d.ts +34 -3
  355. package/dist/threads/threads.service.js +282 -19
  356. package/dist/threads/threads.service.js.map +1 -1
  357. package/dist/threads/threads.service.spec.js +2 -0
  358. package/dist/threads/threads.service.spec.js.map +1 -1
  359. package/dist/tsconfig.tsbuildinfo +1 -1
  360. package/package.json +11 -8
  361. package/dist/public/assets/index-BCPnRhO0.js +0 -11
  362. package/dist/public/assets/index-_FDBdUKK.css +0 -1
  363. package/dist/public/beta/assets/index-S66NF8rC.js +0 -85
@@ -1,85 +0,0 @@
1
- var sx=Object.defineProperty;var id=e=>{throw TypeError(e)};var lx=(e,t,n)=>t in e?sx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yr=(e,t,n)=>lx(e,typeof t!="symbol"?t+"":t,n),od=(e,t,n)=>t.has(e)||id("Cannot "+n);var le=(e,t,n)=>(od(e,t,"read from private field"),n?n.call(e):t.get(e)),xn=(e,t,n)=>t.has(e)?id("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tt=(e,t,n,r)=>(od(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wh={exports:{}},Us={},Vh={exports:{}},ee={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 so=Symbol.for("react.element"),ax=Symbol.for("react.portal"),ux=Symbol.for("react.fragment"),cx=Symbol.for("react.strict_mode"),dx=Symbol.for("react.profiler"),fx=Symbol.for("react.provider"),hx=Symbol.for("react.context"),px=Symbol.for("react.forward_ref"),mx=Symbol.for("react.suspense"),gx=Symbol.for("react.memo"),yx=Symbol.for("react.lazy"),sd=Symbol.iterator;function xx(e){return e===null||typeof e!="object"?null:(e=sd&&e[sd]||e["@@iterator"],typeof e=="function"?e:null)}var qh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Gh=Object.assign,Kh={};function Qr(e,t,n){this.props=e,this.context=t,this.refs=Kh,this.updater=n||qh}Qr.prototype.isReactComponent={};Qr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Qr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qh(){}Qh.prototype=Qr.prototype;function Nu(e,t,n){this.props=e,this.context=t,this.refs=Kh,this.updater=n||qh}var Tu=Nu.prototype=new Qh;Tu.constructor=Nu;Gh(Tu,Qr.prototype);Tu.isPureReactComponent=!0;var ld=Array.isArray,Yh=Object.prototype.hasOwnProperty,ju={current:null},Xh={key:!0,ref:!0,__self:!0,__source:!0};function Jh(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)Yh.call(t,r)&&!Xh.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:so,type:e,key:o,ref:s,props:i,_owner:ju.current}}function vx(e,t){return{$$typeof:so,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _u(e){return typeof e=="object"&&e!==null&&e.$$typeof===so}function kx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ad=/\/+/g;function gl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kx(""+e.key):t.toString(36)}function qo(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case so:case ax:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+gl(s,0):r,ld(i)?(n="",e!=null&&(n=e.replace(ad,"$&/")+"/"),qo(i,t,n,"",function(c){return c})):i!=null&&(_u(i)&&(i=vx(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(ad,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",ld(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+gl(o,l);s+=qo(o,t,n,u,i)}else if(u=xx(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+gl(o,l++),s+=qo(o,t,n,u,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ko(e,t,n){if(e==null)return e;var r=[],i=0;return qo(e,r,"","",function(o){return t.call(n,o,i++)}),r}function wx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qe={current:null},Go={transition:null},Sx={ReactCurrentDispatcher:qe,ReactCurrentBatchConfig:Go,ReactCurrentOwner:ju};function Zh(){throw Error("act(...) is not supported in production builds of React.")}ee.Children={map:ko,forEach:function(e,t,n){ko(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ko(e,function(){t++}),t},toArray:function(e){return ko(e,function(t){return t})||[]},only:function(e){if(!_u(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ee.Component=Qr;ee.Fragment=ux;ee.Profiler=dx;ee.PureComponent=Nu;ee.StrictMode=cx;ee.Suspense=mx;ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sx;ee.act=Zh;ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Gh({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=ju.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Yh.call(t,u)&&!Xh.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:so,type:e.type,key:i,ref:o,props:r,_owner:s}};ee.createContext=function(e){return e={$$typeof:hx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:fx,_context:e},e.Consumer=e};ee.createElement=Jh;ee.createFactory=function(e){var t=Jh.bind(null,e);return t.type=e,t};ee.createRef=function(){return{current:null}};ee.forwardRef=function(e){return{$$typeof:px,render:e}};ee.isValidElement=_u;ee.lazy=function(e){return{$$typeof:yx,_payload:{_status:-1,_result:e},_init:wx}};ee.memo=function(e,t){return{$$typeof:gx,type:e,compare:t===void 0?null:t}};ee.startTransition=function(e){var t=Go.transition;Go.transition={};try{e()}finally{Go.transition=t}};ee.unstable_act=Zh;ee.useCallback=function(e,t){return qe.current.useCallback(e,t)};ee.useContext=function(e){return qe.current.useContext(e)};ee.useDebugValue=function(){};ee.useDeferredValue=function(e){return qe.current.useDeferredValue(e)};ee.useEffect=function(e,t){return qe.current.useEffect(e,t)};ee.useId=function(){return qe.current.useId()};ee.useImperativeHandle=function(e,t,n){return qe.current.useImperativeHandle(e,t,n)};ee.useInsertionEffect=function(e,t){return qe.current.useInsertionEffect(e,t)};ee.useLayoutEffect=function(e,t){return qe.current.useLayoutEffect(e,t)};ee.useMemo=function(e,t){return qe.current.useMemo(e,t)};ee.useReducer=function(e,t,n){return qe.current.useReducer(e,t,n)};ee.useRef=function(e){return qe.current.useRef(e)};ee.useState=function(e){return qe.current.useState(e)};ee.useSyncExternalStore=function(e,t,n){return qe.current.useSyncExternalStore(e,t,n)};ee.useTransition=function(){return qe.current.useTransition()};ee.version="18.3.1";Vh.exports=ee;var k=Vh.exports;/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Cx=k,Ex=Symbol.for("react.element"),bx=Symbol.for("react.fragment"),Nx=Object.prototype.hasOwnProperty,Tx=Cx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jx={key:!0,ref:!0,__self:!0,__source:!0};function ep(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Nx.call(t,r)&&!jx.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Ex,type:e,key:o,ref:s,props:i,_owner:Tx.current}}Us.Fragment=bx;Us.jsx=ep;Us.jsxs=ep;Wh.exports=Us;var a=Wh.exports,tp={exports:{}},dt={},np={exports:{}},rp={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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
- */(function(e){function t(C,B){var w=C.length;C.push(B);e:for(;0<w;){var J=w-1>>>1,se=C[J];if(0<i(se,B))C[J]=B,C[w]=se,w=J;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var B=C[0],w=C.pop();if(w!==B){C[0]=w;e:for(var J=0,se=C.length,N=se>>>1;J<N;){var Se=2*(J+1)-1,nt=C[Se],ue=Se+1,mt=C[ue];if(0>i(nt,w))ue<se&&0>i(mt,nt)?(C[J]=mt,C[ue]=w,J=ue):(C[J]=nt,C[Se]=w,J=Se);else if(ue<se&&0>i(mt,w))C[J]=mt,C[ue]=w,J=ue;else break e}}return B}function i(C,B){var w=C.sortIndex-B.sortIndex;return w!==0?w:C.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],c=[],f=1,d=null,h=3,p=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=C)r(c),B.sortIndex=B.expirationTime,t(u,B);else break;B=n(c)}}function T(C){if(v=!1,x(C),!g)if(n(u)!==null)g=!0,O(j);else{var B=n(c);B!==null&&L(T,B.startTime-C)}}function j(C,B){g=!1,v&&(v=!1,y(D),D=-1),p=!0;var w=h;try{for(x(B),d=n(u);d!==null&&(!(d.expirationTime>B)||C&&!P());){var J=d.callback;if(typeof J=="function"){d.callback=null,h=d.priorityLevel;var se=J(d.expirationTime<=B);B=e.unstable_now(),typeof se=="function"?d.callback=se:d===n(u)&&r(u),x(B)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var Se=n(c);Se!==null&&L(T,Se.startTime-B),N=!1}return N}finally{d=null,h=w,p=!1}}var E=!1,_=null,D=-1,R=5,b=-1;function P(){return!(e.unstable_now()-b<R)}function q(){if(_!==null){var C=e.unstable_now();b=C;var B=!0;try{B=_(!0,C)}finally{B?V():(E=!1,_=null)}}else E=!1}var V;if(typeof m=="function")V=function(){m(q)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,G=H.port2;H.port1.onmessage=q,V=function(){G.postMessage(null)}}else V=function(){S(q,0)};function O(C){_=C,E||(E=!0,V())}function L(C,B){D=S(function(){C(e.unstable_now())},B)}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(C){C.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,O(j))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var B=3;break;default:B=h}var w=h;h=B;try{return C()}finally{h=w}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,B){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var w=h;h=C;try{return B()}finally{h=w}},e.unstable_scheduleCallback=function(C,B,w){var J=e.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?J+w:J):w=J,C){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=w+se,C={id:f++,callback:B,priorityLevel:C,startTime:w,expirationTime:se,sortIndex:-1},w>J?(C.sortIndex=w,t(c,C),n(u)===null&&C===n(c)&&(v?(y(D),D=-1):v=!0,L(T,w-J))):(C.sortIndex=se,t(u,C),g||p||(g=!0,O(j))),C},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(C){var B=h;return function(){var w=h;h=B;try{return C.apply(this,arguments)}finally{h=w}}}})(rp);np.exports=rp;var _x=np.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Ix=k,ut=_x;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ip=new Set,zi={};function cr(e,t){Ur(e,t),Ur(e+"Capture",t)}function Ur(e,t){for(zi[e]=t,e=0;e<t.length;e++)ip.add(t[e])}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),da=Object.prototype.hasOwnProperty,Ax=/^[: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]*$/,ud={},cd={};function Rx(e){return da.call(cd,e)?!0:da.call(ud,e)?!1:Ax.test(e)?cd[e]=!0:(ud[e]=!0,!1)}function Px(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Dx(e,t,n,r){if(t===null||typeof t>"u"||Px(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ge(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Ge(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Ge(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Ge(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Ge(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Le[e]=new Ge(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Ge(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Ge(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Ge(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iu=/[\-:]([a-z])/g;function Au(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Iu,Au);Le[t]=new Ge(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Iu,Au);Le[t]=new Ge(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Iu,Au);Le[t]=new Ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Ge(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Ge(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ru(e,t,n,r){var i=Le.hasOwnProperty(t)?Le[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Dx(t,n,i,r)&&(n=null),r||i===null?Rx(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var pn=Ix.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wo=Symbol.for("react.element"),wr=Symbol.for("react.portal"),Sr=Symbol.for("react.fragment"),Pu=Symbol.for("react.strict_mode"),fa=Symbol.for("react.profiler"),op=Symbol.for("react.provider"),sp=Symbol.for("react.context"),Du=Symbol.for("react.forward_ref"),ha=Symbol.for("react.suspense"),pa=Symbol.for("react.suspense_list"),Lu=Symbol.for("react.memo"),wn=Symbol.for("react.lazy"),lp=Symbol.for("react.offscreen"),dd=Symbol.iterator;function si(e){return e===null||typeof e!="object"?null:(e=dd&&e[dd]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,yl;function vi(e){if(yl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yl=t&&t[1]||""}return`
34
- `+yl+e}var xl=!1;function vl(e,t){if(!e||xl)return"";xl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
- `),o=r.stack.split(`
36
- `),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==o[l]){var u=`
37
- `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{xl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vi(e):""}function Lx(e){switch(e.tag){case 5:return vi(e.type);case 16:return vi("Lazy");case 13:return vi("Suspense");case 19:return vi("SuspenseList");case 0:case 2:case 15:return e=vl(e.type,!1),e;case 11:return e=vl(e.type.render,!1),e;case 1:return e=vl(e.type,!0),e;default:return""}}function ma(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sr:return"Fragment";case wr:return"Portal";case fa:return"Profiler";case Pu:return"StrictMode";case ha:return"Suspense";case pa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sp:return(e.displayName||"Context")+".Consumer";case op:return(e._context.displayName||"Context")+".Provider";case Du:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lu:return t=e.displayName||null,t!==null?t:ma(e.type)||"Memo";case wn:t=e._payload,e=e._init;try{return ma(e(t))}catch{}}return null}function Ox(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ma(t);case 8:return t===Pu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fx(e){var t=ap(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function So(e){e._valueTracker||(e._valueTracker=Fx(e))}function up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ap(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ga(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Mn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function cp(e,t){t=t.checked,t!=null&&Ru(e,"checked",t,!1)}function ya(e,t){cp(e,t);var n=Mn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xa(e,t.type,n):t.hasOwnProperty("defaultValue")&&xa(e,t.type,Mn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function xa(e,t,n){(t!=="number"||fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ki=Array.isArray;function Pr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Mn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function va(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(ki(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Mn(n)}}function dp(e,t){var n=Mn(t.value),r=Mn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function md(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function fp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ka(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?fp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Co,hp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Co=Co||document.createElement("div"),Co.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Co.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Mi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ei={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zx=["Webkit","ms","Moz","O"];Object.keys(Ei).forEach(function(e){zx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ei[t]=Ei[e]})});function pp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ei.hasOwnProperty(e)&&Ei[e]?(""+t).trim():t+"px"}function mp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Mx=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wa(e,t){if(t){if(Mx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Sa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ca=null;function Ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,Dr=null,Lr=null;function gd(e){if(e=uo(e)){if(typeof Ea!="function")throw Error(F(280));var t=e.stateNode;t&&(t=qs(t),Ea(e.stateNode,e.type,t))}}function gp(e){Dr?Lr?Lr.push(e):Lr=[e]:Dr=e}function yp(){if(Dr){var e=Dr,t=Lr;if(Lr=Dr=null,gd(e),t)for(e=0;e<t.length;e++)gd(t[e])}}function xp(e,t){return e(t)}function vp(){}var kl=!1;function kp(e,t,n){if(kl)return e(t,n);kl=!0;try{return xp(e,t,n)}finally{kl=!1,(Dr!==null||Lr!==null)&&(vp(),yp())}}function Bi(e,t){var n=e.stateNode;if(n===null)return null;var r=qs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var ba=!1;if(un)try{var li={};Object.defineProperty(li,"passive",{get:function(){ba=!0}}),window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{ba=!1}function Bx(e,t,n,r,i,o,s,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var bi=!1,hs=null,ps=!1,Na=null,Ux={onError:function(e){bi=!0,hs=e}};function $x(e,t,n,r,i,o,s,l,u){bi=!1,hs=null,Bx.apply(Ux,arguments)}function Hx(e,t,n,r,i,o,s,l,u){if($x.apply(this,arguments),bi){if(bi){var c=hs;bi=!1,hs=null}else throw Error(F(198));ps||(ps=!0,Na=c)}}function dr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function wp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function yd(e){if(dr(e)!==e)throw Error(F(188))}function Wx(e){var t=e.alternate;if(!t){if(t=dr(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return yd(i),e;if(o===r)return yd(i),t;o=o.sibling}throw Error(F(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function Sp(e){return e=Wx(e),e!==null?Cp(e):null}function Cp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Cp(e);if(t!==null)return t;e=e.sibling}return null}var Ep=ut.unstable_scheduleCallback,xd=ut.unstable_cancelCallback,Vx=ut.unstable_shouldYield,qx=ut.unstable_requestPaint,Ce=ut.unstable_now,Gx=ut.unstable_getCurrentPriorityLevel,Fu=ut.unstable_ImmediatePriority,bp=ut.unstable_UserBlockingPriority,ms=ut.unstable_NormalPriority,Kx=ut.unstable_LowPriority,Np=ut.unstable_IdlePriority,$s=null,Qt=null;function Qx(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot($s,e,void 0,(e.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:Jx,Yx=Math.log,Xx=Math.LN2;function Jx(e){return e>>>=0,e===0?32:31-(Yx(e)/Xx|0)|0}var Eo=64,bo=4194304;function wi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function gs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=wi(l):(o&=s,o!==0&&(r=wi(o)))}else s=n&~i,s!==0?r=wi(s):o!==0&&(r=wi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ot(t),i=1<<n,r|=e[n],t&=~i;return r}function Zx(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ev(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-Ot(o),l=1<<s,u=i[s];u===-1?(!(l&n)||l&r)&&(i[s]=Zx(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function Ta(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tp(){var e=Eo;return Eo<<=1,!(Eo&4194240)&&(Eo=64),e}function wl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=n}function tv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ot(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function zu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ae=0;function jp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var _p,Mu,Ip,Ap,Rp,ja=!1,No=[],In=null,An=null,Rn=null,Ui=new Map,$i=new Map,En=[],nv="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 submit".split(" ");function vd(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":Ui.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(t.pointerId)}}function ai(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=uo(t),t!==null&&Mu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rv(e,t,n,r,i){switch(t){case"focusin":return In=ai(In,e,t,n,r,i),!0;case"dragenter":return An=ai(An,e,t,n,r,i),!0;case"mouseover":return Rn=ai(Rn,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Ui.set(o,ai(Ui.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,$i.set(o,ai($i.get(o)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=Xn(e.target);if(t!==null){var n=dr(t);if(n!==null){if(t=n.tag,t===13){if(t=wp(n),t!==null){e.blockedOn=t,Rp(e.priority,function(){Ip(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ko(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_a(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ca=r,n.target.dispatchEvent(r),Ca=null}else return t=uo(n),t!==null&&Mu(t),e.blockedOn=n,!1;t.shift()}return!0}function kd(e,t,n){Ko(e)&&n.delete(t)}function iv(){ja=!1,In!==null&&Ko(In)&&(In=null),An!==null&&Ko(An)&&(An=null),Rn!==null&&Ko(Rn)&&(Rn=null),Ui.forEach(kd),$i.forEach(kd)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,ja||(ja=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,iv)))}function Hi(e){function t(i){return ui(i,e)}if(0<No.length){ui(No[0],e);for(var n=1;n<No.length;n++){var r=No[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&ui(In,e),An!==null&&ui(An,e),Rn!==null&&ui(Rn,e),Ui.forEach(t),$i.forEach(t),n=0;n<En.length;n++)r=En[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<En.length&&(n=En[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&En.shift()}var Or=pn.ReactCurrentBatchConfig,ys=!0;function ov(e,t,n,r){var i=ae,o=Or.transition;Or.transition=null;try{ae=1,Bu(e,t,n,r)}finally{ae=i,Or.transition=o}}function sv(e,t,n,r){var i=ae,o=Or.transition;Or.transition=null;try{ae=4,Bu(e,t,n,r)}finally{ae=i,Or.transition=o}}function Bu(e,t,n,r){if(ys){var i=_a(e,t,n,r);if(i===null)Al(e,t,r,xs,n),vd(e,r);else if(rv(i,e,t,n,r))r.stopPropagation();else if(vd(e,r),t&4&&-1<nv.indexOf(e)){for(;i!==null;){var o=uo(i);if(o!==null&&_p(o),o=_a(e,t,n,r),o===null&&Al(e,t,r,xs,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Al(e,t,r,null,n)}}var xs=null;function _a(e,t,n,r){if(xs=null,e=Ou(r),e=Xn(e),e!==null)if(t=dr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=wp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return xs=e,null}function Dp(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gx()){case Fu:return 1;case bp:return 4;case ms:case Kx:return 16;case Np:return 536870912;default:return 16}default:return 16}}var jn=null,Uu=null,Qo=null;function Lp(){if(Qo)return Qo;var e,t=Uu,n=t.length,r,i="value"in jn?jn.value:jn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return Qo=i.slice(e,1<r?1-r:void 0)}function Yo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function To(){return!0}function wd(){return!1}function ft(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?To:wd,this.isPropagationStopped=wd,this}return ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),t}var Yr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$u=ft(Yr),ao=ke({},Yr,{view:0,detail:0}),lv=ft(ao),Sl,Cl,ci,Hs=ke({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ci&&(ci&&e.type==="mousemove"?(Sl=e.screenX-ci.screenX,Cl=e.screenY-ci.screenY):Cl=Sl=0,ci=e),Sl)},movementY:function(e){return"movementY"in e?e.movementY:Cl}}),Sd=ft(Hs),av=ke({},Hs,{dataTransfer:0}),uv=ft(av),cv=ke({},ao,{relatedTarget:0}),El=ft(cv),dv=ke({},Yr,{animationName:0,elapsedTime:0,pseudoElement:0}),fv=ft(dv),hv=ke({},Yr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pv=ft(hv),mv=ke({},Yr,{data:0}),Cd=ft(mv),gv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yv={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"},xv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xv[e])?!!t[e]:!1}function Hu(){return vv}var kv=ke({},ao,{key:function(e){if(e.key){var t=gv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hu,charCode:function(e){return e.type==="keypress"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wv=ft(kv),Sv=ke({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ed=ft(Sv),Cv=ke({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hu}),Ev=ft(Cv),bv=ke({},Yr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nv=ft(bv),Tv=ke({},Hs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),jv=ft(Tv),_v=[9,13,27,32],Wu=un&&"CompositionEvent"in window,Ni=null;un&&"documentMode"in document&&(Ni=document.documentMode);var Iv=un&&"TextEvent"in window&&!Ni,Op=un&&(!Wu||Ni&&8<Ni&&11>=Ni),bd=" ",Nd=!1;function Fp(e,t){switch(e){case"keyup":return _v.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function Av(e,t){switch(e){case"compositionend":return zp(t);case"keypress":return t.which!==32?null:(Nd=!0,bd);case"textInput":return e=t.data,e===bd&&Nd?null:e;default:return null}}function Rv(e,t){if(Cr)return e==="compositionend"||!Wu&&Fp(e,t)?(e=Lp(),Qo=Uu=jn=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Op&&t.locale!=="ko"?null:t.data;default:return null}}var Pv={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 Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Pv[e.type]:t==="textarea"}function Mp(e,t,n,r){gp(r),t=vs(t,"onChange"),0<t.length&&(n=new $u("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ti=null,Wi=null;function Dv(e){Yp(e,0)}function Ws(e){var t=Nr(e);if(up(t))return e}function Lv(e,t){if(e==="change")return t}var Bp=!1;if(un){var bl;if(un){var Nl="oninput"in document;if(!Nl){var jd=document.createElement("div");jd.setAttribute("oninput","return;"),Nl=typeof jd.oninput=="function"}bl=Nl}else bl=!1;Bp=bl&&(!document.documentMode||9<document.documentMode)}function _d(){Ti&&(Ti.detachEvent("onpropertychange",Up),Wi=Ti=null)}function Up(e){if(e.propertyName==="value"&&Ws(Wi)){var t=[];Mp(t,Wi,e,Ou(e)),kp(Dv,t)}}function Ov(e,t,n){e==="focusin"?(_d(),Ti=t,Wi=n,Ti.attachEvent("onpropertychange",Up)):e==="focusout"&&_d()}function Fv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(Wi)}function zv(e,t){if(e==="click")return Ws(t)}function Mv(e,t){if(e==="input"||e==="change")return Ws(t)}function Bv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mt=typeof Object.is=="function"?Object.is:Bv;function Vi(e,t){if(Mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!da.call(t,i)||!Mt(e[i],t[i]))return!1}return!0}function Id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ad(e,t){var n=Id(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Id(n)}}function $p(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$p(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hp(){for(var e=window,t=fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fs(e.document)}return t}function Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Uv(e){var t=Hp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$p(n.ownerDocument.documentElement,n)){if(r!==null&&Vu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Ad(n,o);var s=Ad(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var $v=un&&"documentMode"in document&&11>=document.documentMode,Er=null,Ia=null,ji=null,Aa=!1;function Rd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Aa||Er==null||Er!==fs(r)||(r=Er,"selectionStart"in r&&Vu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ji&&Vi(ji,r)||(ji=r,r=vs(Ia,"onSelect"),0<r.length&&(t=new $u("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var br={animationend:jo("Animation","AnimationEnd"),animationiteration:jo("Animation","AnimationIteration"),animationstart:jo("Animation","AnimationStart"),transitionend:jo("Transition","TransitionEnd")},Tl={},Wp={};un&&(Wp=document.createElement("div").style,"AnimationEvent"in window||(delete br.animationend.animation,delete br.animationiteration.animation,delete br.animationstart.animation),"TransitionEvent"in window||delete br.transitionend.transition);function Vs(e){if(Tl[e])return Tl[e];if(!br[e])return e;var t=br[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wp)return Tl[e]=t[n];return e}var Vp=Vs("animationend"),qp=Vs("animationiteration"),Gp=Vs("animationstart"),Kp=Vs("transitionend"),Qp=new Map,Pd="abort auxClick 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(" ");function Un(e,t){Qp.set(e,t),cr(t,[e])}for(var jl=0;jl<Pd.length;jl++){var _l=Pd[jl],Hv=_l.toLowerCase(),Wv=_l[0].toUpperCase()+_l.slice(1);Un(Hv,"on"+Wv)}Un(Vp,"onAnimationEnd");Un(qp,"onAnimationIteration");Un(Gp,"onAnimationStart");Un("dblclick","onDoubleClick");Un("focusin","onFocus");Un("focusout","onBlur");Un(Kp,"onTransitionEnd");Ur("onMouseEnter",["mouseout","mouseover"]);Ur("onMouseLeave",["mouseout","mouseover"]);Ur("onPointerEnter",["pointerout","pointerover"]);Ur("onPointerLeave",["pointerout","pointerover"]);cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cr("onBeforeInput",["compositionend","keypress","textInput","paste"]);cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Si="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(" "),Vv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Si));function Dd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Hx(r,t,void 0,e),e.currentTarget=null}function Yp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==o&&i.isPropagationStopped())break e;Dd(i,l,c),o=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,c=l.currentTarget,l=l.listener,u!==o&&i.isPropagationStopped())break e;Dd(i,l,c),o=u}}}if(ps)throw e=Na,ps=!1,Na=null,e}function pe(e,t){var n=t[Oa];n===void 0&&(n=t[Oa]=new Set);var r=e+"__bubble";n.has(r)||(Xp(t,e,2,!1),n.add(r))}function Il(e,t,n){var r=0;t&&(r|=4),Xp(n,e,r,t)}var _o="_reactListening"+Math.random().toString(36).slice(2);function qi(e){if(!e[_o]){e[_o]=!0,ip.forEach(function(n){n!=="selectionchange"&&(Vv.has(n)||Il(n,!1,e),Il(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_o]||(t[_o]=!0,Il("selectionchange",!1,t))}}function Xp(e,t,n,r){switch(Dp(t)){case 1:var i=ov;break;case 4:i=sv;break;default:i=Bu}n=i.bind(null,t,n,e),i=void 0,!ba||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Al(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Xn(l),s===null)return;if(u=s.tag,u===5||u===6){r=o=s;continue e}l=l.parentNode}}r=r.return}kp(function(){var c=o,f=Ou(n),d=[];e:{var h=Qp.get(e);if(h!==void 0){var p=$u,g=e;switch(e){case"keypress":if(Yo(n)===0)break e;case"keydown":case"keyup":p=wv;break;case"focusin":g="focus",p=El;break;case"focusout":g="blur",p=El;break;case"beforeblur":case"afterblur":p=El;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=uv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Ev;break;case Vp:case qp:case Gp:p=fv;break;case Kp:p=Nv;break;case"scroll":p=lv;break;case"wheel":p=jv;break;case"copy":case"cut":case"paste":p=pv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Ed}var v=(t&4)!==0,S=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var m=c,x;m!==null;){x=m;var T=x.stateNode;if(x.tag===5&&T!==null&&(x=T,y!==null&&(T=Bi(m,y),T!=null&&v.push(Gi(m,T,x)))),S)break;m=m.return}0<v.length&&(h=new p(h,g,null,n,f),d.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Ca&&(g=n.relatedTarget||n.fromElement)&&(Xn(g)||g[cn]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=c,g=g?Xn(g):null,g!==null&&(S=dr(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=c),p!==g)){if(v=Sd,T="onMouseLeave",y="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ed,T="onPointerLeave",y="onPointerEnter",m="pointer"),S=p==null?h:Nr(p),x=g==null?h:Nr(g),h=new v(T,m+"leave",p,n,f),h.target=S,h.relatedTarget=x,T=null,Xn(f)===c&&(v=new v(y,m+"enter",g,n,f),v.target=x,v.relatedTarget=S,T=v),S=T,p&&g)t:{for(v=p,y=g,m=0,x=v;x;x=xr(x))m++;for(x=0,T=y;T;T=xr(T))x++;for(;0<m-x;)v=xr(v),m--;for(;0<x-m;)y=xr(y),x--;for(;m--;){if(v===y||y!==null&&v===y.alternate)break t;v=xr(v),y=xr(y)}v=null}else v=null;p!==null&&Ld(d,h,p,v,!1),g!==null&&S!==null&&Ld(d,S,g,v,!0)}}e:{if(h=c?Nr(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=Lv;else if(Td(h))if(Bp)j=Mv;else{j=Fv;var E=Ov}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=zv);if(j&&(j=j(e,c))){Mp(d,j,n,f);break e}E&&E(e,h,c),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&xa(h,"number",h.value)}switch(E=c?Nr(c):window,e){case"focusin":(Td(E)||E.contentEditable==="true")&&(Er=E,Ia=c,ji=null);break;case"focusout":ji=Ia=Er=null;break;case"mousedown":Aa=!0;break;case"contextmenu":case"mouseup":case"dragend":Aa=!1,Rd(d,n,f);break;case"selectionchange":if($v)break;case"keydown":case"keyup":Rd(d,n,f)}var _;if(Wu)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else Cr?Fp(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(Op&&n.locale!=="ko"&&(Cr||D!=="onCompositionStart"?D==="onCompositionEnd"&&Cr&&(_=Lp()):(jn=f,Uu="value"in jn?jn.value:jn.textContent,Cr=!0)),E=vs(c,D),0<E.length&&(D=new Cd(D,e,null,n,f),d.push({event:D,listeners:E}),_?D.data=_:(_=zp(n),_!==null&&(D.data=_)))),(_=Iv?Av(e,n):Rv(e,n))&&(c=vs(c,"onBeforeInput"),0<c.length&&(f=new Cd("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:c}),f.data=_))}Yp(d,t)})}function Gi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vs(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Bi(e,n),o!=null&&r.unshift(Gi(e,o,i)),o=Bi(e,t),o!=null&&r.push(Gi(e,o,i))),e=e.return}return r}function xr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ld(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,i?(u=Bi(n,o),u!=null&&s.unshift(Gi(n,u,l))):i||(u=Bi(n,o),u!=null&&s.push(Gi(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var qv=/\r\n?/g,Gv=/\u0000|\uFFFD/g;function Od(e){return(typeof e=="string"?e:""+e).replace(qv,`
38
- `).replace(Gv,"")}function Io(e,t,n){if(t=Od(t),Od(e)!==t&&n)throw Error(F(425))}function ks(){}var Ra=null,Pa=null;function Da(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var La=typeof setTimeout=="function"?setTimeout:void 0,Kv=typeof clearTimeout=="function"?clearTimeout:void 0,Fd=typeof Promise=="function"?Promise:void 0,Qv=typeof queueMicrotask=="function"?queueMicrotask:typeof Fd<"u"?function(e){return Fd.resolve(null).then(e).catch(Yv)}:La;function Yv(e){setTimeout(function(){throw e})}function Rl(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Hi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Hi(t)}function Pn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function zd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Xr=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Xr,Ki="__reactProps$"+Xr,cn="__reactContainer$"+Xr,Oa="__reactEvents$"+Xr,Xv="__reactListeners$"+Xr,Jv="__reactHandles$"+Xr;function Xn(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[cn]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zd(e);e!==null;){if(n=e[Kt])return n;e=zd(e)}return t}e=n,n=e.parentNode}return null}function uo(e){return e=e[Kt]||e[cn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function qs(e){return e[Ki]||null}var Fa=[],Tr=-1;function $n(e){return{current:e}}function me(e){0>Tr||(e.current=Fa[Tr],Fa[Tr]=null,Tr--)}function he(e,t){Tr++,Fa[Tr]=e.current,e.current=t}var Bn={},Ue=$n(Bn),Je=$n(!1),rr=Bn;function $r(e,t){var n=e.type.contextTypes;if(!n)return Bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ze(e){return e=e.childContextTypes,e!=null}function ws(){me(Je),me(Ue)}function Md(e,t,n){if(Ue.current!==Bn)throw Error(F(168));he(Ue,t),he(Je,n)}function Jp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(F(108,Ox(e)||"Unknown",i));return ke({},n,r)}function Ss(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bn,rr=Ue.current,he(Ue,e),he(Je,Je.current),!0}function Bd(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=Jp(e,t,rr),r.__reactInternalMemoizedMergedChildContext=e,me(Je),me(Ue),he(Ue,e)):me(Je),he(Je,n)}var rn=null,Gs=!1,Pl=!1;function Zp(e){rn===null?rn=[e]:rn.push(e)}function Zv(e){Gs=!0,Zp(e)}function Hn(){if(!Pl&&rn!==null){Pl=!0;var e=0,t=ae;try{var n=rn;for(ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}rn=null,Gs=!1}catch(i){throw rn!==null&&(rn=rn.slice(e+1)),Ep(Fu,Hn),i}finally{ae=t,Pl=!1}}return null}var jr=[],_r=0,Cs=null,Es=0,yt=[],xt=0,ir=null,on=1,sn="";function Kn(e,t){jr[_r++]=Es,jr[_r++]=Cs,Cs=e,Es=t}function em(e,t,n){yt[xt++]=on,yt[xt++]=sn,yt[xt++]=ir,ir=e;var r=on;e=sn;var i=32-Ot(r)-1;r&=~(1<<i),n+=1;var o=32-Ot(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,on=1<<32-Ot(t)+i|n<<i|r,sn=o+e}else on=1<<o|n<<i|r,sn=e}function qu(e){e.return!==null&&(Kn(e,1),em(e,1,0))}function Gu(e){for(;e===Cs;)Cs=jr[--_r],jr[_r]=null,Es=jr[--_r],jr[_r]=null;for(;e===ir;)ir=yt[--xt],yt[xt]=null,sn=yt[--xt],yt[xt]=null,on=yt[--xt],yt[xt]=null}var lt=null,st=null,ge=!1,Dt=null;function tm(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ud(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,lt=e,st=Pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,st=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ir!==null?{id:on,overflow:sn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,lt=e,st=null,!0):!1;default:return!1}}function za(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ma(e){if(ge){var t=st;if(t){var n=t;if(!Ud(e,t)){if(za(e))throw Error(F(418));t=Pn(n.nextSibling);var r=lt;t&&Ud(e,t)?tm(r,n):(e.flags=e.flags&-4097|2,ge=!1,lt=e)}}else{if(za(e))throw Error(F(418));e.flags=e.flags&-4097|2,ge=!1,lt=e}}}function $d(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function Ao(e){if(e!==lt)return!1;if(!ge)return $d(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Da(e.type,e.memoizedProps)),t&&(t=st)){if(za(e))throw nm(),Error(F(418));for(;t;)tm(e,t),t=Pn(t.nextSibling)}if($d(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){st=Pn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}st=null}}else st=lt?Pn(e.stateNode.nextSibling):null;return!0}function nm(){for(var e=st;e;)e=Pn(e.nextSibling)}function Hr(){st=lt=null,ge=!1}function Ku(e){Dt===null?Dt=[e]:Dt.push(e)}var ek=pn.ReactCurrentBatchConfig;function di(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var r=n.stateNode}if(!r)throw Error(F(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var l=i.refs;s===null?delete l[o]:l[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function Ro(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Hd(e){var t=e._init;return t(e._payload)}function rm(e){function t(y,m){if(e){var x=y.deletions;x===null?(y.deletions=[m],y.flags|=16):x.push(m)}}function n(y,m){if(!e)return null;for(;m!==null;)t(y,m),m=m.sibling;return null}function r(y,m){for(y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function i(y,m){return y=Fn(y,m),y.index=0,y.sibling=null,y}function o(y,m,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<m?(y.flags|=2,m):x):(y.flags|=2,m)):(y.flags|=1048576,m)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,m,x,T){return m===null||m.tag!==6?(m=Bl(x,y.mode,T),m.return=y,m):(m=i(m,x),m.return=y,m)}function u(y,m,x,T){var j=x.type;return j===Sr?f(y,m,x.props.children,T,x.key):m!==null&&(m.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===wn&&Hd(j)===m.type)?(T=i(m,x.props),T.ref=di(y,m,x),T.return=y,T):(T=rs(x.type,x.key,x.props,null,y.mode,T),T.ref=di(y,m,x),T.return=y,T)}function c(y,m,x,T){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=Ul(x,y.mode,T),m.return=y,m):(m=i(m,x.children||[]),m.return=y,m)}function f(y,m,x,T,j){return m===null||m.tag!==7?(m=nr(x,y.mode,T,j),m.return=y,m):(m=i(m,x),m.return=y,m)}function d(y,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Bl(""+m,y.mode,x),m.return=y,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case wo:return x=rs(m.type,m.key,m.props,null,y.mode,x),x.ref=di(y,null,m),x.return=y,x;case wr:return m=Ul(m,y.mode,x),m.return=y,m;case wn:var T=m._init;return d(y,T(m._payload),x)}if(ki(m)||si(m))return m=nr(m,y.mode,x,null),m.return=y,m;Ro(y,m)}return null}function h(y,m,x,T){var j=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(y,m,""+x,T);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case wo:return x.key===j?u(y,m,x,T):null;case wr:return x.key===j?c(y,m,x,T):null;case wn:return j=x._init,h(y,m,j(x._payload),T)}if(ki(x)||si(x))return j!==null?null:f(y,m,x,T,null);Ro(y,x)}return null}function p(y,m,x,T,j){if(typeof T=="string"&&T!==""||typeof T=="number")return y=y.get(x)||null,l(m,y,""+T,j);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case wo:return y=y.get(T.key===null?x:T.key)||null,u(m,y,T,j);case wr:return y=y.get(T.key===null?x:T.key)||null,c(m,y,T,j);case wn:var E=T._init;return p(y,m,x,E(T._payload),j)}if(ki(T)||si(T))return y=y.get(x)||null,f(m,y,T,j,null);Ro(m,T)}return null}function g(y,m,x,T){for(var j=null,E=null,_=m,D=m=0,R=null;_!==null&&D<x.length;D++){_.index>D?(R=_,_=null):R=_.sibling;var b=h(y,_,x[D],T);if(b===null){_===null&&(_=R);break}e&&_&&b.alternate===null&&t(y,_),m=o(b,m,D),E===null?j=b:E.sibling=b,E=b,_=R}if(D===x.length)return n(y,_),ge&&Kn(y,D),j;if(_===null){for(;D<x.length;D++)_=d(y,x[D],T),_!==null&&(m=o(_,m,D),E===null?j=_:E.sibling=_,E=_);return ge&&Kn(y,D),j}for(_=r(y,_);D<x.length;D++)R=p(_,y,D,x[D],T),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?D:R.key),m=o(R,m,D),E===null?j=R:E.sibling=R,E=R);return e&&_.forEach(function(P){return t(y,P)}),ge&&Kn(y,D),j}function v(y,m,x,T){var j=si(x);if(typeof j!="function")throw Error(F(150));if(x=j.call(x),x==null)throw Error(F(151));for(var E=j=null,_=m,D=m=0,R=null,b=x.next();_!==null&&!b.done;D++,b=x.next()){_.index>D?(R=_,_=null):R=_.sibling;var P=h(y,_,b.value,T);if(P===null){_===null&&(_=R);break}e&&_&&P.alternate===null&&t(y,_),m=o(P,m,D),E===null?j=P:E.sibling=P,E=P,_=R}if(b.done)return n(y,_),ge&&Kn(y,D),j;if(_===null){for(;!b.done;D++,b=x.next())b=d(y,b.value,T),b!==null&&(m=o(b,m,D),E===null?j=b:E.sibling=b,E=b);return ge&&Kn(y,D),j}for(_=r(y,_);!b.done;D++,b=x.next())b=p(_,y,D,b.value,T),b!==null&&(e&&b.alternate!==null&&_.delete(b.key===null?D:b.key),m=o(b,m,D),E===null?j=b:E.sibling=b,E=b);return e&&_.forEach(function(q){return t(y,q)}),ge&&Kn(y,D),j}function S(y,m,x,T){if(typeof x=="object"&&x!==null&&x.type===Sr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case wo:e:{for(var j=x.key,E=m;E!==null;){if(E.key===j){if(j=x.type,j===Sr){if(E.tag===7){n(y,E.sibling),m=i(E,x.props.children),m.return=y,y=m;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===wn&&Hd(j)===E.type){n(y,E.sibling),m=i(E,x.props),m.ref=di(y,E,x),m.return=y,y=m;break e}n(y,E);break}else t(y,E);E=E.sibling}x.type===Sr?(m=nr(x.props.children,y.mode,T,x.key),m.return=y,y=m):(T=rs(x.type,x.key,x.props,null,y.mode,T),T.ref=di(y,m,x),T.return=y,y=T)}return s(y);case wr:e:{for(E=x.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(y,m.sibling),m=i(m,x.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=Ul(x,y.mode,T),m.return=y,y=m}return s(y);case wn:return E=x._init,S(y,m,E(x._payload),T)}if(ki(x))return g(y,m,x,T);if(si(x))return v(y,m,x,T);Ro(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(y,m.sibling),m=i(m,x),m.return=y,y=m):(n(y,m),m=Bl(x,y.mode,T),m.return=y,y=m),s(y)):n(y,m)}return S}var Wr=rm(!0),im=rm(!1),bs=$n(null),Ns=null,Ir=null,Qu=null;function Yu(){Qu=Ir=Ns=null}function Xu(e){var t=bs.current;me(bs),e._currentValue=t}function Ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fr(e,t){Ns=e,Qu=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xe=!0),e.firstContext=null)}function Ct(e){var t=e._currentValue;if(Qu!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(Ns===null)throw Error(F(308));Ir=e,Ns.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var Jn=null;function Ju(e){Jn===null?Jn=[e]:Jn.push(e)}function om(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ju(t)):(n.next=i.next,i.next=n),t.interleaved=n,dn(e,r)}function dn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Sn=!1;function Zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,dn(e,n)}return i=r.interleaved,i===null?(t.next=t,Ju(r)):(t.next=i.next,i.next=t),r.interleaved=t,dn(e,n)}function Xo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zu(e,n)}}function Wd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ts(e,t,n,r){var i=e.updateQueue;Sn=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,s===null?o=c:s.next=c,s=u;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==s&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=u))}if(o!==null){var d=i.baseState;s=0,f=c=u=null,l=o;do{var h=l.lane,p=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){d=g.call(p,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(p,d,h):g,h==null)break e;d=ke({},d,h);break e;case 2:Sn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=p,u=d):f=f.next=p,s|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);sr|=s,e.lanes=s,e.memoizedState=d}}function Vd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(F(191,i));i.call(r)}}}var co={},Yt=$n(co),Qi=$n(co),Yi=$n(co);function Zn(e){if(e===co)throw Error(F(174));return e}function ec(e,t){switch(he(Yi,t),he(Qi,e),he(Yt,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ka(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ka(t,e)}me(Yt),he(Yt,t)}function Vr(){me(Yt),me(Qi),me(Yi)}function lm(e){Zn(Yi.current);var t=Zn(Yt.current),n=ka(t,e.type);t!==n&&(he(Qi,e),he(Yt,n))}function tc(e){Qi.current===e&&(me(Yt),me(Qi))}var xe=$n(0);function js(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dl=[];function nc(){for(var e=0;e<Dl.length;e++)Dl[e]._workInProgressVersionPrimary=null;Dl.length=0}var Jo=pn.ReactCurrentDispatcher,Ll=pn.ReactCurrentBatchConfig,or=0,ve=null,_e=null,Ae=null,_s=!1,_i=!1,Xi=0,tk=0;function Fe(){throw Error(F(321))}function rc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mt(e[n],t[n]))return!1;return!0}function ic(e,t,n,r,i,o){if(or=o,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jo.current=e===null||e.memoizedState===null?ok:sk,e=n(r,i),_i){o=0;do{if(_i=!1,Xi=0,25<=o)throw Error(F(301));o+=1,Ae=_e=null,t.updateQueue=null,Jo.current=lk,e=n(r,i)}while(_i)}if(Jo.current=Is,t=_e!==null&&_e.next!==null,or=0,Ae=_e=ve=null,_s=!1,t)throw Error(F(300));return e}function oc(){var e=Xi!==0;return Xi=0,e}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?ve.memoizedState=Ae=e:Ae=Ae.next=e,Ae}function Et(){if(_e===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=Ae===null?ve.memoizedState:Ae.next;if(t!==null)Ae=t,_e=e;else{if(e===null)throw Error(F(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},Ae===null?ve.memoizedState=Ae=e:Ae=Ae.next=e}return Ae}function Ji(e,t){return typeof t=="function"?t(e):t}function Ol(e){var t=Et(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=_e,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,u=null,c=o;do{var f=c.lane;if((or&f)===f)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,s=r):u=u.next=d,ve.lanes|=f,sr|=f}c=c.next}while(c!==null&&c!==o);u===null?s=r:u.next=l,Mt(r,t.memoizedState)||(Xe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,ve.lanes|=o,sr|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fl(e){var t=Et(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Mt(o,t.memoizedState)||(Xe=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function am(){}function um(e,t){var n=ve,r=Et(),i=t(),o=!Mt(r.memoizedState,i);if(o&&(r.memoizedState=i,Xe=!0),r=r.queue,sc(fm.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Ae!==null&&Ae.memoizedState.tag&1){if(n.flags|=2048,Zi(9,dm.bind(null,n,r,i,t),void 0,null),Re===null)throw Error(F(349));or&30||cm(n,t,i)}return i}function cm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function dm(e,t,n,r){t.value=n,t.getSnapshot=r,hm(t)&&pm(e)}function fm(e,t,n){return n(function(){hm(t)&&pm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mt(e,n)}catch{return!0}}function pm(e){var t=dn(e,1);t!==null&&Ft(t,e,1,-1)}function qd(e){var t=Ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ji,lastRenderedState:e},t.queue=e,e=e.dispatch=ik.bind(null,ve,e),[t.memoizedState,e]}function Zi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function mm(){return Et().memoizedState}function Zo(e,t,n,r){var i=Ht();ve.flags|=e,i.memoizedState=Zi(1|t,n,void 0,r===void 0?null:r)}function Ks(e,t,n,r){var i=Et();r=r===void 0?null:r;var o=void 0;if(_e!==null){var s=_e.memoizedState;if(o=s.destroy,r!==null&&rc(r,s.deps)){i.memoizedState=Zi(t,n,o,r);return}}ve.flags|=e,i.memoizedState=Zi(1|t,n,o,r)}function Gd(e,t){return Zo(8390656,8,e,t)}function sc(e,t){return Ks(2048,8,e,t)}function gm(e,t){return Ks(4,2,e,t)}function ym(e,t){return Ks(4,4,e,t)}function xm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vm(e,t,n){return n=n!=null?n.concat([e]):null,Ks(4,4,xm.bind(null,t,e),n)}function lc(){}function km(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&rc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function wm(e,t){var n=Et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&rc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Sm(e,t,n){return or&21?(Mt(n,t)||(n=Tp(),ve.lanes|=n,sr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xe=!0),e.memoizedState=n)}function nk(e,t){var n=ae;ae=n!==0&&4>n?n:4,e(!0);var r=Ll.transition;Ll.transition={};try{e(!1),t()}finally{ae=n,Ll.transition=r}}function Cm(){return Et().memoizedState}function rk(e,t,n){var r=On(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Em(e))bm(t,n);else if(n=om(e,t,n,r),n!==null){var i=Ve();Ft(n,e,r,i),Nm(n,t,r)}}function ik(e,t,n){var r=On(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Em(e))bm(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Mt(l,s)){var u=t.interleaved;u===null?(i.next=i,Ju(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=om(e,t,i,r),n!==null&&(i=Ve(),Ft(n,e,r,i),Nm(n,t,r))}}function Em(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function bm(e,t){_i=_s=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Nm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zu(e,n)}}var Is={readContext:Ct,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},ok={readContext:Ct,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Gd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zo(4194308,4,xm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var n=Ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=rk.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:qd,useDebugValue:lc,useDeferredValue:function(e){return Ht().memoizedState=e},useTransition:function(){var e=qd(!1),t=e[0];return e=nk.bind(null,e[1]),Ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,i=Ht();if(ge){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Re===null)throw Error(F(349));or&30||cm(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Gd(fm.bind(null,r,o,e),[e]),r.flags|=2048,Zi(9,dm.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ht(),t=Re.identifierPrefix;if(ge){var n=sn,r=on;n=(r&~(1<<32-Ot(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=tk++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sk={readContext:Ct,useCallback:km,useContext:Ct,useEffect:sc,useImperativeHandle:vm,useInsertionEffect:gm,useLayoutEffect:ym,useMemo:wm,useReducer:Ol,useRef:mm,useState:function(){return Ol(Ji)},useDebugValue:lc,useDeferredValue:function(e){var t=Et();return Sm(t,_e.memoizedState,e)},useTransition:function(){var e=Ol(Ji)[0],t=Et().memoizedState;return[e,t]},useMutableSource:am,useSyncExternalStore:um,useId:Cm,unstable_isNewReconciler:!1},lk={readContext:Ct,useCallback:km,useContext:Ct,useEffect:sc,useImperativeHandle:vm,useInsertionEffect:gm,useLayoutEffect:ym,useMemo:wm,useReducer:Fl,useRef:mm,useState:function(){return Fl(Ji)},useDebugValue:lc,useDeferredValue:function(e){var t=Et();return _e===null?t.memoizedState=e:Sm(t,_e.memoizedState,e)},useTransition:function(){var e=Fl(Ji)[0],t=Et().memoizedState;return[e,t]},useMutableSource:am,useSyncExternalStore:um,useId:Cm,unstable_isNewReconciler:!1};function It(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ua(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qs={isMounted:function(e){return(e=e._reactInternals)?dr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ve(),i=On(e),o=ln(r,i);o.payload=t,n!=null&&(o.callback=n),t=Dn(e,o,i),t!==null&&(Ft(t,e,i,r),Xo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ve(),i=On(e),o=ln(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Dn(e,o,i),t!==null&&(Ft(t,e,i,r),Xo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ve(),r=On(e),i=ln(n,r);i.tag=2,t!=null&&(i.callback=t),t=Dn(e,i,r),t!==null&&(Ft(t,e,r,n),Xo(t,e,r))}};function Kd(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!Vi(n,r)||!Vi(i,o):!0}function Tm(e,t,n){var r=!1,i=Bn,o=t.contextType;return typeof o=="object"&&o!==null?o=Ct(o):(i=Ze(t)?rr:Ue.current,r=t.contextTypes,o=(r=r!=null)?$r(e,i):Bn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Qd(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Qs.enqueueReplaceState(t,t.state,null)}function $a(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Zu(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Ct(o):(o=Ze(t)?rr:Ue.current,i.context=$r(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Ua(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Qs.enqueueReplaceState(i,i.state,null),Ts(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function qr(e,t){try{var n="",r=t;do n+=Lx(r),r=r.return;while(r);var i=n}catch(o){i=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:i,digest:null}}function zl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ha(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ak=typeof WeakMap=="function"?WeakMap:Map;function jm(e,t,n){n=ln(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Rs||(Rs=!0,Za=r),Ha(e,t)},n}function _m(e,t,n){n=ln(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ha(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ha(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Yd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ak;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Sk.bind(null,e,t,n),t.then(e,e))}function Xd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Jd(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ln(-1,1),t.tag=2,Dn(n,t,1))),n.lanes|=1),e)}var uk=pn.ReactCurrentOwner,Xe=!1;function He(e,t,n,r){t.child=e===null?im(t,null,n,r):Wr(t,e.child,n,r)}function Zd(e,t,n,r,i){n=n.render;var o=t.ref;return Fr(t,i),r=ic(e,t,n,r,o,i),n=oc(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fn(e,t,i)):(ge&&n&&qu(t),t.flags|=1,He(e,t,r,i),t.child)}function ef(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!mc(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Im(e,t,o,r,i)):(e=rs(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Vi,n(s,r)&&e.ref===t.ref)return fn(e,t,i)}return t.flags|=1,e=Fn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Im(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Vi(o,r)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,fn(e,t,i)}return Wa(e,t,n,r,i)}function Am(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(Rr,ot),ot|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(Rr,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,he(Rr,ot),ot|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,he(Rr,ot),ot|=r;return He(e,t,i,n),t.child}function Rm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wa(e,t,n,r,i){var o=Ze(n)?rr:Ue.current;return o=$r(t,o),Fr(t,i),n=ic(e,t,n,r,o,i),r=oc(),e!==null&&!Xe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,fn(e,t,i)):(ge&&r&&qu(t),t.flags|=1,He(e,t,n,i),t.child)}function tf(e,t,n,r,i){if(Ze(n)){var o=!0;Ss(t)}else o=!1;if(Fr(t,i),t.stateNode===null)es(e,t),Tm(t,n,r),$a(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ct(c):(c=Ze(n)?rr:Ue.current,c=$r(t,c));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==c)&&Qd(t,s,r,c),Sn=!1;var h=t.memoizedState;s.state=h,Ts(t,r,s,i),u=t.memoizedState,l!==r||h!==u||Je.current||Sn?(typeof f=="function"&&(Ua(t,n,f,r),u=t.memoizedState),(l=Sn||Kd(t,n,l,r,h,u,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=c,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,sm(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:It(t.type,l),s.props=c,d=t.pendingProps,h=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ct(u):(u=Ze(n)?rr:Ue.current,u=$r(t,u));var p=n.getDerivedStateFromProps;(f=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||h!==u)&&Qd(t,s,r,u),Sn=!1,h=t.memoizedState,s.state=h,Ts(t,r,s,i);var g=t.memoizedState;l!==d||h!==g||Je.current||Sn?(typeof p=="function"&&(Ua(t,n,p,r),g=t.memoizedState),(c=Sn||Kd(t,n,c,r,h,g,u)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=u,r=c):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Va(e,t,n,r,o,i)}function Va(e,t,n,r,i,o){Rm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Bd(t,n,!1),fn(e,t,o);r=t.stateNode,uk.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Wr(t,e.child,null,o),t.child=Wr(t,null,l,o)):He(e,t,l,o),t.memoizedState=r.state,i&&Bd(t,n,!0),t.child}function Pm(e){var t=e.stateNode;t.pendingContext?Md(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Md(e,t.context,!1),ec(e,t.containerInfo)}function nf(e,t,n,r,i){return Hr(),Ku(i),t.flags|=256,He(e,t,n,r),t.child}var qa={dehydrated:null,treeContext:null,retryLane:0};function Ga(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dm(e,t,n){var r=t.pendingProps,i=xe.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),he(xe,i&1),e===null)return Ma(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Js(s,r,0,null),e=nr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ga(n),t.memoizedState=qa,e):ac(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return ck(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Fn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=Fn(l,o):(o=nr(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?Ga(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=qa,r}return o=e.child,e=o.sibling,r=Fn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ac(e,t){return t=Js({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Po(e,t,n,r){return r!==null&&Ku(r),Wr(t,e.child,null,n),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ck(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=zl(Error(F(422))),Po(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Js({mode:"visible",children:r.children},i,0,null),o=nr(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Wr(t,e.child,null,s),t.child.memoizedState=Ga(s),t.memoizedState=qa,o);if(!(t.mode&1))return Po(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(F(419)),r=zl(o,r,void 0),Po(e,t,s,r)}if(l=(s&e.childLanes)!==0,Xe||l){if(r=Re,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,dn(e,i),Ft(r,e,i,-1))}return pc(),r=zl(Error(F(421))),Po(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Ck.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,st=Pn(i.nextSibling),lt=t,ge=!0,Dt=null,e!==null&&(yt[xt++]=on,yt[xt++]=sn,yt[xt++]=ir,on=e.id,sn=e.overflow,ir=t),t=ac(t,r.children),t.flags|=4096,t)}function rf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ba(e.return,t,n)}function Ml(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Lm(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(He(e,t,r.children,n),r=xe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rf(e,n,t);else if(e.tag===19)rf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(he(xe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&js(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ml(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&js(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ml(t,!0,n,null,o);break;case"together":Ml(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function es(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Fn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dk(e,t,n){switch(t.tag){case 3:Pm(t),Hr();break;case 5:lm(t);break;case 1:Ze(t.type)&&Ss(t);break;case 4:ec(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;he(bs,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(xe,xe.current&1),t.flags|=128,null):n&t.child.childLanes?Dm(e,t,n):(he(xe,xe.current&1),e=fn(e,t,n),e!==null?e.sibling:null);he(xe,xe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Lm(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(xe,xe.current),r)break;return null;case 22:case 23:return t.lanes=0,Am(e,t,n)}return fn(e,t,n)}var Om,Ka,Fm,zm;Om=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ka=function(){};Fm=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Zn(Yt.current);var o=null;switch(n){case"input":i=ga(e,i),r=ga(e,r),o=[];break;case"select":i=ke({},i,{value:void 0}),r=ke({},r,{value:void 0}),o=[];break;case"textarea":i=va(e,i),r=va(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ks)}wa(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(zi.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(l=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(zi.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};zm=function(e,t,n,r){n!==r&&(t.flags|=4)};function fi(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fk(e,t,n){var r=t.pendingProps;switch(Gu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(t),null;case 1:return Ze(t.type)&&ws(),ze(t),null;case 3:return r=t.stateNode,Vr(),me(Je),me(Ue),nc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ao(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dt!==null&&(nu(Dt),Dt=null))),Ka(e,t),ze(t),null;case 5:tc(t);var i=Zn(Yi.current);if(n=t.type,e!==null&&t.stateNode!=null)Fm(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return ze(t),null}if(e=Zn(Yt.current),Ao(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Kt]=t,r[Ki]=o,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(i=0;i<Si.length;i++)pe(Si[i],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":fd(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":pd(r,o),pe("invalid",r)}wa(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Io(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Io(r.textContent,l,e),i=["children",""+l]):zi.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&pe("scroll",r)}switch(n){case"input":So(r),hd(r,o,!0);break;case"textarea":So(r),md(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ks)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=fp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Kt]=t,e[Ki]=r,Om(e,t,!1,!1),t.stateNode=e;e:{switch(s=Sa(n,r),n){case"dialog":pe("cancel",e),pe("close",e),i=r;break;case"iframe":case"object":case"embed":pe("load",e),i=r;break;case"video":case"audio":for(i=0;i<Si.length;i++)pe(Si[i],e);i=r;break;case"source":pe("error",e),i=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),i=r;break;case"details":pe("toggle",e),i=r;break;case"input":fd(e,r),i=ga(e,r),pe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ke({},r,{value:void 0}),pe("invalid",e);break;case"textarea":pd(e,r),i=va(e,r),pe("invalid",e);break;default:i=r}wa(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?mp(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&hp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Mi(e,u):typeof u=="number"&&Mi(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(zi.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Ru(e,o,u,s))}switch(n){case"input":So(e),hd(e,r,!1);break;case"textarea":So(e),md(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Mn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Pr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Pr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ks)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ze(t),null;case 6:if(e&&t.stateNode!=null)zm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=Zn(Yi.current),Zn(Yt.current),Ao(t)){if(r=t.stateNode,n=t.memoizedProps,r[Kt]=t,(o=r.nodeValue!==n)&&(e=lt,e!==null))switch(e.tag){case 3:Io(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Io(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Kt]=t,t.stateNode=r}return ze(t),null;case 13:if(me(xe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&st!==null&&t.mode&1&&!(t.flags&128))nm(),Hr(),t.flags|=98560,o=!1;else if(o=Ao(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(F(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(F(317));o[Kt]=t}else Hr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ze(t),o=!1}else Dt!==null&&(nu(Dt),Dt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Ie===0&&(Ie=3):pc())),t.updateQueue!==null&&(t.flags|=4),ze(t),null);case 4:return Vr(),Ka(e,t),e===null&&qi(t.stateNode.containerInfo),ze(t),null;case 10:return Xu(t.type._context),ze(t),null;case 17:return Ze(t.type)&&ws(),ze(t),null;case 19:if(me(xe),o=t.memoizedState,o===null)return ze(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)fi(o,!1);else{if(Ie!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=js(e),s!==null){for(t.flags|=128,fi(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return he(xe,xe.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ce()>Gr&&(t.flags|=128,r=!0,fi(o,!1),t.lanes=4194304)}else{if(!r)if(e=js(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ge)return ze(t),null}else 2*Ce()-o.renderingStartTime>Gr&&n!==1073741824&&(t.flags|=128,r=!0,fi(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=xe.current,he(xe,r?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return hc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function hk(e,t){switch(Gu(t),t.tag){case 1:return Ze(t.type)&&ws(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vr(),me(Je),me(Ue),nc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tc(t),null;case 13:if(me(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Hr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(xe),null;case 4:return Vr(),null;case 10:return Xu(t.type._context),null;case 22:case 23:return hc(),null;case 24:return null;default:return null}}var Do=!1,Me=!1,pk=typeof WeakSet=="function"?WeakSet:Set,K=null;function Ar(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function Qa(e,t,n){try{n()}catch(r){we(e,t,r)}}var of=!1;function mk(e,t){if(Ra=ys,e=Hp(),Vu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,c=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(u=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++c===i&&(l=s),h===o&&++f===r&&(u=s),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pa={focusedElem:e,selectionRange:n},ys=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,S=g.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:It(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(T){we(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return g=of,of=!1,g}function Ii(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Qa(t,n,o)}i=i.next}while(i!==r)}}function Ys(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ya(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mm(e){var t=e.alternate;t!==null&&(e.alternate=null,Mm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kt],delete t[Ki],delete t[Oa],delete t[Xv],delete t[Jv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Bm(e){return e.tag===5||e.tag===3||e.tag===4}function sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ks));else if(r!==4&&(e=e.child,e!==null))for(Xa(e,t,n),e=e.sibling;e!==null;)Xa(e,t,n),e=e.sibling}function Ja(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ja(e,t,n),e=e.sibling;e!==null;)Ja(e,t,n),e=e.sibling}var Pe=null,Rt=!1;function vn(e,t,n){for(n=n.child;n!==null;)Um(e,t,n),n=n.sibling}function Um(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount($s,n)}catch{}switch(n.tag){case 5:Me||Ar(n,t);case 6:var r=Pe,i=Rt;Pe=null,vn(e,t,n),Pe=r,Rt=i,Pe!==null&&(Rt?(e=Pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pe.removeChild(n.stateNode));break;case 18:Pe!==null&&(Rt?(e=Pe,n=n.stateNode,e.nodeType===8?Rl(e.parentNode,n):e.nodeType===1&&Rl(e,n),Hi(e)):Rl(Pe,n.stateNode));break;case 4:r=Pe,i=Rt,Pe=n.stateNode.containerInfo,Rt=!0,vn(e,t,n),Pe=r,Rt=i;break;case 0:case 11:case 14:case 15:if(!Me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Qa(n,t,s),i=i.next}while(i!==r)}vn(e,t,n);break;case 1:if(!Me&&(Ar(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){we(n,t,l)}vn(e,t,n);break;case 21:vn(e,t,n);break;case 22:n.mode&1?(Me=(r=Me)||n.memoizedState!==null,vn(e,t,n),Me=r):vn(e,t,n);break;default:vn(e,t,n)}}function lf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pk),t.forEach(function(r){var i=Ek.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Pe=l.stateNode,Rt=!1;break e;case 3:Pe=l.stateNode.containerInfo,Rt=!0;break e;case 4:Pe=l.stateNode.containerInfo,Rt=!0;break e}l=l.return}if(Pe===null)throw Error(F(160));Um(o,s,i),Pe=null,Rt=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){we(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$m(t,e),t=t.sibling}function $m(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),$t(e),r&4){try{Ii(3,e,e.return),Ys(3,e)}catch(v){we(e,e.return,v)}try{Ii(5,e,e.return)}catch(v){we(e,e.return,v)}}break;case 1:jt(t,e),$t(e),r&512&&n!==null&&Ar(n,n.return);break;case 5:if(jt(t,e),$t(e),r&512&&n!==null&&Ar(n,n.return),e.flags&32){var i=e.stateNode;try{Mi(i,"")}catch(v){we(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&cp(i,o),Sa(l,s);var c=Sa(l,o);for(s=0;s<u.length;s+=2){var f=u[s],d=u[s+1];f==="style"?mp(i,d):f==="dangerouslySetInnerHTML"?hp(i,d):f==="children"?Mi(i,d):Ru(i,f,d,c)}switch(l){case"input":ya(i,o);break;case"textarea":dp(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Pr(i,!!o.multiple,p,!1):h!==!!o.multiple&&(o.defaultValue!=null?Pr(i,!!o.multiple,o.defaultValue,!0):Pr(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ki]=o}catch(v){we(e,e.return,v)}}break;case 6:if(jt(t,e),$t(e),r&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){we(e,e.return,v)}}break;case 3:if(jt(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hi(t.containerInfo)}catch(v){we(e,e.return,v)}break;case 4:jt(t,e),$t(e);break;case 13:jt(t,e),$t(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(dc=Ce())),r&4&&lf(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Me=(c=Me)||f,jt(t,e),Me=c):jt(t,e),$t(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(K=e,f=e.child;f!==null;){for(d=K=f;K!==null;){switch(h=K,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ii(4,h,h.return);break;case 1:Ar(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){we(r,n,v)}}break;case 5:Ar(h,h.return);break;case 22:if(h.memoizedState!==null){uf(d);continue}}p!==null?(p.return=h,K=p):uf(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,u=d.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=pp("display",s))}catch(v){we(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){we(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:jt(t,e),$t(e),r&4&&lf(e);break;case 21:break;default:jt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Bm(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Mi(i,""),r.flags&=-33);var o=sf(e);Ja(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=sf(e);Xa(e,l,s);break;default:throw Error(F(161))}}catch(u){we(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gk(e,t,n){K=e,Hm(e)}function Hm(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var i=K,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Do;if(!s){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Me;l=Do;var c=Me;if(Do=s,(Me=u)&&!c)for(K=i;K!==null;)s=K,u=s.child,s.tag===22&&s.memoizedState!==null?cf(i):u!==null?(u.return=s,K=u):cf(i);for(;o!==null;)K=o,Hm(o),o=o.sibling;K=i,Do=l,Me=c}af(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,K=o):af(e)}}function af(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Me||Ys(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Me)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:It(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Vd(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Vd(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Hi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Me||t.flags&512&&Ya(t)}catch(h){we(t,t.return,h)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function uf(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function cf(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ys(4,t)}catch(u){we(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){we(t,i,u)}}var o=t.return;try{Ya(t)}catch(u){we(t,o,u)}break;case 5:var s=t.return;try{Ya(t)}catch(u){we(t,s,u)}}}catch(u){we(t,t.return,u)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var yk=Math.ceil,As=pn.ReactCurrentDispatcher,uc=pn.ReactCurrentOwner,St=pn.ReactCurrentBatchConfig,oe=0,Re=null,be=null,De=0,ot=0,Rr=$n(0),Ie=0,eo=null,sr=0,Xs=0,cc=0,Ai=null,Ye=null,dc=0,Gr=1/0,nn=null,Rs=!1,Za=null,Ln=null,Lo=!1,_n=null,Ps=0,Ri=0,eu=null,ts=-1,ns=0;function Ve(){return oe&6?Ce():ts!==-1?ts:ts=Ce()}function On(e){return e.mode&1?oe&2&&De!==0?De&-De:ek.transition!==null?(ns===0&&(ns=Tp()),ns):(e=ae,e!==0||(e=window.event,e=e===void 0?16:Dp(e.type)),e):1}function Ft(e,t,n,r){if(50<Ri)throw Ri=0,eu=null,Error(F(185));lo(e,n,r),(!(oe&2)||e!==Re)&&(e===Re&&(!(oe&2)&&(Xs|=n),Ie===4&&bn(e,De)),et(e,r),n===1&&oe===0&&!(t.mode&1)&&(Gr=Ce()+500,Gs&&Hn()))}function et(e,t){var n=e.callbackNode;ev(e,t);var r=gs(e,e===Re?De:0);if(r===0)n!==null&&xd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xd(n),t===1)e.tag===0?Zv(df.bind(null,e)):Zp(df.bind(null,e)),Qv(function(){!(oe&6)&&Hn()}),n=null;else{switch(jp(r)){case 1:n=Fu;break;case 4:n=bp;break;case 16:n=ms;break;case 536870912:n=Np;break;default:n=ms}n=Xm(n,Wm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Wm(e,t){if(ts=-1,ns=0,oe&6)throw Error(F(327));var n=e.callbackNode;if(zr()&&e.callbackNode!==n)return null;var r=gs(e,e===Re?De:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ds(e,r);else{t=r;var i=oe;oe|=2;var o=qm();(Re!==e||De!==t)&&(nn=null,Gr=Ce()+500,tr(e,t));do try{kk();break}catch(l){Vm(e,l)}while(!0);Yu(),As.current=o,oe=i,be!==null?t=0:(Re=null,De=0,t=Ie)}if(t!==0){if(t===2&&(i=Ta(e),i!==0&&(r=i,t=tu(e,i))),t===1)throw n=eo,tr(e,0),bn(e,r),et(e,Ce()),n;if(t===6)bn(e,r);else{if(i=e.current.alternate,!(r&30)&&!xk(i)&&(t=Ds(e,r),t===2&&(o=Ta(e),o!==0&&(r=o,t=tu(e,o))),t===1))throw n=eo,tr(e,0),bn(e,r),et(e,Ce()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:Qn(e,Ye,nn);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=dc+500-Ce(),10<t)){if(gs(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ve(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=La(Qn.bind(null,e,Ye,nn),t);break}Qn(e,Ye,nn);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Ot(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yk(r/1960))-r,10<r){e.timeoutHandle=La(Qn.bind(null,e,Ye,nn),r);break}Qn(e,Ye,nn);break;case 5:Qn(e,Ye,nn);break;default:throw Error(F(329))}}}return et(e,Ce()),e.callbackNode===n?Wm.bind(null,e):null}function tu(e,t){var n=Ai;return e.current.memoizedState.isDehydrated&&(tr(e,t).flags|=256),e=Ds(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&nu(t)),e}function nu(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function xk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Mt(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bn(e,t){for(t&=~cc,t&=~Xs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ot(t),r=1<<n;e[n]=-1,t&=~r}}function df(e){if(oe&6)throw Error(F(327));zr();var t=gs(e,0);if(!(t&1))return et(e,Ce()),null;var n=Ds(e,t);if(e.tag!==0&&n===2){var r=Ta(e);r!==0&&(t=r,n=tu(e,r))}if(n===1)throw n=eo,tr(e,0),bn(e,t),et(e,Ce()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Qn(e,Ye,nn),et(e,Ce()),null}function fc(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(Gr=Ce()+500,Gs&&Hn())}}function lr(e){_n!==null&&_n.tag===0&&!(oe&6)&&zr();var t=oe;oe|=1;var n=St.transition,r=ae;try{if(St.transition=null,ae=1,e)return e()}finally{ae=r,St.transition=n,oe=t,!(oe&6)&&Hn()}}function hc(){ot=Rr.current,me(Rr)}function tr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Kv(n)),be!==null)for(n=be.return;n!==null;){var r=n;switch(Gu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ws();break;case 3:Vr(),me(Je),me(Ue),nc();break;case 5:tc(r);break;case 4:Vr();break;case 13:me(xe);break;case 19:me(xe);break;case 10:Xu(r.type._context);break;case 22:case 23:hc()}n=n.return}if(Re=e,be=e=Fn(e.current,null),De=ot=t,Ie=0,eo=null,cc=Xs=sr=0,Ye=Ai=null,Jn!==null){for(t=0;t<Jn.length;t++)if(n=Jn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Jn=null}return e}function Vm(e,t){do{var n=be;try{if(Yu(),Jo.current=Is,_s){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}_s=!1}if(or=0,Ae=_e=ve=null,_i=!1,Xi=0,uc.current=null,n===null||n.return===null){Ie=1,eo=t,be=null;break}e:{var o=e,s=n.return,l=n,u=t;if(t=De,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=Xd(s);if(p!==null){p.flags&=-257,Jd(p,s,l,o,t),p.mode&1&&Yd(o,c,t),t=p,u=c;var g=t.updateQueue;if(g===null){var v=new Set;v.add(u),t.updateQueue=v}else g.add(u);break e}else{if(!(t&1)){Yd(o,c,t),pc();break e}u=Error(F(426))}}else if(ge&&l.mode&1){var S=Xd(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Jd(S,s,l,o,t),Ku(qr(u,l));break e}}o=u=qr(u,l),Ie!==4&&(Ie=2),Ai===null?Ai=[o]:Ai.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var y=jm(o,u,t);Wd(o,y);break e;case 1:l=u;var m=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ln===null||!Ln.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var T=_m(o,l,t);Wd(o,T);break e}}o=o.return}while(o!==null)}Km(n)}catch(j){t=j,be===n&&n!==null&&(be=n=n.return);continue}break}while(!0)}function qm(){var e=As.current;return As.current=Is,e===null?Is:e}function pc(){(Ie===0||Ie===3||Ie===2)&&(Ie=4),Re===null||!(sr&268435455)&&!(Xs&268435455)||bn(Re,De)}function Ds(e,t){var n=oe;oe|=2;var r=qm();(Re!==e||De!==t)&&(nn=null,tr(e,t));do try{vk();break}catch(i){Vm(e,i)}while(!0);if(Yu(),oe=n,As.current=r,be!==null)throw Error(F(261));return Re=null,De=0,Ie}function vk(){for(;be!==null;)Gm(be)}function kk(){for(;be!==null&&!Vx();)Gm(be)}function Gm(e){var t=Ym(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?Km(e):be=t,uc.current=null}function Km(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=hk(n,t),n!==null){n.flags&=32767,be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ie=6,be=null;return}}else if(n=fk(n,t,ot),n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ie===0&&(Ie=5)}function Qn(e,t,n){var r=ae,i=St.transition;try{St.transition=null,ae=1,wk(e,t,n,r)}finally{St.transition=i,ae=r}return null}function wk(e,t,n,r){do zr();while(_n!==null);if(oe&6)throw Error(F(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(tv(e,o),e===Re&&(be=Re=null,De=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Lo||(Lo=!0,Xm(ms,function(){return zr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=St.transition,St.transition=null;var s=ae;ae=1;var l=oe;oe|=4,uc.current=null,mk(e,n),$m(n,e),Uv(Pa),ys=!!Ra,Pa=Ra=null,e.current=n,gk(n),qx(),oe=l,ae=s,St.transition=o}else e.current=n;if(Lo&&(Lo=!1,_n=e,Ps=i),o=e.pendingLanes,o===0&&(Ln=null),Qx(n.stateNode),et(e,Ce()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Rs)throw Rs=!1,e=Za,Za=null,e;return Ps&1&&e.tag!==0&&zr(),o=e.pendingLanes,o&1?e===eu?Ri++:(Ri=0,eu=e):Ri=0,Hn(),null}function zr(){if(_n!==null){var e=jp(Ps),t=St.transition,n=ae;try{if(St.transition=null,ae=16>e?16:e,_n===null)var r=!1;else{if(e=_n,_n=null,Ps=0,oe&6)throw Error(F(331));var i=oe;for(oe|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(K=c;K!==null;){var f=K;switch(f.tag){case 0:case 11:case 15:Ii(8,f,o)}var d=f.child;if(d!==null)d.return=f,K=d;else for(;K!==null;){f=K;var h=f.sibling,p=f.return;if(Mm(f),f===c){K=null;break}if(h!==null){h.return=p,K=h;break}K=p}}}var g=o.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}K=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,K=s;else e:for(;K!==null;){if(o=K,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ii(9,o,o.return)}var y=o.sibling;if(y!==null){y.return=o.return,K=y;break e}K=o.return}}var m=e.current;for(K=m;K!==null;){s=K;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,K=x;else e:for(s=m;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ys(9,l)}}catch(j){we(l,l.return,j)}if(l===s){K=null;break e}var T=l.sibling;if(T!==null){T.return=l.return,K=T;break e}K=l.return}}if(oe=i,Hn(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot($s,e)}catch{}r=!0}return r}finally{ae=n,St.transition=t}}return!1}function ff(e,t,n){t=qr(n,t),t=jm(e,t,1),e=Dn(e,t,1),t=Ve(),e!==null&&(lo(e,1,t),et(e,t))}function we(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=qr(n,e),e=_m(t,e,1),t=Dn(t,e,1),e=Ve(),t!==null&&(lo(t,1,e),et(t,e));break}}t=t.return}}function Sk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ve(),e.pingedLanes|=e.suspendedLanes&n,Re===e&&(De&n)===n&&(Ie===4||Ie===3&&(De&130023424)===De&&500>Ce()-dc?tr(e,0):cc|=n),et(e,t)}function Qm(e,t){t===0&&(e.mode&1?(t=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):t=1);var n=Ve();e=dn(e,t),e!==null&&(lo(e,t,n),et(e,n))}function Ck(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qm(e,n)}function Ek(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),Qm(e,n)}var Ym;Ym=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xe=!1,dk(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,ge&&t.flags&1048576&&em(t,Es,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;es(e,t),e=t.pendingProps;var i=$r(t,Ue.current);Fr(t,n),i=ic(null,t,r,e,i,n);var o=oc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(r)?(o=!0,Ss(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zu(t),i.updater=Qs,t.stateNode=i,i._reactInternals=t,$a(t,r,e,n),t=Va(null,t,r,!0,o,n)):(t.tag=0,ge&&o&&qu(t),He(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(es(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Nk(r),e=It(r,e),i){case 0:t=Wa(null,t,r,e,n);break e;case 1:t=tf(null,t,r,e,n);break e;case 11:t=Zd(null,t,r,e,n);break e;case 14:t=ef(null,t,r,It(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Wa(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),tf(e,t,r,i,n);case 3:e:{if(Pm(t),e===null)throw Error(F(387));r=t.pendingProps,o=t.memoizedState,i=o.element,sm(e,t),Ts(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=qr(Error(F(423)),t),t=nf(e,t,r,n,i);break e}else if(r!==i){i=qr(Error(F(424)),t),t=nf(e,t,r,n,i);break e}else for(st=Pn(t.stateNode.containerInfo.firstChild),lt=t,ge=!0,Dt=null,n=im(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hr(),r===i){t=fn(e,t,n);break e}He(e,t,r,n)}t=t.child}return t;case 5:return lm(t),e===null&&Ma(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Da(r,i)?s=null:o!==null&&Da(r,o)&&(t.flags|=32),Rm(e,t),He(e,t,s,n),t.child;case 6:return e===null&&Ma(t),null;case 13:return Dm(e,t,n);case 4:return ec(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wr(t,null,r,n):He(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Zd(e,t,r,i,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,he(bs,r._currentValue),r._currentValue=s,o!==null)if(Mt(o.value,s)){if(o.children===i.children&&!Je.current){t=fn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=ln(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ba(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(F(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ba(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}He(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Fr(t,n),i=Ct(i),r=r(i),t.flags|=1,He(e,t,r,n),t.child;case 14:return r=t.type,i=It(r,t.pendingProps),i=It(r.type,i),ef(e,t,r,i,n);case 15:return Im(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),es(e,t),t.tag=1,Ze(r)?(e=!0,Ss(t)):e=!1,Fr(t,n),Tm(t,r,i),$a(t,r,i,n),Va(null,t,r,!0,e,n);case 19:return Lm(e,t,n);case 22:return Am(e,t,n)}throw Error(F(156,t.tag))};function Xm(e,t){return Ep(e,t)}function bk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,n,r){return new bk(e,t,n,r)}function mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nk(e){if(typeof e=="function")return mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Du)return 11;if(e===Lu)return 14}return 2}function Fn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function rs(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")mc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sr:return nr(n.children,i,o,t);case Pu:s=8,i|=8;break;case fa:return e=wt(12,n,t,i|2),e.elementType=fa,e.lanes=o,e;case ha:return e=wt(13,n,t,i),e.elementType=ha,e.lanes=o,e;case pa:return e=wt(19,n,t,i),e.elementType=pa,e.lanes=o,e;case lp:return Js(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case op:s=10;break e;case sp:s=9;break e;case Du:s=11;break e;case Lu:s=14;break e;case wn:s=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=wt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function nr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function Js(e,t,n,r){return e=wt(22,e,r,t),e.elementType=lp,e.lanes=n,e.stateNode={isHidden:!1},e}function Bl(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function Ul(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wl(0),this.expirationTimes=wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gc(e,t,n,r,i,o,s,l,u){return e=new Tk(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=wt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zu(o),e}function jk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Jm(e){if(!e)return Bn;e=e._reactInternals;e:{if(dr(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(Ze(n))return Jp(e,n,t)}return t}function Zm(e,t,n,r,i,o,s,l,u){return e=gc(n,r,!0,e,i,o,s,l,u),e.context=Jm(null),n=e.current,r=Ve(),i=On(n),o=ln(r,i),o.callback=t??null,Dn(n,o,i),e.current.lanes=i,lo(e,i,r),et(e,r),e}function Zs(e,t,n,r){var i=t.current,o=Ve(),s=On(i);return n=Jm(n),t.context===null?t.context=n:t.pendingContext=n,t=ln(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dn(i,t,s),e!==null&&(Ft(e,i,s,o),Xo(e,i,s)),s}function Ls(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function hf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yc(e,t){hf(e,t),(e=e.alternate)&&hf(e,t)}function _k(){return null}var eg=typeof reportError=="function"?reportError:function(e){console.error(e)};function xc(e){this._internalRoot=e}el.prototype.render=xc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Zs(e,t,null,null)};el.prototype.unmount=xc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lr(function(){Zs(null,e,null,null)}),t[cn]=null}};function el(e){this._internalRoot=e}el.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ap();e={blockedOn:null,target:e,priority:t};for(var n=0;n<En.length&&t!==0&&t<En[n].priority;n++);En.splice(n,0,e),n===0&&Pp(e)}};function vc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pf(){}function Ik(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=Ls(s);o.call(c)}}var s=Zm(t,r,e,0,null,!1,!1,"",pf);return e._reactRootContainer=s,e[cn]=s.current,qi(e.nodeType===8?e.parentNode:e),lr(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var c=Ls(u);l.call(c)}}var u=gc(e,0,!1,null,null,!1,!1,"",pf);return e._reactRootContainer=u,e[cn]=u.current,qi(e.nodeType===8?e.parentNode:e),lr(function(){Zs(t,u,n,r)}),u}function nl(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var u=Ls(s);l.call(u)}}Zs(t,s,e,i)}else s=Ik(n,t,e,i,r);return Ls(s)}_p=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wi(t.pendingLanes);n!==0&&(zu(t,n|1),et(t,Ce()),!(oe&6)&&(Gr=Ce()+500,Hn()))}break;case 13:lr(function(){var r=dn(e,1);if(r!==null){var i=Ve();Ft(r,e,1,i)}}),yc(e,1)}};Mu=function(e){if(e.tag===13){var t=dn(e,134217728);if(t!==null){var n=Ve();Ft(t,e,134217728,n)}yc(e,134217728)}};Ip=function(e){if(e.tag===13){var t=On(e),n=dn(e,t);if(n!==null){var r=Ve();Ft(n,e,t,r)}yc(e,t)}};Ap=function(){return ae};Rp=function(e,t){var n=ae;try{return ae=e,t()}finally{ae=n}};Ea=function(e,t,n){switch(t){case"input":if(ya(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=qs(r);if(!i)throw Error(F(90));up(r),ya(r,i)}}}break;case"textarea":dp(e,n);break;case"select":t=n.value,t!=null&&Pr(e,!!n.multiple,t,!1)}};xp=fc;vp=lr;var Ak={usingClientEntryPoint:!1,Events:[uo,Nr,qs,gp,yp,fc]},hi={findFiberByHostInstance:Xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Rk={bundleType:hi.bundleType,version:hi.version,rendererPackageName:hi.rendererPackageName,rendererConfig:hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:pn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Sp(e),e===null?null:e.stateNode},findFiberByHostInstance:hi.findFiberByHostInstance||_k,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oo.isDisabled&&Oo.supportsFiber)try{$s=Oo.inject(Rk),Qt=Oo}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ak;dt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vc(t))throw Error(F(200));return jk(e,t,null,n)};dt.createRoot=function(e,t){if(!vc(e))throw Error(F(299));var n=!1,r="",i=eg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=gc(e,1,!1,null,null,n,!1,r,i),e[cn]=t.current,qi(e.nodeType===8?e.parentNode:e),new xc(t)};dt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=Sp(t),e=e===null?null:e.stateNode,e};dt.flushSync=function(e){return lr(e)};dt.hydrate=function(e,t,n){if(!tl(t))throw Error(F(200));return nl(null,e,t,!0,n)};dt.hydrateRoot=function(e,t,n){if(!vc(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=eg;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Zm(t,null,e,1,n??null,i,!1,o,s),e[cn]=t.current,qi(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new el(t)};dt.render=function(e,t,n){if(!tl(t))throw Error(F(200));return nl(null,e,t,!1,n)};dt.unmountComponentAtNode=function(e){if(!tl(e))throw Error(F(40));return e._reactRootContainer?(lr(function(){nl(null,null,e,!1,function(){e._reactRootContainer=null,e[cn]=null})}),!0):!1};dt.unstable_batchedUpdates=fc;dt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!tl(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return nl(e,t,n,!1,r)};dt.version="18.3.1-next-f1338f8080-20240426";function tg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tg)}catch(e){console.error(e)}}tg(),tp.exports=dt;var Pk=tp.exports,ng,mf=Pk;ng=mf.createRoot,mf.hydrateRoot;/**
41
- * react-router v7.11.0
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var gf="popstate";function Dk(e={}){function t(r,i){let{pathname:o,search:s,hash:l}=r.location;return ru("",{pathname:o,search:s,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:to(i)}return Ok(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ct(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lk(){return Math.random().toString(36).substring(2,10)}function yf(e,t){return{usr:e.state,key:e.key,idx:t}}function ru(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Jr(t):t,state:n,key:t&&t.key||r||Lk()}}function to({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Jr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ok(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l="POP",u=null,c=f();c==null&&(c=0,s.replaceState({...s.state,idx:c},""));function f(){return(s.state||{idx:null}).idx}function d(){l="POP";let S=f(),y=S==null?null:S-c;c=S,u&&u({action:l,location:v.location,delta:y})}function h(S,y){l="PUSH";let m=ru(v.location,S,y);c=f()+1;let x=yf(m,c),T=v.createHref(m);try{s.pushState(x,"",T)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(T)}o&&u&&u({action:l,location:v.location,delta:1})}function p(S,y){l="REPLACE";let m=ru(v.location,S,y);c=f();let x=yf(m,c),T=v.createHref(m);s.replaceState(x,"",T),o&&u&&u({action:l,location:v.location,delta:0})}function g(S){return Fk(S)}let v={get action(){return l},get location(){return e(i,s)},listen(S){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(gf,d),u=S,()=>{i.removeEventListener(gf,d),u=null}},createHref(S){return t(i,S)},createURL:g,encodeLocation(S){let y=g(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(S){return s.go(S)}};return v}function Fk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ye(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:to(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function rg(e,t,n="/"){return zk(e,t,n,!1)}function zk(e,t,n,r){let i=typeof t=="string"?Jr(t):t,o=hn(i.pathname||"/",n);if(o==null)return null;let s=ig(e);Mk(s);let l=null;for(let u=0;l==null&&u<s.length;++u){let c=Yk(o);l=Kk(s[u],c,r)}return l}function ig(e,t=[],n=[],r="",i=!1){let o=(s,l,u=i,c)=>{let f={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&u)return;ye(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let d=an([r,f.relativePath]),h=n.concat(f);s.children&&s.children.length>0&&(ye(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),ig(s.children,t,h,d,u)),!(s.path==null&&!s.index)&&t.push({path:d,score:qk(d,s.index),routesMeta:h})};return e.forEach((s,l)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))o(s,l);else for(let c of og(s.path))o(s,l,!0,c)}),t}function og(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=og(r.join("/")),l=[];return l.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...s),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function Mk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Gk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Bk=/^:[\w-]+$/,Uk=3,$k=2,Hk=1,Wk=10,Vk=-2,xf=e=>e==="*";function qk(e,t){let n=e.split("/"),r=n.length;return n.some(xf)&&(r+=Vk),t&&(r+=$k),n.filter(i=>!xf(i)).reduce((i,o)=>i+(Bk.test(o)?Uk:o===""?Hk:Wk),r)}function Gk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Kk(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",s=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",d=Os({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),h=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Os({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:an([o,d.pathname]),pathnameBase:ew(an([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=an([o,d.pathnameBase]))}return s}function Os(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Qk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:d},h)=>{if(f==="*"){let g=l[h]||"";s=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const p=l[h];return d&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:e}}function Qk(e,t=!1,n=!0){ct(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ct(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function hn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var sg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xk=e=>sg.test(e);function Jk(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Jr(e):e,o;if(n)if(Xk(n))o=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),ct(!1,`Pathnames cannot have embedded double slashes - normalizing ${s} -> ${n}`)}n.startsWith("/")?o=vf(n.substring(1),"/"):o=vf(n,t)}else o=t;return{pathname:o,search:tw(r),hash:nw(i)}}function vf(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function $l(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kc(e){let t=Zk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function wc(e,t,n,r=!1){let i;typeof e=="string"?i=Jr(e):(i={...e},ye(!i.pathname||!i.pathname.includes("?"),$l("?","pathname","search",i)),ye(!i.pathname||!i.pathname.includes("#"),$l("#","pathname","hash",i)),ye(!i.search||!i.search.includes("#"),$l("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(s==null)l=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}l=d>=0?t[d]:"/"}let u=Jk(i,l),c=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}var an=e=>e.join("/").replace(/\/\/+/g,"/"),ew=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),tw=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,nw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,rw=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function iw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ow(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ag(e,t){let n=e;if(typeof n!="string"||!sg.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(lg)try{let o=new URL(window.location.href),s=n.startsWith("//")?new URL(o.protocol+n):new URL(n),l=hn(s.pathname,t);s.origin===o.origin&&l!=null?n=l+s.search+s.hash:i=!0}catch{ct(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ug=["POST","PUT","PATCH","DELETE"];new Set(ug);var sw=["GET",...ug];new Set(sw);var Zr=k.createContext(null);Zr.displayName="DataRouter";var rl=k.createContext(null);rl.displayName="DataRouterState";var lw=k.createContext(!1),cg=k.createContext({isTransitioning:!1});cg.displayName="ViewTransition";var aw=k.createContext(new Map);aw.displayName="Fetchers";var uw=k.createContext(null);uw.displayName="Await";var ht=k.createContext(null);ht.displayName="Navigation";var fo=k.createContext(null);fo.displayName="Location";var bt=k.createContext({outlet:null,matches:[],isDataRoute:!1});bt.displayName="Route";var Sc=k.createContext(null);Sc.displayName="RouteError";var dg="REACT_ROUTER_ERROR",cw="REDIRECT",dw="ROUTE_ERROR_RESPONSE";function fw(e){if(e.startsWith(`${dg}:${cw}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function hw(e){if(e.startsWith(`${dg}:${dw}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new rw(t.status,t.statusText,t.data)}catch{}}function pw(e,{relative:t}={}){ye(ei(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=k.useContext(ht),{hash:i,pathname:o,search:s}=ho(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:an([n,o])),r.createHref({pathname:l,search:s,hash:i})}function ei(){return k.useContext(fo)!=null}function pt(){return ye(ei(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(fo).location}var fg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hg(e){k.useContext(ht).static||k.useLayoutEffect(e)}function Oe(){let{isDataRoute:e}=k.useContext(bt);return e?_w():mw()}function mw(){ye(ei(),"useNavigate() may be used only in the context of a <Router> component.");let e=k.useContext(Zr),{basename:t,navigator:n}=k.useContext(ht),{matches:r}=k.useContext(bt),{pathname:i}=pt(),o=JSON.stringify(kc(r)),s=k.useRef(!1);return hg(()=>{s.current=!0}),k.useCallback((u,c={})=>{if(ct(s.current,fg),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=wc(u,JSON.parse(o),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:an([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,i,e])}var gw=k.createContext(null);function yw(e){let t=k.useContext(bt).outlet;return k.useMemo(()=>t&&k.createElement(gw.Provider,{value:e},t),[t,e])}function fr(){let{matches:e}=k.useContext(bt),t=e[e.length-1];return t?t.params:{}}function ho(e,{relative:t}={}){let{matches:n}=k.useContext(bt),{pathname:r}=pt(),i=JSON.stringify(kc(n));return k.useMemo(()=>wc(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function xw(e,t){return pg(e,t)}function pg(e,t,n,r,i){var m;ye(ei(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=k.useContext(ht),{matches:s}=k.useContext(bt),l=s[s.length-1],u=l?l.params:{},c=l?l.pathname:"/",f=l?l.pathnameBase:"/",d=l&&l.route;{let x=d&&d.path||"";gg(c,!d||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${x}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let h=pt(),p;if(t){let x=typeof t=="string"?Jr(t):t;ye(f==="/"||((m=x.pathname)==null?void 0:m.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${x.pathname}" was given in the \`location\` prop.`),p=x}else p=h;let g=p.pathname||"/",v=g;if(f!=="/"){let x=f.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let S=rg(e,{pathname:v});ct(d||S!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ct(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Cw(S&&S.map(x=>Object.assign({},x,{params:Object.assign({},u,x.params),pathname:an([f,o.encodeLocation?o.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?f:an([f,o.encodeLocation?o.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),s,n,r,i);return t&&y?k.createElement(fo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},y):y}function vw(){let e=jw(),t=iw(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:o},"ErrorBoundary")," or"," ",k.createElement("code",{style:o},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:i},n):null,s)}var kw=k.createElement(vw,null),mg=class extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=hw(e.digest);n&&(e=n)}let t=e!==void 0?k.createElement(bt.Provider,{value:this.props.routeContext},k.createElement(Sc.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?k.createElement(ww,{error:e},t):t}};mg.contextType=lw;var Hl=new WeakMap;function ww({children:e,error:t}){let{basename:n}=k.useContext(ht);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=fw(t.digest);if(r){let i=Hl.get(t);if(i)throw i;let o=ag(r.location,n);if(lg&&!Hl.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Hl.set(t,s),s}return k.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Sw({routeContext:e,match:t,children:n}){let r=k.useContext(Zr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),k.createElement(bt.Provider,{value:e},n)}function Cw(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n==null?void 0:n.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);ye(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(n)for(let f=0;f<o.length;f++){let d=o[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:p}=n,g=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}let c=n&&r?(f,d)=>{var h,p;r(f,{location:n.location,params:((p=(h=n.matches)==null?void 0:h[0])==null?void 0:p.params)??{},unstable_pattern:ow(n.matches),errorInfo:d})}:void 0;return o.reduceRight((f,d,h)=>{let p,g=!1,v=null,S=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||kw,l&&(u<0&&h===0?(gg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,S=null):u===h&&(g=!0,S=d.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),m=()=>{let x;return p?x=v:g?x=S:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,k.createElement(Sw,{match:d,routeContext:{outlet:f,matches:y,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(mg,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:c}):m()},null)}function Cc(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ew(e){let t=k.useContext(Zr);return ye(t,Cc(e)),t}function bw(e){let t=k.useContext(rl);return ye(t,Cc(e)),t}function Nw(e){let t=k.useContext(bt);return ye(t,Cc(e)),t}function Ec(e){let t=Nw(e),n=t.matches[t.matches.length-1];return ye(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Tw(){return Ec("useRouteId")}function jw(){var r;let e=k.useContext(Sc),t=bw("useRouteError"),n=Ec("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _w(){let{router:e}=Ew("useNavigate"),t=Ec("useNavigate"),n=k.useRef(!1);return hg(()=>{n.current=!0}),k.useCallback(async(i,o={})=>{ct(n.current,fg),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var kf={};function gg(e,t,n){!t&&!kf[e]&&(kf[e]=!0,ct(!1,n))}k.memo(Iw);function Iw({routes:e,future:t,state:n,onError:r}){return pg(e,void 0,n,r,t)}function Aw({to:e,replace:t,state:n,relative:r}){ye(ei(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=k.useContext(ht);ct(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=k.useContext(bt),{pathname:s}=pt(),l=Oe(),u=wc(e,kc(o),s,r==="path"),c=JSON.stringify(u);return k.useEffect(()=>{l(JSON.parse(c),{replace:t,state:n,relative:r})},[l,c,r,t,n]),null}function bc(e){return yw(e.context)}function je(e){ye(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Rw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:s}){ye(!ei(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:i,static:o,unstable_useTransitions:s,future:{}}),[l,i,o,s]);typeof n=="string"&&(n=Jr(n));let{pathname:c="/",search:f="",hash:d="",state:h=null,key:p="default"}=n,g=k.useMemo(()=>{let v=hn(c,l);return v==null?null:{location:{pathname:v,search:f,hash:d,state:h,key:p},navigationType:r}},[l,c,f,d,h,p,r]);return ct(g!=null,`<Router basename="${l}"> is not able to match the URL "${c}${f}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:k.createElement(ht.Provider,{value:u},k.createElement(fo.Provider,{children:t,value:g}))}function Pw({children:e,location:t}){return xw(iu(e),t)}function iu(e,t=[]){let n=[];return k.Children.forEach(e,(r,i)=>{if(!k.isValidElement(r))return;let o=[...t,i];if(r.type===k.Fragment){n.push.apply(n,iu(r.props.children,o));return}ye(r.type===je,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ye(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=iu(r.props.children,o)),n.push(s)}),n}var is="get",os="application/x-www-form-urlencoded";function il(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Dw(e){return il(e)&&e.tagName.toLowerCase()==="button"}function Lw(e){return il(e)&&e.tagName.toLowerCase()==="form"}function Ow(e){return il(e)&&e.tagName.toLowerCase()==="input"}function Fw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zw(e,t){return e.button===0&&(!t||t==="_self")&&!Fw(e)}function ou(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Mw(e,t){let n=ou(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Fo=null;function Bw(){if(Fo===null)try{new FormData(document.createElement("form"),0),Fo=!1}catch{Fo=!0}return Fo}var Uw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wl(e){return e!=null&&!Uw.has(e)?(ct(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${os}"`),null):e}function $w(e,t){let n,r,i,o,s;if(Lw(e)){let l=e.getAttribute("action");r=l?hn(l,t):null,n=e.getAttribute("method")||is,i=Wl(e.getAttribute("enctype"))||os,o=new FormData(e)}else if(Dw(e)||Ow(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?hn(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||is,i=Wl(e.getAttribute("formenctype"))||Wl(l.getAttribute("enctype"))||os,o=new FormData(l,e),!Bw()){let{name:c,type:f,value:d}=e;if(f==="image"){let h=c?`${c}.`:"";o.append(`${h}x`,"0"),o.append(`${h}y`,"0")}else c&&o.append(c,d)}}else{if(il(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=is,r=null,i=os,s=e}return o&&i==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Nc(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hw(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&hn(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function Ww(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function qw(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let s=await Ww(o,n);return s.links?s.links():[]}return[]}));return Yw(r.flat(1).filter(Vw).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function wf(e,t,n,r,i,o){let s=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,l=(u,c)=>{var f;return n[c].pathname!==u.pathname||((f=n[c].route.path)==null?void 0:f.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>s(u,c)||l(u,c)):o==="data"?t.filter((u,c)=>{var d;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(s(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let h=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function Gw(e,t,{includeHydrateFallback:n}={}){return Kw(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function Kw(e){return[...new Set(e)]}function Qw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Yw(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(Qw(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function yg(){let e=k.useContext(Zr);return Nc(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Xw(){let e=k.useContext(rl);return Nc(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tc=k.createContext(void 0);Tc.displayName="FrameworkContext";function xg(){let e=k.useContext(Tc);return Nc(e,"You must render this element inside a <HydratedRouter> element"),e}function Jw(e,t){let n=k.useContext(Tc),[r,i]=k.useState(!1),[o,s]=k.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:f,onTouchStart:d}=t,h=k.useRef(null);k.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let v=y=>{y.forEach(m=>{s(m.isIntersecting)})},S=new IntersectionObserver(v,{threshold:.5});return h.current&&S.observe(h.current),()=>{S.disconnect()}}},[e]),k.useEffect(()=>{if(r){let v=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(v)}}},[r]);let p=()=>{i(!0)},g=()=>{i(!1),s(!1)};return n?e!=="intent"?[o,h,{}]:[o,h,{onFocus:pi(l,p),onBlur:pi(u,g),onMouseEnter:pi(c,p),onMouseLeave:pi(f,g),onTouchStart:pi(d,p)}]:[!1,h,{}]}function pi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Zw({page:e,...t}){let{router:n}=yg(),r=k.useMemo(()=>rg(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?k.createElement(t1,{page:e,matches:r,...t}):null}function e1(e){let{manifest:t,routeModules:n}=xg(),[r,i]=k.useState([]);return k.useEffect(()=>{let o=!1;return qw(e,t,n).then(s=>{o||i(s)}),()=>{o=!0}},[e,t,n]),r}function t1({page:e,matches:t,...n}){let r=pt(),{manifest:i,routeModules:o}=xg(),{basename:s}=yg(),{loaderData:l,matches:u}=Xw(),c=k.useMemo(()=>wf(e,t,u,i,r,"data"),[e,t,u,i,r]),f=k.useMemo(()=>wf(e,t,u,i,r,"assets"),[e,t,u,i,r]),d=k.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,v=!1;if(t.forEach(y=>{var x;let m=i.routes[y.route.id];!m||!m.hasLoader||(!c.some(T=>T.route.id===y.route.id)&&y.route.id in l&&((x=o[y.route.id])!=null&&x.shouldRevalidate)||m.hasClientLoader?v=!0:g.add(y.route.id))}),g.size===0)return[];let S=Hw(e,s,"data");return v&&g.size>0&&S.searchParams.set("_routes",t.filter(y=>g.has(y.route.id)).map(y=>y.route.id).join(",")),[S.pathname+S.search]},[s,l,r,i,c,t,e,o]),h=k.useMemo(()=>Gw(f,i),[f,i]),p=e1(f);return k.createElement(k.Fragment,null,d.map(g=>k.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),h.map(g=>k.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),p.map(({key:g,link:v})=>k.createElement("link",{key:g,nonce:n.nonce,...v})))}function n1(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var r1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{r1&&(window.__reactRouterVersion="7.11.0")}catch{}function i1({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=k.useRef();i.current==null&&(i.current=Dk({window:r,v5Compat:!0}));let o=i.current,[s,l]=k.useState({action:o.action,location:o.location}),u=k.useCallback(c=>{n===!1?l(c):k.startTransition(()=>l(c))},[n]);return k.useLayoutEffect(()=>o.listen(u),[o,u]),k.createElement(Rw,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:n})}var vg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ar=k.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:s,state:l,target:u,to:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h,...p},g){let{basename:v,unstable_useTransitions:S}=k.useContext(ht),y=typeof c=="string"&&vg.test(c),m=ag(c,v);c=m.to;let x=pw(c,{relative:i}),[T,j,E]=Jw(r,p),_=l1(c,{replace:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:d,unstable_defaultShouldRevalidate:h,unstable_useTransitions:S});function D(b){t&&t(b),b.defaultPrevented||_(b)}let R=k.createElement("a",{...p,...E,href:m.absoluteURL||x,onClick:m.isExternal||o?t:D,ref:n1(g,j),target:u,"data-discover":!y&&n==="render"?"true":void 0});return T&&!y?k.createElement(k.Fragment,null,R,k.createElement(Zw,{page:x})):R});ar.displayName="Link";var su=k.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:s,viewTransition:l,children:u,...c},f){let d=ho(s,{relative:c.relative}),h=pt(),p=k.useContext(rl),{navigator:g,basename:v}=k.useContext(ht),S=p!=null&&h1(d)&&l===!0,y=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,m=h.pathname,x=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(m=m.toLowerCase(),x=x?x.toLowerCase():null,y=y.toLowerCase()),x&&v&&(x=hn(x,v)||x);const T=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let j=m===y||!i&&m.startsWith(y)&&m.charAt(T)==="/",E=x!=null&&(x===y||!i&&x.startsWith(y)&&x.charAt(y.length)==="/"),_={isActive:j,isPending:E,isTransitioning:S},D=j?t:void 0,R;typeof r=="function"?R=r(_):R=[r,j?"active":null,E?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let b=typeof o=="function"?o(_):o;return k.createElement(ar,{...c,"aria-current":D,className:R,ref:f,style:b,to:s,viewTransition:l},typeof u=="function"?u(_):u)});su.displayName="NavLink";var o1=k.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:s=is,action:l,onSubmit:u,relative:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h,...p},g)=>{let{unstable_useTransitions:v}=k.useContext(ht),S=d1(),y=f1(l,{relative:c}),m=s.toLowerCase()==="get"?"get":"post",x=typeof l=="string"&&vg.test(l),T=j=>{if(u&&u(j),j.defaultPrevented)return;j.preventDefault();let E=j.nativeEvent.submitter,_=(E==null?void 0:E.getAttribute("formmethod"))||s,D=()=>S(E||j.currentTarget,{fetcherKey:t,method:_,navigate:n,replace:i,state:o,relative:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h});v&&n!==!1?k.startTransition(()=>D()):D()};return k.createElement("form",{ref:g,method:m,action:y,onSubmit:r?u:T,...p,"data-discover":!x&&e==="render"?"true":void 0})});o1.displayName="Form";function s1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kg(e){let t=k.useContext(Zr);return ye(t,s1(e)),t}function l1(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let c=Oe(),f=pt(),d=ho(e,{relative:o});return k.useCallback(h=>{if(zw(h,t)){h.preventDefault();let p=n!==void 0?n:to(f)===to(d),g=()=>c(e,{replace:p,state:r,preventScrollReset:i,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:l});u?k.startTransition(()=>g()):g()}},[f,c,d,n,r,t,e,i,o,s,l,u])}function a1(e){ct(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=k.useRef(ou(e)),n=k.useRef(!1),r=pt(),i=k.useMemo(()=>Mw(r.search,n.current?null:t.current),[r.search]),o=Oe(),s=k.useCallback((l,u)=>{const c=ou(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,o("?"+c,u)},[o,i]);return[i,s]}var u1=0,c1=()=>`__${String(++u1)}__`;function d1(){let{router:e}=kg("useSubmit"),{basename:t}=k.useContext(ht),n=Tw(),r=e.fetch,i=e.navigate;return k.useCallback(async(o,s={})=>{let{action:l,method:u,encType:c,formData:f,body:d}=$w(o,t);if(s.navigate===!1){let h=s.fetcherKey||c1();await r(h,n,s.action||l,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:d,formMethod:s.method||u,formEncType:s.encType||c,flushSync:s.flushSync})}else await i(s.action||l,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:f,body:d,formMethod:s.method||u,formEncType:s.encType||c,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[r,i,t,n])}function f1(e,{relative:t}={}){let{basename:n}=k.useContext(ht),r=k.useContext(bt);ye(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...ho(e||".",{relative:t})},s=pt();if(e==null){o.search=s.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(f=>f==="")){l.delete("index"),u.filter(d=>d).forEach(d=>l.append("index",d));let f=l.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:an([n,o.pathname])),to(o)}function h1(e,{relative:t}={}){let n=k.useContext(cg);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kg("useViewTransitionState"),i=ho(e,{relative:t});if(!n.isTransitioning)return!1;let o=hn(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=hn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Os(i.pathname,s)!=null||Os(i.pathname,o)!=null}const p1="/beta";class Sf extends Error{constructor(n,r,i){super(i);yr(this,"url");yr(this,"status");yr(this,"statusText");yr(this,"body");yr(this,"request");this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=n}}class m1 extends Error{constructor(t){super(t),this.name="CancelError"}get isCancelled(){return!0}}var qt,Gt,At,Nn,er,Br,Tn;class g1{constructor(t){xn(this,qt);xn(this,Gt);xn(this,At);xn(this,Nn);xn(this,er);xn(this,Br);xn(this,Tn);Tt(this,qt,!1),Tt(this,Gt,!1),Tt(this,At,!1),Tt(this,Nn,[]),Tt(this,er,new Promise((n,r)=>{Tt(this,Br,n),Tt(this,Tn,r);const i=l=>{le(this,qt)||le(this,Gt)||le(this,At)||(Tt(this,qt,!0),le(this,Br)&&le(this,Br).call(this,l))},o=l=>{le(this,qt)||le(this,Gt)||le(this,At)||(Tt(this,Gt,!0),le(this,Tn)&&le(this,Tn).call(this,l))},s=l=>{le(this,qt)||le(this,Gt)||le(this,At)||le(this,Nn).push(l)};return Object.defineProperty(s,"isResolved",{get:()=>le(this,qt)}),Object.defineProperty(s,"isRejected",{get:()=>le(this,Gt)}),Object.defineProperty(s,"isCancelled",{get:()=>le(this,At)}),t(i,o,s)}))}get[Symbol.toStringTag](){return"Cancellable Promise"}then(t,n){return le(this,er).then(t,n)}catch(t){return le(this,er).catch(t)}finally(t){return le(this,er).finally(t)}cancel(){if(!(le(this,qt)||le(this,Gt)||le(this,At))){if(Tt(this,At,!0),le(this,Nn).length)try{for(const t of le(this,Nn))t()}catch(t){console.warn("Cancellation threw an error",t);return}le(this,Nn).length=0,le(this,Tn)&&le(this,Tn).call(this,new m1("Request aborted"))}}get isCancelled(){return le(this,At)}}qt=new WeakMap,Gt=new WeakMap,At=new WeakMap,Nn=new WeakMap,er=new WeakMap,Br=new WeakMap,Tn=new WeakMap;const z={BASE:"",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var Cf;(function(e){(function(t){t.HUMAN="human",t.AGENT="agent"})(e.type||(e.type={}))})(Cf||(Cf={}));var Ef;(function(e){(function(t){t.CLAUDE="claude",t.CODEX="codex",t.OPENCODE="opencode",t.ADK="adk",t.GITHUBCOPILOT="githubcopilot",t.OTHER="other"})(e.type||(e.type={}))})(Ef||(Ef={}));var Wt;(function(e){(function(t){t.NOT_STARTED="not_started",t.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",t.MCP_AUTH_FLOW_STARTED="mcp_auth_flow_started",t.MCP_AUTH_FLOW_COMPLETED="mcp_auth_flow_completed",t.CONNECTIONS_FLOW_STARTED="connections_flow_started",t.CONNECTIONS_FLOW_COMPLETED="connections_flow_completed",t.AUTHORIZATION_CODE_ISSUED="authorization_code_issued",t.AUTHORIZATION_CODE_EXCHANGED="authorization_code_exchanged"})(e.status||(e.status={}))})(Wt||(Wt={}));var bf;(function(e){(function(t){t.NOT_STARTED="NOT_STARTED",t.IN_PROGRESS="IN_PROGRESS",t.FOR_REVIEW="FOR_REVIEW",t.DONE="DONE"})(e.status||(e.status={}))})(bf||(bf={}));var Nf;(function(e){(function(t){t.NONE="none",t.CLIENT_SECRET_BASIC="client_secret_basic"})(e.token_endpoint_auth_method||(e.token_endpoint_auth_method={}))})(Nf||(Nf={}));var Cn;(function(e){(function(t){t.PENDING="pending",t.AUTHORIZED="authorized",t.FAILED="failed"})(e.status||(e.status={}))})(Cn||(Cn={}));var Tf;(function(e){(function(t){t.CLAUDE="claude",t.CODEX="codex",t.OPENCODE="opencode",t.ADK="adk",t.GITHUBCOPILOT="githubcopilot",t.OTHER="other"})(e.type||(e.type={}))})(Tf||(Tf={}));var jf;(function(e){(function(t){t.CLIENT_NOT_REGISTERED="CLIENT_NOT_REGISTERED",t.CLIENT_REGISTERED="CLIENT_REGISTERED",t.AUTHORIZATION_REQUEST_STARTED="AUTHORIZATION_REQUEST_STARTED",t.USER_CONSENT_OK="USER_CONSENT_OK",t.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",t.WAITING_ON_DOWNSTREAM_AUTH="WAITING_ON_DOWNSTREAM_AUTH",t.AUTHORIZATION_CODE_ISSUED="AUTHORIZATION_CODE_ISSUED",t.AUTHORIZATION_CODE_EXCHANGED="AUTHORIZATION_CODE_EXCHANGED"})(e.status||(e.status={}))})(jf||(jf={}));var _f;(function(e){(function(t){t.ACCESS_TOKEN="access_token",t.REFRESH_TOKEN="refresh_token"})(e.token_type_hint||(e.token_type_hint={}))})(_f||(_f={}));var If;(function(e){(function(t){t.BEARER="Bearer"})(e.token_type||(e.token_type={}))})(If||(If={}));var Pi;(function(e){(function(t){t.CLIENT_NOT_REGISTERED="CLIENT_NOT_REGISTERED",t.CLIENT_REGISTERED="CLIENT_REGISTERED",t.AUTHORIZATION_REQUEST_STARTED="AUTHORIZATION_REQUEST_STARTED",t.USER_CONSENT_OK="USER_CONSENT_OK",t.USER_CONSENT_REJECTED="USER_CONSENT_REJECTED",t.WAITING_ON_DOWNSTREAM_AUTH="WAITING_ON_DOWNSTREAM_AUTH",t.AUTHORIZATION_CODE_ISSUED="AUTHORIZATION_CODE_ISSUED",t.AUTHORIZATION_CODE_EXCHANGED="AUTHORIZATION_CODE_EXCHANGED"})(e.status||(e.status={}))})(Pi||(Pi={}));var Af;(function(e){(function(t){t.CLAUDE="claude",t.CODEX="codex",t.OPENCODE="opencode",t.ADK="adk",t.GITHUBCOPILOT="githubcopilot",t.OTHER="other"})(e.type||(e.type={}))})(Af||(Af={}));var Rf;(function(e){(function(t){t.NONE="none",t.CLIENT_SECRET_BASIC="client_secret_basic"})(e.token_endpoint_auth_method||(e.token_endpoint_auth_method={}))})(Rf||(Rf={}));var lu;(function(e){(function(t){t.NOT_STARTED="NOT_STARTED",t.IN_PROGRESS="IN_PROGRESS",t.FOR_REVIEW="FOR_REVIEW",t.DONE="DONE"})(e.status||(e.status={}))})(lu||(lu={}));var Pf;(function(e){(function(t){t.NOT_STARTED="NOT_STARTED",t.IN_PROGRESS="IN_PROGRESS",t.FOR_REVIEW="FOR_REVIEW",t.DONE="DONE"})(e.status||(e.status={}))})(Pf||(Pf={}));var Df;(function(e){(function(t){t.URN_IETF_PARAMS_OAUTH_GRANT_TYPE_TOKEN_EXCHANGE="urn:ietf:params:oauth:grant-type:token-exchange"})(e.grant_type||(e.grant_type={})),function(t){t.URN_IETF_PARAMS_OAUTH_TOKEN_TYPE_ACCESS_TOKEN="urn:ietf:params:oauth:token-type:access_token"}(e.subject_token_type||(e.subject_token_type={}))})(Df||(Df={}));var Lf;(function(e){(function(t){t.AUTHORIZATION_CODE="authorization_code",t.REFRESH_TOKEN="refresh_token"})(e.grant_type||(e.grant_type={}))})(Lf||(Lf={}));var Of;(function(e){(function(t){t.BEARER="Bearer"})(e.token_type||(e.token_type={}))})(Of||(Of={}));var Ff;(function(e){(function(t){t.ADMIN="admin",t.STANDARD="standard"})(e.role||(e.role={}))})(Ff||(Ff={}));const jc=e=>e!=null,po=e=>typeof e=="string",Vl=e=>po(e)&&e!=="",_c=e=>typeof e=="object"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.arrayBuffer=="function"&&typeof e.constructor=="function"&&typeof e.constructor.name=="string"&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),wg=e=>e instanceof FormData,y1=e=>{try{return btoa(e)}catch{return Buffer.from(e).toString("base64")}},x1=e=>{const t=[],n=(i,o)=>{t.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(o))}`)},r=(i,o)=>{jc(o)&&(Array.isArray(o)?o.forEach(s=>{r(i,s)}):typeof o=="object"?Object.entries(o).forEach(([s,l])=>{r(`${i}[${s}]`,l)}):n(i,o))};return Object.entries(e).forEach(([i,o])=>{r(i,o)}),t.length>0?`?${t.join("&")}`:""},v1=(e,t)=>{const n=encodeURI,r=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(o,s)=>{var l;return(l=t.path)!=null&&l.hasOwnProperty(s)?n(String(t.path[s])):o}),i=`${e.BASE}${r}`;return t.query?`${i}${x1(t.query)}`:i},k1=e=>{if(e.formData){const t=new FormData,n=(r,i)=>{po(i)||_c(i)?t.append(r,i):t.append(r,JSON.stringify(i))};return Object.entries(e.formData).filter(([r,i])=>jc(i)).forEach(([r,i])=>{Array.isArray(i)?i.forEach(o=>n(r,o)):n(r,i)}),t}},zo=async(e,t)=>t,w1=async(e,t)=>{const[n,r,i,o]=await Promise.all([zo(t,e.TOKEN),zo(t,e.USERNAME),zo(t,e.PASSWORD),zo(t,e.HEADERS)]),s=Object.entries({Accept:"application/json",...o,...t.headers}).filter(([l,u])=>jc(u)).reduce((l,[u,c])=>({...l,[u]:String(c)}),{});if(Vl(n)&&(s.Authorization=`Bearer ${n}`),Vl(r)&&Vl(i)){const l=y1(`${r}:${i}`);s.Authorization=`Basic ${l}`}return t.body!==void 0&&(t.mediaType?s["Content-Type"]=t.mediaType:_c(t.body)?s["Content-Type"]=t.body.type||"application/octet-stream":po(t.body)?s["Content-Type"]="text/plain":wg(t.body)||(s["Content-Type"]="application/json")),new Headers(s)},S1=e=>{var t;if(e.body!==void 0)return(t=e.mediaType)!=null&&t.includes("/json")?JSON.stringify(e.body):po(e.body)||_c(e.body)||wg(e.body)?e.body:JSON.stringify(e.body)},C1=async(e,t,n,r,i,o,s)=>{const l=new AbortController,u={headers:o,body:r??i,method:t.method,signal:l.signal};return s(()=>l.abort()),await fetch(n,u)},E1=(e,t)=>{if(t){const n=e.headers.get(t);if(po(n))return n}},b1=async e=>{if(e.status!==204)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some(i=>t.toLowerCase().startsWith(i))?await e.json():await e.text()}catch(t){console.error(t)}},N1=(e,t)=>{const r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(r)throw new Sf(e,t,r);if(!t.ok){const i=t.status??"unknown",o=t.statusText??"unknown",s=(()=>{try{return JSON.stringify(t.body,null,2)}catch{return}})();throw new Sf(e,t,`Generic Error: status: ${i}; status text: ${o}; body: ${s}`)}},U=(e,t)=>new g1(async(n,r,i)=>{try{const o=v1(e,t),s=k1(t),l=S1(t),u=await w1(e,t);if(!i.isCancelled){const c=await C1(e,t,o,l,s,u,i),f=await b1(c),d=E1(c,t.responseHeader),h={url:o,ok:c.ok,status:c.status,statusText:c.statusText,body:d??f};N1(t,h),n(h.body)}}catch(o){r(o)}});class ql{static agentsControllerCreateAgent(t){return U(z,{method:"POST",url:"/api/v1/agents",body:t,mediaType:"application/json"})}static agentsControllerListAgents(t,n=1,r=20){return U(z,{method:"GET",url:"/api/v1/agents",query:{isActive:t,page:n,limit:r}})}static agentsControllerGetAgentBySlug(t){return U(z,{method:"GET",url:"/api/v1/agents/{slug}",path:{slug:t}})}static agentsControllerPatchAgent(t,n){return U(z,{method:"PATCH",url:"/api/v1/agents/{actorId}",path:{actorId:t},body:n,mediaType:"application/json"})}static agentsControllerDeleteAgent(t){return U(z,{method:"DELETE",url:"/api/v1/agents/{actorId}",path:{actorId:t}})}}class T1{static authJourneysControllerGetAuthJourneys(t){return U(z,{method:"GET",url:"/api/v1/auth-journeys/servers/{serverId}",path:{serverId:t},errors:{404:"Server not found"}})}}class j1{static clientRegistrationControllerRegisterClient(t,n,r){return U(z,{method:"POST",url:"/api/v1/auth/clients/register/mcp/{serverId}/{version}",path:{serverId:t,version:n},body:r,mediaType:"application/json",errors:{400:"Invalid client metadata (missing fields, invalid redirect URIs, unsupported grant types, or PKCE not configured)",409:"A client with this name is already registered"}})}static clientRegistrationControllerGetClient(t){return U(z,{method:"GET",url:"/api/v1/auth/clients/{clientId}",path:{clientId:t},errors:{404:"Client not found"}})}static clientRegistrationControllerListClients(){return U(z,{method:"GET",url:"/api/v1/auth/clients"})}static authorizationControllerAuthorize(t,n,r,i,o,s,l,u,c,f){return U(z,{method:"GET",url:"/api/v1/auth/authorize/mcp/{serverIdentifier}/{version}",path:{serverIdentifier:u,version:c},query:{response_type:t,scope:f,client_id:n,code_challenge:r,code_challenge_method:i,redirect_uri:o,state:s,resource:l},errors:{302:"Redirects to consent screen with authorization request ID",400:"Invalid authorization request parameters",404:"MCP server or client not found"}})}static authorizationControllerAuthorizeConsent(t,n,r){return U(z,{method:"POST",url:"/api/v1/auth/authorize/mcp/{serverIdentifier}/{version}",path:{serverIdentifier:t,version:n},body:r,mediaType:"application/json",errors:{302:"Redirects to client redirect_uri with authorization code or error",400:"Invalid consent decision or flow state",401:"Authorization flow has already been used",404:"Authorization flow not found"}})}static authorizationControllerGetConsentMetadata(t){return U(z,{method:"GET",url:"/api/v1/auth/consent/{flowId}",path:{flowId:t},errors:{401:"Authentication required to access consent metadata",404:"Authorization flow not found"}})}static authorizationControllerToken(t,n,r){return U(z,{method:"POST",url:"/api/v1/auth/token/mcp/{serverIdentifier}/{version}",path:{serverIdentifier:t,version:n},body:r,mediaType:"application/json",errors:{400:"Invalid token request parameters",401:"Invalid authorization code, code_verifier, or expired code"}})}static authorizationControllerIntrospect(t,n,r){return U(z,{method:"POST",url:"/api/v1/auth/introspect/mcp/{serverIdentifier}/{version}",path:{serverIdentifier:t,version:n},body:r,mediaType:"application/json",errors:{400:"Invalid introspection request parameters"}})}static authorizationControllerTokenExchange(t,n,r){return U(z,{method:"POST",url:"/api/v1/auth/token-exchange/mcp/{serverIdentifier}/{version}",path:{serverIdentifier:t,version:n},body:r,mediaType:"application/json",errors:{400:"Invalid token exchange request parameters",401:"Invalid or expired MCP JWT",403:"Insufficient scope - requested scope not entitled",404:"Connection not found"}})}static authorizationControllerCallback(t,n,r,i,o){return U(z,{method:"GET",url:"/api/v1/auth/callback",query:{code:t,state:n,error:r,scope:i,error_description:o},errors:{302:"Redirects to next step in the authorization flow",400:"Invalid callback parameters or state",404:"Connection flow not found for provided state"}})}static authorizationControllerGetScopes(){return U(z,{method:"GET",url:"/api/v1/auth/scopes"})}}class _t{static contextControllerCreateBlock(t){return U(z,{method:"POST",url:"/api/v1/context/blocks",body:t,mediaType:"application/json",errors:{400:"Invalid input data"}})}static contextControllerListBlocks(t){return U(z,{method:"GET",url:"/api/v1/context/blocks",query:{tag:t}})}static contextControllerGetBlockTree(){return U(z,{method:"GET",url:"/api/v1/context/blocks/tree"})}static contextControllerGetBlock(t){return U(z,{method:"GET",url:"/api/v1/context/blocks/{id}",path:{id:t}})}static contextControllerUpdateBlock(t,n){return U(z,{method:"PATCH",url:"/api/v1/context/blocks/{id}",path:{id:t},body:n,mediaType:"application/json",errors:{400:"No update fields provided"}})}static contextControllerDeleteBlock(t){return U(z,{method:"DELETE",url:"/api/v1/context/blocks/{id}",path:{id:t}})}static contextControllerAppendToBlock(t,n){return U(z,{method:"POST",url:"/api/v1/context/blocks/{id}/append",path:{id:t},body:n,mediaType:"application/json"})}static contextControllerReorderBlock(t,n){return U(z,{method:"PATCH",url:"/api/v1/context/blocks/{id}/reorder",path:{id:t},body:n,mediaType:"application/json"})}static contextControllerMoveBlock(t,n){return U(z,{method:"PATCH",url:"/api/v1/context/blocks/{id}/move",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Circular reference detected or parent not found"}})}static contextControllerAddTagToBlock(t,n){return U(z,{method:"POST",url:"/api/v1/context/blocks/{id}/tags",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data"}})}static contextControllerRemoveTagFromBlock(t,n){return U(z,{method:"DELETE",url:"/api/v1/context/blocks/{id}/tags/{tagId}",path:{id:t,tagId:n}})}static contextControllerHandleMcpGet(){return U(z,{method:"GET",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpPost(){return U(z,{method:"POST",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpPut(){return U(z,{method:"PUT",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpDelete(){return U(z,{method:"DELETE",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpPatch(){return U(z,{method:"PATCH",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpOptions(){return U(z,{method:"OPTIONS",url:"/api/v1/context/blocks/mcp"})}static contextControllerHandleMcpHead(){return U(z,{method:"HEAD",url:"/api/v1/context/blocks/mcp"})}}class Sg{static metaControllerCreateTag(t){return U(z,{method:"POST",url:"/api/v1/meta/tags",body:t,mediaType:"application/json",errors:{400:"Invalid input data"}})}static metaControllerGetAllTags(){return U(z,{method:"GET",url:"/api/v1/meta/tags"})}static metaControllerGetTagColors(){return U(z,{method:"GET",url:"/api/v1/meta/tags/colors"})}static metaControllerDeleteTag(t){return U(z,{method:"DELETE",url:"/api/v1/meta/tags/{tagId}",path:{tagId:t},errors:{404:"Tag not found"}})}}class Lt{static tasksControllerCreateTask(t){return U(z,{method:"POST",url:"/api/v1/tasks/tasks",body:t,mediaType:"application/json",errors:{400:"Invalid input data"}})}static tasksControllerListTasks(t,n,r,i=1,o=20){return U(z,{method:"GET",url:"/api/v1/tasks/tasks",query:{assignee:t,sessionId:n,tag:r,page:i,limit:o}})}static tasksControllerUpdateTask(t,n){return U(z,{method:"PATCH",url:"/api/v1/tasks/tasks/{id}",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerDeleteTask(t){return U(z,{method:"DELETE",url:"/api/v1/tasks/tasks/{id}",path:{id:t},errors:{404:"Task not found"}})}static tasksControllerGetTask(t){return U(z,{method:"GET",url:"/api/v1/tasks/tasks/{id}",path:{id:t},errors:{404:"Task not found"}})}static tasksControllerAssignTask(t,n){return U(z,{method:"PATCH",url:"/api/v1/tasks/tasks/{id}/assign",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerAssignTaskToMe(t){return U(z,{method:"PATCH",url:"/api/v1/tasks/tasks/{id}/assign-to-me",path:{id:t},errors:{404:"Task not found"}})}static tasksControllerSearchTasks(t,n=10,r=.3){return U(z,{method:"GET",url:"/api/v1/tasks/tasks/search/query",query:{query:t,limit:n,threshold:r}})}static tasksControllerAddComment(t,n){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/{id}/comments",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerAddArtefact(t,n){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/{id}/artefacts",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerChangeStatus(t,n){return U(z,{method:"PATCH",url:"/api/v1/tasks/tasks/{id}/status",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid status transition or comment required",404:"Task not found"}})}static tasksControllerAddTagToTask(t,n){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/{id}/tags",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerRemoveTagFromTask(t,n){return U(z,{method:"DELETE",url:"/api/v1/tasks/tasks/{id}/tags/{tagId}",path:{id:t,tagId:n},errors:{404:"Task not found"}})}static tasksControllerCreateInputRequest(t,n){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/{id}/input-requests",path:{id:t},body:n,mediaType:"application/json",errors:{400:"Invalid input data",404:"Task not found"}})}static tasksControllerAnswerInputRequest(t,n,r){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/{id}/input-requests/{inputRequestId}/answer",path:{id:t,inputRequestId:n},body:r,mediaType:"application/json",errors:{400:"Invalid input data",404:"Input request not found"}})}static tasksControllerHandleMcpGet(){return U(z,{method:"GET",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpPost(){return U(z,{method:"POST",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpPut(){return U(z,{method:"PUT",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpDelete(){return U(z,{method:"DELETE",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpPatch(){return U(z,{method:"PATCH",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpOptions(){return U(z,{method:"OPTIONS",url:"/api/v1/tasks/tasks/mcp"})}static tasksControllerHandleMcpHead(){return U(z,{method:"HEAD",url:"/api/v1/tasks/tasks/mcp"})}}class Ke{static mcpRegistryControllerCreateServer(t){return U(z,{method:"POST",url:"/api/v1/mcp/servers",body:t,mediaType:"application/json",errors:{409:"Server with providedId already exists"}})}static mcpRegistryControllerListServers(t,n){return U(z,{method:"GET",url:"/api/v1/mcp/servers",query:{page:t,limit:n}})}static mcpRegistryControllerGetServer(t){return U(z,{method:"GET",url:"/api/v1/mcp/servers/{serverId}",path:{serverId:t},errors:{404:"Server not found"}})}static mcpRegistryControllerUpdateServer(t,n){return U(z,{method:"PATCH",url:"/api/v1/mcp/servers/{serverId}",path:{serverId:t},body:n,mediaType:"application/json",errors:{404:"Server not found"}})}static mcpRegistryControllerDeleteServer(t){return U(z,{method:"DELETE",url:"/api/v1/mcp/servers/{serverId}",path:{serverId:t},errors:{404:"Server not found",409:"Server has dependencies"}})}static mcpRegistryControllerCreateScopes(t,n){return U(z,{method:"POST",url:"/api/v1/mcp/servers/{serverId}/scopes",path:{serverId:t},body:n,mediaType:"application/json",errors:{404:"Server not found",409:"Scope already exists"}})}static mcpRegistryControllerListScopes(t){return U(z,{method:"GET",url:"/api/v1/mcp/servers/{serverId}/scopes",path:{serverId:t},errors:{404:"Server not found"}})}static mcpRegistryControllerGetScope(t,n){return U(z,{method:"GET",url:"/api/v1/mcp/servers/{serverId}/scopes/{scopeId}",path:{serverId:t,scopeId:n},errors:{404:"Scope not found"}})}static mcpRegistryControllerDeleteScope(t,n){return U(z,{method:"DELETE",url:"/api/v1/mcp/servers/{serverId}/scopes/{scopeId}",path:{serverId:t,scopeId:n},errors:{404:"Scope not found",409:"Scope has mappings"}})}static mcpRegistryControllerCreateConnection(t,n){return U(z,{method:"POST",url:"/api/v1/mcp/servers/{serverId}/connections",path:{serverId:t},body:n,mediaType:"application/json",errors:{404:"Server not found",409:"Connection name conflict"}})}static mcpRegistryControllerListConnections(t){return U(z,{method:"GET",url:"/api/v1/mcp/servers/{serverId}/connections",path:{serverId:t},errors:{404:"Server not found"}})}static mcpRegistryControllerGetConnection(t){return U(z,{method:"GET",url:"/api/v1/mcp/connections/{connectionId}",path:{connectionId:t},errors:{404:"Connection not found"}})}static mcpRegistryControllerUpdateConnection(t,n){return U(z,{method:"PATCH",url:"/api/v1/mcp/connections/{connectionId}",path:{connectionId:t},body:n,mediaType:"application/json",errors:{404:"Connection not found",409:"Connection name conflict"}})}static mcpRegistryControllerDeleteConnection(t){return U(z,{method:"DELETE",url:"/api/v1/mcp/connections/{connectionId}",path:{connectionId:t},errors:{404:"Connection not found",409:"Connection has mappings"}})}static mcpRegistryControllerCreateMapping(t,n){return U(z,{method:"POST",url:"/api/v1/mcp/servers/{serverId}/mappings",path:{serverId:t},body:n,mediaType:"application/json",errors:{400:"Invalid mapping",404:"Scope or connection not found"}})}static mcpRegistryControllerListMappings(t,n){return U(z,{method:"GET",url:"/api/v1/mcp/servers/{serverId}/scopes/{scopeId}/mappings",path:{serverId:t,scopeId:n},errors:{404:"Scope not found"}})}static mcpRegistryControllerDeleteMapping(t){return U(z,{method:"DELETE",url:"/api/v1/mcp/mappings/{mappingId}",path:{mappingId:t},errors:{404:"Mapping not found"}})}}class mi{static webAuthControllerLogin(t){return U(z,{method:"POST",url:"/api/v1/auth/login",body:t,mediaType:"application/json",errors:{401:"Invalid credentials"}})}static webAuthControllerRefresh(){return U(z,{method:"POST",url:"/api/v1/auth/refresh",errors:{401:"Invalid or expired refresh token"}})}static webAuthControllerLogout(){return U(z,{method:"POST",url:"/api/v1/auth/logout"})}static webAuthControllerMe(){return U(z,{method:"GET",url:"/api/v1/auth/me",errors:{401:"Not authenticated"}})}static webAuthControllerChangePassword(t){return U(z,{method:"POST",url:"/api/v1/auth/change-password",body:t,mediaType:"application/json",errors:{401:"Not authenticated or current password is incorrect"}})}}const Cg=()=>"",Eg=e=>e,hr=Cg();z.BASE=hr;z.CREDENTIALS="include";z.BASE=hr;const bg=k.createContext(void 0);function _1({children:e}){const[t,n]=k.useState(null),[r,i]=k.useState(!0);k.useEffect(()=>{mi.webAuthControllerMe().then(c=>{console.log("found me"),n(c)}).catch(()=>{console.log("not me"),n(null)}).finally(()=>{i(!1)})},[]),k.useEffect(()=>{if(!t)return;const c=setInterval(async()=>{try{const f=await mi.webAuthControllerRefresh();n(f.user)}catch(f){console.error("Token refresh failed:",f),n(null)}},8*60*1e3);return()=>clearInterval(c)},[t]);const u={user:t,isAuthenticated:!!t,isLoading:r,login:async(c,f)=>{const d=await mi.webAuthControllerLogin({email:c,password:f});n(d.user)},logout:async()=>{try{await mi.webAuthControllerLogout()}finally{n(null)}},refreshAuth:async()=>{const c=await mi.webAuthControllerRefresh();n(c.user)}};return a.jsx(bg.Provider,{value:u,children:e})}function Ic(){const e=k.useContext(bg);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}function I1({children:e}){const{isAuthenticated:t,isLoading:n}=Ic(),r=pt();return n?a.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:a.jsx("div",{style:{color:"white",fontSize:"18px",fontWeight:"600"},children:"Loading..."})}):t?a.jsx(a.Fragment,{children:e}):a.jsx(Aw,{to:"/login",state:{from:r},replace:!0})}function A1(){var p,g;const[e,t]=k.useState(""),[n,r]=k.useState(""),[i,o]=k.useState(""),[s,l]=k.useState(!1),{login:u}=Ic(),c=Oe(),d=((g=(p=pt().state)==null?void 0:p.from)==null?void 0:g.pathname)||"/",h=async v=>{v.preventDefault(),l(!0),o("");try{await u(e,n),c(d,{replace:!0})}catch{o("Invalid email or password")}finally{l(!1)}};return a.jsx("div",{className:"login-page",children:a.jsx("div",{className:"login-container",children:a.jsxs("div",{className:"login-card",children:[a.jsxs("div",{className:"login-header",children:[a.jsx("h1",{className:"login-title",children:"Welcome Back"}),a.jsx("p",{className:"login-subtitle",children:"Sign in to your account"})]}),a.jsxs("form",{onSubmit:h,className:"login-form",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"email",className:"form-label",children:"Email"}),a.jsx("input",{id:"email",type:"email",value:e,onChange:v=>t(v.target.value),className:"form-input",placeholder:"you@example.com",required:!0,disabled:s,autoComplete:"email"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"password",className:"form-label",children:"Password"}),a.jsx("input",{id:"password",type:"password",value:n,onChange:v=>r(v.target.value),className:"form-input",placeholder:"••••••••",required:!0,disabled:s,autoComplete:"current-password"})]}),i&&a.jsx("div",{className:"login-error",children:i}),a.jsx("button",{type:"submit",className:"login-button",disabled:s,children:s?"Signing in...":"Sign In"})]})]})})})}function R1({collapsed:e}){const t=[{name:"Home",path:"/",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),a.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]})},{name:"Agents",path:"/agents",icon:"🤖"},{name:"Tasks",path:"/tasks",icon:"📋"},{name:"Context",path:"/context",icon:"📚"},{name:"Tools",path:"/mcp-registry",icon:"🔧"}];return a.jsxs("nav",{className:"sidebar-nav-container",children:[a.jsx("div",{className:"sidebar-nav-main",children:t.map(n=>a.jsxs(su,{to:n.path,className:({isActive:r})=>`sidebar-nav-link ${r?"active":""} ${e?"collapsed":""}`,end:n.path==="/",children:[a.jsx("div",{className:"sidebar-nav-icon",children:typeof n.icon=="string"?a.jsx("span",{children:n.icon}):n.icon}),a.jsx("span",{className:"nav-link-text",children:n.name})]},n.path))}),a.jsx("div",{className:"sidebar-nav-bottom",children:a.jsxs(su,{to:"/logout",className:({isActive:n})=>`sidebar-nav-link ${n?"active":""} ${e?"collapsed":""}`,end:!0,children:[a.jsx("div",{className:"sidebar-nav-icon",children:a.jsx("span",{children:"🔓"})}),a.jsx("span",{className:"nav-link-text",children:"Logout"})]},"213")})]})}const P1=768;function no(){return window.innerWidth<P1}function D1(){const[e,t]=k.useState(()=>no());return k.useEffect(()=>{const n=()=>{t(no())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const zf="app-nav-collapsed";function L1(){const[e,t]=k.useState(()=>{const r=localStorage.getItem(zf);return r!==null?r==="true":no()});k.useEffect(()=>{localStorage.setItem(zf,String(e))},[e]);const n=()=>{t(!e)};return a.jsxs("div",{className:"root-layout",children:[a.jsxs("aside",{className:`sidebar-app-nav ${e?"collapsed":""}`,children:[a.jsx("nav",{className:"sidebar-content",children:a.jsx(R1,{collapsed:e})}),a.jsx("button",{className:"sidebar-toggle",onClick:n,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:e?"→":"←"})]}),a.jsx("div",{className:"root-layout-main",children:a.jsx(bc,{})})]})}function pr(e){const t=k.useRef(null);k.useEffect(()=>(t.current=document.title,document.title=e,()=>{t.current!==null&&(document.title=t.current)}),[e])}function O1(){pr("taico — Home");const e=[{name:"Tasks",description:"Manage and track your tasks across different stages with our Kanban board.",path:"/tasks",icon:"📋",color:"#3b82f6"},{name:"Context",description:"Create, edit, and organize your knowledge base with our wiki platform.",path:"/context",icon:"📚",color:"#10b981"},{name:"Tools",description:"Manage Model Context Protocol servers, scopes, and OAuth connections.",path:"/mcp-registry",icon:"🔧",color:"#8b5cf6"}];return a.jsx("div",{className:"home-page",children:a.jsxs("div",{className:"home-container",children:[a.jsxs("header",{className:"home-header",children:[a.jsx("h1",{className:"home-title",children:"taico"}),a.jsx("p",{className:"home-subtitle",children:"Your all-in-one platform for task management, knowledge organization, and protocol integration"})]}),a.jsx("div",{className:"apps-grid",children:e.map(t=>a.jsxs(ar,{to:t.path,className:"app-card",style:{"--app-color":t.color},children:[a.jsx("div",{className:"app-icon",children:t.icon}),a.jsx("h2",{className:"app-name",children:t.name}),a.jsx("p",{className:"app-description",children:t.description}),a.jsx("div",{className:"app-arrow",children:"→"})]},t.path))}),a.jsx("footer",{className:"home-footer",children:a.jsx("p",{children:"Built with React + TypeScript + Vite"})})]})})}const Ng=({tag:e,onRemove:t,small:n=!1})=>{const r=e.color||"#6B7280";return a.jsxs("span",{className:`tag-badge ${n?"tag-badge-small":""}`,style:{backgroundColor:r,color:"#ffffff",padding:n?"1px 4px":"2px 6px",borderRadius:"3px",fontSize:n?"0.65rem":"0.7rem",fontWeight:"500",display:"inline-flex",alignItems:"center",gap:"2px",marginRight:"4px",marginBottom:"4px"},children:[e.name,t&&a.jsx("button",{onClick:i=>{i.stopPropagation(),t()},style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"0",marginLeft:"1px",fontSize:n?"0.75rem":"0.85rem",lineHeight:"1"},"aria-label":`Remove ${e.name} tag`,children:"×"})]})};function F1({task:e,onClick:t}){var i,o;const n=s=>{const l=new Date(s);return(new Date().getTime()-l.getTime())/(1e3*60*60)<24?l.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):l.toLocaleDateString("en-US",{month:"short",day:"numeric"})},r=((i=e.comments)==null?void 0:i.length)??0;return a.jsxs("div",{className:"task-card",onClick:t,children:[a.jsx("h3",{className:"task-card-title",children:e.name}),a.jsx("p",{className:"task-card-description",children:e.description}),e.tags&&e.tags.length>0&&a.jsx("div",{style:{marginTop:"8px",marginBottom:"8px"},children:e.tags.map(s=>a.jsx(Ng,{tag:s,small:!0},s.name))}),a.jsx("div",{className:"task-card-divider"}),a.jsxs("div",{className:"task-card-footer",children:[a.jsxs("div",{className:"task-card-assignee",children:[e.assignee?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"assignee-emoji",children:"👤"}),a.jsx("span",{className:"assignee-name",children:((o=e.assigneeActor)==null?void 0:o.displayName)||"unassigned"})]}):a.jsx("span",{className:"unassigned-text",children:"Unassigned"}),r>0?a.jsxs("span",{className:"comment-count","aria-label":`${r} comments`,children:["💬 ",r]}):null]}),a.jsx("div",{className:"task-card-date",children:n(e.updatedAt)})]})]})}z.BASE=hr;function Tg(){const[e,t]=k.useState([]),n=k.useCallback((i,o="info")=>{const s=Date.now();t(l=>[...l,{id:s,message:i,type:o}])},[]),r=k.useCallback(i=>{t(o=>o.filter(s=>s.id!==i))},[]);return{toasts:e,showToast:n,removeToast:r}}function jg({message:e,type:t="info",onClose:n,duration:r=3e3}){return k.useEffect(()=>{const i=setTimeout(n,r);return()=>clearTimeout(i)},[n,r]),a.jsxs("div",{className:`toast toast-${t}`,children:[a.jsx("span",{children:e}),a.jsx("button",{onClick:n,className:"toast-close","aria-label":"Close",children:"×"})]})}const Ac=({value:e,onChange:t,placeholder:n="Type to add tags..."})=>{const[r,i]=k.useState(""),[o,s]=k.useState([]),[l,u]=k.useState(!1),[c,f]=k.useState(-1),[d,h]=k.useState([]),p=k.useRef(null),g=k.useRef(null);k.useEffect(()=>{(async()=>{try{const x=await Sg.metaControllerGetAllTags();h(x)}catch(x){console.error("Failed to load tags:",x)}})()},[]),k.useEffect(()=>{const x=setTimeout(()=>{if(r.trim().length>0){const T=r.trim().toLowerCase(),j=d.filter(E=>E.name.toLowerCase().includes(T)&&!e.includes(E.name));s(j),u(!0)}else s([]),u(!1)},150);return()=>clearTimeout(x)},[r,e,d]),k.useEffect(()=>{const m=x=>{g.current&&!g.current.contains(x.target)&&u(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const v=m=>{var T;const x=m.trim();x&&!e.includes(x)&&t([...e,x]),i(""),s([]),u(!1),f(-1),(T=p.current)==null||T.focus()},S=m=>{t(e.filter(x=>x!==m))},y=m=>{m.key==="Tab"&&r.trim()||m.key==="Enter"&&r.trim()?(m.preventDefault(),c>=0&&o[c]?v(o[c].name):v(r)):m.key==="ArrowDown"?(m.preventDefault(),f(x=>x<o.length-1?x+1:x)):m.key==="ArrowUp"?(m.preventDefault(),f(x=>x>0?x-1:-1)):m.key==="Escape"?(u(!1),f(-1)):m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))};return a.jsxs("div",{ref:g,style:{position:"relative"},children:[a.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"6px",border:"1px solid #ddd",borderRadius:"4px",minHeight:"38px",cursor:"text"},onClick:()=>{var m;return(m=p.current)==null?void 0:m.focus()},children:[e.map(m=>{const x=d.find(j=>j.name===m),T=(x==null?void 0:x.color)||"#3B82F6";return a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:T,color:"white",padding:"2px 6px",borderRadius:"3px",fontSize:"0.7rem",fontWeight:"500"},children:[m,a.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),S(m)},style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"0",marginLeft:"1px",fontSize:"0.85rem",lineHeight:"1"},children:"×"})]},m)}),a.jsx("input",{ref:p,type:"text",value:r,onChange:m=>i(m.target.value),onKeyDown:y,onFocus:()=>r&&u(!0),placeholder:e.length===0?n:"",style:{flex:"1",minWidth:"120px",border:"none",outline:"none",fontSize:"0.875rem",padding:"2px"}})]}),l&&o.length>0&&a.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",border:"1px solid #ddd",borderRadius:"4px",marginTop:"2px",maxHeight:"200px",overflowY:"auto",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:1e3},children:o.map((m,x)=>a.jsxs("div",{onClick:()=>v(m.name),style:{padding:"8px 12px",cursor:"pointer",backgroundColor:x===c?"#EFF6FF":"white",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:()=>f(x),children:[a.jsx("span",{style:{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:m.color||"#6B7280"}}),a.jsx("span",{style:{fontSize:"0.875rem"},children:m.name})]},m.name))}),l&&r&&o.length===0&&a.jsxs("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",border:"1px solid #ddd",borderRadius:"4px",marginTop:"2px",padding:"8px 12px",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:1e3,fontSize:"0.875rem",color:"#6B7280"},children:['Press Tab or Enter to create "',r,'"']})]})};function z1({key:e,defaultValue:t,debounceMs:n=500}){const[r,i]=k.useState(()=>{try{const l=localStorage.getItem(e);if(l)return JSON.parse(l)}catch(l){console.error("Error loading draft from localStorage:",l)}return t}),o=k.useRef(void 0);return k.useEffect(()=>(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{try{localStorage.setItem(e,JSON.stringify(r))}catch(l){console.error("Error saving draft to localStorage:",l)}},n),()=>{o.current&&clearTimeout(o.current)}),[r,e,n]),[r,i,()=>{try{localStorage.removeItem(e),i(t)}catch(l){console.error("Error clearing draft from localStorage:",l)}}]}const M1={name:"",description:"",assignee:"",sessionId:"",tagNames:[],dependsOnIds:[]};function B1({onClose:e}){const{toasts:t,showToast:n,removeToast:r}=Tg(),[i,o,s]=z1({key:"create-task-draft",defaultValue:M1}),[l,u]=k.useState(!1),{name:c,description:f,assignee:d,sessionId:h,tagNames:p,dependsOnIds:g}=i,v=(y,m)=>{o({...i,[y]:m})};k.useEffect(()=>{const y=m=>{m.key==="Escape"&&e()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e]);const S=async y=>{var m;y.preventDefault(),u(!0);try{await Lt.tasksControllerCreateTask({name:c,description:f,...d&&{assignee:d},...h&&{sessionId:h},...p.length>0&&{tagNames:p},...g.length>0&&{dependsOnIds:g}}),s(),e()}catch(x){const T=((m=x==null?void 0:x.body)==null?void 0:m.detail)||(x==null?void 0:x.message)||"Failed to create task";n(`Error: ${T}`,"error"),console.error(x)}finally{u(!1)}};return a.jsx("div",{className:"modal-overlay",onClick:e,children:a.jsxs("div",{className:"modal-content",onClick:y=>y.stopPropagation(),children:[a.jsxs("div",{className:"modal-header",children:[a.jsx("h2",{children:"Create New Task"}),a.jsx("button",{onClick:e,className:"btn-close",children:"×"})]}),a.jsxs("form",{onSubmit:S,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"name",children:"Title *"}),a.jsx("input",{id:"name",type:"text",value:c,onChange:y=>v("name",y.target.value),required:!0,placeholder:"Enter task name"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"description",children:"Description *"}),a.jsx("textarea",{id:"description",value:f,onChange:y=>v("description",y.target.value),required:!0,placeholder:"Enter task description",rows:4})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"assignee",children:"Assigned to"}),a.jsx("input",{id:"assignee",type:"text",value:d,onChange:y=>v("assignee",y.target.value),placeholder:"Agent name or assignee"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"sessionId",children:"Session ID"}),a.jsx("input",{id:"sessionId",type:"text",value:h,onChange:y=>v("sessionId",y.target.value),placeholder:"Agent session ID"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"tags",children:"Tags"}),a.jsx(Ac,{value:p,onChange:y=>v("tagNames",y),placeholder:"Type to add tags..."})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"dependsOn",children:"Depends On (Task IDs)"}),a.jsx("input",{id:"dependsOn",type:"text",value:g.join(", "),onChange:y=>v("dependsOnIds",y.target.value.split(",").map(m=>m.trim()).filter(m=>m)),placeholder:"Enter task IDs separated by commas"})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:e,className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",disabled:l,children:l?"Creating...":"Create Task"})]})]}),t.map(y=>a.jsx(jg,{message:y.message,type:y.type,onClose:()=>r(y.id)},y.id))]})})}const re=lu.status;function _g({task:e,onClose:t,onUpdate:n}){var R,b,P,q;const[r,i]=k.useState(e.description),[o,s]=k.useState((R=e.assigneeActor)==null?void 0:R.id),[l,u]=k.useState(e.sessionId||""),[c,f]=k.useState(((b=e.tags)==null?void 0:b.map(V=>V.name))||[]),[d,h]=k.useState(""),[p,g]=k.useState(""),[v,S]=k.useState(!1),[y,m]=k.useState("");k.useEffect(()=>{const V=H=>{H.key==="Escape"&&t()};return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[t]);const x=async()=>{var V;if(r!==e.description)try{const H=await Lt.tasksControllerUpdateTask(e.id,{description:r});n(H),m("")}catch(H){console.error("Failed to update task:",H);const G=((V=H==null?void 0:H.body)==null?void 0:V.detail)||(H==null?void 0:H.message)||"Failed to update description";m(G)}},T=async()=>{console.log("NOT IMPLEMENTED - ASSIGNEE STRUCTURE CHANGED")},j=async()=>{var V;if(d.trim())try{await Lt.tasksControllerAddComment(e.id,{content:d});const H=await Lt.tasksControllerGetTask(e.id);n(H),h(""),m("")}catch(H){console.error("Failed to add comment:",H);const G=((V=H==null?void 0:H.body)==null?void 0:V.detail)||(H==null?void 0:H.message)||"Failed to add comment";m(G)}},E=async V=>{var H;try{const G={status:V};V===re.DONE&&p.trim()&&(G.comment=p);const O=await Lt.tasksControllerChangeStatus(e.id,G);n(O),g(""),m("")}catch(G){console.error("Failed to change status:",G);const O=((H=G==null?void 0:G.body)==null?void 0:H.detail)||(G==null?void 0:G.message)||"Failed to change status";m(O)}},_=async()=>{var V;try{await Lt.tasksControllerDeleteTask(e.id),t()}catch(H){console.error("Failed to delete task:",H);const G=((V=H==null?void 0:H.body)==null?void 0:V.detail)||(H==null?void 0:H.message)||"Failed to delete task";m(G)}},D=async V=>{var H,G;f(V);try{const O=await Lt.tasksControllerUpdateTask(e.id,{tagNames:V});n(O),m("")}catch(O){console.error("Failed to update tags:",O);const L=((H=O==null?void 0:O.body)==null?void 0:H.detail)||(O==null?void 0:O.message)||"Failed to update tags";m(L),f(((G=e.tags)==null?void 0:G.map(C=>C.name))||[])}};return a.jsx("div",{className:"modal-overlay",onClick:t,children:a.jsxs("div",{className:"modal-content task-detail",onClick:V=>V.stopPropagation(),children:[a.jsxs("div",{className:"modal-header",children:[a.jsx("h2",{children:e.name}),a.jsx("button",{onClick:t,className:"btn-close",children:"×"})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h3",{children:"Description"}),a.jsx("textarea",{value:r,onChange:V=>i(V.target.value),onBlur:x,placeholder:"Enter task description...",className:"description-textarea"})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h3",{children:"Status"}),y&&a.jsxs("div",{className:"error-message",children:[a.jsx("strong",{children:"Error:"})," ",y]}),a.jsxs("div",{className:"status-buttons",children:[a.jsx("button",{onClick:()=>E(re.NOT_STARTED),className:`status-btn ${e.status===re.NOT_STARTED?"active status-not-started":""}`,children:"Not Started"}),a.jsx("button",{onClick:()=>E(re.IN_PROGRESS),className:`status-btn ${e.status===re.IN_PROGRESS?"active status-in-progress":""}`,children:"In Progress"}),a.jsx("button",{onClick:()=>E(re.FOR_REVIEW),className:`status-btn ${e.status===re.FOR_REVIEW?"active status-for-review":""}`,children:"For Review"}),a.jsx("button",{onClick:()=>E(re.DONE),className:`status-btn ${e.status===re.DONE?"active status-done":""}`,children:"Done"})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h3",{children:"Assignee & Session"}),a.jsxs("div",{className:"assignee-form",children:[a.jsxs("div",{className:"form-row",children:[a.jsxs("div",{className:"form-field",children:[a.jsx("label",{children:"Assignee"}),a.jsx("input",{type:"text",value:e.assignee?`@${e.assignee.slug}`:"@",onChange:V=>s(V.target.value),placeholder:"Enter assignee name"})]}),a.jsxs("div",{className:"form-field",children:[a.jsx("label",{children:"Session ID"}),a.jsx("input",{type:"text",value:l,onChange:V=>u(V.target.value),placeholder:"Enter session ID"})]})]}),a.jsx("button",{onClick:T,className:"btn-primary",children:"Update Assignment"})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h3",{children:"Tags"}),a.jsx(Ac,{value:c,onChange:D,placeholder:"Type to add tags..."})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h3",{children:"Task Info"}),a.jsxs("div",{className:"task-info-grid",children:[a.jsxs("div",{className:"info-item",children:[a.jsx("label",{children:"Created By"}),a.jsxs("span",{children:["@",e.createdByActor.slug]})]}),e.dependsOnIds&&e.dependsOnIds.length>0&&a.jsxs("div",{className:"info-item",children:[a.jsx("label",{children:"Depends On"}),a.jsx("div",{className:"dependency-list",children:e.dependsOnIds.map(V=>a.jsx("span",{className:"dependency-id",children:V},V))})]})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsxs("h3",{children:["Comments (",((P=e.comments)==null?void 0:P.length)||0,")"]}),a.jsx("div",{className:"comments-list",children:(q=e.comments)==null?void 0:q.map(V=>a.jsxs("div",{className:"comment",children:[a.jsx("strong",{children:V.commenterName}),a.jsx("p",{children:V.content}),a.jsx("span",{className:"comment-date",children:new Date(V.createdAt).toLocaleString()})]},V.id))}),a.jsxs("div",{className:"add-comment",children:[a.jsx("textarea",{placeholder:"Add a comment...",value:d,onChange:V=>h(V.target.value),rows:3}),a.jsx("button",{onClick:j,className:"btn-primary",children:"Add Comment"})]})]}),a.jsx("div",{className:"detail-section",children:a.jsxs("div",{className:"task-actions",children:[e.status===re.FOR_REVIEW&&a.jsxs("div",{className:"review-shortcuts",children:[a.jsx("button",{onClick:()=>E(re.DONE),className:"btn-review-done",children:"✓ Done"}),a.jsx("button",{onClick:()=>E(re.IN_PROGRESS),className:"btn-review-needs-work",children:"← Needs work"})]}),v?a.jsxs("div",{className:"delete-confirm",children:[a.jsx("button",{onClick:_,className:"btn-danger",children:"Confirm Delete"}),a.jsx("button",{onClick:()=>S(!1),className:"btn-secondary",children:"Cancel"})]}):a.jsx("button",{onClick:()=>S(!0),className:"btn-danger",children:"Delete Task"})]})})]})})}function ro(){return a.jsx(ar,{to:"/",className:"home-link",title:"Back to Home",children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),a.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]})})}const Jt=Object.create(null);Jt.open="0";Jt.close="1";Jt.ping="2";Jt.pong="3";Jt.message="4";Jt.upgrade="5";Jt.noop="6";const ss=Object.create(null);Object.keys(Jt).forEach(e=>{ss[Jt[e]]=e});const au={type:"error",data:"parser error"},Ig=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ag=typeof ArrayBuffer=="function",Rg=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Rc=({type:e,data:t},n,r)=>Ig&&t instanceof Blob?n?r(t):Mf(t,r):Ag&&(t instanceof ArrayBuffer||Rg(t))?n?r(t):Mf(new Blob([t]),r):r(Jt[e]+(t||"")),Mf=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Bf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Gl;function U1(e,t){if(Ig&&e.data instanceof Blob)return e.data.arrayBuffer().then(Bf).then(t);if(Ag&&(e.data instanceof ArrayBuffer||Rg(e.data)))return t(Bf(e.data));Rc(e,!1,n=>{Gl||(Gl=new TextEncoder),t(Gl.encode(n))})}const Uf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Uf.length;e++)Ci[Uf.charCodeAt(e)]=e;const $1=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,l,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),f=new Uint8Array(c);for(r=0;r<n;r+=4)o=Ci[e.charCodeAt(r)],s=Ci[e.charCodeAt(r+1)],l=Ci[e.charCodeAt(r+2)],u=Ci[e.charCodeAt(r+3)],f[i++]=o<<2|s>>4,f[i++]=(s&15)<<4|l>>2,f[i++]=(l&3)<<6|u&63;return c},H1=typeof ArrayBuffer=="function",Pc=(e,t)=>{if(typeof e!="string")return{type:"message",data:Pg(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:W1(e.substring(1),t)}:ss[n]?e.length>1?{type:ss[n],data:e.substring(1)}:{type:ss[n]}:au},W1=(e,t)=>{if(H1){const n=$1(e);return Pg(n,t)}else return{base64:!0,data:e}},Pg=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Dg="",V1=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{Rc(o,!1,l=>{r[s]=l,++i===n&&t(r.join(Dg))})})},q1=(e,t)=>{const n=e.split(Dg),r=[];for(let i=0;i<n.length;i++){const o=Pc(n[i],t);if(r.push(o),o.type==="error")break}return r};function G1(){return new TransformStream({transform(e,t){U1(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Kl;function Mo(e){return e.reduce((t,n)=>t+n.length,0)}function Bo(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function K1(e,t){Kl||(Kl=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Mo(n)<1)break;const u=Bo(n,1);o=(u[0]&128)===128,i=u[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Mo(n)<2)break;const u=Bo(n,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Mo(n)<8)break;const u=Bo(n,8),c=new DataView(u.buffer,u.byteOffset,u.length),f=c.getUint32(0);if(f>Math.pow(2,21)-1){l.enqueue(au);break}i=f*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Mo(n)<i)break;const u=Bo(n,i);l.enqueue(Pc(o?u:Kl.decode(u),t)),r=0}if(i===0||i>e){l.enqueue(au);break}}}})}const Lg=4;function Ne(e){if(e)return Q1(e)}function Q1(e){for(var t in Ne.prototype)e[t]=Ne.prototype[t];return e}Ne.prototype.on=Ne.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ne.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ne.prototype.off=Ne.prototype.removeListener=Ne.prototype.removeAllListeners=Ne.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ne.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Ne.prototype.emitReserved=Ne.prototype.emit;Ne.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ne.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ol=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),vt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Y1="arraybuffer";function Og(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const X1=vt.setTimeout,J1=vt.clearTimeout;function sl(e,t){t.useNativeTimers?(e.setTimeoutFn=X1.bind(vt),e.clearTimeoutFn=J1.bind(vt)):(e.setTimeoutFn=vt.setTimeout.bind(vt),e.clearTimeoutFn=vt.clearTimeout.bind(vt))}const Z1=1.33;function e0(e){return typeof e=="string"?t0(e):Math.ceil((e.byteLength||e.size)*Z1)}function t0(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Fg(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function n0(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function r0(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class i0 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Dc extends Ne{constructor(t){super(),this.writable=!1,sl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new i0(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Pc(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=n0(t);return n.length?"?"+n:""}}class o0 extends Dc{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};q1(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,V1(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Fg()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let zg=!1;try{zg=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const s0=zg;function l0(){}class a0 extends o0{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Xt extends Ne{constructor(t,n,r){super(),this.createRequest=t,sl(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Og(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Xt.requestsCount++,Xt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=l0,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Xt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Xt.requestsCount=0;Xt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$f);else if(typeof addEventListener=="function"){const e="onpagehide"in vt?"pagehide":"unload";addEventListener(e,$f,!1)}}function $f(){for(let e in Xt.requests)Xt.requests.hasOwnProperty(e)&&Xt.requests[e].abort()}const u0=function(){const e=Mg({xdomain:!1});return e&&e.responseType!==null}();class c0 extends a0{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=u0&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Xt(Mg,this.uri(),t)}}function Mg(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||s0))return new XMLHttpRequest}catch{}if(!t)try{return new vt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Bg=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class d0 extends Dc{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Bg?{}:Og(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Rc(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Fg()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ql=vt.WebSocket||vt.MozWebSocket;class f0 extends d0{createSocket(t,n,r){return Bg?new Ql(t,n,r):n?new Ql(t,n):new Ql(t)}doWrite(t,n){this.ws.send(n)}}class h0 extends Dc{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=K1(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=G1();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:l,value:u})=>{l||(this.onPacket(u),o())}).catch(l=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&ol(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const p0={websocket:f0,webtransport:h0,polling:c0},m0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,g0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function uu(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=m0.exec(e||""),o={},s=14;for(;s--;)o[g0[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=y0(o,o.path),o.queryKey=x0(o,o.query),o}function y0(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function x0(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const cu=typeof addEventListener=="function"&&typeof removeEventListener=="function",ls=[];cu&&addEventListener("offline",()=>{ls.forEach(e=>e())},!1);class zn extends Ne{constructor(t,n){if(super(),this.binaryType=Y1,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=uu(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=uu(n.host).host);sl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=r0(this.opts.query)),cu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ls.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Lg,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&zn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",zn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=e0(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ol(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(zn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),cu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ls.indexOf(this._offlineEventListener);r!==-1&&ls.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}zn.protocol=Lg;class v0 extends zn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;zn.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;zn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const s=d=>{const h=new Error("probe error: "+d);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function l(){s("transport closed")}function u(){s("socket closed")}function c(d){n&&d.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",l),this.off("close",u),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",l),this.once("close",u),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let k0=class extends v0{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>p0[i]).filter(i=>!!i)),super(t,r)}};function w0(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=uu(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const S0=typeof ArrayBuffer=="function",C0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ug=Object.prototype.toString,E0=typeof Blob=="function"||typeof Blob<"u"&&Ug.call(Blob)==="[object BlobConstructor]",b0=typeof File=="function"||typeof File<"u"&&Ug.call(File)==="[object FileConstructor]";function Lc(e){return S0&&(e instanceof ArrayBuffer||C0(e))||E0&&e instanceof Blob||b0&&e instanceof File}function as(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(as(e[n]))return!0;return!1}if(Lc(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return as(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&as(e[n]))return!0;return!1}function N0(e){const t=[],n=e.data,r=e;return r.data=du(n,t),r.attachments=t.length,{packet:r,buffers:t}}function du(e,t){if(!e)return e;if(Lc(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=du(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=du(e[r],t));return n}return e}function T0(e,t){return e.data=fu(e.data,t),delete e.attachments,e}function fu(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=fu(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=fu(e[n],t));return e}const j0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],_0=5;var ne;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ne||(ne={}));class I0{constructor(t){this.replacer=t}encode(t){return(t.type===ne.EVENT||t.type===ne.ACK)&&as(t)?this.encodeAsBinary({type:t.type===ne.EVENT?ne.BINARY_EVENT:ne.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ne.BINARY_EVENT||t.type===ne.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=N0(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Hf(e){return Object.prototype.toString.call(e)==="[object Object]"}class Oc extends Ne{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===ne.BINARY_EVENT;r||n.type===ne.BINARY_ACK?(n.type=r?ne.EVENT:ne.ACK,this.reconstructor=new A0(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Lc(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(ne[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ne.BINARY_EVENT||r.type===ne.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Oc.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case ne.CONNECT:return Hf(n);case ne.DISCONNECT:return n===void 0;case ne.CONNECT_ERROR:return typeof n=="string"||Hf(n);case ne.EVENT:case ne.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&j0.indexOf(n[0])===-1);case ne.ACK:case ne.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class A0{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=T0(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const R0=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Oc,Encoder:I0,get PacketType(){return ne},protocol:_0},Symbol.toStringTag,{value:"Module"}));function Pt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const P0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class $g extends Ne{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Pt(t,"open",this.onopen.bind(this)),Pt(t,"packet",this.onpacket.bind(this)),Pt(t,"error",this.onerror.bind(this)),Pt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(P0.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:ne.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const f=this.ids++,d=n.pop();this._registerAckCallback(f,d),s.id=f}const l=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,u=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(u?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},i),s=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(s,l)=>s?i(s):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ne.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ne.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ne.EVENT:case ne.BINARY_EVENT:this.onevent(t);break;case ne.ACK:case ne.BINARY_ACK:this.onack(t);break;case ne.DISCONNECT:this.ondisconnect();break;case ne.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:ne.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ne.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function ti(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ti.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};ti.prototype.reset=function(){this.attempts=0};ti.prototype.setMin=function(e){this.ms=e};ti.prototype.setMax=function(e){this.max=e};ti.prototype.setJitter=function(e){this.jitter=e};class hu extends Ne{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,sl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new ti({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||R0;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new k0(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Pt(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=Pt(n,"error",o);if(this._timeout!==!1){const l=this._timeout,u=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Pt(t,"ping",this.onping.bind(this)),Pt(t,"data",this.ondata.bind(this)),Pt(t,"error",this.onerror.bind(this)),Pt(t,"close",this.onclose.bind(this)),Pt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ol(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new $g(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const gi={};function Di(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=w0(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=gi[i]&&o in gi[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let u;return l?u=new hu(r,t):(gi[i]||(gi[i]=new hu(r,t)),u=gi[i]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(Di,{Manager:hu,Socket:$g,io:Di,connect:Di});const D0=Eg("/tasks"),Hg=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(null),[i,o]=k.useState([]),[s,l]=k.useState(null),[u,c]=k.useState(!1);k.useEffect(()=>(d(),h(),()=>{s&&s.disconnect()}),[]);const f=p=>[...p].sort((g,v)=>{const S=new Date(g.updatedAt).getTime();return new Date(v.updatedAt).getTime()-S}),d=async()=>{t(!0),r(null);try{const p=await Lt.tasksControllerListTasks();o(f(p.items))}catch(p){r(p instanceof Error?p.message:"Failed to load tasks")}finally{t(!1)}},h=()=>{const p=Di(D0,{transports:["websocket","polling"],withCredentials:!0});return p.on("connect",()=>{console.log("Connected to websocket"),p.emit("tasks.subscribe",{},g=>{g.ok?(console.log(g),console.log("Subscribed to room:",g.room),c(!0)):(console.error("Failed to subscribe to room"),c(!1))}),d()}),p.on("disconnect",()=>{console.log("WebSocket disconnected"),c(!1)}),p.on("task.created",g=>{o(v=>v.some(S=>S.id===g.id)?v:f([g,...v]))}),p.on("task.updated",g=>{o(v=>f(v.map(S=>S.id===g.id?g:S)))}),p.on("task.deleted",({taskId:g})=>{o(v=>v.filter(S=>S.id!==g))}),p.on("task.assigned",g=>{o(v=>f(v.map(S=>S.id===g.id?g:S)))}),p.on("task.commented",async g=>{try{const v=await Lt.tasksControllerGetTask(g.taskId);o(S=>S.findIndex(m=>m.id===v.id)===-1?f([v,...S]):f(S.map(m=>m.id===v.id?v:m)))}catch(v){console.error("Failed to refresh task after comment",v)}}),p.on("input.request.answered",async g=>{try{const v=await Lt.tasksControllerGetTask(g.taskId);o(S=>S.findIndex(m=>m.id===v.id)===-1?f([v,...S]):f(S.map(m=>m.id===v.id?v:m)))}catch(v){console.error("Failed to refresh task after input request answer",v)}}),p.on("task.status_changed",g=>{o(v=>f(v.map(S=>S.id===g.id?g:S)))}),l(p),()=>{p.close()}};return{isLoading:e,error:n,tasks:i,isConnected:u}};function L0(){const{tasks:e,isConnected:t}=Hg(),[n,r]=k.useState(null),[i,o]=k.useState(!1);pr("Tasks");const s={[re.NOT_STARTED]:e.filter(l=>l.status===re.NOT_STARTED),[re.IN_PROGRESS]:e.filter(l=>l.status===re.IN_PROGRESS),[re.FOR_REVIEW]:e.filter(l=>l.status===re.FOR_REVIEW),[re.DONE]:e.filter(l=>l.status===re.DONE)};return a.jsxs("div",{className:"task-board",children:[a.jsxs("div",{className:"task-board-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:"Tasks"}),a.jsx("p",{className:"subtitle",children:"Manage and track your tasks across different stages"})]}),a.jsxs("div",{className:"header-actions",children:[a.jsx(ro,{}),a.jsx("span",{className:`status-indicator ${t?"connected":"disconnected"}`,children:t?"● Connected":"○ Disconnected"})]})]}),a.jsx("div",{className:"kanban-board",children:Object.entries(s).map(([l,u])=>a.jsxs("div",{className:`kanban-column column-${l.replace(" ","-")}`,children:[a.jsxs("div",{className:"column-header",children:[a.jsx("h2",{children:l.toUpperCase()}),a.jsx("span",{className:"task-count",children:u.length})]}),a.jsxs("div",{className:"column-content",children:[l===re.NOT_STARTED&&a.jsx("button",{onClick:()=>o(!0),className:"btn-add-task",children:"+ Add New Task"}),u.map(c=>a.jsx(F1,{task:c,onClick:()=>r(c)},c.id))]})]},l))}),i&&a.jsx(B1,{onClose:()=>o(!1)}),n&&a.jsx(_g,{task:n,onClose:()=>r(null),onUpdate:l=>r(l)})]})}function O0(){const[e,t]=k.useState(!1),n=pt(),r=()=>t(!e),i=()=>t(!1),o=[{name:"Home",path:"/",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),a.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),color:"#8e8e93"},{name:"Tasks",path:"/tasks",icon:"📋",color:"#3b82f6"},{name:"Context",path:"/context",icon:"📚",color:"#10b981"},{name:"Tools",path:"/mcp-registry",icon:"🔧",color:"#8b5cf6"},{name:"Logout",path:"/logout",icon:"🔒"}];return a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"hamburger-button",onClick:r,"aria-label":"Menu",children:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),e&&a.jsx("div",{className:"hamburger-overlay",onClick:i}),a.jsxs("div",{className:`hamburger-drawer ${e?"open":""}`,children:[a.jsxs("div",{className:"hamburger-header",children:[a.jsx("h2",{children:"Menu"}),a.jsx("button",{className:"hamburger-close",onClick:i,"aria-label":"Close menu",children:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("nav",{className:"hamburger-nav",children:o.map(s=>{const l=n.pathname===s.path||s.path!=="/"&&n.pathname.startsWith(s.path);return a.jsxs(ar,{to:s.path,className:`hamburger-nav-item ${l?"active":""}`,onClick:i,children:[a.jsx("div",{className:"hamburger-nav-icon",style:{color:s.color},children:typeof s.icon=="string"?a.jsx("span",{className:"hamburger-emoji",children:s.icon}):s.icon}),a.jsx("span",{className:"hamburger-nav-label",children:s.name}),l&&a.jsx("svg",{className:"hamburger-nav-check",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})]},s.path)})})]})]})}const F0=[re.NOT_STARTED,re.IN_PROGRESS,re.FOR_REVIEW,re.DONE],Uo={[re.NOT_STARTED]:{label:"Queued",icon:"○",sublabel:"Ideas + intake"},[re.IN_PROGRESS]:{label:"Building",icon:"▣",sublabel:"Actively running"},[re.FOR_REVIEW]:{label:"Review",icon:"◆",sublabel:"Needs eyeballs"},[re.DONE]:{label:"Shipped",icon:"▴",sublabel:"Mission complete"}};function z0(){const{tasks:e,isConnected:t}=Hg(),[n,r]=k.useState(null),[i,o]=k.useState(!1),[s,l]=k.useState(re.NOT_STARTED);pr("Tasks");const u=k.useMemo(()=>e.reduce((d,h)=>(d[h.status]=d[h.status]?[...d[h.status],h]:[h],d),{[re.NOT_STARTED]:[],[re.IN_PROGRESS]:[],[re.FOR_REVIEW]:[],[re.DONE]:[]}),[e]),c=u[s]??[],f=d=>{const h=new Date(d),g=Math.round((new Date().getTime()-h.getTime())/(1e3*60));if(g<60)return`${Math.max(g,1)}m ago`;const v=Math.round(g/60);return v<24?`${v}h ago`:h.toLocaleDateString("en-US",{month:"short",day:"numeric"})};return a.jsxs("div",{className:"task-board-mobile",children:[a.jsxs("div",{className:"matrix-frame",children:[a.jsxs("header",{className:"matrix-header",children:[a.jsx(O0,{}),a.jsx("div",{className:"matrix-header-copy",children:a.jsx("h1",{children:"Tasks"})}),a.jsxs("div",{className:"matrix-connection",children:[a.jsx("span",{className:`matrix-connection-dot ${t?"online":"offline"}`,"aria-hidden":!0}),a.jsx("span",{children:t?"":"offline"})]})]}),a.jsxs("section",{className:"matrix-status-panel",children:[a.jsxs("div",{children:[a.jsx("h2",{children:Uo[s].label}),a.jsx("p",{className:"matrix-status-sub",children:Uo[s].sublabel})]}),a.jsxs("div",{className:"matrix-status-count",children:[a.jsx("span",{className:"matrix-count-number",children:c.length}),a.jsx("span",{className:"matrix-count-text",children:"tasks"})]})]}),a.jsxs("section",{className:"matrix-task-feed",children:[c.length===0&&a.jsxs("div",{className:"matrix-empty-state",children:[a.jsx("p",{children:"No entries in this lane."}),s===re.NOT_STARTED&&a.jsx("button",{type:"button",className:"matrix-link",onClick:()=>o(!0),children:"create the first task"})]}),c.map(d=>a.jsxs("article",{className:"matrix-task-card",onClick:()=>r(d),children:[a.jsxs("div",{className:"matrix-task-meta-row",children:[a.jsxs("span",{className:"matrix-task-id",children:["#",d.id.slice(0,6).toUpperCase()]}),a.jsx("span",{className:"matrix-task-updated",children:f(d.updatedAt)})]}),a.jsx("h3",{children:d.name}),a.jsx("p",{children:d.description}),d.tags&&d.tags.length>0&&a.jsx("div",{className:"matrix-task-tags",children:d.tags.map(h=>a.jsx(Ng,{tag:h,small:!0},h.name))}),a.jsxs("div",{className:"matrix-task-footer",children:[a.jsx("span",{children:d.assignee?`Assigned: ${d.assignee}`:"Unassigned"}),d.comments&&d.comments.length>0&&a.jsxs("span",{children:["💬 ",d.comments.length]})]})]},d.id))]})]}),a.jsx("nav",{className:"matrix-bottom-nav","aria-label":"Task status navigation",children:F0.map(d=>a.jsxs("button",{className:`matrix-nav-item ${d===s?"active":""}`,onClick:()=>l(d),type:"button",children:[a.jsx("span",{className:"matrix-nav-icon",children:Uo[d].icon}),a.jsx("span",{className:"matrix-nav-label",children:Uo[d].label}),a.jsx("span",{className:"matrix-nav-count",children:u[d].length})]},d))}),a.jsx("button",{type:"button",className:"matrix-fab",onClick:()=>o(!0),"aria-label":"Create task",children:"➕"}),n&&a.jsx(_g,{task:n,onClose:()=>r(null),onUpdate:d=>r(d)}),i&&a.jsx(M0,{onClose:()=>o(!1)})]})}function M0({onClose:e}){const{toasts:t,showToast:n,removeToast:r}=Tg(),[i,o]=k.useState(""),[s,l]=k.useState(""),[u,c]=k.useState(""),[f,d]=k.useState(""),[h,p]=k.useState([]),[g,v]=k.useState(""),[S,y]=k.useState(!1),m=async x=>{var T;if(x.preventDefault(),!i.trim()||!s.trim()){n("Name and description are required","error");return}y(!0);try{const j=g.split(",").map(E=>E.trim()).filter(Boolean);await Lt.tasksControllerCreateTask({name:i,description:s,...u&&{assignee:u},...f&&{sessionId:f},...h.length>0&&{tagNames:h},...j.length>0&&{dependsOnIds:j}}),e()}catch(j){const E=((T=j==null?void 0:j.body)==null?void 0:T.detail)||(j==null?void 0:j.message)||"Failed to create task";n(E,"error")}finally{y(!1)}};return a.jsx("div",{className:"mobile-create-overlay",onClick:e,children:a.jsxs("div",{className:"mobile-create-panel",onClick:x=>x.stopPropagation(),children:[a.jsxs("header",{className:"mobile-create-header",children:[a.jsxs("div",{children:[a.jsx("p",{className:"matrix-status-label",children:"New task payload"}),a.jsx("h2",{children:"Compose"})]}),a.jsx("button",{type:"button",className:"matrix-link",onClick:e,children:"close"})]}),a.jsxs("form",{className:"mobile-create-form",onSubmit:m,children:[a.jsxs("label",{children:[a.jsx("span",{children:"Title *"}),a.jsx("input",{type:"text",value:i,onChange:x=>o(x.target.value),placeholder:"Ship a feature",required:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Description *"}),a.jsx("textarea",{value:s,onChange:x=>l(x.target.value),placeholder:"Outline what needs to happen",rows:4,required:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Assignee"}),a.jsx("input",{type:"text",value:u,onChange:x=>c(x.target.value),placeholder:"agent or human"})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Session ID"}),a.jsx("input",{type:"text",value:f,onChange:x=>d(x.target.value),placeholder:"link a running session"})]}),a.jsxs("div",{className:"mobile-form-control",children:[a.jsx("span",{children:"Tags"}),a.jsx(Ac,{value:h,onChange:p,placeholder:"ops, agents, ui"})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Depends on task IDs"}),a.jsx("input",{type:"text",value:g,onChange:x=>v(x.target.value),placeholder:"comma separated"})]}),a.jsx("button",{type:"submit",className:"matrix-submit",disabled:S,children:S?"Transmitting…":"Create Task"})]}),t.map(x=>a.jsx(jg,{message:x.message,type:x.type,onClose:()=>r(x.id)},x.id))]})})}function Wg(e,t){return t?e.id===t?!0:e.children?e.children.some(n=>Wg(n,t)):!1:!1}const B0=k.memo(function e({page:t,level:n,isActive:r,currentPageId:i,onPageClick:o,onAddChild:s}){const l=t.children&&t.children.length>0,u=l&&Wg(t,i),[c,f]=k.useState(u);k.useEffect(()=>{u&&f(!0)},[u]);const d=v=>{v.stopPropagation(),f(!c)},h=v=>{v.preventDefault(),o(t.id)},p=v=>{v.preventDefault(),v.stopPropagation(),s(t.id)},g=k.useMemo(()=>l?[...t.children].sort((v,S)=>v.order-S.order):[],[l,t.children]);return a.jsxs("div",{className:"page-tree-item",children:[a.jsxs("div",{className:`tree-item-content ${r?"active":""}`,style:{paddingLeft:`${n*20}px`},children:[l?a.jsx("button",{className:"tree-toggle",onClick:d,"aria-label":c?"Collapse":"Expand","aria-expanded":c,children:c?"▼":"▶"}):a.jsx("span",{className:"tree-spacer"}),a.jsx("a",{href:"#",className:"tree-item-link",onClick:h,"aria-current":r?"page":void 0,children:t.title}),a.jsx("button",{className:"tree-item-add-child",onClick:p,"aria-label":`Add child page to ${t.title}`,title:"Add child page",children:"+"})]}),c&&l&&a.jsx("div",{className:"tree-item-children",children:g.map(v=>a.jsx(e,{page:v,level:n+1,isActive:v.id===i,currentPageId:i,onPageClick:o,onAddChild:s},v.id))})]})});function U0({pages:e,currentPageId:t,onPageClick:n}){const r=Oe(),i=k.useMemo(()=>[...e].sort((s,l)=>s.order-l.order),[e]),o=s=>{r(`/context/page/${s}/new`)};return a.jsx("div",{className:"page-tree",children:i.map(s=>a.jsx(B0,{page:s,level:0,isActive:s.id===t,currentPageId:t,onPageClick:n,onAddChild:o},s.id))})}z.BASE=hr;const $0=Eg("/context"),mo=()=>{const[e,t]=k.useState([]),[n,r]=k.useState(null),[i,o]=k.useState(!1),[s,l]=k.useState(!1),[u,c]=k.useState(!1),[f,d]=k.useState(!1),[h,p]=k.useState(!1),[g,v]=k.useState(null),[S,y]=k.useState(null),[m,x]=k.useState(!1),T=k.useCallback(async()=>{o(!0),v(null);try{const O=await _t.contextControllerListBlocks();t(O.items)}catch(O){v(O instanceof Error?O.message:"Failed to load wiki pages")}finally{o(!1)}},[]),j=k.useCallback(async O=>{l(!0),v(null),r(null);try{const L=await _t.contextControllerGetBlock(O);r(L)}catch(L){v(L instanceof Error?L.message:"Failed to fetch wiki page")}finally{l(!1)}},[]),E=k.useCallback(async O=>{c(!0),v(null);try{const L=await _t.contextControllerCreateBlock(O);return t(C=>{const B=C.filter(w=>w.id!==L.id);return[{id:L.id,title:L.title,createdBy:L.createdBy,createdByActorId:L.createdByActorId,tags:L.tags,parentId:L.parentId,order:L.order,createdAt:L.createdAt,updatedAt:L.updatedAt},...B]}),r(L),L}catch(L){throw v(L instanceof Error?L.message:"Failed to create wiki page"),L}finally{c(!1)}},[]),_=k.useCallback(O=>{j(O)},[j]),D=k.useCallback(async(O,L)=>{d(!0),v(null);try{const C=await _t.contextControllerUpdateBlock(O,L);return t(B=>B.map(w=>w.id===O?{id:C.id,title:C.title,createdBy:C.createdBy,createdByActorId:C.createdByActorId,tags:C.tags,parentId:C.parentId,order:C.order,createdAt:C.createdAt,updatedAt:C.updatedAt}:w)),(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to update page"),C}finally{d(!1)}},[n]),R=k.useCallback(async O=>{p(!0),v(null);try{await _t.contextControllerDeleteBlock(O),t(L=>L.filter(C=>C.id!==O)),(n==null?void 0:n.id)===O&&r(null)}catch(L){throw v(L instanceof Error?L.message:"Failed to delete page"),L}finally{p(!1)}},[n]),b=k.useCallback(async(O,L)=>{d(!0),v(null);try{const C=await _t.contextControllerAppendToBlock(O,{content:L});return(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to append content"),C}finally{d(!1)}},[n]),P=k.useCallback(async(O,L)=>{v(null);try{const C=await _t.contextControllerAddTagToBlock(O,L);return t(B=>B.map(w=>w.id===O?{id:C.id,title:C.title,createdBy:C.createdBy,createdByActorId:C.createdByActorId,tags:C.tags,parentId:C.parentId,order:C.order,createdAt:C.createdAt,updatedAt:C.updatedAt}:w)),(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to add tag"),C}},[n]),q=k.useCallback(async(O,L)=>{v(null);try{const C=await _t.contextControllerRemoveTagFromBlock(O,L);return t(B=>B.map(w=>w.id===O?{id:C.id,title:C.title,createdBy:C.createdBy,createdByActorId:C.createdByActorId,tags:C.tags,parentId:C.parentId,order:C.order,createdAt:C.createdAt,updatedAt:C.updatedAt}:w)),(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to remove tag"),C}},[n]),V=k.useCallback(async()=>{v(null);try{return await _t.contextControllerGetBlockTree()}catch(O){throw v(O instanceof Error?O.message:"Failed to fetch page tree"),O}},[]),H=k.useCallback(async(O,L)=>{v(null);try{const C=await _t.contextControllerReorderBlock(O,{newOrder:L});return t(B=>B.map(w=>w.id===O?{id:C.id,title:C.title,createdBy:C.createdBy,createdByActorId:C.createdByActorId,tags:C.tags,parentId:C.parentId,order:C.order,createdAt:C.createdAt,updatedAt:C.updatedAt}:w)),(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to reorder page"),C}},[n]),G=k.useCallback(async(O,L)=>{v(null);try{const C=await _t.contextControllerMoveBlock(O,{newParentId:L});return t(B=>B.map(w=>w.id===O?{id:C.id,title:C.title,createdBy:C.createdBy,createdByActorId:C.createdByActorId,tags:C.tags,parentId:C.parentId,order:C.order,createdAt:C.createdAt,updatedAt:C.updatedAt}:w)),(n==null?void 0:n.id)===O&&r(C),C}catch(C){throw v(C instanceof Error?C.message:"Failed to move page"),C}},[n]);return k.useEffect(()=>{const O=Di($0,{transports:["websocket","polling"],withCredentials:!0});return O.on("connect",()=>{console.log("Connected to Context websocket"),O.emit("context.subscribe",{},L=>{L.ok?(console.log(L),console.log("Subscribed to room:",L.room),x(!0)):(console.error("Failed to subscribe to room"),x(!1))}),x(!0),T()}),O.on("disconnect",()=>{console.log("Context WebSocket disconnected"),x(!1)}),O.on("page.created",L=>{t(C=>C.some(B=>B.id===L.id)?C:[{id:L.id,title:L.title,createdBy:L.createdBy,createdByActorId:L.createdByActorId,tags:L.tags,parentId:L.parentId,order:L.order,createdAt:L.createdAt,updatedAt:L.updatedAt},...C])}),O.on("page.updated",L=>{t(C=>C.map(B=>B.id===L.id?{id:L.id,title:L.title,createdBy:L.createdBy,createdByActorId:L.createdByActorId,tags:L.tags,parentId:L.parentId,order:L.order,createdAt:L.createdAt,updatedAt:L.updatedAt}:B)),(n==null?void 0:n.id)===L.id&&r(L)}),O.on("page.deleted",({pageId:L})=>{t(C=>C.filter(B=>B.id!==L)),(n==null?void 0:n.id)===L&&r(null)}),y(O),()=>{O.disconnect()}},[T,n==null?void 0:n.id]),k.useEffect(()=>{T()},[T]),{pages:e,selectedPage:n,isLoadingList:i,isLoadingPage:s,isCreating:u,isUpdating:f,isDeleting:h,error:g,isConnected:m,socket:S,loadPages:T,createPage:E,selectPage:_,updatePage:D,appendToPage:b,deletePage:R,addTagToPage:P,removeTagFromPage:q,getPageTree:V,reorderPage:H,movePage:G}},Wf="context-sidebar-collapsed";function H0(){const{pageId:e}=fr(),t=Oe(),{getPageTree:n,isConnected:r,socket:i}=mo(),[o,s]=k.useState([]),[l,u]=k.useState(!1),[c,f]=k.useState(()=>{const g=localStorage.getItem(Wf);return g!==null?g==="true":no()});k.useEffect(()=>{localStorage.setItem(Wf,String(c))},[c]);const d=k.useCallback(async()=>{u(!0);try{const g=await n();s(g)}catch(g){console.error("Failed to load page tree:",g)}finally{u(!1)}},[n]);k.useEffect(()=>{d()},[d]),k.useEffect(()=>{if(!i)return;const g=()=>{d()},v=()=>{d()},S=()=>{d()};return i.on("page.created",g),i.on("page.updated",v),i.on("page.deleted",S),()=>{i.off("page.created",g),i.off("page.updated",v),i.off("page.deleted",S)}},[i,d]);const h=k.useCallback(g=>{t(`/context/page/${g}`)},[t]),p=()=>{f(!c)};return a.jsxs("div",{className:"context-with-sidebar",children:[a.jsxs("aside",{className:`sidebar-app-specific ${c?"collapsed":""}`,children:[a.jsxs("nav",{className:"sidebar-content",children:[c&&a.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px"},children:a.jsx("span",{className:`context-status-dot ${r?"connected":"disconnected"}`,title:r?"WebSocket connected":"WebSocket disconnected","aria-label":r?"WebSocket connected":"WebSocket disconnected"})}),!c&&a.jsxs("div",{children:[a.jsxs("div",{className:"context-sidebar-header",children:[a.jsxs("h2",{className:"context-sidebar-title",children:["📚 Context",a.jsx("span",{className:`context-status-dot ${r?"connected":"disconnected"}`,title:r?"WebSocket connected":"WebSocket disconnected","aria-label":r?"WebSocket connected":"WebSocket disconnected"})]}),a.jsx("button",{className:"context-button primary context-sidebar-new-page",type:"button",onClick:()=>t("/context/new"),title:"Create new page",children:"+ New page"})]}),l&&a.jsx("div",{className:"context-status",children:"Loading pages…"}),o.length>0&&a.jsx(U0,{pages:o,currentPageId:e,onPageClick:h}),o.length===0&&!l&&a.jsx("div",{className:"context-empty-sidebar",children:a.jsx("span",{children:"No pages yet"})})]})]}),a.jsx("button",{className:"sidebar-toggle",onClick:p,"aria-label":c?"Expand sidebar":"Collapse sidebar",children:c?"→":"←"})]}),a.jsx("main",{className:"context-content",children:a.jsx(bc,{})})]})}const Vg=({tag:e,onRemove:t,small:n=!1})=>{const r=e.color||"#6B7280";return a.jsxs("span",{className:`tag-badge ${n?"tag-badge-small":""}`,style:{backgroundColor:r,color:"#ffffff",padding:n?"1px 4px":"2px 6px",borderRadius:"3px",fontSize:n?"0.65rem":"0.7rem",fontWeight:"500",display:"inline-flex",alignItems:"center",gap:"2px",marginRight:"4px",marginBottom:"4px"},children:[e.name,t&&a.jsx("button",{onClick:i=>{i.stopPropagation(),t()},style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"0",marginLeft:"1px",fontSize:n?"0.75rem":"0.85rem",lineHeight:"1"},"aria-label":`Remove ${e.name} tag`,children:"×"})]})};function W0(){const e=Oe(),{pages:t,isLoadingList:n}=mo();return n?a.jsx("div",{className:"context-welcome",children:a.jsx("p",{children:"Loading pages..."})}):t.length===0?a.jsxs("div",{className:"context-welcome",children:[a.jsx("h2",{children:"Context"}),a.jsx("br",{}),a.jsx("button",{className:"context-button primary",type:"button",onClick:()=>e("/context/new"),title:"Create new page",children:"+ New page"})]}):a.jsxs("div",{className:"context-content",style:{padding:"24px"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[a.jsx("h2",{style:{margin:0},children:"All Pages"}),a.jsx("button",{className:"context-button primary",type:"button",onClick:()=>e("/context/new"),title:"Create new page",children:"+ New page"})]}),a.jsx("div",{className:"context-grid",children:t.map(r=>a.jsxs("div",{className:"context-card",onClick:()=>e(`/context/page/${r.id}`),style:{cursor:"pointer"},children:[a.jsx("h3",{children:r.title}),r.tags&&r.tags.length>0&&a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:r.tags.map(i=>a.jsx(Vg,{tag:i},i.name))}),a.jsxs("div",{className:"context-card-meta",children:[a.jsxs("span",{children:["By ",r.createdBy||"unknown"]}),a.jsxs("span",{children:["Created ",new Date(r.createdAt).toLocaleDateString()]}),r.updatedAt!==r.createdAt&&a.jsxs("span",{children:["Updated ",new Date(r.updatedAt).toLocaleDateString()]})]})]},r.id))})]})}const V0=({value:e,onChange:t,placeholder:n="Type to add tags..."})=>{const[r,i]=k.useState(""),[o,s]=k.useState([]),[l,u]=k.useState(!1),[c,f]=k.useState(-1),[d,h]=k.useState([]),p=k.useRef(null),g=k.useRef(null);k.useEffect(()=>{(async()=>{try{const x=await Sg.metaControllerGetAllTags();h(x)}catch(x){console.error("Failed to load tags:",x)}})()},[]),k.useEffect(()=>{const x=setTimeout(()=>{if(r.trim().length>0){const T=r.trim().toLowerCase(),j=d.filter(E=>E.name.toLowerCase().includes(T)&&!e.includes(E.name));s(j),u(!0)}else s([]),u(!1)},150);return()=>clearTimeout(x)},[r,e,d]),k.useEffect(()=>{const m=x=>{g.current&&!g.current.contains(x.target)&&u(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const v=m=>{var T;const x=m.trim();x&&!e.includes(x)&&t([...e,x]),i(""),s([]),u(!1),f(-1),(T=p.current)==null||T.focus()},S=m=>{t(e.filter(x=>x!==m))},y=m=>{m.key==="Tab"&&r.trim()||m.key==="Enter"&&r.trim()?(m.preventDefault(),c>=0&&o[c]?v(o[c].name):v(r)):m.key==="ArrowDown"?(m.preventDefault(),f(x=>x<o.length-1?x+1:x)):m.key==="ArrowUp"?(m.preventDefault(),f(x=>x>0?x-1:-1)):m.key==="Escape"?(u(!1),f(-1)):m.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))};return a.jsxs("div",{ref:g,style:{position:"relative"},children:[a.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"6px",border:"1px solid #ddd",borderRadius:"4px",minHeight:"38px",cursor:"text"},onClick:()=>{var m;return(m=p.current)==null?void 0:m.focus()},children:[e.map(m=>{const x=d.find(j=>j.name===m),T=(x==null?void 0:x.color)||"#3B82F6";return a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:T,color:"white",padding:"2px 6px",borderRadius:"3px",fontSize:"0.7rem",fontWeight:"500"},children:[m,a.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),S(m)},style:{background:"none",border:"none",color:"white",cursor:"pointer",padding:"0",marginLeft:"1px",fontSize:"0.85rem",lineHeight:"1"},children:"×"})]},m)}),a.jsx("input",{ref:p,type:"text",value:r,onChange:m=>i(m.target.value),onKeyDown:y,onFocus:()=>r&&u(!0),placeholder:e.length===0?n:"",style:{flex:"1",minWidth:"120px",border:"none",outline:"none",fontSize:"0.875rem",padding:"2px"}})]}),l&&o.length>0&&a.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",border:"1px solid #ddd",borderRadius:"4px",marginTop:"2px",maxHeight:"200px",overflowY:"auto",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:1e3},children:o.map((m,x)=>a.jsxs("div",{onClick:()=>v(m.name),style:{padding:"8px 12px",cursor:"pointer",backgroundColor:x===c?"#EFF6FF":"white",display:"flex",alignItems:"center",gap:"8px"},onMouseEnter:()=>f(x),children:[a.jsx("span",{style:{width:"12px",height:"12px",borderRadius:"2px",backgroundColor:m.color||"#6B7280"}}),a.jsx("span",{style:{fontSize:"0.875rem"},children:m.name})]},m.name))}),l&&r&&o.length===0&&a.jsxs("div",{style:{position:"absolute",top:"100%",left:0,right:0,backgroundColor:"white",border:"1px solid #ddd",borderRadius:"4px",marginTop:"2px",padding:"8px 12px",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:1e3,fontSize:"0.875rem",color:"#6B7280"},children:['Press Tab or Enter to create "',r,'"']})]})};function q0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const G0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q0={};function Vf(e,t){return(Q0.jsx?K0:G0).test(e)}const Y0=/[ \t\n\f\r]/g;function X0(e){return typeof e=="object"?e.type==="text"?qf(e.value):!1:qf(e)}function qf(e){return e.replace(Y0,"")===""}class go{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}go.prototype.normal={};go.prototype.property={};go.prototype.space=void 0;function qg(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new go(n,r,t)}function pu(e){return e.toLowerCase()}class tt{constructor(t,n){this.attribute=n,this.property=t}}tt.prototype.attribute="";tt.prototype.booleanish=!1;tt.prototype.boolean=!1;tt.prototype.commaOrSpaceSeparated=!1;tt.prototype.commaSeparated=!1;tt.prototype.defined=!1;tt.prototype.mustUseProperty=!1;tt.prototype.number=!1;tt.prototype.overloadedBoolean=!1;tt.prototype.property="";tt.prototype.spaceSeparated=!1;tt.prototype.space=void 0;let J0=0;const X=mr(),Ee=mr(),mu=mr(),M=mr(),fe=mr(),Mr=mr(),it=mr();function mr(){return 2**++J0}const gu=Object.freeze(Object.defineProperty({__proto__:null,boolean:X,booleanish:Ee,commaOrSpaceSeparated:it,commaSeparated:Mr,number:M,overloadedBoolean:mu,spaceSeparated:fe},Symbol.toStringTag,{value:"Module"})),Yl=Object.keys(gu);class Fc extends tt{constructor(t,n,r,i){let o=-1;if(super(t,n),Gf(this,"space",i),typeof r=="number")for(;++o<Yl.length;){const s=Yl[o];Gf(this,Yl[o],(r&gu[s])===gu[s])}}}Fc.prototype.defined=!0;function Gf(e,t,n){n&&(e[t]=n)}function ni(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Fc(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[pu(r)]=r,n[pu(o.attribute)]=r}return new go(t,n,e.space)}const Gg=ni({properties:{ariaActiveDescendant:null,ariaAtomic:Ee,ariaAutoComplete:null,ariaBusy:Ee,ariaChecked:Ee,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:fe,ariaCurrent:null,ariaDescribedBy:fe,ariaDetails:null,ariaDisabled:Ee,ariaDropEffect:fe,ariaErrorMessage:null,ariaExpanded:Ee,ariaFlowTo:fe,ariaGrabbed:Ee,ariaHasPopup:null,ariaHidden:Ee,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fe,ariaLevel:M,ariaLive:null,ariaModal:Ee,ariaMultiLine:Ee,ariaMultiSelectable:Ee,ariaOrientation:null,ariaOwns:fe,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:Ee,ariaReadOnly:Ee,ariaRelevant:null,ariaRequired:Ee,ariaRoleDescription:fe,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:Ee,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Kg(e,t){return t in e?e[t]:t}function Qg(e,t){return Kg(e,t.toLowerCase())}const Z0=ni({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mr,acceptCharset:fe,accessKey:fe,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:fe,autoFocus:X,autoPlay:X,blocking:fe,capture:null,charSet:null,checked:X,cite:null,className:fe,cols:M,colSpan:null,content:null,contentEditable:Ee,controls:X,controlsList:fe,coords:M|Mr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:mu,draggable:Ee,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:fe,height:M,hidden:mu,high:M,href:null,hrefLang:null,htmlFor:fe,httpEquiv:fe,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:fe,itemRef:fe,itemScope:X,itemType:fe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:M,pattern:null,ping:fe,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:fe,required:X,reversed:X,rows:M,rowSpan:M,sandbox:fe,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:Ee,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:Ee,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fe,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:Ee,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Qg}),eS=ni({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",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:it,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:fe,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:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,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:Mr,g2:Mr,glyphName:Mr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:it,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,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:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:fe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:it,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:it,rev:it,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:it,requiredFeatures:it,requiredFonts:it,requiredFormats:it,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:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:it,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:it,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:it,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Kg}),Yg=ni({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()}}),Xg=ni({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qg}),Jg=ni({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tS={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"},nS=/[A-Z]/g,Kf=/-[a-z]/g,rS=/^data[-\w.:]+$/i;function iS(e,t){const n=pu(t);let r=t,i=tt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rS.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Kf,sS);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Kf.test(o)){let s=o.replace(nS,oS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Fc}return new i(r,t)}function oS(e){return"-"+e.toLowerCase()}function sS(e){return e.charAt(1).toUpperCase()}const lS=qg([Gg,Z0,Yg,Xg,Jg],"html"),zc=qg([Gg,eS,Yg,Xg,Jg],"svg");function aS(e){return e.join(" ").trim()}var Mc={},Qf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,uS=/\n/g,cS=/^\s*/,dS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fS=/^:\s*/,hS=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pS=/^[;\s]*/,mS=/^\s+|\s+$/g,gS=`
52
- `,Yf="/",Xf="*",Yn="",yS="comment",xS="declaration";function vS(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var v=g.match(uS);v&&(n+=v.length);var S=g.lastIndexOf(gS);r=~S?g.length-S:r+g.length}function o(){var g={line:n,column:r};return function(v){return v.position=new s(g),c(),v}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function u(g){var v=g.exec(e);if(v){var S=v[0];return i(S),e=e.slice(S.length),v}}function c(){u(cS)}function f(g){var v;for(g=g||[];v=d();)v!==!1&&g.push(v);return g}function d(){var g=o();if(!(Yf!=e.charAt(0)||Xf!=e.charAt(1))){for(var v=2;Yn!=e.charAt(v)&&(Xf!=e.charAt(v)||Yf!=e.charAt(v+1));)++v;if(v+=2,Yn===e.charAt(v-1))return l("End of comment missing");var S=e.slice(2,v-2);return r+=2,i(S),e=e.slice(v),r+=2,g({type:yS,comment:S})}}function h(){var g=o(),v=u(dS);if(v){if(d(),!u(fS))return l("property missing ':'");var S=u(hS),y=g({type:xS,property:Jf(v[0].replace(Qf,Yn)),value:S?Jf(S[0].replace(Qf,Yn)):Yn});return u(pS),y}}function p(){var g=[];f(g);for(var v;v=h();)v!==!1&&(g.push(v),f(g));return g}return c(),p()}function Jf(e){return e?e.replace(mS,Yn):Yn}var kS=vS,wS=ds&&ds.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mc,"__esModule",{value:!0});Mc.default=CS;const SS=wS(kS);function CS(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,SS.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:l}=o;i?t(s,l,o):l&&(n=n||{},n[s]=l)}),n}var ll={};Object.defineProperty(ll,"__esModule",{value:!0});ll.camelCase=void 0;var ES=/^--[a-zA-Z0-9_-]+$/,bS=/-([a-z])/g,NS=/^[^-]+$/,TS=/^-(webkit|moz|ms|o|khtml)-/,jS=/^-(ms)-/,_S=function(e){return!e||NS.test(e)||ES.test(e)},IS=function(e,t){return t.toUpperCase()},Zf=function(e,t){return"".concat(t,"-")},AS=function(e,t){return t===void 0&&(t={}),_S(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(jS,Zf):e=e.replace(TS,Zf),e.replace(bS,IS))};ll.camelCase=AS;var RS=ds&&ds.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},PS=RS(Mc),DS=ll;function yu(e,t){var n={};return!e||typeof e!="string"||(0,PS.default)(e,function(r,i){r&&i&&(n[(0,DS.camelCase)(r,t)]=i)}),n}yu.default=yu;var LS=yu;const OS=Hh(LS),Zg=ey("end"),Bc=ey("start");function ey(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function FS(e){const t=Bc(e),n=Zg(e);if(t&&n)return{start:t,end:n}}function Li(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?eh(e.position):"start"in e||"end"in e?eh(e):"line"in e||"column"in e?xu(e):""}function xu(e){return th(e&&e.line)+":"+th(e&&e.column)}function eh(e){return xu(e&&e.start)+"-"+xu(e&&e.end)}function th(e){return e&&typeof e=="number"?e:1}class $e extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Li(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$e.prototype.file="";$e.prototype.name="";$e.prototype.reason="";$e.prototype.message="";$e.prototype.stack="";$e.prototype.column=void 0;$e.prototype.line=void 0;$e.prototype.ancestors=void 0;$e.prototype.cause=void 0;$e.prototype.fatal=void 0;$e.prototype.place=void 0;$e.prototype.ruleId=void 0;$e.prototype.source=void 0;const Uc={}.hasOwnProperty,zS=new Map,MS=/[A-Z]/g,BS=new Set(["table","tbody","thead","tfoot","tr"]),US=new Set(["td","th"]),ty="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $S(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=YS(n,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");r=QS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?zc:lS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ny(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ny(e,t,n){if(t.type==="element")return HS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return WS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qS(e,t,n);if(t.type==="mdxjsEsm")return VS(e,t);if(t.type==="root")return GS(e,t,n);if(t.type==="text")return KS(e,t)}function HS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=zc,e.schema=i),e.ancestors.push(t);const o=iy(e,t.tagName,!1),s=XS(e,t);let l=Hc(e,t);return BS.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!X0(u):!0})),ry(e,s,o,t),$c(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function WS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}io(e,t.position)}function VS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);io(e,t.position)}function qS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=zc,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:iy(e,t.name,!0),s=JS(e,t),l=Hc(e,t);return ry(e,s,o,t),$c(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function GS(e,t,n){const r={};return $c(r,Hc(e,t)),e.create(t,e.Fragment,r,n)}function KS(e,t){return t.value}function ry(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $c(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QS(e,t,n){return r;function r(i,o,s,l){const c=Array.isArray(s.children)?n:t;return l?c(o,s,l):c(o,s)}}function YS(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),u=Bc(r);return t(i,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function XS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Uc.call(t.properties,i)){const o=ZS(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&US.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function JS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else io(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else io(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Hc(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:zS;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const l=ny(e,o,s);l!==void 0&&n.push(l)}return n}function ZS(e,t,n){const r=iS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?q0(n):aS(n)),r.property==="style"){let i=typeof n=="object"?n:eC(e,String(n));return e.stylePropertyNameCase==="css"&&(i=tC(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?tS[r.property]||r.property:r.attribute,n]}}function eC(e,t){try{return OS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new $e("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ty+"#cannot-parse-style-attribute",i}}function iy(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=Vf(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=Vf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Uc.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);io(e)}function io(e,t){const n=new $e("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ty+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tC(e){const t={};let n;for(n in e)Uc.call(e,n)&&(t[nC(n)]=e[n]);return t}function nC(e){let t=e.replace(MS,rC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rC(e){return"-"+e.toLowerCase()}const Xl={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"]},iC={};function Wc(e,t){const n=iC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oy(e,r,i)}function oy(e,t,n){if(oC(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return nh(e.children,t,n)}return Array.isArray(e)?nh(e,t,n):""}function nh(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=oy(e[i],t,n);return r.join("")}function oC(e){return!!(e&&typeof e=="object")}const rh=document.createElement("i");function Vc(e){const t="&"+e+";";rh.innerHTML=t;const n=rh.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function at(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function kt(e,t){return e.length>0?(at(e,e.length,0,t),e):t}const ih={}.hasOwnProperty;function sy(e){const t={};let n=-1;for(;++n<e.length;)sC(t,e[n]);return t}function sC(e,t){let n;for(n in t){const i=(ih.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){ih.call(i,s)||(i[s]=[]);const l=o[s];lC(i[s],Array.isArray(l)?l:l?[l]:[])}}}function lC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);at(e,0,0,r)}function ly(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const We=Wn(/[A-Za-z]/),Be=Wn(/[\dA-Za-z]/),aC=Wn(/[#-'*+\--9=?A-Z^-~]/);function Fs(e){return e!==null&&(e<32||e===127)}const vu=Wn(/\d/),uC=Wn(/[\dA-Fa-f]/),cC=Wn(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function de(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const al=Wn(new RegExp("\\p{P}|\\p{S}","u")),ur=Wn(/\s/);function Wn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ri(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Be(e.charCodeAt(n+1))&&Be(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ie(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return Z(u)?(e.enter(n),l(u)):t(u)}function l(u){return Z(u)&&o++<i?(e.consume(u),l):(e.exit(n),t(u))}}const dC={tokenize:fC};function fC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ie(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Q(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const hC={tokenize:pC},oh={tokenize:mC};function pC(e){const t=this,n=[];let r=0,i,o,s;return l;function l(x){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,u,c)(x)}return c(x)}function u(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&m();const T=t.events.length;let j=T,E;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){E=t.events[j][1].end;break}y(r);let _=T;for(;_<t.events.length;)t.events[_][1].end={...E},_++;return at(t.events,j+1,0,t.events.slice(T)),t.events.length=_,c(x)}return l(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return g(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oh,f,d)(x)}function f(x){return i&&m(),y(r),h(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(x)}function h(x){return t.containerState={},e.attempt(oh,p,g)(x)}function p(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function g(x){if(x===null){i&&m(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),v(x)}function v(x){if(x===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Q(x)?(e.consume(x),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(x),v)}function S(x,T){const j=t.sliceStream(x);if(T&&j.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(j),t.parser.lazy[x.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const _=t.events.length;let D=_,R,b;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){b=t.events[D][1].end;break}R=!0}for(y(r),E=_;E<t.events.length;)t.events[E][1].end={...b},E++;at(t.events,D+1,0,t.events.slice(_)),t.events.length=E}}function y(x){let T=n.length;for(;T-- >x;){const j=n[T];t.containerState=j[1],j[0].exit.call(t,e)}n.length=x}function m(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function mC(e,t,n){return ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kr(e){if(e===null||de(e)||ur(e))return 1;if(al(e))return 2}function ul(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ku={name:"attention",resolveAll:gC,tokenize:yC};function gC(e,t){let n=-1,r,i,o,s,l,u,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};sh(d,-u),sh(h,u),s={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=kt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=kt(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=kt(c,ul(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=kt(c,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=kt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,at(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kr(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===o)return e.consume(u),l;const c=e.exit("attentionSequence"),f=Kr(u),d=!f||f===2&&i||n.includes(u),h=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(f||!d)),t(u)}}function sh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xC={name:"autolink",tokenize:vC};function vC(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return We(p)?(e.consume(p),s):p===64?n(p):c(p)}function s(p){return p===43||p===45||p===46||Be(p)?(r=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||Be(p))&&r++<32?(e.consume(p),l):(r=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Fs(p)?n(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),f):aC(p)?(e.consume(p),c):n(p)}function f(p){return Be(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Be(p))&&r++<63){const g=p===45?h:d;return e.consume(p),g}return n(p)}}const yo={partial:!0,tokenize:kC};function kC(e,t,n){return r;function r(o){return Z(o)?ie(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Q(o)?t(o):n(o)}}const ay={continuation:{tokenize:SC},exit:CC,name:"blockQuote",tokenize:wC};function wC(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Z(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function SC(e,t,n){const r=this;return i;function i(s){return Z(s)?ie(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(ay,t,n)(s)}}function CC(e){e.exit("blockQuote")}const uy={name:"characterEscape",tokenize:EC};function EC(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return cC(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const cy={name:"characterReference",tokenize:bC};function bC(e,t,n){const r=this;let i=0,o,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Be,f(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=uC,f):(e.enter("characterReferenceValue"),o=7,s=vu,f(d))}function f(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===Be&&!Vc(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),f):n(d)}}const lh={partial:!0,tokenize:TC},ah={concrete:!0,name:"codeFenced",tokenize:NC};function NC(e,t,n){const r=this,i={partial:!0,tokenize:j};let o=0,s=0,l;return u;function u(E){return c(E)}function c(E){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,l=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===l?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),Z(E)?ie(e,d,"whitespace")(E):d(E))}function d(E){return E===null||Q(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(lh,v,T)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||Q(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Z(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ie(e,p,"whitespace")(E)):E===96&&E===l?n(E):(e.consume(E),h)}function p(E){return E===null||Q(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||Q(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===l?n(E):(e.consume(E),g)}function v(E){return e.attempt(i,T,S)(E)}function S(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),y}function y(E){return o>0&&Z(E)?ie(e,m,"linePrefix",o+1)(E):m(E)}function m(E){return E===null||Q(E)?e.check(lh,v,T)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||Q(E)?(e.exit("codeFlowValue"),m(E)):(e.consume(E),x)}function T(E){return e.exit("codeFenced"),t(E)}function j(E,_,D){let R=0;return b;function b(G){return E.enter("lineEnding"),E.consume(G),E.exit("lineEnding"),P}function P(G){return E.enter("codeFencedFence"),Z(G)?ie(E,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):q(G)}function q(G){return G===l?(E.enter("codeFencedFenceSequence"),V(G)):D(G)}function V(G){return G===l?(R++,E.consume(G),V):R>=s?(E.exit("codeFencedFenceSequence"),Z(G)?ie(E,H,"whitespace")(G):H(G)):D(G)}function H(G){return G===null||Q(G)?(E.exit("codeFencedFence"),_(G)):D(G)}}}function TC(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Jl={name:"codeIndented",tokenize:_C},jC={partial:!0,tokenize:IC};function _C(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ie(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):Q(c)?e.attempt(jC,s,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||Q(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function IC(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Q(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ie(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Q(s)?i(s):n(s)}}const AC={name:"codeText",previous:PC,resolve:RC,tokenize:DC};function RC(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function PC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DC(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(o=e.enter("codeTextSequence"),i=0,f(d)):Q(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Q(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class LC{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,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&yi(this.left,r),o.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),yi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yi(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 n=this.left.splice(t,Number.POSITIVE_INFINITY);yi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);yi(this.left,n.reverse())}}}function yi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function dy(e){const t={};let n=-1,r,i,o,s,l,u,c;const f=new LC(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,OC(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return at(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function OC(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],c={};let f,d,h=-1,p=n,g=0,v=0;const S=[v];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(v=h+1,S.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),h=S.length;h--;){const y=l.slice(S[h],S[h+1]),m=o.pop();u.push([m,m+y.length-1]),e.splice(m,2,y)}for(u.reverse(),h=-1;++h<u.length;)c[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return c}const FC={resolve:MC,tokenize:BC},zC={partial:!0,tokenize:UC};function MC(e){return dy(e),e}function BC(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):Q(l)?e.check(zC,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function UC(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ie(e,o,"linePrefix")}function o(s){if(s===null||Q(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function fy(e,t,n,r,i,o,s,l,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||Fs(y)?n(y):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Q(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function v(y){return!f&&(y===null||y===41||de(y))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(y)):f<c&&y===40?(e.consume(y),f++,v):y===41?(e.consume(y),f--,v):y===null||y===32||y===40||Fs(y)?n(y):(e.consume(y),y===92?S:v)}function S(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function hy(e,t,n,r,i,o){const s=this;let l=0,u;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),f}function f(p){return l>999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Q(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),u||(u=!Z(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function py(e,t,n,r,i,o){let s;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,u):n(h)}function u(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===s?(e.exit(o),u(s)):h===null?n(h):Q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||Q(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:f)}function d(h){return h===s||h===92?(e.consume(h),f):f(h)}}function Oi(e,t){let n;return r;function r(i){return Q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Z(i)?ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $C={name:"definition",tokenize:WC},HC={partial:!0,tokenize:VC};function WC(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return hy.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return de(p)?Oi(e,c)(p):c(p)}function c(p){return fy(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(HC,d,d)(p)}function d(p){return Z(p)?ie(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Q(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function VC(e,t,n){return r;function r(l){return de(l)?Oi(e,i)(l):n(l)}function i(l){return py(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Z(l)?ie(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Q(l)?t(l):n(l)}}const qC={name:"hardBreakEscape",tokenize:GC};function GC(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Q(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const KC={name:"headingAtx",resolve:QC,tokenize:YC};function QC(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},at(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function YC(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||de(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Q(f)?(e.exit("atxHeading"),t(f)):Z(f)?ie(e,l,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),l(f))}function c(f){return f===null||f===35||de(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),c)}}const XC=["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"],uh=["pre","script","style","textarea"],JC={concrete:!0,name:"htmlFlow",resolveTo:tE,tokenize:nE},ZC={partial:!0,tokenize:iE},eE={partial:!0,tokenize:rE};function tE(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 nE(e,t,n){const r=this;let i,o,s,l,u;return c;function c(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),o=!0,v):N===63?(e.consume(N),i=3,r.interrupt?t:w):We(N)?(e.consume(N),s=String.fromCharCode(N),S):n(N)}function h(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,l=0,g):We(N)?(e.consume(N),i=4,r.interrupt?t:w):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:w):n(N)}function g(N){const Se="CDATA[";return N===Se.charCodeAt(l++)?(e.consume(N),l===Se.length?r.interrupt?t:q:g):n(N)}function v(N){return We(N)?(e.consume(N),s=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||de(N)){const Se=N===47,nt=s.toLowerCase();return!Se&&!o&&uh.includes(nt)?(i=1,r.interrupt?t(N):q(N)):XC.includes(s.toLowerCase())?(i=6,Se?(e.consume(N),y):r.interrupt?t(N):q(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?m(N):x(N))}return N===45||Be(N)?(e.consume(N),s+=String.fromCharCode(N),S):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:q):n(N)}function m(N){return Z(N)?(e.consume(N),m):b(N)}function x(N){return N===47?(e.consume(N),b):N===58||N===95||We(N)?(e.consume(N),T):Z(N)?(e.consume(N),x):b(N)}function T(N){return N===45||N===46||N===58||N===95||Be(N)?(e.consume(N),T):j(N)}function j(N){return N===61?(e.consume(N),E):Z(N)?(e.consume(N),j):x(N)}function E(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,_):Z(N)?(e.consume(N),E):D(N)}function _(N){return N===u?(e.consume(N),u=null,R):N===null||Q(N)?n(N):(e.consume(N),_)}function D(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||de(N)?j(N):(e.consume(N),D)}function R(N){return N===47||N===62||Z(N)?x(N):n(N)}function b(N){return N===62?(e.consume(N),P):n(N)}function P(N){return N===null||Q(N)?q(N):Z(N)?(e.consume(N),P):n(N)}function q(N){return N===45&&i===2?(e.consume(N),O):N===60&&i===1?(e.consume(N),L):N===62&&i===4?(e.consume(N),J):N===63&&i===3?(e.consume(N),w):N===93&&i===5?(e.consume(N),B):Q(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ZC,se,V)(N)):N===null||Q(N)?(e.exit("htmlFlowData"),V(N)):(e.consume(N),q)}function V(N){return e.check(eE,H,se)(N)}function H(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),G}function G(N){return N===null||Q(N)?V(N):(e.enter("htmlFlowData"),q(N))}function O(N){return N===45?(e.consume(N),w):q(N)}function L(N){return N===47?(e.consume(N),s="",C):q(N)}function C(N){if(N===62){const Se=s.toLowerCase();return uh.includes(Se)?(e.consume(N),J):q(N)}return We(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),C):q(N)}function B(N){return N===93?(e.consume(N),w):q(N)}function w(N){return N===62?(e.consume(N),J):N===45&&i===2?(e.consume(N),w):q(N)}function J(N){return N===null||Q(N)?(e.exit("htmlFlowData"),se(N)):(e.consume(N),J)}function se(N){return e.exit("htmlFlow"),t(N)}}function rE(e,t,n){const r=this;return i;function i(s){return Q(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function iE(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yo,t,n)}}const oE={name:"htmlText",tokenize:sE};function sE(e,t,n){const r=this;let i,o,s;return l;function l(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),u}function u(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),j):w===63?(e.consume(w),x):We(w)?(e.consume(w),D):n(w)}function c(w){return w===45?(e.consume(w),f):w===91?(e.consume(w),o=0,g):We(w)?(e.consume(w),m):n(w)}function f(w){return w===45?(e.consume(w),p):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),h):Q(w)?(s=d,L(w)):(e.consume(w),d)}function h(w){return w===45?(e.consume(w),p):d(w)}function p(w){return w===62?O(w):w===45?h(w):d(w)}function g(w){const J="CDATA[";return w===J.charCodeAt(o++)?(e.consume(w),o===J.length?v:g):n(w)}function v(w){return w===null?n(w):w===93?(e.consume(w),S):Q(w)?(s=v,L(w)):(e.consume(w),v)}function S(w){return w===93?(e.consume(w),y):v(w)}function y(w){return w===62?O(w):w===93?(e.consume(w),y):v(w)}function m(w){return w===null||w===62?O(w):Q(w)?(s=m,L(w)):(e.consume(w),m)}function x(w){return w===null?n(w):w===63?(e.consume(w),T):Q(w)?(s=x,L(w)):(e.consume(w),x)}function T(w){return w===62?O(w):x(w)}function j(w){return We(w)?(e.consume(w),E):n(w)}function E(w){return w===45||Be(w)?(e.consume(w),E):_(w)}function _(w){return Q(w)?(s=_,L(w)):Z(w)?(e.consume(w),_):O(w)}function D(w){return w===45||Be(w)?(e.consume(w),D):w===47||w===62||de(w)?R(w):n(w)}function R(w){return w===47?(e.consume(w),O):w===58||w===95||We(w)?(e.consume(w),b):Q(w)?(s=R,L(w)):Z(w)?(e.consume(w),R):O(w)}function b(w){return w===45||w===46||w===58||w===95||Be(w)?(e.consume(w),b):P(w)}function P(w){return w===61?(e.consume(w),q):Q(w)?(s=P,L(w)):Z(w)?(e.consume(w),P):R(w)}function q(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,V):Q(w)?(s=q,L(w)):Z(w)?(e.consume(w),q):(e.consume(w),H)}function V(w){return w===i?(e.consume(w),i=void 0,G):w===null?n(w):Q(w)?(s=V,L(w)):(e.consume(w),V)}function H(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||de(w)?R(w):(e.consume(w),H)}function G(w){return w===47||w===62||de(w)?R(w):n(w)}function O(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function L(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),C}function C(w){return Z(w)?ie(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):B(w)}function B(w){return e.enter("htmlTextData"),s(w)}}const qc={name:"labelEnd",resolveAll:cE,resolveTo:dE,tokenize:fE},lE={tokenize:hE},aE={tokenize:pE},uE={tokenize:mE};function cE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&at(e,0,e.length,n),e}function dE(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=kt(l,e.slice(o+1,o+r+3)),l=kt(l,[["enter",f,t]]),l=kt(l,ul(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=kt(l,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),l=kt(l,e.slice(s+1)),l=kt(l,[["exit",u,t]]),at(e,o,e.length,l),e}function fE(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(h){return o?o._inactive?d(h):(s=r.parser.defined.includes(zt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(lE,f,s?f:d)(h):h===91?e.attempt(aE,f,s?c:d)(h):s?f(h):d(h)}function c(h){return e.attempt(uE,f,d)(h)}function f(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function hE(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return de(d)?Oi(e,o)(d):o(d)}function o(d){return d===41?f(d):fy(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return de(d)?Oi(e,u)(d):f(d)}function l(d){return n(d)}function u(d){return d===34||d===39||d===40?py(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function c(d){return de(d)?Oi(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function pE(e,t,n){const r=this;return i;function i(l){return hy.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function mE(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const gE={name:"labelStartImage",resolveAll:qc.resolveAll,tokenize:yE};function yE(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const xE={name:"labelStartLink",resolveAll:qc.resolveAll,tokenize:vE};function vE(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Zl={name:"lineEnding",tokenize:kE};function kE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ie(e,t,"linePrefix")}}const us={name:"thematicBreak",tokenize:wE};function wE(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||Q(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Z(c)?ie(e,l,"whitespace")(c):l(c))}}const Qe={continuation:{tokenize:bE},exit:TE,name:"list",tokenize:EE},SE={partial:!0,tokenize:jE},CE={partial:!0,tokenize:NE};function EE(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:vu(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(us,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return vu(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yo,r.interrupt?n:f,e.attempt(SE,h,d))}function f(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function d(p){return Z(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function bE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yo,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ie(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Z(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(CE,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ie(e,e.attempt(Qe,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function NE(e,t,n){const r=this;return ie(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function TE(e){e.exit(this.containerState.type)}function jE(e,t,n){const r=this;return ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Z(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ch={name:"setextUnderline",resolveTo:_E,tokenize:IE};function _E(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function IE(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Z(c)?ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Q(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const AE={tokenize:RE};function RE(e){const t=this,n=e.attempt(yo,r,e.attempt(this.parser.constructs.flowInitial,i,ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FC,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const PE={resolveAll:gy()},DE=my("string"),LE=my("text");function my(e){return{resolveAll:gy(e==="text"?OE:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(f){return c(f)?o(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const d=i[f];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function gy(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function OE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,l=0,u;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)u=!0,l++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const FE={42:Qe,43:Qe,45:Qe,48:Qe,49:Qe,50:Qe,51:Qe,52:Qe,53:Qe,54:Qe,55:Qe,56:Qe,57:Qe,62:ay},zE={91:$C},ME={[-2]:Jl,[-1]:Jl,32:Jl},BE={35:KC,42:us,45:[ch,us],60:JC,61:ch,95:us,96:ah,126:ah},UE={38:cy,92:uy},$E={[-5]:Zl,[-4]:Zl,[-3]:Zl,33:gE,38:cy,42:ku,60:[xC,oE],91:xE,92:[qC,uy],93:qc,95:ku,96:AC},HE={null:[ku,PE]},WE={null:[42,95]},VE={null:[]},qE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WE,contentInitial:zE,disable:VE,document:FE,flow:BE,flowInitial:ME,insideSpan:HE,string:UE,text:$E},Symbol.toStringTag,{value:"Module"}));function GE(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const u={attempt:_(j),check:_(E),consume:m,enter:x,exit:T,interrupt:_(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:d};let f=t.tokenize.call(c,u);return t.resolveAll&&o.push(t),c;function d(P){return s=kt(s,P),S(),s[s.length-1]!==null?[]:(D(t,0),c.events=ul(o,c.events,c),c.events)}function h(P,q){return QE(p(P),q)}function p(P){return KE(s,P)}function g(){const{_bufferIndex:P,_index:q,line:V,column:H,offset:G}=r;return{_bufferIndex:P,_index:q,line:V,column:H,offset:G}}function v(P){i[P.line]=P.column,b()}function S(){let P;for(;r._index<s.length;){const q=s[r._index];if(typeof q=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<q.length;)y(q.charCodeAt(r._bufferIndex));else y(q)}}function y(P){f=f(P)}function m(P){Q(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,b()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function x(P,q){const V=q||{};return V.type=P,V.start=g(),c.events.push(["enter",V,c]),l.push(V),V}function T(P){const q=l.pop();return q.end=g(),c.events.push(["exit",q,c]),q}function j(P,q){D(P,q.from)}function E(P,q){q.restore()}function _(P,q){return V;function V(H,G,O){let L,C,B,w;return Array.isArray(H)?se(H):"tokenize"in H?se([H]):J(H);function J(ue){return mt;function mt(Bt){const gn=Bt!==null&&ue[Bt],yn=Bt!==null&&ue.null,Vn=[...Array.isArray(gn)?gn:gn?[gn]:[],...Array.isArray(yn)?yn:yn?[yn]:[]];return se(Vn)(Bt)}}function se(ue){return L=ue,C=0,ue.length===0?O:N(ue[C])}function N(ue){return mt;function mt(Bt){return w=R(),B=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?nt():ue.tokenize.call(q?Object.assign(Object.create(c),q):c,u,Se,nt)(Bt)}}function Se(ue){return P(B,w),G}function nt(ue){return w.restore(),++C<L.length?N(L[C]):O}}}function D(P,q){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&at(c.events,q,c.events.length-q,P.resolve(c.events.slice(q),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function R(){const P=g(),q=c.previous,V=c.currentConstruct,H=c.events.length,G=Array.from(l);return{from:H,restore:O};function O(){r=P,c.previous=q,c.currentConstruct=V,c.events.length=H,l=G,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function KE(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function QE(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
53
- `;break}case-3:{s=`\r
54
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function YE(e){const r={constructs:sy([qE,...(e||{}).extensions||[]]),content:i(dC),defined:[],document:i(hC),flow:i(AE),lazy:{},string:i(DE),text:i(LE)};return r;function i(o){return s;function s(l){return GE(r,o,l)}}}function XE(e){for(;!dy(e););return e}const dh=/[\0\t\n\r]/g;function JE(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const u=[];let c,f,d,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(dh.lastIndex=d,c=dh.exec(o),h=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(h),!c){t=o.slice(d);break}if(p===10&&d===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),d<h&&(u.push(o.slice(d,h)),e+=h-d),p){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ZE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eb(e){return e.replace(ZE,tb)}function tb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return ly(n.slice(o?2:1),o?16:10)}return Vc(n)||e}const yy={}.hasOwnProperty;function nb(e,t,n){return typeof t!="string"&&(n=t,t=void 0),rb(n)(XE(YE(n).document().write(JE()(e,t,!0))))}function rb(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(gt),autolinkProtocol:R,autolinkEmail:R,atxHeading:o(vo),blockQuote:o(yn),characterEscape:R,characterReference:R,codeFenced:o(Vn),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Vn,s),codeText:o(hl,s),codeTextData:R,data:R,codeFlowValue:R,definition:o(pl),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ml),hardBreakEscape:o(I),hardBreakTrailing:o(I),htmlFlow:o($,s),htmlFlowData:R,htmlText:o($,s),htmlTextData:R,image:o(Te),label:s,link:o(gt),listItem:o(tx),listItemValue:h,listOrdered:o(Ut,d),listUnordered:o(Ut),paragraph:o(nx),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(vo),strong:o(rx),thematicBreak:o(ox)},exit:{atxHeading:u(),atxHeadingSequence:j,autolink:u(),autolinkEmail:gn,autolinkProtocol:Bt,blockQuote:u(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:nt,characterReferenceMarkerNumeric:nt,characterReferenceValue:ue,characterReference:mt,codeFenced:u(S),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:b,codeIndented:u(y),codeText:u(G),codeTextData:b,data:b,definition:u(),definitionDestinationString:T,definitionLabelString:m,definitionTitleString:x,emphasis:u(),hardBreakEscape:u(q),hardBreakTrailing:u(q),htmlFlow:u(V),htmlFlowData:b,htmlText:u(H),htmlTextData:b,image:u(L),label:B,labelText:C,lineEnding:P,link:u(O),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Se,resourceDestinationString:w,resourceTitleString:J,resource:se,setextHeading:u(D),setextHeadingLineSequence:_,setextHeadingText:E,strong:u(),thematicBreak:u()}};xy(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(A){let W={type:"root",children:[]};const Y={stack:[W],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:f,data:n},te=[];let ce=-1;for(;++ce<A.length;)if(A[ce][1].type==="listOrdered"||A[ce][1].type==="listUnordered")if(A[ce][0]==="enter")te.push(ce);else{const Nt=te.pop();ce=i(A,Nt,ce)}for(ce=-1;++ce<A.length;){const Nt=t[A[ce][0]];yy.call(Nt,A[ce][1].type)&&Nt[A[ce][1].type].call(Object.assign({sliceSerialize:A[ce][2].sliceSerialize},Y),A[ce][1])}if(Y.tokenStack.length>0){const Nt=Y.tokenStack[Y.tokenStack.length-1];(Nt[1]||fh).call(Y,void 0,Nt[0])}for(W.position={start:kn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:kn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)W=t.transforms[ce](W)||W;return W}function i(A,W,Y){let te=W-1,ce=-1,Nt=!1,qn,en,ii,oi;for(;++te<=Y;){const rt=A[te];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?ce++:ce--,oi=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(qn&&!oi&&!ce&&!ii&&(ii=te),oi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:oi=void 0}if(!ce&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||ce===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(qn){let gr=te;for(en=void 0;gr--;){const tn=A[gr];if(tn[1].type==="lineEnding"||tn[1].type==="lineEndingBlank"){if(tn[0]==="exit")continue;en&&(A[en][1].type="lineEndingBlank",Nt=!0),tn[1].type="lineEnding",en=gr}else if(!(tn[1].type==="linePrefix"||tn[1].type==="blockQuotePrefix"||tn[1].type==="blockQuotePrefixWhitespace"||tn[1].type==="blockQuoteMarker"||tn[1].type==="listItemIndent"))break}ii&&(!en||ii<en)&&(qn._spread=!0),qn.end=Object.assign({},en?A[en][1].start:rt[1].end),A.splice(en||te,0,["exit",qn,rt[2]]),te++,Y++}if(rt[1].type==="listItemPrefix"){const gr={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};qn=gr,A.splice(te,0,["enter",gr,rt[2]]),te++,Y++,ii=void 0,oi=!0}}}return A[W][1]._spread=Nt,Y}function o(A,W){return Y;function Y(te){l.call(this,A(te),te),W&&W.call(this,te)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(A,W,Y){this.stack[this.stack.length-1].children.push(A),this.stack.push(A),this.tokenStack.push([W,Y||void 0]),A.position={start:kn(W.start),end:void 0}}function u(A){return W;function W(Y){A&&A.call(this,Y),c.call(this,Y)}}function c(A,W){const Y=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==A.type&&(W?W.call(this,A,te[0]):(te[1]||fh).call(this,A,te[0]));else throw new Error("Cannot close `"+A.type+"` ("+Li({start:A.start,end:A.end})+"): it’s not open");Y.position.end=kn(A.end)}function f(){return Wc(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(A){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(A),10),this.data.expectingFirstListItemValue=void 0}}function p(){const A=this.resume(),W=this.stack[this.stack.length-1];W.lang=A}function g(){const A=this.resume(),W=this.stack[this.stack.length-1];W.meta=A}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const A=this.resume(),W=this.stack[this.stack.length-1];W.value=A.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const A=this.resume(),W=this.stack[this.stack.length-1];W.value=A.replace(/(\r?\n|\r)$/g,"")}function m(A){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.label=W,Y.identifier=zt(this.sliceSerialize(A)).toLowerCase()}function x(){const A=this.resume(),W=this.stack[this.stack.length-1];W.title=A}function T(){const A=this.resume(),W=this.stack[this.stack.length-1];W.url=A}function j(A){const W=this.stack[this.stack.length-1];if(!W.depth){const Y=this.sliceSerialize(A).length;W.depth=Y}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function _(A){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(A).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function R(A){const Y=this.stack[this.stack.length-1].children;let te=Y[Y.length-1];(!te||te.type!=="text")&&(te=ix(),te.position={start:kn(A.start),end:void 0},Y.push(te)),this.stack.push(te)}function b(A){const W=this.stack.pop();W.value+=this.sliceSerialize(A),W.position.end=kn(A.end)}function P(A){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Y=W.children[W.children.length-1];Y.position.end=kn(A.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(W.type)&&(R.call(this,A),b.call(this,A))}function q(){this.data.atHardBreak=!0}function V(){const A=this.resume(),W=this.stack[this.stack.length-1];W.value=A}function H(){const A=this.resume(),W=this.stack[this.stack.length-1];W.value=A}function G(){const A=this.resume(),W=this.stack[this.stack.length-1];W.value=A}function O(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=W,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function L(){const A=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";A.type+="Reference",A.referenceType=W,delete A.url,delete A.title}else delete A.identifier,delete A.label;this.data.referenceType=void 0}function C(A){const W=this.sliceSerialize(A),Y=this.stack[this.stack.length-2];Y.label=eb(W),Y.identifier=zt(W).toLowerCase()}function B(){const A=this.stack[this.stack.length-1],W=this.resume(),Y=this.stack[this.stack.length-1];if(this.data.inReference=!0,Y.type==="link"){const te=A.children;Y.children=te}else Y.alt=W}function w(){const A=this.resume(),W=this.stack[this.stack.length-1];W.url=A}function J(){const A=this.resume(),W=this.stack[this.stack.length-1];W.title=A}function se(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Se(A){const W=this.resume(),Y=this.stack[this.stack.length-1];Y.label=W,Y.identifier=zt(this.sliceSerialize(A)).toLowerCase(),this.data.referenceType="full"}function nt(A){this.data.characterReferenceType=A.type}function ue(A){const W=this.sliceSerialize(A),Y=this.data.characterReferenceType;let te;Y?(te=ly(W,Y==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Vc(W);const ce=this.stack[this.stack.length-1];ce.value+=te}function mt(A){const W=this.stack.pop();W.position.end=kn(A.end)}function Bt(A){b.call(this,A);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(A)}function gn(A){b.call(this,A);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(A)}function yn(){return{type:"blockquote",children:[]}}function Vn(){return{type:"code",lang:null,meta:null,value:""}}function hl(){return{type:"inlineCode",value:""}}function pl(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ml(){return{type:"emphasis",children:[]}}function vo(){return{type:"heading",depth:0,children:[]}}function I(){return{type:"break"}}function $(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function gt(){return{type:"link",title:null,url:"",children:[]}}function Ut(A){return{type:"list",ordered:A.type==="listOrdered",start:null,spread:A._spread,children:[]}}function tx(A){return{type:"listItem",spread:A._spread,checked:null,children:[]}}function nx(){return{type:"paragraph",children:[]}}function rx(){return{type:"strong",children:[]}}function ix(){return{type:"text",value:""}}function ox(){return{type:"thematicBreak"}}}function kn(e){return{line:e.line,column:e.column,offset:e.offset}}function xy(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xy(e,r):ib(e,r)}}function ib(e,t){let n;for(n in t)if(yy.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function fh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Li({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Li({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Li({start:t.start,end:t.end})+") is still open")}function ob(e){const t=this;t.parser=n;function n(r){return nb(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function sb(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lb(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
55
- `}]}function ab(e,t){const n=t.value?t.value+`
56
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function ub(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function db(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ri(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function fb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function vy(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function pb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vy(e,t);const i={src:ri(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function mb(e,t){const n={src:ri(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function gb(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function yb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vy(e,t);const i={href:ri(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function xb(e,t){const n={href:ri(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vb(e,t,n){const r=e.all(t),i=n?kb(n):ky(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(i||l!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
57
- `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
58
- `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function kb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ky(n[r])}return t}function ky(e){const t=e.spread;return t??e.children.length>1}function wb(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function Sb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Eb(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bb(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Bc(t.children[1]),u=Zg(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Nb(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const d=t.children[u],h={},p=s?s[u]:void 0;p&&(h.align=p);let g={type:"element",tagName:o,properties:h,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),c.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function Tb(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const hh=9,ph=32;function jb(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(mh(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(mh(t.slice(i),i>0,!1)),o.join("")}function mh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===hh||o===ph;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===hh||o===ph;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _b(e,t){const n={type:"text",value:jb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ib(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ab={blockquote:sb,break:lb,code:ab,delete:ub,emphasis:cb,footnoteReference:db,heading:fb,html:hb,imageReference:pb,image:mb,inlineCode:gb,linkReference:yb,link:xb,listItem:vb,list:wb,paragraph:Sb,root:Cb,strong:Eb,table:bb,tableCell:Tb,tableRow:Nb,text:_b,thematicBreak:Ib,toml:$o,yaml:$o,definition:$o,footnoteDefinition:$o};function $o(){}const wy=-1,cl=0,Fi=1,zs=2,Gc=3,Kc=4,Qc=5,Yc=6,Sy=7,Cy=8,gh=typeof self=="object"?self:globalThis,Rb=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case cl:case wy:return n(s,i);case Fi:{const l=n([],i);for(const u of s)l.push(r(u));return l}case zs:{const l=n({},i);for(const[u,c]of s)l[r(u)]=r(c);return l}case Gc:return n(new Date(s),i);case Kc:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case Qc:{const l=n(new Map,i);for(const[u,c]of s)l.set(r(u),r(c));return l}case Yc:{const l=n(new Set,i);for(const u of s)l.add(r(u));return l}case Sy:{const{name:l,message:u}=s;return n(new gh[l](u),i)}case Cy:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new gh[o](s),i)};return r},yh=e=>Rb(new Map,e)(0),vr="",{toString:Pb}={},{keys:Db}=Object,xi=e=>{const t=typeof e;if(t!=="object"||!e)return[cl,t];const n=Pb.call(e).slice(8,-1);switch(n){case"Array":return[Fi,vr];case"Object":return[zs,vr];case"Date":return[Gc,vr];case"RegExp":return[Kc,vr];case"Map":return[Qc,vr];case"Set":return[Yc,vr];case"DataView":return[Fi,n]}return n.includes("Array")?[Fi,n]:n.includes("Error")?[Sy,n]:[zs,n]},Ho=([e,t])=>e===cl&&(t==="function"||t==="symbol"),Lb=(e,t,n,r)=>{const i=(s,l)=>{const u=r.push(s)-1;return n.set(l,u),u},o=s=>{if(n.has(s))return n.get(s);let[l,u]=xi(s);switch(l){case cl:{let f=s;switch(u){case"bigint":l=Cy,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([wy],s)}return i([l,f],s)}case Fi:{if(u){let h=s;return u==="DataView"?h=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(s)),i([u,[...h]],s)}const f=[],d=i([l,f],s);for(const h of s)f.push(o(h));return d}case zs:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],d=i([l,f],s);for(const h of Db(s))(e||!Ho(xi(s[h])))&&f.push([o(h),o(s[h])]);return d}case Gc:return i([l,s.toISOString()],s);case Kc:{const{source:f,flags:d}=s;return i([l,{source:f,flags:d}],s)}case Qc:{const f=[],d=i([l,f],s);for(const[h,p]of s)(e||!(Ho(xi(h))||Ho(xi(p))))&&f.push([o(h),o(p)]);return d}case Yc:{const f=[],d=i([l,f],s);for(const h of s)(e||!Ho(xi(h)))&&f.push(o(h));return d}}const{message:c}=s;return i([l,{name:u,message:c}],s)};return o},xh=(e,{json:t,lossy:n}={})=>{const r=[];return Lb(!(t||n),!!t,new Map,r)(e),r},Ms=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yh(xh(e,t)):structuredClone(e):(e,t)=>yh(xh(e,t));function Ob(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Fb(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function zb(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ob,r=e.options.footnoteBackLabel||Fb,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const f=e.all(c),d=String(c.identifier).toUpperCase(),h=ri(d.toLowerCase());let p=0;const g=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++p<=v;){g.length>0&&g.push({type:"text",value:" "});let m=typeof n=="string"?n:n(u,p);typeof m=="string"&&(m={type:"text",value:m}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const m=S.children[S.children.length-1];m&&m.type==="text"?m.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...g)}else f.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ms(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
59
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
60
- `}]}}const dl=function(e){if(e==null)return $b;if(typeof e=="function")return fl(e);if(typeof e=="object")return Array.isArray(e)?Mb(e):Bb(e);if(typeof e=="string")return Ub(e);throw new Error("Expected function, string, or object as test")};function Mb(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=dl(e[n]);return fl(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Bb(e){const t=e;return fl(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Ub(e){return fl(t);function t(n){return n&&n.type===e}}function fl(e){return t;function t(n,r,i){return!!(Hb(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $b(){return!0}function Hb(e){return e!==null&&typeof e=="object"&&"type"in e}const Ey=[],Wb=!0,wu=!1,Vb="skip";function by(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=dl(i),s=r?-1:1;l(e,void 0,[])();function l(u,c,f){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Ey,g,v,S;if((!t||o(u,c,f[f.length-1]||void 0))&&(p=qb(n(u,f)),p[0]===wu))return p;if("children"in u&&u.children){const y=u;if(y.children&&p[0]!==Vb)for(v=(r?y.children.length:-1)+s,S=f.concat(y);v>-1&&v<y.children.length;){const m=y.children[v];if(g=l(m,v,S)(),g[0]===wu)return g;v=typeof g[1]=="number"?g[1]:v+s}}return p}}}function qb(e){return Array.isArray(e)?e:typeof e=="number"?[Wb,e]:e==null?Ey:[e]}function Xc(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),by(e,o,l,i);function l(u,c){const f=c[c.length-1],d=f?f.children.indexOf(u):void 0;return s(u,d,f)}}const Su={}.hasOwnProperty,Gb={};function Kb(e,t){const n=t||Gb,r=new Map,i=new Map,o=new Map,s={...Ab,...n.handlers},l={all:c,applyData:Yb,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:Qb,wrap:Jb};return Xc(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();d.has(h)||d.set(h,f)}}),l;function u(f,d){const h=f.type,p=l.handlers[h];if(Su.call(l.handlers,h)&&p)return p(l,f,d);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in f){const{children:v,...S}=f,y=Ms(S);return y.children=l.all(f),y}return Ms(f)}return(l.options.unknownHandler||Xb)(l,f,d)}function c(f){const d=[];if("children"in f){const h=f.children;let p=-1;for(;++p<h.length;){const g=l.one(h[p],f);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=vh(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=vh(v.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function Qb(e,t){e.position&&(t.position=FS(e))}function Yb(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Ms(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Xb(e,t){const n=t.data||{},r="value"in t&&!(Su.call(n,"hProperties")||Su.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jb(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
61
- `});++r<e.length;)r&&n.push({type:"text",value:`
62
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
63
- `}),n}function vh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kh(e,t){const n=Kb(e,t),r=n.one(e,void 0),i=zb(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
64
- `},i),o}function Zb(e,t){return e&&"run"in e?async function(n,r){const i=kh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kh(n,{file:r,...e||t})}}function wh(e){if(e)throw e}var cs=Object.prototype.hasOwnProperty,Ny=Object.prototype.toString,Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Eh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ny.call(t)==="[object Array]"},bh=function(t){if(!t||Ny.call(t)!=="[object Object]")return!1;var n=cs.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cs.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||cs.call(t,i)},Nh=function(t,n){Sh&&n.name==="__proto__"?Sh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Th=function(t,n){if(n==="__proto__")if(cs.call(t,n)){if(Ch)return Ch(t,n).value}else return;return t[n]},eN=function e(){var t,n,r,i,o,s,l=arguments[0],u=1,c=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=Th(l,n),i=Th(t,n),l!==i&&(f&&i&&(bh(i)||(o=Eh(i)))?(o?(o=!1,s=r&&Eh(r)?r:[]):s=r&&bh(r)?r:{},Nh(l,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&Nh(l,{name:n,newValue:i}));return l};const ea=Hh(eN);function Cu(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 tN(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(u,...c){const f=e[++o];let d=-1;if(u){s(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,f?nN(f,l)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function nN(e,t){let n;return r;function r(...s){const l=e.length>s.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(c){const f=c;if(l&&n)throw f;return i(f)}l||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const Vt={basename:rN,dirname:iN,extname:oN,join:sN,sep:"/"};function rN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function iN(e){if(xo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function oN(e){xo(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function sN(...e){let t=-1,n;for(;++t<e.length;)xo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lN(n)}function lN(e){xo(e);const t=e.codePointAt(0)===47;let n=aN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function aN(e,t){let n="",r=0,i=-1,o=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function xo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uN={cwd:cN};function cN(){return"/"}function Eu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dN(e){if(typeof e=="string")e=new URL(e);else if(!Eu(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 fN(e)}function fN(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ta=["history","path","basename","stem","extname","dirname"];class Ty{constructor(t){let n;t?Eu(t)?n={path:t}:typeof t=="string"||hN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ta.length;){const o=ta[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ta.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Vt.basename(this.path):void 0}set basename(t){ra(t,"basename"),na(t,"basename"),this.path=Vt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vt.dirname(this.path):void 0}set dirname(t){jh(this.basename,"dirname"),this.path=Vt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vt.extname(this.path):void 0}set extname(t){if(na(t,"extname"),jh(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=Vt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Eu(t)&&(t=dN(t)),ra(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vt.basename(this.path,this.extname):void 0}set stem(t){ra(t,"stem"),na(t,"stem"),this.path=Vt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new $e(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function na(e,t){if(e&&e.includes(Vt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vt.sep+"`")}function ra(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pN=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},mN={}.hasOwnProperty;class Jc extends pN{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=tN()}copy(){const t=new Jc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ea(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(sa("data",this.frozen),this.namespace[t]=n,this):mN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(sa("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[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Wo(t),r=this.parser||this.Parser;return ia("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ia("process",this.parser||this.Parser),oa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const l=Wo(t),u=r.parse(l);r.run(u,l,function(f,d,h){if(f||!d||!h)return c(f);const p=d,g=r.stringify(p,h);xN(g)?h.value=g:h.result=g,c(f,h)});function c(f,d){f||!d?s(f):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ia("processSync",this.parser||this.Parser),oa("processSync",this.compiler||this.Compiler),this.process(t,i),Ih("processSync","process",n),r;function i(o,s){n=!0,wh(o),r=s}}run(t,n,r){_h(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,l){const u=Wo(n);i.run(t,u,c);function c(f,d,h){const p=d||t;f?l(f):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Ih("runSync","run",r),i;function o(s,l){wh(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Wo(n),i=this.compiler||this.Compiler;return oa("stringify",i),_h(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(sa("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...d]=c;u(f,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))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");l(c.plugins),c.settings&&(i.settings=ea(!0,i.settings,c.settings))}function l(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const d=c[f];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,f){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...f]);else if(f.length>0){let[p,...g]=f;const v=r[h][1];Cu(v)&&Cu(p)&&(p=ea(!0,v,p)),r[h]=[c,p,...g]}}}}const gN=new Jc().freeze();function ia(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function oa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sa(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 _h(e){if(!Cu(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ih(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wo(e){return yN(e)?e:new Ty(e)}function yN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xN(e){return typeof e=="string"||vN(e)}function vN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ah=[],Rh={allowDangerousHtml:!0},wN=/^(https?|ircs?|mailto|xmpp)$/i,SN=[{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:"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 CN(e){const t=EN(e),n=bN(e);return NN(t.runSync(t.parse(n),n),e)}function EN(e){const t=e.rehypePlugins||Ah,n=e.remarkPlugins||Ah,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rh}:Rh;return gN().use(ob).use(n).use(Zb,r).use(t)}function bN(e){const t=e.children||"",n=new Ty;return typeof t=="string"&&(n.value=t),n}function NN(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||TN;for(const f of SN)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+kN+f.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Xc(e,c),$S(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(f,d,h){if(f.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Xl)if(Object.hasOwn(Xl,p)&&Object.hasOwn(f.properties,p)){const g=f.properties[p],v=Xl[p];(v===null||v.includes(f.tagName))&&(f.properties[p]=u(String(g||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,h)),p&&h&&typeof d=="number")return l&&f.children?h.children.splice(d,1,...f.children):h.children.splice(d,1),d}}}function TN(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||wN.test(e.slice(0,t))?e:""}function Ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jN(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jy(e,t,n){const i=dl((n||{}).ignore||[]),o=_N(t);let s=-1;for(;++s<o.length;)by(e,"text",l);function l(c,f){let d=-1,h;for(;++d<f.length;){const p=f[d],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return u(c,f)}function u(c,f){const d=f[f.length-1],h=o[s][0],p=o[s][1];let g=0;const S=d.children.indexOf(c);let y=!1,m=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const T=x.index,j={index:x.index,input:x.input,stack:[...f,c]};let E=p(...x,j);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=T+1:(g!==T&&m.push({type:"text",value:c.value.slice(g,T)}),Array.isArray(E)?m.push(...E):E&&m.push(E),g=T+x[0].length,y=!0),!h.global)break;x=h.exec(c.value)}return y?(g<c.value.length&&m.push({type:"text",value:c.value.slice(g)}),d.children.splice(S,1,...m)):m=[c],S+m.length}}function _N(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([IN(i[0]),AN(i[1])])}return t}function IN(e){return typeof e=="string"?new RegExp(jN(e),"g"):e}function AN(e){return typeof e=="function"?e:function(){return e}}const la="phrasing",aa=["autolink","link","image","label"];function RN(){return{transforms:[MN],enter:{literalAutolink:DN,literalAutolinkEmail:ua,literalAutolinkHttp:ua,literalAutolinkWww:ua},exit:{literalAutolink:zN,literalAutolinkEmail:FN,literalAutolinkHttp:LN,literalAutolinkWww:ON}}}function PN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:la,notInConstruct:aa},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:la,notInConstruct:aa},{character:":",before:"[ps]",after:"\\/",inConstruct:la,notInConstruct:aa}]}}function DN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ua(e){this.config.enter.autolinkProtocol.call(this,e)}function LN(e){this.config.exit.autolinkProtocol.call(this,e)}function ON(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 FN(e){this.config.exit.autolinkEmail.call(this,e)}function zN(e){this.exit(e)}function MN(e){jy(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),UN]],{ignore:["link","linkReference"]})}function BN(e,t,n,r,i){let o="";if(!_y(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!$N(n)))return!1;const s=HN(n+r);if(!s[0])return!1;const l={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[l,{type:"text",value:s[1]}]:l}function UN(e,t,n,r){return!_y(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function $N(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 HN(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ph(e,"(");let o=Ph(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _y(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ur(n)||al(n))&&(!t||n!==47)}Iy.peek=JN;function WN(){this.buffer()}function VN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function qN(){this.buffer()}function GN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function KN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QN(e){this.exit(e)}function YN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XN(e){this.exit(e)}function JN(){return"["}function Iy(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),l=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),l(),s(),o+=i.move("]"),o}function ZN(){return{enter:{gfmFootnoteCallString:WN,gfmFootnoteCall:VN,gfmFootnoteDefinitionLabelString:qN,gfmFootnoteDefinition:GN},exit:{gfmFootnoteCallString:KN,gfmFootnoteCall:QN,gfmFootnoteDefinitionLabelString:YN,gfmFootnoteDefinition:XN}}}function eT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Iy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const l=o.createTracker(s);let u=l.move("[^");const c=o.enter("footnoteDefinition"),f=o.enter("label");return u+=l.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?`
65
- `:" ")+o.indentLines(o.containerFlow(r,l.current()),t?Ay:tT))),c(),u}}function tT(e,t,n){return t===0?e:Ay(e,t,n)}function Ay(e,t,n){return(n?"":" ")+e}const nT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ry.peek=lT;function rT(){return{canContainEols:["delete"],enter:{strikethrough:oT},exit:{strikethrough:sT}}}function iT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nT}],handlers:{delete:Ry}}}function oT(e){this.enter({type:"delete",children:[]},e)}function sT(e){this.exit(e)}function Ry(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function lT(){return"~"}function aT(e){return e.length}function uT(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||aT,o=[],s=[],l=[],u=[];let c=0,f=-1;for(;++f<e.length;){const v=[],S=[];let y=-1;for(e[f].length>c&&(c=e[f].length);++y<e[f].length;){const m=cT(e[f][y]);if(n.alignDelimiters!==!1){const x=i(m);S[y]=x,(u[y]===void 0||x>u[y])&&(u[y]=x)}v.push(m)}s[f]=v,l[f]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=Dh(r[d]);else{const v=Dh(r);for(;++d<c;)o[d]=v}d=-1;const h=[],p=[];for(;++d<c;){const v=o[d];let S="",y="";v===99?(S=":",y=":"):v===108?S=":":v===114&&(y=":");let m=n.alignDelimiters===!1?1:Math.max(1,u[d]-S.length-y.length);const x=S+"-".repeat(m)+y;n.alignDelimiters!==!1&&(m=S.length+m+y.length,m>u[d]&&(u[d]=m),p[d]=m),h[d]=x}s.splice(1,0,h),l.splice(1,0,p),f=-1;const g=[];for(;++f<s.length;){const v=s[f],S=l[f];d=-1;const y=[];for(;++d<c;){const m=v[d]||"";let x="",T="";if(n.alignDelimiters!==!1){const j=u[d]-(S[d]||0),E=o[d];E===114?x=" ".repeat(j):E===99?j%2?(x=" ".repeat(j/2+.5),T=" ".repeat(j/2-.5)):(x=" ".repeat(j/2),T=x):T=" ".repeat(j)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&m==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(m),n.alignDelimiters!==!1&&y.push(T),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
66
- `)}function cT(e){return e==null?"":String(e)}function Dh(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 dT(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),fT);return i(),s}function fT(e,t,n){return">"+(n?"":" ")+e}function hT(e,t){return Lh(e,t.inConstruct,!0)&&!Lh(e,t.notInConstruct,!1)}function Lh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Oh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
67
- `&&hT(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
68
- `}function pT(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function mT(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 gT(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 yT(e,t,n,r){const i=gT(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(mT(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,xT);return d(),h}const l=n.createTracker(r),u=i.repeat(Math.max(pT(o,i)+1,3)),c=n.enter("codeFenced");let f=l.move(u);if(e.lang){const d=n.enter(`codeFencedLang${s}`);f+=l.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${s}`);f+=l.move(" "),f+=l.move(n.safe(e.meta,{before:f,after:`
69
- `,encode:["`"],...l.current()})),d()}return f+=l.move(`
70
- `),o&&(f+=l.move(o+`
71
- `)),f+=l.move(u),c(),f}function xT(e,t,n){return(n?"":" ")+e}function Zc(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 vT(e,t,n,r){const i=Zc(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
72
- `,...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),s(),c}function kT(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 oo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Bs(e,t,n){const r=Kr(e),i=Kr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Py.peek=wT;function Py(e,t,n,r){const i=kT(n),o=n.enter("emphasis"),s=n.createTracker(r),l=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const c=u.charCodeAt(0),f=Bs(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=oo(c)+u.slice(1));const d=u.charCodeAt(u.length-1),h=Bs(r.after.charCodeAt(0),d,i);h.inside&&(u=u.slice(0,-1)+oo(d));const p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+u+p}function wT(e,t,n){return n.options.emphasis||"*"}function ST(e,t){let n=!1;return Xc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wu}),!!((!e.depth||e.depth<3)&&Wc(e)&&(t.options.setext||n))}function CT(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(ST(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
73
- `,after:`
74
- `});return d(),f(),h+`
75
- `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
76
- `))+1))}const s="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
77
- `,...o.current()});return/^[\t ]/.test(c)&&(c=oo(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),l(),c}Dy.peek=ET;function Dy(e){return e.value||""}function ET(){return"<"}Ly.peek=bT;function Ly(e,t,n,r){const i=Zc(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),c+=u.move(")"),s(),c}function bT(){return"!"}Oy.peek=NT;function Oy(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const c=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==d?u+=l.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function NT(){return"!"}Fy.peek=TT;function Fy(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],l=n.compilePattern(s);let u;if(s.atBreak)for(;u=l.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function TT(){return"`"}function zy(e,t){const n=Wc(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}My.peek=jT;function My(e,t,n,r){const i=Zc(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let l,u;if(zy(e,n)){const f=n.stack;n.stack=[],l=n.enter("autolink");let d=s.move("<");return d+=s.move(n.containerPhrasing(e,{before:d,after:">",...s.current()})),d+=s.move(">"),l(),n.stack=f,d}l=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),u()),c+=s.move(")"),l(),c}function jT(e,t,n){return zy(e,n)?"<":"["}By.peek=_T;function By(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==d?u+=l.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function _T(){return"["}function ed(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 IT(e){const t=ed(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function AT(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 Uy(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 RT(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?AT(n):ed(n);const l=e.ordered?s==="."?")":".":IT(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Uy(n)===s&&f){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=l),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function PT(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 DT(e,t,n,r){const i=PT(n);let o=n.bulletCurrent||ed(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const l=n.createTracker(r);l.move(o+" ".repeat(s-o.length)),l.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),f);return u(),c;function f(d,h,p){return h?(p?"":" ".repeat(s))+d:(p?o:o+" ".repeat(s-o.length))+d}}function LT(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const OT=dl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FT(e,t,n,r){return(e.children.some(function(s){return OT(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function zT(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$y.peek=MT;function $y(e,t,n,r){const i=zT(n),o=n.enter("strong"),s=n.createTracker(r),l=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:l,...s.current()}));const c=u.charCodeAt(0),f=Bs(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=oo(c)+u.slice(1));const d=u.charCodeAt(u.length-1),h=Bs(r.after.charCodeAt(0),d,i);h.inside&&(u=u.slice(0,-1)+oo(d));const p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},l+u+p}function MT(e,t,n){return n.options.strong||"*"}function BT(e,t,n,r){return n.safe(e.value,r)}function UT(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 $T(e,t,n){const r=(Uy(n)+(n.options.ruleSpaces?" ":"")).repeat(UT(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hy={blockquote:dT,break:Oh,code:yT,definition:vT,emphasis:Py,hardBreak:Oh,heading:CT,html:Dy,image:Ly,imageReference:Oy,inlineCode:Fy,link:My,linkReference:By,list:RT,listItem:DT,paragraph:LT,root:FT,strong:$y,text:BT,thematicBreak:$T};function HT(){return{enter:{table:WT,tableData:Fh,tableHeader:Fh,tableRow:qT},exit:{codeText:GT,table:VT,tableData:ca,tableHeader:ca,tableRow:ca}}}function WT(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function VT(e){this.exit(e),this.data.inTable=void 0}function qT(e){this.enter({type:"tableRow",children:[]},e)}function ca(e){this.exit(e)}function Fh(e){this.enter({type:"tableCell",children:[]},e)}function GT(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,KT));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function KT(e,t){return t==="|"?t:e}function QT(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
78
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:u,tableRow:l}};function s(p,g,v,S){return c(f(p,v,S),p.align)}function l(p,g,v,S){const y=d(p,v,S),m=c([y]);return m.slice(0,m.indexOf(`
79
- `))}function u(p,g,v,S){const y=v.enter("tableCell"),m=v.enter("phrasing"),x=v.containerPhrasing(p,{...S,before:o,after:o});return m(),y(),x}function c(p,g){return uT(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(p,g,v){const S=p.children;let y=-1;const m=[],x=g.enter("table");for(;++y<S.length;)m[y]=d(S[y],g,v);return x(),m}function d(p,g,v){const S=p.children;let y=-1;const m=[],x=g.enter("tableRow");for(;++y<S.length;)m[y]=u(S[y],p,g,v);return x(),m}function h(p,g,v){let S=Hy.inlineCode(p,g,v);return v.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function YT(){return{exit:{taskListCheckValueChecked:zh,taskListCheckValueUnchecked:zh,paragraph:JT}}}function XT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZT}}}function zh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function JT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const l=i[o];if(l.type==="paragraph"){s=l;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ZT(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);o&&l.move(s);let u=Hy.listItem(e,t,n,{...r,...l.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function ej(){return[RN(),ZN(),rT(),HT(),YT()]}function tj(e){return{extensions:[PN(),eT(e),iT(),QT(e),XT()]}}const nj={tokenize:aj,partial:!0},Wy={tokenize:uj,partial:!0},Vy={tokenize:cj,partial:!0},qy={tokenize:dj,partial:!0},rj={tokenize:fj,partial:!0},Gy={name:"wwwAutolink",tokenize:sj,previous:Qy},Ky={name:"protocolAutolink",tokenize:lj,previous:Yy},mn={name:"emailAutolink",tokenize:oj,previous:Xy},Zt={};function ij(){return{text:Zt}}let Gn=48;for(;Gn<123;)Zt[Gn]=mn,Gn++,Gn===58?Gn=65:Gn===91&&(Gn=97);Zt[43]=mn;Zt[45]=mn;Zt[46]=mn;Zt[95]=mn;Zt[72]=[mn,Ky];Zt[104]=[mn,Ky];Zt[87]=[mn,Gy];Zt[119]=[mn,Gy];function oj(e,t,n){const r=this;let i,o;return s;function s(d){return!bu(d)||!Xy.call(r,r.previous)||td(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return bu(d)?(e.consume(d),l):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(rj,f,c)(d):d===45||d===95||Be(d)?(o=!0,e.consume(d),u):f(d)}function c(d){return e.consume(d),i=!0,u}function f(d){return o&&i&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function sj(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Qy.call(r,r.previous)||td(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nj,e.attempt(Wy,e.attempt(Vy,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function lj(e,t,n){const r=this;let i="",o=!1;return s;function s(d){return(d===72||d===104)&&Yy.call(r,r.previous)&&!td(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(We(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),o?c:(o=!0,u)):n(d)}function c(d){return d===null||Fs(d)||de(d)||ur(d)||al(d)?n(d):e.attempt(Wy,e.attempt(Vy,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function aj(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function uj(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(qy,u,l)(c):c===null||de(c)||ur(c)||c!==45&&al(c)?u(c):(o=!0,e.consume(c),s)}function l(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function cj(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(qy,t,o)(s):s===null||de(s)||ur(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function dj(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),o):l===93?(e.consume(l),i):l===60||l===null||de(l)||ur(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||de(l)||ur(l)?t(l):r(l)}function o(l){return We(l)?s(l):n(l)}function s(l){return l===59?(e.consume(l),r):We(l)?(e.consume(l),s):n(l)}}function fj(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Be(o)?n(o):t(o)}}function Qy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||de(e)}function Yy(e){return!We(e)}function Xy(e){return!(e===47||bu(e))}function bu(e){return e===43||e===45||e===46||e===95||Be(e)}function td(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const hj={tokenize:wj,partial:!0};function pj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xj,continuation:{tokenize:vj},exit:kj}},text:{91:{name:"gfmFootnoteCall",tokenize:yj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mj,resolveTo:gj}}}}function mj(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!s||!s._balanced)return n(u);const c=zt(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function gj(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function yj(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!s||d===null||d===91||de(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(zt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return de(d)||(s=!0),o++,e.consume(d),d===92?f:c}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function xj(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,l;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(s>999||g===93&&!l||g===null||g===91||de(g))return n(g);if(g===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=zt(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return de(g)||(l=!0),s++,e.consume(g),g===92?d:f}function d(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),ie(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function vj(e,t,n){return e.check(yo,t,e.attempt(hj,t,n))}function kj(e){e.exit("gfmFootnoteDefinition")}function wj(e,t,n){const r=this;return ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function Sj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,l){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},d={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},h=[["enter",f,l],["enter",s[c][1],l],["exit",s[c][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&at(h,h.length,0,ul(p,s.slice(c+1,u),l)),at(h,h.length,0,[["exit",d,l],["enter",s[u][1],l],["exit",s[u][1],l],["exit",f,l]]),at(s,c-1,u-c+3,h),u=c+h.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,l,u){const c=this.previous,f=this.events;let d=0;return h;function h(g){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const v=Kr(c);if(g===126)return d>1?u(g):(s.consume(g),d++,p);if(d<2&&!n)return u(g);const S=s.exit("strikethroughSequenceTemporary"),y=Kr(g);return S._open=!y||y===2&&!!v,S._close=!v||v===2&&!!y,l(g)}}}class Cj{constructor(){this.map=[]}add(t,n,r){Ej(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function Ej(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function bj(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Nj(){return{flow:{null:{name:"table",tokenize:Tj,resolveAll:jj}}}}function Tj(e,t,n){const r=this;let i=0,o=0,s;return l;function l(b){let P=r.events.length-1;for(;P>-1;){const H=r.events[P][1].type;if(H==="lineEnding"||H==="linePrefix")P--;else break}const q=P>-1?r.events[P][1].type:null,V=q==="tableHead"||q==="tableRow"?E:u;return V===E&&r.parser.lazy[r.now().line]?n(b):V(b)}function u(b){return e.enter("tableHead"),e.enter("tableRow"),c(b)}function c(b){return b===124||(s=!0,o+=1),f(b)}function f(b){return b===null?n(b):Q(b)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):n(b):Z(b)?ie(e,f,"whitespace")(b):(o+=1,s&&(s=!1,i+=1),b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),d(b)))}function d(b){return b===null||b===124||de(b)?(e.exit("data"),f(b)):(e.consume(b),b===92?h:d)}function h(b){return b===92||b===124?(e.consume(b),d):d(b)}function p(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(e.enter("tableDelimiterRow"),s=!1,Z(b)?ie(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):g(b))}function g(b){return b===45||b===58?S(b):b===124?(s=!0,e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),v):j(b)}function v(b){return Z(b)?ie(e,S,"whitespace")(b):S(b)}function S(b){return b===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),y):b===45?(o+=1,y(b)):b===null||Q(b)?T(b):j(b)}function y(b){return b===45?(e.enter("tableDelimiterFiller"),m(b)):j(b)}function m(b){return b===45?(e.consume(b),m):b===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(b),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(b))}function x(b){return Z(b)?ie(e,T,"whitespace")(b):T(b)}function T(b){return b===124?g(b):b===null||Q(b)?!s||i!==o?j(b):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(b)):j(b)}function j(b){return n(b)}function E(b){return e.enter("tableRow"),_(b)}function _(b){return b===124?(e.enter("tableCellDivider"),e.consume(b),e.exit("tableCellDivider"),_):b===null||Q(b)?(e.exit("tableRow"),t(b)):Z(b)?ie(e,_,"whitespace")(b):(e.enter("data"),D(b))}function D(b){return b===null||b===124||de(b)?(e.exit("data"),_(b)):(e.consume(b),b===92?R:D)}function R(b){return b===92||b===124?(e.consume(b),D):D(b)}}function jj(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],l=!1,u=0,c,f,d;const h=new Cj;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(l=!1,u!==0&&(Mh(h,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",f,t]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=Vo(h,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=Vo(h,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):g.type==="tableHead"?(l=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],d=Vo(h,t,o,i,n,d)):s[1]!==0&&(d=Vo(h,t,s,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Mh(h,t,u,c,f),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=bj(t.events,n))}return e}function Vo(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(o.end=Object.assign({},kr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=kr(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=kr(t.events,n[2]),f=kr(t.events,n[3]),d={type:l,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,v=n[3]-n[2]-1;e.add(g,v,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},kr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Mh(e,t,n,r,i){const o=[],s=kr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function kr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const _j={name:"tasklistCheck",tokenize:Aj};function Ij(){return{text:{91:_j}}}function Aj(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return de(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return Q(u)?t(u):Z(u)?e.check({tokenize:Rj},t,n)(u):n(u)}}function Rj(e,t,n){return ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Pj(e){return sy([ij(),pj(),Sj(e),Nj(),Ij()])}const Dj={};function Lj(e){const t=this,n=e||Dj,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Pj(n)),o.push(ej()),s.push(tj(n))}function Oj(e){jy(e,[/\r?\n|\r/g,Fj])}function Fj(){return{type:"break"}}function zj(){return function(e){Oj(e)}}function Jy({content:e}){return a.jsx("div",{className:"context-markdownXXX",children:a.jsx(CN,{remarkPlugins:[Lj,zj],children:e.replace(/\\n/g,`
80
- `)})})}function Mj({commands:e,selectedIndex:t,position:n,onSelect:r,onCancel:i}){const o=k.useRef(null);return k.useEffect(()=>{const s=l=>{o.current&&!o.current.contains(l.target)&&i()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[i]),e.length===0?null:a.jsx("div",{ref:o,className:"slash-command-menu",style:{left:`${n.x}px`,top:`${n.y}px`},role:"listbox","aria-label":"Slash commands",children:e.map((s,l)=>a.jsxs("button",{type:"button",className:`slash-command-item ${l===t?"selected":""}`,onClick:()=>r(s),role:"option","aria-selected":l===t,children:[a.jsx("div",{className:"slash-command-label",children:s.label}),a.jsx("div",{className:"slash-command-description",children:s.description})]},s.id))})}const Bj=[{id:"h1",label:"/h1",trigger:"h1",markdown:{before:"# "},description:"Heading 1"},{id:"h2",label:"/h2",trigger:"h2",markdown:{before:"## "},description:"Heading 2"},{id:"h3",label:"/h3",trigger:"h3",markdown:{before:"### "},description:"Heading 3"},{id:"h4",label:"/h4",trigger:"h4",markdown:{before:"#### "},description:"Heading 4"},{id:"h5",label:"/h5",trigger:"h5",markdown:{before:"##### "},description:"Heading 5"},{id:"h6",label:"/h6",trigger:"h6",markdown:{before:"###### "},description:"Heading 6"},{id:"bold",label:"/bold",trigger:"bold",markdown:{before:"**",after:"**"},description:"Bold text"},{id:"italic",label:"/italic",trigger:"italic",markdown:{before:"_",after:"_"},description:"Italic text"},{id:"code",label:"/code",trigger:"code",markdown:{before:"`",after:"`"},description:"Inline code"},{id:"codeblock",label:"/codeblock",trigger:"codeblock",markdown:{before:"```\n",after:"\n```"},description:"Code block"},{id:"table",label:"/table",trigger:"table",markdown:{before:`| Column 1 | Column 2 |
81
- | --- | --- |
82
- | | |`},description:"Insert table"},{id:"list",label:"/list",trigger:"list",markdown:{before:"- "},description:"Bullet list"},{id:"numbered",label:"/numbered",trigger:"numbered",markdown:{before:"1. "},description:"Numbered list"},{id:"quote",label:"/quote",trigger:"quote",markdown:{before:"> "},description:"Block quote"},{id:"divider",label:"/divider",trigger:"div",markdown:{before:`
83
- ---
84
- `},description:"Horizontal divider"},{id:"link",label:"/link",trigger:"link",markdown:{before:"[",after:"](url)"},description:"Insert link"}];function Uj(e,t){return{id:e.id,label:e.label,description:e.description,action:()=>t(e.markdown.before,e.markdown.after)}}function $j(e){return Bj.map(t=>Uj(t,e))}function Hj({value:e,onChange:t,placeholder:n,disabled:r}){const i=k.useRef(null),[o,s]=k.useState({active:!1,query:"",position:{x:0,y:0},selectedIndex:0,startPosition:0}),u=$j((g,v="")=>{if(!i.current)return;const S=i.current,y=o.startPosition,m=S.selectionEnd,x=e.substring(0,y),T=e.substring(m),j=x+g+v+T;t(j),s({...o,active:!1}),setTimeout(()=>{const E=y+g.length;S.focus(),S.setSelectionRange(E,E)},0)}),c=o.query?u.filter(g=>g.label.toLowerCase().includes(o.query.toLowerCase())):u,f=g=>{if(!o.active){if(g.key==="/"){const v=i.current;if(!v)return;const S=v.selectionStart,y=e.substring(0,S);if(S===0||y[S-1].match(/\s/)){const m=v.getBoundingClientRect(),x=24,T=y.split(`
85
- `).length;s({active:!0,query:"",position:{x:m.left+16,y:m.top+T*x+40},selectedIndex:0,startPosition:S})}}return}switch(g.key){case"Escape":g.preventDefault(),s({...o,active:!1});break;case"ArrowDown":g.preventDefault(),s({...o,selectedIndex:(o.selectedIndex+1)%c.length});break;case"ArrowUp":g.preventDefault(),s({...o,selectedIndex:o.selectedIndex===0?c.length-1:o.selectedIndex-1});break;case"Enter":case"Tab":g.preventDefault(),c[o.selectedIndex]&&c[o.selectedIndex].action();break;case"Backspace":const v=i.current;v&&v.selectionStart<=o.startPosition&&s({...o,active:!1});break}},d=g=>{const v=g.target.value;if(t(v),o.active&&i.current){const S=i.current.selectionStart,y=v.substring(o.startPosition+1,S);s({...o,query:y,selectedIndex:0})}},h=g=>{g.action()},p=()=>{s({...o,active:!1})};return a.jsx("div",{className:"rich-editor",children:a.jsxs("div",{className:"rich-editor-panes",children:[a.jsxs("div",{className:"rich-editor-pane rich-editor-edit",children:[a.jsx("div",{className:"rich-editor-label",children:"Edit"}),a.jsx("textarea",{ref:i,className:"rich-editor-textarea",value:e,onChange:d,onKeyDown:f,placeholder:n||"Write in markdown...",disabled:r,"aria-label":"Markdown editor"}),o.active&&a.jsx(Mj,{commands:c,selectedIndex:o.selectedIndex,position:o.position,onSelect:h,onCancel:p})]}),a.jsxs("div",{className:"rich-editor-pane rich-editor-preview",children:[a.jsx("div",{className:"rich-editor-label",children:"Preview"}),a.jsx("div",{className:"rich-editor-preview-content",children:e?a.jsx(Jy,{content:e}):a.jsx("div",{className:"rich-editor-empty",children:"Nothing to preview yet"})})]})]})})}function Wj(e,t){const n=new Set,r=[e];for(;r.length>0;){const i=r.shift();n.add(i),t.filter(s=>{const l=s.parentId;return typeof l=="string"&&l===i}).forEach(s=>r.push(s.id))}return n}function Zy({mode:e,page:t,pages:n,onSubmit:r,onCancel:i,isSubmitting:o,defaultParentId:s}){var x;const[l,u]=k.useState((t==null?void 0:t.title)||""),[c,f]=k.useState((t==null?void 0:t.content)||""),[d,h]=k.useState(((x=t==null?void 0:t.tags)==null?void 0:x.map(T=>T.name))||[]),[p,g]=k.useState(()=>{if(e==="create"&&s)return s;const T=t==null?void 0:t.parentId;return typeof T=="string"?T:null}),[v,S]=k.useState(""),y=k.useMemo(()=>{if(e==="create")return n;{const T=Wj(t.id,n);return n.filter(j=>!T.has(j.id))}},[e,n,t]);k.useEffect(()=>{const T=j=>{j.key==="Escape"&&i()};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[i]);const m=async T=>{var j,E;T.preventDefault();try{if(e==="create"){const _={title:l.trim(),content:c.trim(),...d.length>0&&{tagNames:d},...p&&{parentId:p}};await r(_)}else{const _={};let D=!1;l!==t.title&&(_.title=l,D=!0),c!==t.content&&(_.content=c,D=!0);const R=((j=t.tags)==null?void 0:j.map(q=>q.name))||[];JSON.stringify(d.sort())!==JSON.stringify(R.sort())&&(_.tagNames=d,D=!0);const P=typeof t.parentId=="string"?t.parentId:null;if(p!==P&&(_.parentId=p,D=!0),!D){S("No changes to save");return}await r(_)}S("")}catch(_){const D=((E=_==null?void 0:_.body)==null?void 0:E.detail)||(_==null?void 0:_.message)||`Failed to ${e==="create"?"create":"update"} page`;S(D)}};return a.jsxs("form",{className:"context-form",onSubmit:m,children:[v&&a.jsx("div",{className:"context-error",style:{margin:"0 0 16px 0"},children:v}),a.jsxs("div",{className:"context-form-group",children:[a.jsx("label",{htmlFor:`${e}-title`,children:"Title *"}),a.jsx("input",{id:`${e}-title`,type:"text",value:l,onChange:T=>u(T.target.value),placeholder:"Give your page a headline",required:!0,disabled:o})]}),a.jsxs("div",{className:"context-form-group",children:[a.jsx("label",{htmlFor:`${e}-parent`,children:"Parent Page"}),a.jsxs("select",{id:`${e}-parent`,value:p??"",onChange:T=>g(T.target.value||null),disabled:o,children:[a.jsx("option",{value:"",children:"None (top level)"}),y.map(T=>a.jsx("option",{value:T.id,children:T.title},T.id))]})]}),a.jsxs("div",{className:"context-form-group",children:[a.jsx("label",{htmlFor:`${e}-content`,children:"Content *"}),a.jsx(Hj,{value:c,onChange:f,placeholder:"Write in markdown or use / for commands",disabled:o})]}),a.jsxs("div",{className:"context-form-group",children:[a.jsx("label",{htmlFor:`${e}-tags`,children:"Tags"}),a.jsx(V0,{value:d,onChange:h,placeholder:"Type to add tags..."})]}),a.jsxs("div",{className:"context-form-actions",children:[a.jsx("button",{type:"button",className:"context-button secondary",onClick:i,disabled:o,children:"Cancel"}),a.jsx("button",{type:"submit",className:"context-button primary",disabled:o,children:o?"Saving…":e==="create"?"Create page":"Save Changes"})]})]})}function Bh(){const e=Oe(),{pageId:t}=fr(),{pages:n,isCreating:r,createPage:i,getPageTree:o}=mo(),s=async l=>{const u=await i(l);await o(),e(`/context/page/${u.id}`)};return a.jsxs("div",{className:"context-edit-container",children:[a.jsxs("div",{className:"context-edit-header",children:[a.jsx("h2",{children:"New Page"}),a.jsx("button",{onClick:()=>e("/context"),className:"context-button secondary",children:"Close"})]}),a.jsx(Zy,{mode:"create",pages:n,onSubmit:s,onCancel:()=>e("/context"),isSubmitting:r,defaultParentId:t})]})}function nd({message:e,onConfirm:t,onCancel:n,confirmText:r="Confirm",cancelText:i="Cancel"}){return a.jsx("div",{className:"confirm-overlay",onClick:n,children:a.jsxs("div",{className:"confirm-dialog",onClick:o=>o.stopPropagation(),children:[a.jsx("div",{className:"confirm-message",children:e}),a.jsxs("div",{className:"confirm-actions",children:[a.jsx("button",{onClick:n,className:"btn-secondary",children:i}),a.jsx("button",{onClick:t,className:"btn-danger",children:r})]})]})})}function Vj(e,t){const n=[];let r=e;for(;r;){const i=t.find(s=>s.id===r);if(!i)break;n.unshift(i);const o=i.parentId;r=typeof o=="string"?o:null}return n}function qj({pageId:e,pages:t}){const n=Vj(e,t);return a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(ar,{to:"/context",className:"breadcrumb-link",children:"Home"}),n.map((r,i)=>a.jsxs("span",{className:"breadcrumb-item",children:[a.jsx("span",{className:"breadcrumb-separator",children:" > "}),i===n.length-1?a.jsx("span",{className:"breadcrumb-current",children:r.title}):a.jsx(ar,{to:`/context/page/${r.id}`,className:"breadcrumb-link",children:r.title})]},r.id))]})}function Uh(e){try{return new Date(e).toLocaleString()}catch{return e}}function Gj(){const{pageId:e}=fr(),t=Oe(),{pages:n,selectedPage:r,isLoadingPage:i,isUpdating:o,isDeleting:s,error:l,selectPage:u,deletePage:c,getPageTree:f}=mo(),[d,h]=k.useState(!1),[p,g]=k.useState("");pr(r!=null&&r.title?`Context — ${r.title}`:"Context"),k.useEffect(()=>{e&&u(e)},[e,u]);const v=k.useCallback(()=>{h(!0)},[]),S=k.useCallback(async()=>{var y;if(e)try{await c(e),h(!1),await f(),t("/context")}catch(m){const x=((y=m==null?void 0:m.body)==null?void 0:y.detail)||(m==null?void 0:m.message)||"Failed to delete page";g(x),h(!1)}},[e,c,t,f]);return a.jsxs(a.Fragment,{children:[i&&a.jsx("div",{className:"context-status",children:"Loading page…"}),l&&a.jsx("div",{className:"context-error",children:l}),p&&a.jsx("div",{className:"context-error",children:p}),r&&e&&a.jsxs("div",{className:"context-page-detail",children:[a.jsx(qj,{pageId:e,pages:n}),a.jsxs("div",{className:"context-page-detail-header",children:[a.jsx("h1",{className:"context-page-detail-title",children:r.title}),a.jsxs("div",{className:"context-page-detail-meta",children:[a.jsxs("span",{children:["By ",r.createdBy||"unknown"]}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:["Created ",Uh(r.createdAt)]}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:["Last edited ",Uh(r.updatedAt)]})]})]}),r.tags&&r.tags.length>0&&a.jsx("div",{className:"context-page-detail-tags",children:r.tags.map(y=>a.jsx(Vg,{tag:y},y.name))}),a.jsx("div",{className:"context-page-detail-content",children:a.jsx(Jy,{content:r.content})}),a.jsxs("div",{className:"context-page-detail-actions",children:[a.jsx("button",{className:"context-button",type:"button",onClick:()=>t(`/context/page/${e}/edit`),disabled:o||s,children:"Edit"}),a.jsx("button",{className:"context-button context-button-danger",type:"button",onClick:v,disabled:o||s,children:"Delete"})]})]}),d&&a.jsx(nd,{message:"Are you sure you want to delete this page? This action cannot be undone.",onConfirm:S,onCancel:()=>h(!1),confirmText:"Delete",cancelText:"Cancel"})]})}function Kj(){const{pageId:e}=fr(),t=Oe(),{selectedPage:n,pages:r,isUpdating:i,updatePage:o,getPageTree:s,selectPage:l}=mo();k.useEffect(()=>{e&&l(e)},[e,l]);const u=k.useCallback(async c=>{e&&(await o(e,c),await s(),t(`/context/page/${e}`))},[e,o,s,t]);return n?a.jsxs("div",{className:"context-edit-container",children:[a.jsxs("div",{className:"context-edit-header",children:[a.jsx("h2",{children:"Edit Page"}),a.jsx("button",{onClick:()=>t(`/context/page/${e}`),className:"context-button secondary",children:"Close"})]}),a.jsx(Zy,{mode:"edit",page:n,pages:r,onSubmit:u,onCancel:()=>t(`/context/page/${e}`),isSubmitting:i})]}):a.jsx("div",{className:"context-status",children:"Loading..."})}z.BASE=hr;const ex=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(null),[i,o]=k.useState([]),[s,l]=k.useState(null),[u,c]=k.useState([]),[f,d]=k.useState([]),[h,p]=k.useState([]);k.useEffect(()=>{g()},[]);const g=async()=>{t(!0),r(null);try{const R=await Ke.mcpRegistryControllerListServers();o(R.items||[])}catch(R){r(R instanceof Error?R.message:"Failed to load servers")}finally{t(!1)}},v=async R=>{t(!0),r(null);try{const[b,P,q]=await Promise.all([Ke.mcpRegistryControllerGetServer(R),Ke.mcpRegistryControllerListScopes(R),Ke.mcpRegistryControllerListConnections(R)]);if(l(b),c(P||[]),d(q||[]),P&&P.length>0){const V=[];for(const H of P)try{const G=await Ke.mcpRegistryControllerListMappings(R,H.id);G&&V.push(...G)}catch(G){console.error(`Failed to load mappings for scope ${H.id}`,G)}p(V)}}catch(b){r(b instanceof Error?b.message:"Failed to load server details")}finally{t(!1)}};return{isLoading:e,error:n,servers:i,selectedServer:s,scopes:u,connections:f,mappings:h,loadServers:g,loadServerDetails:v,createServer:async R=>{t(!0),r(null);try{const b=await Ke.mcpRegistryControllerCreateServer(R);return await g(),b}catch(b){throw r(b instanceof Error?b.message:"Failed to create server"),b}finally{t(!1)}},updateServer:async(R,b)=>{t(!0),r(null);try{const P=await Ke.mcpRegistryControllerUpdateServer(R,b);return(s==null?void 0:s.id)===R&&l(P),await g(),P}catch(P){throw r(P instanceof Error?P.message:"Failed to update server"),P}finally{t(!1)}},createScope:async(R,b,P)=>{t(!0),r(null);try{await Ke.mcpRegistryControllerCreateScopes(R,[{id:b,description:P}]),(s==null?void 0:s.id)===R&&await v(R)}catch(q){throw r(q instanceof Error?q.message:"Failed to create scope"),q}finally{t(!1)}},createConnection:async(R,b)=>{t(!0),r(null);try{await Ke.mcpRegistryControllerCreateConnection(R,b),(s==null?void 0:s.id)===R&&await v(R)}catch(P){throw r(P instanceof Error?P.message:"Failed to create connection"),P}finally{t(!1)}},updateConnection:async(R,b)=>{t(!0),r(null);try{await Ke.mcpRegistryControllerUpdateConnection(R,b),s&&await v(s.id)}catch(P){throw r(P instanceof Error?P.message:"Failed to update connection"),P}finally{t(!1)}},createMapping:async(R,b)=>{t(!0),r(null);try{await Ke.mcpRegistryControllerCreateMapping(R,b),(s==null?void 0:s.id)===R&&await v(R)}catch(P){throw r(P instanceof Error?P.message:"Failed to create mapping"),P}finally{t(!1)}},deleteScope:async(R,b)=>{t(!0),r(null);try{await Ke.mcpRegistryControllerDeleteScope(R,b),(s==null?void 0:s.id)===R&&await v(R)}catch(P){throw r(P instanceof Error?P.message:"Failed to delete scope"),P}finally{t(!1)}},deleteConnection:async R=>{t(!0),r(null);try{await Ke.mcpRegistryControllerDeleteConnection(R),s&&await v(s.id)}catch(b){throw r(b instanceof Error?b.message:"Failed to delete connection"),b}finally{t(!1)}},deleteMapping:async R=>{t(!0),r(null);try{await Ke.mcpRegistryControllerDeleteMapping(R),s&&await v(s.id)}catch(b){throw r(b instanceof Error?b.message:"Failed to delete mapping"),b}finally{t(!1)}}}};function Qj(){pr("Tools");const{servers:e,isLoading:t,error:n,createServer:r}=ex(),i=Oe(),[o,s]=k.useState(!1),[l,u]=k.useState({providedId:"",name:"",description:"",url:""}),c=async f=>{f.preventDefault();try{const d={...l,url:l.url||void 0},h=await r(d);s(!1),u({providedId:"",name:"",description:"",url:""}),h&&i(`/mcp-registry/${h.id}`)}catch(d){console.error("Failed to create server",d)}};return a.jsxs("div",{className:"mcp-registry",children:[a.jsxs("div",{className:"mcp-registry-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:"Tools"}),a.jsx("p",{className:"subtitle",children:"Manage Model Context Protocol servers and their configurations"})]}),a.jsxs("div",{className:"header-actions",children:[a.jsx(ro,{}),a.jsx("button",{onClick:()=>s(!0),className:"btn-primary",children:"+ Add Server"})]})]}),n&&a.jsx("div",{className:"error-message",children:n}),t?a.jsx("div",{className:"loading",children:"Loading servers..."}):a.jsx("div",{className:"servers-grid",children:e.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx("p",{children:"No MCP servers registered yet."}),a.jsx("button",{onClick:()=>s(!0),className:"btn-primary",children:"Create your first server"})]}):e.map(f=>a.jsxs("div",{className:"server-card",onClick:()=>i(`/mcp-registry/${f.id}`),children:[a.jsx("h3",{children:f.name}),a.jsxs("p",{className:"server-id",children:["ID: ",f.providedId]}),a.jsx("p",{className:"server-description",children:f.description})]},f.id))}),o&&a.jsx("div",{className:"modal-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"modal-content",onClick:f=>f.stopPropagation(),children:[a.jsx("h2",{children:"Create MCP Server"}),a.jsxs("form",{onSubmit:c,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"providedId",children:"Server ID"}),a.jsx("input",{type:"text",id:"providedId",value:l.providedId,onChange:f=>u({...l,providedId:f.target.value}),placeholder:"e.g., my-mcp-server",required:!0}),a.jsx("small",{children:"Unique identifier for this server"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"name",children:"Name"}),a.jsx("input",{type:"text",id:"name",value:l.name,onChange:f=>u({...l,name:f.target.value}),placeholder:"e.g., My MCP Server",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"description",children:"Description"}),a.jsx("textarea",{id:"description",value:l.description,onChange:f=>u({...l,description:f.target.value}),placeholder:"Brief description of this server",rows:3,required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"url",children:"Server URL (optional)"}),a.jsx("input",{type:"url",id:"url",value:l.url,onChange:f=>u({...l,url:f.target.value}),placeholder:"e.g., http://localhost:3000/api/v1/tasks/tasks/mcp"}),a.jsx("small",{children:"URL that MCP clients will use to connect to this server"})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>s(!1),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Create Server"})]})]})]})})]})}const Yj=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(null),[i,o]=k.useState(null),[s,l]=k.useState(null),[u,c]=k.useState(null);async function f(h,p){t(!0),r(null);try{const g=Cg(),v=await fetch(`${g}/.well-known/oauth-authorization-server/mcp/issuer`);if(!v.ok)throw new Error("Failed to fetch authorization server issuer URL");const{issuer:S}=await v.json(),y=new URL(`${S}/mcp/${h}/${p}`);o(y);const m=new URL(`${y.origin}/.well-known/oauth-authorization-server${y.pathname}`);l(m),await d(m)}catch(g){r(g instanceof Error?g.message:"Failed to load authorization server configuration"),t(!1)}}async function d(h){t(!0),r(null);try{const g=await(await fetch(h.toString())).json();c(g)}catch(p){r(p instanceof Error?p.message:"Failed to load metadata"),c({})}finally{t(!1)}}return{isLoading:e,error:n,authorizationServerUrl:i,authorizationServerMetadataUrl:s,metadata:u,loadMetadata:f}};function Xj(){const{serverId:e}=fr(),t=Oe(),{selectedServer:n,scopes:r,connections:i,mappings:o,isLoading:s,error:l,loadServerDetails:u,createScope:c,createConnection:f,updateServer:d,updateConnection:h,createMapping:p,deleteScope:g,deleteConnection:v,deleteMapping:S}=ex(),{metadata:y,authorizationServerMetadataUrl:m,loadMetadata:x}=Yj(),[T,j]=k.useState([]),[E,_]=k.useState(null),[D,R]=k.useState(null),[b,P]=k.useState(null),[q,V]=k.useState(!1),[H,G]=k.useState({name:"",description:"",url:""}),[O,L]=k.useState({scopeId:"",description:""}),[C,B]=k.useState({clientId:"",clientSecret:"",authorizeUrl:"",tokenUrl:"",friendlyName:"",providedId:""}),[w,J]=k.useState({scopeId:"",mappings:[{connectionId:"",downstreamScope:""}]});pr(n?`${n.name} - Tools`:"Tools"),k.useEffect(()=>{e&&(u(e),T1.authJourneysControllerGetAuthJourneys(e).then(j).catch(()=>j([])))},[e]),k.useEffect(()=>{n&&x(n.providedId,"0.0.0")},[n]);const se=()=>{n&&(G({name:n.name,description:n.description,url:n.url||""}),_("edit-server"))},N=async I=>{if(I.preventDefault(),!!e)try{const $={};H.name&&($.name=H.name),H.description&&($.description=H.description),H.url&&($.url=H.url),await d(e,$),_(null),G({name:"",description:"",url:""})}catch($){console.error("Failed to update server",$)}},Se=async I=>{if(I.preventDefault(),!!e)try{await c(e,O.scopeId,O.description),_(null),L({scopeId:"",description:""})}catch($){console.error("Failed to create scope",$)}},nt=async I=>{if(I.preventDefault(),!!e)try{await f(e,C),_(null),B({clientId:"",clientSecret:"",authorizeUrl:"",tokenUrl:"",friendlyName:"",providedId:""})}catch($){console.error("Failed to create connection",$)}},ue=I=>{const $=i.find(Te=>Te.id===I);$&&(P(I),B({clientId:$.clientId,clientSecret:"",authorizeUrl:$.authorizeUrl,tokenUrl:$.tokenUrl,friendlyName:$.friendlyName,providedId:$.providedId||""}),_("edit-connection"))},mt=async I=>{if(I.preventDefault(),!!b)try{const $={};C.friendlyName&&($.friendlyName=C.friendlyName),C.providedId&&($.providedId=C.providedId),C.clientId&&($.clientId=C.clientId),C.clientSecret&&($.clientSecret=C.clientSecret),C.authorizeUrl&&($.authorizeUrl=C.authorizeUrl),C.tokenUrl&&($.tokenUrl=C.tokenUrl),await h(b,$),_(null),P(null),B({clientId:"",clientSecret:"",authorizeUrl:"",tokenUrl:"",friendlyName:"",providedId:""})}catch($){console.error("Failed to update connection",$)}},Bt=async I=>{if(I.preventDefault(),!!e)try{for(const $ of w.mappings)await p(e,{scopeId:w.scopeId,connectionId:$.connectionId,downstreamScope:$.downstreamScope});_(null),J({scopeId:"",mappings:[{connectionId:"",downstreamScope:""}]})}catch($){console.error("Failed to create mapping",$)}},gn=()=>{const I=w.mappings[w.mappings.length-1];J({...w,mappings:[...w.mappings,{connectionId:I.connectionId,downstreamScope:""}]})},yn=I=>{w.mappings.length!==1&&J({...w,mappings:w.mappings.filter(($,Te)=>Te!==I)})},Vn=(I,$,Te)=>{const gt=[...w.mappings];gt[I]={...gt[I],[$]:Te},J({...w,mappings:gt})},hl=async I=>{e&&R({message:"Are you sure you want to delete this scope?",onConfirm:async()=>{try{await g(e,I),R(null)}catch($){console.error("Failed to delete scope",$),R(null)}}})},pl=async I=>{R({message:"Are you sure you want to delete this connection?",onConfirm:async()=>{try{await v(I),R(null)}catch($){console.error("Failed to delete connection",$),R(null)}}})},ml=async I=>{R({message:"Are you sure you want to delete this mapping?",onConfirm:async()=>{try{await S(I),R(null)}catch($){console.error("Failed to delete mapping",$),R(null)}}})},vo=k.useMemo(()=>{const I={};return o.forEach($=>{const Te=r.find(Ut=>Ut.id===$.scopeId),gt=i.find(Ut=>Ut.id===$.connectionId);!Te||!gt||(I[$.scopeId]||(I[$.scopeId]={scope:Te,connections:{}}),I[$.scopeId].connections[$.connectionId]||(I[$.scopeId].connections[$.connectionId]={connection:gt,mappings:[]}),I[$.scopeId].connections[$.connectionId].mappings.push($))}),I},[o,r,i]);return s&&!n?a.jsx("div",{className:"loading",children:"Loading server details..."}):n?a.jsxs("div",{className:"mcp-registry",children:[a.jsxs("div",{className:"mcp-registry-header",children:[a.jsxs("div",{children:[a.jsx("button",{onClick:()=>t("/mcp-registry"),className:"btn-back",children:"← Back to Registry"}),a.jsx("h1",{children:n.name}),a.jsx("p",{className:"subtitle",children:n.description}),a.jsxs("p",{className:"server-id",children:["ID: ",n.providedId]})]}),a.jsx("div",{className:"header-actions",children:a.jsx(ro,{})})]}),l&&a.jsx("div",{className:"error-message",children:l}),a.jsxs("div",{className:"info-section",children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx("h2",{className:"section-title",children:"Information"}),a.jsx("button",{onClick:se,className:"btn-secondary btn-sm",children:"Edit"})]}),a.jsx("div",{className:"section-divider"}),a.jsxs("div",{className:"info-grid",children:[a.jsxs("div",{className:"info-item",children:[a.jsx("span",{className:"info-label",children:"Name"}),a.jsx("span",{className:"info-value",children:n.name})]}),a.jsxs("div",{className:"info-item",children:[a.jsx("span",{className:"info-label",children:"ID"}),a.jsx("span",{className:"info-value mono",children:n.providedId})]}),i.length>0&&a.jsxs("div",{className:"info-item",children:[a.jsx("span",{className:"info-label",children:"Connections"}),a.jsx("span",{className:"info-value",children:i.map(I=>I.friendlyName).join(", ")})]}),r.length>0&&a.jsxs("div",{className:"info-item",children:[a.jsx("span",{className:"info-label",children:"Scopes"}),a.jsx("span",{className:"info-value",children:r.map(I=>I.id).join(", ")})]}),n.url&&a.jsxs("div",{className:"info-item inspector-command-item",children:[a.jsx("span",{className:"info-label",children:"Inspector Command"}),a.jsxs("div",{className:"inspector-command",children:[a.jsxs("code",{className:"inspector-code",children:["npx @modelcontextprotocol/inspector --transport http --server-url ",n.url]}),a.jsx("button",{className:"btn-secondary btn-sm copy-btn",onClick:()=>{navigator.clipboard.writeText(`npx @modelcontextprotocol/inspector --transport http --server-url ${n.url}`)},title:"Copy to clipboard",children:"Copy"})]})]})]}),y?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"section-divider"}),a.jsxs("div",{className:"metadata-section",children:[a.jsxs("div",{className:"metadata-header",children:[a.jsx("span",{className:"metadata-status",children:"✓ Authorization Server Metadata found"}),a.jsx("button",{onClick:()=>V(!q),className:"btn-link",children:q?"Hide":"Show"})]}),q&&a.jsxs("div",{className:"metadata-content",children:[a.jsx("p",{className:"metadata-url",children:m==null?void 0:m.toString()}),a.jsx("pre",{className:"metadata-json",children:JSON.stringify(y,null,2)})]})]})]}):null]}),a.jsxs("div",{className:"admin-section",children:[a.jsx("h2",{className:"section-title",children:"Administration"}),a.jsx("div",{className:"section-divider"}),a.jsxs("div",{className:"admin-subsection",children:[a.jsx("div",{className:"subsection-header",children:a.jsx("h3",{children:"Permissions"})}),a.jsx("p",{className:"subsection-description",children:"Define the scopes (permissions) that will be available for MCP clients to request when connecting to this server."}),r.length===0?a.jsx("div",{className:"proper-table",children:a.jsx("div",{className:"table-add-row",onClick:()=>_("scope"),children:a.jsx("div",{className:"add-row-cell",children:a.jsx("span",{className:"add-row-text",children:"Add permission..."})})})}):a.jsxs("div",{className:"proper-table",children:[a.jsxs("div",{className:"table-header",children:[a.jsx("div",{className:"table-col-name",children:"Scope Name"}),a.jsx("div",{className:"table-col-description",children:"Description"}),a.jsx("div",{className:"table-col-actions"})]}),r.map(I=>a.jsxs("div",{className:"table-body-row",children:[a.jsx("div",{className:"table-col-name",children:I.id}),a.jsx("div",{className:"table-col-description",children:I.description}),a.jsx("div",{className:"table-col-actions",children:a.jsx("button",{onClick:()=>hl(I.id),className:"btn-delete-small",children:"Delete"})})]},I.id)),a.jsx("div",{className:"table-add-row",onClick:()=>_("scope"),children:a.jsx("div",{className:"add-row-cell",children:a.jsx("span",{className:"add-row-text",children:"Add permission..."})})})]})]}),a.jsx("div",{className:"section-divider"}),a.jsxs("div",{className:"admin-subsection",children:[a.jsx("div",{className:"subsection-header",children:a.jsx("h3",{children:"Connections"})}),a.jsx("p",{className:"subsection-description",children:"Configure connections to downstream systems that support OAuth. The MCP server acts as a secure proxy, managing authentication and authorization on behalf of clients."}),i.length===0?a.jsx("div",{className:"proper-table",children:a.jsx("div",{className:"table-add-row",onClick:()=>_("connection"),children:a.jsx("div",{className:"add-row-cell",children:a.jsx("span",{className:"add-row-text",children:"Add connection..."})})})}):a.jsxs("div",{className:"proper-table",children:[a.jsxs("div",{className:"table-header",children:[a.jsx("div",{className:"table-col-name",children:"Connection Name"}),a.jsx("div",{className:"table-col-description",children:"Description"}),a.jsx("div",{className:"table-col-actions"})]}),i.map(I=>a.jsxs("div",{className:"table-body-row",children:[a.jsx("div",{className:"table-col-name",children:I.friendlyName}),a.jsx("div",{className:"table-col-description",children:I.providedId&&a.jsx("span",{className:"mono",children:I.providedId})}),a.jsxs("div",{className:"table-col-actions",children:[a.jsx("button",{onClick:()=>ue(I.id),className:"btn-secondary btn-sm",children:"Edit"}),a.jsx("button",{onClick:()=>pl(I.id),className:"btn-delete-small",children:"Delete"})]})]},I.id)),a.jsx("div",{className:"table-add-row",onClick:()=>_("connection"),children:a.jsx("div",{className:"add-row-cell",children:a.jsx("span",{className:"add-row-text",children:"Add connection..."})})})]})]}),i.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"section-divider"}),a.jsxs("div",{className:"admin-subsection",children:[a.jsx("div",{className:"subsection-header",children:a.jsx("h3",{children:"Scope Mappings"})}),a.jsx("p",{className:"subsection-description",children:"Map MCP server scopes to downstream connection scopes. When a client requests an MCP scope, the server will request the corresponding downstream scopes from the configured connections."}),o.length===0?a.jsx("div",{className:"mapping-group",children:a.jsx("div",{className:"table-add-row",onClick:()=>r.length>0&&_("mapping"),style:{opacity:r.length===0?.5:1,cursor:r.length===0?"not-allowed":"pointer"},children:a.jsx("span",{className:"add-row-text",children:r.length===0?"Add permissions first to create mappings...":"Add scope mapping..."})})}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[Object.entries(vo).map(([I,$])=>a.jsxs("div",{className:"mapping-group",children:[a.jsxs("div",{className:"mapping-group-header",children:[$.scope.id," → ",Object.keys($.connections).length," connection",Object.keys($.connections).length!==1?"s":""]}),a.jsx("div",{className:"mapping-items",children:Object.entries($.connections).map(([Te,gt])=>gt.mappings.map(Ut=>a.jsxs("div",{className:"mapping-item",children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"#1a202c",marginBottom:"4px"},children:gt.connection.friendlyName}),a.jsx("div",{className:"mapping-item-scope",children:Ut.downstreamScope})]}),a.jsx("button",{onClick:()=>ml(Ut.id),className:"btn-delete-small",title:"Delete mapping",children:"Delete"})]},Ut.id)))})]},I)),a.jsx("div",{className:"mapping-group",children:a.jsx("div",{className:"table-add-row",onClick:()=>r.length>0&&_("mapping"),style:{opacity:r.length===0?.5:1,cursor:r.length===0?"not-allowed":"pointer"},children:a.jsx("span",{className:"add-row-text",children:r.length===0?"Add permissions first to create mappings...":"Add scope mapping..."})})})]})]})]})]}),a.jsxs("div",{className:"admin-section",children:[a.jsx("h2",{className:"section-title",children:"Authorizations"}),a.jsx("div",{className:"section-divider"}),a.jsx("p",{className:"subsection-description",style:{marginBottom:"16px"},children:"Live monitoring of MCP client authorizations and their authentication state"}),T.length===0?a.jsx("p",{style:{color:"#888",fontSize:"14px"},children:"No active authorizations"}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:T.sort((I,$)=>new Date($.updatedAt).getTime()-new Date(I.updatedAt).getTime()).map(I=>a.jsxs("div",{style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:"8px",padding:"16px"},children:[a.jsx("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"12px"},children:a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[a.jsx("h3",{style:{margin:0,fontSize:"16px",fontWeight:600},children:I.mcpAuthorizationFlow.clientName??"Unknown Client"}),a.jsx("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"4px",backgroundColor:I.status===Wt.status.AUTHORIZATION_CODE_EXCHANGED?"#d4edda":I.status===Wt.status.MCP_AUTH_FLOW_STARTED?"#cfe2ff":I.status===Wt.status.CONNECTIONS_FLOW_STARTED?"#fff3cd":I.status===Wt.status.USER_CONSENT_REJECTED?"#f8d7da":"#e2e3e5",color:I.status===Wt.status.AUTHORIZATION_CODE_EXCHANGED?"#155724":I.status===Wt.status.MCP_AUTH_FLOW_STARTED?"#084298":I.status===Wt.status.CONNECTIONS_FLOW_STARTED?"#664d03":I.status===Wt.status.USER_CONSENT_REJECTED?"#842029":"#383d41"},children:I.status.replace(/_/g," ").toUpperCase()})]}),a.jsxs("div",{style:{fontSize:"11px",color:"#6c757d",lineHeight:"1.5"},children:[I.actor&&a.jsxs("div",{style:{marginBottom:"4px"},children:[a.jsx("strong",{children:"User:"})," ",I.actor.displayName," (",I.actor.slug,")"]}),a.jsxs("div",{children:["Journey ID: ",I.id]}),a.jsxs("div",{children:["Started: ",new Date(I.createdAt).toLocaleString()]}),a.jsxs("div",{children:["Last Update: ",new Date(I.updatedAt).toLocaleString()]})]})]})}),a.jsxs("div",{style:{marginBottom:"12px",paddingLeft:"16px",borderLeft:"2px solid #dee2e6"},children:[a.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"#495057",marginBottom:"4px"},children:"MCP Authorization"}),a.jsxs("div",{style:{fontSize:"11px",color:"#6c757d",lineHeight:"1.5"},children:[a.jsxs("div",{children:["Status: ",a.jsx("span",{style:{fontWeight:500,color:I.mcpAuthorizationFlow.status===Pi.status.AUTHORIZATION_CODE_EXCHANGED?"#28a745":I.mcpAuthorizationFlow.status===Pi.status.CLIENT_REGISTERED?"#007bff":I.mcpAuthorizationFlow.status===Pi.status.USER_CONSENT_REJECTED?"#dc3545":"#6c757d"},children:I.mcpAuthorizationFlow.status.replace(/_/g," ")})]}),I.mcpAuthorizationFlow.scope&&a.jsxs("div",{children:["Scopes: ",I.mcpAuthorizationFlow.scope]}),I.mcpAuthorizationFlow.authorizationCodeExpiresAt&&a.jsxs("div",{children:["Code Expires: ",new Date(I.mcpAuthorizationFlow.authorizationCodeExpiresAt).toLocaleString()]}),a.jsxs("div",{children:["Code Used: ",I.mcpAuthorizationFlow.authorizationCodeUsed?"Yes":"No"]})]})]}),I.connectionAuthorizationFlows.length>0&&a.jsxs("div",{style:{paddingLeft:"16px",borderLeft:"2px solid #dee2e6"},children:[a.jsxs("div",{style:{fontSize:"14px",fontWeight:500,color:"#495057",marginBottom:"8px"},children:["Downstream Connections (",I.connectionAuthorizationFlows.length,")"]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:I.connectionAuthorizationFlows.map($=>a.jsxs("div",{style:{backgroundColor:"#ffffff",borderRadius:"4px",padding:"12px"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[a.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:$.connectionName??"Unknown Connection"}),a.jsx("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"4px",backgroundColor:$.status===Cn.status.AUTHORIZED?"#d4edda":$.status===Cn.status.PENDING?"#fff3cd":($.status===Cn.status.FAILED,"#f8d7da"),color:$.status===Cn.status.AUTHORIZED?"#155724":$.status===Cn.status.PENDING?"#664d03":$.status===Cn.status.FAILED?"#842029":"#721c24"},children:$.status})]}),a.jsxs("div",{style:{fontSize:"11px",color:"#6c757d",lineHeight:"1.5"},children:[$.tokenExpiresAt&&a.jsxs("div",{children:["Token Expires: ",new Date($.tokenExpiresAt).toLocaleString()]}),a.jsxs("div",{children:["Created: ",new Date($.createdAt).toLocaleString()]})]})]},$.id))})]})]},I.id))})]}),E==="scope"&&a.jsx("div",{className:"modal-overlay",onClick:()=>_(null),children:a.jsxs("div",{className:"modal-content",onClick:I=>I.stopPropagation(),children:[a.jsx("h2",{children:"Create Permission"}),a.jsxs("form",{onSubmit:Se,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"scopeId",children:"Scope ID"}),a.jsx("input",{type:"text",id:"scopeId",value:O.scopeId,onChange:I=>L({...O,scopeId:I.target.value}),placeholder:"e.g., tool:read",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"scopeDescription",children:"Description"}),a.jsx("textarea",{id:"scopeDescription",value:O.description,onChange:I=>L({...O,description:I.target.value}),placeholder:"What does this scope provide?",rows:3,required:!0})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>_(null),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Create Scope"})]})]})]})}),E==="connection"&&a.jsx("div",{className:"modal-overlay",onClick:()=>_(null),children:a.jsxs("div",{className:"modal-content",onClick:I=>I.stopPropagation(),children:[a.jsx("h2",{children:"Create Connection"}),a.jsxs("form",{onSubmit:nt,autoComplete:"off",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"friendlyName",children:"Friendly Name"}),a.jsx("input",{type:"text",id:"friendlyName",value:C.friendlyName,onChange:I=>B({...C,friendlyName:I.target.value}),placeholder:"e.g., GitHub OAuth",autoComplete:"off",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsxs("label",{htmlFor:"providedId",children:["Provided ID ",a.jsx("span",{style:{color:"#888",fontWeight:"normal"},children:"(optional)"})]}),a.jsx("input",{type:"text",id:"providedId",value:C.providedId,onChange:I=>B({...C,providedId:I.target.value}),placeholder:"e.g., google-oauth, github-integration",pattern:"[a-zA-Z0-9_-]+",title:"Only alphanumeric characters, dashes, and underscores are allowed",autoComplete:"off"}),a.jsx("small",{style:{color:"#888",fontSize:"0.85em",marginTop:"4px",display:"block"},children:"Unique identifier for token exchange (alphanumeric, dash, underscore only)"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"clientId",children:"Client ID"}),a.jsx("input",{type:"text",id:"clientId",value:C.clientId,onChange:I=>B({...C,clientId:I.target.value}),autoComplete:"off",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"clientSecret",children:"Client Secret"}),a.jsx("input",{type:"password",id:"clientSecret",value:C.clientSecret,onChange:I=>B({...C,clientSecret:I.target.value}),autoComplete:"new-password",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"authorizeUrl",children:"Authorize URL"}),a.jsx("input",{type:"url",id:"authorizeUrl",value:C.authorizeUrl,onChange:I=>B({...C,authorizeUrl:I.target.value}),placeholder:"https://...",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"tokenUrl",children:"Token URL"}),a.jsx("input",{type:"url",id:"tokenUrl",value:C.tokenUrl,onChange:I=>B({...C,tokenUrl:I.target.value}),placeholder:"https://...",required:!0})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>_(null),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Create Connection"})]})]})]})}),E==="edit-connection"&&a.jsx("div",{className:"modal-overlay",onClick:()=>_(null),children:a.jsxs("div",{className:"modal-content",onClick:I=>I.stopPropagation(),children:[a.jsx("h2",{children:"Edit Connection"}),a.jsxs("form",{onSubmit:mt,autoComplete:"off",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editFriendlyName",children:"Friendly Name"}),a.jsx("input",{type:"text",id:"editFriendlyName",value:C.friendlyName,onChange:I=>B({...C,friendlyName:I.target.value}),placeholder:"e.g., GitHub OAuth",autoComplete:"off",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsxs("label",{htmlFor:"editProvidedId",children:["Provided ID ",a.jsx("span",{style:{color:"#888",fontWeight:"normal"},children:"(optional)"})]}),a.jsx("input",{type:"text",id:"editProvidedId",value:C.providedId,onChange:I=>B({...C,providedId:I.target.value}),placeholder:"e.g., google-oauth, github-integration",pattern:"[a-zA-Z0-9_-]+",title:"Only alphanumeric characters, dashes, and underscores are allowed",autoComplete:"off"}),a.jsx("small",{style:{color:"#888",fontSize:"0.85em",marginTop:"4px",display:"block"},children:"Unique identifier for token exchange (alphanumeric, dash, underscore only)"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editClientId",children:"Client ID"}),a.jsx("input",{type:"text",id:"editClientId",value:C.clientId,onChange:I=>B({...C,clientId:I.target.value}),autoComplete:"off",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editClientSecret",children:"Client Secret (leave blank to keep current)"}),a.jsx("input",{type:"password",id:"editClientSecret",value:C.clientSecret,onChange:I=>B({...C,clientSecret:I.target.value}),placeholder:"Enter new secret or leave blank",autoComplete:"new-password"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editAuthorizeUrl",children:"Authorize URL"}),a.jsx("input",{type:"url",id:"editAuthorizeUrl",value:C.authorizeUrl,onChange:I=>B({...C,authorizeUrl:I.target.value}),placeholder:"https://...",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editTokenUrl",children:"Token URL"}),a.jsx("input",{type:"url",id:"editTokenUrl",value:C.tokenUrl,onChange:I=>B({...C,tokenUrl:I.target.value}),placeholder:"https://...",required:!0})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>{_(null),P(null),B({clientId:"",clientSecret:"",authorizeUrl:"",tokenUrl:"",friendlyName:"",providedId:""})},className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Update Connection"})]})]})]})}),E==="edit-server"&&a.jsx("div",{className:"modal-overlay",onClick:()=>_(null),children:a.jsxs("div",{className:"modal-content",onClick:I=>I.stopPropagation(),children:[a.jsx("h2",{children:"Edit Server"}),a.jsxs("form",{onSubmit:N,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editServerName",children:"Name"}),a.jsx("input",{type:"text",id:"editServerName",value:H.name,onChange:I=>G({...H,name:I.target.value}),placeholder:"e.g., GitHub Integration",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"editServerDescription",children:"Description"}),a.jsx("textarea",{id:"editServerDescription",value:H.description,onChange:I=>G({...H,description:I.target.value}),placeholder:"What does this server provide?",rows:3,required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsxs("label",{htmlFor:"editServerUrl",children:["URL ",a.jsx("span",{style:{color:"#888",fontWeight:"normal"},children:"(optional)"})]}),a.jsx("input",{type:"url",id:"editServerUrl",value:H.url,onChange:I=>G({...H,url:I.target.value}),placeholder:"http://localhost:3000/api/v1/mcp"})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>{_(null),G({name:"",description:"",url:""})},className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Update Server"})]})]})]})}),E==="mapping"&&a.jsx("div",{className:"modal-overlay",onClick:()=>_(null),children:a.jsxs("div",{className:"modal-content",onClick:I=>I.stopPropagation(),children:[a.jsx("h2",{children:"Create Scope Mapping"}),a.jsxs("form",{onSubmit:Bt,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"mappingScopeId",children:"MCP Scope"}),a.jsxs("select",{id:"mappingScopeId",value:w.scopeId,onChange:I=>J({...w,scopeId:I.target.value}),required:!0,children:[a.jsx("option",{value:"",children:"Select a scope"}),r.map(I=>a.jsx("option",{value:I.id,children:I.id},I.id))]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:"Connection & Downstream Scope Mappings"}),w.mappings.map((I,$)=>a.jsxs("div",{className:"mapping-row",children:[a.jsxs("select",{value:I.connectionId,onChange:Te=>Vn($,"connectionId",Te.target.value),required:!0,className:"mapping-connection-select",children:[a.jsx("option",{value:"",children:"Select a connection"}),i.map(Te=>a.jsx("option",{value:Te.id,children:Te.friendlyName},Te.id))]}),a.jsx("input",{type:"text",value:I.downstreamScope,onChange:Te=>Vn($,"downstreamScope",Te.target.value),placeholder:"e.g., repo:read",required:!0,className:"mapping-scope-input"}),w.mappings.length>1&&a.jsx("button",{type:"button",onClick:()=>yn($),className:"btn-remove","aria-label":"Remove mapping",children:"×"})]},$)),a.jsx("button",{type:"button",onClick:gn,className:"btn-add-mapping",children:"+ Add Entry"})]}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>_(null),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Create Mapping"})]})]})]})}),D&&a.jsx(nd,{message:D.message,onConfirm:D.onConfirm,onCancel:()=>R(null)})]}):a.jsx("div",{className:"error-message",children:"Server not found"})}z.BASE=hr;function Jj(){pr("Authorization Consent - taico");const[e]=a1(),t=e.get("flow"),[n,r]=k.useState(null),[i,o]=k.useState(!0),[s,l]=k.useState(null),[u,c]=k.useState(!1);k.useEffect(()=>{if(!t){l("No authorization flow ID provided"),o(!1);return}f()},[t]);const f=async()=>{if(t){o(!0),l(null);try{const g=await j1.authorizationControllerGetConsentMetadata(t);r(g)}catch(g){l(g instanceof Error?g.message:"Failed to load authorization details")}finally{o(!1)}}},d=async g=>{if(!(!n||!t)){c(!0),l(null);try{const v={flow_id:t,approved:g},S=z.BASE??"",y=document.createElement("form");y.method="POST",y.action=`${S}/api/v1/auth/authorize/mcp/${n.server.providedId}/0.0.0`,Object.entries(v).forEach(([m,x])=>{const T=document.createElement("input");T.type="hidden",T.name=m,T.value=String(x),y.appendChild(T)}),document.body.appendChild(y),y.submit()}catch(v){l(v instanceof Error?v.message:"Failed to submit consent decision"),c(!1)}}},h=()=>{n&&d(!0)},p=()=>{n&&d(!1)};return i?a.jsx("div",{className:"consent-page",children:a.jsx("div",{className:"consent-container",children:a.jsxs("div",{className:"loading-state",children:[a.jsx("div",{className:"spinner"}),a.jsx("p",{children:"Loading authorization details..."})]})})}):s||!n?a.jsx("div",{className:"consent-page",children:a.jsx("div",{className:"consent-container",children:a.jsxs("div",{className:"error-state",children:[a.jsx("h1",{children:"Authorization Error"}),a.jsx("p",{className:"error-message",children:s||"Invalid authorization request"}),a.jsx(ro,{})]})})}):a.jsx("div",{className:"consent-page",children:a.jsxs("div",{className:"consent-container",children:[a.jsxs("div",{className:"consent-header",children:[a.jsx("div",{className:"oauth-icon",children:"🔐"}),a.jsx("h1",{children:"Authorization Request"}),a.jsx("p",{className:"subtitle",children:"Review the following authorization request carefully"})]}),a.jsxs("div",{className:"consent-details",children:[a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"WHO is requesting access"}),a.jsxs("div",{className:"client-info",children:[a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Client Name:"}),a.jsx("span",{className:"value",children:n.client.clientName})]}),a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Client ID:"}),a.jsx("span",{className:"value",children:a.jsx("code",{children:n.client.clientId})})]})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"WHAT access is requested"}),n.scopes&&n.scopes.length>0?a.jsxs(a.Fragment,{children:[a.jsx("ul",{className:"scopes-list",children:n.scopes.map(g=>a.jsx("li",{children:a.jsx("span",{className:"scope-badge",children:g})},g))}),a.jsx("p",{style:{marginTop:"12px",fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"These permissions determine what the client can do on your behalf."})]}):a.jsx("p",{style:{fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"No specific permissions requested."})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"WHERE access is granted"}),a.jsxs("div",{className:"server-info",children:[a.jsx("div",{className:"server-name",children:n.server.name}),a.jsxs("div",{className:"server-id",children:["Server ID: ",n.server.providedId]})]}),a.jsxs("div",{className:"resource-info",style:{marginTop:"16px"},children:[a.jsx("div",{style:{fontSize:"13px",color:"#7f8c8d",marginBottom:"8px"},children:"Resource:"}),a.jsx("code",{children:n.resource})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Redirect Information"}),a.jsx("div",{className:"client-info",children:a.jsxs("div",{className:"info-row",children:[a.jsx("span",{className:"label",children:"Redirect URI:"}),a.jsx("span",{className:"value",children:a.jsx("code",{children:n.redirectUri})})]})}),a.jsx("p",{style:{marginTop:"12px",fontSize:"13px",color:"#7f8c8d",marginBottom:0},children:"After authorization, you will be redirected to this URL."})]})]}),s&&a.jsx("div",{className:"error-banner",children:s}),a.jsxs("div",{className:"consent-actions",children:[a.jsx("button",{type:"button",className:"btn-deny",onClick:p,disabled:u,children:"Deny"}),a.jsx("button",{type:"button",className:"btn-approve",onClick:h,disabled:u,children:u?"Approving...":"Approve"})]}),a.jsxs("div",{className:"consent-footer",children:[a.jsxs("p",{children:["By approving, you authorize ",a.jsx("strong",{children:n.client.clientName})," to access the specified resources with the requested permissions."]}),a.jsx(ro,{})]})]})})}const $h="agents-sidebar-collapsed";function Zj(){const{agentId:e,sessionId:t}=fr(),n=Oe(),[r,i]=k.useState(()=>{const u=localStorage.getItem($h);return u!==null?u==="true":no()});k.useEffect(()=>{localStorage.setItem($h,String(r))},[r]);const o=()=>{i(!r)},s=window.location.pathname.includes("/agents/admin"),l=window.location.pathname==="/agents"||window.location.pathname==="/agents/";return a.jsxs("div",{className:"agents-with-sidebar",children:[a.jsxs("aside",{className:`sidebar-app-specific ${r?"collapsed":""}`,children:[a.jsx("nav",{className:"sidebar-content",children:!r&&a.jsxs("div",{children:[a.jsx("div",{className:"agents-sidebar-header",children:a.jsxs("h2",{className:"agents-sidebar-title",children:["🤖 Agents",a.jsx("span",{className:"agents-status-dot disconnected",title:"WebSocket disconnected"})]})}),a.jsx("div",{className:"agents-sidebar-section",children:a.jsxs("div",{className:"agents-nav-list",children:[a.jsx("div",{className:`agents-nav-item ${l?"active":""}`,onClick:()=>n("/agents"),role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&n("/agents")},title:"Agents",children:"🤖 Agents"}),a.jsx("div",{className:`agents-nav-item ${s?"active":""}`,onClick:()=>n("/agents/admin"),role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&n("/agents/admin")},title:"Admin",children:"⚙️ Admin"})]})}),a.jsxs("div",{className:"agents-sidebar-section",children:[a.jsx("h3",{className:"agents-sidebar-section-title",children:"History"}),a.jsxs("div",{className:"agents-history-list",children:[a.jsx("div",{className:"agents-history-item",children:"Loading sessions..."}),!1,!1]})]})]})}),a.jsx("button",{className:"sidebar-toggle",onClick:o,"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?"→":"←"})]}),a.jsx("main",{className:"agents-content",children:a.jsx(bc,{})})]})}z.BASE=hr;const rd=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(null),[i,o]=k.useState([]),[s,l]=k.useState(null);k.useEffect(()=>{u()},[]);const u=async()=>{t(!0),r(null);try{const d=await ql.agentsControllerListAgents();o(d.items||[])}catch(d){r(d instanceof Error?d.message:"Failed to load agents")}finally{t(!1)}};return{agents:i,selectedAgent:s,isLoading:e,error:n,loadAgents:u,loadAgentDetails:async d=>{t(!0),r(null);try{const h=await ql.agentsControllerGetAgentBySlug(d);l(h)}catch(h){r(h instanceof Error?h.message:"Failed to load agent details")}finally{t(!1)}},createAgent:async d=>{t(!0),r(null);try{const h=await ql.agentsControllerCreateAgent(d);return await u(),h}catch(h){return r(h instanceof Error?h.message:"Failed to create agent"),null}finally{t(!1)}}}};function e_(){const e=Oe(),{agents:t,isLoading:n,error:r}=rd();return a.jsxs("div",{className:"agents-home",children:[a.jsxs("div",{className:"agents-home-header",children:[a.jsx("h2",{children:"Available Agents"}),a.jsx("p",{children:"Select an agent to start a new conversation"})]}),n&&a.jsx("div",{className:"agents-loading",children:"Loading agents..."}),r&&a.jsxs("div",{className:"agents-error",children:["Error: ",r]}),!n&&!r&&t.length===0&&a.jsx("div",{className:"agents-empty",children:"No agents available. Create one in the admin panel."}),a.jsx("div",{className:"agents-admin-grid",children:t.map(i=>a.jsxs("div",{className:"agent-admin-card",onClick:()=>e(`/agents/${i.slug||i.actorId}/session/new`),role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&e(`/agents/${i.slug||i.actorId}/session/new`)},children:[a.jsxs("div",{className:"agent-admin-card-header",children:[a.jsx("h3",{children:i.name}),a.jsx("span",{className:`agent-status ${i.isActive?"active":"inactive"}`,children:i.isActive?"Active":"Inactive"})]}),a.jsxs("p",{className:"agent-slug",children:["@",i.slug]}),a.jsx("p",{className:"agent-description",children:typeof i.description=="string"?i.description:i.description?JSON.stringify(i.description):"No description available"}),a.jsxs("p",{className:"agent-tools",children:["Tools: ",i.allowedTools.length>0?i.allowedTools.join(", "):"None"]})]},i.actorId))})]})}function t_(){const{agents:e,isLoading:t,error:n,createAgent:r}=rd(),i=Oe(),[o,s]=k.useState(!1),[l,u]=k.useState({slug:"",name:"",description:"",systemPrompt:"",allowedTools:"",statusTriggers:"",isActive:!0}),c=async f=>{f.preventDefault();try{const d=await r({slug:l.slug,name:l.name,description:l.description,systemPrompt:l.systemPrompt,allowedTools:l.allowedTools.split(",").map(h=>h.trim()).filter(Boolean),statusTriggers:l.statusTriggers.split(",").map(h=>h.trim()).filter(Boolean),isActive:l.isActive});s(!1),u({slug:"",name:"",description:"",systemPrompt:"",allowedTools:"",statusTriggers:"",isActive:!0}),d&&i(`/agents/${d.actorId}/admin`)}catch(d){console.error("Failed to create agent",d)}};return a.jsxs("div",{className:"agents-admin-list",children:[a.jsxs("div",{className:"agents-admin-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:"Agents Admin"}),a.jsx("p",{className:"subtitle",children:"Manage agents and their configurations"})]}),a.jsx("div",{className:"header-actions",children:a.jsx("button",{onClick:()=>s(!0),className:"btn-primary",children:"+ Create Agent"})})]}),n&&a.jsx("div",{className:"error-message",children:n}),t?a.jsx("div",{className:"loading",children:"Loading agents..."}):a.jsx("div",{className:"agents-admin-grid",children:e.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx("p",{children:"No agents created yet."}),a.jsx("button",{onClick:()=>s(!0),className:"btn-primary",children:"Create your first agent"})]}):e.map(f=>a.jsxs("div",{className:"agent-admin-card",onClick:()=>i(`/agents/${f.actorId}/admin`),children:[a.jsxs("div",{className:"agent-admin-card-header",children:[a.jsx("h3",{children:f.name}),a.jsx("span",{className:`agent-status ${f.isActive?"active":"inactive"}`,children:f.isActive?"Active":"Inactive"})]}),a.jsxs("p",{className:"agent-slug",children:["@",f.slug]}),a.jsx("p",{className:"agent-description",children:typeof f.description=="string"?f.description:"No description"}),a.jsxs("p",{className:"agent-tools",children:["Tools: ",f.allowedTools.length>0?f.allowedTools.join(", "):"None"]})]},f.actorId))}),o&&a.jsx("div",{className:"modal-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"modal-content",onClick:f=>f.stopPropagation(),children:[a.jsx("h2",{children:"Create Agent"}),a.jsxs("form",{onSubmit:c,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"slug",children:"Slug"}),a.jsx("input",{type:"text",id:"slug",value:l.slug,onChange:f=>u({...l,slug:f.target.value}),placeholder:"e.g., code-assistant",required:!0}),a.jsx("small",{children:"Unique identifier (lowercase, hyphens allowed)"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"name",children:"Name"}),a.jsx("input",{type:"text",id:"name",value:l.name,onChange:f=>u({...l,name:f.target.value}),placeholder:"e.g., Code Assistant",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"description",children:"Description"}),a.jsx("textarea",{id:"description",value:l.description,onChange:f=>u({...l,description:f.target.value}),placeholder:"Brief description of this agent",rows:2})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"systemPrompt",children:"System Prompt"}),a.jsx("textarea",{id:"systemPrompt",value:l.systemPrompt,onChange:f=>u({...l,systemPrompt:f.target.value}),placeholder:"Core instructions/persona for this agent",rows:5,required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"allowedTools",children:"Allowed Tools"}),a.jsx("input",{type:"text",id:"allowedTools",value:l.allowedTools,onChange:f=>u({...l,allowedTools:f.target.value}),placeholder:"e.g., filesystem, browser, calculator (comma-separated)"}),a.jsx("small",{children:"Comma-separated list of tool identifiers"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"statusTriggers",children:"Status triggers"}),a.jsx("input",{type:"text",id:"statusTriggers",value:l.statusTriggers,onChange:f=>u({...l,statusTriggers:f.target.value}),placeholder:"e.g., NOT_STARTED, IN_PROGRESS, FOR_REVIEW, DONE (comma-separated)"}),a.jsx("small",{children:"Comma-separated list of tool identifiers"})]}),a.jsx("div",{className:"form-group",children:a.jsxs("label",{className:"checkbox-label",children:[a.jsx("input",{type:"checkbox",checked:l.isActive,onChange:f=>u({...l,isActive:f.target.checked})}),a.jsx("span",{children:"Active (available for assignment)"})]})}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>s(!1),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Create Agent"})]})]})]})})]})}function n_(){var g;const{agentId:e}=fr(),t=Oe(),{selectedAgent:n,isLoading:r,error:i,loadAgentDetails:o}=rd(),[s,l]=k.useState(!1),[u,c]=k.useState(null),[f,d]=k.useState({slug:"",name:"",description:"",systemPrompt:"",allowedTools:"",isActive:!0});k.useEffect(()=>{e&&o(e)},[e]),k.useEffect(()=>{var v;n&&d({slug:n.slug,name:n.name,description:((v=n.description)==null?void 0:v.toString())||"",systemPrompt:n.systemPrompt,allowedTools:n.allowedTools.join(", "),isActive:n.isActive})},[n]);const h=async v=>{if(v.preventDefault(),!!e)try{throw new Error("update agent not implemented in the backend")}catch(S){console.error("Failed to update agent",S)}},p=async()=>{e&&c({message:"Are you sure you want to delete this agent? This action cannot be undone.",onConfirm:async()=>{try{throw new Error("delete agent not implemented in the backend")}catch(v){console.error("Failed to delete agent",v),c(null)}}})};return r&&!n?a.jsx("div",{className:"loading",children:"Loading agent details..."}):n?(console.log(n.statusTriggers),a.jsxs("div",{className:"agent-admin-detail",children:[a.jsxs("div",{className:"agent-admin-detail-header",children:[a.jsxs("div",{children:[a.jsx("button",{onClick:()=>t("/agents/admin"),className:"btn-back",children:"← Back to Agents"}),a.jsx("h1",{children:n.name}),a.jsxs("p",{className:"agent-slug",children:["@",n.slug]}),a.jsx("span",{className:`agent-status ${n.isActive?"active":"inactive"}`,children:n.isActive?"Active":"Inactive"})]}),a.jsx("div",{className:"header-actions",children:s?a.jsx("button",{onClick:()=>l(!1),className:"btn-secondary",children:"Cancel Edit"}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>l(!0),className:"btn-secondary",children:"Edit Agent"}),a.jsx("button",{onClick:p,className:"btn-delete",children:"Delete Agent"})]})})]}),i&&a.jsx("div",{className:"error-message",children:i}),s?a.jsxs("form",{onSubmit:h,className:"agent-edit-form",children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"slug",children:"Slug"}),a.jsx("input",{type:"text",id:"slug",value:f.slug,onChange:v=>d({...f,slug:v.target.value}),placeholder:"e.g., code-assistant",required:!0}),a.jsx("small",{children:"Unique identifier (lowercase, hyphens allowed)"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"name",children:"Name"}),a.jsx("input",{type:"text",id:"name",value:f.name,onChange:v=>d({...f,name:v.target.value}),placeholder:"e.g., Code Assistant",required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"description",children:"Description"}),a.jsx("textarea",{id:"description",value:f.description,onChange:v=>d({...f,description:v.target.value}),placeholder:"Brief description of this agent",rows:2})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"systemPrompt",children:"System Prompt"}),a.jsx("textarea",{id:"systemPrompt",value:f.systemPrompt,onChange:v=>d({...f,systemPrompt:v.target.value}),placeholder:"Core instructions/persona for this agent",rows:10,required:!0})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"allowedTools",children:"Allowed Tools"}),a.jsx("input",{type:"text",id:"allowedTools",value:f.allowedTools,onChange:v=>d({...f,allowedTools:v.target.value}),placeholder:"e.g., filesystem, browser, calculator (comma-separated)"}),a.jsx("small",{children:"Comma-separated list of tool identifiers"})]}),a.jsx("div",{className:"form-group",children:a.jsxs("label",{className:"checkbox-label",children:[a.jsx("input",{type:"checkbox",checked:f.isActive,onChange:v=>d({...f,isActive:v.target.checked})}),a.jsx("span",{children:"Active (available for assignment)"})]})}),a.jsxs("div",{className:"form-actions",children:[a.jsx("button",{type:"button",onClick:()=>l(!1),className:"btn-secondary",children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Save Changes"})]})]}):a.jsxs("div",{className:"agent-detail-sections",children:[a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Basic Information"}),a.jsxs("div",{className:"detail-content",children:[a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Name"}),a.jsx("p",{children:n.name})]}),a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Slug"}),a.jsxs("p",{children:["@",n.slug]})]}),a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Description"}),a.jsx("p",{children:((g=n.description)==null?void 0:g.toString())||"No description"})]}),a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Status"}),a.jsx("p",{children:n.isActive?"Active":"Inactive"})]})]})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"System Prompt"}),a.jsx("div",{className:"detail-content",children:a.jsx("pre",{className:"system-prompt-display",children:n.systemPrompt})})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Status Triggers"}),a.jsx("div",{className:"detail-content",children:n.statusTriggers.length>0?a.jsx("div",{className:"tools-list",children:n.statusTriggers.map((v,S)=>a.jsx("span",{className:"tool-badge",children:v},S))}):a.jsx("p",{className:"empty-text",children:"No status triggers configured"})})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Tag Triggers"}),a.jsx("div",{className:"detail-content",children:n.tagTriggers.length>0?a.jsx("div",{className:"tools-list",children:n.tagTriggers.map((v,S)=>a.jsx("span",{className:"tool-badge",children:v},S))}):a.jsx("p",{className:"empty-text",children:"No tag triggers configured"})})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Allowed Tools"}),a.jsx("div",{className:"detail-content",children:n.allowedTools.length>0?a.jsx("div",{className:"tools-list",children:n.allowedTools.map((v,S)=>a.jsx("span",{className:"tool-badge",children:v},S))}):a.jsx("p",{className:"empty-text",children:"No tools configured"})})]}),a.jsxs("div",{className:"detail-section",children:[a.jsx("h2",{children:"Metadata"}),a.jsxs("div",{className:"detail-content",children:[a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Created At"}),a.jsx("p",{children:new Date(n.createdAt).toLocaleString()})]}),a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Last Updated"}),a.jsx("p",{children:new Date(n.updatedAt).toLocaleString()})]}),a.jsxs("div",{className:"detail-field",children:[a.jsx("label",{children:"Row Version"}),a.jsx("p",{children:n.rowVersion})]})]})]})]}),u&&a.jsx(nd,{message:u.message,onConfirm:u.onConfirm,onCancel:()=>c(null)})]})):a.jsx("div",{className:"error-message",children:"Agent not found"})}function r_(){const{logout:e}=Ic(),t=Oe();return pt(),k.useEffect(()=>{(async()=>{await e(),t("/login",{replace:!0})})()},[e,t]),a.jsx("div",{className:"logout-page",children:a.jsx("div",{className:"logout-container",children:a.jsx("div",{className:"logout-card",children:a.jsxs("div",{className:"logout-header",children:[a.jsx("h1",{className:"logout-title",children:"Logging Out..."}),a.jsx("p",{className:"logout-subtitle",children:"You are being logged out. Please wait."})]})})})})}function i_(){return D1()?a.jsx(z0,{}):a.jsx(L0,{})}function o_(){return a.jsx(i1,{basename:p1,children:a.jsx(_1,{children:a.jsxs(Pw,{children:[a.jsx(je,{path:"/login",element:a.jsx(A1,{})}),a.jsx(je,{path:"/logout",element:a.jsx(r_,{})}),a.jsxs(je,{element:a.jsx(I1,{children:a.jsx(L1,{})}),children:[a.jsx(je,{index:!0,element:a.jsx(O1,{})}),a.jsx(je,{path:"tasks",element:a.jsx(i_,{})}),a.jsx(je,{path:"mcp-registry",element:a.jsx(Qj,{})}),a.jsx(je,{path:"mcp-registry/:serverId",element:a.jsx(Xj,{})}),a.jsx(je,{path:"consent",element:a.jsx(Jj,{})}),a.jsxs(je,{path:"context",element:a.jsx(H0,{}),children:[a.jsx(je,{index:!0,element:a.jsx(W0,{})}),a.jsx(je,{path:"new",element:a.jsx(Bh,{})}),a.jsx(je,{path:"page/:pageId",element:a.jsx(Gj,{})}),a.jsx(je,{path:"page/:pageId/edit",element:a.jsx(Kj,{})}),a.jsx(je,{path:"page/:pageId/new",element:a.jsx(Bh,{})})]}),a.jsxs(je,{path:"agents",element:a.jsx(Zj,{}),children:[a.jsx(je,{index:!0,element:a.jsx(e_,{})}),a.jsx(je,{path:"admin",element:a.jsx(t_,{})}),a.jsx(je,{path:":agentId/admin",element:a.jsx(n_,{})})]})]})]})})})}ng(document.getElementById("root")).render(a.jsx(k.StrictMode,{children:a.jsx("div",{className:"app-shell",children:a.jsx(o_,{})})}));