@graychennpm/codebridge 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +217 -2
  4. package/README.zh-CN.md +222 -0
  5. package/apps/web/public/brand/agent-logo-carbon.svg +1 -0
  6. package/apps/web/public/brand/agent-logo.svg +1 -0
  7. package/docs/zh-CN/npm-release.md +77 -0
  8. package/node_modules/@codebridge/agent-registry/dist/index.d.ts +32 -0
  9. package/node_modules/@codebridge/agent-registry/dist/index.js +177 -0
  10. package/node_modules/@codebridge/agent-registry/dist/setup.d.ts +9 -0
  11. package/node_modules/@codebridge/agent-registry/dist/setup.js +115 -0
  12. package/node_modules/@codebridge/agent-registry/package.json +17 -0
  13. package/node_modules/@codebridge/backends/dist/acp/acp-active-session.d.ts +12 -0
  14. package/node_modules/@codebridge/backends/dist/acp/acp-active-session.js +57 -0
  15. package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.d.ts +9 -0
  16. package/node_modules/@codebridge/backends/dist/acp/acp-claude-activity.js +49 -0
  17. package/node_modules/@codebridge/backends/dist/acp/acp-config-options.d.ts +46 -0
  18. package/node_modules/@codebridge/backends/dist/acp/acp-config-options.js +220 -0
  19. package/node_modules/@codebridge/backends/dist/acp/acp-doctor.d.ts +3 -0
  20. package/node_modules/@codebridge/backends/dist/acp/acp-doctor.js +18 -0
  21. package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.d.ts +5 -0
  22. package/node_modules/@codebridge/backends/dist/acp/acp-event-mapper.js +136 -0
  23. package/node_modules/@codebridge/backends/dist/acp/acp-kill.d.ts +10 -0
  24. package/node_modules/@codebridge/backends/dist/acp/acp-kill.js +24 -0
  25. package/node_modules/@codebridge/backends/dist/acp/acp-race.d.ts +6 -0
  26. package/node_modules/@codebridge/backends/dist/acp/acp-race.js +29 -0
  27. package/node_modules/@codebridge/backends/dist/acp/acp-session-list.d.ts +32 -0
  28. package/node_modules/@codebridge/backends/dist/acp/acp-session-list.js +218 -0
  29. package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.d.ts +85 -0
  30. package/node_modules/@codebridge/backends/dist/acp/acp-session-pool.js +165 -0
  31. package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.d.ts +78 -0
  32. package/node_modules/@codebridge/backends/dist/acp/acp-session-runner.js +550 -0
  33. package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.d.ts +9 -0
  34. package/node_modules/@codebridge/backends/dist/acp/acp-spawn-profiles.js +28 -0
  35. package/node_modules/@codebridge/backends/dist/acp/headless-client.d.ts +19 -0
  36. package/node_modules/@codebridge/backends/dist/acp/headless-client.js +47 -0
  37. package/node_modules/@codebridge/backends/dist/acp/index.d.ts +9 -0
  38. package/node_modules/@codebridge/backends/dist/acp/index.js +9 -0
  39. package/node_modules/@codebridge/backends/dist/agent-setup.d.ts +60 -0
  40. package/node_modules/@codebridge/backends/dist/agent-setup.js +504 -0
  41. package/node_modules/@codebridge/backends/dist/attachment-prompt.d.ts +8 -0
  42. package/node_modules/@codebridge/backends/dist/attachment-prompt.js +28 -0
  43. package/node_modules/@codebridge/backends/dist/auth-error-hints.d.ts +8 -0
  44. package/node_modules/@codebridge/backends/dist/auth-error-hints.js +33 -0
  45. package/node_modules/@codebridge/backends/dist/codex-skill-commands.d.ts +3 -0
  46. package/node_modules/@codebridge/backends/dist/codex-skill-commands.js +88 -0
  47. package/node_modules/@codebridge/backends/dist/index.d.ts +18 -0
  48. package/node_modules/@codebridge/backends/dist/index.js +34 -0
  49. package/node_modules/@codebridge/backends/dist/pi-providers.d.ts +45 -0
  50. package/node_modules/@codebridge/backends/dist/pi-providers.js +148 -0
  51. package/node_modules/@codebridge/backends/dist/pi-session-runner.d.ts +85 -0
  52. package/node_modules/@codebridge/backends/dist/pi-session-runner.js +460 -0
  53. package/node_modules/@codebridge/backends/dist/provider-connection.d.ts +17 -0
  54. package/node_modules/@codebridge/backends/dist/provider-connection.js +99 -0
  55. package/node_modules/@codebridge/backends/dist/session-discovery.d.ts +23 -0
  56. package/node_modules/@codebridge/backends/dist/session-discovery.js +340 -0
  57. package/node_modules/@codebridge/backends/dist/skill-control-plane.d.ts +147 -0
  58. package/node_modules/@codebridge/backends/dist/skill-control-plane.js +832 -0
  59. package/node_modules/@codebridge/backends/package.json +22 -0
  60. package/node_modules/@codebridge/bridge/dist/alert-notification-rules.d.ts +14 -0
  61. package/node_modules/@codebridge/bridge/dist/alert-notification-rules.js +37 -0
  62. package/node_modules/@codebridge/bridge/dist/channel-config.d.ts +4 -0
  63. package/node_modules/@codebridge/bridge/dist/channel-config.js +9 -0
  64. package/node_modules/@codebridge/bridge/dist/channel-ingress.d.ts +5 -0
  65. package/node_modules/@codebridge/bridge/dist/channel-ingress.js +403 -0
  66. package/node_modules/@codebridge/bridge/dist/cli.d.ts +3 -0
  67. package/node_modules/@codebridge/bridge/dist/cli.js +581 -0
  68. package/node_modules/@codebridge/bridge/dist/deployment.d.ts +46 -0
  69. package/node_modules/@codebridge/bridge/dist/deployment.js +174 -0
  70. package/node_modules/@codebridge/bridge/dist/event-loop-lag.d.ts +19 -0
  71. package/node_modules/@codebridge/bridge/dist/event-loop-lag.js +33 -0
  72. package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.d.ts +70 -0
  73. package/node_modules/@codebridge/bridge/dist/feishu-alert-monitor.js +591 -0
  74. package/node_modules/@codebridge/bridge/dist/init-wizard.d.ts +52 -0
  75. package/node_modules/@codebridge/bridge/dist/init-wizard.js +571 -0
  76. package/node_modules/@codebridge/bridge/dist/mcp-api.d.ts +4 -0
  77. package/node_modules/@codebridge/bridge/dist/mcp-api.js +100 -0
  78. package/node_modules/@codebridge/bridge/dist/outbound-api.d.ts +31 -0
  79. package/node_modules/@codebridge/bridge/dist/outbound-api.js +184 -0
  80. package/node_modules/@codebridge/bridge/dist/outbound-publishers.d.ts +54 -0
  81. package/node_modules/@codebridge/bridge/dist/outbound-publishers.js +213 -0
  82. package/node_modules/@codebridge/bridge/dist/project-api.d.ts +4 -0
  83. package/node_modules/@codebridge/bridge/dist/project-api.js +161 -0
  84. package/node_modules/@codebridge/bridge/dist/secrets-command.d.ts +13 -0
  85. package/node_modules/@codebridge/bridge/dist/secrets-command.js +34 -0
  86. package/node_modules/@codebridge/bridge/dist/session-api.d.ts +26 -0
  87. package/node_modules/@codebridge/bridge/dist/session-api.js +1378 -0
  88. package/node_modules/@codebridge/bridge/dist/session-history-import.d.ts +24 -0
  89. package/node_modules/@codebridge/bridge/dist/session-history-import.js +82 -0
  90. package/node_modules/@codebridge/bridge/dist/session-runtime-api.d.ts +19 -0
  91. package/node_modules/@codebridge/bridge/dist/session-runtime-api.js +453 -0
  92. package/node_modules/@codebridge/bridge/dist/session-runtime-migration.d.ts +21 -0
  93. package/node_modules/@codebridge/bridge/dist/session-runtime-migration.js +43 -0
  94. package/node_modules/@codebridge/bridge/dist/session-runtime-types.d.ts +85 -0
  95. package/node_modules/@codebridge/bridge/dist/session-runtime-types.js +98 -0
  96. package/node_modules/@codebridge/bridge/dist/skill-api.d.ts +28 -0
  97. package/node_modules/@codebridge/bridge/dist/skill-api.js +129 -0
  98. package/node_modules/@codebridge/bridge/dist/startup-surfaces.d.ts +15 -0
  99. package/node_modules/@codebridge/bridge/dist/startup-surfaces.js +13 -0
  100. package/node_modules/@codebridge/bridge/dist/web-frontend.d.ts +8 -0
  101. package/node_modules/@codebridge/bridge/dist/web-frontend.js +76 -0
  102. package/node_modules/@codebridge/bridge/dist/work-item-api.d.ts +6 -0
  103. package/node_modules/@codebridge/bridge/dist/work-item-api.js +414 -0
  104. package/node_modules/@codebridge/bridge/package.json +28 -0
  105. package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.d.ts +6 -0
  106. package/node_modules/@codebridge/channel-feishu/dist/alert-reactions.js +58 -0
  107. package/node_modules/@codebridge/channel-feishu/dist/alert-types.d.ts +35 -0
  108. package/node_modules/@codebridge/channel-feishu/dist/alert-types.js +2 -0
  109. package/node_modules/@codebridge/channel-feishu/dist/bridge.d.ts +130 -0
  110. package/node_modules/@codebridge/channel-feishu/dist/bridge.js +1231 -0
  111. package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.d.ts +48 -0
  112. package/node_modules/@codebridge/channel-feishu/dist/cardkit-writer.js +153 -0
  113. package/node_modules/@codebridge/channel-feishu/dist/chain-topics.d.ts +20 -0
  114. package/node_modules/@codebridge/channel-feishu/dist/chain-topics.js +35 -0
  115. package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.d.ts +12 -0
  116. package/node_modules/@codebridge/channel-feishu/dist/coalescing-card-writer.js +53 -0
  117. package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.d.ts +19 -0
  118. package/node_modules/@codebridge/channel-feishu/dist/delivery-reconciler.js +53 -0
  119. package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.d.ts +19 -0
  120. package/node_modules/@codebridge/channel-feishu/dist/durable-markdown-card.js +77 -0
  121. package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.d.ts +27 -0
  122. package/node_modules/@codebridge/channel-feishu/dist/feishu-extra-events.js +24 -0
  123. package/node_modules/@codebridge/channel-feishu/dist/feishu-http.d.ts +4 -0
  124. package/node_modules/@codebridge/channel-feishu/dist/feishu-http.js +25 -0
  125. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.d.ts +13 -0
  126. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-context.js +45 -0
  127. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.d.ts +22 -0
  128. package/node_modules/@codebridge/channel-feishu/dist/feishu-inbound-media.js +273 -0
  129. package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.d.ts +13 -0
  130. package/node_modules/@codebridge/channel-feishu/dist/feishu-mention-gate.js +22 -0
  131. package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.d.ts +12 -0
  132. package/node_modules/@codebridge/channel-feishu/dist/feishu-outbound-file.js +38 -0
  133. package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.d.ts +30 -0
  134. package/node_modules/@codebridge/channel-feishu/dist/feishu-quoted-message.js +183 -0
  135. package/node_modules/@codebridge/channel-feishu/dist/index.d.ts +7 -0
  136. package/node_modules/@codebridge/channel-feishu/dist/index.js +3 -0
  137. package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.d.ts +17 -0
  138. package/node_modules/@codebridge/channel-feishu/dist/redacting-logger.js +41 -0
  139. package/node_modules/@codebridge/channel-feishu/dist/run-status.d.ts +39 -0
  140. package/node_modules/@codebridge/channel-feishu/dist/run-status.js +166 -0
  141. package/node_modules/@codebridge/channel-feishu/dist/session-watcher.d.ts +98 -0
  142. package/node_modules/@codebridge/channel-feishu/dist/session-watcher.js +655 -0
  143. package/node_modules/@codebridge/channel-feishu/package.json +19 -0
  144. package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.d.ts +14 -0
  145. package/node_modules/@codebridge/channel-telegram/dist/coalescing-message-writer.js +56 -0
  146. package/node_modules/@codebridge/channel-telegram/dist/index.d.ts +3 -0
  147. package/node_modules/@codebridge/channel-telegram/dist/index.js +3 -0
  148. package/node_modules/@codebridge/channel-telegram/dist/telegram-api.d.ts +62 -0
  149. package/node_modules/@codebridge/channel-telegram/dist/telegram-api.js +72 -0
  150. package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.d.ts +64 -0
  151. package/node_modules/@codebridge/channel-telegram/dist/telegram-bridge.js +469 -0
  152. package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.d.ts +41 -0
  153. package/node_modules/@codebridge/channel-telegram/dist/telegram-session-watcher.js +184 -0
  154. package/node_modules/@codebridge/channel-telegram/package.json +18 -0
  155. package/node_modules/@codebridge/core/dist/config-schema.d.ts +1195 -0
  156. package/node_modules/@codebridge/core/dist/config-schema.js +293 -0
  157. package/node_modules/@codebridge/core/dist/config-store.d.ts +48 -0
  158. package/node_modules/@codebridge/core/dist/config-store.js +207 -0
  159. package/node_modules/@codebridge/core/dist/index.d.ts +11 -0
  160. package/node_modules/@codebridge/core/dist/index.js +10 -0
  161. package/node_modules/@codebridge/core/dist/json-file-store.d.ts +16 -0
  162. package/node_modules/@codebridge/core/dist/json-file-store.js +46 -0
  163. package/node_modules/@codebridge/core/dist/mcp-types.d.ts +7 -0
  164. package/node_modules/@codebridge/core/dist/mcp-types.js +2 -0
  165. package/node_modules/@codebridge/core/dist/mentions.d.ts +36 -0
  166. package/node_modules/@codebridge/core/dist/mentions.js +138 -0
  167. package/node_modules/@codebridge/core/dist/secret-migration.d.ts +14 -0
  168. package/node_modules/@codebridge/core/dist/secret-migration.js +55 -0
  169. package/node_modules/@codebridge/core/dist/secret-refs.d.ts +34 -0
  170. package/node_modules/@codebridge/core/dist/secret-refs.js +142 -0
  171. package/node_modules/@codebridge/core/dist/session-event-wire.d.ts +17 -0
  172. package/node_modules/@codebridge/core/dist/session-event-wire.js +28 -0
  173. package/node_modules/@codebridge/core/dist/types.d.ts +363 -0
  174. package/node_modules/@codebridge/core/dist/types.js +22 -0
  175. package/node_modules/@codebridge/core/dist/workspace-key.d.ts +11 -0
  176. package/node_modules/@codebridge/core/dist/workspace-key.js +25 -0
  177. package/node_modules/@codebridge/core/package.json +22 -0
  178. package/node_modules/@codebridge/mcp-runtime/dist/.tsbuildinfo +1 -0
  179. package/node_modules/@codebridge/mcp-runtime/dist/index.d.ts +92 -0
  180. package/node_modules/@codebridge/mcp-runtime/dist/index.js +377 -0
  181. package/node_modules/@codebridge/mcp-runtime/package.json +19 -0
  182. package/node_modules/@codebridge/policy/dist/capability-runtime.d.ts +123 -0
  183. package/node_modules/@codebridge/policy/dist/capability-runtime.js +195 -0
  184. package/node_modules/@codebridge/policy/dist/demo-capabilities.d.ts +4 -0
  185. package/node_modules/@codebridge/policy/dist/demo-capabilities.js +134 -0
  186. package/node_modules/@codebridge/policy/dist/equity-capabilities.d.ts +8 -0
  187. package/node_modules/@codebridge/policy/dist/equity-capabilities.js +35 -0
  188. package/node_modules/@codebridge/policy/dist/index.d.ts +107 -0
  189. package/node_modules/@codebridge/policy/dist/index.js +317 -0
  190. package/node_modules/@codebridge/policy/package.json +17 -0
  191. package/node_modules/@codebridge/project-catalog/dist/index.d.ts +145 -0
  192. package/node_modules/@codebridge/project-catalog/dist/index.js +699 -0
  193. package/node_modules/@codebridge/project-catalog/package.json +18 -0
  194. package/node_modules/@codebridge/router/dist/channel-stream-projector.d.ts +19 -0
  195. package/node_modules/@codebridge/router/dist/channel-stream-projector.js +68 -0
  196. package/node_modules/@codebridge/router/dist/command-help.d.ts +14 -0
  197. package/node_modules/@codebridge/router/dist/command-help.js +151 -0
  198. package/node_modules/@codebridge/router/dist/feishu-stream-presenter.d.ts +18 -0
  199. package/node_modules/@codebridge/router/dist/feishu-stream-presenter.js +193 -0
  200. package/node_modules/@codebridge/router/dist/index.d.ts +9 -0
  201. package/node_modules/@codebridge/router/dist/index.js +9 -0
  202. package/node_modules/@codebridge/router/dist/model-effort.d.ts +5 -0
  203. package/node_modules/@codebridge/router/dist/model-effort.js +33 -0
  204. package/node_modules/@codebridge/router/dist/orchestrator.d.ts +56 -0
  205. package/node_modules/@codebridge/router/dist/orchestrator.js +290 -0
  206. package/node_modules/@codebridge/router/dist/session-list-format.d.ts +19 -0
  207. package/node_modules/@codebridge/router/dist/session-list-format.js +97 -0
  208. package/node_modules/@codebridge/router/dist/session-rotation.d.ts +9 -0
  209. package/node_modules/@codebridge/router/dist/session-rotation.js +31 -0
  210. package/node_modules/@codebridge/router/dist/session-router.d.ts +59 -0
  211. package/node_modules/@codebridge/router/dist/session-router.js +182 -0
  212. package/node_modules/@codebridge/router/dist/slash-commands.d.ts +78 -0
  213. package/node_modules/@codebridge/router/dist/slash-commands.js +874 -0
  214. package/node_modules/@codebridge/router/package.json +18 -0
  215. package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.d.ts +18 -0
  216. package/node_modules/@codebridge/run-executor/dist/agent-event-aggregator.js +88 -0
  217. package/node_modules/@codebridge/run-executor/dist/index.d.ts +55 -0
  218. package/node_modules/@codebridge/run-executor/dist/index.js +754 -0
  219. package/node_modules/@codebridge/run-executor/dist/run-heartbeat.d.ts +14 -0
  220. package/node_modules/@codebridge/run-executor/dist/run-heartbeat.js +24 -0
  221. package/node_modules/@codebridge/run-executor/package.json +20 -0
  222. package/node_modules/@codebridge/runner-client/dist/index.d.ts +142 -0
  223. package/node_modules/@codebridge/runner-client/dist/index.js +439 -0
  224. package/node_modules/@codebridge/runner-client/package.json +18 -0
  225. package/node_modules/@codebridge/runner-host/dist/cli.d.ts +3 -0
  226. package/node_modules/@codebridge/runner-host/dist/cli.js +58 -0
  227. package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.d.ts +13 -0
  228. package/node_modules/@codebridge/runner-host/dist/codex-session-ownership.js +79 -0
  229. package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.d.ts +10 -0
  230. package/node_modules/@codebridge/runner-host/dist/deployment-mcp-server.js +54 -0
  231. package/node_modules/@codebridge/runner-host/dist/fcb-script.d.ts +3 -0
  232. package/node_modules/@codebridge/runner-host/dist/fcb-script.js +99 -0
  233. package/node_modules/@codebridge/runner-host/dist/index.d.ts +3 -0
  234. package/node_modules/@codebridge/runner-host/dist/index.js +2 -0
  235. package/node_modules/@codebridge/runner-host/dist/materialize-attachments.d.ts +4 -0
  236. package/node_modules/@codebridge/runner-host/dist/materialize-attachments.js +62 -0
  237. package/node_modules/@codebridge/runner-host/dist/server.d.ts +150 -0
  238. package/node_modules/@codebridge/runner-host/dist/server.js +1295 -0
  239. package/node_modules/@codebridge/runner-host/dist/session-lease.d.ts +12 -0
  240. package/node_modules/@codebridge/runner-host/dist/session-lease.js +146 -0
  241. package/node_modules/@codebridge/runner-host/package.json +26 -0
  242. package/node_modules/@codebridge/session-catalog/dist/index.d.ts +124 -0
  243. package/node_modules/@codebridge/session-catalog/dist/index.js +411 -0
  244. package/node_modules/@codebridge/session-catalog/package.json +17 -0
  245. package/node_modules/@codebridge/session-coordinator/dist/coordinator.d.ts +111 -0
  246. package/node_modules/@codebridge/session-coordinator/dist/coordinator.js +364 -0
  247. package/node_modules/@codebridge/session-coordinator/dist/index.d.ts +5 -0
  248. package/node_modules/@codebridge/session-coordinator/dist/index.js +5 -0
  249. package/node_modules/@codebridge/session-coordinator/dist/lease.d.ts +14 -0
  250. package/node_modules/@codebridge/session-coordinator/dist/lease.js +26 -0
  251. package/node_modules/@codebridge/session-coordinator/dist/queued-claim.d.ts +20 -0
  252. package/node_modules/@codebridge/session-coordinator/dist/queued-claim.js +45 -0
  253. package/node_modules/@codebridge/session-coordinator/dist/recovery.d.ts +31 -0
  254. package/node_modules/@codebridge/session-coordinator/dist/recovery.js +114 -0
  255. package/node_modules/@codebridge/session-coordinator/package.json +17 -0
  256. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  257. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  258. package/node_modules/@codebridge/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  259. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  260. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  261. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  262. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  263. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  264. package/node_modules/@codebridge/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  265. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  266. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  267. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  268. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  269. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  270. package/node_modules/@codebridge/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  271. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  272. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  273. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  274. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  275. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  276. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  277. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  278. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  279. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  280. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  281. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  282. package/node_modules/@codebridge/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  283. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  284. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  285. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  286. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  287. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  288. package/node_modules/@codebridge/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  289. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  290. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  291. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  292. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  293. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  294. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  295. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  296. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  297. package/node_modules/@codebridge/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  298. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  299. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  300. package/node_modules/@codebridge/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  301. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  302. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  303. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  304. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  305. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  306. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  307. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  308. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  309. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  310. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  311. package/node_modules/@codebridge/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  312. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  313. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  314. package/node_modules/@codebridge/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  315. package/node_modules/@codebridge/web/dist/assets/abnfDiagram-N423BO3Z-C-JdFv0U.js +1 -0
  316. package/node_modules/@codebridge/web/dist/assets/arc-DsNROjzU.js +1 -0
  317. package/node_modules/@codebridge/web/dist/assets/architecture-TIHT7OUA-ZEBHG2JZ.js +1 -0
  318. package/node_modules/@codebridge/web/dist/assets/architectureDiagram-T3A2C74G-OsrxcwPM.js +36 -0
  319. package/node_modules/@codebridge/web/dist/assets/array-BifhSqXX.js +1 -0
  320. package/node_modules/@codebridge/web/dist/assets/blockDiagram-VBNYF7ZC-DRgfNeNW.js +132 -0
  321. package/node_modules/@codebridge/web/dist/assets/c4Diagram-5PPSVZJV-BtOGKTh8.js +10 -0
  322. package/node_modules/@codebridge/web/dist/assets/channel-MhXyjxUS.js +1 -0
  323. package/node_modules/@codebridge/web/dist/assets/chunk-2GRJ4B5K-Dy1gJ7sY.js +1 -0
  324. package/node_modules/@codebridge/web/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  325. package/node_modules/@codebridge/web/dist/assets/chunk-4I5QYGJK-1pOLR_SG.js +1 -0
  326. package/node_modules/@codebridge/web/dist/assets/chunk-5RXB4S5H-CP43rgsO.js +231 -0
  327. package/node_modules/@codebridge/web/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
  328. package/node_modules/@codebridge/web/dist/assets/chunk-6Q2QTUOP-Bi3Xrp6W.js +88 -0
  329. package/node_modules/@codebridge/web/dist/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  330. package/node_modules/@codebridge/web/dist/assets/chunk-7Z6QIM7H-CILAW2Nk.js +10 -0
  331. package/node_modules/@codebridge/web/dist/assets/chunk-GF5L2VYU-CAp09yhq.js +206 -0
  332. package/node_modules/@codebridge/web/dist/assets/chunk-I66GZJ75-B_rJXmNu.js +128 -0
  333. package/node_modules/@codebridge/web/dist/assets/chunk-JQJVKLGR-OVeOJFCx.js +156 -0
  334. package/node_modules/@codebridge/web/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  335. package/node_modules/@codebridge/web/dist/assets/chunk-KBJHAD2P-uaupp0k5.js +1 -0
  336. package/node_modules/@codebridge/web/dist/assets/chunk-KEIR6QF5-BICK3FdT.js +161 -0
  337. package/node_modules/@codebridge/web/dist/assets/chunk-NSK5VX7P-fIHF5wwn.js +2 -0
  338. package/node_modules/@codebridge/web/dist/assets/chunk-QR6OTTB3-DxkJuF2b.js +62 -0
  339. package/node_modules/@codebridge/web/dist/assets/chunk-RYQCIY6F-CC5j3u-X.js +1 -0
  340. package/node_modules/@codebridge/web/dist/assets/chunk-UBXNYLIW-DB35O-6R.js +1 -0
  341. package/node_modules/@codebridge/web/dist/assets/chunk-W5SLKNZC-bkRBsbq-.js +1 -0
  342. package/node_modules/@codebridge/web/dist/assets/chunk-WRU74C26-DwvEoD-1.js +70 -0
  343. package/node_modules/@codebridge/web/dist/assets/chunk-XXDRQBXY-DRyYA-HY.js +1 -0
  344. package/node_modules/@codebridge/web/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  345. package/node_modules/@codebridge/web/dist/assets/classDiagram-JCYQIIEL-B8r7z8ii.js +1 -0
  346. package/node_modules/@codebridge/web/dist/assets/classDiagram-v2-OCEON4UE-B8r7z8ii.js +1 -0
  347. package/node_modules/@codebridge/web/dist/assets/cose-bilkent-JH36ORCC-CLkwlrX7.js +1 -0
  348. package/node_modules/@codebridge/web/dist/assets/cynefin-VYW2F7L2-C3_Llw02.js +1 -0
  349. package/node_modules/@codebridge/web/dist/assets/cynefinDiagram-MW4NZA55-D5v7UnJy.js +62 -0
  350. package/node_modules/@codebridge/web/dist/assets/cytoscape.esm-B-NFISlW.js +321 -0
  351. package/node_modules/@codebridge/web/dist/assets/dagre-Buvkdvvj.js +1 -0
  352. package/node_modules/@codebridge/web/dist/assets/dagre-VZM6K2ZE-Cr0IibwW.js +4 -0
  353. package/node_modules/@codebridge/web/dist/assets/defaultLocale-BFoDCU3G.js +1 -0
  354. package/node_modules/@codebridge/web/dist/assets/diagram-7IWD3JNH-CpQXDIzA.js +30 -0
  355. package/node_modules/@codebridge/web/dist/assets/diagram-B4RE2ZJO-VaOkH0Ya.js +3 -0
  356. package/node_modules/@codebridge/web/dist/assets/diagram-LBJQPF4R-D0iXyNks.js +24 -0
  357. package/node_modules/@codebridge/web/dist/assets/diagram-Q27KOJAE-CtqYk01P.js +24 -0
  358. package/node_modules/@codebridge/web/dist/assets/diagram-UB23O5K3-CFnd3H1_.js +41 -0
  359. package/node_modules/@codebridge/web/dist/assets/dist-D2L7nRdk.js +1 -0
  360. package/node_modules/@codebridge/web/dist/assets/ebnfDiagram-BXEA7PRR-B0GIbJYt.js +1 -0
  361. package/node_modules/@codebridge/web/dist/assets/erDiagram-JOGREHBK-BApaLGVA.js +85 -0
  362. package/node_modules/@codebridge/web/dist/assets/eventmodeling-45OFAUF4-DqGGjcld.js +1 -0
  363. package/node_modules/@codebridge/web/dist/assets/flowDiagram-UKHOOZJN-I_qlizLH.js +1 -0
  364. package/node_modules/@codebridge/web/dist/assets/ganttDiagram-PKOTCBZU-B-QZ-J82.js +292 -0
  365. package/node_modules/@codebridge/web/dist/assets/gitGraph-TEB2WS4Q-DK2SJ2Ne.js +1 -0
  366. package/node_modules/@codebridge/web/dist/assets/gitGraphDiagram-DS77QQ5N-B6Z-pu0D.js +106 -0
  367. package/node_modules/@codebridge/web/dist/assets/graphlib-DS17s2tU.js +1 -0
  368. package/node_modules/@codebridge/web/dist/assets/index-8BzpyygS.js +559 -0
  369. package/node_modules/@codebridge/web/dist/assets/index-Bzaz89LE.css +1 -0
  370. package/node_modules/@codebridge/web/dist/assets/info-DKCQHKI2-CGWxt_Py.js +1 -0
  371. package/node_modules/@codebridge/web/dist/assets/infoDiagram-6WML65LV-77XjrPZs.js +2 -0
  372. package/node_modules/@codebridge/web/dist/assets/init-C-OQMol4.js +1 -0
  373. package/node_modules/@codebridge/web/dist/assets/ishikawaDiagram-WSZJBQD7-P1bZAz2x.js +70 -0
  374. package/node_modules/@codebridge/web/dist/assets/journeyDiagram-NVQOT4AX-C4rwMcBY.js +139 -0
  375. package/node_modules/@codebridge/web/dist/assets/kanban-definition-27J2QSJJ-mtw4a9bc.js +89 -0
  376. package/node_modules/@codebridge/web/dist/assets/line-DP4RkYqm.js +1 -0
  377. package/node_modules/@codebridge/web/dist/assets/linear-DMg3PPio.js +1 -0
  378. package/node_modules/@codebridge/web/dist/assets/map-BaFkSB1l.js +1 -0
  379. package/node_modules/@codebridge/web/dist/assets/mermaid-parser.core-HY84kHw1.js +7 -0
  380. package/node_modules/@codebridge/web/dist/assets/mermaid.core-DdgCdsnM.js +42 -0
  381. package/node_modules/@codebridge/web/dist/assets/mindmap-definition-FAOFIHXS-Cw1EnbhZ.js +96 -0
  382. package/node_modules/@codebridge/web/dist/assets/ordinal-BDEzSJ7C.js +1 -0
  383. package/node_modules/@codebridge/web/dist/assets/packet-7NZHBO7P-CEbrbJH3.js +1 -0
  384. package/node_modules/@codebridge/web/dist/assets/path-fybaL0A-.js +1 -0
  385. package/node_modules/@codebridge/web/dist/assets/pegDiagram-VL7TDLO6-CEc1Gedb.js +1 -0
  386. package/node_modules/@codebridge/web/dist/assets/pie-RZYD4A2V-DPXVs-IW.js +1 -0
  387. package/node_modules/@codebridge/web/dist/assets/pieDiagram-7S7Q4E2Y-hoQeGMFH.js +39 -0
  388. package/node_modules/@codebridge/web/dist/assets/quadrantDiagram-CIZ2JOQS-C-Nmxx0f.js +7 -0
  389. package/node_modules/@codebridge/web/dist/assets/radar-I7S5WNFK-BVd3X3Pd.js +1 -0
  390. package/node_modules/@codebridge/web/dist/assets/railroad-3IZDKUUU-CxLxzr_v.js +1 -0
  391. package/node_modules/@codebridge/web/dist/assets/railroad-abnf-AHOZXSZD-MA1zPI84.js +1 -0
  392. package/node_modules/@codebridge/web/dist/assets/railroad-ebnf-EBAXGLYW-Bqug_umD.js +1 -0
  393. package/node_modules/@codebridge/web/dist/assets/railroad-peg-LSFZ7HO6-DRcRFwpq.js +1 -0
  394. package/node_modules/@codebridge/web/dist/assets/railroadDiagram-AXF67PYL-B007ZkL9.js +1 -0
  395. package/node_modules/@codebridge/web/dist/assets/requirementDiagram-LRYGKXZP-LrTCcEi5.js +84 -0
  396. package/node_modules/@codebridge/web/dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
  397. package/node_modules/@codebridge/web/dist/assets/sankeyDiagram-W5VNT64P-Ch4mzHck.js +40 -0
  398. package/node_modules/@codebridge/web/dist/assets/sequenceDiagram-SI44F4Z6-CHg4OzLX.js +162 -0
  399. package/node_modules/@codebridge/web/dist/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  400. package/node_modules/@codebridge/web/dist/assets/src-BrO6_odD.js +1 -0
  401. package/node_modules/@codebridge/web/dist/assets/stateDiagram-OKZ733FA-7cVkr5nR.js +1 -0
  402. package/node_modules/@codebridge/web/dist/assets/stateDiagram-v2-UEYNNEHI-CTy_mAXb.js +1 -0
  403. package/node_modules/@codebridge/web/dist/assets/swimlanes-SLNWSIFB-BwSVF5qy.js +2 -0
  404. package/node_modules/@codebridge/web/dist/assets/swimlanesDiagram-ULZ7WXOC-BBQnfZ1j.js +8 -0
  405. package/node_modules/@codebridge/web/dist/assets/timeline-definition-Z64GVDOM-BaHEkVDV.js +120 -0
  406. package/node_modules/@codebridge/web/dist/assets/treeView-QDETBFTQ-CF0kLN62.js +1 -0
  407. package/node_modules/@codebridge/web/dist/assets/treemap-6X3UGDF4-BB8A8uux.js +1 -0
  408. package/node_modules/@codebridge/web/dist/assets/vennDiagram-T6HMQDX7-BFK12Iro.js +34 -0
  409. package/node_modules/@codebridge/web/dist/assets/wardley-OPB4EBWU-C_3y61zk.js +1 -0
  410. package/node_modules/@codebridge/web/dist/assets/wardleyDiagram-T6FBY63Y-W2oGu4WK.js +78 -0
  411. package/node_modules/@codebridge/web/dist/assets/xychartDiagram-ELKLHX3M-BiVRnbvz.js +7 -0
  412. package/node_modules/@codebridge/web/dist/brand/agent-logo-carbon.svg +1 -0
  413. package/node_modules/@codebridge/web/dist/brand/agent-logo.svg +1 -0
  414. package/node_modules/@codebridge/web/dist/brand/agnet-logo-carbon.svg +1 -0
  415. package/node_modules/@codebridge/web/dist/brand/agnet-logo.svg +1 -0
  416. package/node_modules/@codebridge/web/dist/brand/agnet-mark-carbon.svg +1 -0
  417. package/node_modules/@codebridge/web/dist/brand/agnet-mark.svg +1 -0
  418. package/node_modules/@codebridge/web/dist/fonts/CommitMono-400-Regular.otf +0 -0
  419. package/node_modules/@codebridge/web/dist/fonts/CommitMono-700-Regular.otf +0 -0
  420. package/node_modules/@codebridge/web/dist/fonts/CommitMono-OFL.txt +21 -0
  421. package/node_modules/@codebridge/web/dist/fonts/DepartureMono-OFL.txt +21 -0
  422. package/node_modules/@codebridge/web/dist/fonts/DepartureMono-Regular.woff2 +0 -0
  423. package/node_modules/@codebridge/web/dist/index.html +25 -0
  424. package/node_modules/@codebridge/web/package.json +7 -0
  425. package/node_modules/@codebridge/work-items/dist/index.d.ts +371 -0
  426. package/node_modules/@codebridge/work-items/dist/index.js +1784 -0
  427. package/node_modules/@codebridge/work-items/dist/session-projector.d.ts +4 -0
  428. package/node_modules/@codebridge/work-items/dist/session-projector.js +506 -0
  429. package/node_modules/@codebridge/work-items/dist/session-runtime.d.ts +274 -0
  430. package/node_modules/@codebridge/work-items/dist/session-runtime.js +1103 -0
  431. package/node_modules/@codebridge/work-items/dist/session-schema.d.ts +9 -0
  432. package/node_modules/@codebridge/work-items/dist/session-schema.js +292 -0
  433. package/node_modules/@codebridge/work-items/package.json +20 -0
  434. package/package.json +75 -4
@@ -0,0 +1,559 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DdgCdsnM.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BrO6_odD.js","assets/chunk-I66GZJ75-B_rJXmNu.js","assets/chunk-NSK5VX7P-fIHF5wwn.js","assets/dist-D2L7nRdk.js","assets/chunk-4I5QYGJK-1pOLR_SG.js","assets/chunk-WRU74C26-DwvEoD-1.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-DB35O-6R.js","assets/chunk-W5SLKNZC-bkRBsbq-.js","assets/chunk-QR6OTTB3-DxkJuF2b.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-7Z6QIM7H-CILAW2Nk.js","assets/line-DP4RkYqm.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ie(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},A={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=A,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,k)}catch(e){k(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,O=te.port2;te.port1.onmessage=ee,D=function(){O.postMessage(null)}}else D=function(){_(ee,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){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 s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function de(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function fe(e,t){le++,ce[le]=e.current,e.current=t}var pe=ue(null),me=ue(null),he=ue(null),ge=ue(null);function _e(e,t){switch(fe(he,t),fe(me,e),fe(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cf(t),e=lf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(pe),fe(pe,e)}function ve(){de(pe),de(me),de(he)}function ye(e){e.memoizedState!==null&&fe(ge,e);var t=pe.current,n=lf(t,e.type);t!==n&&(fe(me,e),fe(pe,n))}function be(e){me.current===e&&(de(pe),de(me)),ge.current===e&&(de(ge),gp._currentValue=se)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,j=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=A.p;return e===0?(e=window.event,e===void 0?32:Mp(e.type)):e}function dt(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kf(e);e!==null;){if(n=e[pt])return n;e=kf(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Mt={},Nt={};function Pt(e){return Oe.call(Nt,e)?!0:Oe.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function It(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Lt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ut(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function M(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Rt(n)):qt(e,o,Rt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Rt(s):e.removeAttribute(`name`)}function Kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Vt(e)}function qt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(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=``+Rt(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 Yt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function N(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function $t(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&N(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&N(e,o,t[o])}function en(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var tn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),nn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function rn(e){return nn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function an(){}var on=null;function sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cn=null,ln=null;function un(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(M(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));M(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ht(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var dn=!1;function fn(e,t,n){if(dn)return e(t,n);dn=!0;try{return e(t)}finally{if(dn=!1,(cn!==null||ln!==null)&&(Lu(),cn&&(t=cn,e=ln,ln=cn=null,un(t),e)))for(t=0;t<e.length;t++)un(e[t])}}function pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var mn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),hn=!1;if(mn)try{var gn={};Object.defineProperty(gn,"passive",{get:function(){hn=!0}}),window.addEventListener(`test`,gn,gn),window.removeEventListener(`test`,gn,gn)}catch{hn=!1}var _n=null,P=null,vn=null;function yn(){if(vn)return vn;var e,t=P,n=t.length,r,i=`value`in _n?_n.value:_n.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(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 xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=m({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=m({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,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!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(m({},jn,{dataTransfer:0})),Pn=Cn(m({},En,{relatedTarget:0})),Fn=Cn(m({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(m({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(m({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={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`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(m({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(m({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(m({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(m({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(m({},jn,{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})),Jn=Cn(m({},wn,{newState:0,oldState:0})),Yn=[9,13,27,32],Xn=mn&&`CompositionEvent`in window,Zn=null;mn&&`documentMode`in document&&(Zn=document.documentMode);var Qn=mn&&`TextEvent`in window&&!Zn,$n=mn&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=P=_n=null,ir=!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 $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){cn?ln?ln.push(r):ln=[r]:cn=r,t=Gd(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){Ld(e,0)}function pr(e){if(Ht(wt(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(mn){var gr;if(mn){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,sn(e)),fn(fr,t)}}function xr(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function Sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Cr(e,t){if(e===`click`)return pr(t)}function wr(e,t){if(e===`input`||e===`change`)return pr(t)}function Tr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Er=typeof Object.is==`function`?Object.is:Tr;function Dr(e,t){if(Er(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Oe.call(t,i)||!Er(e[i],t[i]))return!1}return!0}function Or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kr(e,t){var n=Or(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Nr=mn&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Ut(r)||(r=Pr,`selectionStart`in r&&Mr(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}),Ir&&Dr(Ir,r)||(Ir=r,r=Gd(Fr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Pr)))}function zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Br={animationend:zr(`Animation`,`AnimationEnd`),animationiteration:zr(`Animation`,`AnimationIteration`),animationstart:zr(`Animation`,`AnimationStart`),transitionrun:zr(`Transition`,`TransitionRun`),transitionstart:zr(`Transition`,`TransitionStart`),transitioncancel:zr(`Transition`,`TransitionCancel`),transitionend:zr(`Transition`,`TransitionEnd`)},Vr={},Hr={};mn&&(Hr=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 Ur(e){if(Vr[e])return Vr[e];if(!Br[e])return e;var t=Br[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hr)return Vr[e]=t[n];return e}var Wr=Ur(`animationend`),Gr=Ur(`animationiteration`),Kr=Ur(`animationstart`),qr=Ur(`transitionrun`),Jr=Ur(`transitionstart`),Yr=Ur(`transitioncancel`),Xr=Ur(`transitionend`),Zr=new Map,Qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Qr.push(`scrollEnd`);function $r(e,t){Zr.set(e,t),kt(t,[e])}var ei=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ti=[],ni=0,ri=0;function ii(){for(var e=ni,t=ri=ni=0;t<e;){var n=ti[t];ti[t++]=null;var r=ti[t];ti[t++]=null;var i=ti[t];ti[t++]=null;var a=ti[t];if(ti[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ci(n,i,a)}}function ai(e,t,n,r){ti[ni++]=e,ti[ni++]=t,ti[ni++]=n,ti[ni++]=r,ri|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function oi(e,t,n,r){return ai(e,t,n,r),li(e)}function si(e,t){return ai(e,null,null,t),li(e)}function ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function li(e){if(50<Ou)throw Ou=0,ku=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ui={};function di(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fi(e,t,n,r){return new di(e,t,n,r)}function pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mi(e,t){var n=e.alternate;return n===null?(n=fi(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&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function hi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)pi(e)&&(s=1);else if(typeof e==`string`)s=sp(e,n,pe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=fi(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return _i(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=fi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=fi(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=fi(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function _i(e,t,n,r){return e=fi(7,e,r,t),e.lanes=n,e}function vi(e,t,n){return e=fi(6,e,null,t),e.lanes=n,e}function yi(e){var t=fi(18,null,null,0);return t.stateNode=e,t}function bi(e,t,n){return t=fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xi=new WeakMap;function Si(e,t){if(typeof e==`object`&&e){var n=xi.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},xi.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Ci=[],wi=0,Ti=null,Ei=0,Di=[],Oi=0,ki=null,Ai=1,ji=``;function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Ti,Ti=e,Ei=t}function Ni(e,t,n){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,ki=e;var r=Ai;e=ji;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ai=1<<32-We(t)+i|n<<i|r,ji=a+e}else Ai=1<<a|n<<i|r,ji=e}function Pi(e){e.return!==null&&(Mi(e,1),Ni(e,1,0))}function Fi(e){for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null;for(;e===ki;)ki=Di[--Oi],Di[Oi]=null,ji=Di[--Oi],Di[Oi]=null,Ai=Di[--Oi],Di[Oi]=null}function Ii(e,t){Di[Oi++]=Ai,Di[Oi++]=ji,Di[Oi++]=ki,Ai=t.id,ji=t.overflow,ki=e}var Li=null,Ri=null,zi=!1,Bi=null,Vi=!1,Hi=Error(i(519));function Ui(e){throw Yi(Si(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Hi}function Wi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Rd(`cancel`,t),Rd(`close`,t);break;case`iframe`:case`object`:case`embed`:Rd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Fd.length;n++)Rd(Fd[n],t);break;case`source`:Rd(`error`,t);break;case`img`:case`image`:case`link`:Rd(`error`,t),Rd(`load`,t);break;case`details`:Rd(`toggle`,t);break;case`input`:Rd(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Rd(`invalid`,t);break;case`textarea`:Rd(`invalid`,t),Xt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Zd(t.textContent,n)?(r.popover!=null&&(Rd(`beforetoggle`,t),Rd(`toggle`,t)),r.onScroll!=null&&Rd(`scroll`,t),r.onScrollEnd!=null&&Rd(`scrollend`,t),r.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||Ui(e,!0)}function Gi(e){for(Li=e.return;Li;)switch(Li.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:Li=Li.return}}function Ki(e){if(e!==Li)return!1;if(!zi)return Gi(e),zi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||uf(e.type,e.memoizedProps)),n=!n),n&&Ri&&Ui(e),Gi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ri=Of(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ri=Of(e)}else t===27?(t=Ri,_f(e.type)?(e=Df,Df=null,Ri=e):Ri=t):Ri=Li?Ef(e.stateNode.nextSibling):null;return!0}function qi(){Ri=Li=null,zi=!1}function Ji(){var e=Bi;return e!==null&&(mu===null?mu=e:mu.push.apply(mu,e),Bi=null),e}function Yi(e){Bi===null?Bi=[e]:Bi.push(e)}var Xi=ue(null),Zi=null,Qi=null;function $i(e,t,n){fe(Xi,t._currentValue),t._currentValue=n}function ea(e){e._currentValue=Xi.current,de(Xi)}function ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function na(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ta(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ta(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ra(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Er(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ge.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[gp]:e.push(gp))}a=a.return}e!==null&&na(t,e,n,r),t.flags|=262144}function ia(e){for(e=e.firstContext;e!==null;){if(!Er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function aa(e){Zi=e,Qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function oa(e){return ca(Zi,e)}function sa(e,t){return Zi===null&&aa(e),ca(e,t)}function ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Qi===null){if(e===null)throw Error(i(308));Qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qi=Qi.next=t;return n}var la=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ua=t.unstable_scheduleCallback,da=t.unstable_NormalPriority,fa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pa(){return{controller:new la,data:new Map,refCount:0}}function ma(e){e.refCount--,e.refCount===0&&ua(da,function(){e.controller.abort()})}var ha=null,ga=0,_a=0,va=null;function ya(e,t){if(ha===null){var n=ha=[];ga=0,_a=kd(),va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ga++,t.then(ba,ba),t}function ba(){if(--ga===0&&ha!==null){va!==null&&(va.status=`fulfilled`);var e=ha;ha=null,_a=0,va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Sa=k.S;k.S=function(e,t){_u=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&ya(e,t),Sa!==null&&Sa(e,t)};var Ca=ue(null);function wa(){var e=Ca.current;return e===null?Ql.pooledCache:e}function Ta(e,t){t===null?fe(Ca,Ca.current):fe(Ca,t.pool)}function Ea(){var e=wa();return e===null?null:{parent:fa._currentValue,pool:e}}var Da=Error(i(460)),Oa=Error(i(474)),ka=Error(i(542)),Aa={then:function(){}};function ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ma(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ia(e),e;default:if(typeof t.status==`string`)t.then(an,an);else{if(e=Ql,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ia(e),e}throw Pa=t,Da}}function Na(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Pa=e,Da):e}}var Pa=null;function Fa(){if(Pa===null)throw Error(i(459));var e=Pa;return Pa=null,e}function Ia(e){if(e===Da||e===ka)throw Error(i(483))}var La=null,Ra=0;function za(e){var t=Ra;return Ra+=1,La===null&&(La=[]),Ma(La,e,t)}function Ba(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Va(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ha(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=mi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&Na(i)===t.type)?(t=a(t,n.props),Ba(t,n),t.return=e,t):(t=gi(n.type,n.key,n.props,null,e.mode,r),Ba(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=bi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=_i(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=gi(t.type,t.key,t.props,null,e.mode,n),Ba(n,t),n.return=e,n;case v:return t=bi(t,e.mode,n),t.return=e,t;case D:return t=Na(t),f(e,t,n)}if(oe(t)||re(t))return t=_i(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,za(t),n);if(t.$$typeof===C)return f(e,sa(e,t),n);Va(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=Na(n),p(e,t,n,r)}if(oe(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,za(n),r);if(n.$$typeof===C)return p(e,t,sa(e,n),r);Va(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Na(r),m(e,t,n,r,i)}if(oe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,za(r),i);if(r.$$typeof===C)return m(e,t,n,sa(t,r),i);Va(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),zi&&Mi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return zi&&Mi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),zi&&Mi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),zi&&Mi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return zi&&Mi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),zi&&Mi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Na(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ba(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=_i(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=gi(o.type,o.key,o.props,null,e.mode,c),Ba(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=bi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Na(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,za(o),c);if(o.$$typeof===C)return b(e,r,sa(e,o),c);Va(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ra=0;var i=b(e,t,n,r);return La=null,i}catch(t){if(t===Da||t===ka)throw t;var a=fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ua=Ha(!0),Wa=Ha(!1),Ga=!1;function Ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=li(e),ci(e,null,n),t}return ai(e,r,t,n),li(e)}function Xa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qa=!1;function $a(){if(Qa){var e=va;if(e!==null)throw e}}function eo(e,t,n,r){Qa=!1;var i=e.updateQueue;Ga=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(eu&f)===f:(r&f)===f){f!==0&&f===_a&&(Qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ga=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cu|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)to(n[e],t)}var ro=ue(null),io=ue(0);function ao(e,t){e=ou,fe(io,e),fe(ro,t),ou=e|t.baseLanes}function oo(){fe(io,ou),fe(ro,ro.current)}function so(){ou=io.current,de(ro),de(io)}var co=ue(null),lo=null;function uo(e){var t=e.alternate;fe(go,go.current&1),fe(co,e),lo===null&&(t===null||ro.current!==null||t.memoizedState!==null)&&(lo=e)}function fo(e){fe(go,go.current),fe(co,e),lo===null&&(lo=e)}function po(e){e.tag===22?(fe(go,go.current),fe(co,e),lo===null&&(lo=e)):mo(e)}function mo(){fe(go,go.current),fe(co,co.current)}function ho(e){de(co),lo===e&&(lo=null),de(go)}var go=ue(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Cf(n)||wf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 vo=0,yo=null,bo=null,xo=null,So=!1,Co=!1,wo=!1,To=0,Eo=0,Do=null,Oo=0;function ko(){throw Error(i(321))}function Ao(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Er(e[n],t[n]))return!1;return!0}function jo(e,t,n,r,i,a){return vo=a,yo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ys:Xs,wo=!1,a=n(r,i),wo=!1,Co&&(a=No(t,n,r,i)),Mo(e),a}function Mo(e){k.H=Js;var t=bo!==null&&bo.next!==null;if(vo=0,xo=bo=yo=null,So=!1,Eo=0,Do=null,t)throw Error(i(300));e===null||pc||(e=e.dependencies,e!==null&&ia(e)&&(pc=!0))}function No(e,t,n,r){yo=e;var a=0;do{if(Co&&(Do=null),Eo=0,Co=!1,25<=a)throw Error(i(301));if(a+=1,xo=bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Zs,o=t(n,r)}while(Co);return o}function Po(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Vo(t):t,e=e.useState()[0],(bo===null?null:bo.memoizedState)!==e&&(yo.flags|=1024),t}function Fo(){var e=To!==0;return To=0,e}function Io(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Lo(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}vo=0,xo=bo=yo=null,Co=!1,Eo=To=0,Do=null}function Ro(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xo===null?yo.memoizedState=xo=e:xo=xo.next=e,xo}function zo(){if(bo===null){var e=yo.alternate;e=e===null?null:e.memoizedState}else e=bo.next;var t=xo===null?yo.memoizedState:xo.next;if(t!==null)xo=t,bo=e;else{if(e===null)throw yo.alternate===null?Error(i(467)):Error(i(310));bo=e,e={memoizedState:bo.memoizedState,baseState:bo.baseState,baseQueue:bo.baseQueue,queue:bo.queue,next:null},xo===null?yo.memoizedState=xo=e:xo=xo.next=e}return xo}function Bo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vo(e){var t=Eo;return Eo+=1,Do===null&&(Do=[]),e=Ma(Do,e,t),t=yo,(xo===null?t.memoizedState:xo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ys:Xs),e}function Ho(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Vo(e);if(e.$$typeof===C)return oa(e)}throw Error(i(438,String(e)))}function Uo(e){var t=null,n=yo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=yo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Bo(),yo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function Wo(e,t){return typeof t==`function`?t(e):t}function Go(e){return Ko(zo(),bo,e)}function Ko(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(vo&f)===f:(eu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===_a&&(d=!0);else if((vo&p)===p){u=u.next,p===_a&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,yo.lanes|=p,cu|=p;f=u.action,wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,yo.lanes|=f,cu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Er(o,e.memoizedState)&&(pc=!0,d&&(n=va,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function qo(e){var t=zo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Er(o,t.memoizedState)||(pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Jo(e,t,n){var r=yo,a=zo(),o=zi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Er((bo||a).memoizedState,n);if(s&&(a.memoizedState=n,pc=!0),a=a.queue,bs(Zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||xo!==null&&xo.memoizedState.tag&1){if(r.flags|=2048,hs(9,{destroy:void 0},Xo.bind(null,r,a,n,t),null),Ql===null)throw Error(i(349));o||vo&127||Yo(r,t,n)}return n}function Yo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=yo.updateQueue,t===null?(t=Bo(),yo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xo(e,t,n,r){t.value=n,t.getSnapshot=r,Qo(t)&&$o(e)}function Zo(e,t,n){return n(function(){Qo(t)&&$o(e)})}function Qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Er(e,n)}catch{return!0}}function $o(e){var t=si(e,2);t!==null&&Mu(t,e,2)}function es(e){var t=Ro();if(typeof e==`function`){var n=e;if(e=n(),wo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t}function ts(e,t,n,r){return e.baseState=n,Ko(e,bo,typeof r==`function`?r:Wo)}function ns(e,t,n,r,a){if(Gs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,rs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function rs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),is(e,t,s)}catch(n){ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),is(e,t,a)}catch(n){ss(e,t,n)}}function is(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){as(e,t,n)},function(n){return ss(e,t,n)}):as(e,t,n)}function as(e,t,n){t.status=`fulfilled`,t.value=n,cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rs(e,n)))}function ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,cs(t),t=t.next;while(t!==r)}e.action=null}function cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ls(e,t){return t}function us(e,t){if(zi){var n=Ql.formState;if(n!==null){a:{var r=yo;if(zi){if(Ri){b:{for(var i=Ri,a=Vi;i.nodeType!==8;){if(!a){i=null;break b}if(i=Ef(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ri=Ef(i.nextSibling),r=i.data===`F!`;break a}}Ui(r)}r=!1}r&&(t=n[0])}}return n=Ro(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:t},n.queue=r,n=Hs.bind(null,yo,r),r.dispatch=n,r=es(!1),a=Ws.bind(null,yo,!1,r.queue),r=Ro(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ns.bind(null,yo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ds(e){return fs(zo(),bo,e)}function fs(e,t,n){if(t=Ko(e,t,ls)[0],e=Go(Wo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Vo(t)}catch(e){throw e===Da?ka:e}else r=t;t=zo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(yo.flags|=2048,hs(9,{destroy:void 0},ps.bind(null,i,n),null)),[r,a,e]}function ps(e,t){e.action=t}function ms(e){var t=zo(),n=bo;if(n!==null)return fs(t,n,e);zo(),t=t.memoizedState,n=zo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function hs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=yo.updateQueue,t===null&&(t=Bo(),yo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function gs(){return zo().memoizedState}function _s(e,t,n,r){var i=Ro();yo.flags|=e,i.memoizedState=hs(1|t,{destroy:void 0},n,r===void 0?null:r)}function vs(e,t,n,r){var i=zo();r=r===void 0?null:r;var a=i.memoizedState.inst;bo!==null&&r!==null&&Ao(r,bo.memoizedState.deps)?i.memoizedState=hs(t,a,n,r):(yo.flags|=e,i.memoizedState=hs(1|t,a,n,r))}function ys(e,t){_s(8390656,8,e,t)}function bs(e,t){vs(2048,8,e,t)}function xs(e){yo.flags|=4;var t=yo.updateQueue;if(t===null)t=Bo(),yo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ss(e){var t=zo().memoizedState;return xs({ref:t,nextImpl:e}),function(){if(Zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Cs(e,t){return vs(4,2,e,t)}function ws(e,t){return vs(4,4,e,t)}function Ts(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Es(e,t,n){n=n==null?null:n.concat([e]),vs(4,4,Ts.bind(null,t,e),n)}function Ds(){}function Os(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ks(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ao(t,r[1]))return r[0];if(r=e(),wo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function As(e,t,n){return n===void 0||vo&1073741824&&!(eu&261930)?e.memoizedState=t:(e.memoizedState=n,e=ju(),yo.lanes|=e,cu|=e,n)}function js(e,t,n,r){return Er(n,t)?n:ro.current===null?!(vo&42)||vo&1073741824&&!(eu&261930)?(pc=!0,e.memoizedState=n):(e=ju(),yo.lanes|=e,cu|=e,t):(e=As(e,n,r),Er(e,t)||(pc=!0),e)}function Ms(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ws(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Us(e,t,xa(c,r),Au(e)):Us(e,t,r,Au(e))}catch(n){Us(e,t,{then:function(){},status:`rejected`,reason:n},Au())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Ns(){}function Ps(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Fs(e).queue;Ms(e,a,t,se,n===null?Ns:function(){return Is(e),n(r)})}function Fs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Is(e){var t=Fs(e);t.next===null&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},Au())}function Ls(){return oa(gp)}function Rs(){return zo().memoizedState}function zs(){return zo().memoizedState}function Bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Au();e=Ja(n);var r=Ya(t,e,n);r!==null&&(Mu(r,t,n),Xa(r,t,n)),t={cache:pa()},e.payload=t;return}t=t.return}}function Vs(e,t,n){var r=Au();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gs(e)?Ks(t,n):(n=oi(e,t,n,r),n!==null&&(Mu(n,e,r),qs(n,t,r)))}function Hs(e,t,n){Us(e,t,n,Au())}function Us(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gs(e))Ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ai(e,t,i,0),Ql===null&&ii(),!1}catch{}if(n=oi(e,t,i,r),n!==null)return Mu(n,e,r),qs(n,t,r),!0}return!1}function Ws(e,t,n,r){if(r={lane:2,revertLane:kd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gs(e)){if(t)throw Error(i(479))}else t=oi(e,n,r,2),t!==null&&Mu(t,e,2)}function Gs(e){var t=e.alternate;return e===yo||t!==null&&t===yo}function Ks(e,t){Co=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Js={readContext:oa,use:Ho,useCallback:ko,useContext:ko,useEffect:ko,useImperativeHandle:ko,useLayoutEffect:ko,useInsertionEffect:ko,useMemo:ko,useReducer:ko,useRef:ko,useState:ko,useDebugValue:ko,useDeferredValue:ko,useTransition:ko,useSyncExternalStore:ko,useId:ko,useHostTransitionStatus:ko,useFormState:ko,useActionState:ko,useOptimistic:ko,useMemoCache:ko,useCacheRefresh:ko};Js.useEffectEvent=ko;var Ys={readContext:oa,use:Ho,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:oa,useEffect:ys,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),_s(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var r=e();if(wo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ro();if(n!==void 0){var i=n(t);if(wo){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Vs.bind(null,yo,e),[r.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=es(e);var t=e.queue,n=Hs.bind(null,yo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ds,useDeferredValue:function(e,t){return As(Ro(),e,t)},useTransition:function(){var e=es(!1);return e=Ms.bind(null,yo,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=yo,a=Ro();if(zi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ql===null)throw Error(i(349));eu&127||Yo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ys(Zo.bind(null,r,o,e),[e]),r.flags|=2048,hs(9,{destroy:void 0},Xo.bind(null,r,o,n,t),null),n},useId:function(){var e=Ro(),t=Ql.identifierPrefix;if(zi){var n=ji,r=Ai;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=To++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Oo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ls,useFormState:us,useActionState:us,useOptimistic:function(e){var t=Ro();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ws.bind(null,yo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Uo,useCacheRefresh:function(){return Ro().memoizedState=Bs.bind(null,yo)},useEffectEvent:function(e){var t=Ro(),n={impl:e};return t.memoizedState=n,function(){if(Zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Xs={readContext:oa,use:Ho,useCallback:Os,useContext:oa,useEffect:bs,useImperativeHandle:Es,useInsertionEffect:Cs,useLayoutEffect:ws,useMemo:ks,useReducer:Go,useRef:gs,useState:function(){return Go(Wo)},useDebugValue:Ds,useDeferredValue:function(e,t){return js(zo(),bo.memoizedState,e,t)},useTransition:function(){var e=Go(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Rs,useHostTransitionStatus:Ls,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){return ts(zo(),bo,e,t)},useMemoCache:Uo,useCacheRefresh:zs};Xs.useEffectEvent=Ss;var Zs={readContext:oa,use:Ho,useCallback:Os,useContext:oa,useEffect:bs,useImperativeHandle:Es,useInsertionEffect:Cs,useLayoutEffect:ws,useMemo:ks,useReducer:qo,useRef:gs,useState:function(){return qo(Wo)},useDebugValue:Ds,useDeferredValue:function(e,t){var n=zo();return bo===null?As(n,e,t):js(n,bo.memoizedState,e,t)},useTransition:function(){var e=qo(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Rs,useHostTransitionStatus:Ls,useFormState:ms,useActionState:ms,useOptimistic:function(e,t){var n=zo();return bo===null?(n.baseState=e,[e,n.queue.dispatch]):ts(n,bo,e,t)},useMemoCache:Uo,useCacheRefresh:zs};Zs.useEffectEvent=Ss;function Qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Au(),i=Ja(r);i.payload=t,n!=null&&(i.callback=n),t=Ya(e,i,r),t!==null&&(Mu(t,e,r),Xa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Au(),i=Ja(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ya(e,i,r),t!==null&&(Mu(t,e,r),Xa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Au(),r=Ja(n);r.tag=2,t!=null&&(r.callback=t),t=Ya(e,r,n),t!==null&&(Mu(t,e,n),Xa(t,e,n))}};function ec(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(i,a):!0}function tc(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&&$s.enqueueReplaceState(t,t.state,null)}function nc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function rc(e){ei(e)}function ic(e){console.error(e)}function ac(e){ei(e)}function oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function sc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function cc(e,t,n){return n=Ja(n),n.tag=3,n.payload={element:null},n.callback=function(){oc(e,t)},n}function lc(e){return e=Ja(e),e.tag=3,e}function uc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){sc(t,n,r),typeof i!=`function`&&(bu===null?bu=new Set([this]):bu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function dc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ra(t,n,a,!0),n=co.current,n!==null){switch(n.tag){case 31:case 13:return lo===null?Wu():n.alternate===null&&su===0&&(su=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Aa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ld(e,r,a)),!1;case 22:return n.flags|=65536,r===Aa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ld(e,r,a)),!1}throw Error(i(435,n.tag))}return ld(e,r,a),Wu(),!1}if(zi)return t=co.current,t===null?(r!==Hi&&(t=Error(i(423),{cause:r}),Yi(Si(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Si(r,n),a=cc(e.stateNode,r,a),Za(e,a),su!==4&&(su=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Hi&&(e=Error(i(422),{cause:r}),Yi(Si(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Si(o,n),pu===null?pu=[o]:pu.push(o),su!==4&&(su=2),t===null)return!0;r=Si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=cc(n.stateNode,r,e),Za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(bu===null||!bu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=lc(a),uc(a,e,n,r),Za(n,a),!1}n=n.return}while(n!==null);return!1}var fc=Error(i(461)),pc=!1;function mc(e,t,n,r){t.child=e===null?Wa(t,null,n,r):Ua(t,e.child,n,r)}function hc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return aa(t),r=jo(e,t,n,o,a,i),s=Fo(),e!==null&&!pc?(Io(e,t,i),zc(e,t,i)):(zi&&s&&Pi(t),t.flags|=1,mc(e,t,r,i),t.child)}function gc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,_c(e,t,a,r,i)):(e=gi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Bc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Dr:n,n(o,r)&&e.ref===t.ref)return zc(e,t,i)}return t.flags|=1,e=mi(a,r),e.ref=t.ref,e.return=t,t.child=e}function _c(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref){if(pc=!1,t.pendingProps=r=a,Bc(e,i))e.flags&131072&&(pc=!0);else return t.lanes=e.lanes,zc(e,t,i)}}return Tc(e,t,n,r,i)}function vc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ta(t,a===null?null:a.cachePool),a===null?oo():ao(t,a),po(t);else return r=t.lanes=536870912,bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ta(t,null),oo(),mo(t)):(Ta(t,a.cachePool),ao(t,a),mo(t),t.memoizedState=null);return mc(e,t,i,n),t.child}function yc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bc(e,t,n,r,i){var a=wa();return a=a===null?null:{parent:fa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ta(t,null),oo(),po(t),e!==null&&ra(e,t,r,!0),t.childLanes=i,null}function xc(e,t){return t=Pc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Sc(e,t,n){return Ua(t,e.child,null,n),e=xc(t,t.pendingProps),e.flags|=2,ho(t),t.memoizedState=null,e}function Cc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(zi){if(r.mode===`hidden`)return e=xc(t,r),t.lanes=536870912,yc(null,e);if(fo(t),(e=Ri)?(e=Sf(e,Vi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=yi(e),n.return=t,t.child=n,Li=t,Ri=null)):e=null,e===null)throw Ui(t);return t.lanes=536870912,null}return xc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(fo(t),a){if(t.flags&256)t.flags&=-257,t=Sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(pc||ra(e,t,n,!1),a=(n&e.childLanes)!==0,pc||a){if(r=Ql,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,si(e,s),Mu(r,e,s),fc;Wu(),t=Sc(e,t,n)}else e=o.treeContext,Ri=Ef(s.nextSibling),Li=t,zi=!0,Bi=null,Vi=!1,e!==null&&Ii(t,e),t=xc(t,r),t.flags|=4096;return t}return e=mi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Tc(e,t,n,r,i){return aa(t),n=jo(e,t,n,r,void 0,i),r=Fo(),e!==null&&!pc?(Io(e,t,i),zc(e,t,i)):(zi&&r&&Pi(t),t.flags|=1,mc(e,t,n,i),t.child)}function Ec(e,t,n,r,i,a){return aa(t),t.updateQueue=null,n=No(t,r,n,i),Mo(e),r=Fo(),e!==null&&!pc?(Io(e,t,a),zc(e,t,a)):(zi&&r&&Pi(t),t.flags|=1,mc(e,t,n,a),t.child)}function Dc(e,t,n,r,i){if(aa(t),t.stateNode===null){var a=ui,o=n.contextType;typeof o==`object`&&o&&(a=oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=$s,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ka(t),o=n.contextType,a.context=typeof o==`object`&&o?oa(o):ui,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Qs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&$s.enqueueReplaceState(a,a.state,null),eo(t,r,a,i),$a(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=nc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ui,typeof u==`object`&&u&&(o=oa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&tc(t,a,r,o),Ga=!1;var f=t.memoizedState;a.state=f,eo(t,r,a,i),$a(),l=t.memoizedState,s||f!==l||Ga?(typeof d==`function`&&(Qs(t,n,d,r),l=t.memoizedState),(c=Ga||ec(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,qa(e,t),o=t.memoizedProps,u=nc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ui,typeof l==`object`&&l&&(c=oa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&tc(t,a,r,c),Ga=!1,f=t.memoizedState,a.state=f,eo(t,r,a,i),$a();var p=t.memoizedState;o!==d||f!==p||Ga||e!==null&&e.dependencies!==null&&ia(e.dependencies)?(typeof s==`function`&&(Qs(t,n,s,r),p=t.memoizedState),(u=Ga||ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ia(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ua(t,e.child,null,i),t.child=Ua(t,null,n,i)):mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=zc(e,t,i),e}function Oc(e,t,n,r){return qi(),t.flags|=256,mc(e,t,n,r),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ac(e){return{baseLanes:e,cachePool:Ea()}}function jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=du),e}function Mc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(go.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(zi){if(a?uo(t):mo(t),(e=Ri)?(e=Sf(e,Vi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ki===null?null:{id:Ai,overflow:ji},retryLane:536870912,hydrationErrors:null},n=yi(e),n.return=t,t.child=n,Li=t,Ri=null)):e=null,e===null)throw Ui(t);return wf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(mo(t),a=t.mode,c=Pc({mode:`hidden`,children:c},a),r=_i(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Ac(n),r.childLanes=jc(e,s,n),t.memoizedState=kc,yc(null,r)):(uo(t),Nc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(uo(t),t.flags&=-257,t=Fc(e,t,n)):t.memoizedState===null?(mo(t),c=r.fallback,a=t.mode,r=Pc({mode:`visible`,children:r.children},a),c=_i(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ua(t,e.child,null,n),r=t.child,r.memoizedState=Ac(n),r.childLanes=jc(e,s,n),t.memoizedState=kc,t=yc(null,r)):(mo(t),t.child=e.child,t.flags|=128,t=null);else if(uo(t),wf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Yi({value:r,source:null,stack:null}),t=Fc(e,t,n)}else if(pc||ra(e,t,n,!1),s=(n&e.childLanes)!==0,pc||s){if(s=Ql,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,si(e,r),Mu(s,e,r),fc;Cf(c)||Wu(),t=Fc(e,t,n)}else Cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ri=Ef(c.nextSibling),Li=t,zi=!0,Bi=null,Vi=!1,e!==null&&Ii(t,e),t=Nc(t,r.children),t.flags|=4096);return t}return a?(mo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=mi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=_i(c,a,n,null),c.flags|=2):c=mi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,yc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Ac(n):(a=c.cachePool,a===null?a=Ea():(l=fa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=jc(e,s,n),t.memoizedState=kc,yc(e.child,r)):(uo(t),n=e.child,e=n.sibling,n=mi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Nc(e,t){return t=Pc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Pc(e,t){return e=fi(22,e,null,t),e.lanes=0,e}function Fc(e,t,n){return Ua(t,e.child,null,n),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ic(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ta(e.return,t,n)}function Lc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Rc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=go.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,fe(go,o),mc(e,t,r,n),r=zi?Ei:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ic(e,n,t);else if(e.tag===19)Ic(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Lc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Lc(t,!0,n,null,a,r);break;case`together`:Lc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function zc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ra(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ia(e)))}function Vc(e,t,n){switch(t.tag){case 3:_e(t,t.stateNode.containerInfo),$i(t,fa,e.memoizedState.cache),qi();break;case 27:case 5:ye(t);break;case 4:_e(t,t.stateNode.containerInfo);break;case 10:$i(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(uo(t),e=zc(e,t,n),e===null?null:e.sibling):Mc(e,t,n):(uo(t),t.flags|=128,null);uo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ra(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Rc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),fe(go,go.current),r)break;return null;case 22:return t.lanes=0,vc(e,t,n,t.pendingProps);case 24:$i(t,fa,e.memoizedState.cache)}return zc(e,t,n)}function Hc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)pc=!0;else{if(!Bc(e,n)&&!(t.flags&128))return pc=!1,Vc(e,t,n);pc=!!(e.flags&131072)}}else pc=!1,zi&&t.flags&1048576&&Ni(t,Ei,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Na(t.elementType),t.type=e,typeof e==`function`)pi(e)?(r=nc(e,r),t.tag=1,t=Dc(null,t,e,r,n)):(t.tag=0,t=Tc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=hc(null,t,e,r,n);break a}if(a===ee){t.tag=14,t=gc(null,t,e,r,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return Tc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=nc(r,t.pendingProps),Dc(e,t,r,a,n);case 3:a:{if(_e(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,qa(e,t),eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,$i(t,fa,r),r!==o.cache&&na(t,[fa],n,!0),$a(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Oc(e,t,r,n);break a}if(r!==a){a=Si(Error(i(424)),t),Yi(a),t=Oc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ri=Ef(e.firstChild),Li=t,zi=!0,Bi=null,Vi=!0,n=Wa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(qi(),r===a){t=zc(e,t,n);break a}mc(e,t,r,n)}t=t.child}return t;case 26:return wc(e,t),e===null?(n=qf(t.type,null,t.pendingProps,null))?t.memoizedState=n:zi||(n=t.type,e=t.pendingProps,r=sf(he.current).createElement(n),r[pt]=t,r[mt]=e,ef(r,n,e),Et(r),t.stateNode=r):t.memoizedState=qf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&zi&&(r=t.stateNode=Af(t.type,t.pendingProps,he.current),Li=t,Vi=!0,a=Ri,_f(t.type)?(Df=a,Ri=Ef(r.firstChild)):Ri=a),mc(e,t,t.pendingProps.children,n),wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&zi&&((a=r=Ri)&&(r=bf(r,t.type,t.pendingProps,Vi),r===null?a=!1:(t.stateNode=r,Li=t,Ri=Ef(r.firstChild),Vi=!1,a=!0)),a||Ui(t)),ye(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,uf(a,o)?r=null:s!==null&&uf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=jo(e,t,Po,null,null,n),gp._currentValue=a),wc(e,t),mc(e,t,r,n),t.child;case 6:return e===null&&zi&&((e=n=Ri)&&(n=xf(n,t.pendingProps,Vi),n===null?e=!1:(t.stateNode=n,Li=t,Ri=null,e=!0)),e||Ui(t)),null;case 13:return Mc(e,t,n);case 4:return _e(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ua(t,null,r,n):mc(e,t,r,n),t.child;case 11:return hc(e,t,t.type,t.pendingProps,n);case 7:return mc(e,t,t.pendingProps,n),t.child;case 8:return mc(e,t,t.pendingProps.children,n),t.child;case 12:return mc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,$i(t,t.type,r.value),mc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,aa(t),a=oa(a),r=r(a),t.flags|=1,mc(e,t,r,n),t.child;case 14:return gc(e,t,t.type,t.pendingProps,n);case 15:return _c(e,t,t.type,t.pendingProps,n);case 19:return Rc(e,t,n);case 31:return Cc(e,t,n);case 22:return vc(e,t,n,t.pendingProps);case 24:return aa(t),r=oa(fa),e===null?(a=wa(),a===null&&(a=Ql,o=pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ka(t),$i(t,fa,a)):((e.lanes&n)!==0&&(qa(e,t),eo(t,null,null,n),$a()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,$i(t,fa,r),r!==a.cache&&na(t,[fa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),$i(t,fa,r))),mc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Uc(e){e.flags|=4}function Wc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vu())e.flags|=8192;else throw Pa=Aa,Oa}}else e.flags&=-16777217}function Gc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!cp(t)){if(Vu())e.flags|=8192;else throw Pa=Aa,Oa}}function Kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,fu|=t)}function qc(e,t){if(!zi)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 Jc(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&65011712,r|=i.flags&65011712,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 Yc(e,t,n){var r=t.pendingProps;switch(Fi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jc(t),null;case 1:return Jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ea(fa),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?Uc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ji())),Jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Uc(t),o===null?(Jc(t),Wc(t,a,null,r,n)):(Jc(t),Gc(t,o))):o?o===e.memoizedState?(Jc(t),t.flags&=-16777217):(Uc(t),Jc(t),Gc(t,o)):(e=e.memoizedProps,e!==r&&Uc(t),Jc(t),Wc(t,a,e,r,n)),null;case 27:if(be(t),n=he.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Uc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Jc(t),null}e=pe.current,Ki(t)?Wi(t,e):(e=Af(a,r,n),t.stateNode=e,Uc(t))}return Jc(t),null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Uc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Jc(t),null}if(o=pe.current,Ki(t))Wi(t,o);else{var s=sf(he.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(ef(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Uc(t)}}return Jc(t),Wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Uc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=he.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Li,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Zd(e.nodeValue,n)),e||Ui(t,!0)}else e=sf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ki(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),e=!1}else n=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return Jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),a=!1}else a=Ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Kc(t,t.updateQueue),Jc(t),null);case 4:return ve(),e===null&&Vd(t.stateNode.containerInfo),Jc(t),null;case 10:return ea(t.type),Jc(t),null;case 19:if(de(go),r=t.memoizedState,r===null)return Jc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)qc(r,!1);else{if(su!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=_o(e),o!==null){for(t.flags|=128,qc(r,!1),e=o.updateQueue,t.updateQueue=e,Kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)hi(n,e),n=n.sibling;return fe(go,go.current&1|2),zi&&Mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>vu&&(t.flags|=128,a=!0,qc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=_o(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Kc(t,e),qc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!zi)return Jc(t),null}else 2*Ne()-r.renderingStartTime>vu&&n!==536870912&&(t.flags|=128,a=!0,qc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ne(),e.sibling=null,n=go.current,fe(go,a?n&1|2:n&1),zi&&Mi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Jc(t),t.subtreeFlags&6&&(t.flags|=8192)):Jc(t),n=t.updateQueue,n!==null&&Kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(Ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ea(fa),Jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Xc(e,t){switch(Fi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(fa),ve(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(go),null;case 4:return ve(),null;case 10:return ea(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&de(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(fa),null;case 25:return null;default:return null}}function Zc(e,t){switch(Fi(t),t.tag){case 3:ea(fa),ve();break;case 26:case 27:case 5:be(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:de(go);break;case 10:ea(t.type);break;case 22:case 23:ho(t),so(),e!==null&&de(Ca);break;case 24:ea(fa)}}function Qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){cd(t,t.return,e)}}function $c(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){cd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){cd(t,t.return,e)}}function el(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){cd(e,e.return,t)}}}function tl(e,t,n){n.props=nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){cd(e,t,n)}}function nl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){cd(e,t,n)}}function rl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){cd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){cd(e,t,n)}else n.current=null}}function il(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){cd(e,e.return,t)}}function al(e,t,n){try{var r=e.stateNode;tf(r,e.type,n,t),r[mt]=t}catch(t){cd(e,e.return,t)}}function ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_f(e.type)||e.tag===4}function sl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_f(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(r!==4&&(r===27&&_f(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function ll(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&&(r===27&&_f(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ll(e,t,n),e=e.sibling;e!==null;)ll(e,t,n),e=e.sibling}function ul(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ef(t,r,n),t[pt]=e,t[mt]=n}catch(t){cd(e,e.return,t)}}var dl=!1,fl=!1,pl=!1,ml=typeof WeakSet==`function`?WeakSet:Set,hl=null;function gl(e,t){if(e=e.containerInfo,af=Tp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(of={focusedElem:e,selectionRange:n},Tp=!1,hl=t;hl!==null;)if(t=hl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,hl=e;else for(;hl!==null;){switch(t=hl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=nc(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){cd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)yf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:yf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,hl=e;break}hl=t.return}}function _l(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ml(e,n),r&4&&Qc(5,n);break;case 1:if(Ml(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){cd(n,n.return,e)}else{var i=nc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){cd(n,n.return,e)}}}r&64&&el(n),r&512&&nl(n,n.return);break;case 3:if(Ml(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{no(e,t)}catch(e){cd(n,n.return,e)}}break;case 27:t===null&&r&4&&ul(n);case 26:case 5:Ml(e,n),t===null&&r&4&&il(n),r&512&&nl(n,n.return);break;case 12:Ml(e,n);break;case 31:Ml(e,n),r&4&&Cl(e,n);break;case 13:Ml(e,n),r&4&&wl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=fd.bind(null,n),Tf(e,n))));break;case 22:if(r=n.memoizedState!==null||dl,!r){t=t!==null&&t.memoizedState!==null||fl,i=dl;var a=fl;dl=r,(fl=t)&&!a?Pl(e,n,!!(n.subtreeFlags&8772)):Ml(e,n),dl=i,fl=a}break;case 30:break;default:Ml(e,n)}}function vl(e){var t=e.alternate;t!==null&&(e.alternate=null,vl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yl=null,bl=!1;function xl(e,t,n){for(n=n.child;n!==null;)Sl(e,t,n),n=n.sibling}function Sl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:fl||rl(n,t),xl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:fl||rl(n,t);var r=yl,i=bl;_f(n.type)&&(yl=n.stateNode,bl=!1),xl(e,t,n),jf(n.stateNode),yl=r,bl=i;break;case 5:fl||rl(n,t);case 6:if(r=yl,i=bl,yl=null,xl(e,t,n),yl=r,bl=i,yl!==null){if(bl)try{(yl.nodeType===9?yl.body:yl.nodeName===`HTML`?yl.ownerDocument.body:yl).removeChild(n.stateNode)}catch(e){cd(n,t,e)}else try{yl.removeChild(n.stateNode)}catch(e){cd(n,t,e)}}break;case 18:yl!==null&&(bl?(e=yl,I(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Zp(e)):I(yl,n.stateNode));break;case 4:r=yl,i=bl,yl=n.stateNode.containerInfo,bl=!0,xl(e,t,n),yl=r,bl=i;break;case 0:case 11:case 14:case 15:$c(2,n,t),fl||$c(4,n,t),xl(e,t,n);break;case 1:fl||(rl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&tl(n,t,r)),xl(e,t,n);break;case 21:xl(e,t,n);break;case 22:fl=(r=fl)||n.memoizedState!==null,xl(e,t,n),fl=r;break;default:xl(e,t,n)}}function Cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zp(e)}catch(e){cd(t,t.return,e)}}}function wl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zp(e)}catch(e){cd(t,t.return,e)}}function Tl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ml),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ml),t;default:throw Error(i(435,e.tag))}}function El(e,t){var n=Tl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=pd.bind(null,e,t);t.then(r,r)}})}function Dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(_f(c.type)){yl=c.stateNode,bl=!1;break a}break;case 5:yl=c.stateNode,bl=!1;break a;case 3:case 4:yl=c.stateNode.containerInfo,bl=!0;break a}c=c.return}if(yl===null)throw Error(i(160));Sl(o,s,a),yl=null,bl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kl(t,e),t=t.sibling}var Ol=null;function kl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Dl(t,e),Al(e),r&4&&($c(3,e,e.return),Qc(3,e),$c(5,e,e.return));break;case 1:Dl(t,e),Al(e),r&512&&(fl||n===null||rl(n,n.return)),r&64&&dl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Ol;if(Dl(t,e),Al(e),r&512&&(fl||n===null||rl(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),ef(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=ap(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),ef(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ap(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),ef(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else op(a,e.type,e.stateNode)}else e.stateNode=ep(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&al(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?op(a,e.type,e.stateNode):ep(a,r,e.memoizedProps))}break;case 27:Dl(t,e),Al(e),r&512&&(fl||n===null||rl(n,n.return)),n!==null&&r&4&&al(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Dl(t,e),Al(e),r&512&&(fl||n===null||rl(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){cd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,al(e,a,n===null?a:n.memoizedProps)),r&1024&&(pl=!0);break;case 6:if(Dl(t,e),Al(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){cd(e,e.return,t)}}break;case 3:if(ip=null,a=Ol,Ol=Pf(t.containerInfo),Dl(t,e),Ol=a,Al(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zp(t.containerInfo)}catch(t){cd(e,e.return,t)}pl&&(pl=!1,jl(e));break;case 4:r=Ol,Ol=Pf(e.stateNode.containerInfo),Dl(t,e),Al(e),Ol=r;break;case 12:Dl(t,e),Al(e);break;case 31:Dl(t,e),Al(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 13:Dl(t,e),Al(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(gu=Ne()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=dl,d=fl;if(dl=u||a,fl=d||l,Dl(t,e),fl=d,dl=u,Al(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||dl||fl||Nl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){cd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){cd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?vf(m,!0):vf(l.stateNode,!1)}catch(e){cd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,El(e,n))));break;case 19:Dl(t,e),Al(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 30:break;case 21:break;default:Dl(t,e),Al(e)}}function Al(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(ol(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ll(e,sl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),ll(e,sl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;cl(e,sl(e),s);break;default:throw Error(i(161))}}catch(t){cd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;jl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_l(e,t.alternate,t),t=t.sibling}function Nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$c(4,t,t.return),Nl(t);break;case 1:rl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&tl(t,t.return,n),Nl(t);break;case 27:jf(t.stateNode);case 26:case 5:rl(t,t.return),Nl(t);break;case 22:t.memoizedState===null&&Nl(t);break;case 30:Nl(t);break;default:Nl(t)}e=e.sibling}}function Pl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Pl(i,a,n),Qc(4,a);break;case 1:if(Pl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){cd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)to(c[i],s)}catch(e){cd(r,r.return,e)}}n&&o&64&&el(a),nl(a,a.return);break;case 27:ul(a);case 26:case 5:Pl(i,a,n),n&&r===null&&o&4&&il(a),nl(a,a.return);break;case 12:Pl(i,a,n);break;case 31:Pl(i,a,n),n&&o&4&&Cl(i,a);break;case 13:Pl(i,a,n),n&&o&4&&wl(i,a);break;case 22:a.memoizedState===null&&Pl(i,a,n),nl(a,a.return);break;case 30:break;default:Pl(i,a,n)}t=t.sibling}}function Fl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ma(n))}function Il(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ma(e))}function Ll(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rl(e,t,n,r),t=t.sibling}function Rl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ll(e,t,n,r),i&2048&&Qc(9,t);break;case 1:Ll(e,t,n,r);break;case 3:Ll(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ma(e)));break;case 12:if(i&2048){Ll(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){cd(t,t.return,e)}}else Ll(e,t,n,r);break;case 31:Ll(e,t,n,r);break;case 13:Ll(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ll(e,t,n,r):(a._visibility|=2,zl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Ll(e,t,n,r):Bl(e,t),i&2048&&Fl(o,t);break;case 24:Ll(e,t,n,r),i&2048&&Il(t.alternate,t);break;default:Ll(e,t,n,r)}}function zl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:zl(a,o,s,c,i),Qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zl(a,o,s,c,i)):u._visibility&2?zl(a,o,s,c,i):Bl(a,o),i&&l&2048&&Fl(o.alternate,o);break;case 24:zl(a,o,s,c,i),i&&l&2048&&Il(o.alternate,o);break;default:zl(a,o,s,c,i)}t=t.sibling}}function Bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Bl(n,r),i&2048&&Fl(r.alternate,r);break;case 24:Bl(n,r),i&2048&&Il(r.alternate,r);break;default:Bl(n,r)}t=t.sibling}}var Vl=8192;function Hl(e,t,n){if(e.subtreeFlags&Vl)for(e=e.child;e!==null;)Ul(e,t,n),e=e.sibling}function Ul(e,t,n){switch(e.tag){case 26:Hl(e,t,n),e.flags&Vl&&e.memoizedState!==null&&lp(n,Ol,e.memoizedState,e.memoizedProps);break;case 5:Hl(e,t,n);break;case 3:case 4:var r=Ol;Ol=Pf(e.stateNode.containerInfo),Hl(e,t,n),Ol=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vl,Vl=16777216,Hl(e,t,n),Vl=r):Hl(e,t,n));break;default:Hl(e,t,n)}}function Wl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Gl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hl=r,Jl(r,e)}Wl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kl(e),e=e.sibling}function Kl(e){switch(e.tag){case 0:case 11:case 15:Gl(e),e.flags&2048&&$c(9,e,e.return);break;case 3:Gl(e);break;case 12:Gl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ql(e)):Gl(e);break;default:Gl(e)}}function ql(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hl=r,Jl(r,e)}Wl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$c(8,t,t.return),ql(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ql(t));break;default:ql(t)}e=e.sibling}}function Jl(e,t){for(;hl!==null;){var n=hl;switch(n.tag){case 0:case 11:case 15:$c(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,hl=r;else a:for(n=e;hl!==null;){r=hl;var i=r.sibling,a=r.return;if(vl(r),r===n){hl=null;break a}if(i!==null){i.return=a,hl=i;break a}hl=a}}}var Yl={getCacheForType:function(e){var t=oa(fa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return oa(fa).controller.signal}},Xl=typeof WeakMap==`function`?WeakMap:Map,Zl=0,Ql=null,$l=null,eu=0,tu=0,nu=null,ru=!1,iu=!1,au=!1,ou=0,su=0,cu=0,lu=0,uu=0,du=0,fu=0,pu=null,mu=null,hu=!1,gu=0,_u=0,vu=1/0,yu=null,bu=null,xu=0,Su=null,Cu=null,wu=0,Tu=0,Eu=null,Du=null,Ou=0,ku=null;function Au(){return Zl&2&&eu!==0?eu&-eu:k.T===null?ut():kd()}function ju(){if(du===0){if(!(eu&536870912)||zi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),du=e}else du=536870912}return e=co.current,e!==null&&(e.flags|=32),du}function Mu(e,t,n){(e===Ql&&(tu===2||tu===9)||e.cancelPendingCommit!==null)&&(zu(e,0),Iu(e,eu,du,!1)),rt(e,n),(!(Zl&2)||e!==Ql)&&(e===Ql&&(!(Zl&2)&&(lu|=n),su===4&&Iu(e,eu,du,!1)),xd(e))}function Nu(e,t,n){if(Zl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),a=r?qu(e,t):Gu(e,t,!0),o=r;do{if(a===0){iu&&!r&&Iu(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fu(n)){a=Gu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=pu;var l=c.current.memoizedState.isDehydrated;if(l&&(zu(c,s).flags|=256),s=Gu(c,s,!1),s!==2){if(au&&!l){c.errorRecoveryDisabledLanes|=o,lu|=o,a=4;break a}o=mu,mu=a,o!==null&&(mu===null?mu=o:mu.push.apply(mu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zu(e,0),Iu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Iu(r,t,du,!ru);break a;case 2:mu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=gu+300-Ne(),10<a)){if(Iu(r,t,du,!ru),Qe(r,0,!0)!==0)break a;wu=t,r.timeoutHandle=F(Pu.bind(null,r,n,mu,yu,hu,t,du,lu,fu,ru,o,`Throttled`,-0,0),a);break a}Pu(r,n,mu,yu,hu,t,du,lu,fu,ru,o,null,-0,0)}break}while(1);xd(e)}function Pu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Ul(t,a,d);var m=(a&62914560)===a?gu-Ne():(a&4194048)===a?_u-Ne():0;if(m=dp(d,m),m!==null){wu=a,e.cancelPendingCommit=m(ed.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Iu(e,a,o,!l);return}}ed(e,t,a,n,r,i,o,s,c)}function Fu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Er(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Iu(e,t,n,r){t&=~uu,t&=~lu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function Lu(){return Zl&6?!0:(Sd(0,!1),!1)}function Ru(){if($l!==null){if(tu===0)var e=$l.return;else e=$l,Qi=Zi=null,Lo(e),La=null,Ra=0,e=$l;for(;e!==null;)Zc(e.alternate,e),e=e.return;$l=null}}function zu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,pf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wu=0,Ru(),Ql=e,$l=n=mi(e.current,null),eu=t,tu=0,nu=null,ru=!1,iu=$e(e,t),au=!1,fu=du=uu=lu=cu=su=0,mu=pu=null,hu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return ou=t,ii(),n}function Bu(e,t){yo=null,k.H=Js,t===Da||t===ka?(t=Fa(),tu=3):t===Oa?(t=Fa(),tu=4):tu=t===fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nu=t,$l===null&&(su=1,oc(e,Si(t,e.current)))}function Vu(){var e=co.current;return e===null?!0:(eu&4194048)===eu?lo===null:(eu&62914560)===eu||eu&536870912?e===lo:!1}function Hu(){var e=k.H;return k.H=Js,e===null?Js:e}function Uu(){var e=k.A;return k.A=Yl,e}function Wu(){su=4,ru||(eu&4194048)!==eu&&co.current!==null||(iu=!0),!(cu&134217727)&&!(lu&134217727)||Ql===null||Iu(Ql,eu,du,!1)}function Gu(e,t,n){var r=Zl;Zl|=2;var i=Hu(),a=Uu();(Ql!==e||eu!==t)&&(yu=null,zu(e,t)),t=!1;var o=su;a:do try{if(tu!==0&&$l!==null){var s=$l,c=nu;switch(tu){case 8:Ru(),o=6;break a;case 3:case 2:case 9:case 6:co.current===null&&(t=!0);var l=tu;if(tu=0,nu=null,Zu(e,s,c,l),n&&iu){o=0;break a}break;default:l=tu,tu=0,nu=null,Zu(e,s,c,l)}}Ku(),o=su;break}catch(t){Bu(e,t)}while(1);return t&&e.shellSuspendCounter++,Qi=Zi=null,Zl=r,k.H=i,k.A=a,$l===null&&(Ql=null,eu=0,ii()),o}function Ku(){for(;$l!==null;)Yu($l)}function qu(e,t){var n=Zl;Zl|=2;var r=Hu(),a=Uu();Ql!==e||eu!==t?(yu=null,vu=Ne()+500,zu(e,t)):iu=$e(e,t);a:do try{if(tu!==0&&$l!==null){t=$l;var o=nu;b:switch(tu){case 1:tu=0,nu=null,Zu(e,t,o,1);break;case 2:case 9:if(ja(o)){tu=0,nu=null,Xu(t);break}t=function(){tu!==2&&tu!==9||Ql!==e||(tu=7),xd(e)},o.then(t,t);break a;case 3:tu=7;break a;case 4:tu=5;break a;case 7:ja(o)?(tu=0,nu=null,Xu(t)):(tu=0,nu=null,Zu(e,t,o,7));break;case 5:var s=null;switch($l.tag){case 26:s=$l.memoizedState;case 5:case 27:var c=$l;if(s?cp(s):c.stateNode.complete){tu=0,nu=null;var l=c.sibling;if(l!==null)$l=l;else{var u=c.return;u===null?$l=null:($l=u,Qu(u))}break b}}tu=0,nu=null,Zu(e,t,o,5);break;case 6:tu=0,nu=null,Zu(e,t,o,6);break;case 8:Ru(),su=6;break a;default:throw Error(i(462))}}Ju();break}catch(t){Bu(e,t)}while(1);return Qi=Zi=null,k.H=r,k.A=a,Zl=n,$l===null?(Ql=null,eu=0,ii(),su):0}function Ju(){for(;$l!==null&&!je();)Yu($l)}function Yu(e){var t=Hc(e.alternate,e,ou);e.memoizedProps=e.pendingProps,t===null?Qu(e):$l=t}function Xu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ec(n,t,t.pendingProps,t.type,void 0,eu);break;case 11:t=Ec(n,t,t.pendingProps,t.type.render,t.ref,eu);break;case 5:Lo(t);default:Zc(n,t),t=$l=hi(t,ou),t=Hc(n,t,ou)}e.memoizedProps=e.pendingProps,t===null?Qu(e):$l=t}function Zu(e,t,n,r){Qi=Zi=null,Lo(t),La=null,Ra=0;var i=t.return;try{if(dc(e,i,t,n,eu)){su=1,oc(e,Si(n,e.current)),$l=null;return}}catch(t){if(i!==null)throw $l=i,t;su=1,oc(e,Si(n,e.current)),$l=null;return}t.flags&32768?(zi||r===1?e=!0:iu||eu&536870912?e=!1:(ru=e=!0,(r===2||r===9||r===3||r===6)&&(r=co.current,r!==null&&r.tag===13&&(r.flags|=16384))),$u(t,e)):Qu(t)}function Qu(e){var t=e;do{if(t.flags&32768){$u(t,ru);return}e=t.return;var n=Yc(t.alternate,t,ou);if(n!==null){$l=n;return}if(t=t.sibling,t!==null){$l=t;return}$l=t=e}while(t!==null);su===0&&(su=5)}function $u(e,t){do{var n=Xc(e.alternate,e);if(n!==null){n.flags&=32767,$l=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){$l=e;return}$l=e=n}while(e!==null);su=6,$l=null}function ed(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do ad();while(xu!==0);if(Zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ri,it(e,n,o,s,c,l),e===Ql&&($l=Ql=null,eu=0),Cu=t,Su=e,wu=n,Tu=o,Eu=a,Du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,md(Le,function(){return od(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=k.T,k.T=null,a=A.p,A.p=2,s=Zl,Zl|=4;try{gl(e,t,n)}finally{Zl=s,A.p=a,k.T=r}}xu=1,td(),nd(),rd()}}function td(){if(xu===1){xu=0;var e=Su,t=Cu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=Zl;Zl|=4;try{kl(t,e);var a=of,o=jr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ar(s.ownerDocument.documentElement,s)){if(c!==null&&Mr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Tp=!!af,of=af=null}finally{Zl=i,A.p=r,k.T=n}}e.current=t,xu=2}}function nd(){if(xu===2){xu=0;var e=Su,t=Cu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=Zl;Zl|=4;try{_l(e,t.alternate,t)}finally{Zl=i,A.p=r,k.T=n}}xu=3}}function rd(){if(xu===4||xu===3){xu=0,Me();var e=Su,t=Cu,n=wu,r=Du;t.subtreeFlags&10256||t.flags&10256?xu=5:(xu=0,Cu=Su=null,id(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(bu=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}wu&3&&ad(),xd(e),i=e.pendingLanes,n&261930&&i&42?e===ku?Ou++:(Ou=0,ku=e):Ou=0,Sd(0,!1)}}function id(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ma(t)))}function ad(){return td(),nd(),rd(),od()}function od(){if(xu!==5)return!1;var e=Su,t=Tu;Tu=0;var n=lt(wu),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=Eu,Eu=null;var o=Su,s=wu;if(xu=0,Cu=Su=null,wu=0,Zl&6)throw Error(i(331));var c=Zl;if(Zl|=4,Kl(o.current),Rl(o,o.current,s,n),Zl=c,Sd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{A.p=a,k.T=r,id(e,t)}}function sd(e,t,n){t=Si(n,t),t=cc(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(rt(e,2),xd(e))}function cd(e,t,n){if(e.tag===3)sd(e,e,n);else for(;t!==null;){if(t.tag===3){sd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bu===null||!bu.has(r))){e=Si(n,e),n=lc(2),r=Ya(t,n,2),r!==null&&(uc(n,r,t,e),rt(r,2),xd(r));break}}t=t.return}}function ld(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xl;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)||(au=!0,i.add(n),e=ud.bind(null,e,t,n),t.then(e,e))}function ud(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ql===e&&(eu&n)===n&&(su===4||su===3&&(eu&62914560)===eu&&300>Ne()-gu?!(Zl&2)&&zu(e,0):uu|=n,fu===eu&&(fu=0)),xd(e)}function dd(e,t){t===0&&(t=tt()),e=si(e,t),e!==null&&(rt(e,t),xd(e))}function fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dd(e,n)}function pd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),dd(e,n)}function md(e,t){return ke(e,t)}var hd=null,gd=null,_d=!1,vd=!1,yd=!1,bd=0;function xd(e){e!==gd&&e.next===null&&(gd===null?hd=gd=e:gd=gd.next=e),vd=!0,_d||(_d=!0,Od())}function Sd(e,t){if(!yd&&vd){yd=!0;do for(var n=!1,r=hd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Dd(r,a))}else a=eu,a=Qe(r,r===Ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Dd(r,a))}r=r.next}while(n);yd=!1}}function Cd(){wd()}function wd(){vd=_d=!1;var e=0;bd!==0&&ff()&&(e=bd);for(var t=Ne(),n=null,r=hd;r!==null;){var i=r.next,a=Td(r,t);a===0?(r.next=null,n===null?hd=i:n.next=i,i===null&&(gd=n)):(n=r,(e!==0||a&3)&&(vd=!0)),r=i}xu!==0&&xu!==5||Sd(e,!1),bd!==0&&(bd=0)}function Td(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ql,n=eu,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(tu===2||tu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),lt(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=j;break;default:n=Le}return r=Ed.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function Ed(e,t){if(xu!==0&&xu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ad()&&e.callbackNode!==n)return null;var r=eu;return r=Qe(e,e===Ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nu(e,r,t),Td(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?Ed.bind(null,e):null)}function Dd(e,t){if(ad())return null;Nu(e,t,!0)}function Od(){hf(function(){Zl&6?ke(Fe,Cd):wd()})}function kd(){if(bd===0){var e=_a;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),bd=e}return bd}function Ad(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:rn(``+e)}function jd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ad((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Ad(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Tn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(bd!==0){var e=o?jd(i,o):new FormData(i);Ps(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?jd(i,o):new FormData(i),Ps(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Nd=0;Nd<Qr.length;Nd++){var Pd=Qr[Nd];$r(Pd.toLowerCase(),`on`+(Pd[0].toUpperCase()+Pd.slice(1)))}$r(Wr,`onAnimationEnd`),$r(Gr,`onAnimationIteration`),$r(Kr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(qr,`onTransitionRun`),$r(Jr,`onTransitionStart`),$r(Yr,`onTransitionCancel`),$r(Xr,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Fd=`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(` `),Id=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Fd));function Ld(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ei(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ei(e)}i.currentTarget=null,a=c}}}}function Rd(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Hd(t,e,2,!1),n.add(r))}function zd(e,t,n){var r=0;t&&(r|=4),Hd(n,e,r,t)}var Bd=`_reactListening`+Math.random().toString(36).slice(2);function Vd(e){if(!e[Bd]){e[Bd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Id.has(t)||zd(t,!1,e),zd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bd]||(t[Bd]=!0,zd(`selectionchange`,!1,t))}}function Hd(e,t,n,r){switch(Mp(t)){case 2:var i=Ep;break;case 8:i=Dp;break;default:i=Op}n=i.bind(null,t,n,e),i=void 0,!hn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ud(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=St(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}fn(function(){var r=a,i=sn(n),s=[];a:{var c=Zr.get(e);if(c!==void 0){var l=Tn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Un;break;case`focusin`:u=`focus`,l=Pn;break;case`focusout`:u=`blur`,l=Pn;break;case`beforeblur`:case`afterblur`:l=Pn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Wr:case Gr:case Kr:l=Fn;break;case Xr:l=Kn;break;case`scroll`:case`scrollend`:l=Dn;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Wn;break;case`toggle`:case`beforetoggle`:l=Jn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=pn(m,p),g!=null&&d.push(Wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==on&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Wn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&qd(s,c,l,d,!1),u!==null&&f!==null&&qd(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=mr;else if(cr(c)){if(hr)v=wr;else{v=Sr;var y=xr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&en(r.elementType)&&(v=mr):v=Cr;if(v&&=v(e,r)){lr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(cr(y)||y.contentEditable===`true`)&&(Pr=y,Fr=r,Ir=null);break;case`focusout`:Ir=Fr=Pr=null;break;case`mousedown`:Lr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Lr=!1,Rr(s,n,i);break;case`selectionchange`:if(Nr)break;case`keydown`:case`keyup`:Rr(s,n,i)}var b;if(Xn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ir?nr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&($n&&n.locale!==`ko`&&(ir||x!==`onCompositionStart`?x===`onCompositionEnd`&&ir&&(b=yn()):(_n=i,P=`value`in _n?_n.value:_n.textContent,ir=!0)),y=Gd(r,x),0<y.length&&(x=new Ln(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=rr(n),b!==null&&(x.data=b)))),(b=Qn?ar(e,n):or(e,n))&&(x=Gd(r,`onBeforeInput`),0<x.length&&(y=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Md(s,e,r,n,i)}Ld(s,t)})}function Wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=pn(e,n),i!=null&&r.unshift(Wd(e,i,a)),i=pn(e,t),i!=null&&r.push(Wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=pn(n,a),l!=null&&o.unshift(Wd(n,l,c))):i||(l=pn(n,a),l!=null&&o.push(Wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Jd=/\r\n?/g,Yd=/\u0000|\uFFFD/g;function Xd(e){return(typeof e==`string`?e:``+e).replace(Jd,`
10
+ `).replace(Yd,``)}function Zd(e,t){return t=Xd(t),Xd(e)===t}function Qd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:$t(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Qd(e,t,`name`,a.name,a,null),Qd(e,t,`formEncType`,a.formEncType,a,null),Qd(e,t,`formMethod`,a.formMethod,a,null),Qd(e,t,`formTarget`,a.formTarget,a,null)):(Qd(e,t,`encType`,a.encType,a,null),Qd(e,t,`method`,a.method,a,null),Qd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=an);break;case`onScroll`:r!=null&&Rd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Rd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=rn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Rd(`beforetoggle`,e),Rd(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=tn.get(n)||n,Ft(e,n,r))}}function $d(e,t,n,r,a,o){switch(n){case`style`:$t(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&Rd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Rd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=an);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function ef(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Rd(`error`,e),Rd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Qd(e,t,o,s,n,null)}}a&&Qd(e,t,`srcSet`,n.srcSet,n,null),r&&Qd(e,t,`src`,n.src,n,null);return;case`input`:Rd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Qd(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Rd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Qd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in Rd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Qd(e,t,s,c,n,null)}Xt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Qd(e,t,l,r,n,null)}return;case`dialog`:Rd(`beforetoggle`,e),Rd(`toggle`,e),Rd(`cancel`,e),Rd(`close`,e);break;case`iframe`:case`object`:Rd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Fd.length;r++)Rd(Fd[r],e);break;case`image`:Rd(`error`,e),Rd(`load`,e);break;case`details`:Rd(`toggle`,e);break;case`embed`:case`source`:case`link`:Rd(`error`,e),Rd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Qd(e,t,u,r,n,null)}return;default:if(en(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&$d(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Qd(e,t,c,r,n,null))}function tf(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Qd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Qd(e,t,p,m,r,f)}}M(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Qd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Qd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Qd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Qd(e,t,s,a,r,o)}Yt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Qd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Qd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Qd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Qd(e,t,u,p,r,m)}return;default:if(en(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&$d(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||$d(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Qd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Qd(e,t,f,p,r,m)}function nf(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function rf(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&nf(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&nf(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var af=null,of=null;function sf(e){return e.nodeType===9?e:e.ownerDocument}function cf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function lf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function uf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var df=null;function ff(){var e=window.event;return e&&e.type===`popstate`?e!==df&&(df=e,!0):(df=null,!1)}var F=typeof setTimeout==`function`?setTimeout:void 0,pf=typeof clearTimeout==`function`?clearTimeout:void 0,mf=typeof Promise==`function`?Promise:void 0,hf=typeof queueMicrotask==`function`?queueMicrotask:mf===void 0?F:function(e){return mf.resolve(null).then(e).catch(gf)};function gf(e){setTimeout(function(){throw e})}function _f(e){return e===`head`}function I(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)jf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,jf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&jf(e.ownerDocument.body)}n=i}while(n);Zp(t)}function vf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function yf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:yf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function bf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Ef(e.nextSibling),e===null)break}return null}function xf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Ef(e.nextSibling),e===null))return null;return e}function Sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Ef(e.nextSibling),e===null))return null;return e}function Cf(e){return e.data===`$?`||e.data===`$~`}function wf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Tf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Ef(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Df=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Ef(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function kf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Af(e,t,n){switch(t=sf(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function jf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Mf=new Map,Nf=new Set;function Pf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ff=A.d;A.d={f:If,r:Lf,D:Bf,C:Vf,L:Hf,m:Uf,X:Gf,S:Wf,M:Kf};function If(){var e=Ff.f(),t=Lu();return e||t}function Lf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Is(t):Ff.r(e)}var Rf=typeof document>`u`?null:document;function zf(e,t,n){var r=Rf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Nf.has(i)||(Nf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Bf(e){Ff.D(e),zf(`dns-prefetch`,e,null)}function Vf(e,t){Ff.C(e,t),zf(`preconnect`,e,t)}function Hf(e,t,n){Ff.L(e,t,n);var r=Rf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Jf(e);break;case`script`:a=Qf(e)}Mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Yf(a))||t===`script`&&r.querySelector($f(a))||(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Uf(e,t){Ff.m(e,t);var n=Rf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Qf(e)}if(!Mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector($f(a)))return}r=n.createElement(`link`),ef(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Wf(e,t,n){Ff.S(e,t,n);var r=Rf;if(r&&e){var i=Tt(r).hoistableStyles,a=Jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Yf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Mf.get(a))&&np(e,n);var c=o=r.createElement(`link`);Et(c),ef(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,tp(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Gf(e,t){Ff.X(e,t);var n=Rf;if(n&&e){var r=Tt(n).hoistableScripts,i=Qf(e),a=r.get(i);a||(a=n.querySelector($f(i)),a||(e=m({src:e,async:!0},t),(t=Mf.get(i))&&rp(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Kf(e,t){Ff.M(e,t);var n=Rf;if(n&&e){var r=Tt(n).hoistableScripts,i=Qf(e),a=r.get(i);a||(a=n.querySelector($f(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Mf.get(i))&&rp(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function qf(e,t,n,r){var a=(a=he.current)?Pf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Jf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Jf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Yf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Mf.set(e,n),o||Zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Qf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Jf(e){return`href="`+Gt(e)+`"`}function Yf(e){return`link[rel="stylesheet"][`+e+`]`}function Xf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),ef(t,`link`,n),Et(t),e.head.appendChild(t))}function Qf(e){return`[src="`+Gt(e)+`"]`}function $f(e){return`script[async]`+e}function ep(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),ef(r,`style`,a),tp(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Jf(n.href);var o=e.querySelector(Yf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Xf(n),(a=Mf.get(a))&&np(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ef(o,`link`,r),t.state.loading|=4,tp(o,n.precedence,e),t.instance=o;case`script`:return o=Qf(n.src),(a=e.querySelector($f(o)))?(t.instance=a,Et(a),a):(r=n,(a=Mf.get(o))&&(r=m({},n),rp(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),ef(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,tp(r,n.precedence,e));return t.instance}function tp(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function np(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function rp(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ip=null;function ap(e,t,n){if(ip===null){var r=new Map,i=ip=new Map;i.set(n,r)}else i=ip,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function op(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function sp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function cp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function lp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Jf(r.href),a=t.querySelector(Yf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Xf(r),(i=Mf.get(i))&&np(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ef(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=fp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var up=0;function dp(e,t){return e.stylesheets&&e.count===0&&mp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&up===0&&(up=62500*rf());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>up?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var pp=null;function mp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,pp=new Map,t.forEach(hp,e),pp=null,fp.call(e))}function hp(e,t){if(!(t.state.loading&4)){var n=pp.get(e);if(n)var r=n.get(null);else{n=new Map,pp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=fp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var gp={$$typeof:C,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function _p(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function vp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _p(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=fi(3,null,null,t),e.current=a,a.stateNode=e,t=pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ka(a),e}function yp(e){return e?(e=ui,e):ui}function bp(e,t,n,r,i,a){i=yp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ja(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ya(e,r,t),n!==null&&(Mu(n,e,t),Xa(n,e,t))}function xp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sp(e,t){xp(e,t),(e=e.alternate)&&xp(e,t)}function Cp(e){if(e.tag===13||e.tag===31){var t=si(e,67108864);t!==null&&Mu(t,e,67108864),Sp(e,67108864)}}function wp(e){if(e.tag===13||e.tag===31){var t=Au();t=ct(t);var n=si(e,t);n!==null&&Mu(n,e,t),Sp(e,t)}}var Tp=!0;function Ep(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,Op(e,t,n,r)}finally{A.p=a,k.T=i}}function Dp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,Op(e,t,n,r)}finally{A.p=a,k.T=i}}function Op(e,t,n,r){if(Tp){var i=kp(r);if(i===null)Ud(e,t,r,Ap,n),Vp(e,r);else if(Up(i,e,t,n,r))r.stopPropagation();else if(Vp(e,r),t&4&&-1<Bp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}xd(a),!(Zl&6)&&(vu=Ne()+500,Sd(0,!1))}}break;case 31:case 13:s=si(a,2),s!==null&&Mu(s,a,2),Lu(),Sp(a,2)}if(a=kp(r),a===null&&Ud(e,t,r,Ap,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ud(e,t,r,null,n)}}function kp(e){return e=sn(e),jp(e)}var Ap=null;function jp(e){if(Ap=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ap=e,null}function Mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case j:return 268435456;default:return 32}default:return 32}}var Np=!1,Pp=null,Fp=null,Ip=null,Lp=new Map,Rp=new Map,zp=[],Bp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Vp(e,t){switch(e){case`focusin`:case`focusout`:Pp=null;break;case`dragenter`:case`dragleave`:Fp=null;break;case`mouseover`:case`mouseout`:Ip=null;break;case`pointerover`:case`pointerout`:Lp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Rp.delete(t.pointerId)}}function Hp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&Cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Up(e,t,n,r,i){switch(t){case`focusin`:return Pp=Hp(Pp,e,t,n,r,i),!0;case`dragenter`:return Fp=Hp(Fp,e,t,n,r,i),!0;case`mouseover`:return Ip=Hp(Ip,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Lp.set(a,Hp(Lp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Rp.set(a,Hp(Rp.get(a)||null,e,t,n,r,i)),!0}return!1}function Wp(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){wp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){wp(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 Gp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);on=r,n.target.dispatchEvent(r),on=null}else return t=Ct(n),t!==null&&Cp(t),e.blockedOn=n,!1;t.shift()}return!0}function Kp(e,t,n){Gp(e)&&n.delete(t)}function qp(){Np=!1,Pp!==null&&Gp(Pp)&&(Pp=null),Fp!==null&&Gp(Fp)&&(Fp=null),Ip!==null&&Gp(Ip)&&(Ip=null),Lp.forEach(Kp),Rp.forEach(Kp)}function Jp(e,n){e.blockedOn===n&&(e.blockedOn=null,Np||(Np=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qp)))}var Yp=null;function Xp(e){Yp!==e&&(Yp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yp===e&&(Yp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(jp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Ps(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Zp(e){function t(t){return Jp(t,e)}Pp!==null&&Jp(Pp,e),Fp!==null&&Jp(Fp,e),Ip!==null&&Jp(Ip,e),Lp.forEach(t),Rp.forEach(t);for(var n=0;n<zp.length;n++){var r=zp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zp.length&&(n=zp[0],n.blockedOn===null);)Wp(n),n.blockedOn===null&&zp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Xp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(jp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Xp(n)}}}function Qp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function $p(e){this._internalRoot=e}em.prototype.render=$p.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;bp(n,Au(),e,t,null,null)},em.prototype.unmount=$p.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bp(e.current,2,null,e,null,null),Lu(),t[ht]=null}};function em(e){this._internalRoot=e}em.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zp.length&&t!==0&&t<zp[n].priority;n++);zp.splice(n,0,e),n===0&&Wp(e)}};var tm=n.version;if(tm!==`19.2.8`)throw Error(i(527,tm,`19.2.8`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var nm={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var rm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rm.isDisabled&&rm.supportsFiber)try{Ve=rm.inject(nm),He=rm}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=rc,s=ic,c=ac;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=vp(e,1,!1,null,null,n,r,null,o,s,c,Qp),e[ht]=t.current,Vd(e),new $p(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),y=o(((e,t)=>{t.exports=v()})),b=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),x=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),C=e=>{let t=S(e);return t.charAt(0).toUpperCase()+t.slice(1)},w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=l(d(),1),ee=(0,E.createContext)({}),D=()=>(0,E.useContext)(ee),te=(0,E.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=D()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,E.createElement)(`svg`,{ref:c,...w,width:t??l??w.width,height:t??l??w.height,stroke:e??f,strokeWidth:m,className:b(`lucide`,p,i),...!a&&!T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,E.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),O=(e,t)=>{let n=(0,E.forwardRef)(({className:n,...r},i)=>(0,E.createElement)(te,{ref:i,iconNode:t,className:b(`lucide-${x(C(e))}`,`lucide-${e}`,n),...r}));return n.displayName=C(e),n},ne=O(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),re=O(`book-open`,[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]),ie=O(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ae=O(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),oe=O(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),k=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),A=O(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),se=O(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ce=O(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),le=O(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ue=O(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),de=O(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),fe=O(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),pe=O(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),me=O(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),he=O(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ge=O(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),_e=O(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),ve=O(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ye=O(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),be=O(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),xe=O(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Se=O(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Ce=O(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),we=O(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Te=O(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Ee=O(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),De=O(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Oe=O(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ke=O(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ae=O(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),je=O(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Me=O(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ne=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Pe=O(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Fe=O(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Ie=O(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Le=O(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),Re=_(),j=y(),ze={codex:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,pi:`M0 0v24h6v-6h6v-6H6V6h6v6h6V0Zm18 12v12h6V12Z`,cursor:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`,claude:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,opencode:`M22 24H2V0h20zM17 4.8H7v14.4h10z`},Be={claude:`bg-agent-claude`,codex:`bg-agent-codex`,cursor:`bg-agent-cursor`,opencode:`bg-agent-opencode`,pi:`bg-agent-pi`};function Ve(e){return e&&Be[e]||`bg-line-strong`}function He({agentId:e,className:t=`size-4`}){let n=ze[e];return n?(0,j.jsx)(`svg`,{"aria-hidden":`true`,className:t,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,j.jsx)(`path`,{d:n})}):(0,j.jsx)(ie,{"aria-hidden":`true`,className:t,strokeWidth:1.5})}function Ue(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ue(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function We(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ue(e))&&(r&&(r+=` `),r+=t);return r}var Ge=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ke=(e,t)=>({classGroupId:e,validator:t}),qe=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Je=`-`,Ye=[],Xe=`arbitrary..`,Ze=e=>{let t=et(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return $e(e);let n=e.split(Je);return Qe(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ge(i,t):t:i||Ye}return n[e]||Ye}}},Qe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Qe(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Je):e.slice(t).join(Je),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},$e=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Xe+r:void 0})(),et=e=>{let{theme:t,classGroups:n}=e;return tt(n,t)},tt=(e,t)=>{let n=qe();for(let r in e){let i=e[r];nt(i,n,r,t)}return n},nt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];rt(i,t,n,r)}},rt=(e,t,n,r)=>{if(typeof e==`string`){it(e,t,n);return}if(typeof e==`function`){at(e,t,n,r);return}ot(e,t,n,r)},it=(e,t,n)=>{let r=e===``?t:st(t,e);r.classGroupId=n},at=(e,t,n,r)=>{if(ct(e)){nt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ke(n,e))},ot=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];nt(o,st(t,a),n,r)}},st=(e,t)=>{let n=e,r=t.split(Je),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=qe(),n.nextPart.set(t,i)),n=i}return n},ct=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,lt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ut=`!`,dt=`:`,ft=[],pt=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),mt=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===dt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ut)?(c=s.slice(0,-1),l=!0):s.startsWith(ut)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return pt(t,l,c,u)};if(t){let e=t+dt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):pt(ft,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ht=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},gt=e=>({cache:lt(e.cacheSize),parseClassName:mt(e),sortModifiers:ht(e),postfixLookupClassGroupIds:_t(e),...Ze(e)}),_t=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},vt=/\s+/,yt=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(vt),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ut:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},bt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=xt(n))&&(i&&(i+=` `),i+=r);return i},xt=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=xt(e[r]))&&(n&&(n+=` `),n+=t);return n},St=(e,...t)=>{let n,r,i,a,o=o=>(n=gt(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=yt(e,n);return i(e,a),a};return a=o,(...e)=>a(bt(...e))},Ct=[],wt=e=>{let t=t=>t[e]||Ct;return t.isThemeGetter=!0,t},Tt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Et=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ot=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,At=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nt=e=>Dt.test(e),Pt=e=>!!e&&!Number.isNaN(Number(e)),Ft=e=>!!e&&Number.isInteger(Number(e)),It=e=>e.endsWith(`%`)&&Pt(e.slice(0,-1)),Lt=e=>Ot.test(e),Rt=()=>!0,zt=e=>kt.test(e)&&!At.test(e),Bt=()=>!1,Vt=e=>jt.test(e),Ht=e=>Mt.test(e),Ut=e=>!M(e)&&!N(e),Wt=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Gt=e=>sn(e,dn,Bt),M=e=>Tt.test(e),Kt=e=>sn(e,fn,zt),qt=e=>sn(e,pn,Pt),Jt=e=>sn(e,hn,Rt),Yt=e=>sn(e,mn,Bt),Xt=e=>sn(e,ln,Bt),Zt=e=>sn(e,un,Ht),Qt=e=>sn(e,gn,Vt),N=e=>Et.test(e),$t=e=>cn(e,fn),en=e=>cn(e,mn),tn=e=>cn(e,ln),nn=e=>cn(e,dn),rn=e=>cn(e,un),an=e=>cn(e,gn,!0),on=e=>cn(e,hn,!0),sn=(e,t,n)=>{let r=Tt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cn=(e,t,n=!1)=>{let r=Et.exec(e);return r?r[1]?t(r[1]):n:!1},ln=e=>e===`position`||e===`percentage`,un=e=>e===`image`||e===`url`,dn=e=>e===`length`||e===`size`||e===`bg-size`,fn=e=>e===`length`,pn=e=>e===`number`,mn=e=>e===`family-name`,hn=e=>e===`number`||e===`weight`,gn=e=>e===`shadow`,_n=St(()=>{let e=wt(`color`),t=wt(`font`),n=wt(`text`),r=wt(`font-weight`),i=wt(`tracking`),a=wt(`leading`),o=wt(`breakpoint`),s=wt(`container`),c=wt(`spacing`),l=wt(`radius`),u=wt(`shadow`),d=wt(`inset-shadow`),f=wt(`text-shadow`),p=wt(`drop-shadow`),m=wt(`blur`),h=wt(`perspective`),g=wt(`aspect`),_=wt(`ease`),v=wt(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),N,M],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[N,M,c],T=()=>[Nt,`full`,`auto`,...w()],E=()=>[Ft,`none`,`subgrid`,N,M],ee=()=>[`auto`,{span:[`full`,Ft,N,M]},Ft,N,M],D=()=>[Ft,`auto`,N,M],te=()=>[`auto`,`min`,`max`,`fr`,N,M],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Nt,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[Nt,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[Nt,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,N,M],A=()=>[...b(),tn,Xt,{position:[N,M]}],se=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ce=()=>[`auto`,`cover`,`contain`,nn,Gt,{size:[N,M]}],le=()=>[It,$t,Kt],ue=()=>[``,`none`,`full`,l,N,M],de=()=>[``,Pt,$t,Kt],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[Pt,It,tn,Xt],he=()=>[``,`none`,m,N,M],ge=()=>[`none`,Pt,N,M],_e=()=>[`none`,Pt,N,M],ve=()=>[Pt,N,M],ye=()=>[Nt,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Lt],breakpoint:[Lt],color:[Rt],container:[Lt],"drop-shadow":[Lt],ease:[`in`,`out`,`in-out`],font:[Ut],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Lt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Lt],shadow:[Lt],spacing:[`px`,Pt],text:[Lt],"text-shadow":[Lt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Nt,M,N,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,N,M]}],"container-named":[Wt],columns:[{columns:[Pt,M,N,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ft,`auto`,N,M]}],basis:[{basis:[Nt,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Pt,Nt,`auto`,`initial`,`none`,M]}],grow:[{grow:[``,Pt,N,M]}],shrink:[{shrink:[``,Pt,N,M]}],order:[{order:[Ft,`first`,`last`,`none`,N,M]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,...ie()]}],"font-size":[{text:[`base`,n,$t,Kt]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,on,Jt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,It,M]}],"font-family":[{font:[en,Yt,t]}],"font-features":[{"font-features":[M]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,N,M]}],"line-clamp":[{"line-clamp":[Pt,`none`,N,qt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,N,M]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,N,M]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Pt,`from-font`,`auto`,N,Kt]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[Pt,`auto`,N,M]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ft,N,M]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,N,M]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,N,M]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ft,N,M],radial:[``,N,M],conic:[Ft,N,M]},rn,Zt]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Pt,N,M]}],"outline-w":[{outline:[``,Pt,$t,Kt]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`none`,u,an,Qt]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,an,Qt]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[Pt,Kt]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,an,Qt]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[Pt,N,M]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[N,M]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,N,M]}],filter:[{filter:[``,`none`,N,M]}],blur:[{blur:he()}],brightness:[{brightness:[Pt,N,M]}],contrast:[{contrast:[Pt,N,M]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,an,Qt]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,Pt,N,M]}],"hue-rotate":[{"hue-rotate":[Pt,N,M]}],invert:[{invert:[``,Pt,N,M]}],saturate:[{saturate:[Pt,N,M]}],sepia:[{sepia:[``,Pt,N,M]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,N,M]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Pt,N,M]}],"backdrop-contrast":[{"backdrop-contrast":[Pt,N,M]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Pt,N,M]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pt,N,M]}],"backdrop-invert":[{"backdrop-invert":[``,Pt,N,M]}],"backdrop-opacity":[{"backdrop-opacity":[Pt,N,M]}],"backdrop-saturate":[{"backdrop-saturate":[Pt,N,M]}],"backdrop-sepia":[{"backdrop-sepia":[``,Pt,N,M]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,N,M]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Pt,`initial`,N,M]}],ease:[{ease:[`linear`,`initial`,_,N,M]}],delay:[{delay:[Pt,N,M]}],animate:[{animate:[`none`,v,N,M]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,N,M]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[N,M,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ft,N,M]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,N,M]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,N,M]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[Pt,$t,Kt,qt]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function P(...e){return _n(We(e))}var vn=`__default__`,yn={healthy:`就绪`,unavailable:`不可用`,needs_setup:`需要配置`,active:`运行中`,idle:`就绪`,closed:`已关闭`};function bn(e){let t=e.values.find(t=>t.value===e.currentValue);return t?t.name||t.value:`Agent 默认`}function xn(e,t){let n=Math.max(1,Math.round((new Date(t).getTime()-new Date(e).getTime())/1e3)),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${n}s`}function Sn(e){let t=Math.max(0,Date.now()-new Date(e).getTime());return t<6e4?`now`:t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`}function Cn(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e,null,2)}function wn(e){return e instanceof Error?e.message:String(e)}function Tn({agents:e,sessions:t,canCreate:n,onClose:r,onSelectAgent:i,onSelectSession:a,onCreateSession:o,onToggleTheme:s}){let[c,l]=(0,E.useState)(``),[u,d]=(0,E.useState)(0),f=(0,E.useMemo)(()=>{let r=[...e.map(e=>({id:`agent:${e.agent_id}`,group:`Agent`,title:e.display_name,hint:yn[e.status]??e.status,run:()=>i(e.agent_id)})),...t.map(e=>({id:`session:${e.session_id}`,group:`会话`,title:e.title||`未命名 Session`,hint:Sn(e.updated_at),run:()=>a(e)})),...n?[{id:`action:new`,group:`操作`,title:`新建 Session`,hint:`⌘N`,run:o}]:[],{id:`action:theme`,group:`操作`,title:`切换主题`,hint:``,run:s}],l=c.toLowerCase();return l?r.filter(e=>e.title.toLowerCase().includes(l)):r},[e,t,c,n,i,a,o,s]);(0,E.useEffect)(()=>d(0),[c]);function p(e){if(e.key===`Escape`){r();return}if(e.key===`ArrowDown`){e.preventDefault(),d(e=>Math.min(e+1,f.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),d(e=>Math.max(e-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=f[u];t&&(r(),t.run())}}let m=``;return(0,j.jsx)(`div`,{"aria-modal":`true`,className:`fixed inset-0 z-50 bg-canvas/80`,onClick:r,role:`dialog`,children:(0,j.jsxs)(`div`,{className:P(`surface-frosted mx-auto mt-[18vh] w-full max-w-[480px] overflow-hidden rounded-xl border`,`border-line-strong`,`shadow-panel`),onClick:e=>e.stopPropagation(),children:[(0,j.jsxs)(`div`,{className:P(`flex h-11 items-center gap-2 border-b px-3.5`,`border-line`),children:[(0,j.jsx)(Ee,{className:P(`size-4 shrink-0`,`text-muted`)}),(0,j.jsx)(`input`,{"aria-label":`命令面板`,autoFocus:!0,className:P(`min-w-0 flex-1 bg-transparent text-sm outline-none`,`text-ink`,`placeholder:text-faint`),onChange:e=>l(e.target.value),onKeyDown:p,placeholder:`切换 Agent / Session,或执行操作…`,value:c}),(0,j.jsx)(`kbd`,{className:P(`rounded border px-1.5 py-0.5 font-mono text-xs`,`text-faint`,`border-line`),children:`esc`})]}),(0,j.jsxs)(`div`,{className:`max-h-80 overflow-y-auto p-1.5`,children:[f.map((e,t)=>{let n=e.group===m?null:(m=e.group,(0,j.jsx)(`div`,{className:P(`px-2.5 pb-1 pt-2 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-faint`),children:e.group},`group-${e.group}`));return(0,j.jsxs)(E.Fragment,{children:[n,(0,j.jsxs)(`button`,{"aria-selected":t===u,className:P(`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-sm`,`text-ink`,t===u?`bg-surface-soft`:``),onClick:()=>{r(),e.run()},onMouseEnter:()=>d(t),ref:t===u?e=>e?.scrollIntoView({block:`nearest`}):void 0,type:`button`,children:[e.id.startsWith(`agent:`)?(0,j.jsx)(He,{agentId:e.id.slice(6),className:`size-3.5 shrink-0`}):e.id.startsWith(`session:`)?(0,j.jsx)(Me,{className:P(`size-3.5 shrink-0`,`text-muted`)}):(0,j.jsx)(Le,{className:P(`size-3.5 shrink-0`,`text-muted`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.hint&&(0,j.jsx)(`span`,{className:P(`shrink-0 font-mono text-xs`,`text-faint`),children:e.hint})]})]},e.id)}),f.length===0&&(0,j.jsx)(`div`,{className:P(`px-3 py-8 text-center text-xs`,`text-muted`),children:`没有匹配项`})]})]})})}function En(e){return e.category?.toLowerCase()===`model`||e.id.toLowerCase().includes(`model`)}function Dn(e){return e.category?.toLowerCase()===`mode`||e.id.toLowerCase().includes(`permission`)}function On(e){return e.category?.toLowerCase()===`thought_level`||e.id.toLowerCase().includes(`reasoning`)}function kn(e){let t=`${e.id} ${e.name}`.toLowerCase();return e.category?.toLowerCase()===`model_config`&&/\b(fast|speed)\b/.test(t)}function An(e,t){return e.type===`boolean`?t===`true`:t}function jn(e,t){let n=`${e} ${t??``}`.toLowerCase();return e.toLowerCase()===`true`||/\b(fast|quick)\b/.test(n)?`快速`:`标准`}function Mn(e){return[...e].sort((e,t)=>!!e.pinned_at==!!t.pinned_at?new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime():e.pinned_at?-1:1)}function Nn(e,t,n,r){let i=e.find(e=>e.session_id===t);if(i?.agent_id===n&&!i.archived_at)return i.session_id;let a=e.find(e=>e.session_id===r);return a?.agent_id===n&&!a.archived_at?a.session_id:null}function Pn(e,t){let n=t?e.find(e=>e.agent_id===t&&e.setup?.can_select_default):void 0;return n?n.agent_id:e.find(e=>e.setup?.can_select_default)?.agent_id??null}function Fn(e){return e?[...new Set([e.cwd,...e.additional_directories].filter(e=>!!e))]:[]}function In(e){let t=e.trimEnd().match(/(?:^|\s)([/@])([^\s]*)$/);return t?{kind:t[1]===`/`?`command`:`context`,query:t[2]??``}:null}function Ln(e,t){let n=t.trim().toLowerCase();return[...n?e.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(n)):e].sort((e,t)=>Number(t.name.startsWith(`$`))-Number(e.name.startsWith(`$`)))}function Rn(e,t){return e.trimEnd().replace(/([/@])[^\s]*$/,t)}function zn(e){return e.mimeType.startsWith(`image/`)?`data:${e.mimeType};base64,${e.dataBase64}`:null}function Bn({attachments:e,onRemove:t}){return e.length?(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,"data-composer-attachments":!0,children:e.map((e,n)=>{let r=zn(e);return(0,j.jsxs)(`div`,{className:P(`group relative overflow-hidden rounded-md border motion-safe:animate-chip-pop`,r?`size-16`:`inline-flex items-center gap-1.5 px-2 py-1 text-xs`,`border-line bg-surface-tint text-ink-soft`),"data-composer-attachment":!0,style:{animationDelay:`${n*50}ms`},children:[r?(0,j.jsx)(`img`,{alt:e.name,className:`size-full object-cover`,src:r}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ye,{className:`size-3`}),(0,j.jsx)(`span`,{className:`max-w-40 truncate`,children:e.name})]}),(0,j.jsx)(`button`,{"aria-label":`移除 ${e.name}`,className:P(r&&`absolute right-1 top-1 grid size-5 place-items-center rounded-full bg-surface`),onClick:()=>t(n),type:`button`,children:(0,j.jsx)(Ie,{className:`size-3`})})]},`${e.name}-${n}`)})}):null}var Vn=Object.defineProperty,Hn=(e,t)=>Vn(e,`name`,{value:t,configurable:!0});function Un(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Hn(Un,`setRef`);function Wn(...e){return t=>{let n=!1,r=e.map(e=>{let r=Un(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Un(e[t],null)}}}}Hn(Wn,`composeRefs`);function Gn(...e){return E.useCallback(Wn(...e),e)}Hn(Gn,`useComposedRefs`);var Kn=Object.defineProperty,qn=(e,t)=>Kn(e,`name`,{value:t,configurable:!0});function Jn(e){let t=E.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];rr(r)&&typeof sr==`function`&&(r=sr(r._payload)),E.Children.forEach(r,e=>{if(tr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;rr(n)&&typeof sr==`function`&&(n=sr(n._payload)),a=Qn(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=E.cloneElement(a,void 0,s):!o&&E.Children.count(r)===1&&E.isValidElement(r)&&(a=r);let c=a?er(a):void 0,l=Gn(n,c);if(!a){if(r||r===0)throw Error(o?or(e):ar(e));return r}let u=$n(i,a.props??{});return a.type!==E.Fragment&&(u.ref=n?l:c),E.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}qn(Jn,`createSlot`);var Yn=Jn(`Slot`),Xn=Symbol.for(`radix.slottable`);function Zn(e){let t=qn(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Xn,t}qn(Zn,`createSlottable`);var Qn=qn((e,t)=>{if(`child`in e.props){let t=e.props.child;return E.isValidElement(t)?E.cloneElement(t,void 0,e.props.children(t.props.children)):null}return E.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function $n(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}qn($n,`mergeProps`);function er(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qn(er,`getElementRef`);function tr(e){return E.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xn}qn(tr,`isSlottable`);var nr=Symbol.for(`react.lazy`);function rr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===nr&&`_payload`in e&&ir(e._payload)}qn(rr,`isLazyComponent`);function ir(e){return typeof e==`object`&&!!e&&`then`in e}qn(ir,`isPromiseLike`);var ar=qn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),or=qn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),sr=E.use,cr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,lr=We,ur=(e,t)=>n=>{if(t?.variants==null)return lr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=cr(t)||cr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return lr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},dr=ur(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-line-strong disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-surface-soft text-ink hover:bg-line`,secondary:`bg-ink text-canvas hover:opacity-90`,outline:`border border-line-strong bg-transparent text-ink hover:bg-surface-soft`,ghost:`text-muted hover:bg-surface-soft hover:text-ink`,destructive:`bg-danger-soft text-danger hover:opacity-90`},size:{default:`h-9 px-3`,sm:`h-8 rounded-md px-2.5 text-xs`,lg:`h-11 px-4`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),fr=E.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,j.jsx)(r?Yn:`button`,{className:P(dr({variant:t,size:n,className:e})),ref:a,...i}));fr.displayName=`Button`;var pr=Object.defineProperty,mr=(e,t)=>pr(e,`name`,{value:t,configurable:!0}),hr=!!(typeof window<`u`&&window.document&&window.document.createElement);function gr(e,t,{checkForDefaultPrevented:n=!0}={}){return mr(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}mr(gr,`composeEventHandlers`);function _r(e){if(!hr)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}mr(_r,`getOwnerWindow`);function vr(e){if(!hr)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}mr(vr,`getOwnerDocument`);function yr(e,t=!1){let{activeElement:n}=vr(e);if(!n?.nodeName)return null;if(br(n)&&n.contentDocument)return yr(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=vr(n).getElementById(e);if(t)return t}}return n}mr(yr,`getActiveElement`);function br(e){return e.tagName===`IFRAME`}mr(br,`isFrame`);var xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e,t){let n=E.createContext(t);n.displayName=e+`Context`;let r=Sr(e=>{let{children:t,...r}=e,i=E.useMemo(()=>r,Object.values(r));return(0,j.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=E.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Sr(i,`useContext`),[r,i]}Sr(Cr,`createContext`);function wr(e,t=[]){let n=[];function r(t,r){let i=E.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Sr(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=E.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=E.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Sr(s,`useContext`),[o,s]}Sr(r,`createContext`);let i=Sr(()=>{let t=n.map(e=>E.createContext(e));return Sr(function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Tr(i,...t)]}Sr(wr,`createContextScope`);function Tr(...e){let t=e[0];if(e.length===1)return t;let n=Sr(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Sr(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Sr(Tr,`composeContextScopes`);var Er=l(h(),1),Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0}),kr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Jn(`Primitive.${t}`),r=E.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ar(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}Or(Ar,`dispatchDiscreteCustomEvent`);var jr=Object.defineProperty,Mr=(e,t)=>jr(e,`name`,{value:t,configurable:!0});function Nr(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Mr(Nr,`useCallbackRef`);var Pr=Object.defineProperty,Fr=(e,t)=>Pr(e,`name`,{value:t,configurable:!0}),Ir=`dismissableLayer.update`,Lr=`dismissableLayer.pointerDownOutside`,Rr=`dismissableLayer.focusOutside`,zr,Br=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vr=E.forwardRef(Fr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=E.useContext(Br),[d,f]=E.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=E.useState({}),h=Gn(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=E.useRef(!1),C=Wr(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Gr(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,ee=Nr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return E.useEffect(()=>{if(T)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,T,ee]),E.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zr=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=zr))}},[d,p,n,u]),E.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kr())},[d,u]),E.useEffect(()=>{let e=Fr(()=>m({}),`handleUpdate`);return document.addEventListener(Ir,e),()=>document.removeEventListener(Ir,e)},[]),(0,j.jsx)(kr.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:gr(e.onFocusCapture,w.onFocusCapture),onBlurCapture:gr(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:gr(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Hr(){let e=E.useContext(Br),[t,n]=E.useState(null);return E.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Fr(Hr,`useDismissableLayerSurface`);var Ur=Fr(()=>!0,`IS_TRUE`);function Wr(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ur}=t,s=Nr(e),c=E.useRef(!1),l=E.useRef(!1),u=E.useRef(new Map),d=E.useRef(()=>{});return E.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Fr(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Fr(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Fr(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Fr(p,`handleInteractionBubble`);let m=Fr(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||qr(Lr,s,p,{discrete:!0})};if(Fr(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Fr(()=>c.current=!0,`onPointerDownCapture`)}}Fr(Wr,`usePointerDownOutside`);function Gr(e,t=globalThis?.document){let n=Nr(e),r=E.useRef(!1);return E.useEffect(()=>{let e=Fr(e=>{e.target&&!r.current&&qr(Rr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Fr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Fr(()=>r.current=!1,`onBlurCapture`)}}Fr(Gr,`useFocusOutside`);function Kr(){let e=new CustomEvent(Ir);document.dispatchEvent(e)}Fr(Kr,`dispatchUpdate`);function qr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ar(i,a):i.dispatchEvent(a)}Fr(qr,`handleAndDispatchCustomEvent`);var Jr=Object.defineProperty,Yr=(e,t)=>Jr(e,`name`,{value:t,configurable:!0}),Xr=0,Zr=null;function Qr(e){return $r(),e.children}Yr(Qr,`FocusGuards`);function $r(){E.useEffect(()=>{Zr||={start:ei(),end:ei()};let{start:e,end:t}=Zr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Xr++,()=>{Xr===1&&(Zr?.start.remove(),Zr?.end.remove(),Zr=null),Xr=Math.max(0,Xr-1)}},[])}Yr($r,`useFocusGuards`);function ei(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Yr(ei,`createFocusGuard`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=`focusScope.autoFocusOnMount`,ii=`focusScope.autoFocusOnUnmount`,ai={bubbles:!1,cancelable:!0},oi=E.forwardRef(ni(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=E.useState(null),l=Nr(i),u=Nr(a),d=E.useRef(null),f=Gn(t,c),p=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:pi(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||pi(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&pi(s)};ni(e,`handleFocusIn`),ni(t,`handleFocusOut`),ni(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),E.useEffect(()=>{if(s){mi.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ri,ai);s.addEventListener(ri,l),s.dispatchEvent(t),t.defaultPrevented||(si(_i(li(s)),{select:!0}),document.activeElement===e&&pi(s))}return()=>{s.removeEventListener(ri,l),setTimeout(()=>{let t=new CustomEvent(ii,ai);s.addEventListener(ii,u),s.dispatchEvent(t),t.defaultPrevented||pi(e??document.body,{select:!0}),s.removeEventListener(ii,u),mi.remove(p)},0)}}},[s,l,u,p]);let m=E.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ci(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&pi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&pi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(kr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function si(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(pi(r,{select:t}),document.activeElement!==n)return}ni(si,`focusFirst`);function ci(e){let t=li(e);return[ui(t,e),ui(t.reverse(),e)]}ni(ci,`getTabbableEdges`);function li(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ni(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ni(li,`getTabbableCandidates`);function ui(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):di(r,{upTo:t})))return r}ni(ui,`findVisible`);function di(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ni(di,`isHidden`);function fi(e){return e instanceof HTMLInputElement&&`select`in e}ni(fi,`isSelectableInput`);function pi(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fi(e)&&t&&e.select()}}ni(pi,`focus`);var mi=hi();function hi(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=gi(e,t),e.unshift(t)},remove(t){e=gi(e,t),e[0]?.resume()}}}ni(hi,`createFocusScopesStack`);function gi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ni(gi,`arrayRemove`);function _i(e){return e.filter(e=>e.tagName!==`A`)}ni(_i,`removeLinks`);var vi=globalThis?.document?E.useLayoutEffect:()=>{},yi=Object.defineProperty,bi=(e,t)=>yi(e,`name`,{value:t,configurable:!0}),xi=E.useId||(()=>void 0),Si=0;function Ci(e){let[t,n]=E.useState(xi());return vi(()=>{e||n(e=>e??String(Si++))},[e]),e||(t?`radix-${t}`:``)}bi(Ci,`useId`);var wi=[`top`,`right`,`bottom`,`left`],Ti=Math.min,Ei=Math.max,Di=Math.round,Oi=Math.floor,ki=e=>({x:e,y:e}),Ai={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ji(e,t,n){return Ei(e,Ti(t,n))}function Mi(e,t){return typeof e==`function`?e(t):e}function Ni(e){return e.split(`-`)[0]}function Pi(e){return e.split(`-`)[1]}function Fi(e){return e===`x`?`y`:`x`}function Ii(e){return e===`y`?`height`:`width`}function Li(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ri(e){return Fi(Li(e))}function zi(e,t,n){n===void 0&&(n=!1);let r=Pi(e),i=Ri(e),a=Ii(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ji(o)),[o,Ji(o)]}function Bi(e){let t=Ji(e);return[Vi(e),t,Vi(t)]}function Vi(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Hi=[`left`,`right`],Ui=[`right`,`left`],Wi=[`top`,`bottom`],Gi=[`bottom`,`top`];function Ki(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ui:Hi:t?Hi:Ui;case`left`:case`right`:return t?Wi:Gi;default:return[]}}function qi(e,t,n,r){let i=Pi(e),a=Ki(Ni(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Vi)))),a}function Ji(e){let t=Ni(e);return Ai[t]+e.slice(t.length)}function Yi(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Xi(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Yi(e)}function Zi(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Qi(e,t,n){let{reference:r,floating:i}=e,a=Li(t),o=Ri(t),s=Ii(o),c=Ni(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Pi(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function $i(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Mi(t,e),p=Xi(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Zi(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Zi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ea=50,ta=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$i},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ea&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Qi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},na=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Mi(e,t)||{};if(l==null)return{};let d=Xi(u),f={x:n,y:r},p=Ri(i),m=Ii(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ti(d[_],T),ee=Ti(d[v],T),D=C-h[m]-ee,te=C/2-h[m]/2+w,O=ji(E,te,D),ne=!c.arrow&&Pi(i)!=null&&te!==O&&a.reference[m]/2-(te<E?E:ee)-h[m]/2<0,re=ne?te<E?te-E:te-D:0;return{[p]:f[p]+re,data:{[p]:O,centerOffset:te-O-re,...ne&&{alignmentOffset:re}},reset:ne}}}),ra=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Mi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ni(r),_=Li(o),v=Ni(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ji(o)]:Bi(o)),x=p!==`none`;!d&&x&&b.push(...qi(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=zi(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Li(t)||T.every(e=>Li(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Li(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ia(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aa(e){return wi.some(t=>e[t]>=0)}var oa=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Mi(e,t);switch(i){case`referenceHidden`:{let e=ia(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:aa(e)}}}case`escaped`:{let e=ia(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:aa(e)}}}default:return{}}}}},sa=new Set([`left`,`top`]);async function ca(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ni(n),s=Pi(n),c=Li(n)===`y`,l=sa.has(o)?-1:1,u=a&&c?-1:1,d=Mi(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var la=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ca(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ua=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Mi(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Li(i),p=Fi(f),m=u[p],h=u[f],g=(e,t)=>ji(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},da=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Mi(e,t),u={x:n,y:r},d=Li(i),f=Fi(d),p=u[f],m=u[d],h=Mi(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=sa.has(Ni(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},fa=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Mi(e,t),c=await i.detectOverflow(t,s),l=Ni(n),u=Pi(n),d=Li(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ti(p-c[m],g),y=Ti(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ei(c.left,c.right):S=p-2*Ei(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function pa(){return typeof window<`u`}function ma(e){return _a(e)?(e.nodeName||``).toLowerCase():`#document`}function ha(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ga(e){return((_a(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _a(e){return pa()?e instanceof Node||e instanceof ha(e).Node:!1}function va(e){return pa()?e instanceof Element||e instanceof ha(e).Element:!1}function ya(e){return pa()?e instanceof HTMLElement||e instanceof ha(e).HTMLElement:!1}function ba(e){return!pa()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ha(e).ShadowRoot}function xa(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ma(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Sa(e){return/^(table|td|th)$/.test(ma(e))}function Ca(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wa=/transform|translate|scale|rotate|perspective|filter/,Ta=/paint|layout|strict|content/,Ea=e=>!!e&&e!==`none`,Da;function Oa(e){let t=va(e)?Ma(e):e;return Ea(t.transform)||Ea(t.translate)||Ea(t.scale)||Ea(t.rotate)||Ea(t.perspective)||!Aa()&&(Ea(t.backdropFilter)||Ea(t.filter))||wa.test(t.willChange||``)||Ta.test(t.contain||``)}function ka(e){let t=Pa(e);for(;ya(t)&&!ja(t);){if(Oa(t))return t;if(Ca(t))return null;t=Pa(t)}return null}function Aa(){return Da??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Da}function ja(e){return/^(html|body|#document)$/.test(ma(e))}function Ma(e){return ha(e).getComputedStyle(e)}function Na(e){return va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pa(e){if(ma(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ba(e)&&e.host||ga(e);return ba(t)?t.host:t}function Fa(e){let t=Pa(e);return ja(t)?(e.ownerDocument||e).body:ya(t)&&xa(t)?t:Fa(t)}function Ia(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Fa(e),i=r===e.ownerDocument?.body,a=ha(r);if(i){let e=La(a);return t.concat(a,a.visualViewport||[],xa(r)?r:[],e&&n?Ia(e):[])}return t.concat(r,Ia(r,[],n))}function La(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ra(e){let t=Ma(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ya(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Di(n)!==a||Di(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function za(e){return va(e)?e:e.contextElement}function Ba(e){let t=za(e);if(!ya(t))return ki(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ra(t),o=(a?Di(n.width):n.width)/r,s=(a?Di(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Va=ki(0);function Ha(e){let t=ha(e);return!Aa()||!t.visualViewport?Va:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ua(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ha(e)}function Wa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=za(e),o=ki(1);t&&(r?va(r)&&(o=Ba(r)):o=Ba(e));let s=Ua(a,n,r)?Ha(a):ki(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ha(a),t=va(r)?ha(r):r,n=e,i=La(n);for(;i&&t!==n;){let e=Ba(i),t=i.getBoundingClientRect(),r=Ma(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ha(i),i=La(n)}}return Zi({width:u,height:d,x:c,y:l})}function Ga(e,t){let n=Na(e).scrollLeft;return t?t.left+n:Wa(ga(e)).left+n}function Ka(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ga(e,n),y:n.top+t.scrollTop}}function qa(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ga(r),s=t?Ca(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ki(1),u=ki(0),d=ya(r);if((d||!a)&&((ma(r)!==`body`||xa(o))&&(c=Na(r)),d)){let e=Wa(r);l=Ba(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ka(o,c):ki(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ja(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ya(e){let t=Na(e),n=e.ownerDocument.body,r=Ei(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ei(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ga(e),o=-t.scrollTop;return Ma(n).direction===`rtl`&&(a+=Ei(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xa=25;function Za(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ha(e),a=ga(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Aa()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ga(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xa&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qa(e,t){let n=Wa(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ba(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $a(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Za(e,n,t);else if(t===`document`)r=Ya(ga(e));else if(va(t))r=Qa(t,n);else{let n=Ha(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zi(r)}function eo(e,t){let n=t.get(e);if(n)return n;let r=Ia(e,[],!1).filter(e=>va(e)&&ma(e)!==`body`),i=null,a=Ma(e).position===`fixed`,o=a?Pa(e):e;for(;va(o)&&!ja(o);){let e=Ma(o),t=Oa(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Pa(o)}return t.set(e,r),r}function to(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ca(t)?[]:eo(t,this._c):[].concat(n),r],o=$a(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$a(t,a[e],i);s=Ei(n.top,s),c=Ti(n.right,c),l=Ti(n.bottom,l),u=Ei(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function no(e){let{width:t,height:n}=Ra(e);return{width:t,height:n}}function ro(e,t,n){let r=ya(t),i=ga(t),a=n===`fixed`,o=Wa(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ki(0);if((r||!a)&&((ma(t)!==`body`||xa(i))&&(s=Na(t)),r)){let e=Wa(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ga(i));let l=i&&!r&&!a?Ka(i,s):ki(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function io(e){return Ma(e).position===`static`}function ao(e,t){if(!ya(e)||Ma(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ga(e)===n&&(n=n.ownerDocument.body),n}function oo(e,t){let n=ha(e);if(Ca(e))return n;if(!ya(e)){let t=Pa(e);for(;t&&!ja(t);){if(va(t)&&!io(t))return t;t=Pa(t)}return n}let r=ao(e,t);for(;r&&Sa(r)&&io(r);)r=ao(r,t);return r&&ja(r)&&io(r)&&!Oa(r)?n:r||ka(e)||n}var so=async function(e){let t=this.getOffsetParent||oo,n=this.getDimensions,r=await n(e.floating);return{reference:ro(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function co(e){return Ma(e).direction===`rtl`}var lo={convertOffsetParentRelativeRectToViewportRelativeRect:qa,getDocumentElement:ga,getClippingRect:to,getOffsetParent:oo,getElementRects:so,getClientRects:Ja,getDimensions:no,getScale:Ba,isElement:va,isRTL:co};function uo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fo(e,t,n){let r=null,i,a=ga(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Oi(d),h=Oi(a.clientWidth-(u+f)),g=Oi(a.clientHeight-(d+p)),_=Oi(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ei(0,Ti(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!uo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ha(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function po(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=za(e),u=i||a?[...l?Ia(l):[],...t?Ia(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fo(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wa(e):null;c&&g();function g(){let t=Wa(e);h&&!uo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mo=la,ho=ua,go=ra,_o=fa,vo=oa,yo=na,bo=da,xo=(e,t,n)=>{let r=new Map,i=n??{},a={...lo,...i.platform,_c:r};return ta(e,t,{...i,platform:a})},So=typeof document<`u`?E.useLayoutEffect:function(){};function Co(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Co(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Co(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function To(e,t){let n=wo(e);return Math.round(t*n)/n}function Eo(e){let t=E.useRef(e);return So(()=>{t.current=e}),t}function Do(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);Co(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,ee=Eo(c),D=Eo(i),te=Eo(l),O=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),xo(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};ne.current&&!Co(w.current,t)&&(w.current=t,Er.flushSync(()=>{d(t)}))})},[f,t,n,D,te]);So(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ne=E.useRef(!1);So(()=>(ne.current=!0,()=>{ne.current=!1}),[]),So(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,O);O()}},[b,x,O,ee,T]);let re=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ie=E.useMemo(()=>({reference:b,floating:x}),[b,x]),ae=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=To(ie.floating,u.x),r=To(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wo(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:O,refs:re,elements:ie,floatingStyles:ae}),[u,O,re,ie,ae])}var Oo=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:yo({element:r.current,padding:i}).fn(n):r?yo({element:r,padding:i}).fn(n):{}}}},ko=(e,t)=>{let n=mo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=(e,t)=>{let n=ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>({fn:bo(e).fn,options:[e,t]}),Mo=(e,t)=>{let n=go(e);return{name:n.name,fn:n.fn,options:[e,t]}},No=(e,t)=>{let n=_o(e);return{name:n.name,fn:n.fn,options:[e,t]}},Po=(e,t)=>{let n=vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fo=(e,t)=>{let n=Oo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Io=Object.defineProperty,Lo=(e,t)=>Io(e,`name`,{value:t,configurable:!0});function Ro(e){let[t,n]=E.useState(void 0);return vi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Lo(Ro,`useSize`);var zo=Object.defineProperty,Bo=(e,t)=>zo(e,`name`,{value:t,configurable:!0}),Vo=`Popper`,[Ho,Uo]=wr(Vo),[Wo,Go]=Ho(Vo),Ko=Bo(e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,j.jsx)(Wo,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),qo=`PopperAnchor`,Jo=E.forwardRef(Bo(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Go(qo,n),o=E.useRef(null),s=a.onAnchorChange,c=Gn(t,E.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=E.useRef(null);E.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ts(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,j.jsx)(kr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Yo=`PopperContent`,[Xo,Zo]=Ho(Yo),Qo=E.forwardRef(Bo(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Go(Yo,n),[_,v]=E.useState(null),y=Gn(t,v),[b,x]=E.useState(null),S=Ro(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],te=D.length>0,O={padding:ee,boundary:D.filter($o),altBoundary:te},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:oe}=Do({strategy:`fixed`,placement:T,whileElementsMounted:Bo((...e)=>po(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ko({mainAxis:i+w,alignmentAxis:o}),c&&Ao({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?jo():void 0,...O}),c&&Mo({...O}),No({...O,apply:Bo(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&Fo({element:b,padding:s}),es({arrowWidth:C,arrowHeight:w}),f&&Po({strategy:`referenceHidden`,...O,boundary:te?O.boundary:void 0})]}),k=g.setPlacementState;vi(()=>(k(ie),()=>{k(void 0)}),[ie,k]);let[A,se]=ts(ie),ce=Nr(m);vi(()=>{ae&&ce?.()},[ae,ce]);let le=oe.arrow?.x,ue=oe.arrow?.y,de=oe.arrow?.centerOffset!==0,[fe,pe]=E.useState();return vi(()=>{_&&pe(window.getComputedStyle(_).zIndex)},[_]),(0,j.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:fe,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,j.jsx)(Xo,{scope:n,placedSide:A,placedAlign:se,onArrowChange:x,arrowX:le,arrowY:ue,shouldHideArrow:de,children:(0,j.jsx)(kr.div,{"data-side":A,"data-align":se,...h,ref:y,style:{...h.style,animation:ae?h.style?.animation:`none`}})})})},`PopperContent`));function $o(e){return e!==null}Bo($o,`isNotNull`);var es=Bo(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ts(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ts(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Bo(ts,`getSideAndAlignFromPlacement`);var ns=Ko,rs=Jo,is=Qo,as=Object.defineProperty,ss=E.forwardRef(((e,t)=>as(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=E.useState(!1);vi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Er.createPortal((0,j.jsx)(kr.div,{...r,ref:t}),o):null},`Portal`)),cs=Object.defineProperty,ls=(e,t)=>cs(e,`name`,{value:t,configurable:!0});function us(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}ls(us,`useStateMachine`);var ds=ls(e=>{let{present:t,children:n}=e,r=fs(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=ms(r.ref,gs(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null},`Presence`);function fs(e){let[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef(`none`),o=E.useRef(void 0),[s,c]=us(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return E.useEffect(()=>{s===`mounted`?(a.current=o.current??hs(r.current),o.current=void 0):a.current=`none`},[s]),vi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=hs(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),vi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ls(a=>{let o=hs(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ls(e=>{e.target===t&&(a.current=hs(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:E.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=hs(t)}else r.current=null;n(e)},[])}}ls(fs,`usePresence`);function ps(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ls(ps,`setRef`);function ms(...e){let t=E.useRef(e);return t.current=e,E.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ps(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ps(n[e],null)}}},[])}ls(ms,`useStableComposedRefs`);function hs(e){return e?.animationName||`none`}ls(hs,`getAnimationName`);function gs(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ls(gs,`getElementRef`);var _s=Object.defineProperty,vs=(e,t)=>_s(e,`name`,{value:t,configurable:!0}),ys=E.useEffectEvent,bs=E.useInsertionEffect;function xs(e){if(typeof ys==`function`)return ys(e);let t=E.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof bs==`function`?bs(()=>{t.current=e}):vi(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}vs(xs,`useEffectEvent`);var Ss=Object.defineProperty,Cs=(e,t)=>Ss(e,`name`,{value:t,configurable:!0}),ws=E.useInsertionEffect||vi;function Ts({prop:e,defaultProp:t,onChange:n=Cs(()=>{},`onChange`),caller:r}){let[i,a,o]=Es({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,E.useCallback(t=>{if(s){let n=Ds(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Cs(Ts,`useControllableState`);function Es({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return ws(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Cs(Es,`useUncontrolledState`);function Ds(e){return typeof e==`function`}Cs(Ds,`isFunction`);var Os=Symbol(`RADIX:SYNC_STATE`);function ks(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=xs(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=E.useReducer((t,n)=>{if(n.type===Os)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=E.useRef(p);E.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=E.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return E.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Os,state:i})},[i,d.state,c]),[h,f]}Cs(ks,`useControllableStateReducer`);var As=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},js=new WeakMap,Ms=new WeakMap,Ns={},Ps=0,Fs=function(e){return e&&(e.host||Fs(e.parentNode))},Is=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Fs(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ls=function(e,t,n,r){var i=Is(t,Array.isArray(e)?e:[e]);Ns[n]||(Ns[n]=new WeakMap);var a=Ns[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(js.get(e)||0)+1,l=(a.get(e)||0)+1;js.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ms.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ps++,function(){o.forEach(function(e){var t=js.get(e)-1,i=a.get(e)-1;js.set(e,t),a.set(e,i),t||(Ms.has(e)||e.removeAttribute(r),Ms.delete(e)),i||e.removeAttribute(n)}),Ps--,Ps||(js=new WeakMap,js=new WeakMap,Ms=new WeakMap,Ns={})}},Rs=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||As(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ls(r,i,n,`aria-hidden`)):function(){return null}},zs=function(){return zs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zs.apply(this,arguments)};function Bs(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Vs(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Hs=`right-scroll-bar-position`,Us=`width-before-scroll-bar`,Ws=`with-scroll-bars-hidden`,Gs=`--removed-body-scroll-bar-size`;function Ks(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function qs(e,t){var n=(0,E.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Js=typeof window<`u`?E.useLayoutEffect:E.useEffect,Ys=new WeakMap;function Xs(e,t){var n=qs(t||null,function(t){return e.forEach(function(e){return Ks(e,t)})});return Js(function(){var t=Ys.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ks(e,null)}),i.forEach(function(e){r.has(e)||Ks(e,a)})}Ys.set(n,e)},[e]),n}function Zs(e){return e}function Qs(e,t){t===void 0&&(t=Zs);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function $s(e){e===void 0&&(e={});var t=Qs(null);return t.options=zs({async:!0,ssr:!1},e),t}var ec=function(e){var t=e.sideCar,n=Bs(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return E.createElement(r,zs({},n))};ec.isSideCarExport=!0;function tc(e,t){return e.useMedium(t),ec}var nc=$s(),rc=function(){},ic=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:rc,onWheelCapture:rc,onTouchMoveCapture:rc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Bs(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Xs([n,t]),C=zs(zs({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:nc,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?E.cloneElement(E.Children.only(s),zs(zs({},C),{ref:S})):E.createElement(v,zs({},C,{className:c,ref:S}),s))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ic.classNames={fullWidth:Us,zeroRight:Hs};var ac,oc=function(){if(ac)return ac;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function sc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=oc();return t&&e.setAttribute(`nonce`,t),e}function cc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var uc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sc())&&(cc(t,n),lc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dc=function(){var e=uc();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fc=function(){var e=dc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},pc={left:0,top:0,right:0,gap:0},mc=function(e){return parseInt(e||``,10)||0},hc=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[mc(n),mc(r),mc(i)]},gc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return pc;var t=hc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_c=fc(),vc=`data-scroll-locked`,yc=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
+ .${Ws} {
12
+ overflow: hidden ${r};
13
+ padding-right: ${s}px ${r};
14
+ }
15
+ body[${vc}] {
16
+ overflow: hidden ${r};
17
+ overscroll-behavior: contain;
18
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
19
+ padding-left: ${i}px;
20
+ padding-top: ${a}px;
21
+ padding-right: ${o}px;
22
+ margin-left:0;
23
+ margin-top:0;
24
+ margin-right: ${s}px ${r};
25
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
26
+ }
27
+
28
+ .${Hs} {
29
+ right: ${s}px ${r};
30
+ }
31
+
32
+ .${Us} {
33
+ margin-right: ${s}px ${r};
34
+ }
35
+
36
+ .${Hs} .${Hs} {
37
+ right: 0 ${r};
38
+ }
39
+
40
+ .${Us} .${Us} {
41
+ margin-right: 0 ${r};
42
+ }
43
+
44
+ body[${vc}] {
45
+ ${Gs}: ${s}px;
46
+ }
47
+ `},bc=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xc=function(){E.useEffect(function(){return document.body.setAttribute(vc,(bc()+1).toString()),function(){var e=bc()-1;e<=0?document.body.removeAttribute(vc):document.body.setAttribute(vc,e.toString())}},[])},Sc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xc();var a=E.useMemo(function(){return gc(i)},[i]);return E.createElement(_c,{styles:yc(a,!t,i,n?``:`!important`)})},Cc=!1;if(typeof window<`u`)try{var wc=Object.defineProperty({},"passive",{get:function(){return Cc=!0,!0}});window.addEventListener(`test`,wc,wc),window.removeEventListener(`test`,wc,wc)}catch{Cc=!1}var Tc=Cc?{passive:!1}:!1,Ec=function(e){return e.tagName===`TEXTAREA`},Dc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ec(e)&&n[t]===`visible`)},Oc=function(e){return Dc(e,`overflowY`)},kc=function(e){return Dc(e,`overflowX`)},Ac=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Nc(e,r)){var i=Pc(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jc=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Mc=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Nc=function(e,t){return e===`v`?Oc(t):kc(t)},Pc=function(e,t){return e===`v`?jc(t):Mc(t)},Fc=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ic=function(e,t,n,r,i){var a=Fc(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Pc(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Nc(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Lc=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rc=function(e){return[e.deltaX,e.deltaY]},zc=function(e){return e&&`current`in e?e.current:e},Bc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vc=function(e){return`
48
+ .block-interactivity-${e} {pointer-events: none;}
49
+ .allow-interactivity-${e} {pointer-events: all;}
50
+ `},Hc=0,Uc=[];function Wc(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(Hc++)[0],a=E.useState(fc)[0],o=E.useRef(e);E.useEffect(function(){o.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Vs([e.lockRef.current],(e.shards||[]).map(zc),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Lc(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ac(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ac(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ic(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!Uc.length||Uc[Uc.length-1]!==a)){var r=`deltaY`in n?Rc(n):Lc(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bc(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zc).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=E.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gc(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=E.useCallback(function(e){n.current=Lc(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,Rc(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,Lc(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return Uc.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Tc),document.addEventListener(`touchmove`,c,Tc),document.addEventListener(`touchstart`,u,Tc),function(){Uc=Uc.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Tc),document.removeEventListener(`touchmove`,c,Tc),document.removeEventListener(`touchstart`,u,Tc)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:Vc(i)}):null,p?E.createElement(Sc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kc=tc(nc,Wc),qc=E.forwardRef(function(e,t){return E.createElement(ic,zs({},e,{ref:t,sideCar:Kc}))});qc.classNames=ic.classNames;var Jc=Object.defineProperty,Yc=(e,t)=>Jc(e,`name`,{value:t,configurable:!0}),Xc=`Popover`,[Zc,Qc]=wr(Xc,[Uo]),$c=Uo(),[el,tl]=Zc(Xc),nl=Yc(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=$c(t),c=E.useRef(null),[l,u]=E.useState(!1),[d,f]=Ts({prop:r,defaultProp:i??!1,onChange:a,caller:Xc});return(0,j.jsx)(ns,{...s,children:(0,j.jsx)(el,{scope:t,contentId:Ci(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:E.useCallback(()=>u(!0),[]),onCustomAnchorRemove:E.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),rl=`PopoverTrigger`,il=E.forwardRef(Yc(function(e,t){let{__scopePopover:n,...r}=e,i=tl(rl,n),a=$c(n),o=Gn(t,i.triggerRef),s=(0,j.jsx)(kr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":hl(i.open),...r,ref:o,onClick:gr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,j.jsx)(rs,{asChild:!0,...a,children:s})},`PopoverTrigger`)),al=`PopoverPortal`,[ol,sl]=Zc(al,{forceMount:void 0}),cl=Yc(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=tl(al,t);return(0,j.jsx)(ol,{scope:t,forceMount:n,children:(0,j.jsx)(ds,{present:n||a.open,children:(0,j.jsx)(ss,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),ll=`PopoverContent`,ul=E.forwardRef(Yc(function(e,t){let n=sl(ll,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=tl(ll,e.__scopePopover);return(0,j.jsx)(ds,{present:r||a.open,children:a.modal?(0,j.jsx)(fl,{...i,ref:t}):(0,j.jsx)(pl,{...i,ref:t})})},`PopoverContent`)),dl=Jn(`PopoverContent.RemoveScroll`),fl=E.forwardRef(Yc(function(e,t){let n=tl(ll,e.__scopePopover),r=E.useRef(null),i=Gn(t,r),a=E.useRef(!1);return E.useEffect(()=>{let e=r.current;if(e)return Rs(e)},[]),(0,j.jsx)(qc,{as:dl,allowPinchZoom:!0,children:(0,j.jsx)(ml,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:gr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:gr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),pl=E.forwardRef(Yc(function(e,t){let n=tl(ll,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return(0,j.jsx)(ml,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),ml=E.forwardRef(Yc(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=tl(ll,n),p=$c(n);return $r(),(0,j.jsx)(oi,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,j.jsx)(Vr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,j.jsx)(is,{"data-state":hl(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function hl(e){return e?`open`:`closed`}Yc(hl,`getState`);var gl=nl,_l=il,vl=cl,yl=ul,bl=gl,xl=_l,Sl=E.forwardRef(({align:e=`center`,className:t,sideOffset:n=6,surface:r=`solid`,...i},a)=>(0,j.jsx)(vl,{children:(0,j.jsx)(yl,{align:e,className:P(`z-50 rounded-lg border p-3 outline-none shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r===`frosted`?`surface-frosted`:`bg-surface`,t),ref:a,sideOffset:n,...i})}));Sl.displayName=yl.displayName;var Cl=Object.defineProperty,wl=(e,t)=>Cl(e,`name`,{value:t,configurable:!0});function Tl(e,[t,n]){return Math.min(n,Math.max(t,e))}wl(Tl,`clamp`);var El=Object.defineProperty,Dl=(e,t)=>El(e,`name`,{value:t,configurable:!0});function Ol(e){let t=e+`CollectionProvider`,[n,r]=wr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Dl(e=>{let{scope:t,children:n}=e,r=E.useRef(null),a=E.useRef(new Map).current;return(0,j.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Jn(s),l=E.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Gn(t,a(s,n).collectionRef);return(0,j.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Jn(u),p=E.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=E.useRef(null),s=Gn(t,o),c=a(u,n);return E.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,j.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Dl(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}Dl(Ol,`createCollection`);var kl=new WeakMap,Al=class e extends Map{static{Dl(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],kl.set(this,!0)}set(e,t){return kl.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Nl(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=jl(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=jl(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return jl(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function jl(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ml(e,t);return n===-1?void 0:e[n]}Dl(jl,`at`);function Ml(e,t){let n=e.length,r=Nl(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Dl(Ml,`toSafeIndex`);function Nl(e){return e!==e||e===0?0:Math.trunc(e)}Dl(Nl,`toSafeInteger`);function Pl(e){let t=e+`CollectionProvider`,[n,r]=wr(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Al,setItemMap:Dl(()=>void 0,`setItemMap`)}),o=Dl(({state:e,...t})=>e?(0,j.jsx)(c,{...t,state:e}):(0,j.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Dl(e=>{let t=h();return(0,j.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Dl(e=>{let{scope:t,children:n,state:r}=e,a=E.useRef(null),[o,s]=E.useState(null),c=Gn(a,s),[l,u]=r;return E.useEffect(()=>{if(!o)return;let e=Rl(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,j.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Jn(l),d=E.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Gn(t,a(l,n).collectionRef);return(0,j.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Jn(f),m=E.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=E.useRef(null),[s,c]=E.useState(null),l=Gn(t,o,c),{setItemMap:u}=a(f,n),d=E.useRef(i);Fl(d.current,i)||(d.current=i);let m=d.current;return E.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Ll):(t.set(s,{...e,element:s}),t.toSorted(Ll)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Al(e)))}},[s,m,u]),(0,j.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return E.useState(new Al)}Dl(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Dl(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}Dl(Pl,`createCollection`);function Fl(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Dl(Fl,`shallowEqual`);function Il(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Dl(Il,`isElementPreceding`);function Ll(e,t){return!e[1].element||!t[1].element?0:Il(e[1].element,t[1].element)?-1:1}Dl(Ll,`sortByDocumentPosition`);function Rl(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Dl(Rl,`getChildListObserver`);var zl=Object.defineProperty,Bl=(e,t)=>zl(e,`name`,{value:t,configurable:!0}),Vl=E.createContext(void 0);function Hl(e){let t=E.useContext(Vl);return e||t||`ltr`}Bl(Hl,`useDirection`);var Ul=Object.defineProperty,Wl=(e,t)=>Ul(e,`name`,{value:t,configurable:!0});function Gl(e){let t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Wl(Gl,`usePrevious`);var Kl=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ql=Object.defineProperty,Jl=(e,t)=>ql(e,`name`,{value:t,configurable:!0}),Yl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Xl=[` `,`Enter`],Zl=`Select`,[Ql,$l,eu]=Ol(Zl),[tu,nu]=wr(Zl,[eu,Uo]),ru=Uo(),[iu,au]=tu(Zl),[ou,su]=tu(Zl);function cu(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=ru(t),[_,v]=E.useState(null),[y,b]=E.useState(null),[x,S]=E.useState(!1),C=Hl(l),[w,T]=Ts({prop:r,defaultProp:i??!1,onChange:a,caller:Zl}),[ee,D]=Ts({prop:o,defaultProp:s,onChange:c,caller:Zl}),te=E.useRef(null),O=E.useRef(ee);E.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=Jl(()=>D(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let ne=!_||!!m||!!_.closest(`form`),[re,ie]=E.useState(new Set),ae=Ci(),oe=Array.from(re).map(e=>e.props.value).join(`;`),k=E.useCallback(e=>{ie(t=>new Set(t).add(e))},[]),A=E.useCallback(e=>{ie(t=>{let n=new Set(t);return n.delete(e),n})},[]),se={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:ae,value:ee,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:te,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:re,nativeSelectKey:oe,isFormControl:ne};return(0,j.jsx)(ns,{...g,children:(0,j.jsx)(iu,{scope:t,...se,children:(0,j.jsx)(Ql.Provider,{scope:t,children:(0,j.jsx)(ou,{scope:t,onNativeOptionAdd:k,onNativeOptionRemove:A,children:Yu(h)?h(se):n})})})})}Jl(cu,`SelectProvider`);var lu=Jl(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,j.jsx)(cu,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,j.jsxs)(j.Fragment,{children:[n,e?(0,j.jsx)(Ju,{__scopeSelect:t}):null]})})},`Select`),uu=`SelectTrigger`,du=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ru(n),o=au(uu,n),s=o.disabled||r,c=Gn(t,o.onTriggerChange),l=$l(n),u=E.useRef(`touch`),[d,f,p]=Zu(e=>{let t=l().filter(e=>!e.disabled),n=Qu(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Jl(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,j.jsx)(rs,{asChild:!0,...a,children:(0,j.jsx)(kr.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Xu(o.value)?``:void 0,...i,ref:c,onClick:gr(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:gr(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:gr(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Yl.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),fu=`SelectValue`,pu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=au(fu,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Gn(t,c.onValueNodeChange);vi(()=>{l(u)},[l,u]);let f=Xu(c.value);return(0,j.jsx)(kr.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,j.jsx)(E.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),mu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,j.jsx)(kr.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[hu,gu]=tu(`SelectPortal`,{forceMount:void 0}),_u=Jl(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,j.jsx)(hu,{scope:e.__scopeSelect,forceMount:n,children:(0,j.jsx)(ss,{asChild:!0,...r})})},`SelectPortal`),vu=`SelectContent`,yu=E.forwardRef(Jl(function(e,t){let n=gu(vu,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=au(vu,e.__scopeSelect),[o,s]=E.useState();return vi(()=>{s(new DocumentFragment)},[]),(0,j.jsx)(ds,{present:r||a.open,children:({present:e})=>e?(0,j.jsx)(Tu,{...i,ref:t}):(0,j.jsx)(bu,{...i,fragment:o})})},`SelectContent`)),bu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Er.createPortal((0,j.jsx)(Su,{scope:n,children:(0,j.jsx)(Ql.Slot,{scope:n,children:(0,j.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),xu=10,[Su,Cu]=tu(vu),wu=Jn(`SelectContent.RemoveScroll`),Tu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=au(vu,n),[y,b]=E.useState(null),[x,S]=E.useState(null),C=Gn(t,b),[w,T]=E.useState(null),[ee,D]=E.useState(null),te=$l(n),[O,ne]=E.useState(!1),re=E.useRef(!1);E.useEffect(()=>{if(y)return Rs(y)},[y]),$r();let ie=E.useCallback(e=>{let[t,...n]=te().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[te,x]),ae=E.useCallback(()=>ie([w,y]),[ie,w,y]);E.useEffect(()=>{O&&ae()},[O,ae]);let{onOpenChange:oe,triggerPointerDownPosRef:k}=v;E.useEffect(()=>{if(y){let e={x:0,y:0},t=Jl(t=>{e={x:Math.abs(Math.round(t.pageX)-(k.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(k.current?.y??0))}},`handlePointerMove`),n=Jl(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||oe(!1),document.removeEventListener(`pointermove`,t),k.current=null},`handlePointerUp`);return k.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,oe,k]),E.useEffect(()=>{let e=Jl(()=>oe(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[oe]);let[A,se]=Zu(e=>{let t=te().filter(e=>!e.disabled),n=Qu(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ce=E.useCallback((e,t,n)=>{let r=!re.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(re.current=!0))},[v.value]),le=E.useCallback(()=>y?.focus(),[y]),ue=E.useCallback((e,t,n)=>{let r=!re.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),de=r===`popper`?Du:Eu,fe=de===Du?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,j.jsx)(Su,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ce,selectedItem:w,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:ae,selectedItemText:ee,position:r,isPositioned:O,searchRef:A,children:(0,j.jsx)(qc,{as:wu,allowPinchZoom:!0,children:(0,j.jsx)(oi,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:gr(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,j.jsx)(Vr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,j.jsx)(de,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...fe,onPlaced:()=>ne(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:gr(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=te().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ie(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Eu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=au(vu,n),o=Cu(vu,n),[s,c]=E.useState(null),[l,u]=E.useState(null),d=Gn(t,u),f=$l(n),p=E.useRef(!1),m=E.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=E.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xu,d=Tl(a,[xu,Math.max(xu,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-xu,d=Tl(a,[xu,Math.max(xu,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-xu*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-xu,ee=c-E,D=g.offsetHeight/2,te=g.offsetTop+D,O=m+v+te,ne=x-O;if(O<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=O+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+ne;s.style.height=t+`px`,h.scrollTop=O-E+h.offsetTop}s.style.margin=`${xu}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);vi(()=>y(),[y]);let[b,x]=E.useState();vi(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=E.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,j.jsx)(Ou,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,j.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,j.jsx)(kr.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Du=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=xu,...a}=e,o=ru(n);return(0,j.jsx)(is,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Ou,ku]=tu(vu,{}),Au=`SelectViewport`,ju=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Cu(Au,n),o=ku(Au,n),s=Gn(t,a.onViewportChange),c=E.useRef(0);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,j.jsx)(Ql.Slot,{scope:n,children:(0,j.jsx)(kr.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:gr(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-xu*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Mu,Nu]=tu(`SelectGroup`),Pu=`SelectItem`,[Fu,Iu]=tu(Pu),Lu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=au(Pu,n),c=Cu(Pu,n),l=s.value===r,[u,d]=E.useState(a??``),[f,p]=E.useState(!1),m=Gn(t,Nr(e=>c.itemRefCallback?.(e,r,i))),h=Ci(),g=E.useRef(`touch`),_=Jl(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,j.jsx)(Fu,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:E.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,j.jsx)(Ql.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,j.jsx)(kr.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:gr(o.onFocus,()=>p(!0)),onBlur:gr(o.onBlur,()=>p(!1)),onClick:gr(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:gr(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:gr(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:gr(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:gr(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:gr(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Xl.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Ru=`SelectItemText`,zu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=au(Ru,n),s=Cu(Ru,n),c=Iu(Ru,n),l=su(Ru,n),[u,d]=E.useState(null),f=Nr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Gn(t,d,c.onItemTextChange,f),m=u?.textContent,h=E.useMemo(()=>(0,j.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return vi(()=>(g(h),()=>_(h)),[g,_,h]),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(kr.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Xu(o.value)?Er.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Bu=`SelectItemIndicator`,Vu=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,...r}=e;return Iu(Bu,n).isSelected?(0,j.jsx)(kr.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Hu=`SelectScrollUpButton`,Uu=E.forwardRef(Jl(function(e,t){let n=Cu(Hu,e.__scopeSelect),r=ku(Hu,e.__scopeSelect),[i,a]=E.useState(!1),o=Gn(t,r.onScrollButtonChange);return vi(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Jl(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,j.jsx)(Ku,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Wu=`SelectScrollDownButton`,Gu=E.forwardRef(Jl(function(e,t){let n=Cu(Wu,e.__scopeSelect),r=ku(Wu,e.__scopeSelect),[i,a]=E.useState(!1),o=Gn(t,r.onScrollButtonChange);return vi(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Jl(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,j.jsx)(Ku,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Ku=E.forwardRef(Jl(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Cu(`SelectScrollButton`,n),o=E.useRef(null),s=$l(n),c=E.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return E.useEffect(()=>()=>c(),[c]),vi(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,j.jsx)(kr.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:gr(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:gr(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:gr(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),qu=`SelectBubbleInput`,Ju=E.forwardRef(Jl(function({__scopeSelect:e,...t},n){let r=au(qu,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=E.useRef(null),m=Gn(n,p),h=i??``,g=Gl(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return E.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,j.jsxs)(kr.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Kl,...t.style},ref:m,defaultValue:h,children:[Xu(i)&&!_?(0,j.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Yu(e){return typeof e==`function`}Jl(Yu,`isFunction`);function Xu(e){return e===``||e===void 0}Jl(Xu,`shouldShowPlaceholder`);function Zu(e){let t=Nr(e),n=E.useRef(``),r=E.useRef(0),i=E.useCallback(e=>{let i=n.current+e;t(i),Jl((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=E.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Jl(Zu,`useTypeaheadSearch`);function Qu(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$u(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Jl(Qu,`findNextItem`);function $u(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Jl($u,`wrapArray`);var ed=lu,td=pu,nd=E.forwardRef(({className:e,children:t,...n},r)=>(0,j.jsxs)(du,{className:P(`flex h-9 w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border px-3 py-2 text-sm outline-none transition-colors focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:truncate`,e),ref:r,...n,children:[t,(0,j.jsx)(mu,{asChild:!0,children:(0,j.jsx)(oe,{className:`size-3.5 shrink-0 opacity-60`})})]}));nd.displayName=du.displayName;var rd=E.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Uu,{className:P(`flex cursor-default items-center justify-center py-1`,e),ref:n,...t,children:(0,j.jsx)(se,{className:`size-3.5`})}));rd.displayName=Uu.displayName;var id=E.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Gu,{className:P(`flex cursor-default items-center justify-center py-1`,e),ref:n,...t,children:(0,j.jsx)(oe,{className:`size-3.5`})}));id.displayName=Gu.displayName;var ad=E.forwardRef(({className:e,children:t,position:n=`popper`,surface:r=`solid`,...i},a)=>(0,j.jsx)(_u,{children:(0,j.jsxs)(yu,{className:P(`relative z-50 max-h-[var(--radix-select-content-available-height)] min-w-[8rem] overflow-hidden rounded-lg border shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r===`frosted`?`surface-frosted`:`bg-surface`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,ref:a,...i,children:[(0,j.jsx)(rd,{}),(0,j.jsx)(ju,{className:P(`p-1`,n===`popper`&&`min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,j.jsx)(id,{})]})}));ad.displayName=yu.displayName;var od=E.forwardRef(({className:e,children:t,...n},r)=>(0,j.jsxs)(Lu,{className:P(`relative flex w-full cursor-default select-none items-center rounded-md py-2 pl-8 pr-3 text-xs outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),ref:r,...n,children:[(0,j.jsx)(`span`,{className:`absolute left-2.5 flex size-3.5 items-center justify-center`,children:(0,j.jsx)(Vu,{children:(0,j.jsx)(ae,{className:`size-3.5`})})}),(0,j.jsx)(zu,{children:t})]}));od.displayName=Lu.displayName;var sd=Object.defineProperty,cd=(e,t)=>sd(e,`name`,{value:t,configurable:!0}),ld=[`PageUp`,`PageDown`],ud=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],dd={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},fd=`Slider`,[pd,md,hd]=Ol(fd),[gd,_d]=wr(fd,[hd]),[vd,yd]=gd(fd),bd=E.forwardRef(cd(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=cd(()=>{},`onValueChange`),onValueCommit:f=cd(()=>{},`onValueCommit`),inverted:p=!1,form:m,...h}=e,g=E.useRef(new Set),_=E.useRef(0),v=E.useRef(!1),y=o===`horizontal`?Cd:wd,[b,x]=E.useState(null),S=Gn(t,x),[C=[],w]=Ts({prop:u,defaultProp:l,onChange:cd(e=>{[...g.current][_.current]?.focus({preventScroll:!0,focusVisible:v.current}),v.current=!1,d(e)},`onChange`)}),T=E.useRef(C),ee=E.useRef(C);E.useEffect(()=>{let e=m?b?.ownerDocument.getElementById(m):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=cd(()=>w(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,m,w]);function D(e){ne(e,Hd(C,e))}cd(D,`handleSlideStart`);function te(e){ne(e,_.current)}cd(te,`handleSlideMove`);function O(){String(C)!==String(T.current)&&f(C)}cd(O,`handleSlideEnd`);function ne(e,t,{commit:n}={commit:!1}){let o=qd(a),s=Tl(Jd(Math.round((e-r)/a)*a+r,o),[r,i]);w((e=[])=>{let r=zd(e,s,t);if(Gd(r,c*a)){_.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return cd(ne,`updateValues`),(0,j.jsx)(vd,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:C,orientation:o,form:m,children:(0,j.jsx)(pd.Provider,{scope:e.__scopeSlider,children:(0,j.jsx)(pd.Slot,{scope:e.__scopeSlider,children:(0,j.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:S,onPointerDown:gr(h.onPointerDown,()=>{s||(T.current=C,v.current=!1)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:D,onSlideMove:s?void 0:te,onSlideEnd:s?void 0:O,onHomeKeyDown:()=>{s||(v.current=!0,ne(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(v.current=!0,ne(i,C.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){v.current=!0;let n=ld.includes(e.key)||e.shiftKey&&ud.includes(e.key)?10:1,i=_.current,o=C[i];ne(Yd(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[xd,Sd]=gd(fd,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Cd=E.forwardRef(cd(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=E.useState(null),p=Gn(t,f),m=E.useRef(void 0),h=Hl(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=Kd([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return cd(v,`getValueFromPointer`),(0,j.jsx)(xd,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,j.jsx)(Td,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=dd[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),wd=E.forwardRef(cd(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=E.useRef(null),d=Gn(t,u),f=E.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=Kd([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return cd(m,`getValueFromPointer`),(0,j.jsx)(xd,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,j.jsx)(Td,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=dd[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Td=E.forwardRef(cd(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=yd(fd,n);return(0,j.jsx)(kr.span,{...l,ref:t,onKeyDown:gr(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):ld.concat(ud).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:gr(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:gr(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:gr(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),Ed=`SliderTrack`,Dd=E.forwardRef(cd(function(e,t){let{__scopeSlider:n,...r}=e,i=yd(Ed,n);return(0,j.jsx)(kr.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),Od=`SliderRange`,kd=E.forwardRef(cd(function(e,t){let{__scopeSlider:n,...r}=e,i=yd(Od,n),a=Sd(Od,n),o=Gn(t,E.useRef(null)),s=i.values.length,c=i.values.map(e=>Bd(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,j.jsx)(kr.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})},`SliderRange`)),[Ad,jd]=gd(`SliderThumb`),Md=`SliderThumbProvider`;function Nd(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=yd(Md,t),o=md(t),[s,c]=E.useState(null),l=E.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=Ro(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:Bd(f,a.min,a.max);E.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return(0,j.jsx)(Ad,{scope:t,...h,children:Xd(i)?i(h):r})}cd(Nd,`SliderThumbProvider`);var Pd=`SliderThumbTrigger`,Fd=E.forwardRef(cd(function(e,t){let{__scopeSlider:n,...r}=e,i=yd(Pd,n),a=Sd(Pd,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=jd(Pd,n),d=Gn(t,u),f=Vd(o,i.values.length),p=l?.[a.size],m=p?Ud(p,c,a.direction):0;return(0,j.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${m}px)`},children:(0,j.jsx)(pd.ItemSlot,{scope:n,children:(0,j.jsx)(kr.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:gr(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),Id=E.forwardRef(cd(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,j.jsx)(Nd,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Fd,{...i,ref:t,__scopeSlider:n}),r?(0,j.jsx)(Rd,{__scopeSlider:n},e):null]})})},`SliderThumb`)),Ld=`SliderBubbleInput`,Rd=E.forwardRef(cd(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=jd(Ld,e),o=E.useRef(null),s=Gn(o,n),c=Gl(r);return E.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(c!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),(0,j.jsx)(kr.input,{style:{display:`none`},name:i,form:a,...t,ref:s,defaultValue:r})},`SliderBubbleInput`));function zd(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}cd(zd,`getNextSortedValues`);function Bd(e,t,n){return Tl(100/(n-t)*(e-t),[0,100])}cd(Bd,`convertValueToPercentage`);function Vd(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}cd(Vd,`getLabel`);function Hd(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}cd(Hd,`getClosestValueIndex`);function Ud(e,t,n){let r=e/2;return(r-Kd([0,50],[0,r])(t)*n)*n}cd(Ud,`getThumbInBoundsOffset`);function Wd(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}cd(Wd,`getStepsBetweenValues`);function Gd(e,t){if(t>0){let n=Wd(e);return Math.min(...n)>=t}return!0}cd(Gd,`hasMinStepsBetweenValues`);function Kd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}cd(Kd,`linearScale`);function qd(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}cd(qd,`getDecimalCount`);function Jd(e,t){let n=10**t;return Math.round(e*n)/n}cd(Jd,`roundValue`);function Yd(e,{min:t,step:n,direction:r,multiplier:i}){let a=qd(n),o=(e-t)/n,s=Math.round(o),c=Jd(s*n+t,a)===Jd(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),Jd(l*n+t,a)}cd(Yd,`getNextStepValue`);function Xd(e){return typeof e==`function`}cd(Xd,`isFunction`);var Zd=E.forwardRef(({className:e,...t},n)=>(0,j.jsxs)(bd,{className:P(`relative flex w-full touch-none select-none items-center`,e),ref:n,...t,children:[(0,j.jsx)(Dd,{className:`relative h-1.5 w-full grow overflow-hidden rounded-full bg-current opacity-20`,children:(0,j.jsx)(kd,{className:`absolute h-full bg-current opacity-100 motion-safe:transition-[width] motion-safe:duration-150 motion-safe:ease-out`})}),(0,j.jsx)(Id,{className:`block size-4 rounded-full border-2 border-current bg-surface shadow-sm outline-none ring-offset-2 motion-safe:transition-[left,transform,box-shadow] motion-safe:duration-150 motion-safe:ease-out hover:scale-110 focus-visible:ring-2 active:scale-95 disabled:pointer-events-none disabled:opacity-50`})]}));Zd.displayName=bd.displayName;function Qd({hasWorkspace:e,onFiles:t,onPickDirectory:n,onWorkspaceContext:r}){return(0,j.jsxs)(bl,{children:[(0,j.jsx)(xl,{asChild:!0,children:(0,j.jsx)(fr,{"aria-label":`Composer actions`,className:`size-8 px-0`,size:`icon`,title:`添加内容`,variant:`ghost`,children:(0,j.jsx)(Ce,{className:`size-4`})})}),(0,j.jsxs)(Sl,{align:`start`,className:`grid w-64 gap-1 border-line-strong p-1.5 text-ink-soft shadow-panel`,side:`top`,surface:`frosted`,children:[(0,j.jsx)($d,{icon:(0,j.jsx)(ye,{className:`size-3.5`}),label:`添加文件`,onClick:t}),(0,j.jsx)($d,{disabled:!e,icon:(0,j.jsx)(me,{className:`size-3.5`}),label:`插入 Workspace 上下文`,onClick:r}),(0,j.jsx)($d,{icon:(0,j.jsx)(Ce,{className:`size-3.5`}),label:`添加 Workspace`,onClick:n})]})]})}function $d({disabled:e=!1,icon:t,label:n,onClick:r}){return(0,j.jsxs)(`button`,{className:`flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-ink-soft hover:bg-surface-soft disabled:opacity-50`,disabled:e,onClick:r,type:`button`,children:[t,n]})}function ef({onValue:e,option:t,value:n}){return t?(0,j.jsx)(sf,{ariaLabel:`Permission`,label:`Agent 默认`,onValue:e,option:t,value:n}):null}function tf({configOverrides:e,effort:t,model:n,modelOption:r,onConfigOverride:i,onEffort:a,onModel:o,speedOption:s,thoughtLevelOption:c}){if(!r&&!c&&!s)return(0,j.jsx)(`span`,{className:`inline-flex h-8 max-w-44 items-center rounded-md px-2 text-xs text-muted`,children:`Agent 默认`});let l=n||r?.currentValue||``,u=r?.values.find(e=>e.value===l),d=u?.name||u?.value||(r?bn(r):`Agent 默认`);return(0,j.jsxs)(bl,{children:[(0,j.jsx)(xl,{asChild:!0,children:(0,j.jsxs)(fr,{"aria-label":`Model and reasoning`,className:`h-8 max-w-52 gap-1.5 px-2 text-xs`,title:d,variant:`ghost`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:d}),(0,j.jsx)(oe,{className:`size-3 opacity-60`})]})}),(0,j.jsxs)(Sl,{align:`end`,className:`grid w-80 gap-4 border-line-strong text-ink-soft shadow-panel`,side:`top`,surface:`frosted`,children:[r&&(0,j.jsx)(nf,{label:`Model`,children:(0,j.jsx)(sf,{ariaLabel:r.name,label:bn(r),onValue:o,option:r,value:n,wide:!0})}),c&&(0,j.jsx)(rf,{onValue:a,option:c,value:t}),s&&(0,j.jsx)(nf,{label:`速度`,children:(0,j.jsx)(of,{onValue:e=>i(s,e),option:s,overridden:Object.hasOwn(e,s.id),value:String(e[s.id]??s.currentValue??`false`)})})]})]})}function nf({children:e,label:t}){return(0,j.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-ink`,children:t}),e]})}function rf({onValue:e,option:t,value:n}){let r=t.values.filter(e=>e.value.toLowerCase()!=="default"),i=r.length?r:t.values;if(!i.length)return null;let a=n||t.currentValue||i[0].value,o=Math.max(0,i.findIndex(e=>e.value===a));return(0,j.jsx)(af,{committedIndex:o,levels:i,onValue:e,value:n},a)}function af({committedIndex:e,levels:t,onValue:n,value:r}){let[i,a]=(0,E.useState)(e),o=t[i]??t[0];return(0,j.jsxs)(`div`,{className:`grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-ink`,children:`推理强度`}),(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[r&&(0,j.jsx)(`button`,{className:`text-xs text-muted underline underline-offset-2`,onClick:()=>n(``),type:`button`,children:`恢复默认`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-muted`,children:o.name||o.value})]})]}),(0,j.jsxs)(`div`,{className:`relative py-1`,children:[(0,j.jsx)(`div`,{className:`pointer-events-none absolute inset-x-1 top-1/2 flex -translate-y-1/2 justify-between`,children:t.map((e,t)=>(0,j.jsx)(`span`,{className:P(`size-1 rounded-full bg-current motion-safe:transition-[color,transform] motion-safe:duration-150`,i>=t?`text-control-accent`:`text-faint`,i===t&&`scale-150`)},`${e.value}-${t}`))}),(0,j.jsx)(Zd,{"aria-label":`Reasoning level`,className:`text-control-accent`,max:t.length-1,min:0,onValueChange:([e])=>a(e??0),onValueCommit:([e])=>n(t[e??0]?.value??``),step:1,value:[i]})]}),(0,j.jsxs)(`div`,{className:`flex justify-between text-xs text-faint`,children:[(0,j.jsx)(`span`,{children:t[0]?.name}),(0,j.jsx)(`span`,{children:t.at(-1)?.name})]}),(0,j.jsx)(`p`,{className:`min-h-4 text-xs leading-4 text-muted`,children:o.description??`Agent 提供的推理等级`})]})}function of({onValue:e,option:t,overridden:n,value:r}){let i=t.values.find(e=>e.value===r),a=jn(i?.value??r,i?.name);return(0,j.jsxs)(ed,{onValueChange:t=>e(t===`__default__`?``:t),value:n?r:vn,children:[(0,j.jsxs)(nd,{"aria-label":`速度`,className:`h-8 w-full border-line bg-surface-soft px-2 py-0 text-xs text-ink-soft shadow-none focus-visible:ring-1`,children:[(0,j.jsx)(ge,{className:`size-3`}),(0,j.jsx)(td,{children:a})]}),(0,j.jsxs)(ad,{className:`max-w-80 border-line-strong text-ink-soft shadow-panel`,surface:`frosted`,children:[(0,j.jsxs)(od,{className:`data-[highlighted]:bg-surface-soft`,value:vn,children:[`跟随默认(`,jn(t.currentValue??`false`),`)`]}),t.values.map(e=>(0,j.jsx)(od,{className:`data-[highlighted]:bg-surface-soft`,textValue:jn(e.value,e.name),value:e.value,children:(0,j.jsxs)(`span`,{className:`grid gap-0.5 py-0.5`,children:[(0,j.jsx)(`span`,{children:jn(e.value,e.name)}),(0,j.jsx)(`span`,{className:`max-w-72 text-xs font-normal leading-4 text-muted`,children:e.description??(jn(e.value,e.name)===`快速`?`响应更快,配额消耗更高`:`标准响应速度`)})]})},e.value))]})]})}function sf({ariaLabel:e,label:t,onValue:n,option:r,value:i,wide:a=!1}){let o=i||r.currentValue||``,s=r.values.find(e=>e.value===o),c=s?s.name||s.value:t;return(0,j.jsxs)(ed,{onValueChange:e=>n(e===`__default__`?``:e),value:o||`__default__`,children:[(0,j.jsx)(nd,{"aria-label":e,className:P(`h-8 gap-1 border-line bg-surface-soft px-2 py-0 text-xs shadow-none focus-visible:ring-1`,a?`w-full`:`max-w-44`,i?`text-ink-soft`:`text-muted`),title:s?.description,children:(0,j.jsx)(td,{children:c})}),(0,j.jsxs)(ad,{className:`max-w-80 border-line-strong text-ink-soft shadow-panel`,surface:`frosted`,children:[!s&&(0,j.jsx)(od,{className:`data-[highlighted]:bg-surface-soft`,value:`__default__`,children:t}),r.values.map(e=>(0,j.jsx)(od,{className:`data-[highlighted]:bg-surface-soft`,textValue:e.name||e.value,value:e.value,children:(0,j.jsxs)(`span`,{className:`grid gap-0.5 py-0.5`,children:[(0,j.jsx)(`span`,{children:e.name||e.value}),e.description&&(0,j.jsx)(`span`,{className:`max-w-72 text-xs font-normal leading-4 text-muted`,children:e.description})]})},e.value))]})]})}function cf(e){this.content=e}cf.prototype={constructor:cf,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new cf(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new cf(n)},addToStart:function(e,t){return new cf([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cf(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new cf(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=cf.from(e),e.size?new cf(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cf.from(e),e.size?new cf(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cf.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},cf.from=function(e){if(e instanceof cf)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cf(t)};function lf(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ff(e.charCodeAt(r-1))&&df(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=lf(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function uf(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ff(e.charCodeAt(i-1))&&df(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=uf(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function df(e){return e>=56320&&e<57344}function ff(e){return e>=55296&&e<56320}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return lf(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return uf(this,e,t,n)}findIndex(e){if(e==0)return mf(0,e);if(e==this.size)return mf(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?mf(t+1,i):mf(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);var pf={index:0,offset:0};function mf(e,t){return pf.index=e,pf.offset=t,pf}function hf(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!hf(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hf(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var gf=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hf(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};gf.none=[];var _f=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=yf(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(vf(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(F.empty,0,0);function vf(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(vf(a.content,t-i-1,n-i-1)))}function yf(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=yf(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function bf(e,t,n){if(n.openStart>e.depth)throw new _f(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _f(`Inconsistent open depths`);return xf(e,t,n,0)}function xf(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=xf(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Ef(a,Of(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Ef(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=kf(n,e);return Ef(a,Df(e,i,o,t,r))}}function Sf(e,t){if(!t.type.compatibleContent(e.type))throw new _f(`Cannot join `+t.type.name+` onto `+e.type.name)}function Cf(e,t,n){let r=e.node(n);return Sf(r,t.node(n)),r}function wf(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Tf(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(wf(e.nodeAfter,r),a++));for(let e=a;e<o;e++)wf(i.child(e),r);t&&t.depth==n&&t.textOffset&&wf(t.nodeBefore,r)}function Ef(e,t){if(!e.type.validContent(t))throw new _f(`Invalid content for node `+e.type.name);return e.copy(t)}function Df(e,t,n,r,i){let a=e.depth>i&&Cf(e,t,i+1),o=r.depth>i&&Cf(n,r,i+1),s=[];return Tf(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Sf(a,o),wf(Ef(a,Df(e,t,n,r,i+1)),s)):(a&&wf(Ef(a,Of(e,t,i+1)),s),Tf(t,n,i,s),o&&wf(Ef(o,Of(n,r,i+1)),s)),Tf(r,null,i,s),new F(s)}function Of(e,t,n){let r=[];return Tf(null,e,n,r),e.depth>n&&wf(Ef(Cf(e,t,n+1),Of(e,t,n+1)),r),Tf(t,null,n,r),new F(r)}function kf(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Af=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gf.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Pf(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Nf.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Nf.set(t,r=new jf);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Mf,i}},jf=class{constructor(){this.elts=[],this.i=0}},Mf=12,Nf=new WeakMap,Pf=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Ff=Object.create(null),If=class e{constructor(e,t,n,r=gf.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&hf(this.attrs,t||e.defaultAttrs||Ff)&&gf.sameSet(this.marks,n||gf.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return bf(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Af.resolveCached(this,e)}resolveNoCache(e){return Af.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Rf(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gf.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!gf.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};If.prototype.text=void 0;var Lf=class e extends If{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Rf(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var zf=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Bf(t,n);if(r.next==null)return e.empty;let i=Vf(r);r.next&&r.err(`Unexpected trailing text`);let a=Zf(Jf(i));return Qf(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
51
+ `)}};zf.empty=new zf(!0);var Bf=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Vf(e){let t=[];do t.push(Hf(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Hf(e){let t=[];do t.push(Uf(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Uf(e){let t=qf(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Gf(e,t);else break;return t}function Wf(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Gf(e,t){let n=Wf(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Wf(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Kf(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function qf(e){if(e.eat(`(`)){let t=Vf(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Kf(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Jf(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Yf(e,t){return t-e}function Xf(e,t){let n=[];return r(t),n.sort(Yf);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Zf(e){let t=Object.create(null);return n(Xf(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Xf(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new zf(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Yf);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Qf(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function $f(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ep(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function tp(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function np(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ap(e,r,t[r]);return n}var rp=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=np(e,n.attrs),this.defaultAttrs=$f(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==zf.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ep(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new If(this,this.computeAttrs(e),F.from(t),gf.setFrom(n))}createChecked(e=null,t,n){return t=F.from(t),this.checkContent(t),new If(this,this.computeAttrs(e),t,gf.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=F.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(F.empty,!0);return i?new If(this,e,t.append(i),gf.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){tp(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:gf.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ip(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var ap=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ip(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},op=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=np(e,r.attrs),this.excluded=null;let i=$f(this.attrs);this.instance=i?new gf(this,i):null}create(e=null){return!e&&this.instance?this.instance:new gf(this,ep(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){tp(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},sp=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=cf.from(e.nodes),t.marks=cf.from(e.marks||{}),this.nodes=rp.compile(this.spec.nodes,this),this.marks=op.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=zf.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?cp(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:cp(this,n.split(` `))}this.nodeFromJSON=e=>If.fromJSON(this,e),this.markFromJSON=e=>gf.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof rp))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Lf(n,n.defaultAttrs,e,gf.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function cp(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function lp(e){return e.tag!=null}function up(e){return e.style!=null}var dp=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(lp(e))this.tags.push(e);else if(up(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new bp(this,t,!1);return n.addAll(e,gf.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new bp(this,t,!0);return n.addAll(e,gf.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Sp(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cp(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cp(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},fp={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pp={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mp={ol:!0,ul:!0},hp=1,gp=2,_p=4;function vp(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?hp:0)|(t===`full`?gp:0)}var yp=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=gf.none,this.match=i||(a&_p?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&hp)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!fp.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},bp=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=vp(null,t.preserveWhitespace,0)|(n?_p:0);i=r?new yp(r.type,r.attrs,gf.none,!0,t.topMatch||r.type.contentMatch,a):n?new yp(null,null,gf.none,!0,null,a):new yp(e.schema.topNodeType,null,gf.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&gp?`full`:this.localPreserveWS||(r.options&hp)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
52
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;mp.hasOwnProperty(a)&&this.parser.normalizeLists&&xp(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:pp.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(fp.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
53
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=gf.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):wp(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=vp(e,i,a.options);a.options&_p&&a.content.length==0&&(o|=_p);let s=gf.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):wp(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new yp(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=hp);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function xp(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&mp.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Sp(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Cp(e){let t={};for(let n in e)t[n]=e[n];return t}function wp(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Tp=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Dp(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Dp(t).createTextNode(e.text);let{dom:n,contentDOM:r}=jp(Dp(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&jp(Dp(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:jp(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Ep(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Ep(e.marks)}};function Ep(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Dp(e){return e.document||window.document}var Op=new WeakMap;function kp(e){let t=Op.get(e);return t===void 0&&Op.set(e,t=Ap(e)),t}function Ap(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function jp(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=kp(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=jp(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Mp=65535,Np=2**16;function Pp(e,t){return e+t*Np}function Fp(e){return e&Mp}function Ip(e){return(e-(e&Mp))/Np}var Lp=1,Rp=2,zp=4,Bp=8,Vp=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Bp)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&zp)>0}},Hp=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Fp(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Ip(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Pp(o/3,e-s),f=e==s?Rp:e==u?Lp:zp;return(t<0?e!=s:e!=u)&&(f|=Bp),new Vp(a,f,d)}r+=l-c}return n?e+r:new Vp(e+r,0,null)}touches(e,t){let n=0,r=Fp(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Hp.empty=new Hp([]);var Up=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Vp(e,r,null)}},Wp=Object.create(null),Gp=class{getMap(){return Hp.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Wp[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Wp)throw RangeError(`Duplicate use of step JSON ID `+e);return Wp[e]=t,t.prototype.jsonID=e,t}},Kp=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof _f)return e.fail(t.message);throw t}}};function qp(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(qp(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return F.fromArray(r)}var Jp=class e extends Gp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new I(qp(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Kp.fromReplace(e,this.from,this.to,i)}invert(){return new Yp(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Gp.jsonID(`addMark`,Jp);var Yp=class e extends Gp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new I(qp(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Kp.fromReplace(e,this.from,this.to,n)}invert(){return new Jp(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Gp.jsonID(`removeMark`,Yp);var Xp=class e extends Gp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kp.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Kp.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Zp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Gp.jsonID(`addNodeMark`,Xp);var Zp=class e extends Gp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kp.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Kp.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Xp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Gp.jsonID(`removeNodeMark`,Zp);var Qp=class e extends Gp{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&em(e,this.from,this.to)?Kp.fail(`Structure replace would overwrite content`):Kp.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Hp([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?I.empty:new I(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?I.empty:new I(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,I.fromJSON(t,n.slice),!!n.structure)}};Qp.MAP_BIAS=1,Gp.jsonID(`replace`,Qp);var $p=class e extends Gp{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(em(e,this.from,this.gapFrom)||em(e,this.gapTo,this.to)))return Kp.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Kp.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Kp.fromReplace(e,this.from,this.to,n):Kp.fail(`Content does not fit in gap`)}getMap(){return new Hp([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(t,n.slice),n.insert,!!n.structure)}};Gp.jsonID(`replaceAround`,$p);function em(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function tm(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Yp(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Jp(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function nm(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof op){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Yp(t.from,t.to,t.style)))}function rm(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Qp(s,l,I.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Yp(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new I(F.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Qp(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(F.empty,!0);e.replace(s,s,new I(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function im(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function am(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!im(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function om(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=F.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=F.from(r.node(e).copy(u)),d++):c--;let f=F.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=F.from(i.node(e).copy(f)),p++):l++;e.step(new $p(c,l,o,s,new I(u.append(f),d,p),u.size-d,!0))}function sm(e,t,n=null,r=e){let i=lm(e,t),a=i&&um(r,t);return a?i.map(cm).concat({type:t,attrs:n}).concat(a.map(cm)):null}function cm(e){return{type:e,attrs:null}}function lm(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function um(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function dm(e,t,n){let r=F.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=F.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new $p(i,a,i,a,new I(r,0,0),n.length,!0))}function fm(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&hm(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&mm(e,t,n,a),rm(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new $p(c,l,c+1,l-1,new I(F.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&pm(e,t,n,a),!1}})}function pm(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function mm(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
54
+ `))}})}function hm(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function gm(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new $p(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new I(F.from(o),0,0),1,!0))}function _m(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function vm(e,t,n=1,r){let i=e.doc.resolve(t),a=F.empty,o=F.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=F.from(i.node(e).copy(a));let t=r&&r[s];o=F.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Qp(t,t,new I(a.append(o),n,n),!0))}function ym(e,t){let n=e.resolve(t),r=n.index();return xm(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function bm(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function xm(e,t){return!!(e&&t&&!e.isLeaf&&bm(e,t))}function Sm(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&xm(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Cm(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);mm(e,r.node(),r.before(),s)}o.inlineContent&&rm(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Qp(l,c.map(t+n,-1),I.empty,!0)),r===!0){let t=e.doc.resolve(l);pm(e,t.node(),t.before(),e.steps.length)}return e}function wm(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Tm(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Em(e,t,n=t,r=I.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Dm(i,a,r)?new Qp(t,n,r):new Om(i,a,r).fit()}function Dm(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Om=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=F.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=F.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new I(i,a,o);return e>-1?new $p(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Qp(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=jm(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(F.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jm(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new I(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=jm(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new I(km(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new I(km(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Mm(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Am(this.placed,t,F.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?I.empty:new I(km(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new I(km(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Nm(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Nm(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Nm(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Am(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Am(this.placed,this.depth,F.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(F.empty,!0);e.childCount&&(this.placed=Am(this.placed,this.frontier.length,e))}};function km(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(km(e.firstChild.content,t-1,n)))}function Am(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Am(e.lastChild.content,t-1,n)))}function jm(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Mm(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Mm(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(F.empty,!0)))),e.copy(r)}function Nm(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Pm(n,a.content,o)?s:null}function Pm(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Fm(e){return e.spec.defining||e.spec.definingForContent}function Im(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Dm(i,a,r))return e.step(new Qp(t,n,r));let o=Bm(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Fm(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new I(Lm(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Lm(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Lm(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(F.empty,!0))}return e}function Rm(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=wm(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new I(F.from(r),0,0))}function zm(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Bm(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Bm(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Vm=class e extends Gp{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Kp.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Kp.fromReplace(e,this.pos,this.pos+1,new I(F.from(r),0,+!t.isLeaf))}getMap(){return Hp.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Gp.jsonID(`attr`,Vm);var Hm=class e extends Gp{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Kp.ok(n)}getMap(){return Hp.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Gp.jsonID(`docAttr`,Hm);var Um=class extends Error{};Um=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Um.prototype=Object.create(Error.prototype),Um.prototype.constructor=Um,Um.prototype.name=`TransformError`;var Wm=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Up}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Um(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=I.empty){let r=Em(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new I(F.from(n),0,0))}delete(e,t){return this.replace(e,t,I.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Im(this,e,t,n),this}replaceRangeWith(e,t,n){return Rm(this,e,t,n),this}deleteRange(e,t){return zm(this,e,t),this}lift(e,t){return om(this,e,t),this}join(e,t=1){return Cm(this,e,t),this}wrap(e,t){return dm(this,e,t),this}setBlockType(e,t=e,n,r=null){return fm(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return gm(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Vm(e,t,n)),this}setDocAttribute(e,t){return this.step(new Hm(e,t)),this}addNodeMark(e,t){return this.step(new Xp(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof gf)t.isInSet(n.marks)&&this.step(new Zp(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Zp(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return vm(this,e,t,n),this}addMark(e,t,n){return tm(this,e,t,n),this}removeMark(e,t,n){return nm(this,e,t,n),this}clearIncompatible(e,t,n){return rm(this,e,t,n),this}},Gm=Object.create(null),Km=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new qm(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=I.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?I.empty:t),o==0&&rh(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),rh(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Xm(e):nh(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?nh(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):nh(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new eh(e.node(0))}static atStart(e){return nh(e,e,0,0,1)||new eh(e)}static atEnd(e){return nh(e,e,e.content.size,e.childCount,-1)||new eh(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Gm[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Gm)throw RangeError(`Duplicate use of selection JSON ID `+e);return Gm[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Xm.between(this.$anchor,this.$head).getBookmark()}};Km.prototype.visible=!0;var qm=class{constructor(e,t){this.$from=e,this.$to=t}},Jm=!1;function Ym(e){!Jm&&!e.parent.inlineContent&&(Jm=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Xm=class e extends Km{constructor(e,t=e){Ym(e),Ym(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Km.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=I.empty){if(super.replace(e,t),t==I.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Zm(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Km.findFrom(n,r,!0)||Km.findFrom(n,-r,!0);if(e)n=e.$head;else return Km.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Km.findFrom(t,-r,!0)||Km.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Km.jsonID(`text`,Xm);var Zm=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Xm.between(e.resolve(this.anchor),e.resolve(this.head))}},Qm=class e extends Km{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Km.near(a):new e(a)}content(){return new I(F.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new $m(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Qm.prototype.visible=!1,Km.jsonID(`node`,Qm);var $m=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Zm(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Qm.isSelectable(n)?new Qm(t):Km.near(t)}},eh=class e extends Km{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=I.empty){if(t==I.empty){e.delete(0,e.doc.content.size);let t=Km.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return th}};Km.jsonID(`all`,eh);var th={map(){return this},resolve(e){return new eh(e)}};function nh(e,t,n,r,i,a=!1){if(t.inlineContent)return Xm.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=nh(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Qm.isSelectable(r))return Qm.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function rh(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Qp||i instanceof $p))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Km.near(e.doc.resolve(o),n))}var ih=1,ah=2,oh=4,sh=class extends Wm{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ih)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&ih)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ah,this}ensureMarks(e){return gf.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ah)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||gf.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Km.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=oh,this}get scrolledIntoView(){return(this.updated&oh)>0}};function ch(e,t){return!t||!e?e:e.bind(t)}var lh=class{constructor(e,t,n){this.name=e,this.init=ch(t.init,n),this.apply=ch(t.apply,n)}},uh=[new lh(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new lh(`selection`,{init(e,t){return e.selection||Km.atStart(t.doc)},apply(e){return e.selection}}),new lh(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new lh(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],dh=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=uh.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new lh(e.key,e.spec.state,e))})}},fh=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new sh(this)}static create(t){let n=new dh(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new dh(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new dh(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=If.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Km.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function ph(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=ph(i,t,{})),n[r]=i}return n}var mh=class{constructor(e){this.spec=e,this.props={},e.props&&ph(e.props,this,this.props),this.key=e.key?e.key.key:gh(`plugin`)}getState(e){return e[this.key]}},hh=Object.create(null);function gh(e){return e in hh?e+`$`+ ++hh[e]:(hh[e]=0,e+`$`)}var _h=class{constructor(e=`key`){this.key=gh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},vh=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function yh(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var bh=(e,t,n)=>{let r=yh(e,n);if(!r)return!1;let i=Eh(r);if(!i){let n=r.blockRange(),i=n&&am(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Wh(e,i,t,-1))return!0;if(r.parent.content.size==0&&(wh(a,`end`)||Qm.isSelectable(a)))for(let n=r.depth;;n--){let o=Em(e.doc,r.before(n),r.after(n),I.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(wh(a,`end`)?Km.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):Qm.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},xh=(e,t,n)=>{let r=yh(e,n);if(!r)return!1;let i=Eh(r);return i?Ch(e,i,t):!1},Sh=(e,t,n)=>{let r=Dh(e,n);if(!r)return!1;let i=Ah(r);return i?Ch(e,i,t):!1};function Ch(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Em(e.doc,i,o,I.empty);if(!s||s.from!=i||s instanceof Qp&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(Xm.create(t.doc,i)),n(t.scrollIntoView())}return!0}function wh(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Th=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Eh(r)}let o=a&&a.nodeBefore;return!o||!Qm.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Qm.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Eh(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Dh(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Oh=(e,t,n)=>{let r=Dh(e,n);if(!r)return!1;let i=Ah(r);if(!i)return!1;let a=i.nodeAfter;if(Wh(e,i,t,1))return!0;if(r.parent.content.size==0&&(wh(a,`start`)||Qm.isSelectable(a))){let n=Em(e.doc,r.before(),r.after(),I.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(wh(a,`start`)?Km.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Qm.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},kh=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Ah(r)}let o=a&&a.nodeAfter;return!o||!Qm.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Qm.create(e.doc,a.pos)).scrollIntoView()),!0)};function Ah(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var jh=(e,t)=>{let n=e.selection,r=n instanceof Qm,i;if(r){if(n.node.isTextblock||!ym(e.doc,n.from))return!1;i=n.from}else if(i=Sm(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(Qm.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Mh=(e,t)=>{let n=e.selection,r;if(n instanceof Qm){if(n.node.isTextblock||!ym(e.doc,n.to))return!1;r=n.to}else if(r=Sm(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Nh=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&am(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Ph=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
55
+ `).scrollIntoView()),!0)};function Fh(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Ih=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Fh(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Km.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Lh=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof eh||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Fh(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(Xm.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Rh=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(_m(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&am(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function zh(e){return(t,n)=>{if(t.selection instanceof Qm&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!_m(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof Xm||t.selection instanceof eh)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=Fh(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=_m(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,_m(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var Bh=zh(),Vh=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(Qm.create(e.doc,i))),!0)},Hh=(e,t)=>(t&&t(e.tr.setSelection(new eh(e.doc))),!0);function Uh(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||ym(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Wh(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Uh(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=F.empty;for(let e=o.length-1;e>=0;e--)s=F.from(o[e].create(null,s));s=F.from(i.copy(s));let c=e.tr.step(new $p(t.pos-1,r,t.pos,r,new I(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&ym(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Km.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&am(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&wh(a,`start`,!0)&&wh(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=F.empty;for(let e=o.length-1;e>=0;e--)r=F.from(o[e].copy(r));n(e.tr.step(new $p(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new I(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Gh(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(Xm.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Kh=Gh(-1),qh=Gh(1);function Jh(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&sm(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Yh(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t))){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Xh(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Zh=Xh(vh,bh,Th),Qh=Xh(vh,Oh,kh),$h={Enter:Xh(Ph,Lh,Rh,Bh),"Mod-Enter":Ih,Backspace:Zh,"Mod-Backspace":Zh,"Shift-Backspace":Zh,Delete:Qh,"Mod-Delete":Qh,"Mod-a":Hh},eg={"Ctrl-h":$h.Backspace,"Alt-Backspace":$h[`Mod-Backspace`],"Ctrl-d":$h.Delete,"Ctrl-Alt-Backspace":$h[`Mod-Delete`],"Alt-Delete":$h[`Mod-Delete`],"Alt-d":$h[`Mod-Delete`],"Ctrl-a":Kh,"Ctrl-e":qh};for(let e in $h)eg[e]=$h[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function tg(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return ng(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function ng(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Pf(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Pf(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=sm(a,n,r,t);return s?(e&&rg(e,t,s,i,n),!0):!1}function rg(e,t,n,r,i){let a=F.empty;for(let e=n.length-1;e>=0;e--)a=F.from(n[e].type.create(n[e].attrs,a));e.step(new $p(t.start-(r?2:0),t.end,t.start,t.end,new I(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&_m(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function ig(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?ag(t,n,e,a):og(t,n,a):!0:!1}}function ag(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new $p(a-1,o,a,o,new I(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Pf(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=am(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return ym(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function og(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?F.empty:F.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new $p(d-+!!s,f+ +!!c,d+1,f-1,new I((s?F.empty:F.from(i.copy(F.empty))).append(c?F.empty:F.from(i.copy(F.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function sg(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=F.from(r?e.create():null),o=new I(F.from(e.create(null,F.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new $p(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var cg=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},lg=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},ug=null,dg=function(e,t,n){let r=ug||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},fg=function(){ug=null},pg=function(e,t,n,r){return n&&(hg(e,t,n,r,-1)||hg(e,t,n,r,1))},mg=/^(img|br|input|textarea|hr)$/i;function hg(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:gg(e))){let n=e.parentNode;if(!n||n.nodeType!=1||bg(e)||mg.test(e.nodeName)||e.contentEditable==`false`)return!1;t=cg(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?gg(e):0}else return!1}}function gg(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function _g(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=gg(e)}else if(e.parentNode&&!bg(e))t=cg(e),e=e.parentNode;else return null}}function vg(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!bg(e))t=cg(e)+1,e=e.parentNode;else return null}}function yg(e,t,n){for(let r=t==0,i=t==gg(e);r||i;){if(e==n)return!0;let t=cg(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==gg(e)}}function bg(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var xg=function(e){return e.focusNode&&pg(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Sg(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Cg(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function wg(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(gg(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(gg(r.startContainer),r.startOffset)}}}var Tg=typeof navigator<`u`?navigator:null,Eg=typeof document<`u`?document:null,Dg=Tg&&Tg.userAgent||``,Og=/Edge\/(\d+)/.exec(Dg),kg=/MSIE \d/.exec(Dg),Ag=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Dg),jg=!!(kg||Ag||Og),Mg=kg?document.documentMode:Ag?+Ag[1]:Og?+Og[1]:0,Ng=!jg&&/gecko\/(\d+)/i.test(Dg);Ng&&+(/Firefox\/(\d+)/.exec(Dg)||[0,0])[1];var Pg=!jg&&/Chrome\/(\d+)/.exec(Dg),Fg=!!Pg,Ig=Pg?+Pg[1]:0,Lg=!jg&&!!Tg&&/Apple Computer/.test(Tg.vendor),Rg=Lg&&(/Mobile\/\w+/.test(Dg)||!!Tg&&Tg.maxTouchPoints>2),zg=Rg||(Tg?/Mac/.test(Tg.platform):!1),Bg=Tg?/Win/.test(Tg.platform):!1,Vg=/Android \d/.test(Dg),Hg=!!Eg&&`webkitFontSmoothing`in Eg.documentElement.style,Ug=Hg?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Wg(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Gg(e,t){return typeof e==`number`?e:e[t]}function Kg(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function qg(e,t,n){if(!c_(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=lg(o);continue}let e=o,n=e==a.body,s=n?Wg(a):Kg(e),c=0,l=0;if(t.top<s.top+Gg(r,`top`)?l=-(s.top-t.top+Gg(i,`top`)):t.bottom>s.bottom-Gg(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Gg(i,`top`)-s.top:t.bottom-s.bottom+Gg(i,`bottom`)),t.left<s.left+Gg(r,`left`)?c=-(s.left-t.left+Gg(i,`left`)):t.right>s.right-Gg(r,`right`)&&(c=t.right-s.right+Gg(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:lg(o)}}function Jg(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Yg(e.dom)}}function Yg(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=lg(r));return t}function Xg({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Zg(n,r==0?0:r-t)}function Zg(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Qg=null;function $g(e){if(e.setActive)return e.setActive();if(Qg)return e.focus(Qg);let t=Yg(e);e.focus(Qg==null?{get preventScroll(){return Qg={preventScroll:!0},!0}}:void 0),Qg||(Qg=!1,Zg(t,0))}function e_(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=dg(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?t_(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:e_(n,i)}function t_(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=l_(r,1);if(n.top!=n.bottom&&n_(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function n_(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function r_(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function i_(e,t,n){let{node:r,offset:i}=e_(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function a_(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function o_(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(n_(t,i))return o_(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function s_(e,t){let n=e.dom.ownerDocument,r,i=0,a=wg(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!n_(t,n)||(o=o_(e.dom,t,n),!o))return null}if(Lg)for(let e=o;r&&e;e=lg(e))e.draggable&&(r=void 0);if(o=r_(o,t),r){if(Ng&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Hg&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=a_(e,r,i,t))}s??=i_(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function c_(e){return e.top<e.bottom||e.left<e.right}function l_(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(c_(e))return e}return Array.prototype.find.call(n,c_)||e.getBoundingClientRect()}var u_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function d_(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Hg||Ng;if(r.nodeType==3){if(o&&(u_.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=l_(dg(r,i,i),n);if(Ng&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=l_(dg(r,i-1,i-1),-1);if(t.top==e.top){let n=l_(dg(r,i,i+1),-1);if(n.top!=e.top)return f_(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,f_(l_(dg(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==gg(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return p_(e.getBoundingClientRect(),!1)}if(a==null&&i<gg(r)){let e=r.childNodes[i];if(e.nodeType==1)return p_(e.getBoundingClientRect(),!0)}return p_(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==gg(r))){let e=r.childNodes[i-1],t=e.nodeType==3?dg(e,gg(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return f_(l_(t,1),!1)}if(a==null&&i<gg(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?dg(e,0,+!o):e.nodeType==1?e:null:null;if(t)return f_(l_(t,-1),!0)}return f_(l_(r.nodeType==3?dg(r):r,-n),n>=0)}function f_(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function p_(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function m_(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function h_(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return m_(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=d_(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=dg(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var g_=/[\u0590-\u08ac]/;function __(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!g_.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:m_(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var v_=null,y_=null,b_=!1;function x_(e,t,n){return v_==t&&y_==n?b_:(v_=t,y_=n,b_=n==`up`||n==`down`?h_(e,t,n):__(e,t,n))}var S_=0,C_=1,w_=2,T_=3,E_=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=S_,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>cg(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof N_){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof D_&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?cg(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?cg(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=cg(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=cg(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Ng||Lg)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
56
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:cg(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Ng&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Lg)&&pg(o.node,o.offset,l.anchorNode,l.anchorOffset)&&pg(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Ng)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?w_:C_,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=T_:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?w_:T_}n=a}this.dirty=w_}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?w_:C_;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},D_=class extends E_{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==S_&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},O_=class extends E_{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},k_=class e extends E_{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Tp.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&T_||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=T_&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=S_){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=S_}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=X_(a,n,o,r)),t>0&&(a=X_(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},A_=class e extends E_{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Tp.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=V_(u,r,n),l?c=new P_(t,n,r,i,u,d||null,f,l):n.isText?new M_(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>t.nodeType==1&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>F.empty}}return t}matchesNode(e,t,n){return this.dirty==S_&&e.eq(this.node)&&H_(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new W_(this,a&&a.node,e);q_(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?gf.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==w_)&&(a&&this.protectLocalComposition(e,a),F_(this.contentDOM,this.children,e),Rg&&J_(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Xm)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Y_(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new O_(this,i,t,r);e.input.compositionNodes.push(a),this.children=X_(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==T_||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=S_}updateOuterDeco(e){if(H_(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=z_(this.dom,this.nodeDOM,R_(this.outerDeco,this.node,t),R_(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function j_(e,t,n,r,i){V_(r,t,e);let a=new A_(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var M_=class e extends A_{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==T_||this.dirty!=S_&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=S_||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=S_,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=T_)}get domAtom(){return!1}isText(e){return this.node.text==e}},N_=class extends E_{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==S_&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},P_=class extends A_{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==T_)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function F_(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=U_(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof k_){let t=r?r.previousSibling:e.lastChild;F_(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=U_(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var I_=function(e){e&&(this.nodeName=e)};I_.prototype=Object.create(null);var L_=[new I_];function R_(e,t,n){if(e.length==0)return L_;let r=n?L_[0]:new I_,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new I_(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new I_(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function z_(e,t,n,r){if(n==L_&&r==L_)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=L_[0],i=t)}B_(i,o||L_[0],a)}return i}function B_(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function V_(e,t,n){return z_(e,e,L_,R_(t,n,e.nodeType!=1))}function H_(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function U_(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var W_=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=G_(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=S_,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof k_&&t.dirty!=T_&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=k_.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==T_&&a.dom==a.contentDOM&&(a.dirty=w_),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof A_){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=T_&&H_(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=w_,u.updateChildren(r,a+1),u.dirty=S_),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!H_(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=A_.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=A_.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new D_(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof k_;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof M_)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Lg||Fg)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new N_(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function G_(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof k_)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function K_(e,t){return e.type.side-t.type.side}function q_(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(K_);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function J_(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Y_(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function X_(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Z_(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(xg(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Qm.isSelectable(e)&&i.parent&&!(e.isInline&&yg(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Qm(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=cv(e,u,s,n)}return l}function Q_(e){return e.editable?e.hasFocus():uv(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function $_(e,t=!1){let n=e.state.selection;if(ov(e,n),!Q_(e))return;let r=e.input.mouseDown;if(!t&&Fg&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&pg(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)av(e);else{let{anchor:r,head:i}=n,a,o;ev&&!(n instanceof Xm)&&(n.$from.parent.inlineContent||(a=tv(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=tv(e,n.to))),e.docView.setSelection(r,i,e,t),ev&&(a&&rv(a),o&&rv(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&iv(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var ev=Lg||Fg&&Ig<63;function tv(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Lg&&i&&i.contentEditable==`false`)return nv(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return nv(i);if(a)return nv(a)}}function nv(e){return e.contentEditable=`true`,Lg&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function rv(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function iv(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Q_(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function av(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,cg(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&jg&&Mg<=11&&(n.disabled=!0,n.disabled=!1)}function ov(e,t){if(t instanceof Qm){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(sv(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else sv(e)}function sv(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function cv(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||Xm.between(t,n,r)}function lv(e){return e.editable&&!e.hasFocus()?!1:uv(e)}function uv(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function dv(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return pg(t.node,t.offset,n.anchorNode,n.anchorOffset)}function fv(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Km.findFrom(a,t)}function pv(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function mv(e,t,n){let r=e.state.selection;if(r instanceof Xm){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return pv(e,new Xm(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=fv(e.state,t);return n&&n instanceof Qm?pv(e,n):!1}if(!(zg&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?Qm.isSelectable(i)?pv(e,new Qm(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Hg?pv(e,new Xm(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof Qm&&r.node.isInline)return pv(e,new Xm(t>0?r.$to:r.$from));else{let n=fv(e.state,t);return n?pv(e,n):!1}}function hv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function gv(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function _v(e,t){return t<0?vv(e):yv(e)}function vv(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Ng&&n.nodeType==1&&r<hv(n)&&gv(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(gv(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(bv(n))break;else{let t=n.previousSibling;for(;t&&gv(t,-1);)i=n.parentNode,a=cg(t),t=t.previousSibling;if(t)n=t,r=hv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Cv(e,n,r):i&&Cv(e,i,a)}function yv(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=hv(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(gv(e,1))a=n,o=++r;else break}else if(bv(n))break;else{let t=n.nextSibling;for(;t&&gv(t,1);)a=t.parentNode,o=cg(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=hv(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Cv(e,a,o)}function bv(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function xv(e,t){for(;e&&t==e.childNodes.length&&!bg(e);)t=cg(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Sv(e,t){for(;e&&!t&&!bg(e);)t=cg(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Cv(e,t,n){if(t.nodeType!=3){let e,r;(r=xv(t,n))?(t=r,n=0):(e=Sv(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(xg(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&$_(e)},50)}function wv(e,t){let n=e.state.doc.resolve(t);if(!(Fg||Bg)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Tv(e,t,n){let r=e.state.selection;if(r instanceof Xm&&!r.empty||n.indexOf(`s`)>-1||zg&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=fv(e.state,t);if(n&&n instanceof Qm)return pv(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof eh?Km.near(n,t):Km.findFrom(n,t);return o?pv(e,o):!1}return!1}function Ev(e,t){if(!(e.state.selection instanceof Xm))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Dv(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ov(e){if(!Lg||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Dv(e,n,`true`),setTimeout(()=>Dv(e,n,`false`),20)}return!1}function kv(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Av(e,t){let n=t.keyCode,r=kv(t);if(n==8||zg&&n==72&&r==`c`)return Ev(e,-1)||_v(e,-1);if(n==46&&!t.shiftKey||zg&&n==68&&r==`c`)return Ev(e,1)||_v(e,1);if(n==13||n==27)return!0;if(n==37||zg&&n==66&&r==`c`){let t=n==37?wv(e,e.state.selection.from)==`ltr`?-1:1:-1;return mv(e,t,r)||_v(e,t)}if(n==39||zg&&n==70&&r==`c`){let t=n==39?wv(e,e.state.selection.from)==`ltr`?1:-1:1;return mv(e,t,r)||_v(e,t)}return n==38||zg&&n==80&&r==`c`?Tv(e,-1,r)||_v(e,-1):n==40||zg&&n==78&&r==`c`?Ov(e)||Tv(e,1,r)||_v(e,1):!(r!=(zg?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function jv(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Tp.fromSchema(e.state.schema),s=Vv(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Bv[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
57
+
58
+ `),slice:t}}function Mv(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new I(F.from(e.state.schema.text(t.replace(/\r\n?/g,`
59
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Tp.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Wv(n),Hg&&Gv(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||dp.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Nv.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Kv(zv(s,+u[1],+u[2]),u[4]);else if(s=I.maxOpen(Pv(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=zv(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Nv=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Pv(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Iv(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Lv(a[a.length-1],i.length));let n=Fv(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return F.from(a)}return e}function Fv(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,F.from(e));return e}function Iv(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Iv(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(F.from(Fv(n,e,i+1))))}}function Lv(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Lv(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(F.empty,!0);return e.copy(n.append(r))}function Rv(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Rv(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(F.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function zv(e,t,n){return t<e.openStart&&(e=new I(Rv(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new I(Rv(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Bv={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function Vv(){return document.implementation.createHTMLDocument(`title`)}var Hv=null;function Uv(e){let t=window.trustedTypes;return t?(Hv||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Hv.createHTML(e)):e}function Wv(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Vv(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&Bv[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=Uv(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function Gv(e){let t=e.querySelectorAll(Fg?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Kv(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=F.from(t.create(r[e+1],i)),a++,o++}return new I(i,a,o)}var qv={},Jv={},Yv={touchstart:!0,touchmove:!0},Xv=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Zv(e){for(let t in qv){let n=qv[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{ny(e,t)&&!ty(e,t)&&(e.editable||!(t.type in Jv))&&n(e,t)},Yv[t]?{passive:!0}:void 0)}Lg&&e.dom.addEventListener(`input`,()=>null),ey(e)}function Qv(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function $v(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ey(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ty(e,t))})}function ty(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ny(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function ry(e,t){!ty(e,t)&&qv[t.type]&&(e.editable||!(t.type in Jv))&&qv[t.type](e,t)}Jv.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!by(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Vg&&Fg&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Rg&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Sg(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Av(e,n)?n.preventDefault():Qv(e,`key`)}},Jv.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Jv.keypress=(e,t)=>{let n=t;if(by(e)||!n.charCode||n.ctrlKey&&!n.altKey||zg&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Xm)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function iy(e){return{left:e.clientX,top:e.clientY}}function ay(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function oy(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function sy(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function cy(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Qm.isSelectable(r)?(sy(e,new Qm(n),`pointer`),!0):!1}function ly(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Qm&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(Qm.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(sy(e,Qm.create(e.state.doc,i),`pointer`),!0)}function uy(e,t,n,r,i){return oy(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?ly(e,n):cy(e,n))}function dy(e,t,n,r){return oy(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function fy(e,t,n,r){return oy(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||py(e,n,r)}function py(e,t,n){if(n.button!=0)return!1;let r=my(e,t,!0),i=e.state.doc;return r?(sy(e,r,`pointer`),r instanceof Xm&&i.eq(e.state.doc)&&(e.input.mouseDown=new yy(e,r)),!0):!1}function my(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Xm.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return Xm.create(r,a+1,a+1+t.content.size);if(n&&Qm.isSelectable(t))return Qm.create(r,a)}return null}function hy(e){return Ey(e)}var gy=zg?`metaKey`:`ctrlKey`;qv.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=hy(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&ay(n,e.input.lastClick)&&!n[gy]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(iy(n));o&&(a==`singleClick`?e.input.mouseDown=new vy(e,o,n,!!r):(a==`doubleClick`?dy:fy)(e,o.pos,o.inside,n)?n.preventDefault():Qv(e,`pointer`))};var _y=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},vy=class extends _y{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[gy],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Qm&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ng&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),Qv(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||$_(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(iy(e))),this.updateAllowDefault(e),this.allowDefault||!t?Qv(this.view,`pointer`):uy(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Lg&&this.mightDrag&&!this.mightDrag.node.isAtom||Fg&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(sy(this.view,Km.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Qv(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Qv(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},yy=class extends _y{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Qv(this.view,`pointer`);let t=this.view.posAtCoords(iy(e)),n=t&&my(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];sy(this.view,Xm.create(r,a,o),`pointer`)}};qv.touchstart=e=>{e.input.lastTouch=Date.now(),hy(e),Qv(e,`pointer`)},qv.touchmove=e=>{e.input.lastTouch=Date.now(),Qv(e,`pointer`)},qv.contextmenu=e=>hy(e);function by(e,t){return e.composing?!0:Lg&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var xy=Vg?5e3:-1;Jv.compositionstart=Jv.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Xm&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Fg&&Bg&&Sy(e)))e.markCursor=e.state.storedMarks||n.marks(),Ey(e,!0),e.markCursor=null;else if(Ey(e,!t.selection.empty),Ng&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Cy(e,xy)};function Sy(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Jv.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Cy(e,20))};function Cy(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ey(e),t))}function wy(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ty(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=_g(t.focusNode,t.focusOffset),r=vg(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Ey(e,t=!1){if(!(Vg&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),wy(e),t||e.docView&&e.docView.dirty){let n=Z_(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Dy(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Oy=jg&&Mg<15||Rg&&Ug<604;qv.copy=Jv.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Oy?null:n.clipboardData,{dom:o,text:s}=jv(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Dy(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function ky(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ay(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?jy(e,r.value,null,i,t):jy(e,r.textContent,r.innerHTML,i,t)},50)}function jy(e,t,n,r,i){let a=Mv(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||I.empty)))return!0;if(!a)return!1;let o=ky(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function My(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Jv.paste=(e,t)=>{let n=t;if(e.composing&&!Vg)return;let r=Oy?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&jy(e,My(r),r.getData(`text/html`),i,n)?n.preventDefault():Ay(e,n)};var Ny=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Py=zg?`altKey`:`ctrlKey`;function Fy(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Py]:!n}qv.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(iy(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Qm?i.to-1:i.to))){if(r&&r.mightDrag)o=Qm.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Qm.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=jv(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Fg||Ig>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Oy?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Oy||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Ny(l,Fy(e,n),o)},qv.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Jv.dragover=Jv.dragenter=(e,t)=>t.preventDefault(),Jv.drop=(e,t)=>{try{Iy(e,t,e.dragging)}finally{e.dragging=null}};function Iy(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(iy(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Mv(e,My(t.dataTransfer),Oy?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Fy(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||I.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Tm(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&Qm.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Qm(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(cv(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}qv.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&$_(e)},20))},qv.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},qv.beforeinput=(e,t)=>{if(Vg&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Sg(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Jv)qv[e]=Jv[e];function Ly(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Ry=class e{constructor(e,t){this.toDOM=e,this.spec=t||Uy,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Vy(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ly(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},zy=class e{constructor(e,t){this.attrs=e,this.spec=t||Uy}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Vy(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Ly(this.attrs,t.attrs)&&Ly(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},By=class e{constructor(e,t){this.attrs=e,this.spec=t||Uy}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Vy(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Ly(this.attrs,t.attrs)&&Ly(this.spec,t.spec)}destroy(){}},Vy=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Ry(n,r))}static inline(t,n,r,i){return new e(t,n,new zy(r,i))}static node(t,n,r,i){return new e(t,n,new By(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof zy}get widget(){return this.type instanceof Ry}},Hy=[],Uy={},Wy=class e{constructor(e,t){this.local=e.length?e:Hy,this.children=t.length?t:Hy}static create(e,t){return t.length?Qy(t,e,0,Uy):Gy}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Gy||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Uy)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?qy(this.children,o||[],t,n,r,i,a):o?new e(o.sort($y),Hy):Gy}add(t,n){return n.length?this==Gy?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Xy(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Qy(s,e,o+1,Uy)),a+=3}});let o=Jy(a?Zy(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort($y):this.local,i||this.children)}remove(e){return e.length==0||this==Gy?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Gy?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Gy}forChild(t,n){if(this==Gy)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof zy){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort($y),Hy);return r?new Ky([t,r]):t}return r||Gy}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return eb(this.localsInner(e))}localsInner(e){if(this==Gy)return Hy;if(e.inlineContent||!this.local.some(zy.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof zy||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Wy.empty=new Wy([],[]),Wy.removeOverlap=eb;var Gy=Wy.empty,Ky=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Uy));return e.from(r)}forChild(t,n){if(n.isLeaf)return Wy.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Gy&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?eb(n?t:t.sort($y)):Hy}static from(t){switch(t.length){case 0:return Gy;case 1:return t[0];default:return new e(t.every(e=>e instanceof Wy)?t:t.reduce((e,t)=>e.concat(t instanceof Wy?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function qy(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Gy?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Qy(Yy(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Wy(t.sort($y),s)}function Jy(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Vy(i.from+t,i.to+t,i.type))}return n}function Yy(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Xy(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Zy(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Qy(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Xy(e,t,o+n);if(s){a=!0;let e=Qy(s,t,n+o+1,r);e!=Gy&&i.push(o,o+t.nodeSize,e)}});let o=Jy(a?Zy(e):e,-n).sort($y);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Wy(o,i):Gy}function $y(e,t){return e.from-t.from||e.to-t.to}function eb(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),tb(t,i+1,a.copy(r.to,a.to)));continue}a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),tb(t,i,r.copy(a.from,r.to)));break}}return t}function tb(e,t,n){for(;t<e.length&&$y(n,e[t])>0;)t++;e.splice(t,0,n)}function nb(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Gy&&t.push(r)}),e.cursorWrapper&&t.push(Wy.create(e.state.doc,[e.cursorWrapper.deco])),Ky.from(t)}var rb={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ib=jg&&Mg<=11,ab=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},ob=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ab,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);jg&&Mg<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Lg&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ib&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,rb)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(lv(this.view)){if(this.suppressingSelectionUpdates)return $_(this.view);if(jg&&Mg<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&pg(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=lg(n))t.add(n);for(let r=e.anchorNode;r;r=lg(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&lv(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Fg&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Ng&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||fb(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&xg(n)&&(c=Z_(e))&&c.eq(Km.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,$_(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),lb(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,pb(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||$_(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(jg&&Mg<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?cg(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?cg(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},sb=new WeakMap,cb=!1;function lb(e){if(!sb.has(e)&&(sb.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ng,cb)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),cb=!0}}function ub(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return pg(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function db(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ub(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?ub(e,n):null}function fb(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function pb(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function mb(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],xg(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Fg&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||dp.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:hb(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var hb=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(Lg&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||Lg&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},gb=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _b(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Z_(e,t);if(n&&!e.state.selection.eq(n)){if(Fg&&Vg&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Sg(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=mb(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Sb(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Rg&&e.input.lastIOSEnter>Date.now()-225||Vg)&&i.some(e=>e.nodeType==1&&!gb.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Sg(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof Xm&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=vb(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof Xm&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),jg&&Mg<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Rg&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Sg(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&bb(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Sg(8,`Backspace`)))){Vg&&Fg&&e.domObserver.suppressSelectionUpdates();return}Fg&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Vg&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Sg(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=vb(e,n.doc,l.sel);t&&!(Fg&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||jg&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){jg&&Mg<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>$_(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=yb(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function vb(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:cv(e,t.resolve(n.anchor),t.resolve(n.head))}function yb(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(F.from(l).eq(e))return{mark:s,type:o}}function bb(e,t,n,r,i){if(n-t<=i.pos-r.pos||xb(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(xb(a,!0,!0));return!o.parent.isTextblock||o.pos>n||xb(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function xb(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Sb(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Cb=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Xv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ab),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Eb(this),Tb(this),this.nodeViews=Ob(this),this.docView=j_(this.state.doc,wb(this),nb(this),this.dom,this),this.domObserver=new ob(this,(e,t,n,r)=>_b(this,e,t,n,r)),this.domObserver.start(),Zv(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ey(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ab),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(wy(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ob(this);kb(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&ey(this),this.editable=Eb(this),Tb(this);let o=nb(this),s=wb(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Jg(this);if(i){this.domObserver.stop();let t=l&&(jg||Fg)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Db(n.selection,e.selection);if(l){let n=Fg?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ty(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=j_(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&dv(this)&&i.delaySelUpdate())?$_(this,t):(ov(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Xg(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof Qm){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&qg(this,t.getBoundingClientRect(),e)}else qg(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ny(e.slice,e.move,r<0?void 0:Qm.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(jg){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&$g(this.dom),$_(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return s_(this,e)}coordsAtPos(e,t=1){return d_(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return x_(this,t||this.state,e)}pasteHTML(e,t){return jy(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return jy(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return jv(this,e)}destroy(){this.docView&&($v(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],nb(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,fg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ry(this,e)}domSelectionRange(){let e=this.domSelection();return e?Lg&&this.root.nodeType===11&&Cg(this.dom.ownerDocument)==this.dom&&db(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Cb.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function wb(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Vy.node(0,e.state.doc.content.size,t)]}function Tb(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Vy.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Eb(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Db(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ob(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function kb(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Ab(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var jb={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Mb={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Nb=typeof navigator<`u`&&/Mac/.test(navigator.platform),Pb=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Fb=0;Fb<10;Fb++)jb[48+Fb]=jb[96+Fb]=String(Fb);for(var Fb=1;Fb<=24;Fb++)jb[Fb+111]=`F`+Fb;for(var Fb=65;Fb<=90;Fb++)jb[Fb]=String.fromCharCode(Fb+32),Mb[Fb]=String.fromCharCode(Fb);for(var Ib in jb)Mb.hasOwnProperty(Ib)||(Mb[Ib]=jb[Ib]);function Lb(e){var t=!(Nb&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Pb&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Mb:jb)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Rb=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zb=typeof navigator<`u`&&/Win/.test(navigator.platform);function Bb(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Rb?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Vb(e){let t=Object.create(null);for(let n in e)t[Bb(n)]=e[n];return t}function Hb(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Ub(e){return new mh({props:{handleKeyDown:Wb(e)}})}function Wb(e){let t=Vb(e);return function(e,n){let r=Lb(n),i,a=t[Hb(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Hb(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(zb&&n.ctrlKey&&n.altKey)&&(i=jb[n.keyCode])&&i!=r){let r=t[Hb(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Gb=Object.defineProperty,Kb=(e,t)=>{for(var n in t)Gb(e,n,{get:t[n],enumerable:!0})};function qb(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Jb=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:qb({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Yb={};Kb(Yb,{blur:()=>Xb,clearContent:()=>Zb,clearNodes:()=>Qb,command:()=>$b,createParagraphNear:()=>ex,cut:()=>tx,deleteCurrentNode:()=>nx,deleteNode:()=>ix,deleteRange:()=>ax,deleteSelection:()=>lx,enter:()=>ux,exitCode:()=>dx,extendMarkRange:()=>vx,first:()=>yx,focus:()=>Ex,forEach:()=>Dx,insertContent:()=>Ox,insertContentAt:()=>Fx,insertDefaultBlock:()=>Lx,joinBackward:()=>Bx,joinDown:()=>zx,joinForward:()=>Vx,joinItemBackward:()=>Hx,joinItemForward:()=>Ux,joinTextblockBackward:()=>Wx,joinTextblockForward:()=>Gx,joinUp:()=>Rx,keyboardShortcut:()=>Jx,lift:()=>Xx,liftEmptyBlock:()=>Zx,liftListItem:()=>Qx,newlineInCode:()=>$x,resetAttributes:()=>nS,scrollIntoView:()=>rS,selectAll:()=>iS,selectNodeBackward:()=>aS,selectNodeForward:()=>oS,selectParentNode:()=>sS,selectTextblockEnd:()=>cS,selectTextblockStart:()=>lS,setContent:()=>dS,setMark:()=>uC,setMeta:()=>dC,setNode:()=>fC,setNodeSelection:()=>pC,setTextDirection:()=>mC,setTextSelection:()=>hC,sinkListItem:()=>gC,splitBlock:()=>vC,splitListItem:()=>yC,toggleList:()=>TC,toggleMark:()=>EC,toggleNode:()=>DC,toggleWrap:()=>OC,undoInputRule:()=>kC,unsetAllMarks:()=>AC,unsetMark:()=>jC,unsetTextDirection:()=>MC,updateAttributes:()=>NC,updateDecorations:()=>FC,wrapIn:()=>IC,wrapInList:()=>LC});var Xb=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Zb=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Qb=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=am(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},$b=e=>t=>e(t),ex=()=>({state:e,dispatch:t})=>Lh(e,t),tx=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new Xm(r.doc.resolve(Math.max(o-1,0)))),!0},nx=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function rx(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var ix=e=>({tr:t,state:n,dispatch:r})=>{let i=rx(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ax=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ox=e=>e.content?/^text(\*|\+)/.test(e.content):!1,sx=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return ox(r)?n===`left`?e.start()-1:e.end()+1:e.pos},cx=(e,t,n)=>({from:sx(e,n,`left`),to:sx(t,n,`right`)}),lx=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=cx(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(Xm.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},ux=()=>({commands:e})=>e.keyboardShortcut(`Enter`),dx=()=>({state:e,dispatch:t})=>Ih(e,t);function fx(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function px(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:fx(t[r])?t[r].test(e[r]):t[r]===e[r])}function mx(e,t,n={}){return e.find(e=>e.type===t&&px(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function hx(e,t,n={}){return!!mx(e,t,n)}function gx(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!mx([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&hx([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&hx([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function _x(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var vx=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=_x(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=gx(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=Xm.create(o,e.from,e.to);n.setSelection(t)}}return!0},yx=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function bx(e){return e instanceof Xm}function xx(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Sx(e,t=null){if(!t)return null;let n=Km.atStart(e),r=Km.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?Xm.create(e,xx(0,i,a),xx(e.content.size,i,a)):Xm.create(e,xx(t,i,a),xx(t,i,a))}function Cx(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function wx(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Tx(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Ex=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(wx()||Cx())&&r.dom.focus(),Tx()&&!wx()&&!Cx()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!bx(n.state.selection))return o(),!0;let s=Sx(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Dx=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Ox=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),kx=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&kx(r)}return e};function Ax(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return kx(n)}function jx(e){return typeof e?.nodesBetween==`function`}function Mx(e,t,n){if(jx(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return F.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Mx(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new sp({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?dp.fromSchema(a).parseSlice(Ax(e),n.parseOptions):dp.fromSchema(a).parse(Ax(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=dp.fromSchema(t);return n.slice?r.parseSlice(Ax(e),n.parseOptions).content:r.parse(Ax(e),n.parseOptions)}return Mx(``,t,n)}function Nx(e){return!(`type`in e)}function Px(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Qp||i instanceof $p))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(Km.near(e.doc.resolve(o),n))}var Fx=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Mx(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Mx(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=Nx(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):jx(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=F.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Px(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Ix(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Lx=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Ix(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=Mx(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&Px(t,t.steps.length-1,-1)),!0):!1},Rx=()=>({state:e,dispatch:t})=>jh(e,t),zx=()=>({state:e,dispatch:t})=>Mh(e,t),Bx=()=>({state:e,dispatch:t})=>bh(e,t),Vx=()=>({state:e,dispatch:t})=>Oh(e,t),Hx=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sm(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ux=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Sm(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Wx=()=>({state:e,dispatch:t})=>xh(e,t),Gx=()=>({state:e,dispatch:t})=>Sh(e,t);function Kx(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function qx(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))wx()||Kx()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Jx=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=qx(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Yx(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?rx(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>px(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Xx=(e,t={})=>({state:n,dispatch:r})=>Yx(n,rx(e,n.schema),t)?Nh(n,r):!1,Zx=()=>({state:e,dispatch:t})=>Rh(e,t),Qx=e=>({state:t,dispatch:n})=>ig(rx(e,t.schema))(t,n),$x=()=>({state:e,dispatch:t})=>Ph(e,t);function eS(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function tS(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var nS=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=eS(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=rx(e,r.schema)),s===`mark`&&(o=_x(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,tS(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(tS(a.attrs,t))))})})}),c},rS=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),iS=()=>({tr:e,dispatch:t})=>{if(t){let t=new eh(e.doc);e.setSelection(t)}return!0},aS=()=>({state:e,dispatch:t})=>Th(e,t),oS=()=>({state:e,dispatch:t})=>kh(e,t),sS=()=>({state:e,dispatch:t})=>Vh(e,t),cS=()=>({state:e,dispatch:t})=>qh(e,t),lS=()=>({state:e,dispatch:t})=>Kh(e,t);function uS(e,t,n={},r={}){return Mx(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var dS=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=uS(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=Nx(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function fS(e,t){let n=_x(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function pS(e,t){let n=new Wm(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function mS(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function hS(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function gS(e){return t=>hS(t.$from,e)}function L(e,t,n){return e.config[t]===void 0&&e.parent?L(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?L(e.parent,t,n):null}):e.config[t]}function _S(e){return e.map(e=>{let t=L(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,..._S(t())]:e}).flat(10)}function vS(e,t){let n=Tp.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function yS(e){return typeof e==`function`}function bS(e,t=void 0,...n){return yS(e)?t?e.bind(t)(...n):e(...n):e}function xS(e={}){return Object.keys(e).length===0&&e.constructor===Object}function SS(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function CS(e){let t=[],{nodeExtensions:n,markExtensions:r}=SS(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=L(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=L(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function wS(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function TS(e){let t=[],n=wS(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function ES(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...TS(n[e]),...TS(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function DS(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>ES(e,t),{})}function OS(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function kS(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):OS(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function AS(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&xS(t)?!1:t!=null))}function jS(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function MS(e,t){let n=CS(e),{nodeExtensions:r,markExtensions:i}=SS(e),a=r.find(e=>L(e,`topNode`))?.name;return new sp({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=AS({...e.reduce((e,t)=>{let n=L(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:bS(L(r,`content`,a)),marks:bS(L(r,`marks`,a)),group:bS(L(r,`group`,a)),inline:bS(L(r,`inline`,a)),atom:bS(L(r,`atom`,a)),selectable:bS(L(r,`selectable`,a)),draggable:bS(L(r,`draggable`,a)),code:bS(L(r,`code`,a)),whitespace:bS(L(r,`whitespace`,a)),linebreakReplacement:bS(L(r,`linebreakReplacement`,a)),defining:bS(L(r,`defining`,a)),isolating:bS(L(r,`isolating`,a)),attrs:Object.fromEntries(i.map(jS))}),s=bS(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>kS(e,i)));let c=L(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:DS(e,i)}));let l=L(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=AS({...e.reduce((e,t)=>{let n=L(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:bS(L(r,`inclusive`,a)),excludes:bS(L(r,`excludes`,a)),group:bS(L(r,`group`,a)),spanning:bS(L(r,`spanning`,a)),code:bS(L(r,`code`,a)),attrs:Object.fromEntries(i.map(jS))}),s=bS(L(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>kS(e,i)));let c=L(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:DS(e,i)})),[r.name,o]}))})}function NS(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function PS(e){return e.sort((e,t)=>{let n=L(e,`priority`)||100,r=L(t,`priority`)||100;return n>r?-1:+(n<r)})}function FS(e){let t=PS(_S(e)),n=NS(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function IS(e,t){return MS(FS(e),t)}function LS(e,t){let n=IS(t),r=Ax(e);return dp.fromSchema(n).parse(r).toJSON()}function RS(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
60
+
61
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function zS(e,t){return RS(e,{from:0,to:e.content.size},t)}function BS(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function VS(e,t){let n=rx(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function HS(e,t){let n=eS(typeof t==`string`?t:t.name,e.schema);return n===`node`?VS(e,t):n===`mark`?fS(e,t):{}}function US(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function WS(e){let t=US(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function GS(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),WS(r)}function KS(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=gx(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var qS=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},JS=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function YS(e,t){return t.nodes[e]||t.marks[e]||null}function XS(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var ZS=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function QS(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?_x(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>px(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>px(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function $S(e,t,n={}){if(!t)return Yx(e,null,n)||QS(e,null,n);let r=eS(t,e.schema);return r===`node`?Yx(e,t,n):r===`mark`&&QS(e,t,n)}var eC=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=gS(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},tC=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function nC(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function rC(e,t){let{nodeExtensions:n}=SS(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=bS(L(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function iC(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(iC(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function aC(e){return e instanceof Qm}var oC=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function sC(e,t){let n=t.mapping.mapResult(e.position);return{position:new oC(n.pos),mapResult:n}}function cC(e){return new oC(e)}function lC(e,t,n){let{selection:r}=t,i=null;if(bx(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var uC=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=_x(e,r.schema);if(i){if(o){let e=fS(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return lC(r,n,c)},dC=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),fC=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=rx(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Yh(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Yh(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},pC=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=xx(e,0,n.content.size),i=Qm.create(n,r);t.setSelection(i)}return!0},mC=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},hC=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=Xm.atStart(n).from,o=Xm.atEnd(n).to,s=xx(r,a,o),c=xx(i,a,o),l=Xm.create(n,s,c);t.setSelection(l)}return!0},gC=e=>({state:t,dispatch:n})=>sg(rx(e,t.schema))(t,n);function _C(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var vC=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=XS(l,s.node().type.name,s.node().attrs);if(a instanceof Qm&&a.node.isBlock)return!s.parentOffset||!_m(o,s.pos)?!1:(r&&(e&&_C(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Ix(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=_m(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&_m(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof Xm&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&_C(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},yC=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=rx(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=F.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=F.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...XS(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(F.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new I(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(Xm.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...XS(d,u.type.name,u.attrs),...t},m={...XS(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!_m(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function bC(e){return!e||e===`1`?null:e}function xC(e,t){return bC(e)===bC(t)}var SC=(e,t)=>{let n=gS(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&ym(e.doc,n.pos))||!xC(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},CC=(e,t)=>{let n=gS(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&ym(e.doc,r))||!xC(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function wC(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Xm.between(r,i)}var TC=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=rx(e,o.schema),m=rx(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=gS(e=>rC(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&rC(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!T;if((ee||D)&&E){if(E.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=wC(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(rC(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>SC(a,p)).command(()=>CC(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>SC(a,p)).command(()=>CC(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>SC(a,p)).command(()=>CC(a,p)).run()},EC=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=_x(e,r.schema);return QS(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},DC=(e,t,n={})=>({state:r,commands:i})=>{let a=rx(e,r.schema),o=rx(t,r.schema),s=Yx(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},OC=(e,t={})=>({state:n,commands:r})=>{let i=rx(e,n.schema);return Yx(n,i,t)?r.lift(i):r.wrapIn(i,t)},kC=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},AC=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},jC=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=_x(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=gx(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},MC=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},NC=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=eS(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=rx(e,r.schema)),s===`mark`&&(o=_x(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},PC=new _h(`__tiptap_decorations__`),FC=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(PC,{type:`force`,name:e}),!0),IC=(e,t={})=>({state:n,dispatch:r})=>Jh(rx(e,n.schema),t)(n,r),LC=(e,t={})=>({state:n,dispatch:r})=>tg(rx(e,n.schema),t)(n,r),RC=new WeakMap;function zC(e,t){RC.set(e,(RC.get(e)??0)+1);try{return t()}finally{let t=(RC.get(e)??1)-1;t>0?RC.set(e,t):RC.delete(e)}}function BC(e){return RC.has(e)}var VC=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},HC=typeof process<`u`&&!1;function UC(e){return e.kind===`widget`}function WC(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&UC(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function GC(e,t,n){let{decorations:r,widgetKeys:i}=WC(t,n);return{set:Wy.create(e,r),widgetKeys:i}}function KC({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function qC({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>KC({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function JC(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function YC(e){let t=new Map,n=new Map;for(let r of e.find()){let e=JC(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function XC(e){return e.jsonID===`attr`}function ZC(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||XC(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function QC(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function $C(e,t){if(e.steps.some(e=>!ZC(e)))return{type:`full`};let n=GS(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!XC(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=QC(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function ew(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function tw(e,t,n){let r=t.decorationSetsByExtension[e]??Wy.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:ew(r,n.mapping,n.doc,i),widgetKeys:i}}function nw(e,t){let n=Object.values(t).flatMap(e=>e.find());return Wy.create(e,n)}function rw(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function iw(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function aw(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var ow=new Set,sw=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=PC.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>iw(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return PC.getState(this.editor.state)?.widgetKeys??ow}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new mh({key:PC,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:rw(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(PC),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return zC(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!aw(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=tw(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:rw(u)}}},props:{decorations(e){return PC.getState(e)?.mergedDecorationSet??Wy.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=$C(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??Wy.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=ew(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>KC({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=JC(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=WC(qC({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return GC(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!HC)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=YC(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:nw(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):nw(n.doc,r)}};function cw(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}function lw(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof Qm){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function uw(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function dw(e){return e.replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&amp;/g,`&`)}function fw(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function pw(e){return typeof e==`number`}function mw(e){return Object.prototype.toString.call(e).slice(8,-1)}function hw(e){return mw(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}Kb({},{createAtomBlockMarkdownSpec:()=>vw,createBlockMarkdownSpec:()=>yw,createInlineMarkdownSpec:()=>Sw,parseAttributes:()=>gw,parseIndentedBlocks:()=>Cw,renderNestedMarkdownContent:()=>ww,serializeAttributes:()=>_w});function gw(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10),a=n[i];a&&(t[e]=a.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([\w-]+)/g,``).replace(/(?:^|\s)#([\w-]+)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function _w(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e!==`class`&&e!==`id`&&(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function vw(e){let{nodeName:t,name:n,parseAttributes:r=gw,serializeAttributes:i=_w,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=s[1]||``,u=r(l);if(!o.find(e=>!(e in u)))return{type:t,raw:s[0],attributes:u}}},renderMarkdown:e=>{let t=l(e.attrs||{}),n=i(t),r=n?` {${n}}`:``;return`:::${c}${r} :::`}}}function yw(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=gw,serializeAttributes:a=_w,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m){if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m)}return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=u(e.attrs||{}),r=a(n),i=r?` {${r}}`:``,o=t.renderChildren(e.content||[],`
62
+
63
+ `);return`:::${l}${i}
64
+
65
+ ${o}
66
+
67
+ :::`}}}function bw(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function xw(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Sw(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=bw,serializeAttributes:a=xw,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=u(e.attrs||{}),i=a(n),o=i?` ${i}`:``;return s?`[${l}${o}]`:`[${l}${o}]${t}[/${l}]`}}}function Cw(e,t,n){let r=e.split(`
68
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
69
+ `;continue}return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
70
+ `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
71
+ `,o+=1;continue}break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
72
+ `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
73
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function ww(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
74
+ `).map(e=>e?t.indent(e):t.indent(``)).join(`
75
+ `);s+=e.type===`paragraph`?`
76
+
77
+ ${n}`:`
78
+ ${n}`}}),s}function Tw(e){return typeof e.type==`string`?e.type:e.type.name}function Ew(e,t){if(e.length!==t.length)return!1;let n=Array.from({length:t.length},()=>!1);return e.every(e=>{let r=Tw(e),i=t.findIndex((t,i)=>!n[i]&&r===Tw(t)&&cw(e.attrs,t.attrs));return i!==-1&&(n[i]=!0,!0)})}function Dw(e,t){let n={...e};return hw(e)&&hw(t)&&Object.keys(t).forEach(r=>{hw(t[r])&&hw(e[r])?n[r]=Dw(e[r],t[r]):n[r]=t[r]}),n}function Ow(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var kw=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Aw=(e,t)=>{if(fx(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function jw(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=ZS(c)+i;return a.forEach(e=>{if(l)return;let a=Aw(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=qb({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new Jb({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})===null||!f.steps.length||(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function Mw(e){let{editor:t,rules:n}=e,r=new mh({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:vS(F.from(e),a.schema);let{from:i}=s,o=i+e.length;jw({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return jw({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&jw({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?jw({editor:t,from:a.pos,to:a.pos,text:`
79
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Nw=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...bS(L(this,`addOptions`,{name:this.name}))}}get storage(){return{...bS(L(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Dw(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Pw=class e extends Nw{constructor(){super(...arguments),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Fw=class{constructor(e){this.find=e.find,this.handler=e.handler}},Iw=(e,t,n)=>{if(fx(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Lw(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Jb({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Iw(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Rw=null,zw=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Bw(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=qb({state:e,transaction:c});if(!(!Lw({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new mh({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Rw=t)},i=()=>{Rw&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Rw;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:vS(F.from(t),r.schema);let{from:n}=d,i=n+t.length,a=zw(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!pw(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Vw=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=FS(e),this.schema=MS(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=L(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:YS(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=PS([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:YS(t.name,this.schema)},r=[],i=L(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&L(t,`exitable`,n)&&(a.ArrowRight=()=>Pw.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Ub(a);r.push(o);let s=L(t,`addInputRules`,n);if(nC(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Mw({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=L(t,`addPasteRules`,n);if(nC(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Bw({editor:e,rules:t});r.push(...n)}}let l=L(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=L(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:YS(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new sw({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return CS(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=SS(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:rx(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=DS(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return PS([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:YS(n.name,this.schema)},i=L(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return PS([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:YS(n.name,this.schema)},i=L(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=SS(this.extensions);return Object.fromEntries(t.filter(e=>!!L(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=L(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:_x(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=DS(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Ow(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:YS(e.name,this.schema)};e.type===`mark`&&((bS(L(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(bS(L(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=L(e,`onBeforeCreate`,t),r=L(e,`onCreate`,t),i=L(e,`onUpdate`,t),a=L(e,`onSelectionUpdate`,t),o=L(e,`onTransaction`,t),s=L(e,`onFocus`,t),c=L(e,`onBlur`,t),l=L(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Vw.resolve=FS,Vw.sort=PS,Vw.flatten=_S,Kb({},{ClipboardTextSerializer:()=>Uw,Commands:()=>Ww,Delete:()=>Gw,Drop:()=>Kw,Editable:()=>qw,FocusEvents:()=>Yw,Keymap:()=>Xw,Paste:()=>Zw,Tabindex:()=>Qw,TextDirection:()=>$w,focusEventsPluginKey:()=>Jw});var Hw=class e extends Nw{constructor(){super(...arguments),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Uw=Hw.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new mh({key:new _h(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=BS(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>RS(r,{from:e.pos,to:t.pos},s)).join(o??`
80
+
81
+ `)}}})]}}),Ww=Hw.create({name:`commands`,addCommands(){return{...Yb}}}),Gw=Hw.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=pS(e.before,[e,...t]);GS(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Yp){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0&&r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),Kw=Hw.create({name:`drop`,addProseMirrorPlugins(){return[new mh({key:new _h(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),qw=Hw.create({name:`editable`,addProseMirrorPlugins(){return[new mh({key:new _h(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Jw=new _h(`focusEvents`),Yw=Hw.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new mh({key:Jw,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Xw=Hw.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:Km.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return wx()||Kx()?i:r},addProseMirrorPlugins(){return[new mh({key:new _h(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=Km.atStart(t.doc).from,l=Km.atEnd(t.doc).to;if(a||o!==c||s!==l||!iC(n.doc))return;let u=n.tr,d=qb({state:n,transaction:u}),{commands:f}=new Jb({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Zw=Hw.create({name:`paste`,addProseMirrorPlugins(){return[new mh({key:new _h(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Qw=Hw.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new mh({key:new _h(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),$w=Hw.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=SS(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new mh({key:new _h(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),eT=!1;function tT(e){if(eT)return;eT=!0;let t;try{t=Qp.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof F||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var nT=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},rT=`.ProseMirror {
82
+ position: relative;
83
+ }
84
+
85
+ .ProseMirror {
86
+ word-wrap: break-word;
87
+ white-space: pre-wrap;
88
+ white-space: break-spaces;
89
+ -webkit-font-variant-ligatures: none;
90
+ font-variant-ligatures: none;
91
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
92
+ }
93
+
94
+ .ProseMirror [contenteditable="false"] {
95
+ white-space: normal;
96
+ }
97
+
98
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
99
+ white-space: pre-wrap;
100
+ }
101
+
102
+ .ProseMirror pre {
103
+ white-space: pre-wrap;
104
+ }
105
+
106
+ img.ProseMirror-separator {
107
+ display: inline !important;
108
+ border: none !important;
109
+ margin: 0 !important;
110
+ width: 0 !important;
111
+ height: 0 !important;
112
+ }
113
+
114
+ .ProseMirror-gapcursor {
115
+ display: none;
116
+ pointer-events: none;
117
+ position: absolute;
118
+ margin: 0;
119
+ }
120
+
121
+ .ProseMirror-gapcursor:after {
122
+ content: "";
123
+ display: block;
124
+ position: absolute;
125
+ top: -2px;
126
+ width: 20px;
127
+ border-top: 1px solid black;
128
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
129
+ }
130
+
131
+ @keyframes ProseMirror-cursor-blink {
132
+ to {
133
+ visibility: hidden;
134
+ }
135
+ }
136
+
137
+ .ProseMirror-hideselection *::selection {
138
+ background: transparent;
139
+ }
140
+
141
+ .ProseMirror-hideselection *::-moz-selection {
142
+ background: transparent;
143
+ }
144
+
145
+ .ProseMirror-hideselection * {
146
+ caret-color: transparent;
147
+ }
148
+
149
+ .ProseMirror-focused .ProseMirror-gapcursor {
150
+ display: block;
151
+ }`,iT=class extends VC{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:sC,createMappablePosition:cC},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=Sx(t,this.options.autofocus);this.editorState=fh.create({doc:t,schema:this.schema,selection:e||void 0})}tT(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=uw(rT,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return HC&&!this.hasWarnedStaleDecorationRead&&BC(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=yS(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[qw,Uw.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Ww,Yw,Xw,Qw.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),Kw,Zw,Gw,$w.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Vw(e,this)}createCommandManager(){this.commandManager=new Jb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=uS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=uS(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=fh.create({doc:t,schema:this.schema,selection:Sx(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Cb(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return HS(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return $S(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return vS(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
152
+
153
+ `,textSerializers:n={}}=e||{};return zS(this.state.doc,{blockSeparator:t,textSerializers:{...BS(this.schema),...n}})}get isEmpty(){return iC(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new nT(t,this,!1,n)}get $doc(){return this.$pos(0)}};function aT(e){return new kw({find:e.find,handler:({state:t,range:n,match:r})=>{let i=bS(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(KS(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function oT(e){return new kw({find:e.find,handler:({state:t,range:n,match:r})=>{let i=bS(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function sT(e){return new kw({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=bS(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function cT(e){return new kw({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=bS(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&sm(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&ym(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var lT=class e extends Nw{constructor(){super(...arguments),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function uT(e){return new Fw({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=bS(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(KS(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function dT(e={}){return new mh({view(t){return new fT(t,e)}})}var fT=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Tm(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},pT=class e extends Km{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Km.near(r)}content(){return I.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new mT(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!gT(e)||!_T(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Qm.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};pT.prototype.visible=!1,pT.findFrom=pT.findGapCursorFrom,Km.jsonID(`gapcursor`,pT);var mT=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return pT.valid(t)?new pT(t):Km.near(t)}};function hT(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function gT(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||hT(e.type))return!0;if(e.inlineContent)return!1}}return!0}function _T(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||hT(e.type))return!0;if(e.inlineContent)return!1}}return!0}function vT(){return new mh({props:{decorations:CT,createSelectionBetween(e,t,n){return t.pos==n.pos&&pT.valid(n)?new pT(n):null},handleClick:xT,handleKeyDown:yT,handleDOMEvents:{beforeinput:ST}}})}var yT=Wb({ArrowLeft:bT(`horiz`,-1),ArrowRight:bT(`horiz`,1),ArrowUp:bT(`vert`,-1),ArrowDown:bT(`vert`,1)});function bT(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof Xm){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=pT.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new pT(c))),!0):!1}}function xT(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!pT.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Qm.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new pT(r))),!0)}function ST(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof pT))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=F.empty;for(let e=r.length-1;e>=0;e--)i=F.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new I(i,0,0));return a.setSelection(Xm.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function CT(e){if(!(e.selection instanceof pT))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Wy.create(e.doc,[Vy.widget(e.selection.head,t,{key:`gapcursor`})])}var wT=200,TT=function(){};TT.prototype.append=function(e){return e.length?(e=TT.from(e),!this.length&&e||e.length<wT&&this.leafAppend(e)||this.length<wT&&e.leafPrepend(this)||this.appendInner(e)):this},TT.prototype.prepend=function(e){return e.length?TT.from(e).append(this):this},TT.prototype.appendInner=function(e){return new DT(this,e)},TT.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?TT.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},TT.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},TT.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},TT.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},TT.from=function(e){return e instanceof TT?e:e&&e.length?new ET(e):TT.empty};var ET=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=wT)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=wT)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(TT);TT.empty=new ET([]);var DT=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(TT),OT=500,kT=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new jT(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new jT(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new jT(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>NT&&(s=AT(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Up;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new jT(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new jT(i,o,l))}else r.push(new jT(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new jT(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>OT&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new jT(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(TT.from(i.reverse()),a)}};kT.empty=new kT(TT.empty,0);function AT(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var jT=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},MT=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},NT=20;function PT(e,t,n,r){let i=n.getMeta(HT),a;if(i)return i.historyState;n.getMeta(UT)&&(e=new MT(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(HT))return o.getMeta(HT).redo?new MT(e.done.addTransform(n,void 0,r,VT(t)),e.undone,IT(n.mapping.maps),e.prevTime,e.prevComposition):new MT(e.done,e.undone.addTransform(n,void 0,r,VT(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!FT(n,e.prevRanges)),s=o?LT(e.prevRanges,n.mapping):IT(n.mapping.maps);return new MT(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,VT(t)),kT.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new MT(e.done.rebased(n,a),e.undone.rebased(n,a),LT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new MT(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),LT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function FT(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function IT(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function LT(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function RT(e,t,n){let r=VT(t),i=HT.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new MT(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(HT,{redo:n,historyState:c})}var zT=!1,BT=null;function VT(e){let t=e.plugins;if(BT!=t){zT=!1,BT=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){zT=!0;break}}return zT}var HT=new _h(`history`),UT=new _h(`closeHistory`);function WT(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new mh({key:HT,state:{init(){return new MT(kT.empty,kT.empty,null,0,-1)},apply(t,n,r){return PT(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?KT:n==`historyRedo`?qT:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function GT(e,t){return(n,r)=>{let i=HT.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=RT(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var KT=GT(!1,!0),qT=GT(!0,!0);Hw.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new mh({key:new _h(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var JT=Hw.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[dT(this.options)]}});Hw.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new mh({key:new _h(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Wy.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Vy.node(t,t+e.nodeSize,{class:this.options.className}))}),Wy.create(e,a)}}})]}});var YT=Hw.create({name:`gapCursor`,addProseMirrorPlugins(){return[vT()]},extendNodeSchema(e){return{allowGapCursor:bS(L(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),XT=`placeholder`,ZT=new _h(`tiptap__placeholder`);function QT(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Vy.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function $T(e,t){return typeof e==`function`?e(t):e}function eE({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&iC(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(QT({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$T(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function tE({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&iC(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(QT({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$T(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...eE({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return Wy.create(r,o)}function nE(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function rE(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function iE(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function aE(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function oE(e,t){let n=iE(e,t.from,t.to);return n.push(rE(e,nE(e,t.from))),t.to>t.from?n.push(rE(e,nE(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(rE(e,nE(e,Math.min(t.from+1,e.content.size)))),n}function sE(e,t,n){let r=[];if(e.docChanged){let t=GS(e);for(let e of t)r.push(...oE(n.doc,e.newRange))}return e.selectionSet&&(r.push(rE(n.doc,nE(n.doc,e.mapping.map(t.selection.anchor)))),r.push(rE(n.doc,nE(n.doc,n.selection.anchor)))),aE(r)}function cE(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function lE({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=cE(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=eE({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function uE({editor:e,options:t,dataAttribute:n}){return{init(r,i){return tE({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??Wy.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:lE({decorations:i.map(r.mapping,r.doc),ranges:sE(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function dE(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function fE({editor:e,options:t}){let n=t.dataAttribute?`data-${dE(t.dataAttribute)}`:`data-${XT}`,r=t.showOnlyCurrent&&!t.includeChildren;return new mh({key:ZT,...r?{}:{state:uE({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>tE({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?Wy.empty:ZT.getState(n)??Wy.empty}})}var pE=Hw.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:XT,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[fE({editor:this.editor,options:this.options})]}});function mE(e,t){return!e.selection.empty&&!aC(e.selection)&&t.isEditable}function hE(e,t){return mE(e,t)&&!t.isFocused&&!t.view.dragging}function gE(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function _E(e){e.focus()}Hw.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new mh({key:new _h(`selection`),props:{decorations(n){return hE(n,e)?Wy.create(n.doc,[Vy.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return mE(t.state,e)&&gE(),!1},focus(t){return mE(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&_E(t)}),!1}}}})]}});function vE({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var yE=Hw.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new _h(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new mh({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!vE({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!vE({node:r,types:n})}}})]}}),bE=Hw.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>KT(e,t),redo:()=>({state:e,dispatch:t})=>qT(e,t)}},addProseMirrorPlugins(){return[WT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xE=pE,SE=Object.defineProperty,CE=(e,t)=>{for(var n in t)SE(e,n,{get:t[n],enumerable:!0})},wE=`listItem`,TE=`textStyle`,EE=/^\s*([-+*])\s$/,DE=lT.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,ES(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
154
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wE,this.editor.getAttributes(TE)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=cT({find:EE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=cT({find:EE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(TE),editor:this.editor})),[e]}}),OE=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},kE=(e,t,n,r)=>{let i=OE(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,F.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},AE=(e,t,n)=>kE(e.state,e.view.dispatch,t,n),jE=(e,t)=>Hw.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>AE(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),ME=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],NE=`abcdefghijklmnopqrstuvwxyz`,PE=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function FE(e){let t=e,n=``;for(let[e,r]of ME)for(;t>=e;)n+=r,t-=e;return n}function IE(e){return FE(e).toUpperCase()}function LE(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of ME)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function RE(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=LE(e);return t<=0?!1:(e===e.toLowerCase()?FE(t):IE(t))===e}function zE(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function BE(e){if(e<=26)return NE[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?NE[n]:NE[t]+NE[n]}function VE(e){if(!(!e||/^\d+$/.test(e))){if(RE(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function HE(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=VE(e);if(t===`i`||t===`I`)return LE(e);if(t===`a`||t===`A`){let t=zE(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function UE(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return BE(t);case`A`:return BE(t).toUpperCase();case`i`:return FE(t);case`I`:return IE(t);default:return String(t)}}function WE(e){if(e.length===0)return!1;let t=VE(e[0])??`numeric`,n=HE(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=UE(t,n+r);if(e[r]!==i)return!1}return!0}function GE(e){return{type:VE(e),start:HE(e)}}function KE(e){let{type:t,start:n}=GE(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function qE(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${BE(r)}${n}`;case`A`:return`${BE(r).toUpperCase()}${n}`;case`i`:return`${FE(r)}${n}`;case`I`:return`${IE(r)}${n}`;default:return`${r}${n}`}}function JE(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function YE(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var XE=lT.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,ES(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(JE(e))return{type:`listItem`,content:[{type:`paragraph`,content:YE(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>ww(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return qE(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[jE(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});CE({},{findListItemPos:()=>ZE,getNextListDepth:()=>QE,handleBackspace:()=>eD,handleDelete:()=>rD,handleTab:()=>iD,hasListBefore:()=>$E,hasListItemAfter:()=>aD,hasListItemBefore:()=>oD,listItemHasSubList:()=>sD,nextListIsDeeper:()=>tD,nextListIsHigher:()=>nD});var ZE=(e,t)=>{let{$from:n}=t.selection,r=rx(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},QE=(e,t)=>{let n=ZE(e,t);if(!n)return!1;let[,r]=qS(t,e,n.$pos.pos+4);return r},$E=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},eD=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Yx(e.state,t)&&$E(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Yx(e.state,t)||!tC(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},tD=(e,t)=>{let n=QE(e,t),r=ZE(e,t);return!r||!n?!1:n>r.depth},nD=(e,t)=>{let n=QE(e,t),r=ZE(e,t);return!r||!n?!1:n<r.depth},rD=(e,t)=>{if(!Yx(e.state,t)||!eC(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:tD(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():nD(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},iD=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Yx(r,t))return!1;let o=JS(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,F.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,F.from(c)),e.setSelection(Xm.create(e.doc,d+1)),e.scrollIntoView()),!0))},aD=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return r.index()!==r.parent.childCount-1&&r.nodeAfter?.type.name===e},oD=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return r.index()!==0&&r.nodeBefore?.type.name===e},sD=(e,t,n)=>{if(!n)return!1;let r=rx(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},cD=Hw.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&rD(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&rD(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&eD(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&eD(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&iD(e,t,n))return!0;return!1}}}}),lD=RegExp(`^(\\s*)(${PE})([.)])\\s+(.*)$`),uD=/^\s/,dD={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function fD(e){return lD.test(e.trimStart())}function pD(e){let t=e.trimStart();return dD.bulletItem.test(t)||fD(t)||dD.heading.test(t)||dD.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||dD.codeFence.test(t)||dD.blockMath.test(t)}function mD(e){return Object.values(dD).some(t=>t.test(e))}function hD(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&pD(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function gD(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(lD);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?VE(s):void 0,p=isNaN(d)?HE(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(lD))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(uD)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||mD(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
155
+ `).trim(),contentLines:m,raw:g.join(`
156
+ `)}),r=h,n=h}return[t,r]}var _D=RegExp(`^(${PE})([.)])\\s+(.+)$`);function vD(e){let t=e.split(`
157
+ `).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(_D);if(!t)return null;n.push({marker:t[1],content:t[3]})}return WE(n.map(e=>e.marker))?{type:`orderedList`,attrs:KE(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function yD(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=hD(a.contentLines),c=o.join(`
158
+ `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
159
+ `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=yD(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
160
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function bD(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var xD=`listItem`,SD=`textStyle`,CD=/^(\d+)\.\s$/;function wD(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var TD=lT.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=wD(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=wD(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=ES(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?bD(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
161
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
162
+ `),[i,a]=gD(r);if(i.length===0)return;let o=yD(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
163
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(xD,this.editor.getAttributes(SD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new mh({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=vD(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=cT({find:CD,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cT({find:CD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(SD)}),joinPredicate:e,editor:this.editor})),[t]}}),ED=/^\s*(\[([( |x])?\])\s$/,DD=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,OD=(e,t,n)=>(n?.checkboxLabel)?.call(n,e,t)||`Task item checkbox for ${e.textContent||`empty task item`}`,kD=lT.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,ES(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>ww(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[jE(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=DD;let l=e=>{let t=OD(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=DS(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[cT({find:ED,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),AD=lT.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,ES(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
164
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Cw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=Cw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Hw.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(DE.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(XE.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cD.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(TD.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(kD.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(AD.configure(this.options.taskList)),e}});var jD=kD,MD=AD;function ND(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var PD=ND();function FD(e){PD=e}var ID={exec:()=>null};function LD(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(zD.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var RD=(()=>{try{return!0}catch{return!1}})(),zD={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},BD=/^(?:[ \t]*(?:\n|$))+/,VD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,HD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,UD=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,WD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,GD=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,KD=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qD=LD(KD).replace(/bull/g,GD).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),JD=LD(KD).replace(/bull/g,GD).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),YD=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XD=/^[^\n]+/,ZD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,QD=LD(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ZD).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$D=LD(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,GD).getRegex(),eO=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,tO=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nO=LD(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,tO).replace(`tag`,eO).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rO=LD(YD).replace(`hr`,UD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eO).getRegex(),iO={blockquote:LD(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,rO).getRegex(),code:VD,def:QD,fences:HD,heading:WD,hr:UD,html:nO,lheading:qD,list:$D,newline:BD,paragraph:rO,table:ID,text:XD},aO=LD(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,UD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eO).getRegex(),oO={...iO,lheading:JD,table:aO,paragraph:LD(YD).replace(`hr`,UD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,aO).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,eO).getRegex()},sO={...iO,html:LD(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,tO).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ID,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:LD(YD).replace(`hr`,UD).replace(`heading`,` *#{1,6} *[^
165
+ ]`).replace(`lheading`,qD).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},cO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,uO=/^( {2,}|\\)\n(?!\s*$)/,dO=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fO=/[\p{P}\p{S}]/u,pO=/[\s\p{P}\p{S}]/u,mO=/[^\s\p{P}\p{S}]/u,hO=LD(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,pO).getRegex(),gO=/(?!~)[\p{P}\p{S}]/u,_O=/(?!~)[\s\p{P}\p{S}]/u,vO=/(?:[^\s\p{P}\p{S}]|~)/u,yO=LD(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,RD?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),bO=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xO=LD(bO,`u`).replace(/punct/g,fO).getRegex(),SO=LD(bO,`u`).replace(/punct/g,gO).getRegex(),CO=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,wO=LD(CO,`gu`).replace(/notPunctSpace/g,mO).replace(/punctSpace/g,pO).replace(/punct/g,fO).getRegex(),TO=LD(CO,`gu`).replace(/notPunctSpace/g,vO).replace(/punctSpace/g,_O).replace(/punct/g,gO).getRegex(),EO=LD(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,mO).replace(/punctSpace/g,pO).replace(/punct/g,fO).getRegex(),DO=LD(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,fO).getRegex(),OO=LD(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,mO).replace(/punctSpace/g,pO).replace(/punct/g,fO).getRegex(),kO=LD(/\\(punct)/,`gu`).replace(/punct/g,fO).getRegex(),AO=LD(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jO=LD(tO).replace(`(?:-->|$)`,`-->`).getRegex(),MO=LD(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,jO).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),NO=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,PO=LD(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,NO).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),FO=LD(/^!?\[(label)\]\[(ref)\]/).replace(`label`,NO).replace(`ref`,ZD).getRegex(),IO=LD(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ZD).getRegex(),LO=LD(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,FO).replace(`nolink`,IO).getRegex(),RO=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zO={_backpedal:ID,anyPunctuation:kO,autolink:AO,blockSkip:yO,br:uO,code:lO,del:ID,delLDelim:ID,delRDelim:ID,emStrongLDelim:xO,emStrongRDelimAst:wO,emStrongRDelimUnd:EO,escape:cO,link:PO,nolink:IO,punctuation:hO,reflink:FO,reflinkSearch:LO,tag:MO,text:dO,url:ID},BO={...zO,link:LD(/^!?\[(label)\]\((.*?)\)/).replace(`label`,NO).getRegex(),reflink:LD(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,NO).getRegex()},VO={...zO,emStrongRDelimAst:TO,emStrongLDelim:SO,delLDelim:DO,delRDelim:OO,url:LD(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,RO).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:LD(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,RO).getRegex()},HO={...VO,br:LD(uO).replace(`{2,}`,`*`).getRegex(),text:LD(VO.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},UO={normal:iO,gfm:oO,pedantic:sO},WO={normal:zO,gfm:VO,breaks:HO,pedantic:BO},GO={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},KO=e=>GO[e];function qO(e,t){if(t){if(zD.escapeTest.test(e))return e.replace(zD.escapeReplace,KO)}else if(zD.escapeTestNoEncode.test(e))return e.replace(zD.escapeReplaceNoEncode,KO);return e}function JO(e){try{e=encodeURI(e).replace(zD.percentDecode,`%`)}catch{return null}return e}function YO(e,t){let n=e.replace(zD.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(zD.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(zD.slashPipe,`|`);return n}function XO(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ZO(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function QO(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function $O(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ek(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
166
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
167
+ `)}var tk=class{options;rules;lexer;constructor(e){this.options=e||PD}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:XO(e,`
168
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ek(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=XO(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:XO(t[0],`
169
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=XO(t[0],`
170
+ `).split(`
171
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
172
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
173
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
174
+ ${s}`:s,r=r?`${r}
175
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
176
+ `+e.join(`
177
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
178
+ `+e.join(`
179
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
180
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=QO(t[2].split(`
181
+ `,1)[0],t[1].length),l=e.split(`
182
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
183
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
184
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
185
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
186
+ `+l}u=!l.trim(),r+=p+`
187
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=YO(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
188
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(YO(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
189
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=XO(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ZO(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),$O(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return $O(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},nk=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||PD,this.options.tokenizer=this.options.tokenizer||new tk,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:zD,block:UO.normal,inline:WO.normal};this.options.pedantic?(t.block=UO.pedantic,t.inline=WO.pedantic):this.options.gfm&&(t.block=UO.gfm,t.inline=this.options.breaks?WO.breaks:WO.gfm),this.tokenizer.rules=t}static get rules(){return{block:UO,inline:WO}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(zD.carriageReturn,`
190
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(zD.tabCharGlobal,` `).replace(zD.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
191
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
192
+ `)?``:`
193
+ `)+r.raw,n.text+=`
194
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
195
+ `)?``:`
196
+ `)+r.raw,n.text+=`
197
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
198
+ `)?``:`
199
+ `)+r.raw,a.text+=`
200
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
201
+ `)?``:`
202
+ `)+r.raw,n.text+=`
203
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},rk=class{options;parser;constructor(e){this.options=e||PD}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(zD.notSpaceStart)?.[0],i=e.replace(zD.endingNewline,``)+`
204
+ `;return r?`<pre><code class="language-`+qO(r)+`">`+(n?i:qO(i,!0))+`</code></pre>
205
+ `:`<pre><code>`+(n?i:qO(i,!0))+`</code></pre>
206
+ `}blockquote({tokens:e}){return`<blockquote>
207
+ ${this.parser.parse(e)}</blockquote>
208
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
209
+ `}hr(e){return`<hr>
210
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
211
+ `+r+`</`+i+`>
212
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
213
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
214
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
215
+ <thead>
216
+ `+t+`</thead>
217
+ `+r+`</table>
218
+ `}tablerow({text:e}){return`<tr>
219
+ ${e}</tr>
220
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
221
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${qO(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=JO(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+qO(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=JO(e);if(i===null)return qO(n);e=i;let a=`<img src="${e}" alt="${qO(n)}"`;return t&&(a+=` title="${qO(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:qO(e.text)}},ik=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ak=class e{options;renderer;textRenderer;constructor(e){this.options=e||PD,this.options.renderer=this.options.renderer||new rk,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ik}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ok=class{options;block;constructor(e){this.options=e||PD}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?nk.lex:nk.lexInline}provideParser(e=this.block){return e?ak.parse:ak.parseInline}},sk=new class{defaults=ND();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ak;Renderer=rk;TextRenderer=ik;Lexer=nk;Tokenizer=tk;Hooks=ok;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new rk(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new tk(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ok;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ok.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ok.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nk.lex(e,t??this.defaults)}parser(e,t){return ak.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?nk.lex:nk.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ak.parse:ak.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?nk.lex:nk.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ak.parse:ak.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
222
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+qO(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ck(e,t){return sk.parse(e,t)}ck.options=ck.setOptions=function(e){return sk.setOptions(e),ck.defaults=sk.defaults,FD(ck.defaults),ck},ck.getDefaults=ND,ck.defaults=PD,ck.use=function(...e){return sk.use(...e),ck.defaults=sk.defaults,FD(ck.defaults),ck},ck.walkTokens=function(e,t){return sk.walkTokens(e,t)},ck.parseInline=sk.parseInline,ck.Parser=ak,ck.parser=ak.parse,ck.Renderer=rk,ck.TextRenderer=ik,ck.Lexer=nk,ck.lexer=nk.lex,ck.Tokenizer=tk,ck.Hooks=ok,ck.parse=ck,ck.options,ck.setOptions,ck.use,ck.walkTokens,ck.parseInline,ak.parse,nk.lex;var lk=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function uk(e){return e.flatMap((t,n)=>{if(t.type===`space`||e[n+1]?.type===`space`)return[t];let r=(t.raw||``).match(lk);return r?[{...t,raw:(t.raw||``).slice(0,-r[0].length)},{type:`space`,raw:r[0]}]:[t]})}function dk(e,t){let n=t.split(`
223
+ `).flatMap(e=>[e,``]).map(t=>`${e}${t}`).join(`
224
+ `);return n.slice(0,n.length-1)}function fk(e,t){let n=[];return Array.from(e.entries()).forEach(([e,r])=>{if(!t){n.push(e);return}(t.marks||[]).find(t=>t.type===e&&cw(t.attrs,r.attrs))||n.push(e)}),n}function pk(e,t){let n=[];return Array.from(t.entries()).forEach(([t,r])=>{let i=e.get(t);(!i||!cw(i.attrs,r.attrs))&&n.push({type:t,mark:r})}),n}function mk(e,t,n,r){let i=!n,a=n&&(!n.marks||n.marks.length===0),o=n&&n.marks&&!r(t,new Map(n.marks.map(e=>[e.type,e]))),s=[];return(i||a||o)&&(n&&n.marks?Array.from(e.entries()).reverse().forEach(([e,t])=>{n.marks.find(n=>n.type===e&&cw(n.attrs,t.attrs))||s.push(e)}):(i||a)&&s.push(...Array.from(e.keys()).reverse())),s}function hk(e,t){let n=``;return Array.from(e.keys()).reverse().forEach(r=>{let i=t(r,e.get(r));i&&(n=i+n)}),e.clear(),n}function gk(e,t,n){let r=``;return Array.from(e.entries()).forEach(([e,i])=>{let a=n(e,i);a&&(r+=a),t.set(e,i)}),r}function _k(e){let t=(e.raw||e.text||``).match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return t?{isTask:!0,checked:t[2].toLowerCase()===`x`,indentLevel:t[1].length}:{isTask:!1,indentLevel:0}}function vk(e,t){return typeof e==`string`?t:`json`}var yk=new Set(`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.circle.clippath.defs.ellipse.foreignobject.g.image.line.lineargradient.mask.path.polygon.polyline.radialgradient.rect.stop.switch.symbol.textpath.tspan.use.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`)),bk=/<\/?([a-zA-Z][\w-]*)/g;function xk(e){let t=[],n;for(;(n=bk.exec(e))!==null;)t.push(n[1].toLowerCase());return t}function Sk(e){let t=e.toLowerCase();return!t.includes(`-`)&&!yk.has(t)}function Ck(e,t){return xk(e).some(e=>Sk(e)?!t.has(e):!1)}var wk=class{constructor(e){this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=e?.marked??ck,this.indentStyle=e?.indentation?.style??`space`,this.indentSize=e?.indentation?.size??2,this.baseExtensions=e?.extensions||[],e?.markedOptions&&typeof this.markedInstance.setOptions==`function`&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e?.extensions&&(this.baseExtensions=e.extensions,PS(_S(e.extensions)).forEach(e=>this.registerExtension(e)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle===`space`?` `:` `}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){this.extensions.push(e);let t=bS(L(e,`code`)),n=e.name;t&&this.codeTypes.add(n),this.extensionRanks.has(n)||this.extensionRanks.set(n,this.extensionRanks.size);let r=L(e,`markdownTokenName`)||n,i=L(e,`parseMarkdown`),a=L(e,`renderMarkdown`),o=L(e,`markdownTokenizer`),s=L(e,`markdownOptions`)??null,c={tokenName:r,nodeName:n,parseMarkdown:i,renderMarkdown:a,isIndenting:s?.indentsContent??!1,htmlReopen:s?.htmlReopen,tokenizer:o};if(r&&i){let e=this.registry.get(r)||[];e.push(c),this.registry.set(r,e)}if(a){let e=this.nodeTypeRegistry.get(n)||[];e.push(c),this.nodeTypeRegistry.set(n,e)}o&&this.hasMarked()&&this.registerTokenizer(o)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>e.blockTokens(t)}}tokenizeInline(e){return(this.activeParseLexer??this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;let{name:t,start:n,level:r=`inline`,tokenize:i}=e,a=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this),s;s=n?typeof n==`function`?n:e=>e.indexOf(n):e=>{let t=i(e,[],this.createTokenizerHelpers(this.createLexer()));return t&&t.raw?e.indexOf(t.raw):-1};let c={name:t,level:r,start:s,tokenizer(e,n){let r=this.lexer?a(this.lexer):a(o()),s=i(e,n,r);if(s&&s.type)return{...s,type:s.type||t,raw:s.raw||``,tokens:s.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[c]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){let t=this.getHandlersForToken(e);if(t.length>0)return t[0];let n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return``;let t=this.renderNodes(e,e);return this.isEmptyOutput(t)?``:t}isEmptyOutput(e){return!e||e.trim()===``||e.replace(/&nbsp;/g,``).replace(/\u00A0/g,``).trim()===``}parse(e){if(!this.hasMarked())throw Error(`No marked instance available for parsing`);let t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{let t=n.lex(e);return{type:`doc`,content:this.parseTokens(t,!0)}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){let n=t?uk(e):e,r=n.reduce((e,t,n)=>(t.type!==`space`&&e.push(n),e),[]),i=-1,a=0;return n.flatMap((e,n)=>{for(;a<r.length&&r[a]<n;)i=r[a],a+=1;if(t&&e.type===`space`){let t=r[a]??-1;return this.createImplicitEmptyParagraphsFromSpace(e,i,t)}let o=this.parseToken(e,t);return o===null?[]:Array.isArray(o)?o:[o]})}createImplicitEmptyParagraphsFromSpace(e,t,n){let r=this.countParagraphSeparators(e.raw||``);if(r===0)return[];let i=Math.max(r-(t===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:`paragraph`,content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,`
225
+ `).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type===`list`)return this.parseListToken(e);let n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(t=>{if(!t.parseMarkdown)return!1;let n=t.parseMarkdown(e,r),i=this.normalizeParseResult(n);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);let t=e.items.some(e=>_k(e).isTask),n=e.items.some(e=>!_k(e).isTask);if(!t||!n||this.getHandlersForToken(`taskList`).length===0)return this.parseTokenWithHandlers(e);let r=[],i=[],a=null;for(let t=0;t<e.items.length;t+=1){let n=e.items[t],{isTask:o,checked:s,indentLevel:c}=_k(n),l=n;if(o){let e=(n.raw||n.text||``).split(`
226
+ `),t=e[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),r=t?t[2]:``,i=[];if(e.length>1&&e.slice(1).join(`
227
+ `).trim()){let t=e.slice(1),n=t.filter(e=>e.trim());if(n.length>0){let e=Math.min(...n.map(e=>e.length-e.trimStart().length)),r=t.map(t=>t.trim()?t.slice(e):``).join(`
228
+ `).trim();r&&(i=this.markedInstance.lexer(`${r}
229
+ `))}}l={type:`taskItem`,raw:``,mainContent:r,indentLevel:c,checked:s??!1,text:r,tokens:this.tokenizeInline(r),nestedTokens:i}}let u=o?`taskList`:`list`;a===u?i.push(l):(i.length>0&&r.push({type:a,items:i}),i=[l],a=u)}i.length>0&&r.push({type:a,items:i});let o=[];for(let t=0;t<r.length;t+=1){let n=r[t],i={...e,type:n.type,items:n.items},a=this.parseToken(i);a&&(Array.isArray(a)?o.push(...a):o.push(a))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;let t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(t=>{if(!t.parseMarkdown)return!1;let r=t.parseMarkdown(e,n),i=this.normalizeParseResult(r);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:`text`,text:e,marks:t||void 0}),createNode:(e,t,n)=>{let r={type:e,attrs:t||void 0,content:n||void 0};return(!t||Object.keys(t).length===0)&&delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}parseInlineTokens(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type===`text`)t.push({type:`text`,text:dw(r.text||``)});else if(r.type===`escape`)t.push({type:`text`,text:r.text||``});else if(r.type===`html`){let i=(r.raw??r.text??``).toString(),a=/^<\/[\s]*[\w-]+/i.test(i),o=i.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!a&&o&&!/\/>$/.test(i)){let r=o[1],a=this.escapeRegex(r),s=RegExp(`^<\\/\\s*${a}\\b`,`i`),c=-1,l=[i];for(let t=n+1;t<e.length;t+=1){let n=e[t],r=(n.raw??n.text??``).toString();if(l.push(r),n.type===`html`&&s.test(r)){c=t;break}}if(c!==-1){let e=l.join(``),r={type:`html`,raw:e,text:e,block:!1},i=this.parseHTMLToken(r);if(i){let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}n=c;continue}}let s=this.parseHTMLToken(r);if(s){let e=this.normalizeParseResult(s);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else if(r.type){let e=this.getHandlerForToken(r.type);if(e&&e.parseMarkdown){let n=this.createParseHelpers(),i=e.parseMarkdown(r,n);if(this.isMarkResult(i)){let e=this.applyMarkToContent(i.mark,i.content,i.attrs);t.push(...e)}else{let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else r.tokens&&t.push(...this.parseInlineTokens(r.tokens))}}for(let e=t.length-1;e>0;--e){let n=t[e],r=t[e-1];n.type===`text`&&r.type===`text`&&Ew(n.marks||[],r.marks||[])&&(r.text=(r.text||``)+(n.text||``),t.splice(e,1))}return t}applyMarkToContent(e,t,n){return t.map(t=>{if(t.type===`text`){let r=t.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...t,marks:[...r,i]}}return{...t,content:t.content?this.applyMarkToContent(e,t.content,n):void 0}})}isMarkResult(e){return e&&typeof e==`object`&&`mark`in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case`paragraph`:return{type:`paragraph`,content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`heading`:return{type:`heading`,attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`text`:return{type:`text`,text:dw(e.text||``)};case`html`:return this.parseHTMLToken(e);case`escape`:return{type:`text`,text:e.text||``};case`space`:return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){let t=e.text||e.raw||``;if(!t.trim())return null;if(this.isUnrecognizedHtml(t)||typeof window>`u`||window.DOMParser===void 0)return this.htmlAsLiteralText(t,!!e.block);try{let n=LS(t,this.baseExtensions);if(n.type===`doc`&&n.content){if(e.block)return n.content;let t=this.toInlineContent(n.content);return t.length>0?t:null}return n}catch(e){throw Error(`Failed to parse HTML in markdown: ${e}`)}}toInlineContent(e){let t=this.getInlineNodeTypes();return e.flatMap(e=>e.type&&t.has(e.type)?[e]:e.content?this.toInlineContent(e.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;let e=new Set([`text`]);try{let t=IS(this.baseExtensions);Object.values(t.nodes).forEach(t=>{t.isInline&&e.add(t.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Ck(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;let e=new Set;try{let t=IS(this.baseExtensions),n=t=>{let n=t?.parseDOM;Array.isArray(n)&&n.forEach(t=>{if(typeof t?.tag==`string`){let n=t.tag.match(/^[a-zA-Z][\w-]*/);n&&e.add(n[0].toLowerCase())}})};Object.values(t.nodes).forEach(e=>n(e.spec)),Object.values(t.marks).forEach(e=>n(e.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){let n=e.replace(/\s+$/,``);return n?t?{type:`paragraph`,content:[{type:`text`,text:n}]}:{type:`text`,text:n}:null}encodeTextForMarkdown(e,t,n){return n?.type!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(e=>this.codeTypes.has(typeof e==`string`?e:e.type))?e:this.escapeMarkdownSyntax(fw(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,`\\$1`)}renderNodeToMarkdown(e,t,n=0,r=0,i={}){if(e.type===`text`)return this.encodeTextForMarkdown(e.text||``,e,t);if(!e.type)return``;let a=this.getHandlerForToken(e.type);if(!a)return``;let o=Array.isArray(t?.content)&&n>0?t.content[n-1]:void 0,s={renderChildren:(t,i)=>{let o=a.isIndenting?r+1:r;return!Array.isArray(t)&&t.content?this.renderNodes(t.content,e,i||``,n,o):this.renderNodes(t,e,i||``,n,o)},renderChild:(t,n)=>{let i=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(t,e,n,i)},indent:e=>this.indentString+e,wrapInBlock:dk},c={index:n,level:r,parentType:t?.type,previousNode:o,meta:{parentAttrs:t?.attrs,...i}};return a.renderMarkdown?.call(a,e,s,c)||``}renderNodes(e,t,n=``,r=0,i=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,i):e.type?this.renderNodeToMarkdown(e,t,r,i):``}renderNodesWithMarkBoundaries(e,t,n=``,r=0){let i=[],a=new Map,o=new Set,s=new Map;return e.forEach((n,c)=>{let l=c<e.length-1?e[c+1]:null;if(n.type){if(n.type===`text`){let e=this.encodeTextForMarkdown(n.text||``,n,t),r=new Map((n.marks||[]).map(e=>[e.type,e])),c=this.getMarksToOpenForSerialization(a,r,l),u=fk(r,l),d=u.filter(e=>a.has(e)),f=d.length>0&&c.length>0,p=``;if(u.length>0&&!f){let t=e.match(/(\s+)$/);t&&(p=t[1],e=e.slice(0,-p.length))}f||u.slice().reverse().forEach(t=>{if(!a.has(t))return;let n=r.get(t),i=this.getMarkClosing(t,n,s.get(t));i&&(e+=i),a.has(t)&&(a.delete(t),s.delete(t))});let m=``;if(c.length>0){let t=e.match(/^(\s+)/);t&&(m=t[1],e=e.slice(m.length))}c.forEach(({type:t,mark:n})=>{let r=o.has(t)?`html`:`markdown`,i=this.getMarkOpening(t,n,r);i&&(e=i+e),s.set(t,r),o.delete(t)}),f||c.slice().reverse().forEach(({type:e,mark:t})=>{a.set(e,t)}),e=m+e;let h;if(f){let e=new Set((l?.marks||[]).map(e=>e.type));c.forEach(({type:t})=>{e.has(t)&&this.getHtmlReopenTags(t)&&o.add(t)});let t=Array.from(a.keys()),n=d.slice().sort((e,n)=>t.indexOf(n)-t.indexOf(e));h=[...c.map(e=>e.type),...n]}else h=mk(a,r,l,this.markSetsEqual.bind(this));let g=``;if(h.length>0){let t=e.match(/(\s+)$/);t&&(g=t[1],e=e.slice(0,-g.length))}h.forEach(t=>{let n=a.get(t)??r.get(t),i=this.getMarkClosing(t,n,s.get(t));i&&(e+=i),a.delete(t),s.delete(t)}),e+=g,e+=p,i.push(e)}else{let e=new Set((n.marks||[]).map(e=>e.type)),o=new Map,l=new Map;a.forEach((t,n)=>{e.has(n)&&(o.set(n,t),l.set(n,s.get(n)??`markdown`))});let u=hk(a,(e,t)=>this.getMarkClosing(e,t,s.get(e)));s.clear();let d=this.renderNodeToMarkdown(n,t,c,r),f=n.type===`hardBreak`?``:gk(o,a,(e,t)=>{let n=l.get(e)??`markdown`;return s.set(e,n),this.getMarkOpening(e,t,n)});i.push(u+d+f)}}}),i.join(n)}getMarkOpening(e,t,n=`markdown`){if(n===`html`)return this.getHtmlReopenTags(e)?.open||``;let r=this.getHandlersForNodeType(e),i=r.length>0?r[0]:void 0;if(!i||!i.renderMarkdown)return``;let a=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,o={type:e,attrs:t.attrs||{},content:[{type:`text`,text:a}]};try{let e=i.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{}}),t=e.indexOf(a);return t>=0?e.substring(0,t):``}catch(t){throw Error(`Failed to get mark opening for ${e}: ${t}`)}}getMarkClosing(e,t,n=`markdown`){if(n===`html`)return this.getHtmlReopenTags(e)?.close||``;let r=this.getHandlersForNodeType(e),i=r.length>0?r[0]:void 0;if(!i||!i.renderMarkdown)return``;let a=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,o={type:e,attrs:t.attrs||{},content:[{type:`text`,text:a}]};try{let e=i.renderMarkdown(o,{renderChildren:()=>a,renderChild:()=>a,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{}}),t=e.indexOf(a),n=t+33;return t>=0?e.substring(n):``}catch(t){throw Error(`Failed to get mark closing for ${e}: ${t}`)}}getHtmlReopenTags(e){let t=this.getHandlersForNodeType(e);return(t.length>0?t[0]:void 0)?.htmlReopen}markSetsEqual(e,t){return e.size===t.size&&Array.from(e.entries()).every(([e,n])=>{let r=t.get(e);return r&&cw(n.attrs,r.attrs)})}getMarksToOpenForSerialization(e,t,n){let r=pk(e,t);if(r.length<=1)return r;let i=n?.marks||[],a=(e,t)=>i.some(n=>n.type===e&&cw(n.attrs,t)),o=(e,t)=>{let n=this.extensionRanks.get(e.type)??2**53-1,r=this.extensionRanks.get(t.type)??2**53-1;return n===r?e.type.localeCompare(t.type):r-n},s=r.filter(e=>!a(e.type,e.mark.attrs)).sort(o),c=r.filter(e=>a(e.type,e.mark.attrs)).sort(o);return[...s,...c]}},Tk=wk,Ek=Hw.create({name:`markdown`,addOptions(){return{indentation:{style:`space`,size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!t?.contentType||vk(e,t?.contentType)!==`markdown`||!this.editor.markdown)return Yb.setContent(e,t);let n=this.editor.markdown.parse(e);return Yb.setContent(n,t)},insertContent:(e,t)=>{if(!t?.contentType||vk(e,t?.contentType)!==`markdown`||!this.editor.markdown)return Yb.insertContent(e,t);let n=this.editor.markdown.parse(e);return Yb.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!n?.contentType||vk(t,n?.contentType)!==`markdown`||!this.editor.markdown)return Yb.insertContentAt(e,t,n);let r=this.editor.markdown.parse(t);return Yb.insertContentAt(e,r,n)}}},addStorage(){return{manager:new Tk({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new Tk({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||vk(this.editor.options.content,this.editor.options.contentType)!==`markdown`)return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!=`string`)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let e=this.editor.markdown.parse(this.editor.options.content);e.content?.length&&(this.editor.options.content=e)}}),Dk=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ok=o(((e,t)=>{t.exports=Dk()})),kk=Ok(),{getOwnPropertyNames:Ak,getOwnPropertySymbols:jk}=Object,{hasOwnProperty:Mk}=Object.prototype;function Nk(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Pk(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Fk(e){return e?.[Symbol.toStringTag]}function Ik(e){return Ak(e).concat(jk(e))}var Lk=Object.hasOwn||((e,t)=>Mk.call(e,t));function Rk(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var zk=`__v`,Bk=`__o`,Vk=`_owner`,{getOwnPropertyDescriptor:Hk,keys:Uk}=Object;function Wk(e,t){return e.byteLength===t.byteLength&&rA(new Uint8Array(e),new Uint8Array(t))}function Gk(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Kk(e,t){return e.byteLength===t.byteLength&&rA(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function qk(e,t){return Rk(e.getTime(),t.getTime())}function Jk(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Yk(e,t){return e===t}function Xk(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Zk=Rk;function Qk(e,t,n){let r=Uk(e),i=r.length;if(Uk(t).length!==i)return!1;for(;i-->0;)if(!aA(e,t,n,r[i]))return!1;return!0}function $k(e,t,n){let r=Ik(e),i=r.length;if(Ik(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!aA(e,t,n,a)||(o=Hk(e,a),s=Hk(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function eA(e,t){return Rk(e.valueOf(),t.valueOf())}function tA(e,t){return e.source===t.source&&e.flags===t.flags}function nA(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function rA(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function iA(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function aA(e,t,n,r){return(r===Vk||r===Bk||r===zk)&&(e.$$typeof||t.$$typeof)?!0:Lk(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var oA=`[object ArrayBuffer]`,sA=`[object Arguments]`,cA=`[object Boolean]`,lA=`[object DataView]`,uA=`[object Date]`,dA=`[object Error]`,fA=`[object Map]`,pA=`[object Number]`,mA=`[object Object]`,hA=`[object RegExp]`,gA=`[object Set]`,_A=`[object String]`,vA={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},yA=`[object URL]`,bA=Object.prototype.toString;function xA({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=bA.call(h);if(b===uA)return r(h,g,_);if(b===hA)return u(h,g,_);if(b===fA)return o(h,g,_);if(b===gA)return d(h,g,_);if(b===mA)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===yA)return p(h,g,_);if(b===dA)return i(h,g,_);if(b===sA)return c(h,g,_);if(vA[b])return f(h,g,_);if(b===oA)return e(h,g,_);if(b===lA)return n(h,g,_);if(b===cA||b===pA||b===_A)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Fk(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function SA({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Wk,areArraysEqual:n?$k:Gk,areDataViewsEqual:Kk,areDatesEqual:qk,areErrorsEqual:Jk,areFunctionsEqual:Yk,areMapsEqual:n?Nk(Xk,$k):Xk,areNumbersEqual:Zk,areObjectsEqual:n?$k:Qk,arePrimitiveWrappersEqual:eA,areRegExpsEqual:tA,areSetsEqual:n?Nk(nA,$k):nA,areTypedArraysEqual:n?Nk(rA,$k):rA,areUrlsEqual:iA,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Pk(r.areArraysEqual),t=Pk(r.areMapsEqual),n=Pk(r.areObjectsEqual),i=Pk(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function CA(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function wA({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var TA=EA();EA({strict:!0}),EA({circular:!0}),EA({circular:!0,strict:!0}),EA({createInternalComparator:()=>Rk}),EA({strict:!0,createInternalComparator:()=>Rk}),EA({circular:!0,createInternalComparator:()=>Rk}),EA({circular:!0,createInternalComparator:()=>Rk,strict:!0});function EA(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=xA(SA(e));return wA({circular:t,comparator:a,createState:r,equals:n?n(a):CA(a),strict:i})}var DA=o((e=>{var t=d(),n=Ok();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),OA=o(((e,t)=>{t.exports=DA()}))(),kA=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},AA=({contentComponent:e})=>{let t=(0,kk.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,j.jsx)(j.Fragment,{children:Object.values(t)})};function jA(){let e=new Set,t={},n=!1,r=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:Er.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var MA=class extends E.Component{constructor(e){super(e),this.editorContentRef=E.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=jA(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{ref:kA(t,this.editorContentRef),...n}),e?.contentComponent&&(0,j.jsx)(AA,{contentComponent:e.contentComponent})]})}},NA=(0,E.forwardRef)((e,t)=>{let n=E.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return E.createElement(MA,{key:n,innerRef:t,...e})}),PA=E.memo(NA),FA=typeof window<`u`?E.useLayoutEffect:E.useEffect,IA=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{(t?.transaction===void 0||t.transaction!==e)&&(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function LA(e){let[t]=(0,E.useState)(()=>new IA(e.editor)),n=(0,OA.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??TA);return FA(()=>t.watch(e.editor),[e.editor,t]),(0,E.useDebugValue)(n),n}var RA=typeof window>`u`,zA=RA||!!(typeof window<`u`&&window.next),BA=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(RA||zA&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new iT({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function VA(e={},t=[]){let n=(0,E.useRef)(e);n.current=e;let[r]=(0,E.useState)(()=>new BA(n)),i=(0,kk.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,E.useDebugValue)(i),(0,E.useEffect)(r.onRender(t)),LA({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var HA=(0,E.createContext)({editor:null});HA.Consumer;var UA=(0,E.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),WA=()=>(0,E.useContext)(UA);E.forwardRef((e,t)=>{let{onDragStart:n}=WA(),r=e.as||`div`;return(0,j.jsx)(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),E.createContext({markViewContentRef:()=>{}});var GA=(0,E.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});GA.displayName=`TiptapContext`;var KA=()=>(0,E.useContext)(GA);function qA({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,E.useMemo)(()=>({editor:n}),[n]),i=(0,E.useMemo)(()=>({editor:n}),[n]);return(0,j.jsx)(HA.Provider,{value:i,children:(0,j.jsx)(GA.Provider,{value:r,children:e})})}qA.displayName=`Tiptap`;function JA({...e}){let{editor:t}=KA();return(0,j.jsx)(PA,{editor:t,...e})}JA.displayName=`Tiptap.Content`,Object.assign(qA,{Content:JA});var YA=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},XA=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new I(n,0,0);return e.replace(l,i.after(),r),e.setSelection(Xm.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},ZA=/^\s*>\s$/,QA=lT.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return YA(`blockquote`,{...ES(this.options.HTMLAttributes,e),children:YA(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
230
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
231
+ `))}),n.join(`
232
+ >
233
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>XA(this.editor,this.type)}},addInputRules(){return[cT({find:ZA,type:this.type})]}}),$A=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ej=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,tj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,nj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,rj=Pw.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return YA(`strong`,{...ES(this.options.HTMLAttributes,e),children:YA(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[aT({find:$A,type:this.type}),aT({find:tj,type:this.type})]},addPasteRules(){return[uT({find:ej,type:this.type}),uT({find:nj,type:this.type})]}}),ij=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},aj=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},oj=Pw.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,ES(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[aT({find:ij,type:this.type})]},addPasteRules(){return[uT({find:aj,type:this.type})]}}),sj=4,cj=/^```([a-z]+)?[\s\n]$/,lj=/^~~~([a-z]+)?[\s\n]$/,uj=lT.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:sj,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,ES(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
234
+ `):`\`\`\`${r}
235
+
236
+ \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??sj,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
237
+ `,`
238
+ `).split(`
239
+ `).map(e=>o+e).join(`
240
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??sj,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
241
+ `,`
242
+ `).split(`
243
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(Xm.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
244
+ `,`
245
+ `).split(`
246
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
247
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
248
+
249
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(Km.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[sT({find:cj,type:this.type,getAttributes:e=>({language:e[1]})}),sT({find:lj,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new mh({key:new _h(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
250
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(Xm.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),dj=lT.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
251
+
252
+ `):``}),fj=lT.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,ES(this.options.HTMLAttributes,e)]},renderText(){return`
253
+ `},renderMarkdown:()=>`
254
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),pj=lT.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,ES(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>sT({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),mj=lT.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,ES(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!lw(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return aC(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Xm.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Qm.create(t.doc,n.pos)):t.setSelection(Xm.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(Xm.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[oT({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),hj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,gj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_j=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,vj=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,yj=Pw.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,ES(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[aT({find:hj,type:this.type}),aT({find:_j,type:this.type})]},addPasteRules(){return[uT({find:gj,type:this.type}),uT({find:vj,type:this.type})]}}),bj=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,xj=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,Sj=`numeric`,Cj=`ascii`,wj=`alpha`,Tj=`asciinumeric`,Ej=`alphanumeric`,Dj=`domain`,Oj=`emoji`,kj=`scheme`,Aj=`slashscheme`,jj=`whitespace`;function Mj(e,t){return e in t||(t[e]=[]),t[e]}function Nj(e,t,n){t[Sj]&&(t[Tj]=!0,t[Ej]=!0),t[Cj]&&(t[Tj]=!0,t[wj]=!0),t[Tj]&&(t[Ej]=!0),t[wj]&&(t[Ej]=!0),t[Ej]&&(t[Dj]=!0),t[Oj]&&(t[Dj]=!0);for(let r in t){let t=Mj(r,n);t.indexOf(e)<0&&t.push(e)}}function Pj(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Fj(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Fj.groups={},Fj.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=Fj.groups;let i;return t&&t.j?i=t:(i=new Fj(t),n&&r&&Nj(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=Fj.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new Fj,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Fj,a&&(r&&(o.t&&typeof o.t==`string`?Nj(a,Object.assign(Pj(o.t,r),n),r):n&&Nj(a,n,r)),o.t=a),i.j[e]=o,o}};var Ij=(e,t,n,r,i)=>e.ta(t,n,r,i),Lj=(e,t,n,r,i)=>e.tr(t,n,r,i),Rj=(e,t,n,r,i)=>e.ts(t,n,r,i),R=(e,t,n,r,i)=>e.tt(t,n,r,i),zj=`WORD`,Bj=`UWORD`,Vj=`ASCIINUMERICAL`,Hj=`ALPHANUMERICAL`,Uj=`LOCALHOST`,Wj=`TLD`,Gj=`UTLD`,Kj=`SCHEME`,qj=`SLASH_SCHEME`,Jj=`NUM`,Yj=`WS`,Xj=`NL`,Zj=`OPENBRACE`,Qj=`CLOSEBRACE`,$j=`OPENBRACKET`,eM=`CLOSEBRACKET`,tM=`OPENPAREN`,nM=`CLOSEPAREN`,rM=`OPENANGLEBRACKET`,iM=`CLOSEANGLEBRACKET`,aM=`FULLWIDTHLEFTPAREN`,oM=`FULLWIDTHRIGHTPAREN`,sM=`LEFTCORNERBRACKET`,cM=`RIGHTCORNERBRACKET`,lM=`LEFTWHITECORNERBRACKET`,uM=`RIGHTWHITECORNERBRACKET`,dM=`FULLWIDTHLESSTHAN`,fM=`FULLWIDTHGREATERTHAN`,pM=`AMPERSAND`,mM=`APOSTROPHE`,hM=`ASTERISK`,gM=`AT`,_M=`BACKSLASH`,vM=`BACKTICK`,yM=`CARET`,bM=`COLON`,xM=`COMMA`,SM=`DOLLAR`,CM=`DOT`,wM=`EQUALS`,TM=`EXCLAMATION`,EM=`HYPHEN`,DM=`PERCENT`,OM=`PIPE`,kM=`PLUS`,AM=`POUND`,jM=`QUERY`,MM=`QUOTE`,NM=`FULLWIDTHMIDDLEDOT`,PM=`SEMI`,FM=`SLASH`,IM=`TILDE`,LM=`UNDERSCORE`,RM=`EMOJI`,zM=`SYM`,BM=Object.freeze({__proto__:null,ALPHANUMERICAL:Hj,AMPERSAND:pM,APOSTROPHE:mM,ASCIINUMERICAL:Vj,ASTERISK:hM,AT:gM,BACKSLASH:_M,BACKTICK:vM,CARET:yM,CLOSEANGLEBRACKET:iM,CLOSEBRACE:Qj,CLOSEBRACKET:eM,CLOSEPAREN:nM,COLON:bM,COMMA:xM,DOLLAR:SM,DOT:CM,EMOJI:RM,EQUALS:wM,EXCLAMATION:TM,FULLWIDTHGREATERTHAN:fM,FULLWIDTHLEFTPAREN:aM,FULLWIDTHLESSTHAN:dM,FULLWIDTHMIDDLEDOT:NM,FULLWIDTHRIGHTPAREN:oM,HYPHEN:EM,LEFTCORNERBRACKET:sM,LEFTWHITECORNERBRACKET:lM,LOCALHOST:Uj,NL:Xj,NUM:Jj,OPENANGLEBRACKET:rM,OPENBRACE:Zj,OPENBRACKET:$j,OPENPAREN:tM,PERCENT:DM,PIPE:OM,PLUS:kM,POUND:AM,QUERY:jM,QUOTE:MM,RIGHTCORNERBRACKET:cM,RIGHTWHITECORNERBRACKET:uM,SCHEME:Kj,SEMI:PM,SLASH:FM,SLASH_SCHEME:qj,SYM:zM,TILDE:IM,TLD:Wj,UNDERSCORE:LM,UTLD:Gj,UWORD:Bj,WORD:zj,WS:Yj}),VM=/[a-z]/,HM=/\p{L}/u,UM=/\p{Emoji}/u,WM=/\d/,GM=/\s/,KM=`\r`,qM=`
255
+ `,JM=`️`,YM=`‍`,XM=``,ZM=null,QM=null;function $M(e=[]){let t={};Fj.groups=t;let n=new Fj;ZM??=rN(bj),QM??=rN(xj),R(n,`'`,mM),R(n,`{`,Zj),R(n,`}`,Qj),R(n,`[`,$j),R(n,`]`,eM),R(n,`(`,tM),R(n,`)`,nM),R(n,`<`,rM),R(n,`>`,iM),R(n,`(`,aM),R(n,`)`,oM),R(n,`「`,sM),R(n,`」`,cM),R(n,`『`,lM),R(n,`』`,uM),R(n,`<`,dM),R(n,`>`,fM),R(n,`&`,pM),R(n,`*`,hM),R(n,`@`,gM),R(n,"`",vM),R(n,`^`,yM),R(n,`:`,bM),R(n,`,`,xM),R(n,`$`,SM),R(n,`.`,CM),R(n,`=`,wM),R(n,`!`,TM),R(n,`-`,EM),R(n,`%`,DM),R(n,`|`,OM),R(n,`+`,kM),R(n,`#`,AM),R(n,`?`,jM),R(n,`"`,MM),R(n,`/`,FM),R(n,`;`,PM),R(n,`~`,IM),R(n,`_`,LM),R(n,`\\`,_M),R(n,`・`,NM);let r=Lj(n,WM,Jj,{[Sj]:!0});Lj(r,WM,r);let i=Lj(r,VM,Vj,{[Tj]:!0}),a=Lj(r,HM,Hj,{[Ej]:!0}),o=Lj(n,VM,zj,{[Cj]:!0});Lj(o,WM,i),Lj(o,VM,o),Lj(i,WM,i),Lj(i,VM,i);let s=Lj(n,HM,Bj,{[wj]:!0});Lj(s,VM),Lj(s,WM,a),Lj(s,HM,s),Lj(a,WM,a),Lj(a,VM),Lj(a,HM,a);let c=R(n,qM,Xj,{[jj]:!0}),l=R(n,KM,Yj,{[jj]:!0}),u=Lj(n,GM,Yj,{[jj]:!0});R(n,XM,u),R(l,qM,c),R(l,XM,u),Lj(l,GM,u),R(u,KM),R(u,qM),Lj(u,GM,u),R(u,XM,u);let d=Lj(n,UM,RM,{[Oj]:!0});R(d,`#`),Lj(d,UM,d),R(d,JM,d);let f=R(d,YM);R(f,`#`),Lj(f,UM,d);let p=[[VM,o],[WM,i]],m=[[VM,null],[HM,s],[WM,a]];for(let e=0;e<ZM.length;e++)nN(n,ZM[e],Wj,zj,p);for(let e=0;e<QM.length;e++)nN(n,QM[e],Gj,Bj,m);Nj(Wj,{tld:!0,ascii:!0},t),Nj(Gj,{utld:!0,alpha:!0},t),nN(n,`file`,Kj,zj,p),nN(n,`mailto`,Kj,zj,p),nN(n,`http`,qj,zj,p),nN(n,`https`,qj,zj,p),nN(n,`ftp`,qj,zj,p),nN(n,`ftps`,qj,zj,p),Nj(Kj,{scheme:!0,ascii:!0},t),Nj(qj,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[kj]:!0}:{[Aj]:!0};r.indexOf(`-`)>=0?i[Dj]=!0:VM.test(r)?WM.test(r)?i[Tj]=!0:i[Cj]=!0:i[Sj]=!0,Rj(n,r,r,i)}return Rj(n,`localhost`,Uj,{ascii:!0}),n.jd=new Fj(zM),{start:n,tokens:Object.assign({groups:t},BM)}}function eN(e,t){let n=tN(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function tN(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function nN(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new Fj(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Fj(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function rN(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var iN={defaultProtocol:`http`,events:null,format:oN,formatHref:oN,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function aN(e,t=null){let n=Object.assign({},iN);e&&(n=Object.assign(n,e instanceof aN?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}aN.prototype={o:iN,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:iN[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function oN(e){return e}function sN(e,t){this.t=`token`,this.v=e,this.tk=t}sN.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=iN.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function cN(e,t){class n extends sN{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var lN=cN(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),uN=cN(`text`),dN=cN(`nl`),fN=cN(`url`,{isLink:!0,toHref(e=iN.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Uj&&e[1].t===bM}}),pN=e=>new Fj(e);function mN({groups:e}){let t=e.domain.concat([pM,hM,gM,_M,vM,yM,SM,wM,EM,Jj,DM,OM,kM,AM,FM,zM,IM,LM]),n=[mM,bM,xM,CM,TM,DM,jM,MM,PM,rM,iM,Zj,Qj,eM,$j,tM,nM,aM,oM,sM,cM,lM,uM,dM,fM],r=[pM,mM,hM,_M,vM,yM,SM,wM,EM,Zj,Qj,DM,OM,kM,AM,jM,FM,zM,IM,LM],i=pN(),a=R(i,IM);Ij(a,r,a),Ij(a,e.domain,a);let o=pN(),s=pN(),c=pN();Ij(i,e.domain,o),Ij(i,e.scheme,s),Ij(i,e.slashscheme,c),Ij(o,r,a),Ij(o,e.domain,o);let l=R(o,gM);R(a,gM,l),R(s,gM,l),R(c,gM,l);let u=R(a,CM);Ij(u,r,a),Ij(u,e.domain,a);let d=pN();Ij(l,e.domain,d),Ij(d,e.domain,d);let f=R(d,CM);Ij(f,e.domain,d);let p=pN(lN);Ij(f,e.tld,p),Ij(f,e.utld,p),R(l,Uj,p);let m=R(d,EM);R(m,EM,m),Ij(m,e.domain,d),Ij(p,e.domain,d),R(p,CM,f),R(p,EM,m);let h=R(o,EM),g=R(o,CM);R(h,EM,h),Ij(h,e.domain,o),Ij(g,r,a),Ij(g,e.domain,o);let _=pN(fN);Ij(g,e.tld,_),Ij(g,e.utld,_),Ij(_,e.domain,o),Ij(_,r,a),R(_,CM,g),R(_,EM,h),R(_,gM,l);let v=R(_,bM),y=pN(fN);Ij(v,e.numeric,y);let b=pN(fN),x=pN();Ij(b,t,b),Ij(b,n,x),Ij(x,t,b),Ij(x,n,x),R(_,FM,b),R(y,FM,b);let S=R(s,bM),C=R(R(R(c,bM),FM),FM);Ij(s,e.domain,o),R(s,CM,g),R(s,EM,h),Ij(c,e.domain,o),R(c,CM,g),R(c,EM,h),Ij(S,e.domain,b),R(S,FM,b),R(S,jM,b),Ij(C,e.domain,b),Ij(C,t,b),R(C,FM,b);let w=[[Zj,Qj],[$j,eM],[tM,nM],[rM,iM],[aM,oM],[sM,cM],[lM,uM],[dM,fM]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=R(b,r);R(x,r,a);let o=pN(fN);Ij(a,t,o);let s=pN();Ij(a,n,s),R(a,i,b),Ij(o,t,o),Ij(o,n,s),Ij(s,t,o),Ij(s,n,s),R(o,i,b),R(s,i,b)}return R(i,Uj,_),R(i,Xj,dN),{start:i,tokens:BM}}function hN(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(gN(uN,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(gN(e,t,r))}}return o.length>0&&a.push(gN(uN,t,o)),a}function gN(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var _N=typeof console<`u`&&console&&console.warn||(()=>{}),vN=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,yN={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function bN(){return Fj.groups={},yN.scanner=null,yN.parser=null,yN.tokenQueue=[],yN.pluginQueue=[],yN.customSchemes=[],yN.initialized=!1,yN}function xN(e,t=!1){if(yN.initialized&&_N(`linkifyjs: already initialized - will not register custom scheme "${e}" ${vN}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
256
+ 1. Must only contain digits, lowercase ASCII letters or "-"
257
+ 2. Cannot start or end with "-"
258
+ 3. "-" cannot repeat`);yN.customSchemes.push([e,t])}function SN(){yN.scanner=$M(yN.customSchemes);for(let e=0;e<yN.tokenQueue.length;e++)yN.tokenQueue[e][1]({scanner:yN.scanner});yN.parser=mN(yN.scanner.tokens);for(let e=0;e<yN.pluginQueue.length;e++)yN.pluginQueue[e][1]({scanner:yN.scanner,parser:yN.parser});return yN.initialized=!0,yN}function CN(e){return yN.initialized||SN(),hN(yN.parser.start,e,eN(yN.scanner.start,e))}CN.scan=eN;function wN(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new aN(n),i=CN(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var TN=`[\0- \xA0 ᠎ -\u2029  ]`,EN=new RegExp(TN),DN=RegExp(`${TN}$`),ON=new RegExp(TN,`g`);function kN(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function AN(e){return new mh({key:new _h(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(GS(pS(n.doc,[...t])).forEach(({newRange:t})=>{let n=mS(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!DN.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(EN).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=CN(n).map(t=>t.toObject(e.defaultProtocol));if(!kN(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{KS(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function jN(e){return new mh({key:new _h(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=HS(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var MN=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,NN=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function PN(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function FN(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&PN(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function IN(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||PN(e,t.index??0)||FN(e,t.index??0)?!1:!!r.trim()&&n(i)}function LN(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function RN(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function zN(e){return{href:e.data?.href,title:e.data?.title??null}}function BN(e){let t=aT({find:t=>{let n=MN.exec(t);return!n||!IN(t,n,e.isAllowedHref)?null:LN(n)},type:e.type,getAttributes:zN});return new kw({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function VN(e){let t=uT({find:t=>{let n=[];for(let r of t.matchAll(NN))IN(t,r,e.isAllowedHref)&&n.push(LN(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>RN(t,e)));return[...n,...r]},type:e.type,getAttributes:zN});return new Fw({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function HN(e){return new mh({key:new _h(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=wN(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function UN(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(ON,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var WN=Pw.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){xN(e);return}xN(e.scheme,e.optionalSlashes)})},onDestroy(){bN()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!UN(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,ES(this.options.HTMLAttributes,e),0]:[`a`,ES(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[BN({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;wN(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!UN(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[VN({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!UN(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[uT({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(AN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!UN(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(jN({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(HN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),GN=`&nbsp;`,KN=`\xA0`,qN=lT.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,ES(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===GN||n[0].text===GN||n[0].raw===KN||n[0].text===KN)&&r.length===1&&r[0].type===`text`&&(r[0].text===GN||r[0].text===KN)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?GN:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),JN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,YN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,XN=Pw.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,ES(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[aT({find:JN,type:this.type})]},addPasteRules(){return[uT({find:YN,type:this.type})]}}),ZN=lT.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),QN=Pw.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,ES(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),$N=Hw.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(rj.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(QA.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(DE.configure(this.options.bulletList)),this.options.code!==!1&&e.push(oj.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(uj.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(dj.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(JT.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(YT.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(fj.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(pj.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(bE.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(mj.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(yj.configure(this.options.italic)),this.options.listItem!==!1&&e.push(XE.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cD.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(WN.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(TD.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(qN.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(XN.configure(this.options.strike)),this.options.text!==!1&&e.push(ZN.configure(this.options.text)),this.options.underline!==!1&&e.push(QN.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(yE.configure(this.options?.trailingNode)),e}}),eP=lT.create({name:`sourceBlock`,group:`block`,content:`text*`,marks:``,code:!0,defining:!0,addAttributes(){return{kind:{default:`markdown`,parseHTML:e=>e.getAttribute(`data-source-kind`)??`markdown`}}},parseHTML(){return[{tag:`pre[data-markdown-source]`}]},renderHTML({HTMLAttributes:e}){return[`pre`,ES(e,{"data-markdown-source":``,"data-source-kind":e.kind}),[`code`,0]]}}),tP=`codebridge-source`,nP=/```codebridge-source\n([A-Za-z0-9+/=]+)\n```/g;function rP(e,t){let n=new TextEncoder().encode(JSON.stringify({kind:e,source:t})),r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r)}function iP(e){let t=Uint8Array.from(atob(e),e=>e.charCodeAt(0));return JSON.parse(new TextDecoder().decode(t))}function aP(e,t=`markdown`){return{type:`doc`,content:[{type:`sourceBlock`,attrs:{kind:t},content:e?[{type:`text`,text:e}]:[]}]}}function oP(e){return/^```mermaid(?:\s|$)/.test(e)?`mermaid`:`code`}function sP(e){let t=e.split(`
259
+ `),n=[];for(let e=0;e<t.length;){let r=t[e]??``;if(/^```/.test(r)){let i=[r];for(e+=1;e<t.length;){let n=t[e]??``;if(i.push(n),e+=1,/^```/.test(n))break}let a=i.join(`
260
+ `);n.push(cP(oP(a),a));continue}if(r.trim()===`$$`){let i=[r];for(e+=1;e<t.length;){let n=t[e]??``;if(i.push(n),e+=1,n.trim()===`$$`)break}n.push(cP(`math`,i.join(`
261
+ `)));continue}let i=t[e+1]??``;if(r.includes(`|`)&&/^\s*\|?\s*:?-{3,}:?(\s*\|\s*:?-{3,}:?)+\s*\|?\s*$/.test(i)){let a=[r,i];for(e+=2;e<t.length&&(t[e]??``).includes(`|`)&&(t[e]??``).trim();)a.push(t[e]??``),e+=1;n.push(cP(`table`,a.join(`
262
+ `)));continue}n.push(r),e+=1}return n.join(`
263
+ `)}function cP(e,t){return`\`\`\`${tP}\n${rP(e,t)}\n\`\`\``}function lP(e,t){return t({...e,content:e.content?.map(e=>lP(e,t))})}function uP(){let e=new wk({extensions:[$N,MD,jD.configure({nested:!0}),eP]});function t(t){return lP(e.parse(sP(t)),e=>{if(e.type!==`codeBlock`||e.attrs?.language!==tP)return e;let t=iP(e.content?.map(e=>e.text??``).join(``)??``);return{type:`sourceBlock`,attrs:{kind:t.kind},content:t.source?[{type:`text`,text:t.source}]:[]}})}function n(t){let n=lP(t,e=>{if(e.type!==`sourceBlock`)return e;let t=e.content?.map(e=>e.text??``).join(``)??``;return{type:`codeBlock`,attrs:{language:tP},content:[{type:`text`,text:rP(e.attrs?.kind,t)}]}});return e.serialize(n).replace(nP,(e,t)=>iP(t).source).trimEnd()}return{parse:t,parseSafely(e,n=t){try{return{document:n(e),failed:!1}}catch{return{document:aP(e),failed:!0}}},serialize:n}}var dP=Hw.create({name:`composerEvents`,addStorage(){return{blockedMarkdown:null,callbacks:null,codec:null,initialized:!1,lastEmitted:``}},addCommands(){return{syncComposerRuntime:e=>({commands:t})=>{this.storage.callbacks=e.callbacks,this.storage.codec=e.codec;let n=e.codec.serialize(this.editor.getJSON()),r=n.trim()===e.value.trim();if(!this.storage.initialized){if(this.storage.initialized=!0,this.storage.lastEmitted=e.value,r)return!0}else if(e.value===this.storage.lastEmitted&&r)return!0;e.value.trim()?this.storage.blockedMarkdown=null:this.storage.blockedMarkdown=n;let i=e.codec.parseSafely(e.value);return t.setContent(i.document,{emitUpdate:!1}),this.storage.lastEmitted=e.value,e.callbacks.onTrigger(hP(i.document,e.value)),e.callbacks.onSerializationError(null),!0}}},addProseMirrorPlugins(){return[new mh({props:{handleKeyDown:(e,t)=>{let n=this.storage.callbacks;if(!n||t.isComposing||this.editor.view.composing||t.key===`Enter`&&this.editor.state.selection.$from.parent.type.name===`sourceBlock`)return!1;if(t.key===`Enter`&&t.shiftKey)return this.editor.commands.setHardBreak();if(pP(t.key)){if(n.onPickerKey({key:t.key,shiftKey:t.shiftKey}))return!0;if(t.key!==`Enter`)return!1}return t.key===`Enter`&&(n.onSubmit(),!0)},handlePaste:(e,t)=>{let{callbacks:n,codec:r}=this.storage;if(!n||!r)return!1;let i=Array.from(t.clipboardData?.files??[]);i.length&&n.onFiles(i);let a=t.clipboardData?.getData(`text/plain`)??``;if(!a)return i.length>0;let o=r.parseSafely(a);return this.editor.commands.insertContent(o.document.content??[]),!0}}})]}});function fP({disabled:e,value:t,onChange:n,onFiles:r,onPickerKey:i,onSerializationError:a,onSubmit:o,onTrigger:s}){let c=(0,E.useMemo)(()=>uP(),[]),[l]=(0,E.useState)(()=>c.parseSafely(t).document),u=(0,E.useMemo)(()=>[$N,MD,jD.configure({nested:!0}),eP,Ek,xE.configure({placeholder:`输入目标,或继续当前工作…`}),dP],[]),d=VA({content:l,editable:!e,editorProps:{attributes:{"aria-label":`消息`,"aria-multiline":`true`,role:`textbox`}},extensions:u,immediatelyRender:!1,onUpdate:({editor:e})=>{let t=e.storage.composerEvents;if(!(!t.callbacks||!t.codec))try{let n=e.getJSON(),r=t.codec.serialize(n);if(t.blockedMarkdown!==null&&r.trim()===t.blockedMarkdown.trim())return;t.blockedMarkdown=null,t.lastEmitted=r,t.callbacks.onSerializationError(null),t.callbacks.onChange(r),t.callbacks.onTrigger(gP(e,r))}catch(e){t.callbacks.onSerializationError(e instanceof Error?e.message:`Markdown 序列化失败`)}}},[u,l]);return(0,E.useEffect)(()=>{d?.setEditable(!e)},[e,d]),(0,E.useEffect)(()=>{d&&d.commands.syncComposerRuntime({callbacks:{onChange:n,onFiles:r,onPickerKey:i,onSerializationError:a,onSubmit:o,onTrigger:s},codec:c,value:t})},[c,d,n,r,i,a,o,s,t]),(0,j.jsx)(PA,{className:`markdown-composer`,"data-composer-editor":!0,editor:d})}function pP(e){return e===`Escape`||e===`ArrowUp`||e===`ArrowDown`||e===`Enter`||e===`Tab`}function mP(e){return In(e)}function hP(e,t){return e.content?.at(-1)?.type===`sourceBlock`?null:mP(t)}function gP(e,t){return e.state.selection.$from.parent.type.name===`sourceBlock`?null:mP(t)}function _P({attachments:e,commands:t,contextOpen:n,workspaceListing:r,workspaceLoading:i,disabled:a,draft:o,model:s,modelOption:c,effort:l,thoughtLevelOption:u,configOverrides:d,speedOption:f,permissionMode:p,permissionOption:m,sending:h,session:g,commandOpen:_,running:v,onAddFiles:y,onCommandOpen:b,onContext:x,onContextNavigate:S,onContextOpen:C,onDraft:w,onFiles:T,onModel:ee,onEffort:D,onConfigOverride:te,onPermissionMode:O,onPickDirectory:ne,onRemoveAttachment:re,onSubmit:ie,onStop:ae}){let oe=In(o),k=oe?.kind===`command`?oe.query:``,A=Ln(t,k),se=oe?.kind===`context`?oe.query.toLowerCase():``,ce=(r?.entries??[]).filter(e=>!se||`${e.name} ${e.path}`.toLowerCase().includes(se)),le=Fn(g).length>0,ue=`${_}:${k}`,de=`${n}:${se}:${r?.path??``}`,[fe,pe]=(0,E.useState)({key:ue,index:0}),[me,he]=(0,E.useState)({key:de,index:0}),ge=fe.key===ue?Math.min(fe.index,Math.max(A.length-1,0)):0,_e=me.key===de?Math.min(me.index,Math.max(ce.length-1,0)):0,[ye,be]=(0,E.useState)(null),[xe,Se]=(0,E.useState)(0);function Ce(e){pe(t=>{let n=t.key===ue?t.index:0;return{key:ue,index:typeof e==`function`?e(n):e}})}function we(e){he(t=>{let n=t.key===de?t.index:0;return{key:de,index:typeof e==`function`?e(n):e}})}function Te(e){let t=A[e];t&&(w(Rn(o,`/${t.name} `)),b(!1))}function Ee(e){let t=ce[e];if(t){if(t.kind===`directory`){S(t.path,r?.root);return}x(t.absolutePath),C(!1)}}function Oe(e){if(e.key===`Escape`&&(_||n))return b(!1),C(!1),!0;if(_&&A.length>0){if(e.key===`ArrowDown`)return Ce(e=>(e+1)%A.length),!0;if(e.key===`ArrowUp`)return Ce(e=>(e-1+A.length)%A.length),!0;if(e.key===`Enter`||e.key===`Tab`)return Te(ge),!0}if(n&&ce.length>0){if(e.key===`ArrowDown`)return we(e=>(e+1)%ce.length),!0;if(e.key===`ArrowUp`)return we(e=>(e-1+ce.length)%ce.length),!0;if(e.key===`Tab`||e.key===`Enter`)return Ee(_e),!0}return!1}function ke(e){b(e?.kind===`command`),C(e?.kind===`context`&&le)}function je(){w(`${o}${o&&!/\s$/.test(o)?` `:``}@`),C(!0)}function Me(){a||h||!o.trim()||ye||(Se(e=>e+1),w(``),ie())}return(0,j.jsxs)(`div`,{className:P(`surface-frosted relative rounded-xl border border-line-strong shadow-panel`,v&&`motion-safe:animate-breathe`),"data-composer":!0,"data-composer-running":v||void 0,children:[(0,j.jsx)(Bn,{attachments:e,onRemove:re}),(0,j.jsx)(fP,{disabled:a||h,onChange:w,onFiles:e=>y(e),onPickerKey:Oe,onSerializationError:be,onSubmit:Me,onTrigger:ke,value:o},`composer-editor-${xe}`),(0,j.jsxs)(`div`,{className:`flex items-end justify-between gap-3 px-3 pb-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(Qd,{hasWorkspace:le,onFiles:T,onPickDirectory:ne,onWorkspaceContext:je}),(0,j.jsx)(ef,{onValue:O,option:m,value:p})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(tf,{configOverrides:d,effort:l,model:s,modelOption:c,onConfigOverride:te,onEffort:D,onModel:ee,speedOption:f,thoughtLevelOption:u}),v&&(0,j.jsx)(fr,{"aria-label":`停止当前 Run`,className:`size-8 bg-danger-soft px-0 text-danger`,onClick:ae,size:`icon`,title:`停止当前 Run`,children:(0,j.jsx)(Ae,{className:`size-3.5 fill-current`})}),(0,j.jsx)(fr,{"aria-label":`发送`,className:`size-8 bg-accent px-0 text-accent-ink transition-transform active:translate-y-px`,disabled:a||h||!o.trim()||!!ye,onClick:Me,size:`icon`,children:h?(0,j.jsx)(ve,{className:`size-4 animate-spin`}):(0,j.jsx)(De,{className:`size-4`})})]})]}),ye&&(0,j.jsx)(`p`,{className:`px-3 pb-2 text-xs text-danger`,role:`alert`,children:ye}),n&&le&&(0,j.jsx)(vP,{activeIndex:_e,entries:ce,listing:r,loading:i,onNavigate:S,onPick:Ee,onSelect:we}),_&&A.length>0&&(0,j.jsx)(yP,{activeIndex:ge,commands:A,onPick:Te,onSelect:Ce}),xe>0&&(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`composer-sweep sent`},xe)]})}function vP({activeIndex:e,entries:t,listing:n,loading:r,onNavigate:i,onPick:a,onSelect:o}){return(0,j.jsxs)(`div`,{className:`surface-frosted absolute bottom-[calc(100%+0.5rem)] left-3 z-30 w-[420px] overflow-hidden rounded-lg border border-line-strong shadow-panel`,children:[(0,j.jsxs)(`div`,{className:`flex h-9 items-center gap-2 border-b border-line px-2.5 text-xs text-muted`,children:[n?.relativePath&&(0,j.jsx)(`button`,{"aria-label":`返回上级目录`,className:`grid size-6 place-items-center rounded-md hover:opacity-70`,onClick:()=>i(n.relativePath.split(`/`).slice(0,-1).join(`/`),n.root),type:`button`,children:(0,j.jsx)(oe,{className:`size-3.5 rotate-90`})}),(0,j.jsx)(me,{className:`size-3.5`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:n?.path})]}),(0,j.jsx)(`div`,{className:`max-h-72 overflow-y-auto p-1`,children:r?(0,j.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-muted`,children:`正在读取 Workspace…`}):t.length?t.map((t,n)=>(0,j.jsxs)(`button`,{"aria-selected":n===e,className:P(`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-xs text-ink hover:opacity-80`,n===e&&`bg-surface-soft`),onClick:()=>a(n),onMouseEnter:()=>o(n),ref:n===e?e=>e?.scrollIntoView?.({block:`nearest`}):void 0,type:`button`,children:[t.kind===`directory`?(0,j.jsx)(me,{className:`size-3.5 shrink-0 text-muted`}):(0,j.jsx)(pe,{className:`size-3.5 shrink-0 text-muted`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.name}),(0,j.jsx)(`span`,{className:`max-w-48 truncate font-mono text-xs text-faint`,children:t.absolutePath}),t.kind===`directory`&&(0,j.jsx)(A,{className:`size-3.5 shrink-0 text-faint`})]},t.absolutePath)):(0,j.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-muted`,children:`没有匹配的文件或目录`})})]})}function yP({activeIndex:e,commands:t,onPick:n,onSelect:r}){return(0,j.jsx)(`div`,{className:`surface-frosted absolute bottom-[calc(100%+0.5rem)] left-3 z-30 max-h-72 w-[420px] overflow-y-auto rounded-lg border border-line-strong p-1 shadow-panel`,children:t.map((t,i)=>(0,j.jsxs)(`button`,{"aria-selected":i===e,className:P(`grid w-full gap-0.5 rounded-md px-3 py-2.5 text-left text-ink hover:opacity-80`,i===e&&`bg-surface-soft`),onClick:()=>n(i),onMouseEnter:()=>r(i),ref:i===e?e=>e?.scrollIntoView?.({block:`nearest`}):void 0,type:`button`,children:[(0,j.jsxs)(`span`,{className:`font-mono text-xs`,children:[`/`,t.name]}),(0,j.jsx)(`span`,{className:`truncate text-xs text-muted`,children:t.description})]},t.name))})}function bP(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function xP(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var SP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wP={};function TP(e,t){return((t||wP).jsx?CP:SP).test(e)}var EP=/[ \t\n\f\r]/g;function DP(e){return typeof e==`object`?e.type===`text`&&OP(e.value):OP(e)}function OP(e){return e.replace(EP,``)===``}var kP=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};kP.prototype.normal={},kP.prototype.property={},kP.prototype.space=void 0;function AP(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new kP(n,r,t)}function jP(e){return e.toLowerCase()}var MP=class{constructor(e,t){this.attribute=t,this.property=e}};MP.prototype.attribute=``,MP.prototype.booleanish=!1,MP.prototype.boolean=!1,MP.prototype.commaOrSpaceSeparated=!1,MP.prototype.commaSeparated=!1,MP.prototype.defined=!1,MP.prototype.mustUseProperty=!1,MP.prototype.number=!1,MP.prototype.overloadedBoolean=!1,MP.prototype.property=``,MP.prototype.spaceSeparated=!1,MP.prototype.space=void 0;var NP=s({boolean:()=>FP,booleanish:()=>IP,commaOrSpaceSeparated:()=>BP,commaSeparated:()=>zP,number:()=>z,overloadedBoolean:()=>LP,spaceSeparated:()=>RP}),PP=0,FP=VP(),IP=VP(),LP=VP(),z=VP(),RP=VP(),zP=VP(),BP=VP();function VP(){return 2**++PP}var HP=Object.keys(NP),UP=class extends MP{constructor(e,t,n,r){let i=-1;if(super(e,t),WP(this,`space`,r),typeof n==`number`)for(;++i<HP.length;){let e=HP[i];WP(this,HP[i],(n&NP[e])===NP[e])}}};UP.prototype.defined=!0;function WP(e,t,n){n&&(e[t]=n)}function GP(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new UP(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[jP(r)]=r,n[jP(a.attribute)]=r}return new kP(t,n,e.space)}var KP=GP({properties:{ariaActiveDescendant:null,ariaAtomic:IP,ariaAutoComplete:null,ariaBusy:IP,ariaChecked:IP,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:RP,ariaCurrent:null,ariaDescribedBy:RP,ariaDetails:null,ariaDisabled:IP,ariaDropEffect:RP,ariaErrorMessage:null,ariaExpanded:IP,ariaFlowTo:RP,ariaGrabbed:IP,ariaHasPopup:null,ariaHidden:IP,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:RP,ariaLevel:z,ariaLive:null,ariaModal:IP,ariaMultiLine:IP,ariaMultiSelectable:IP,ariaOrientation:null,ariaOwns:RP,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:IP,ariaReadOnly:IP,ariaRelevant:null,ariaRequired:IP,ariaRoleDescription:RP,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:IP,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function qP(e,t){return t in e?e[t]:t}function JP(e,t){return qP(e,t.toLowerCase())}var YP=GP({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:zP,acceptCharset:RP,accessKey:RP,action:null,allow:null,allowFullScreen:FP,allowPaymentRequest:FP,allowUserMedia:FP,alpha:FP,alt:null,as:null,async:FP,autoCapitalize:null,autoComplete:RP,autoFocus:FP,autoPlay:FP,blocking:RP,capture:null,charSet:null,checked:FP,cite:null,className:RP,closedBy:null,colorSpace:null,cols:z,colSpan:z,command:null,commandFor:null,content:null,contentEditable:IP,controls:FP,controlsList:RP,coords:z|zP,crossOrigin:null,data:null,dateTime:null,decoding:null,default:FP,defer:FP,dir:null,dirName:null,disabled:FP,download:LP,draggable:IP,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:FP,formTarget:null,headers:RP,height:z,hidden:LP,high:z,href:null,hrefLang:null,htmlFor:RP,httpEquiv:RP,id:null,imageSizes:null,imageSrcSet:null,inert:FP,inputMode:null,integrity:null,is:null,isMap:FP,itemId:null,itemProp:RP,itemRef:RP,itemScope:FP,itemType:RP,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:FP,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:FP,muted:FP,name:null,nonce:null,noModule:FP,noValidate:FP,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:FP,optimum:z,pattern:null,ping:RP,placeholder:null,playsInline:FP,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:FP,referrerPolicy:null,rel:RP,required:FP,reversed:FP,rows:z,rowSpan:z,sandbox:RP,scope:null,scoped:FP,seamless:FP,selected:FP,shadowRootClonable:FP,shadowRootCustomElementRegistry:FP,shadowRootDelegatesFocus:FP,shadowRootMode:null,shadowRootSerializable:FP,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:IP,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:FP,useMap:null,value:IP,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:RP,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:FP,declare:FP,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:FP,noHref:FP,noShade:FP,noWrap:FP,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:IP,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:FP,disablePictureInPicture:FP,disableRemotePlayback:FP,exportParts:zP,part:RP,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:JP}),XP=GP({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:BP,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:RP,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:FP,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:zP,g2:zP,glyphName:zP,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:BP,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:RP,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:BP,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:BP,rev:BP,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:BP,requiredFeatures:BP,requiredFonts:BP,requiredFormats:BP,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:BP,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:BP,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:BP,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:qP}),ZP=GP({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()}}),QP=GP({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:JP}),$P=GP({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),eF={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`},tF=/[A-Z]/g,nF=/-[a-z]/g,rF=/^data[-\w.:]+$/i;function iF(e,t){let n=jP(t),r=t,i=MP;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&rF.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(nF,oF);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!nF.test(e)){let n=e.replace(tF,aF);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=UP}return new i(r,t)}function aF(e){return`-`+e.toLowerCase()}function oF(e){return e.charAt(1).toUpperCase()}var sF=AP([KP,YP,ZP,QP,$P],`html`),cF=AP([KP,XP,ZP,QP,$P],`svg`);function lF(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function uF(e){return e.join(` `).trim()}var dF=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
264
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),fF=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(dF());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),pF=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),mF=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(fF()),r=pF();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),hF=_F(`end`),gF=_F(`start`);function _F(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function vF(e){let t=gF(e),n=hF(e);if(t&&n)return{start:t,end:n}}function yF(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?xF(e.position):`start`in e||`end`in e?xF(e):`line`in e||`column`in e?bF(e):``}function bF(e){return SF(e&&e.line)+`:`+SF(e&&e.column)}function xF(e){return bF(e&&e.start)+`-`+bF(e&&e.end)}function SF(e){return e&&typeof e==`number`?e:1}var CF=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=yF(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};CF.prototype.file=``,CF.prototype.name=``,CF.prototype.reason=``,CF.prototype.message=``,CF.prototype.stack=``,CF.prototype.column=void 0,CF.prototype.line=void 0,CF.prototype.ancestors=void 0,CF.prototype.cause=void 0,CF.prototype.fatal=void 0,CF.prototype.place=void 0,CF.prototype.ruleId=void 0,CF.prototype.source=void 0;var wF=l(mF(),1),TF={}.hasOwnProperty,EF=new Map,DF=/[A-Z]/g,OF=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),kF=new Set([`td`,`th`]);function AF(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=VF(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=BF(n,t.jsx,t.jsxs)}let 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`?cF:sF,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=jF(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function jF(e,t,n){if(t.type===`element`)return MF(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return NF(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return FF(e,t,n);if(t.type===`mdxjsEsm`)return PF(e,t);if(t.type===`root`)return IF(e,t,n);if(t.type===`text`)return LF(e,t)}function MF(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=cF,e.schema=i),e.ancestors.push(t);let a=qF(e,t.tagName,!1),o=HF(e,t),s=WF(e,t);return OF.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!DP(e)})),RF(e,o,a,t),zF(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function NF(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}JF(e,t.position)}function PF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);JF(e,t.position)}function FF(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=cF,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:qF(e,t.name,!0),o=UF(e,t),s=WF(e,t);return RF(e,o,a,t),zF(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function IF(e,t,n){let r={};return zF(r,WF(e,t)),e.create(t,e.Fragment,r,n)}function LF(e,t){return t.value}function RF(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zF(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function BF(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function VF(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=gF(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function HF(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&TF.call(t.properties,i)){let a=GF(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&kF.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function UF(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else JF(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else JF(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function WF(e,t){let n=[],r=-1,i=e.passKeys?new Map:EF;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=jF(e,a,o);s!==void 0&&n.push(s)}return n}function GF(e,t,n){let r=iF(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xP(n):uF(n)),r.property===`style`){let t=typeof n==`object`?n:KF(e,String(n));return e.stylePropertyNameCase===`css`&&(t=YF(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?eF[r.property]||r.property:r.attribute,n]}}function KF(e,t){try{return(0,wF.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new CF("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function qF(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=TP(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=TP(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return TF.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);JF(e)}function JF(e,t){let n=new CF("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function YF(e){let t={},n;for(n in e)TF.call(e,n)&&(t[XF(n)]=e[n]);return t}function XF(e){let t=e.replace(DF,ZF);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ZF(e){return`-`+e.toLowerCase()}var QF={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`]},$F={};function eI(e,t){let n=t||$F;return tI(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function tI(e,t,n){if(rI(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 nI(e.children,t,n)}return Array.isArray(e)?nI(e,t,n):``}function nI(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=tI(e[i],t,n);return r.join(``)}function rI(e){return!!(e&&typeof e==`object`)}var iI=document.createElement(`i`);function aI(e){let t=`&`+e+`;`;iI.innerHTML=t;let n=iI.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function oI(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function sI(e,t){return e.length>0?(oI(e,e.length,0,t),e):t}var cI={}.hasOwnProperty;function lI(e){let t={},n=-1;for(;++n<e.length;)uI(t,e[n]);return t}function uI(e,t){let n;for(n in t){let r=(cI.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){cI.call(r,a)||(r[a]=[]);let e=i[a];dI(r[a],Array.isArray(e)?e:e?[e]:[])}}}function dI(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);oI(e,0,0,r)}function fI(e,t){let 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 pI(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var mI=EI(/[A-Za-z]/),hI=EI(/[\dA-Za-z]/),gI=EI(/[#-'*+\--9=?A-Z^-~]/);function _I(e){return e!==null&&(e<32||e===127)}var vI=EI(/\d/),yI=EI(/[\dA-Fa-f]/),bI=EI(/[!-/:-@[-`{-~]/);function xI(e){return e!==null&&e<-2}function SI(e){return e!==null&&(e<0||e===32)}function CI(e){return e===-2||e===-1||e===32}var wI=EI(/\p{P}|\p{S}/u),TI=EI(/\s/);function EI(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function DI(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&hI(e.charCodeAt(n+1))&&hI(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function OI(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return CI(r)?(e.enter(n),s(r)):t(r)}function s(r){return CI(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var kI={tokenize:AI};function AI(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),OI(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return xI(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var jI={tokenize:NI},MI={tokenize:PI};function NI(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return oI(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(MI,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(MI,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return xI(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;oI(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function PI(e,t,n){return OI(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function FI(e){if(e===null||SI(e)||TI(e))return 1;if(wI(e))return 2}function II(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var LI={name:`attention`,resolveAll:RI,tokenize:zI};function RI(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};BI(d,-c),BI(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=sI(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=sI(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=sI(l,II(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=sI(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=sI(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,oI(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function zI(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=FI(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=FI(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function BI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var VI={name:`autolink`,tokenize:HI};function HI(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return mI(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||hI(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||hI(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||_I(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):gI(t)?(e.consume(t),l):n(t)}function u(e){return hI(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||hI(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var UI={partial:!0,tokenize:WI};function WI(e,t,n){return r;function r(t){return CI(t)?OI(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||xI(e)?t(e):n(e)}}var GI={continuation:{tokenize:qI},exit:JI,name:`blockQuote`,tokenize:KI};function KI(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return CI(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function qI(e,t,n){let r=this;return i;function i(t){return CI(t)?OI(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(GI,t,n)(r)}}function JI(e){e.exit(`blockQuote`)}var YI={name:`characterEscape`,tokenize:XI};function XI(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return bI(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ZI={name:`characterReference`,tokenize:QI};function QI(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=hI,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=yI,u):(e.enter(`characterReferenceValue`),a=7,o=vI,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===hI&&!aI(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var $I={partial:!0,tokenize:nL},eL={concrete:!0,name:`codeFenced`,tokenize:tL};function tL(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),CI(t)?OI(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||xI(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check($I,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||xI(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):CI(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),OI(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||xI(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||xI(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&CI(t)?OI(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||xI(t)?e.check($I,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||xI(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),CI(t)?OI(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),CI(t)?OI(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||xI(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function nL(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var rL={name:`codeIndented`,tokenize:aL},iL={partial:!0,tokenize:oL};function aL(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),OI(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):xI(t)?e.attempt(iL,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||xI(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function oL(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):xI(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):OI(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):xI(e)?i(e):n(e)}}var sL={name:`codeText`,previous:lL,resolve:cL,tokenize:uL};function cL(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 lL(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function uL(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):xI(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||xI(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var dL=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&fL(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),fL(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),fL(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);fL(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);fL(this.left,t.reverse())}}}};function fL(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 pL(e){let t={},n=-1,r,i,a,o,s,c,l,u=new dL(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,mL(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return oI(e,0,1/0,u.slice(0)),!l}function mL(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var hL={resolve:_L,tokenize:vL},gL={partial:!0,tokenize:yL};function _L(e){return pL(e),e}function vL(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):xI(t)?e.check(gL,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function yL(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),OI(e,a,`linePrefix`)}function a(i){if(i===null||xI(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function bL(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||_I(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||xI(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||SI(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||_I(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function xL(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):xI(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||xI(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!CI(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function SL(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):xI(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),OI(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||xI(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function CL(e,t){let n;return r;function r(i){return xI(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):CI(i)?OI(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var wL={name:`definition`,tokenize:EL},TL={partial:!0,tokenize:DL};function EL(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return xL.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=pI(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return SI(t)?CL(e,l)(t):l(t)}function l(t){return bL(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(TL,d,d)(t)}function d(t){return CI(t)?OI(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||xI(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function DL(e,t,n){return r;function r(t){return SI(t)?CL(e,i)(t):n(t)}function i(t){return SL(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return CI(t)?OI(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||xI(e)?t(e):n(e)}}var OL={name:`hardBreakEscape`,tokenize:kL};function kL(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return xI(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var AL={name:`headingAtx`,resolve:jL,tokenize:ML};function jL(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},oI(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function ML(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||SI(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||xI(n)?(e.exit(`atxHeading`),t(n)):CI(n)?OI(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||SI(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var NL=`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`.split(`.`),PL=[`pre`,`script`,`style`,`textarea`],FL={concrete:!0,name:`htmlFlow`,resolveTo:RL,tokenize:zL},IL={partial:!0,tokenize:VL},LL={partial:!0,tokenize:BL};function RL(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 zL(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:k):mI(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):mI(a)?(e.consume(a),i=4,r.interrupt?t:k):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:k):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return mI(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||SI(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&PL.includes(l)?(i=1,r.interrupt?t(s):D(s)):NL.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||hI(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return CI(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||mI(t)?(e.consume(t),b):CI(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||hI(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):CI(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):CI(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||xI(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||SI(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||CI(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||xI(t)?D(t):CI(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),re):t===60&&i===1?(e.consume(t),ie):t===62&&i===4?(e.consume(t),A):t===63&&i===3?(e.consume(t),k):t===93&&i===5?(e.consume(t),oe):xI(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(IL,se,te)(t)):t===null||xI(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(LL,O,se)(t)}function O(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||xI(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function re(t){return t===45?(e.consume(t),k):D(t)}function ie(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return PL.includes(n)?(e.consume(t),A):D(t)}return mI(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),k):D(t)}function k(t){return t===62?(e.consume(t),A):t===45&&i===2?(e.consume(t),k):D(t)}function A(t){return t===null||xI(t)?(e.exit(`htmlFlowData`),se(t)):(e.consume(t),A)}function se(n){return e.exit(`htmlFlow`),t(n)}}function BL(e,t,n){let r=this;return i;function i(t){return xI(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function VL(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(UI,t,n)}}var HL={name:`htmlText`,tokenize:UL};function UL(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):mI(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):mI(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):xI(t)?(o=d,ie(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?re(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):xI(t)?(o=h,ie(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?re(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?re(t):xI(t)?(o=v,ie(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):xI(t)?(o=y,ie(t)):(e.consume(t),y)}function b(e){return e===62?re(e):y(e)}function x(t){return mI(t)?(e.consume(t),S):n(t)}function S(t){return t===45||hI(t)?(e.consume(t),S):C(t)}function C(t){return xI(t)?(o=C,ie(t)):CI(t)?(e.consume(t),C):re(t)}function w(t){return t===45||hI(t)?(e.consume(t),w):t===47||t===62||SI(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),re):t===58||t===95||mI(t)?(e.consume(t),E):xI(t)?(o=T,ie(t)):CI(t)?(e.consume(t),T):re(t)}function E(t){return t===45||t===46||t===58||t===95||hI(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):xI(t)?(o=ee,ie(t)):CI(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):xI(t)?(o=D,ie(t)):CI(t)?(e.consume(t),D):(e.consume(t),O)}function te(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):xI(t)?(o=te,ie(t)):(e.consume(t),te)}function O(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||SI(t)?T(t):(e.consume(t),O)}function ne(e){return e===47||e===62||SI(e)?T(e):n(e)}function re(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ie(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return CI(t)?OI(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var WL={name:`labelEnd`,resolveAll:JL,resolveTo:YL,tokenize:XL},GL={tokenize:ZL},KL={tokenize:QL},qL={tokenize:$L};function JL(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&oI(e,0,e.length,n),e}function YL(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=sI(s,e.slice(a+1,a+r+3)),s=sI(s,[[`enter`,u,t]]),s=sI(s,II(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=sI(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=sI(s,e.slice(o+1)),s=sI(s,[[`exit`,c,t]]),oI(e,a,e.length,s),e}function XL(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(pI(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(GL,u,o?u:d)(t):t===91?e.attempt(KL,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(qL,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ZL(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return SI(t)?CL(e,a)(t):a(t)}function a(t){return t===41?u(t):bL(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return SI(t)?CL(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?SL(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return SI(t)?CL(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function QL(e,t,n){let r=this;return i;function i(t){return xL.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(pI(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function $L(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var eR={name:`labelStartImage`,resolveAll:WL.resolveAll,tokenize:tR};function tR(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var nR={name:`labelStartLink`,resolveAll:WL.resolveAll,tokenize:rR};function rR(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var iR={name:`lineEnding`,tokenize:aR};function aR(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),OI(e,t,`linePrefix`)}}var oR={name:`thematicBreak`,tokenize:sR};function sR(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||xI(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),CI(t)?OI(e,s,`whitespace`)(t):s(t))}}var cR={continuation:{tokenize:fR},exit:mR,name:`list`,tokenize:dR},lR={partial:!0,tokenize:hR},uR={partial:!0,tokenize:pR};function dR(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:vI(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(oR,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return vI(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(UI,r.interrupt?n:u,e.attempt(lR,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return CI(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function fR(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(UI,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,OI(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!CI(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uR,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,OI(e,e.attempt(cR,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function pR(e,t,n){let r=this;return OI(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function mR(e){e.exit(this.containerState.type)}function hR(e,t,n){let r=this;return OI(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!CI(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var gR={name:`setextUnderline`,resolveTo:_R,tokenize:vR};function _R(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function vR(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),CI(t)?OI(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||xI(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var yR={tokenize:bR};function bR(e){let t=this,n=e.attempt(UI,r,e.attempt(this.parser.constructs.flowInitial,i,OI(e,e.attempt(this.parser.constructs.flow,i,e.attempt(hL,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var xR={resolveAll:TR()},SR=wR(`string`),CR=wR(`text`);function wR(e){return{resolveAll:TR(e===`text`?ER:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function TR(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ER(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var DR=s({attentionMarkers:()=>FR,contentInitial:()=>kR,disable:()=>IR,document:()=>OR,flow:()=>jR,flowInitial:()=>AR,insideSpan:()=>PR,string:()=>MR,text:()=>NR}),OR={42:cR,43:cR,45:cR,48:cR,49:cR,50:cR,51:cR,52:cR,53:cR,54:cR,55:cR,56:cR,57:cR,62:GI},kR={91:wL},AR={[-2]:rL,[-1]:rL,32:rL},jR={35:AL,42:oR,45:[gR,oR],60:FL,61:gR,95:oR,96:eL,126:eL},MR={38:ZI,92:YI},NR={[-5]:iR,[-4]:iR,[-3]:iR,33:eR,38:ZI,42:LI,60:[VI,HL],91:nR,92:[OL,YI],93:WL,95:LI,96:sL},PR={null:[LI,xR]},FR={null:[42,95]},IR={null:[]};function LR(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=sI(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=II(a,l.events,l),l.events):[]}function f(e,t){return zR(p(e),t)}function p(e){return RR(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){xI(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&oI(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function RR(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function zR(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
265
+ `;break;case-3:o=`\r
266
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function BR(e){let t={constructs:lI([DR,...(e||{}).extensions||[]]),content:n(kI),defined:[],document:n(jI),flow:n(yR),lazy:{},string:n(SR),text:n(CR)};return t;function n(e){return n;function n(n){return LR(t,e,n)}}}function VR(e){for(;!pL(e););return e}var HR=/[\0\t\n\r]/g;function UR(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(HR.lastIndex=u,c=HR.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var WR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GR(e){return e.replace(WR,KR)}function KR(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return fI(n.slice(t?2:1),t?16:10)}return aI(n)||e}var qR={}.hasOwnProperty;function JR(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),YR(n)(VR(BR(n).document().write(UR()(e,t,!0))))}function YR(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(we),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(be),blockQuote:a(he),characterEscape:T,characterReference:T,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(_e,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ve),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ye),hardBreakEscape:a(xe),hardBreakTrailing:a(xe),htmlFlow:a(Se,o),htmlFlowData:T,htmlText:a(Se,o),htmlTextData:T,image:a(Ce),label:o,link:a(we),listItem:a(Ee),listItemValue:f,listOrdered:a(Te,d),listUnordered:a(Te),paragraph:a(De),reference:ce,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(be),strong:a(Oe),thematicBreak:a(Ae)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:me,autolinkProtocol:pe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:fe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(O),htmlTextData:E,image:c(ie),label:oe,labelText:ae,lineEnding:ee,link:c(re),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:le,resourceDestinationString:k,resourceTitleString:A,resource:se,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ZR(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];qR.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||$R).call(a,void 0,e[0])}for(r.position={start:XR(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:XR(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:XR(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||$R).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+yF({start:e.start,end:e.end})+`): it’s not open`);n.position.end=XR(e.end)}function u(){return eI(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pI(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ke(),n.position={start:XR(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=XR(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=XR(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=GR(t),n.identifier=pI(t).toLowerCase()}function oe(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function se(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function le(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pI(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=fI(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=aI(t);let i=this.stack[this.stack.length-1];i.value+=r}function fe(e){let t=this.stack.pop();t.position.end=XR(e.end)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function he(){return{type:`blockquote`,children:[]}}function ge(){return{type:`code`,lang:null,meta:null,value:``}}function _e(){return{type:`inlineCode`,value:``}}function ve(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ye(){return{type:`emphasis`,children:[]}}function be(){return{type:`heading`,depth:0,children:[]}}function xe(){return{type:`break`}}function Se(){return{type:`html`,value:``}}function Ce(){return{type:`image`,title:null,url:``,alt:null}}function we(){return{type:`link`,title:null,url:``,children:[]}}function Te(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ee(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function De(){return{type:`paragraph`,children:[]}}function Oe(){return{type:`strong`,children:[]}}function ke(){return{type:`text`,value:``}}function Ae(){return{type:`thematicBreak`}}}function XR(e){return{line:e.line,column:e.column,offset:e.offset}}function ZR(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ZR(e,r):QR(e,r)}}function QR(e,t){let n;for(n in t)if(qR.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function $R(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+yF({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yF({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+yF({start:t.start,end:t.end})+`) is still open`)}function ez(e){let t=this;t.parser=n;function n(n){return JR(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function tz(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function nz(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
267
+ `}]}function rz(e,t){let n=t.value?t.value+`
268
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function iz(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function az(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oz(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=DI(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function sz(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cz(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lz(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function uz(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lz(e,t);let i={src:DI(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function dz(e,t){let n={src:DI(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fz(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pz(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lz(e,t);let i={href:DI(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mz(e,t){let n={href:DI(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hz(e,t,n){let r=e.all(t),i=n?gz(n):_z(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
269
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
270
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function gz(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=_z(n[r])}return t}function _z(e){return e.spread??e.children.length>1}function vz(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function yz(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bz(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xz(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sz(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=gF(t.children[1]),o=hF(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Cz(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function wz(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Tz=9,Ez=32;function Dz(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Oz(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Oz(t.slice(i),i>0,!1)),a.join(``)}function Oz(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Tz||t===Ez;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Tz||t===Ez;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function kz(e,t){let n={type:`text`,value:Dz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Az(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var jz={blockquote:tz,break:nz,code:rz,delete:iz,emphasis:az,footnoteReference:oz,heading:sz,html:cz,imageReference:uz,image:dz,inlineCode:fz,linkReference:pz,link:mz,listItem:hz,list:vz,paragraph:yz,root:bz,strong:xz,table:Sz,tableCell:wz,tableRow:Cz,text:kz,thematicBreak:Az,toml:Mz,yaml:Mz,definition:Mz,footnoteDefinition:Mz};function Mz(){}var Nz=typeof self==`object`?self:globalThis,Pz=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Nz[e](t)},Fz=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Nz[e]==`function`?Pz(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Pz(a,o),i)};return r},Iz=e=>Fz(new Map,e)(0),Lz=``,{toString:Rz}={},{keys:zz}=Object,Bz=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Rz.call(e).slice(8,-1);switch(n){case`Array`:return[1,Lz];case`Object`:return[2,Lz];case`Date`:return[3,Lz];case`RegExp`:return[4,Lz];case`Map`:return[5,Lz];case`Set`:return[6,Lz];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Vz=([e,t])=>e===0&&(t===`function`||t===`symbol`),Hz=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Bz(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of zz(r))(e||!Vz(Bz(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Lz:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Vz(Bz(n))||Vz(Bz(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Vz(Bz(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Uz=(e,{json:t,lossy:n}={})=>{let r=[];return Hz(!(t||n),!!t,new Map,r)(e),r},Wz=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Iz(Uz(e,t)):structuredClone(e):(e,t)=>Iz(Uz(e,t));function Gz(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Kz(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function qz(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Gz,r=e.options.footnoteBackLabel||Kz,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=DI(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Wz(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
271
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
272
+ `}]}}var Jz=(function(e){if(e==null)return $z;if(typeof e==`function`)return Qz(e);if(typeof e==`object`)return Array.isArray(e)?Yz(e):Xz(e);if(typeof e==`string`)return Zz(e);throw Error(`Expected function, string, or object as test`)});function Yz(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Jz(e[n]);return Qz(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Xz(e){let t=e;return Qz(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Zz(e){return Qz(t);function t(t){return t&&t.type===e}}function Qz(e){return t;function t(t,n,r){return!!(eB(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function $z(){return!0}function eB(e){return typeof e==`object`&&!!e&&`type`in e}function tB(e){return e}var nB=[],rB=`skip`;function iB(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Jz(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+tB(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=nB,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=aB(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function aB(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?nB:[e]}function oB(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),iB(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var sB={}.hasOwnProperty,cB={};function lB(e,t){let n=t||cB,r=new Map,i=new Map,a={all:s,applyData:dB,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...jz,...n.handlers},one:o,options:n,patch:uB,wrap:pB};return oB(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(sB.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Wz(n);return r.children=a.all(e),r}return Wz(e)}return(a.options.unknownHandler||fB)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=mB(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=mB(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function uB(e,t){e.position&&(t.position=vF(e))}function dB(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Wz(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function fB(e,t){let n=t.data||{},r=`value`in t&&!(sB.call(n,`hProperties`)||sB.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 pB(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
273
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
274
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
275
+ `}),n}function mB(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hB(e,t){let n=lB(e,t),r=n.one(e,void 0),i=qz(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
276
+ `},i)),a}function gB(e,t){return e&&`run`in e?async function(n,r){let i=hB(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hB(n,{file:r,...e||t})}}function _B(e){if(e)throw e}var vB=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function yB(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bB(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?xB(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function xB(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var SB={basename:CB,dirname:wB,extname:TB,join:EB,sep:`/`};function CB(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);kB(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function wB(e){if(kB(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function TB(e){kB(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function EB(...e){let t=-1,n;for(;++t<e.length;)kB(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:DB(n)}function DB(e){kB(e);let t=e.codePointAt(0)===47,n=OB(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function OB(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function kB(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var AB={cwd:jB};function jB(){return`/`}function MB(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function NB(e){if(typeof e==`string`)e=new URL(e);else if(!MB(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return PB(e)}function PB(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var FB=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],IB=class{constructor(e){let t;t=e?MB(e)?{path:e}:typeof e==`string`||BB(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:AB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<FB.length;){let e=FB[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)FB.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?SB.basename(this.path):void 0}set basename(e){RB(e,`basename`),LB(e,`basename`),this.path=SB.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?SB.dirname(this.path):void 0}set dirname(e){zB(this.basename,`dirname`),this.path=SB.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?SB.extname(this.path):void 0}set extname(e){if(LB(e,`extname`),zB(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=SB.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){MB(e)&&(e=NB(e)),RB(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?SB.basename(this.path,this.extname):void 0}set stem(e){RB(e,`stem`),LB(e,`stem`),this.path=SB.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new CF(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function LB(e,t){if(e&&e.includes(SB.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+SB.sep+"`")}function RB(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function zB(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function BB(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var VB=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),HB=l(vB(),1),UB={}.hasOwnProperty,WB=new class e extends VB{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=bB()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,HB.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(qB(`data`,this.frozen),this.namespace[e]=t,this):UB.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qB(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=XB(e),n=this.parser||this.Parser;return GB(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),GB(`process`,this.parser||this.Parser),KB(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=XB(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);QB(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),GB(`processSync`,this.parser||this.Parser),KB(`processSync`,this.compiler||this.Compiler),this.process(e,r),YB(`processSync`,`process`,t),n;function r(e,r){t=!0,_B(e),n=r}}run(e,t,n){JB(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=XB(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),YB(`runSync`,`run`,n),r;function i(e,t){_B(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=XB(t),r=this.compiler||this.Compiler;return KB(`stringify`,r),JB(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(qB(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,HB.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];yB(o)&&yB(r)&&(r=(0,HB.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function GB(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function KB(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function qB(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function JB(e){if(!yB(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function YB(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function XB(e){return ZB(e)?e:new IB(e)}function ZB(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function QB(e){return typeof e==`string`||$B(e)}function $B(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var eV=[],tV={allowDangerousHtml:!0},nV=/^(https?|ircs?|mailto|xmpp)$/i,rV=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function iV(e){let t=aV(e),n=oV(e);return sV(t.runSync(t.parse(n),n),e)}function aV(e){let t=e.rehypePlugins||eV,n=e.remarkPlugins||eV,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tV}:tV;return WB().use(ez).use(n).use(gB,r).use(t)}function oV(e){let t=e.children||``,n=new IB;return typeof t==`string`?n.value=t:``+t,n}function sV(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||cV;for(let e of rV)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return oB(e,l),AF(e,{Fragment:j.Fragment,components:i,ignoreInvalidStyle:!0,jsx:j.jsx,jsxs:j.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in QF)if(Object.hasOwn(QF,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=QF[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function cV(e){let 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||nV.test(e.slice(0,t))?e:``}var lV=/[#.]/g;function uV(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){lV.lastIndex=i;let e=lV.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function dV(e,t,n){let r=n?_V(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=uV(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,fV(i))a.unshift(i);else for(let[t,n]of Object.entries(i))pV(e,o.properties,t,n)}for(let e of a)mV(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function fV(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function pV(e,t,n,r){let i=iF(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?lF(r):i.commaSeparated?bP(r):i.commaOrSpaceSeparated?lF(bP(r).join(` `)):hV(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?gV(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(hV(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function mV(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)mV(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?mV(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function hV(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||jP(n)===jP(t)))return!0}return n}function gV(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function _V(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var vV=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),yV=dV(sF,`div`),bV=dV(cF,`g`,vV),xV={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function SV(e,t){return CV(e,t||{})||{type:`root`,children:[]}}function CV(e,t){let n=wV(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function wV(e,t){switch(e.nodeType){case 1:return kV(e,t);case 3:return DV(e);case 8:return OV(e);case 9:return TV(e,t);case 10:return EV();case 11:return TV(e,t);default:return}}function TV(e,t){return{type:`root`,children:AV(e,t)}}function EV(){return{type:`doctype`}}function DV(e){return{type:`text`,value:e.nodeValue||``}}function OV(e){return{type:`comment`,value:e.nodeValue||``}}function kV(e,t){let n=e.namespaceURI,r=n===xV.svg?bV:yV,i=n===xV.html?e.tagName.toLowerCase():e.tagName,a=n===xV.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,AV(a,t))}function AV(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=CV(n[i],t);e!==void 0&&r.push(e)}return r}var jV=new DOMParser;function MV(e,t){return SV(t?.fragment?NV(e):jV.parseFromString(e,`text/html`))}function NV(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var PV=(function(e,t,n){let r=Jz(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),FV=(function(e){if(e==null)return zV;if(typeof e==`string`)return LV(e);if(typeof e==`object`)return IV(e);if(typeof e==`function`)return RV(e);throw Error("Expected function, string, or array as `test`")});function IV(e){let t=[],n=-1;for(;++n<e.length;)t[n]=FV(e[n]);return RV(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function LV(e){return RV(t);function t(t){return t.tagName===e}}function RV(e){return t;function t(t,n,r){return!!(BV(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function zV(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function BV(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var VV=/\n/g,HV=/[\t ]+/g,UV=FV(`br`),WV=FV(rH),GV=FV(`p`),KV=FV(`tr`),qV=FV([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,nH,iH]),JV=FV(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function YV(e,t){let n=t||{},r=`children`in e?e.children:[],i=JV(e),a=tH(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...QV(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...XV(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?UV(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
277
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function XV(e,t,n){return e.type===`element`?ZV(e,t,n):e.type===`text`?n.whitespace===`normal`?QV(e,n):$V(e):[]}function ZV(e,t,n){let r=tH(e,n),i=e.children||[],a=-1,o=[];if(qV(e))return o;let s,c;for(UV(e)||KV(e)&&PV(t,e,KV)?c=`
278
+ `:GV(e)?(s=2,c=2):JV(e)&&(s=1,c=1);++a<i.length;)o=o.concat(XV(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?UV(i[a+1]):c}));return WV(e)&&PV(t,e,WV)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function QV(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){VV.lastIndex=a;let e=VV.exec(n),i=e&&`index`in e?e.index:n.length;r.push(eH(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function $V(e){return[String(e.value)]}function eH(e,t,n){let r=[],i=0,a;for(;i<e.length;){HV.lastIndex=i;let n=HV.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function tH(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`}}return t.whitespace}function nH(e){return!!(e.properties||{}).hidden}function rH(e){return e.tagName===`td`||e.tagName===`th`}function iH(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var aH=s({ParseError:()=>B,SETTINGS_SCHEMA:()=>hH,__defineFunction:()=>Z,__defineMacro:()=>$,__defineSymbol:()=>H,__domTree:()=>vJ,__parse:()=>pJ,__renderToDomTree:()=>hJ,__renderToHTMLTree:()=>gJ,__setFontMetrics:()=>EU,default:()=>yJ,render:()=>dJ,renderToString:()=>fJ,version:()=>_J}),B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},oH=/([A-Z])/g,sH=e=>e.replace(oH,`-$1`).toLowerCase(),cH={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},lH=/[&><"']/g,uH=e=>String(e).replace(lH,e=>cH[e]),dH=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?dH(e.body[0]):e:e.type===`font`?dH(e.body):e,fH=new Set([`mathord`,`textord`,`atom`]),pH=e=>fH.has(dH(e).type),mH=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},hH={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function gH(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function _H(e){return e.default===void 0?gH(Array.isArray(e.type)?e.type[0]:e.type):e.default}function vH(e,t,n,r){var i=n[t];e[t]=i===void 0?_H(r):r.processor?r.processor(i):i}var yH=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(hH)){var n=hH[t];n&&vH(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=mH(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},bH=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return kH[AH[this.id]]}sub(){return kH[jH[this.id]]}fracNum(){return kH[MH[this.id]]}fracDen(){return kH[NH[this.id]]}cramp(){return kH[PH[this.id]]}text(){return kH[FH[this.id]]}isTight(){return this.size>=2}},xH=0,SH=1,CH=2,wH=3,TH=4,EH=5,DH=6,OH=7,kH=[new bH(xH,0,!1),new bH(SH,0,!0),new bH(CH,1,!1),new bH(wH,1,!0),new bH(TH,2,!1),new bH(EH,2,!0),new bH(DH,3,!1),new bH(OH,3,!0)],AH=[TH,EH,TH,EH,DH,OH,DH,OH],jH=[EH,EH,EH,EH,OH,OH,OH,OH],MH=[CH,wH,TH,EH,DH,OH,DH,OH],NH=[wH,wH,EH,EH,OH,OH,OH,OH],PH=[SH,SH,wH,wH,EH,EH,OH,OH],FH=[xH,SH,CH,wH,CH,wH,CH,wH],IH={DISPLAY:kH[xH],TEXT:kH[CH],SCRIPT:kH[TH],SCRIPTSCRIPT:kH[DH]},LH=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function RH(e){for(var t=0;t<LH.length;t++)for(var n=LH[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var zH=[];LH.forEach(e=>e.blocks.forEach(e=>zH.push(...e)));function BH(e){for(var t=0;t<zH.length;t+=2)if(e>=zH[t]&&e<=zH[t+1])return!0;return!1}var VH=e=>e+` `+e,HH=80,UH=function(e,t){return`M95,`+(622+e+t)+`
279
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
280
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
281
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
282
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
283
+ c69,-144,104.5,-217.7,106.5,-221
284
+ l`+e/2.075+` -`+e+`
285
+ c5.3,-9.3,12,-14,20,-14
286
+ H400000v`+(40+e)+`H845.2724
287
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
288
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
289
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},WH=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
290
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
291
+ c340,-704.7,510.7,-1060.3,512,-1067
292
+ l`+e/2.084+` -`+e+`
293
+ c4.7,-7.3,11,-11,19,-11
294
+ H40000v`+(40+e)+`H1012.3
295
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
296
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
297
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
298
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
299
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},GH=function(e,t){return`M983 `+(10+e+t)+`
300
+ l`+e/3.13+` -`+e+`
301
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
302
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
303
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
304
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
305
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
306
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
307
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
308
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},KH=function(e,t){return`M424,`+(2398+e+t)+`
309
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
310
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
311
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
312
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
313
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
314
+ v`+(40+e)+`H1014.6
315
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
316
+ c-2,6,-10,9,-24,9
317
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
318
+ h400000v`+(40+e)+`h-400000z`},qH=function(e,t){return`M473,`+(2713+e+t)+`
319
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
320
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
321
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
322
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
323
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
324
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
325
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},JH=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},YH=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
326
+ H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
327
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
328
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
329
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},XH=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=UH(t,HH);break;case`sqrtSize1`:r=WH(t,HH);break;case`sqrtSize2`:r=GH(t,HH);break;case`sqrtSize3`:r=KH(t,HH);break;case`sqrtSize4`:r=qH(t,HH);break;case`sqrtTall`:r=YH(t,HH,n)}return r},ZH=function(e,t){switch(e){case`⎜`:return VH(`M291 0 H417 V`+t+` H291z`);case`∣`:return VH(`M145 0 H188 V`+t+` H145z`);case`∥`:return VH(`M145 0 H188 V`+t+` H145z`)+VH(`M367 0 H410 V`+t+` H367z`);case`⎟`:return VH(`M457 0 H583 V`+t+` H457z`);case`⎢`:return VH(`M319 0 H403 V`+t+` H319z`);case`⎥`:return VH(`M263 0 H347 V`+t+` H263z`);case`⎪`:return VH(`M384 0 H504 V`+t+` H384z`);case`⏐`:return VH(`M312 0 H355 V`+t+` H312z`);case`‖`:return VH(`M257 0 H300 V`+t+` H257z`)+VH(`M478 0 H521 V`+t+` H478z`);default:return``}},QH={doubleleftarrow:`M262 157
330
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
331
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
332
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
333
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
334
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
335
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
336
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
337
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
338
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
339
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
340
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
341
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
342
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
343
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
344
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
345
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
346
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
347
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
348
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
349
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
350
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
351
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
352
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
353
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
354
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
355
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
356
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
357
+ 435 0h399565z`,leftgroupunder:`M400000 262
358
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
359
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
360
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
361
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
362
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
363
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
364
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
365
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
366
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
367
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
368
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
369
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
370
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
371
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
372
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
373
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
374
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
375
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:VH(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:VH(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:VH(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:VH(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
376
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
377
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
378
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:VH(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
379
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
380
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
381
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
382
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
383
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
384
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
385
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
386
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
387
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
388
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
389
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
390
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
391
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
392
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
393
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
394
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
395
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
396
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
397
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
398
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
399
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
400
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
401
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
402
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
403
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
404
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
405
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
406
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
407
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
408
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
409
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
410
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
411
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
412
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
413
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
414
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
415
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
416
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
417
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
418
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
419
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
420
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
421
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
422
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
423
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
424
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
425
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
426
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
427
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:VH(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:VH(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:VH(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
428
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
429
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
430
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
431
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
432
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
433
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
434
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
435
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
436
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
437
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
438
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
439
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
440
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
441
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
442
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
443
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
444
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
445
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
446
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
447
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
448
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
449
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
450
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
451
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
452
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
453
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
454
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
455
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
456
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
457
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
458
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
459
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
460
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
461
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
462
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
463
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
464
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
465
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
466
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
467
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
468
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
469
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
470
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
471
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
472
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
473
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
474
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
475
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
476
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
477
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
478
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
479
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
480
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
481
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
482
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
483
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
484
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
485
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
486
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
487
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
488
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
489
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
490
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
491
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
492
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
493
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
494
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
495
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
496
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
497
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
498
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
499
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
500
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},$H=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
501
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
502
+ M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
503
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
504
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
505
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
506
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
507
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
508
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
509
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
510
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
511
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
512
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
513
+ M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
514
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
515
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
516
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
517
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
518
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
519
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
520
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
521
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
522
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
523
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
524
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
525
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
526
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
527
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
528
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function eU(e){return`toText`in e}var tU=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(eU(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},nU={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},rU={ex:!0,em:!0,mu:!0},iU=function(e){return typeof e!=`string`&&(e=e.unit),e in nU||e in rU||e===`ex`},aU=function(e,t){var n;if(e.unit in nU)n=nU[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},V=function(e){return+e.toFixed(4)+`em`},oU=function(e){return e.filter(e=>e).join(` `)},sU=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=sH(n)+`:`+r+`;`)}return t},cU=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},lU=function(e){var t=document.createElement(e);t.className=oU(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},uU=/[\s"'>/=\x00-\x1f]/,dU=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+uH(oU(this.classes))+`"`);var n=sU(this.style);n&&(t+=` style="`+uH(n)+`"`);for(var r of Object.keys(this.attributes)){if(uU.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+uH(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},fU=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,cU.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lU.call(this,`span`)}toMarkup(){return dU.call(this,`span`)}},pU=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,cU.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lU.call(this,`a`)}toMarkup(){return dU.call(this,`a`)}},mU=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+uH(this.src)+`"`+(` alt="`+uH(this.alt)+`"`),t=sU(this.style);return t&&(e+=` style="`+uH(t)+`"`),e+=`'/>`,e}},hU={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},gU=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=RH(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=hU[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=oU(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=uH(oU(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`),n+=sU(this.style),n&&(e=!0,t+=` style="`+uH(n)+`"`);var r=uH(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},_U=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+uH(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},vU=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,QH[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+uH(this.alternate)+`"/>`:`<path d="`+uH(QH[this.pathName])+`"/>`}},yU=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+uH(this.attributes[t])+`"`;return e+=`/>`,e}};function bU(e){if(e instanceof gU)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function xU(e){if(e instanceof fU)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var SU=e=>e instanceof fU||e instanceof pU||e instanceof tU,CU={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},wU={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},TU={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function EU(e,t){CU[e]=t}function DU(e,t,n){if(!CU[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=CU[t][r];if(!i&&e[0]in TU&&(r=TU[e[0]].charCodeAt(0),i=CU[t][r]),!i&&n===`text`&&BH(r)&&(i=CU[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var OU={};function kU(e){var t=e>=5?0:e>=3?1:2;if(!OU[t]){var n=OU[t]={cssEmPerMu:wU.quad[t]/18};for(var r in wU)wU.hasOwnProperty(r)&&(n[r]=wU[r][t])}return OU[t]}var AU={math:{},text:{}};function H(e,t,n,r,i,a){AU[e][i]={font:t,group:n,replace:r},a&&r&&(AU[e][r]=AU[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,jU=`accent-token`,q=`bin`,MU=`close`,NU=`inner`,PU=`mathord`,FU=`op-token`,IU=`open`,LU=`punct`,J=`rel`,RU=`spacing`,Y=`textord`;H(U,G,J,`≡`,`\\equiv`,!0),H(U,G,J,`≺`,`\\prec`,!0),H(U,G,J,`≻`,`\\succ`,!0),H(U,G,J,`∼`,`\\sim`,!0),H(U,G,J,`⊥`,`\\perp`),H(U,G,J,`⪯`,`\\preceq`,!0),H(U,G,J,`⪰`,`\\succeq`,!0),H(U,G,J,`≃`,`\\simeq`,!0),H(U,G,J,`∣`,`\\mid`,!0),H(U,G,J,`≪`,`\\ll`,!0),H(U,G,J,`≫`,`\\gg`,!0),H(U,G,J,`≍`,`\\asymp`,!0),H(U,G,J,`∥`,`\\parallel`),H(U,G,J,`⋈`,`\\bowtie`,!0),H(U,G,J,`⌣`,`\\smile`,!0),H(U,G,J,`⊑`,`\\sqsubseteq`,!0),H(U,G,J,`⊒`,`\\sqsupseteq`,!0),H(U,G,J,`≐`,`\\doteq`,!0),H(U,G,J,`⌢`,`\\frown`,!0),H(U,G,J,`∋`,`\\ni`,!0),H(U,G,J,`∝`,`\\propto`,!0),H(U,G,J,`⊢`,`\\vdash`,!0),H(U,G,J,`⊣`,`\\dashv`,!0),H(U,G,J,`∋`,`\\owns`),H(U,G,LU,`.`,`\\ldotp`),H(U,G,LU,`⋅`,`\\cdotp`),H(U,G,LU,`⋅`,`·`),H(W,G,Y,`⋅`,`·`),H(U,G,Y,`#`,`\\#`),H(W,G,Y,`#`,`\\#`),H(U,G,Y,`&`,`\\&`),H(W,G,Y,`&`,`\\&`),H(U,G,Y,`ℵ`,`\\aleph`,!0),H(U,G,Y,`∀`,`\\forall`,!0),H(U,G,Y,`ℏ`,`\\hbar`,!0),H(U,G,Y,`∃`,`\\exists`,!0),H(U,G,Y,`∇`,`\\nabla`,!0),H(U,G,Y,`♭`,`\\flat`,!0),H(U,G,Y,`ℓ`,`\\ell`,!0),H(U,G,Y,`♮`,`\\natural`,!0),H(U,G,Y,`♣`,`\\clubsuit`,!0),H(U,G,Y,`℘`,`\\wp`,!0),H(U,G,Y,`♯`,`\\sharp`,!0),H(U,G,Y,`♢`,`\\diamondsuit`,!0),H(U,G,Y,`ℜ`,`\\Re`,!0),H(U,G,Y,`♡`,`\\heartsuit`,!0),H(U,G,Y,`ℑ`,`\\Im`,!0),H(U,G,Y,`♠`,`\\spadesuit`,!0),H(U,G,Y,`§`,`\\S`,!0),H(W,G,Y,`§`,`\\S`),H(U,G,Y,`¶`,`\\P`,!0),H(W,G,Y,`¶`,`\\P`),H(U,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\textdagger`),H(U,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\textdaggerdbl`),H(U,G,MU,`⎱`,`\\rmoustache`,!0),H(U,G,IU,`⎰`,`\\lmoustache`,!0),H(U,G,MU,`⟯`,`\\rgroup`,!0),H(U,G,IU,`⟮`,`\\lgroup`,!0),H(U,G,q,`∓`,`\\mp`,!0),H(U,G,q,`⊖`,`\\ominus`,!0),H(U,G,q,`⊎`,`\\uplus`,!0),H(U,G,q,`⊓`,`\\sqcap`,!0),H(U,G,q,`∗`,`\\ast`),H(U,G,q,`⊔`,`\\sqcup`,!0),H(U,G,q,`◯`,`\\bigcirc`,!0),H(U,G,q,`∙`,`\\bullet`,!0),H(U,G,q,`‡`,`\\ddagger`),H(U,G,q,`≀`,`\\wr`,!0),H(U,G,q,`⨿`,`\\amalg`),H(U,G,q,`&`,`\\And`),H(U,G,J,`⟵`,`\\longleftarrow`,!0),H(U,G,J,`⇐`,`\\Leftarrow`,!0),H(U,G,J,`⟸`,`\\Longleftarrow`,!0),H(U,G,J,`⟶`,`\\longrightarrow`,!0),H(U,G,J,`⇒`,`\\Rightarrow`,!0),H(U,G,J,`⟹`,`\\Longrightarrow`,!0),H(U,G,J,`↔`,`\\leftrightarrow`,!0),H(U,G,J,`⟷`,`\\longleftrightarrow`,!0),H(U,G,J,`⇔`,`\\Leftrightarrow`,!0),H(U,G,J,`⟺`,`\\Longleftrightarrow`,!0),H(U,G,J,`↦`,`\\mapsto`,!0),H(U,G,J,`⟼`,`\\longmapsto`,!0),H(U,G,J,`↗`,`\\nearrow`,!0),H(U,G,J,`↩`,`\\hookleftarrow`,!0),H(U,G,J,`↪`,`\\hookrightarrow`,!0),H(U,G,J,`↘`,`\\searrow`,!0),H(U,G,J,`↼`,`\\leftharpoonup`,!0),H(U,G,J,`⇀`,`\\rightharpoonup`,!0),H(U,G,J,`↙`,`\\swarrow`,!0),H(U,G,J,`↽`,`\\leftharpoondown`,!0),H(U,G,J,`⇁`,`\\rightharpoondown`,!0),H(U,G,J,`↖`,`\\nwarrow`,!0),H(U,G,J,`⇌`,`\\rightleftharpoons`,!0),H(U,K,J,`≮`,`\\nless`,!0),H(U,K,J,``,`\\@nleqslant`),H(U,K,J,``,`\\@nleqq`),H(U,K,J,`⪇`,`\\lneq`,!0),H(U,K,J,`≨`,`\\lneqq`,!0),H(U,K,J,``,`\\@lvertneqq`),H(U,K,J,`⋦`,`\\lnsim`,!0),H(U,K,J,`⪉`,`\\lnapprox`,!0),H(U,K,J,`⊀`,`\\nprec`,!0),H(U,K,J,`⋠`,`\\npreceq`,!0),H(U,K,J,`⋨`,`\\precnsim`,!0),H(U,K,J,`⪹`,`\\precnapprox`,!0),H(U,K,J,`≁`,`\\nsim`,!0),H(U,K,J,``,`\\@nshortmid`),H(U,K,J,`∤`,`\\nmid`,!0),H(U,K,J,`⊬`,`\\nvdash`,!0),H(U,K,J,`⊭`,`\\nvDash`,!0),H(U,K,J,`⋪`,`\\ntriangleleft`),H(U,K,J,`⋬`,`\\ntrianglelefteq`,!0),H(U,K,J,`⊊`,`\\subsetneq`,!0),H(U,K,J,``,`\\@varsubsetneq`),H(U,K,J,`⫋`,`\\subsetneqq`,!0),H(U,K,J,``,`\\@varsubsetneqq`),H(U,K,J,`≯`,`\\ngtr`,!0),H(U,K,J,``,`\\@ngeqslant`),H(U,K,J,``,`\\@ngeqq`),H(U,K,J,`⪈`,`\\gneq`,!0),H(U,K,J,`≩`,`\\gneqq`,!0),H(U,K,J,``,`\\@gvertneqq`),H(U,K,J,`⋧`,`\\gnsim`,!0),H(U,K,J,`⪊`,`\\gnapprox`,!0),H(U,K,J,`⊁`,`\\nsucc`,!0),H(U,K,J,`⋡`,`\\nsucceq`,!0),H(U,K,J,`⋩`,`\\succnsim`,!0),H(U,K,J,`⪺`,`\\succnapprox`,!0),H(U,K,J,`≆`,`\\ncong`,!0),H(U,K,J,``,`\\@nshortparallel`),H(U,K,J,`∦`,`\\nparallel`,!0),H(U,K,J,`⊯`,`\\nVDash`,!0),H(U,K,J,`⋫`,`\\ntriangleright`),H(U,K,J,`⋭`,`\\ntrianglerighteq`,!0),H(U,K,J,``,`\\@nsupseteqq`),H(U,K,J,`⊋`,`\\supsetneq`,!0),H(U,K,J,``,`\\@varsupsetneq`),H(U,K,J,`⫌`,`\\supsetneqq`,!0),H(U,K,J,``,`\\@varsupsetneqq`),H(U,K,J,`⊮`,`\\nVdash`,!0),H(U,K,J,`⪵`,`\\precneqq`,!0),H(U,K,J,`⪶`,`\\succneqq`,!0),H(U,K,J,``,`\\@nsubseteqq`),H(U,K,q,`⊴`,`\\unlhd`),H(U,K,q,`⊵`,`\\unrhd`),H(U,K,J,`↚`,`\\nleftarrow`,!0),H(U,K,J,`↛`,`\\nrightarrow`,!0),H(U,K,J,`⇍`,`\\nLeftarrow`,!0),H(U,K,J,`⇏`,`\\nRightarrow`,!0),H(U,K,J,`↮`,`\\nleftrightarrow`,!0),H(U,K,J,`⇎`,`\\nLeftrightarrow`,!0),H(U,K,J,`△`,`\\vartriangle`),H(U,K,Y,`ℏ`,`\\hslash`),H(U,K,Y,`▽`,`\\triangledown`),H(U,K,Y,`◊`,`\\lozenge`),H(U,K,Y,`Ⓢ`,`\\circledS`),H(U,K,Y,`®`,`\\circledR`),H(W,K,Y,`®`,`\\circledR`),H(U,K,Y,`∡`,`\\measuredangle`,!0),H(U,K,Y,`∄`,`\\nexists`),H(U,K,Y,`℧`,`\\mho`),H(U,K,Y,`Ⅎ`,`\\Finv`,!0),H(U,K,Y,`⅁`,`\\Game`,!0),H(U,K,Y,`‵`,`\\backprime`),H(U,K,Y,`▲`,`\\blacktriangle`),H(U,K,Y,`▼`,`\\blacktriangledown`),H(U,K,Y,`■`,`\\blacksquare`),H(U,K,Y,`⧫`,`\\blacklozenge`),H(U,K,Y,`★`,`\\bigstar`),H(U,K,Y,`∢`,`\\sphericalangle`,!0),H(U,K,Y,`∁`,`\\complement`,!0),H(U,K,Y,`ð`,`\\eth`,!0),H(W,G,Y,`ð`,`ð`),H(U,K,Y,`╱`,`\\diagup`),H(U,K,Y,`╲`,`\\diagdown`),H(U,K,Y,`□`,`\\square`),H(U,K,Y,`□`,`\\Box`),H(U,K,Y,`◊`,`\\Diamond`),H(U,K,Y,`¥`,`\\yen`,!0),H(W,K,Y,`¥`,`\\yen`,!0),H(U,K,Y,`✓`,`\\checkmark`,!0),H(W,K,Y,`✓`,`\\checkmark`),H(U,K,Y,`ℶ`,`\\beth`,!0),H(U,K,Y,`ℸ`,`\\daleth`,!0),H(U,K,Y,`ℷ`,`\\gimel`,!0),H(U,K,Y,`ϝ`,`\\digamma`,!0),H(U,K,Y,`ϰ`,`\\varkappa`),H(U,K,IU,`┌`,`\\@ulcorner`,!0),H(U,K,MU,`┐`,`\\@urcorner`,!0),H(U,K,IU,`└`,`\\@llcorner`,!0),H(U,K,MU,`┘`,`\\@lrcorner`,!0),H(U,K,J,`≦`,`\\leqq`,!0),H(U,K,J,`⩽`,`\\leqslant`,!0),H(U,K,J,`⪕`,`\\eqslantless`,!0),H(U,K,J,`≲`,`\\lesssim`,!0),H(U,K,J,`⪅`,`\\lessapprox`,!0),H(U,K,J,`≊`,`\\approxeq`,!0),H(U,K,q,`⋖`,`\\lessdot`),H(U,K,J,`⋘`,`\\lll`,!0),H(U,K,J,`≶`,`\\lessgtr`,!0),H(U,K,J,`⋚`,`\\lesseqgtr`,!0),H(U,K,J,`⪋`,`\\lesseqqgtr`,!0),H(U,K,J,`≑`,`\\doteqdot`),H(U,K,J,`≓`,`\\risingdotseq`,!0),H(U,K,J,`≒`,`\\fallingdotseq`,!0),H(U,K,J,`∽`,`\\backsim`,!0),H(U,K,J,`⋍`,`\\backsimeq`,!0),H(U,K,J,`⫅`,`\\subseteqq`,!0),H(U,K,J,`⋐`,`\\Subset`,!0),H(U,K,J,`⊏`,`\\sqsubset`,!0),H(U,K,J,`≼`,`\\preccurlyeq`,!0),H(U,K,J,`⋞`,`\\curlyeqprec`,!0),H(U,K,J,`≾`,`\\precsim`,!0),H(U,K,J,`⪷`,`\\precapprox`,!0),H(U,K,J,`⊲`,`\\vartriangleleft`),H(U,K,J,`⊴`,`\\trianglelefteq`),H(U,K,J,`⊨`,`\\vDash`,!0),H(U,K,J,`⊪`,`\\Vvdash`,!0),H(U,K,J,`⌣`,`\\smallsmile`),H(U,K,J,`⌢`,`\\smallfrown`),H(U,K,J,`≏`,`\\bumpeq`,!0),H(U,K,J,`≎`,`\\Bumpeq`,!0),H(U,K,J,`≧`,`\\geqq`,!0),H(U,K,J,`⩾`,`\\geqslant`,!0),H(U,K,J,`⪖`,`\\eqslantgtr`,!0),H(U,K,J,`≳`,`\\gtrsim`,!0),H(U,K,J,`⪆`,`\\gtrapprox`,!0),H(U,K,q,`⋗`,`\\gtrdot`),H(U,K,J,`⋙`,`\\ggg`,!0),H(U,K,J,`≷`,`\\gtrless`,!0),H(U,K,J,`⋛`,`\\gtreqless`,!0),H(U,K,J,`⪌`,`\\gtreqqless`,!0),H(U,K,J,`≖`,`\\eqcirc`,!0),H(U,K,J,`≗`,`\\circeq`,!0),H(U,K,J,`≜`,`\\triangleq`,!0),H(U,K,J,`∼`,`\\thicksim`),H(U,K,J,`≈`,`\\thickapprox`),H(U,K,J,`⫆`,`\\supseteqq`,!0),H(U,K,J,`⋑`,`\\Supset`,!0),H(U,K,J,`⊐`,`\\sqsupset`,!0),H(U,K,J,`≽`,`\\succcurlyeq`,!0),H(U,K,J,`⋟`,`\\curlyeqsucc`,!0),H(U,K,J,`≿`,`\\succsim`,!0),H(U,K,J,`⪸`,`\\succapprox`,!0),H(U,K,J,`⊳`,`\\vartriangleright`),H(U,K,J,`⊵`,`\\trianglerighteq`),H(U,K,J,`⊩`,`\\Vdash`,!0),H(U,K,J,`∣`,`\\shortmid`),H(U,K,J,`∥`,`\\shortparallel`),H(U,K,J,`≬`,`\\between`,!0),H(U,K,J,`⋔`,`\\pitchfork`,!0),H(U,K,J,`∝`,`\\varpropto`),H(U,K,J,`◀`,`\\blacktriangleleft`),H(U,K,J,`∴`,`\\therefore`,!0),H(U,K,J,`∍`,`\\backepsilon`),H(U,K,J,`▶`,`\\blacktriangleright`),H(U,K,J,`∵`,`\\because`,!0),H(U,K,J,`⋘`,`\\llless`),H(U,K,J,`⋙`,`\\gggtr`),H(U,K,q,`⊲`,`\\lhd`),H(U,K,q,`⊳`,`\\rhd`),H(U,K,J,`≂`,`\\eqsim`,!0),H(U,G,J,`⋈`,`\\Join`),H(U,K,J,`≑`,`\\Doteq`,!0),H(U,K,q,`∔`,`\\dotplus`,!0),H(U,K,q,`∖`,`\\smallsetminus`),H(U,K,q,`⋒`,`\\Cap`,!0),H(U,K,q,`⋓`,`\\Cup`,!0),H(U,K,q,`⩞`,`\\doublebarwedge`,!0),H(U,K,q,`⊟`,`\\boxminus`,!0),H(U,K,q,`⊞`,`\\boxplus`,!0),H(U,K,q,`⋇`,`\\divideontimes`,!0),H(U,K,q,`⋉`,`\\ltimes`,!0),H(U,K,q,`⋊`,`\\rtimes`,!0),H(U,K,q,`⋋`,`\\leftthreetimes`,!0),H(U,K,q,`⋌`,`\\rightthreetimes`,!0),H(U,K,q,`⋏`,`\\curlywedge`,!0),H(U,K,q,`⋎`,`\\curlyvee`,!0),H(U,K,q,`⊝`,`\\circleddash`,!0),H(U,K,q,`⊛`,`\\circledast`,!0),H(U,K,q,`⋅`,`\\centerdot`),H(U,K,q,`⊺`,`\\intercal`,!0),H(U,K,q,`⋒`,`\\doublecap`),H(U,K,q,`⋓`,`\\doublecup`),H(U,K,q,`⊠`,`\\boxtimes`,!0),H(U,K,J,`⇢`,`\\dashrightarrow`,!0),H(U,K,J,`⇠`,`\\dashleftarrow`,!0),H(U,K,J,`⇇`,`\\leftleftarrows`,!0),H(U,K,J,`⇆`,`\\leftrightarrows`,!0),H(U,K,J,`⇚`,`\\Lleftarrow`,!0),H(U,K,J,`↞`,`\\twoheadleftarrow`,!0),H(U,K,J,`↢`,`\\leftarrowtail`,!0),H(U,K,J,`↫`,`\\looparrowleft`,!0),H(U,K,J,`⇋`,`\\leftrightharpoons`,!0),H(U,K,J,`↶`,`\\curvearrowleft`,!0),H(U,K,J,`↺`,`\\circlearrowleft`,!0),H(U,K,J,`↰`,`\\Lsh`,!0),H(U,K,J,`⇈`,`\\upuparrows`,!0),H(U,K,J,`↿`,`\\upharpoonleft`,!0),H(U,K,J,`⇃`,`\\downharpoonleft`,!0),H(U,G,J,`⊶`,`\\origof`,!0),H(U,G,J,`⊷`,`\\imageof`,!0),H(U,K,J,`⊸`,`\\multimap`,!0),H(U,K,J,`↭`,`\\leftrightsquigarrow`,!0),H(U,K,J,`⇉`,`\\rightrightarrows`,!0),H(U,K,J,`⇄`,`\\rightleftarrows`,!0),H(U,K,J,`↠`,`\\twoheadrightarrow`,!0),H(U,K,J,`↣`,`\\rightarrowtail`,!0),H(U,K,J,`↬`,`\\looparrowright`,!0),H(U,K,J,`↷`,`\\curvearrowright`,!0),H(U,K,J,`↻`,`\\circlearrowright`,!0),H(U,K,J,`↱`,`\\Rsh`,!0),H(U,K,J,`⇊`,`\\downdownarrows`,!0),H(U,K,J,`↾`,`\\upharpoonright`,!0),H(U,K,J,`⇂`,`\\downharpoonright`,!0),H(U,K,J,`⇝`,`\\rightsquigarrow`,!0),H(U,K,J,`⇝`,`\\leadsto`),H(U,K,J,`⇛`,`\\Rrightarrow`,!0),H(U,K,J,`↾`,`\\restriction`),H(U,G,Y,`‘`,"`"),H(U,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\textdollar`),H(U,G,Y,`%`,`\\%`),H(W,G,Y,`%`,`\\%`),H(U,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\textunderscore`),H(U,G,Y,`∠`,`\\angle`,!0),H(U,G,Y,`∞`,`\\infty`,!0),H(U,G,Y,`′`,`\\prime`),H(U,G,Y,`△`,`\\triangle`),H(U,G,Y,`Γ`,`\\Gamma`,!0),H(U,G,Y,`Δ`,`\\Delta`,!0),H(U,G,Y,`Θ`,`\\Theta`,!0),H(U,G,Y,`Λ`,`\\Lambda`,!0),H(U,G,Y,`Ξ`,`\\Xi`,!0),H(U,G,Y,`Π`,`\\Pi`,!0),H(U,G,Y,`Σ`,`\\Sigma`,!0),H(U,G,Y,`Υ`,`\\Upsilon`,!0),H(U,G,Y,`Φ`,`\\Phi`,!0),H(U,G,Y,`Ψ`,`\\Psi`,!0),H(U,G,Y,`Ω`,`\\Omega`,!0),H(U,G,Y,`A`,`Α`),H(U,G,Y,`B`,`Β`),H(U,G,Y,`E`,`Ε`),H(U,G,Y,`Z`,`Ζ`),H(U,G,Y,`H`,`Η`),H(U,G,Y,`I`,`Ι`),H(U,G,Y,`K`,`Κ`),H(U,G,Y,`M`,`Μ`),H(U,G,Y,`N`,`Ν`),H(U,G,Y,`O`,`Ο`),H(U,G,Y,`P`,`Ρ`),H(U,G,Y,`T`,`Τ`),H(U,G,Y,`X`,`Χ`),H(U,G,Y,`¬`,`\\neg`,!0),H(U,G,Y,`¬`,`\\lnot`),H(U,G,Y,`⊤`,`\\top`),H(U,G,Y,`⊥`,`\\bot`),H(U,G,Y,`∅`,`\\emptyset`),H(U,K,Y,`∅`,`\\varnothing`),H(U,G,PU,`α`,`\\alpha`,!0),H(U,G,PU,`β`,`\\beta`,!0),H(U,G,PU,`γ`,`\\gamma`,!0),H(U,G,PU,`δ`,`\\delta`,!0),H(U,G,PU,`ϵ`,`\\epsilon`,!0),H(U,G,PU,`ζ`,`\\zeta`,!0),H(U,G,PU,`η`,`\\eta`,!0),H(U,G,PU,`θ`,`\\theta`,!0),H(U,G,PU,`ι`,`\\iota`,!0),H(U,G,PU,`κ`,`\\kappa`,!0),H(U,G,PU,`λ`,`\\lambda`,!0),H(U,G,PU,`μ`,`\\mu`,!0),H(U,G,PU,`ν`,`\\nu`,!0),H(U,G,PU,`ξ`,`\\xi`,!0),H(U,G,PU,`ο`,`\\omicron`,!0),H(U,G,PU,`π`,`\\pi`,!0),H(U,G,PU,`ρ`,`\\rho`,!0),H(U,G,PU,`σ`,`\\sigma`,!0),H(U,G,PU,`τ`,`\\tau`,!0),H(U,G,PU,`υ`,`\\upsilon`,!0),H(U,G,PU,`ϕ`,`\\phi`,!0),H(U,G,PU,`χ`,`\\chi`,!0),H(U,G,PU,`ψ`,`\\psi`,!0),H(U,G,PU,`ω`,`\\omega`,!0),H(U,G,PU,`ε`,`\\varepsilon`,!0),H(U,G,PU,`ϑ`,`\\vartheta`,!0),H(U,G,PU,`ϖ`,`\\varpi`,!0),H(U,G,PU,`ϱ`,`\\varrho`,!0),H(U,G,PU,`ς`,`\\varsigma`,!0),H(U,G,PU,`φ`,`\\varphi`,!0),H(U,G,q,`∗`,`*`,!0),H(U,G,q,`+`,`+`),H(U,G,q,`−`,`-`,!0),H(U,G,q,`⋅`,`\\cdot`,!0),H(U,G,q,`∘`,`\\circ`,!0),H(U,G,q,`÷`,`\\div`,!0),H(U,G,q,`±`,`\\pm`,!0),H(U,G,q,`×`,`\\times`,!0),H(U,G,q,`∩`,`\\cap`,!0),H(U,G,q,`∪`,`\\cup`,!0),H(U,G,q,`∖`,`\\setminus`,!0),H(U,G,q,`∧`,`\\land`),H(U,G,q,`∨`,`\\lor`),H(U,G,q,`∧`,`\\wedge`,!0),H(U,G,q,`∨`,`\\vee`,!0),H(U,G,Y,`√`,`\\surd`),H(U,G,IU,`⟨`,`\\langle`,!0),H(U,G,IU,`∣`,`\\lvert`),H(U,G,IU,`∥`,`\\lVert`),H(U,G,MU,`?`,`?`),H(U,G,MU,`!`,`!`),H(U,G,MU,`⟩`,`\\rangle`,!0),H(U,G,MU,`∣`,`\\rvert`),H(U,G,MU,`∥`,`\\rVert`),H(U,G,J,`=`,`=`),H(U,G,J,`:`,`:`),H(U,G,J,`≈`,`\\approx`,!0),H(U,G,J,`≅`,`\\cong`,!0),H(U,G,J,`≥`,`\\ge`),H(U,G,J,`≥`,`\\geq`,!0),H(U,G,J,`←`,`\\gets`),H(U,G,J,`>`,`\\gt`,!0),H(U,G,J,`∈`,`\\in`,!0),H(U,G,J,``,`\\@not`),H(U,G,J,`⊂`,`\\subset`,!0),H(U,G,J,`⊃`,`\\supset`,!0),H(U,G,J,`⊆`,`\\subseteq`,!0),H(U,G,J,`⊇`,`\\supseteq`,!0),H(U,K,J,`⊈`,`\\nsubseteq`,!0),H(U,K,J,`⊉`,`\\nsupseteq`,!0),H(U,G,J,`⊨`,`\\models`),H(U,G,J,`←`,`\\leftarrow`,!0),H(U,G,J,`≤`,`\\le`),H(U,G,J,`≤`,`\\leq`,!0),H(U,G,J,`<`,`\\lt`,!0),H(U,G,J,`→`,`\\rightarrow`,!0),H(U,G,J,`→`,`\\to`),H(U,K,J,`≱`,`\\ngeq`,!0),H(U,K,J,`≰`,`\\nleq`,!0),H(U,G,RU,`\xA0`,`\\ `),H(U,G,RU,`\xA0`,`\\space`),H(U,G,RU,`\xA0`,`\\nobreakspace`),H(W,G,RU,`\xA0`,`\\ `),H(W,G,RU,`\xA0`,` `),H(W,G,RU,`\xA0`,`\\space`),H(W,G,RU,`\xA0`,`\\nobreakspace`),H(U,G,RU,``,`\\nobreak`),H(U,G,RU,``,`\\allowbreak`),H(U,G,LU,`,`,`,`),H(U,G,LU,`;`,`;`),H(U,K,q,`⊼`,`\\barwedge`,!0),H(U,K,q,`⊻`,`\\veebar`,!0),H(U,G,q,`⊙`,`\\odot`,!0),H(U,G,q,`⊕`,`\\oplus`,!0),H(U,G,q,`⊗`,`\\otimes`,!0),H(U,G,Y,`∂`,`\\partial`,!0),H(U,G,q,`⊘`,`\\oslash`,!0),H(U,K,q,`⊚`,`\\circledcirc`,!0),H(U,K,q,`⊡`,`\\boxdot`,!0),H(U,G,q,`△`,`\\bigtriangleup`),H(U,G,q,`▽`,`\\bigtriangledown`),H(U,G,q,`†`,`\\dagger`),H(U,G,q,`⋄`,`\\diamond`),H(U,G,q,`⋆`,`\\star`),H(U,G,q,`◃`,`\\triangleleft`),H(U,G,q,`▹`,`\\triangleright`),H(U,G,IU,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,MU,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,IU,`{`,`\\lbrace`),H(U,G,MU,`}`,`\\rbrace`),H(U,G,IU,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,MU,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,IU,`(`,`\\lparen`,!0),H(U,G,MU,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,IU,`⌊`,`\\lfloor`,!0),H(U,G,MU,`⌋`,`\\rfloor`,!0),H(U,G,IU,`⌈`,`\\lceil`,!0),H(U,G,MU,`⌉`,`\\rceil`,!0),H(U,G,Y,`\\`,`\\backslash`),H(U,G,Y,`∣`,`|`),H(U,G,Y,`∣`,`\\vert`),H(W,G,Y,`|`,`\\textbar`,!0),H(U,G,Y,`∥`,`\\|`),H(U,G,Y,`∥`,`\\Vert`),H(W,G,Y,`∥`,`\\textbardbl`),H(W,G,Y,`~`,`\\textasciitilde`),H(W,G,Y,`\\`,`\\textbackslash`),H(W,G,Y,`^`,`\\textasciicircum`),H(U,G,J,`↑`,`\\uparrow`,!0),H(U,G,J,`⇑`,`\\Uparrow`,!0),H(U,G,J,`↓`,`\\downarrow`,!0),H(U,G,J,`⇓`,`\\Downarrow`,!0),H(U,G,J,`↕`,`\\updownarrow`,!0),H(U,G,J,`⇕`,`\\Updownarrow`,!0),H(U,G,FU,`∐`,`\\coprod`),H(U,G,FU,`⋁`,`\\bigvee`),H(U,G,FU,`⋀`,`\\bigwedge`),H(U,G,FU,`⨄`,`\\biguplus`),H(U,G,FU,`⋂`,`\\bigcap`),H(U,G,FU,`⋃`,`\\bigcup`),H(U,G,FU,`∫`,`\\int`),H(U,G,FU,`∫`,`\\intop`),H(U,G,FU,`∬`,`\\iint`),H(U,G,FU,`∭`,`\\iiint`),H(U,G,FU,`∏`,`\\prod`),H(U,G,FU,`∑`,`\\sum`),H(U,G,FU,`⨂`,`\\bigotimes`),H(U,G,FU,`⨁`,`\\bigoplus`),H(U,G,FU,`⨀`,`\\bigodot`),H(U,G,FU,`∮`,`\\oint`),H(U,G,FU,`∯`,`\\oiint`),H(U,G,FU,`∰`,`\\oiiint`),H(U,G,FU,`⨆`,`\\bigsqcup`),H(U,G,FU,`∫`,`\\smallint`),H(W,G,NU,`…`,`\\textellipsis`),H(U,G,NU,`…`,`\\mathellipsis`),H(W,G,NU,`…`,`\\ldots`,!0),H(U,G,NU,`…`,`\\ldots`,!0),H(U,G,NU,`⋯`,`\\@cdots`,!0),H(U,G,NU,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,jU,`ˊ`,`\\acute`),H(U,G,jU,`ˋ`,`\\grave`),H(U,G,jU,`¨`,`\\ddot`),H(U,G,jU,`~`,`\\tilde`),H(U,G,jU,`ˉ`,`\\bar`),H(U,G,jU,`˘`,`\\breve`),H(U,G,jU,`ˇ`,`\\check`),H(U,G,jU,`^`,`\\hat`),H(U,G,jU,`⃗`,`\\vec`),H(U,G,jU,`˙`,`\\dot`),H(U,G,jU,`˚`,`\\mathring`),H(U,G,PU,``,`\\@imath`),H(U,G,PU,``,`\\@jmath`),H(U,G,Y,`ı`,`ı`),H(U,G,Y,`ȷ`,`ȷ`),H(W,G,Y,`ı`,`\\i`,!0),H(W,G,Y,`ȷ`,`\\j`,!0),H(W,G,Y,`ß`,`\\ss`,!0),H(W,G,Y,`æ`,`\\ae`,!0),H(W,G,Y,`œ`,`\\oe`,!0),H(W,G,Y,`ø`,`\\o`,!0),H(W,G,Y,`Æ`,`\\AE`,!0),H(W,G,Y,`Œ`,`\\OE`,!0),H(W,G,Y,`Ø`,`\\O`,!0),H(W,G,jU,`ˊ`,`\\'`),H(W,G,jU,`ˋ`,"\\`"),H(W,G,jU,`ˆ`,`\\^`),H(W,G,jU,`˜`,`\\~`),H(W,G,jU,`ˉ`,`\\=`),H(W,G,jU,`˘`,`\\u`),H(W,G,jU,`˙`,`\\.`),H(W,G,jU,`¸`,`\\c`),H(W,G,jU,`˚`,`\\r`),H(W,G,jU,`ˇ`,`\\v`),H(W,G,jU,`¨`,`\\"`),H(W,G,jU,`˝`,`\\H`),H(W,G,jU,`◯`,`\\textcircled`);var zU={"--":!0,"---":!0,"``":!0,"''":!0};H(W,G,Y,`–`,`--`,!0),H(W,G,Y,`–`,`\\textendash`),H(W,G,Y,`—`,`---`,!0),H(W,G,Y,`—`,`\\textemdash`),H(W,G,Y,`‘`,"`",!0),H(W,G,Y,`‘`,`\\textquoteleft`),H(W,G,Y,`’`,`'`,!0),H(W,G,Y,`’`,`\\textquoteright`),H(W,G,Y,`“`,"``",!0),H(W,G,Y,`“`,`\\textquotedblleft`),H(W,G,Y,`”`,`''`,!0),H(W,G,Y,`”`,`\\textquotedblright`),H(U,G,Y,`°`,`\\degree`,!0),H(W,G,Y,`°`,`\\degree`),H(W,G,Y,`°`,`\\textdegree`,!0),H(U,G,Y,`£`,`\\pounds`),H(U,G,Y,`£`,`\\mathsterling`,!0),H(W,G,Y,`£`,`\\pounds`),H(W,G,Y,`£`,`\\textsterling`,!0),H(U,K,Y,`✠`,`\\maltese`),H(W,K,Y,`✠`,`\\maltese`);for(var BU=`0123456789/@."`,VU=0;VU<BU.length;VU++){var HU=BU.charAt(VU);H(U,G,Y,HU,HU)}for(var UU=`0123456789!@*()-=+";:?/.,`,WU=0;WU<UU.length;WU++){var GU=UU.charAt(WU);H(W,G,Y,GU,GU)}for(var KU=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,qU=0;qU<KU.length;qU++){var JU=KU.charAt(qU);H(U,G,PU,JU,JU),H(W,G,Y,JU,JU)}H(U,K,Y,`C`,`ℂ`),H(W,K,Y,`C`,`ℂ`),H(U,K,Y,`H`,`ℍ`),H(W,K,Y,`H`,`ℍ`),H(U,K,Y,`N`,`ℕ`),H(W,K,Y,`N`,`ℕ`),H(U,K,Y,`P`,`ℙ`),H(W,K,Y,`P`,`ℙ`),H(U,K,Y,`Q`,`ℚ`),H(W,K,Y,`Q`,`ℚ`),H(U,K,Y,`R`,`ℝ`),H(W,K,Y,`R`,`ℝ`),H(U,K,Y,`Z`,`ℤ`),H(W,K,Y,`Z`,`ℤ`),H(U,G,PU,`h`,`ℎ`),H(W,G,PU,`h`,`ℎ`);for(var YU,XU=0;XU<KU.length;XU++){var ZU=KU.charAt(XU);YU=String.fromCharCode(55349,56320+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56372+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56424+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56580+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56684+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56736+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56788+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56840+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56944+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),XU<26&&(YU=String.fromCharCode(55349,56632+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU),YU=String.fromCharCode(55349,56476+XU),H(U,G,PU,ZU,YU),H(W,G,Y,ZU,YU))}YU=String.fromCharCode(55349,56668),H(U,G,PU,`k`,YU),H(W,G,Y,`k`,YU);for(var QU=0;QU<10;QU++){var $U=QU.toString();YU=String.fromCharCode(55349,57294+QU),H(U,G,PU,$U,YU),H(W,G,Y,$U,YU),YU=String.fromCharCode(55349,57314+QU),H(U,G,PU,$U,YU),H(W,G,Y,$U,YU),YU=String.fromCharCode(55349,57324+QU),H(U,G,PU,$U,YU),H(W,G,Y,$U,YU),YU=String.fromCharCode(55349,57334+QU),H(U,G,PU,$U,YU),H(W,G,Y,$U,YU)}for(var eW=`ÐÞþ`,tW=0;tW<eW.length;tW++){var nW=eW.charAt(tW);H(U,G,PU,nW,nW),H(W,G,Y,nW,nW)}var rW={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},iW={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},aW={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},oW={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},sW={mathClass:``,textClass:``,font:``},cW={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},lW={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},uW={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},dW={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},fW={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},pW={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},mW={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},hW=[rW,rW,iW,iW,aW,aW,oW,sW,sW,sW,cW,cW,lW,lW,uW,uW,dW,dW,fW,fW,pW,pW,sW,sW,mW,mW],gW=[rW,sW,dW,fW,mW],_W=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return hW[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return gW[Math.floor((r-120782)/10)];if(r===120485||r===120486)return hW[0];if(120486<r&&r<120782)return sW;throw new B(`Unsupported character: `+e)},vW=function(e,t,n){if(AU[n][e]){var r=AU[n][e].replace;r&&(e=r)}return{value:e,metrics:DU(e,t,n)}},yW=function(e,t,n,r,i){var a=vW(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new gU(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new gU(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},bW=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&vW(e,`Main-Bold`,t).metrics?yW(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||AU[t][e].font===`main`?yW(e,`Main-Regular`,t,n,r):yW(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},xW=function(e,t,n){return n!==`textord`&&vW(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},SW=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=_W(i);f=m.font,p=m[r+`Class`]}if(f)return yW(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=xW(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=FW[o].fontName,g=[o]):(h=PW(s,c,l),g=[s,c,l]);if(vW(i,h,r).metrics)return yW(i,h,r,t,a.concat(g));if(zU.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(yW(i[y],h,r,t,a.concat(g)));return kW(v)}}if(n===`mathord`)return yW(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=AU[r][i]&&AU[r][i].font;if(b===`ams`)return yW(i,PW(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return yW(i,PW(`textrm`,c,l),r,t,a.concat(c,l));var x=PW(b,c,l);return yW(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},CW=(e,t)=>{if(oU(e.classes)!==oU(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},wW=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof gU&&r instanceof gU&&CW(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},TW=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new fU(e,t,n,r);return TW(i),i},EW=(e,t,n,r)=>new fU(e,t,n,r),DW=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=V(r.height),r.maxFontSize=1,r},OW=function(e,t,n,r){var i=new pU(e,t,n,r);return TW(i),i},kW=function(e){var t=new tU(e);return TW(t),t},AW=function(e,t){return e instanceof tU?X([],[e],t):e},jW=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},MW=function(e,t){for(var{children:n,depth:r}=jW(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=X([`pstrut`],[]);c.style.height=V(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=X(g,[c,h],void 0,_);v.style.top=V(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=X([`vlist`],l);y.style.height=V(d);var b;if(u<0){var x=X([`vlist`],[X([],[])]);x.style.height=V(-u),b=[X([`vlist-r`],[y,X([`vlist-s`],[new gU(`​`)])]),X([`vlist-r`],[x])]}else b=[X([`vlist-r`],[y])];var S=X([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},NW=(e,t)=>{var n=X([`mspace`],[],t),r=aU(e,t);return n.style.marginRight=V(r),n},PW=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},FW={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},IW={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},LW=function(e,t){var[n,r,i]=IW[e],a=EW([`overlay`],[new _U([new vU(n)],{width:V(r),height:V(i),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=V(i),a.style.width=V(r),a},RW={number:3,unit:`mu`},zW={number:4,unit:`mu`},BW={number:5,unit:`mu`},VW={mord:{mop:RW,mbin:zW,mrel:BW,minner:RW},mop:{mord:RW,mop:RW,mrel:BW,minner:RW},mbin:{mord:zW,mop:zW,mopen:zW,minner:zW},mrel:{mord:BW,mop:BW,mopen:BW,minner:BW},mopen:{},mclose:{mop:RW,mbin:zW,mrel:BW,minner:RW},mpunct:{mord:RW,mop:RW,mrel:BW,mopen:RW,mclose:RW,mpunct:RW,minner:RW},minner:{mord:RW,mop:RW,mbin:zW,mrel:BW,mopen:RW,mpunct:RW,minner:RW}},HW={mord:{mop:RW},mop:{mord:RW,mop:RW},mbin:{},mrel:{},mopen:{},mclose:{mop:RW},mpunct:{},minner:{mop:RW}},UW={},WW={},GW={};function Z(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)UW[n[c]]=s;t&&(a&&(WW[t]=a),o&&(GW[t]=o))}function KW(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Z({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var qW=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},JW=function(e){return e.type===`ordgroup`?e.body:[e]},YW=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),XW=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),ZW={display:IH.DISPLAY,text:IH.TEXT,script:IH.SCRIPT,scriptscript:IH.SCRIPTSCRIPT},QW={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},$W=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=aG(e[a],t);if(o instanceof tU){var s=o.children;i.push(...s)}else i.push(o)}if(wW(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(ZW[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return eG(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&XW.has(r)?t.classes[0]=`mord`:r===`mbin`&&YW.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),eG(i,(e,t)=>{var n=rG(t),r=rG(e),i=n&&r?e.hasClass(`mtight`)?HW[n]?.[r]:VW[n]?.[r]:null;if(i)return NW(i,c)},{node:u},d,f),i},eG=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=tG(o);if(s){eG(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},tG=function(e){return e instanceof tU||e instanceof pU||e instanceof fU&&e.hasClass(`enclosing`)?e:null},nG=function(e,t){var n=tG(e);if(n){var r=n.children;if(r.length){if(t===`right`)return nG(r[r.length-1],`right`);if(t===`left`)return nG(r[0],`left`)}}return e},rG=function(e,t){return e?(t&&(e=nG(e,t)),QW[e.classes[0]]||null):null},iG=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},aG=function(e,t,n){if(!e)return X();if(WW[e.type]){var r=WW[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function oG(e,t){var n=X([`base`],e,t),r=X([`strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function sG(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=$W(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(oG(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(oG(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(oG(o,t));var l;n?(l=oG($W(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=V(u.height+u.depth),u.depth&&(d.style.verticalAlign=V(-u.depth))}return u}function cG(e){return new tU(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=oU(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof lG&&this.children[n+1]instanceof lG){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof lG;)r+=this.children[++n].toText();e.appendChild(new lG(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=uH(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+uH(oU(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},lG=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return uH(this.toText())}toText(){return this.text}},uG=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,V(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+V(this.width)+`"/>`}toText(){return this.character?this.character:` `}},dG=new Set([`\\imath`,`\\jmath`]),fG=new Set([`mrow`,`mtable`]),pG=function(e,t,n){return AU[t][e]&&AU[t][e].replace&&e.charCodeAt(0)!==55349&&!(zU.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=AU[t][e].replace),new lG(e)},mG=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},hG={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},gG=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=hG[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(dG.has(a))return null;if(AU[r][a]){var o=AU[r][a].replace;o&&(a=o)}var s=FW[n].fontName;return DU(a,s,r)?FW[n].variant:null};function _G(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof lG&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof lG&&n.text===`,`}return!1}var vG=function(e,t,n){if(e.length===1){var r=bG(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=bG(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}if(_G(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&_G(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||_G(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof lG&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof lG&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},yG=function(e,t,n){return mG(vG(e,t,n))},bG=function(e,t){if(!e)return new Q(`mrow`);if(GW[e.type])return GW[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function xG(e,t,n,r,i){var a=vG(e,n),o=a.length===1&&a[0]instanceof Q&&fG.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new lG(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var SG=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],CG=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],wG=function(e,t){return t.size<2?e:SG[e-1][t.size-1]},TG=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=CG[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:wG(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:CG[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=wG(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=kU(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};TG.BASESIZE=6;var EG=function(e){return new TG({style:e.displayMode?IH.DISPLAY:IH.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},DG=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},OG=function(e,t,n){var r=EG(n),i;return n.output===`mathml`?xG(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[sG(e,r)]):X([`katex`],[xG(e,t,r,n.displayMode,!1),sG(e,r)]),DG(i,n))},kG=function(e,t,n){return DG(X([`katex`],[sG(e,EG(n))]),n)},AG={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},jG=function(e){var t=new Q(`mo`,[new lG(AG[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},MG={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},NG=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),PG=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(NG.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:EW([],[new _U([new vU(o)],{width:`100%`,height:V(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=MG[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
529
+ `+h+` children.`);for(var v=0;v<h;v++){var y=new _U([new vU(d[v])],{width:`400em`,height:V(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=EW([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=V(m),l.push(b)}return{span:X([`stretchy`],l,t),minWidth:f,height:m}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=V(a),i>0&&(r.style.minWidth=V(i)),r},FG=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new yU({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new yU({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=EW([],[new _U(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a},IG={bin:1,close:1,inner:1,open:1,punct:1,rel:1},LG={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function RG(e){return e in IG}function zG(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function BG(e){var t=VG(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function VG(e){return e&&(e.type===`atom`||LG.hasOwnProperty(e.type))?e:null}var HG=e=>{if(e instanceof gU)return e;if(SU(e)&&e.children.length===1)return HG(e.children[0])},UG=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=zG(e.base,`accent`),n=r.base,e.base=n,i=xU(aG(e,t)),e.base=r):(r=zG(e,`accent`),n=r.base);var a=aG(n,t.havingCrampedStyle()),o=r.isShifty&&pH(n),s=0;o&&(s=HG(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=PG(r,t),u=MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+V(2*s)+`)`,marginLeft:V(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=LW(`vec`,t),f=IW.vec[1]):(d=SW({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=bU(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=V(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},WG=(e,t)=>{var n=e.isStretchy?jG(e.label):new Q(`mo`,[pG(e.label,e.mode)]),r=new Q(`mover`,[bG(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},GG=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=qW(t[0]),r=!GG.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:UG,mathmlBuilder:WG}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:UG,mathmlBuilder:WG}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=aG(e.base,t),r=PG(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[MW({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=jG(e.label),r=new Q(`munder`,[bG(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var KG=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=AW(aG(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=AW(aG(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=PG(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=MW({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=MW({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=jG(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=KG(bG(e.body,t));r=e.below?new Q(`munderover`,[n,KG(bG(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,KG(bG(e.below,t))]):(r=KG(),r=new Q(`mover`,[n,r]));return r}});function qG(e,t){var n=$W(e.body,t,!0);return X([e.mclass],n,t)}function JG(e,t){var n,r=vG(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:JW(i),isCharacterBox:pH(i)}},htmlBuilder:qG,mathmlBuilder:JG});var YG=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:YG(t[0]),body:JW(t[1]),isCharacterBox:pH(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:YG(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:JW(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:pH(c)}},htmlBuilder:qG,mathmlBuilder:JG}),Z({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:YG(t[0]),body:JW(t[0])}},htmlBuilder(e,t){var n=$W(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,vG(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var XG={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},ZG=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),QG=e=>e.type===`textord`&&e.text===`@`,$G=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function eK(e,t,n){var r=XG[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function tK(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=ZG(),c=0;c<o.length;c++)if(!QG(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=BG(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if($G(o[p],l)){f=!1,c=p;break}if(QG(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[eK(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=ZG()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=AW(aG(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=V(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[bG(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=AW(aG(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[bG(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=zG(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=zG(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new B(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new B(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var nK=(e,t)=>kW($W(e.body,t.withColor(e.color),!1)),rK=(e,t)=>{var n=new Q(`mstyle`,vG(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};Z({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=zG(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:JW(i)}},htmlBuilder:nK,mathmlBuilder:rK}),Z({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=zG(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:nK,mathmlBuilder:rK}),Z({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&zG(i,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=V(aU(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,V(aU(e.size,t)))),n}});var iK={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},aK=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},oK=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},sK=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(iK[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=iK[r.text]),zG(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===iK[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=aK(t.gullet.popToken());return t.gullet.consumeSpaces(),sK(t,r,oK(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=aK(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return sK(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var cK=function(e,t,n){var r=DU(AU.math[e]&&AU.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},lK=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},uK=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=V(i),e.height-=i,e.depth+=i},dK=function(e,t,n,r,i,a){var o=lK(yW(e,`Main-Regular`,i,r),t,r,a);return n&&uK(o,r,t),o},fK=function(e,t,n,r){return yW(e,`Size`+t+`-Regular`,n,r)},pK=function(e,t,n,r,i,a){var o=fK(e,t,i,r),s=lK(X([`delimsizing`,`size`+t],[o],r),IH.TEXT,r,a);return n&&uK(s,r,IH.TEXT),s},mK=function(e,t,n){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[yW(e,t,n)])])}},hK=function(e,t,n){var r=CU[`Size4-Regular`][e.charCodeAt(0)]?CU[`Size4-Regular`][e.charCodeAt(0)][4]:CU[`Size1-Regular`][e.charCodeAt(0)][4],i=EW([],[new _U([new vU(`inner`,ZH(e,Math.round(1e3*t)))],{width:V(r),height:V(t),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=V(t),i.style.width=V(r),{type:`elem`,elem:i}},gK=.008,_K={type:`kern`,size:-1*gK},vK=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),yK=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),bK=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):vK.has(e)?(c=`∣`,u=`vert`,d=333):yK.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=cK(o,f,i),m=p.height+p.depth,h=cK(c,f,i),g=h.height+h.depth,_=cK(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=cK(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var ee=C-m-v,D=Math.round(C*1e3),te=$H(u,Math.round(ee*1e3)),O=new vU(u,te),ne=V(d/1e3),re=V(D/1e3),ie=EW([],[new _U([O],{width:ne,height:re,viewBox:`0 0 `+d+` `+D})],r);ie.height=D/1e3,ie.style.width=ne,ie.style.height=re,E.push({type:`elem`,elem:ie})}else{if(E.push(mK(l,f,i)),E.push(_K),s===null){var ae=C-m-v+2*gK;E.push(hK(c,ae,r))}else{var oe=(C-m-v-y)/2+2*gK;E.push(hK(c,oe,r)),E.push(_K),E.push(mK(s,f,i)),E.push(_K),E.push(hK(c,oe,r))}E.push(_K),E.push(mK(o,f,i))}var k=r.havingBaseStyle(IH.TEXT);return lK(X([`delimsizing`,`mult`],[MW({positionType:`bottom`,positionData:T,children:E})],k),IH.TEXT,r,a)},xK=80,SK=.08,CK=function(e,t,n,r,i){return EW([`hide-tail`],[new _U([new vU(e,XH(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},wK=function(e,t){var n=t.havingBaseSizing(),r=PK(`\\surd`,e*n.sizeMultiplier,MK,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+xK,e<1?i=1:e<1.4&&(i=.7),s=(1+a+SK)/i,c=(1+a)/i,o=CK(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+xK)*OK[r.size],c=(OK[r.size]+a)/i,s=(OK[r.size]+a+SK)/i,o=CK(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+SK,c=e+a,l=Math.floor(1e3*e+a)+xK,o=CK(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=V(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},TK=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),EK=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),DK=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),OK=[0,1.2,1.8,2.4,3],kK=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),TK.has(e)||DK.has(e))return pK(e,t,!1,n,r,i);if(EK.has(e))return bK(e,OK[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},AK=[{type:`small`,style:IH.SCRIPTSCRIPT},{type:`small`,style:IH.SCRIPT},{type:`small`,style:IH.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],jK=[{type:`small`,style:IH.SCRIPTSCRIPT},{type:`small`,style:IH.SCRIPT},{type:`small`,style:IH.TEXT},{type:`stack`}],MK=[{type:`small`,style:IH.SCRIPTSCRIPT},{type:`small`,style:IH.SCRIPT},{type:`small`,style:IH.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],NK=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},PK=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=cK(e,NK(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},FK=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=DK.has(e)?AK:TK.has(e)?MK:jK,s=PK(e,t,o,r);return s.type===`small`?dK(e,s.style,n,r,i,a):s.type===`large`?pK(e,s.size,n,r,i,a):bK(e,t,n,r,i,a)},IK=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return FK(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},LK={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},RK=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function zK(e){return`isMiddle`in e}function BK(e,t){var n=VG(e);if(n&&RK.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=BK(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:LK[e.funcName].size,mclass:LK[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):kK(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(pG(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=V(OK[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function VK(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:BK(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=BK(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=zG(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{VK(e);for(var n=$W(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];zK(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?iG(t,[`mopen`]):IK(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(zK(u)){var d=u.isMiddle;n[l]=IK(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=iG(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=IK(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{VK(e);var n=vG(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[pG(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[pG(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return mG(n)}}),Z({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=BK(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=iG(t,[]):(n=kK(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?pG(`|`,`text`):pG(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var HK=(e,t)=>{var n=AW(aG(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=pH(e.body);if(r===`sout`)a=X([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=aU({number:.6,unit:`pt`},t),l=aU({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=V(d/2+c);var f=Math.floor(1e3*d*i);a=EW([`hide-tail`],[new _U([new vU(`phase`,JH(f))],{width:`400em`,height:V(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=V(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=FG(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=V(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=V(h),a.style.borderRightWidth=V(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=MW({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=MW({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},UK=(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[bG(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+V(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};Z({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=zG(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:HK,mathmlBuilder:UK}),Z({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=zG(t[0],`color-token`).color,o=zG(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:HK,mathmlBuilder:UK}),Z({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:HK,mathmlBuilder:UK}),Z({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:HK,mathmlBuilder:UK}),Z({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var WK={};function GK(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)WK[n[c]]=s;a&&(WW[t]=a),o&&(GW[t]=o)}var KK={};function $(e,t){KK[e]=t}var qK=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},JK=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,qK.range(this,t))}};function YK(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var XK=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},ZK=new Set([`gather`,`gather*`]);function QK(e){if(!e.includes(`ed`))return!e.includes(`*`)}function $K(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new JK(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(YK(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(YK(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function eq(e){return e.slice(0,1)===`d`?`display`:`text`}var tq=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(IH.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?aU({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=aG(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=aU(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,ee=e.cols||[],D=[],te,O,ne=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var re=s[n],ie=re.pos-E,ae=e.tags[n],oe=void 0;oe=ae===!0?X([`eqn-num`],[],t):ae===!1?X([],[],t):X([],$W(ae,t,!0),t),oe.depth=re.depth,oe.height=re.height,ne.push({type:`elem`,elem:oe,shift:ie})}for(r=0,O=0;r<o||O<ee.length;++r,++O){for(var k=ee[O],A=!0;(se=k)?.type===`separator`;){var se;if(A||(te=X([`arraycolsep`],[]),te.style.width=V(t.fontMetrics().doubleRuleSep),D.push(te)),k.separator===`|`||k.separator===`:`){var ce=k.separator===`|`?`solid`:`dashed`,le=X([`vertical-separator`],[],t);le.style.height=V(_),le.style.borderRightWidth=V(l),le.style.borderRightStyle=ce,le.style.margin=`0 `+V(-l/2);var ue=_-E;ue&&(le.style.verticalAlign=V(-ue)),D.push(le)}else throw new B(`Invalid separator type: `+k.separator);O++,k=ee[O],A=!1}if(!(r>=o)){var de=void 0;(r>0||e.hskipBeforeAndAfter)&&(de=k?.pregap??d,de!==0&&(te=X([`arraycolsep`],[]),te.style.width=V(de),D.push(te)));var fe=[];for(n=0;n<i;++n){var pe=s[n],me=pe.cells[r];if(me){var he=pe.pos-E;me.depth=pe.depth,me.height=pe.height,fe.push({type:`elem`,elem:me,shift:he})}}var ge=MW({positionType:`individualShift`,children:fe}),_e=X([`col-align-`+(k?.align||`c`)],[ge]);D.push(_e),(r<o-1||e.hskipBeforeAndAfter)&&(de=k?.postgap??d,de!==0&&(te=X([`arraycolsep`],[]),te.style.width=V(de),D.push(te)))}}var ve=X([`mtable`],D);if(c.length>0){for(var ye=DW(`hline`,t,l),be=DW(`hdashline`,t,l),xe=[{type:`elem`,elem:ve,shift:0}];c.length>0;){var Se=c.pop(),Ce=Se.pos-E;Se.isDashed?xe.push({type:`elem`,elem:be,shift:Ce}):xe.push({type:`elem`,elem:ye,shift:Ce})}ve=MW({positionType:`individualShift`,children:xe})}if(ne.length===0)return X([`mord`],[ve],t);var we=X([`tag`],[MW({positionType:`individualShift`,children:ne})],t);return kW([ve,we])},nq={c:`center `,l:`left `,r:`right `},rq=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[bG(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,V(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=nq[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},iq=function(e,t){e.envName.includes(`ed`)||XK(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=$K(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:QK(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=zG(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)zG(zG(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new B(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};GK({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(VG(t[0])?[t[0]]:zG(t[0],`ordgroup`).body).map(function(e){var t=BG(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return $K(e.parser,r,eq(e.envName))},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=$K(e.parser,r,eq(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=$K(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(VG(t[0])?[t[0]]:zG(t[0],`ordgroup`).body).map(function(e){var t=BG(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=$K(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=$K(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},eq(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:iq,htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){ZK.has(e.envName)&&XK(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:QK(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return $K(e.parser,t,`display`)},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:iq,htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){XK(e);var t={autoTag:QK(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return $K(e.parser,t,`display`)},htmlBuilder:tq,mathmlBuilder:rq}),GK({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return XK(e),tK(e.parser)},htmlBuilder:tq,mathmlBuilder:rq}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var aq=WK;Z({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=zG(i.body[o],`textord`).text;if(r===`\\begin`){if(!aq.hasOwnProperty(a))throw new B(`No such environment: `+a,i);var s=aq[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=zG(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var oq=(e,t)=>{var n=e.font,r=t.withFont(n);return aG(e.body,r)},sq=(e,t)=>{var n=e.font,r=t.withFont(n);return bG(e.body,r)},cq={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=qW(t[0]),a=r;return a in cq&&(a=cq[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:oq,mathmlBuilder:sq}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:YG(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:pH(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:oq,mathmlBuilder:sq});var lq=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=aG(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=aG(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=aU(e.barSize,t),u=DW(`frac-line`,t,d)):u=DW(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===IH.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=MW({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=MW({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===IH.DISPLAY.size?t.fontMetrics().delim1:n.size===IH.SCRIPTSCRIPT.size?t.havingStyle(IH.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?iG(t,[`mopen`]):FK(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?iG(t,[`mclose`]):FK(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},uq=(e,t)=>{var n=new Q(`mfrac`,[bG(e.numer,t),bG(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=aU(e.barSize,t);n.setAttribute(`linethickness`,V(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new lG(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new lG(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return mG(i)}return n},dq=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),dq({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:lq,mathmlBuilder:uq}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var fq=[`display`,`text`,`script`,`scriptscript`],pq=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=qW(t[0]),o=a.type===`atom`&&a.family===`open`?pq(a.text):null,s=qW(t[1]),c=s.type===`atom`&&s.family===`close`?pq(s.text):null,l=zG(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=zG(p.body[0],`textord`);f=fq[Number(m.text)]}}else p=zG(p,`textord`),f=fq[Number(p.text)];return dq({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:zG(t[0],`size`).value,token:i}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=zG(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var mq=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?aG(e.sup,t.havingStyle(n.sup()),t):aG(e.sub,t.havingStyle(n.sub()),t),i=zG(e.base,`horizBrace`)):i=zG(e,`horizBrace`);var a=aG(i.base,t.havingBaseStyle(IH.DISPLAY)),o=PG(i,t),s=i.isOver?MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):MW({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):MW({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:mq,mathmlBuilder:(e,t)=>{var n=jG(e.label);return new Q(e.isOver?`mover`:`munder`,[bG(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=zG(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:JW(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=$W(e.body,t,!1);return OW(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=yG(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=zG(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:JW(s)}}}),Z({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:JW(t[0])}},htmlBuilder(e,t){return kW($W(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,vG(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=zG(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new B(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:JW(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=$W(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>yG(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:JW(t[0]),mathml:JW(t[1])}},htmlBuilder:(e,t)=>kW($W(e.html,t,!1)),mathmlBuilder:(e,t)=>yG(e.mathml,t)});var hq=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!iU(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=zG(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=hq(d);break;case`height`:a=hq(d);break;case`totalheight`:o=hq(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=zG(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=aU(e.height,t),r=0;e.totalheight.number>0&&(r=aU(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=aU(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new mU(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=aU(e.height,t),i=0;if(e.totalheight.number>0&&(i=aU(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=aU(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=zG(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return NW(e.dimension,t)},mathmlBuilder(e,t){return new uG(aU(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[aG(e.body,t)]),n=X([`inner`],[n],t)):n=X([`inner`],[aG(e.body,t)]);var r=X([`fix`],[]),i=X([e.alignment],[n,r],t),a=X([`strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`thinbox`],[i],t),X([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[bG(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new B(`Mismatched `+e.funcName)}});var gq=(e,t)=>{switch(t.style.size){case IH.DISPLAY.size:return e.display;case IH.TEXT.size:return e.text;case IH.SCRIPT.size:return e.script;case IH.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:JW(t[0]),text:JW(t[1]),script:JW(t[2]),scriptscript:JW(t[3])}},htmlBuilder:(e,t)=>kW($W(gq(e,t),t,!1)),mathmlBuilder:(e,t)=>yG(gq(e,t),t)});var _q=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&pH(n),c,l;if(t){var u=aG(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=aG(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=MW({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=MW({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=MW({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=V(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},vq=new Set([`\\smallint`]),yq=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=zG(e.base,`op`),i=!0):a=zG(e,`op`);var o=t.style,s=!1;o.size===IH.DISPLAY.size&&a.symbol&&!vq.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=yW(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=LW(d+`Size`+(s?`2`:`1`),t);c=MW({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=$W(a.body,t,!0);p.length===1&&p[0]instanceof gU?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(bW(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof gU||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?_q(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},bq=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[pG(e.name,e.mode)]),vq.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,vG(e.body,t));else{n=new Q(`mi`,[new lG(e.name.slice(1))]);var r=new Q(`mo`,[pG(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):cG([n,r])}return n},xq={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=xq[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:yq,mathmlBuilder:bq}),Z({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:JW(r)}},htmlBuilder:yq,mathmlBuilder:bq});var Sq={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:yq,mathmlBuilder:bq}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:yq,mathmlBuilder:bq}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=Sq[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:yq,mathmlBuilder:bq});var Cq=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=zG(e.base,`operatorname`),i=!0):a=zG(e,`operatorname`);var o;if(a.body.length>0){for(var s=$W(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof gU&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?_q(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:JW(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:Cq,mathmlBuilder:(e,t)=>{for(var n=vG(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof uG)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof lG?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new lG(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[pG(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):cG([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),KW({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?kW($W(e.body,t,!1)):X([`mord`],$W(e.body,t,!0),t)},mathmlBuilder(e,t){return yG(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=aG(e.body,t.havingCrampedStyle()),r=DW(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`overline`],[MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new lG(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[bG(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:JW(r)}},htmlBuilder:(e,t)=>kW($W(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,vG(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`inner`],[aG(e.body,t.withPhantom())]),X([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,vG(JW(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=zG(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=aG(e.body,t);return MW({positionType:`shift`,positionData:-aU(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[bG(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Z({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Z({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=zG(t[0],`size`),o=zG(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&zG(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`rule`],[],t),r=aU(e.width,t),i=aU(e.height,t),a=e.shift?aU(e.shift,t):0;return n.style.borderRightWidth=V(r),n.style.borderTopWidth=V(i),n.style.bottom=V(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=aU(e.width,t),r=aU(e.height,t),i=e.shift?aU(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,V(n)),o.setAttribute(`height`,V(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,V(i)):(s.setAttribute(`height`,V(i)),s.setAttribute(`depth`,V(-i))),s.setAttribute(`voffset`,V(i)),s}});function wq(e,t,n){for(var r=$W(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return kW(r)}var Tq=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:Tq,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:Tq.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return wq(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,vG(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&zG(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=BG(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[aG(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[bG(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=aG(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=AW(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<IH.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=wK(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=V(c);var d=MW({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(IH.SCRIPTSCRIPT),p=aG(e.index,f,t);return X([`mord`,`sqrt`],[X([`root`],[MW({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}return X([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Q(`mroot`,[bG(n,t),bG(r,t)]):new Q(`msqrt`,[bG(n,t)])}});var Eq={display:IH.DISPLAY,text:IH.TEXT,script:IH.SCRIPT,scriptscript:IH.SCRIPTSCRIPT};function Dq(e){return e in Eq}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!Dq(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=Eq[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),wq(e.body,r,t)},mathmlBuilder(e,t){var n=Eq[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,vG(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var Oq=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===IH.DISPLAY.size||n.alwaysHandleSupSub)?yq:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===IH.DISPLAY.size||n.limits)?Cq:null:n.type===`accent`?pH(n.base)?UG:null:n.type===`horizBrace`&&!e.sub===n.isOver?mq:null:null};KW({type:`supsub`,htmlBuilder(e,t){var n=Oq(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=aG(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&pH(r);if(i){var p=t.havingStyle(t.style.sup());s=aG(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=aG(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===IH.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=V(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof gU||y)&&(v=V(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=MW({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=MW({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=MW({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([rG(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[bG(e.base,t)];e.sub&&a.push(bG(e.sub,t)),e.sup&&a.push(bG(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===IH.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===IH.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===IH.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===IH.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===IH.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===IH.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),KW({type:`atom`,htmlBuilder(e,t){return bW(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[pG(e.text,e.mode)]);if(e.family===`bin`){var r=gG(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var kq={mi:`italic`,mn:`normal`,mtext:`normal`};KW({type:`mathord`,htmlBuilder(e,t){return SW(e,t,`mathord`)},mathmlBuilder(e,t){var n=new Q(`mi`,[pG(e.text,e.mode,t)]),r=gG(e,t)||`italic`;return r!==kq[n.type]&&n.setAttribute(`mathvariant`,r),n}}),KW({type:`textord`,htmlBuilder(e,t){return SW(e,t,`textord`)},mathmlBuilder(e,t){var n=pG(e.text,e.mode,t),r=gG(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==kq[i.type]&&i.setAttribute(`mathvariant`,r),i}});var Aq={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},jq={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};KW({type:`spacing`,htmlBuilder(e,t){if(jq.hasOwnProperty(e.text)){var n=jq[e.text].className||``;if(e.mode===`text`){var r=SW(e,t,`textord`);return r.classes.push(n),r}return X([`mspace`,n],[bW(e.text,e.mode,t)],t)}if(Aq.hasOwnProperty(e.text))return X([`mspace`,Aq[e.text]],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(jq.hasOwnProperty(e.text))n=new Q(`mtext`,[new lG(`\xA0`)]);else if(Aq.hasOwnProperty(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var Mq=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};KW({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[Mq(),new Q(`mtd`,[yG(e.body,t)]),Mq(),new Q(`mtd`,[yG(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var Nq={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},Pq={"\\textbf":`textbf`,"\\textmd":`textmd`},Fq={"\\textit":`textit`,"\\textup":`textup`},Iq=(e,t)=>{var n=e.font;return n?Nq[n]?t.withTextFontFamily(Nq[n]):Pq[n]?t.withTextFontWeight(Pq[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(Fq[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:JW(i),font:r}},htmlBuilder(e,t){var n=Iq(e,t);return X([`mord`,`text`],$W(e.body,n,!0),n)},mathmlBuilder(e,t){var n=Iq(e,t);return yG(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=aG(e.body,t),r=DW(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`underline`],[MW({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new lG(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[bG(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=aG(e.body,t),r=t.fontMetrics().axisHeight;return MW({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[bG(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=Lq(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(yW(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),wW(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new lG(Lq(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var Lq=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),Rq=UW,zq=`[ \r
530
+ ]`,Bq=`\\\\[a-zA-Z@]+`,Vq=`\\\\[^\ud800-\udfff]`,Hq=`(`+Bq+`)`+zq+`*`,Uq=`\\\\(
531
+ |[ \r ]+
532
+ ?)[ \r ]*`,Wq=`[̀-ͯ]`,Gq=RegExp(Wq+`+$`),Kq=`(`+zq+`+)|`+(Uq+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(Wq+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(Wq+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+Hq)+(`|`+Vq+`)`),qq=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Kq,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new JK(`EOF`,new qK(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new JK(e[t],new qK(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
533
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new JK(r,new qK(this,t,this.tokenRegex.lastIndex))}},Jq=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},Yq=KK;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Xq={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Xq[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=Xq[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Zq=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>Zq(e,!1,!0,!1)),$(`\\renewcommand`,e=>Zq(e,!0,!1,!1)),$(`\\providecommand`,e=>Zq(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Rq[n],AU.math[n],AU.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var Qq={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},$q=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in Qq?t=Qq[n]:(n.slice(0,4)===`\\not`||n in AU.math&&$q.has(AU.math[n].group))&&(t=`\\dotsb`),t});var eJ={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in eJ?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in eJ&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in eJ?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var tJ=V(CU[`Main-Regular`][84][1]-.7*CU[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+tJ+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+tJ+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var nJ=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,nJ(!1)),$(`\\bra@set`,nJ(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var rJ={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},iJ=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Jq(Yq,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new qq(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new JK(`EOF`,n.loc)),this.pushTokens(r),new JK(``,qK.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new JK(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new qq(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Rq.hasOwnProperty(e)||AU.math.hasOwnProperty(e)||AU.text.hasOwnProperty(e)||rJ.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?Rq.hasOwnProperty(e)&&!Rq[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},aJ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,oJ=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),sJ={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},cJ={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},lJ=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new iJ(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new JK(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&Rq[i.text]&&Rq[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(oJ[i.text]){var s=aJ.test(i.text),c=[];for(c.push(new JK(oJ[i.text])),this.consume();;){var l=this.fetch().text;if(!oJ[l]||aJ.test(l)!==s)break;c.unshift(new JK(oJ[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Rq[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Rq[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new B(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new B(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!iU(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:qK.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!rJ.hasOwnProperty(r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:qK.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:qK.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:qK.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
534
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}cJ.hasOwnProperty(t[0])&&!AU[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=cJ[t[0]]+t.slice(1));var i=Gq.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(AU[this.mode][t]){this.settings.strict&&this.mode===`math`&&eW.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=AU[this.mode][t].group,s=qK.range(e);a=RG(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(BH(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:qK.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!sJ[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=sJ[l][this.mode]||sJ[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:qK.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};lJ.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var uJ=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new lJ(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new JK(`\\df@tag`)])}]}return r},dJ=function(e,t,n){t.textContent=``;var r=hJ(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),dJ=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var fJ=function(e,t){return hJ(e,t).toMarkup()},pJ=function(e,t){return uJ(e,new yH(t))},mJ=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new gU(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},hJ=function(e,t){var n=new yH(t);try{return OG(uJ(e,n),e,n)}catch(t){return mJ(t,e,n)}},gJ=function(e,t){var n=new yH(t);try{return kG(uJ(e,n),e,n)}catch(t){return mJ(t,e,n)}},_J=`0.16.47`,vJ={Span:fU,Anchor:pU,SymbolNode:gU,SvgNode:_U,PathNode:vU,LineNode:yU},yJ={version:_J,render:dJ,renderToString:fJ,ParseError:B,SETTINGS_SCHEMA:hH,__parse:pJ,__renderToDomTree:hJ,__renderToHTMLTree:gJ,__setFontMetrics:EU,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:vJ},bJ={},xJ=[];function SJ(e){let t=e||bJ;return function(e,n){iB(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:xJ,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=YV(u,{whitespace:`pre`}),f;try{f=yJ.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=yJ.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=MV(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),rB})}}function CJ(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function wJ(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function TJ(e,t,n){let r=Jz((n||{}).ignore||[]),i=EJ(t),a=-1;for(;++a<i.length;)iB(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function EJ(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([DJ(e[0]),OJ(e[1])])}return t}function DJ(e){return typeof e==`string`?new RegExp(wJ(e),`g`):e}function OJ(e){return typeof e==`function`?e:function(){return e}}var kJ=`phrasing`,AJ=[`autolink`,`link`,`image`,`label`];function jJ(){return{transforms:[zJ],enter:{literalAutolink:NJ,literalAutolinkEmail:PJ,literalAutolinkHttp:PJ,literalAutolinkWww:PJ},exit:{literalAutolink:RJ,literalAutolinkEmail:LJ,literalAutolinkHttp:FJ,literalAutolinkWww:IJ}}}function MJ(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:kJ,notInConstruct:AJ},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:kJ,notInConstruct:AJ},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:kJ,notInConstruct:AJ}]}}function NJ(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function PJ(e){this.config.enter.autolinkProtocol.call(this,e)}function FJ(e){this.config.exit.autolinkProtocol.call(this,e)}function IJ(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function LJ(e){this.config.exit.autolinkEmail.call(this,e)}function RJ(e){this.exit(e)}function zJ(e){TJ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,BJ],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,VJ]],{ignore:[`link`,`linkReference`]})}function BJ(e,t,n,r,i){let a=``;if(!WJ(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!HJ(n)))return!1;let o=UJ(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function VJ(e,t,n,r){return!WJ(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function HJ(e){let 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 UJ(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=CJ(e,`(`),a=CJ(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function WJ(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||TI(n)||wI(n))&&(!t||n!==47)}eY.peek=$J;function GJ(){this.buffer()}function KJ(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function qJ(){this.buffer()}function JJ(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function YJ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pI(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XJ(e){this.exit(e)}function ZJ(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pI(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QJ(e){this.exit(e)}function $J(){return`[`}function eY(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function tY(){return{enter:{gfmFootnoteCallString:GJ,gfmFootnoteCall:KJ,gfmFootnoteDefinitionLabelString:qJ,gfmFootnoteDefinition:JJ},exit:{gfmFootnoteCallString:YJ,gfmFootnoteCall:XJ,gfmFootnoteDefinitionLabelString:ZJ,gfmFootnoteDefinition:QJ}}}function nY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:eY},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
535
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?iY:rY))),s(),o}}function rY(e,t,n){return t===0?e:iY(e,t,n)}function iY(e,t,n){return(n?``:` `)+e}var aY=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];uY.peek=dY;function oY(){return{canContainEols:[`delete`],enter:{strikethrough:cY},exit:{strikethrough:lY}}}function sY(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:aY}],handlers:{delete:uY}}}function cY(e){this.enter({type:`delete`,children:[]},e)}function lY(e){this.exit(e)}function uY(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function dY(){return`~`}function fY(e){return e.length}function pY(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fY,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=mY(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=hY(r[d]);else{let e=hY(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
536
+ `)}function mY(e){return e==null?``:String(e)}function hY(e){let 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 gY(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_Y);return i(),o}function _Y(e,t,n){return`>`+(n?``:` `)+e}function vY(e,t){return yY(e,t.inConstruct,!0)&&!yY(e,t.notInConstruct,!1)}function yY(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 bY(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
537
+ `&&vY(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
538
+ `}function xY(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function SY(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 CY(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wY(e,t,n,r){let i=CY(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(SY(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,TY);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xY(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
539
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
540
+ `),a&&(u+=s.move(a+`
541
+ `)),u+=s.move(c),l(),u}function TY(e,t,n){return(n?``:` `)+e}function EY(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DY(e,t,n,r){let i=EY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
542
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function OY(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kY(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function AY(e,t,n){let r=FI(e),i=FI(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}}jY.peek=MY;function jY(e,t,n,r){let i=OY(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=AY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=AY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kY(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function MY(e,t,n){return n.options.emphasis||`*`}function NY(e,t){let n=!1;return oB(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&eI(e)&&(t.options.setext||n))}function PY(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(NY(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
543
+ `,after:`
544
+ `});return r(),t(),o+`
545
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
546
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
547
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=kY(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}FY.peek=IY;function FY(e){return e.value||``}function IY(){return`<`}LY.peek=RY;function LY(e,t,n,r){let i=EY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function RY(){return`!`}zY.peek=BY;function zY(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function BY(){return`!`}VY.peek=HY;function VY(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function HY(){return"`"}function UY(e,t){let n=eI(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))}WY.peek=GY;function WY(e,t,n,r){let i=EY(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(UY(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function GY(e,t,n){return UY(e,n)?`<`:`[`}KY.peek=qY;function KY(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function qY(){return`[`}function JY(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YY(e){let t=JY(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XY(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ZY(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QY(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?XY(n):JY(n),s=e.ordered?o===`.`?`)`:`.`:YY(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),ZY(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function $Y(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function eX(e,t,n,r){let i=$Y(n),a=n.bulletCurrent||JY(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function tX(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var nX=Jz([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function rX(e,t,n,r){return(e.children.some(function(e){return nX(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function iX(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aX.peek=oX;function aX(e,t,n,r){let i=iX(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=AY(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=kY(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=AY(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+kY(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function oX(e,t,n){return n.options.strong||`*`}function sX(e,t,n,r){return n.safe(e.value,r)}function cX(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function lX(e,t,n){let r=(ZY(n)+(n.options.ruleSpaces?` `:``)).repeat(cX(n));return n.options.ruleSpaces?r.slice(0,-1):r}var uX={blockquote:gY,break:bY,code:wY,definition:DY,emphasis:jY,hardBreak:bY,heading:PY,html:FY,image:LY,imageReference:zY,inlineCode:VY,link:WY,linkReference:KY,list:QY,listItem:eX,paragraph:tX,root:rX,strong:aX,text:sX,thematicBreak:lX};function dX(){return{enter:{table:fX,tableData:gX,tableHeader:gX,tableRow:mX},exit:{codeText:_X,table:pX,tableData:hX,tableHeader:hX,tableRow:hX}}}function fX(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function pX(e){this.exit(e),this.data.inTable=void 0}function mX(e){this.enter({type:`tableRow`,children:[]},e)}function hX(e){this.exit(e)}function gX(e){this.enter({type:`tableCell`,children:[]},e)}function _X(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vX));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vX(e,t){return t===`|`?t:e}function yX(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
548
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
549
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return pY(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=uX.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function bX(){return{exit:{taskListCheckValueChecked:SX,taskListCheckValueUnchecked:SX,paragraph:CX}}}function xX(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:wX}}}function SX(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function CX(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wX(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=uX.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function TX(){return[jJ(),tY(),oY(),dX(),bX()]}function EX(e){return{extensions:[MJ(),nY(e),sY(),yX(e),xX()]}}var DX={tokenize:VX,partial:!0},OX={tokenize:HX,partial:!0},kX={tokenize:UX,partial:!0},AX={tokenize:WX,partial:!0},jX={tokenize:GX,partial:!0},MX={name:`wwwAutolink`,tokenize:zX,previous:KX},NX={name:`protocolAutolink`,tokenize:BX,previous:qX},PX={name:`emailAutolink`,tokenize:RX,previous:JX},FX={};function IX(){return{text:FX}}for(var LX=48;LX<123;)FX[LX]=PX,LX++,LX===58?LX=65:LX===91&&(LX=97);FX[43]=PX,FX[45]=PX,FX[46]=PX,FX[95]=PX,FX[72]=[PX,NX],FX[104]=[PX,NX],FX[87]=[PX,MX],FX[119]=[PX,MX];function RX(e,t,n){let r=this,i,a;return o;function o(t){return!YX(t)||!JX.call(r,r.previous)||XX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return YX(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(jX,u,l)(t):t===45||t===95||hI(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&mI(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function zX(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!KX.call(r,r.previous)||XX(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(DX,e.attempt(OX,e.attempt(kX,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function BX(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&qX.call(r,r.previous)&&!XX(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(mI(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||_I(t)||SI(t)||TI(t)||wI(t)?n(t):e.attempt(OX,e.attempt(kX,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function VX(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function HX(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(AX,c,s)(t):t===null||SI(t)||TI(t)||t!==45&&wI(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function UX(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(AX,t,a)(o):o===null||SI(o)||TI(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function WX(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||SI(o)||TI(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||SI(e)||TI(e)?t(e):r(e)}function a(e){return mI(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):mI(t)?(e.consume(t),o):n(t)}}function GX(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return hI(e)?n(e):t(e)}}function KX(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||SI(e)}function qX(e){return!mI(e)}function JX(e){return!(e===47||YX(e))}function YX(e){return e===43||e===45||e===46||e===95||hI(e)}function XX(e){let t=e.length,n=!1;for(;t--;){let 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}var ZX={tokenize:aZ,partial:!0};function QX(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:nZ,continuation:{tokenize:rZ},exit:iZ}},text:{91:{name:`gfmFootnoteCall`,tokenize:tZ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$X,resolveTo:eZ}}}}function $X(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=pI(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function eZ(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tZ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||SI(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(pI(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return SI(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function nZ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||SI(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=pI(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return SI(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),OI(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rZ(e,t,n){return e.check(UI,t,e.attempt(ZX,t,n))}function iZ(e){e.exit(`gfmFootnoteDefinition`)}function aZ(e,t,n){let r=this;return OI(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function oZ(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&oI(o,o.length,0,II(s,e.slice(r+1,n),t)),oI(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),oI(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=FI(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=FI(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var sZ=class{constructor(){this.map=[]}add(e,t,n){cZ(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function cZ(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 lZ(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 uZ(){return{flow:{null:{name:`table`,tokenize:dZ,resolveAll:fZ}}}}function dZ(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):xI(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):CI(t)?OI(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||SI(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,CI(t)?OI(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return CI(t)?OI(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||xI(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return CI(t)?OI(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||xI(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||xI(n)?(e.exit(`tableRow`),t(n)):CI(n)?OI(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||SI(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function fZ(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new sZ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(mZ(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=pZ(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=pZ(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=pZ(f,t,o,i,n,d)):(o[0]=o[1],d=pZ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&mZ(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=lZ(t.events,n))}return e}function pZ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},hZ(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=hZ(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=hZ(t.events,n[2]),a=hZ(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},hZ(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function mZ(e,t,n,r,i){let a=[],o=hZ(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function hZ(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var gZ={name:`tasklistCheck`,tokenize:vZ};function _Z(){return{text:{91:gZ}}}function vZ(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return SI(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return xI(r)?t(r):CI(r)?e.check({tokenize:yZ},t,n)(r):n(r)}}function yZ(e,t,n){return OI(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function bZ(e){return lI([IX(),QX(),oZ(e),uZ(),_Z()])}var xZ={};function SZ(e){let t=this,n=e||xZ,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bZ(n)),a.push(TX()),o.push(EX(n))}function CZ(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function wZ(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
550
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(xY(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
551
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
552
+ `),i&&(c+=a.move(i+`
553
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var TZ={tokenize:DZ,concrete:!0,name:`mathFlow`},EZ={tokenize:OZ,partial:!0};function DZ(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),OI(e,l,`whitespace`)(t))}function l(t){return t===null||xI(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||xI(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(EZ,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?OI(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):xI(t)?e.attempt(EZ,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||xI(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return OI(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),OI(e,c,`whitespace`)(t))}function c(r){return r===null||xI(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function OZ(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function kZ(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:AZ,previous:jZ,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):xI(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||xI(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function AZ(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===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,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=`mathTextData`,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 jZ(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function MZ(e){return{flow:{36:TZ},text:{36:kZ(e)}}}var NZ={};function PZ(e){let t=this,n=e||NZ,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(MZ(n)),a.push(CZ()),o.push(wZ(n))}var FZ=`modulepreload`,IZ=function(e){return`/workbench/`+e},LZ={},RZ=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=IZ(t,n),t=s(t),t in LZ)return;LZ[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:FZ,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function zZ(){let e=()=>document.documentElement.dataset.theme===`carbon`?`carbon`:`paper`,[t,n]=(0,E.useState)(e);return(0,E.useEffect)(()=>{let t=new MutationObserver(()=>n(e()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},[]),t}function BZ({source:e}){let t=zZ(),n=(0,E.useId)(),[r,i]=(0,E.useState)(``),[a,o]=(0,E.useState)(``);return(0,E.useEffect)(()=>{let r=!0;async function a(){try{let{default:a}=await RZ(async()=>{let{default:e}=await import(`./mermaid.core-DdgCdsnM.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));a.initialize({securityLevel:`strict`,startOnLoad:!1,theme:t===`carbon`?`dark`:`neutral`});let s=`mermaid-${n.replaceAll(`:`,``)}`,c=await a.render(s,e);if(!r)return;i(c.svg),o(``)}catch(e){if(!r)return;i(``),o(e instanceof Error?e.message:`Unable to render diagram`)}}return a(),()=>{r=!1}},[n,e,t]),a?(0,j.jsxs)(`div`,{className:`my-3 max-w-full overflow-auto rounded-lg border border-current/15 p-3`,children:[(0,j.jsx)(`p`,{className:`mb-2 text-xs opacity-70`,children:`Diagram could not be rendered`}),(0,j.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-6`,children:e})]}):(0,j.jsx)(`div`,{"aria-label":`Mermaid diagram`,className:`my-3 max-w-full overflow-auto rounded-lg border border-current/15 p-4 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:r},role:`img`})}function VZ(e,t){let n=e.name.toLowerCase(),r=e.input&&typeof e.input==`object`?e.input:{},i=UZ(r.cmd)??UZ(r.command)??WZ(e.input);if(i||[`exec`,`shell`,`terminal`,`command`].some(e=>n.includes(e)))return{category:`command`,label:`运行命令`,...i?{target:i}:{}};let a=e.locations?.[0]?.path??UZ(r.path)??UZ(r.file_path)??UZ(r.filePath);if(a||[`read`,`write`,`edit`,`file`].some(e=>n.includes(e))){let e=a&&t&&!GZ(a)?`${t.replace(/[\\/]+$/,``)}/${a.replace(/^[\\/]+/,``)}`:a;return{category:`file`,label:HZ(n),...e?{target:e}:{}}}return{category:`tool`,label:`使用 ${e.name}`}}function HZ(e){return e.includes(`read`)?`读取文件`:e.includes(`write`)||e.includes(`create`)?`写入文件`:e.includes(`edit`)||e.includes(`patch`)?`编辑文件`:`使用文件`}function UZ(e){return typeof e==`string`&&e?e:void 0}function WZ(e){if(typeof e!=`string`)return;let t=e.match(/\bcmd\s*:\s*("(?:\\.|[^"\\])*")/s);if(t?.[1])try{return UZ(JSON.parse(t[1]))}catch{return}}function GZ(e){return e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)}function KZ({approvals:e,cwd:t,item:n,onApproval:r}){if(n.kind===`user`)return(0,j.jsxs)(`article`,{className:`grid min-w-0 justify-items-end gap-2`,children:[(0,j.jsx)(`span`,{className:P(`font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-muted`),children:`你`}),(0,j.jsx)(`div`,{className:P(`max-w-[72%] min-w-0 [overflow-wrap:anywhere] rounded-xl px-3.5 py-3 text-sm leading-6`,`text-ink`,`bg-accent-soft`),children:n.content})]});if(n.kind===`assistant`)return(0,j.jsxs)(`article`,{className:`grid max-w-[780px] gap-2`,children:[(0,j.jsx)(`span`,{className:P(`text-xs font-medium tracking-[0.08em]`,`text-muted`),children:`Agent`}),(0,j.jsx)(tQ,{content:n.content})]});if(n.kind===`work`)return(0,j.jsx)(JZ,{cwd:t,item:n});if(n.kind===`plan`)return(0,j.jsxs)(`section`,{className:P(`max-w-[760px] rounded-lg border`,`bg-surface`,`border-line`,`shadow-card`),children:[(0,j.jsxs)(`div`,{className:P(`flex items-center justify-between gap-3 border-b px-3.5 py-3`,`border-line`),children:[(0,j.jsxs)(`span`,{className:P(`flex items-center gap-2 text-xs font-semibold`,`text-ink`),children:[(0,j.jsx)(ae,{className:P(`size-3.5`,`text-muted`)}),`计划`]}),(0,j.jsxs)(`span`,{className:P(`font-mono text-xs`,`text-muted`),children:[n.entries.filter(e=>e.status===`completed`).length,` / `,n.entries.length]})]}),(0,j.jsx)(`ol`,{className:`grid gap-2 px-3.5 py-3.5`,children:n.entries.map((e,t)=>(0,j.jsxs)(`li`,{className:P(`flex items-start gap-2 text-xs`,e.status===`completed`?`text-muted`:`text-ink-soft`),children:[e.status===`completed`?(0,j.jsx)(ae,{className:P(`mt-0.5 size-3.5 shrink-0`,`text-success`)}):(0,j.jsx)(le,{className:P(`mt-0.5 size-3.5 shrink-0`,e.status===`in_progress`?`text-warning`:`text-faint`)}),(0,j.jsx)(`span`,{children:e.content})]},`${e.content}-${t}`))})]});if(n.kind===`approval`){let t=e.find(e=>e.id===n.requestId)??e.find(e=>e.run_id===n.runId);return(0,j.jsx)(eQ,{approval:t,item:n,onApproval:r})}if(n.kind===`error`)return(0,j.jsxs)(`section`,{className:P(`flex max-w-[760px] items-start gap-2 rounded-lg border p-3.5 text-xs`,`bg-danger-soft`,`text-danger`,`border-line-strong`),children:[(0,j.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:`font-semibold`,children:n.fatal?`Run 失败`:`Agent 错误`}),(0,j.jsx)(`p`,{className:`mt-1 leading-5`,children:n.content})]})]})}function qZ({startedAt:e}){let[t,n]=(0,E.useState)(()=>Date.now());(0,E.useEffect)(()=>{let e=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let r=Math.max(0,Math.round((t-new Date(e).getTime())/1e3));return(0,j.jsxs)(`span`,{className:P(`font-mono tabular-nums`,`text-control-accent`),children:[Math.floor(r/60),`:`,String(r%60).padStart(2,`0`)]})}function JZ({cwd:e,item:t}){let n=t.entries.filter(e=>e.kind===`tool`),r=t.running;return(0,j.jsxs)(`details`,{open:r||void 0,className:P(`group w-full max-w-[780px] border-t`,`border-line`),children:[(0,j.jsxs)(`summary`,{className:P(`flex cursor-pointer list-none items-center gap-2 py-3 text-xs`,`text-muted`),children:[r&&(0,j.jsx)(ve,{className:P(`size-3.5 animate-spin`,`text-control-accent`)}),(0,j.jsx)(`span`,{className:P(`font-medium`,`text-ink-soft`),children:r?`工作中`:`耗时 ${xn(t.startedAt,t.endedAt)}`}),r&&(0,j.jsx)(qZ,{startedAt:t.startedAt}),n.length>0&&(0,j.jsxs)(`span`,{children:[n.length,` 个工具调用`]}),(0,j.jsx)(oe,{className:`size-3.5 transition-transform group-open:rotate-180`})]}),(0,j.jsxs)(`div`,{className:`relative grid w-full min-w-0 max-w-full grid-cols-[minmax(0,1fr)] gap-2 overflow-hidden pb-4`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:P(`absolute bottom-4 left-[10px] top-1 w-px`,`bg-line`)}),t.entries.map((t,n)=>{let r=t.kind===`tool`?t.status===`failed`?`bg-danger`:t.status===`completed`?`bg-success`:P(`bg-warning`,`animate-pulse`):t.kind===`thought`?`bg-warning`:`bg-faint`;return(0,j.jsxs)(`div`,{className:`grid w-full min-w-0 max-w-full grid-cols-[21px_minmax(0,1fr)] gap-2 overflow-hidden px-1 py-1`,children:[(0,j.jsx)(`span`,{className:P(`relative z-10 ml-[3px] mt-1.5 size-2 rounded-full border-2`,`border-canvas`,r)}),(0,j.jsx)(`div`,{className:`min-w-0`,children:t.kind===`tool`?(0,j.jsx)($Z,{cwd:e,tool:t}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:P(`mb-1 font-brand text-xs font-normal uppercase tracking-[0.1em]`,t.kind===`thought`?`text-warning`:`text-muted`),children:t.kind===`thought`?`推理`:`进度`}),(0,j.jsx)(YZ,{content:t.content})]})})]},t.kind===`tool`?t.id:`${t.kind}-${n}`)})]})]})}function YZ({content:e}){return(0,j.jsx)(`div`,{className:P(`max-w-full break-words text-xs font-normal leading-5`,`text-ink-soft`),children:(0,j.jsx)(iV,{components:{code:({children:e})=>(0,j.jsx)(`code`,{className:P(`rounded px-1 py-0.5 font-mono text-[0.92em]`,`bg-surface-soft`,`text-ink`),children:e}),h1:({children:e})=>(0,j.jsx)(`h1`,{className:`mb-1 text-xs font-medium leading-5`,children:e}),h2:({children:e})=>(0,j.jsx)(`h2`,{className:`mb-1 text-xs font-medium leading-5`,children:e}),h3:({children:e})=>(0,j.jsx)(`h3`,{className:`mb-1 text-xs font-medium leading-5`,children:e}),ol:({children:e})=>(0,j.jsx)(`ol`,{className:`my-1 list-decimal space-y-0.5 pl-4`,children:e}),p:({children:e})=>(0,j.jsx)(`p`,{className:`mb-1 last:mb-0`,children:e}),table:XZ,ul:({children:e})=>(0,j.jsx)(`ul`,{className:`my-1 list-disc space-y-0.5 pl-4`,children:e})},remarkPlugins:[SZ],children:e})})}function XZ({children:e}){return(0,j.jsx)(`div`,{className:P(`my-3 overflow-auto rounded-lg border`,`border-line`),children:(0,j.jsx)(`table`,{className:P(`w-full border-collapse text-left text-xs`,`[&_th]:bg-surface-soft [&_th]:px-3 [&_th]:py-2 [&_th]:font-medium [&_th]:text-muted`,`[&_th]:border-b [&_th]:border-line-strong`,`[&_td]:px-3 [&_td]:py-2 [&_td]:align-top [&_td]:text-ink-soft`,`[&_td:first-child]:text-ink`,`[&_tbody_tr:not(:last-child)_td]:border-b [&_tbody_tr:not(:last-child)_td]:border-line`),children:e})})}function ZZ(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.old_string==`string`?t.old_string:typeof t.oldText==`string`?t.oldText:null,r=typeof t.new_string==`string`?t.new_string:typeof t.newText==`string`?t.newText:null;return n!==null&&r!==null?{oldText:n,newText:r}:null}function QZ({oldText:e,newText:t}){let n=e.split(`
554
+ `),r=t.split(`
555
+ `);return(0,j.jsxs)(`div`,{className:P(`overflow-hidden rounded-md border font-mono text-xs leading-5`,`border-line`),children:[n.map((e,t)=>(0,j.jsxs)(`div`,{className:P(`flex gap-2 px-2.5`,`bg-danger-soft`,`text-danger`),children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 select-none`,children:`−`}),(0,j.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-all`,children:e||` `})]},`r-${t}`)),r.map((e,t)=>(0,j.jsxs)(`div`,{className:P(`flex gap-2 px-2.5`,`bg-success-soft`,`text-success`),children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 select-none`,children:`+`}),(0,j.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-all`,children:e||` `})]},`a-${t}`))]})}function $Z({cwd:e,tool:t}){let n=VZ(t,e),r=n.category===`command`?Me:n.category===`file`?pe:Fe,i=t.status===`failed`?`失败`:t.status===`completed`?`完成`:`运行中`,a=n.category===`file`?ZZ(t.input):null;return(0,j.jsxs)(`details`,{className:P(`group/tool rounded-md border`,`bg-surface-tint`,`border-line`),children:[(0,j.jsxs)(`summary`,{className:P(`flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-xs`,`text-muted`),children:[(0,j.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center`,children:(0,j.jsx)(r,{className:`size-3.5`})}),(0,j.jsx)(`span`,{className:P(`shrink-0 font-medium`,`text-ink-soft`),children:n.label}),n.target&&(0,j.jsx)(`span`,{className:P(`min-w-0 flex-1 truncate font-mono text-xs`,`text-muted`),title:n.target,children:n.target}),(0,j.jsx)(`span`,{className:P(`text-xs`,t.status===`failed`?`text-danger`:t.status===`completed`?`text-success`:`text-warning`),children:i}),(0,j.jsx)(oe,{className:`size-3.5 shrink-0 transition-transform group-open/tool:rotate-180`})]}),(0,j.jsxs)(`div`,{className:P(`grid gap-3 border-t px-3 py-3`,`border-line`),children:[n.target&&n.category===`file`&&(0,j.jsxs)(`div`,{className:P(`flex items-start gap-2 font-mono text-xs leading-5`,`text-ink-soft`),children:[(0,j.jsx)(pe,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`break-all`,children:n.target})]}),a&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:P(`mb-1.5 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-muted`),children:`变更`}),(0,j.jsx)(QZ,{newText:a.newText,oldText:a.oldText})]}),t.input!==void 0&&!a&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:P(`mb-1.5 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-muted`),children:`输入`}),(0,j.jsx)(`pre`,{className:P(`max-h-48 overflow-auto whitespace-pre-wrap font-mono text-xs leading-5`,`text-ink-soft`),children:Cn(t.input)})]}),t.output!==void 0&&(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:P(`mb-1.5 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-muted`),children:`输出`}),(0,j.jsx)(`pre`,{className:P(`max-h-64 overflow-auto whitespace-pre-wrap font-mono text-xs leading-5`,`text-ink-soft`),children:Cn(t.output)})]})]})]})}function eQ({approval:e,item:t,onApproval:n}){return e&&e.status!==`requested`?(0,j.jsx)(`section`,{className:P(`max-w-[760px] rounded-lg border p-3.5`,`bg-surface`,`border-line`,`shadow-card`),children:(0,j.jsxs)(`div`,{className:P(`flex items-center gap-2 text-xs font-semibold`,e.status===`granted`?`text-success`:`text-danger`),children:[e.status===`granted`?(0,j.jsx)(ae,{className:`size-3.5`}):(0,j.jsx)(Ie,{className:`size-3.5`}),e.status===`granted`?`已授权`:`已暂停 Run`,(0,j.jsx)(`span`,{className:P(`ml-auto font-mono text-xs font-normal`,`text-muted`),children:e.status})]})}):(0,j.jsxs)(`section`,{className:P(`relative max-w-[760px] overflow-hidden rounded-lg border`,`bg-surface`,`border-line-strong`,`shadow-card`),children:[(0,j.jsx)(`svg`,{"aria-hidden":`true`,className:P(`pointer-events-none absolute inset-0 size-full`,`text-warning`),children:(0,j.jsx)(`rect`,{className:P(`h-[calc(100%-2px)] w-[calc(100%-2px)]`,`motion-safe:animate-march`),fill:`none`,rx:`7`,stroke:`currentColor`,strokeDasharray:`4 4`,strokeWidth:`1.5`,x:`1`,y:`1`})}),(0,j.jsxs)(`div`,{className:P(`flex items-center justify-between gap-3 border-b px-3.5 py-3`,`border-line`),children:[(0,j.jsxs)(`span`,{className:P(`flex items-center gap-2 text-xs font-semibold`,`text-ink`),children:[(0,j.jsx)(ke,{className:P(`size-3.5`,`text-warning`)}),`需要审批`]}),(0,j.jsx)(`span`,{className:P(`font-mono text-xs`,`text-muted`),children:`仅本次 Run 有效`})]}),(0,j.jsx)(`div`,{className:P(`px-3.5 pb-1 pt-3 text-xs leading-5`,`text-ink-soft`),children:t.title}),(0,j.jsxs)(`div`,{className:`flex gap-2 px-3.5 pb-3.5 pt-2`,children:[(0,j.jsx)(fr,{className:P(`h-8 text-xs`,`bg-accent`,`text-accent-ink`),disabled:!e,onClick:()=>void n(t,!0),size:`sm`,children:`允许一次`}),(0,j.jsx)(fr,{className:P(`h-8 border text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),disabled:!e,onClick:()=>void n(t,!1),size:`sm`,variant:`outline`,children:`拒绝`})]})]})}var tQ=(0,E.memo)(function({content:e}){return(0,j.jsx)(`div`,{className:P(`conversation-body max-w-[780px] text-sm font-normal leading-7 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-2`,`text-ink-soft`),children:(0,j.jsx)(iV,{components:{a:({children:e,href:t})=>(0,j.jsx)(`a`,{className:P(`underline underline-offset-4`,`text-ink`),href:t,rel:`noreferrer`,target:`_blank`,children:e}),blockquote:({children:e})=>(0,j.jsx)(`blockquote`,{className:P(`my-3 border-l-2 pl-3`,`border-line-strong`,`text-muted`),children:e}),code:({children:e,className:t})=>t?.includes(`language-mermaid`)?(0,j.jsx)(BZ,{source:String(e).trimEnd()}):t&&/language-\w+/.test(t)?(0,j.jsx)(`code`,{className:P(`font-mono text-[0.92em]`,`text-ink`),children:iQ(String(e))}):(0,j.jsx)(`code`,{className:P(`rounded px-1 py-0.5 font-mono text-[0.9em]`,`bg-surface-soft`,`text-ink`),children:e}),h1:({children:e})=>(0,j.jsx)(`h1`,{className:P(`mb-3 mt-5 text-lg font-medium`,`text-ink`),children:e}),h2:({children:e})=>(0,j.jsx)(`h2`,{className:P(`mb-2 mt-5 text-base font-medium`,`text-ink`),children:e}),h3:({children:e})=>(0,j.jsx)(`h3`,{className:P(`mb-2 mt-4 text-sm font-medium`,`text-ink`),children:e}),ol:({children:e})=>(0,j.jsx)(`ol`,{className:`my-3 list-decimal space-y-1 pl-5`,children:e}),p:({children:e})=>(0,j.jsx)(`p`,{className:`mb-3 last:mb-0`,children:e}),pre:({children:e})=>(0,E.isValidElement)(e)&&e.type===BZ?e:(0,j.jsx)(`pre`,{className:P(`my-3 max-w-full overflow-auto rounded-lg border p-3 font-mono text-xs leading-6`,`bg-surface-tint`,`border-line`),children:e}),table:XZ,ul:({children:e})=>(0,j.jsx)(`ul`,{className:`my-3 list-disc space-y-1 pl-5`,children:e})},rehypePlugins:[SJ],remarkPlugins:[SZ,PZ],children:e})})}),nQ=new Set(`await async break case catch class const continue def delete do elif else enum except extends finally fn for from func go if impl import in instanceof interface lambda let match mod mut new None of package pass print protected pub public raise range readonly ref return self Self select static struct super switch this throw try True False type typeof undefined use var void where while with yield null true false`.split(` `)),rQ=/('(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|`(?:\\.|[^`\\])*`)|(\/\/[^\n]*|\/\*[\s\S]*?\*\/|#[^\n]*)|\b(\d+(?:\.\d+)?)\b|\b([A-Za-z_][A-Za-z0-9_]*)\b/g;function iQ(e){let t=[],n=0,r=0;for(let i of e.matchAll(rQ)){i.index>n&&t.push(e.slice(n,i.index));let[a,o,s,c,l]=i,u=o?`text-warning`:s?`text-faint`:c?`text-success`:l&&nQ.has(l)?`text-control-accent`:null;t.push(u?(0,j.jsx)(`span`,{className:u,children:a},r++):a),n=i.index+a.length}return n<e.length&&t.push(e.slice(n)),t}function aQ(){return(0,j.jsxs)(`div`,{className:`grid gap-5`,"aria-label":`正在加载 Session`,children:[(0,j.jsx)(`div`,{className:P(`skeleton-pixel h-3 w-24 animate-pulse rounded`,`bg-surface-soft`)}),(0,j.jsx)(`div`,{className:P(`skeleton-pixel h-16 w-2/3 animate-pulse rounded-lg`,`bg-surface-soft`)}),(0,j.jsx)(`div`,{className:P(`skeleton-pixel ml-auto h-12 w-1/2 animate-pulse rounded-lg`,`bg-surface-soft`)})]})}function oQ({className:e=`size-4`}){return(0,j.jsxs)(`svg`,{"aria-hidden":`true`,className:e,fill:`currentColor`,shapeRendering:`crispEdges`,viewBox:`0 0 8 8`,children:[(0,j.jsx)(`title`,{children:`AGNET`}),(0,j.jsx)(`path`,{d:`M1 1h6v6H1zM4 2h1v1H4zM4 3h2v1H4zM4 4h2v1H4zM4 5h1v1H4z`,fillRule:`evenodd`})]})}function sQ(e){if(!e||typeof e!=`object`)return`unknown`;let t=e;return typeof t.code==`string`&&t.code?t.code:typeof t.error==`string`&&t.error?t.error:`unknown`}function cQ(e,t){let n=sQ(e);switch(n){case`confirmation_and_idempotency_key_required`:return{code:n,message:`导入确认请求不完整,请刷新页面后重试。`,retry:null};case`session_not_found`:return{code:n,message:`Session 已不存在,请刷新 Session 列表。`,retry:null};case`provider_session_not_bound`:return{code:n,message:`当前 Session 未绑定 Provider 历史。`,retry:null};case`provider_history_prefix_changed`:return{code:n,message:`Provider 历史前缀已变化,无法安全自动合并。`,retry:null};case`provider_history_cursor_conflict`:return{code:n,message:`Provider 历史已发生变化,请重新检查后再次确认导入。`,retry:`preview`};case`provider_history_unavailable`:return{code:n,message:`暂时无法读取 Provider 历史。`,retry:t};case`runner_unavailable`:return{code:n,message:`Runner 暂不可用,请恢复后重试。`,retry:t};default:return{code:`unknown`,message:t===`import`?`导入结果未知,请使用同一次确认重试。`:`检查 Provider 历史失败,请重试。`,retry:t}}}function lQ(e){let{state:t}=e;if(t.kind===`idle`)return null;if(t.kind===`previewing`)return(0,j.jsxs)(uQ,{children:[(0,j.jsx)(ve,{className:`size-4 animate-spin text-accent`}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`正在检查历史…`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`正在读取 Provider Session,不会写入本地历史。`})]})]});if(t.kind===`available`||t.kind===`importing`){let n=t.kind===`importing`;return(0,j.jsxs)(uQ,{children:[(0,j.jsx)(Te,{className:`size-4 text-accent`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`p`,{className:`text-sm font-medium text-ink`,children:[`发现 `,t.preview.importableEvents,` 条可导入历史记录`]}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`确认后才会写入当前 Session;Provider 原始记录不会被修改。`})]}),(0,j.jsx)(fr,{className:`shrink-0`,disabled:n||!e.onImport,onClick:e.onImport,size:`sm`,children:n?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ve,{className:`mr-1.5 size-3.5 animate-spin`}),`正在导入历史…`]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(de,{className:`mr-1.5 size-3.5`}),`导入历史`]})})]})}if(t.kind===`imported`)return(0,j.jsxs)(uQ,{tone:`success`,children:[(0,j.jsx)(ce,{className:`size-4 text-success`}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`p`,{className:`text-sm font-medium text-ink`,children:[`已导入 `,t.result.importedEvents,` 条历史记录`]}),(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`已恢复 `,t.result.importedTurns,` 个 Turn,时间线已刷新。`]})]})]});if(t.kind===`empty`)return(0,j.jsxs)(uQ,{children:[(0,j.jsx)(ce,{className:`size-4 text-success`}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`Provider 历史已同步`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`没有新的历史记录需要导入。`})]})]});let n=t.retry===`preview`?e.onRetryPreview:t.retry===`import`?e.onRetryImport:void 0;return(0,j.jsxs)(uQ,{tone:`danger`,children:[(0,j.jsx)(Pe,{className:`size-4 text-danger`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-ink`,children:`无法加载 Provider 历史`}),(0,j.jsx)(`p`,{className:`mt-1 [overflow-wrap:anywhere] text-xs text-danger`,children:t.message})]}),t.retry&&(0,j.jsx)(fr,{className:`shrink-0`,disabled:!n,onClick:n,size:`sm`,variant:`outline`,children:t.retry===`preview`?`重试检查`:`重试导入`})]})}function uQ(e){let t=e.tone===`success`?`border-success/30 bg-success-soft`:e.tone===`danger`?`border-danger/30 bg-danger-soft`:`border-line-strong bg-surface`;return(0,j.jsx)(`section`,{"aria-live":`polite`,className:`flex min-w-0 items-start gap-3 rounded-xl border p-4 shadow-card ${t}`,"data-provider-history":!0,children:e.children})}function dQ(e,t){let n=(0,E.useRef)(null);return(0,E.useEffect)(()=>{if(!e)return;function r(e){n.current?.contains(e.target)||t()}function i(e){e.key===`Escape`&&t()}return document.addEventListener(`pointerdown`,r),window.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,r),window.removeEventListener(`keydown`,i)}},[e,t]),n}function fQ({agents:e,area:t,selectedAgentId:n,theme:r,onAgent:i,onArea:a,onTheme:o}){return(0,j.jsxs)(`aside`,{className:P(`flex min-h-0 flex-col items-center gap-3 border-r px-2.5 py-3`,`bg-sidebar`,`border-line`),children:[(0,j.jsx)(`div`,{className:P(`mb-3 grid size-9 place-items-center rounded-md border`,`bg-accent`,`text-accent-ink`,`border-line-strong`),title:`AGNET · CodeBridge`,children:(0,j.jsx)(oQ,{className:`size-4`})}),(0,j.jsx)(`div`,{className:`grid w-full gap-2`,children:e.map(e=>{let r=t===`agents`&&n===e.agent_id;return(0,j.jsxs)(`button`,{"aria-label":e.display_name,"aria-pressed":r,className:P(`group relative grid size-[42px] place-items-center rounded-md border border-transparent transition-all duration-150 hover:-translate-y-px hover:opacity-80`,`text-muted`,r&&P(`bg-surface`,`text-ink`,`border-line-strong`,`shadow-card`)),onClick:()=>i(e.agent_id),title:`${e.display_name} · ${yn[e.status]??e.status}`,type:`button`,children:[r&&(0,j.jsx)(`span`,{"aria-hidden":`true`,className:P(`absolute bottom-1.5 left-0 top-1.5 w-[3px] rounded-full`,Ve(e.agent_id))}),(0,j.jsx)(He,{agentId:e.agent_id,className:`size-[18px]`})]},e.agent_id)})}),(0,j.jsx)(`div`,{className:P(`my-2 h-px w-8 border-t`,`border-line`)}),(0,j.jsx)(`button`,{"aria-label":`Skills`,"aria-pressed":t===`skills`,className:P(`grid size-9 place-items-center rounded-md transition-colors hover:opacity-80`,`text-muted`,t===`skills`&&P(`bg-surface`,`text-ink`,`shadow-card`)),onClick:()=>a(`skills`),title:`Skills`,type:`button`,children:(0,j.jsx)(re,{className:`size-3.5`})}),(0,j.jsx)(`div`,{className:`flex-1`}),(0,j.jsx)(`button`,{"aria-label":`设置`,"aria-pressed":t===`settings`,className:P(`grid size-9 place-items-center rounded-md transition-colors hover:opacity-80`,`text-muted`,t===`settings`&&P(`bg-surface`,`text-ink`,`shadow-card`)),onClick:()=>a(`settings`),title:`设置`,type:`button`,children:(0,j.jsx)(Oe,{className:`size-3.5`})}),(0,j.jsx)(`button`,{"aria-label":`切换主题`,className:P(`grid size-9 place-items-center rounded-md transition-all hover:-translate-y-px hover:opacity-80`,`text-muted`),onClick:o,title:r===`paper`?`Carbon Vermilion`:`Paper Lime`,type:`button`,children:(0,j.jsx)(je,{className:`size-3.5`})})]})}function pQ({session:e,selected:t,onSession:n,onUpdateSession:r,onDeleteSession:i}){let a=e.title||`未命名 Session`,[o,s]=(0,E.useState)(!1),[c,l]=(0,E.useState)(`actions`),[u,d]=(0,E.useState)(a);function f(){s(!1),l(`actions`)}let p=dQ(o,f);return(0,j.jsxs)(`div`,{className:`group relative`,ref:p,children:[(0,j.jsxs)(`button`,{className:P(`grid w-full gap-1 rounded-md border border-transparent px-3 py-2.5 pr-10 text-left transition-colors hover:opacity-80`,`text-ink`,t&&P(`bg-surface`,`border-line`,`shadow-card`)),onClick:()=>{f(),n(e)},title:a,type:`button`,children:[(0,j.jsx)(`span`,{className:`truncate text-xs font-medium`,children:a}),(0,j.jsxs)(`span`,{className:P(`flex items-center gap-1.5 text-xs`,`text-muted`),children:[e.pinned_at&&(0,j.jsx)(xe,{className:P(`size-3`,`text-warning`)}),e.status!==`idle`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{children:yn[e.status]??e.status}),(0,j.jsx)(`span`,{children:`·`})]}),(0,j.jsx)(`time`,{className:`font-mono`,children:Sn(e.updated_at)})]})]}),(0,j.jsx)(fr,{"aria-label":`管理 ${a}`,className:P(`absolute right-1.5 top-2.5 size-8 px-0`,`text-muted`,o?P(`bg-surface-soft`,`text-ink`):``),onClick:e=>{e.stopPropagation(),s(e=>!e),l(`actions`)},size:`icon`,variant:`ghost`,children:(0,j.jsx)(fe,{className:`size-3.5`})}),o&&(0,j.jsx)(`div`,{className:P(`absolute right-1.5 top-10 z-40 w-48 rounded-lg border p-1`,`bg-surface`,`border-line-strong`,`shadow-panel`),onClick:e=>e.stopPropagation(),children:c===`rename`?(0,j.jsxs)(`div`,{className:`space-y-2 p-2`,children:[(0,j.jsx)(`label`,{className:P(`text-xs`,`text-muted`),htmlFor:`session-name-${e.session_id}`,children:`Session 名称`}),(0,j.jsx)(`input`,{autoFocus:!0,className:P(`h-8 w-full rounded-md border bg-transparent px-2 text-xs outline-none`,`text-ink`,`border-line-strong`,`focus:border-muted focus-visible:ring-line-strong`),id:`session-name-${e.session_id}`,onChange:e=>d(e.target.value),onKeyDown:t=>{t.key===`Enter`&&u.trim()&&(r(e,{title:u.trim()}),f()),t.key===`Escape`&&f()},value:u}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,j.jsx)(gQ,{onClick:f,children:`取消`}),(0,j.jsx)(gQ,{disabled:!u.trim(),onClick:()=>{r(e,{title:u.trim()}),f()},children:`保存`})]})]}):c===`delete`?(0,j.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,j.jsx)(`p`,{className:P(`text-xs leading-5`,`text-muted`),children:`删除后无法恢复这个 Session。`}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,j.jsx)(gQ,{onClick:()=>l(`actions`),children:`取消`}),(0,j.jsx)(gQ,{danger:!0,onClick:()=>{i(e),f()},children:`删除`})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(gQ,{onClick:()=>{r(e,{pinned:!e.pinned_at}),f()},children:[(0,j.jsx)(xe,{className:`size-3.5`}),e.pinned_at?`取消 PIN`:`PIN Session`]}),(0,j.jsxs)(gQ,{onClick:()=>{d(a),l(`rename`)},children:[(0,j.jsx)(be,{className:`size-3.5`}),`重命名`]}),(0,j.jsxs)(gQ,{onClick:()=>{r(e,{archived:!e.archived_at}),f()},children:[(0,j.jsx)(ne,{className:`size-3.5`}),e.archived_at?`恢复 Session`:`归档`]}),(0,j.jsxs)(gQ,{danger:!0,onClick:()=>l(`delete`),children:[(0,j.jsx)(Ne,{className:`size-3.5`}),`删除`]})]})})]})}function mQ({agent:e,activeSessionCount:t,area:n,archivedSessionCount:r,loading:i,query:a,sessions:o,selectedSessionId:s,showArchived:c,onCreate:l,onQuery:u,onRefresh:d,onSession:f,onUpdateSession:p,onDeleteSession:m,onToggleArchived:h}){return(0,j.jsxs)(`aside`,{className:P(`flex min-h-0 min-w-0 flex-col border-r`,`bg-sidebar`,`border-line`),children:[(0,j.jsxs)(`header`,{className:`flex items-start justify-between gap-3 px-5 pb-4 pt-6`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:P(`mb-1 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-muted`),children:`当前 Agent`}),(0,j.jsx)(`h1`,{className:P(`truncate font-brand text-lg font-normal tracking-[-0.035em]`,`text-ink`),children:e?.display_name??`Agents`}),(0,j.jsx)(`p`,{className:P(`mt-1.5 flex items-center gap-1.5 text-xs`,`text-muted`),children:e?.status===`healthy`?`${o.length} 个会话`:`${yn[e?.status??`unavailable`]??e?.status??`不可用`} · ${o.length} 个会话`})]}),(0,j.jsxs)(`div`,{className:`flex gap-1`,children:[(0,j.jsx)(fr,{"aria-label":`刷新`,className:P(`size-8 px-0 hover:opacity-80`,`text-muted`),onClick:d,size:`icon`,variant:`ghost`,children:(0,j.jsx)(we,{className:P(`size-3.5`,i&&`animate-spin`)})}),n===`agents`&&(0,j.jsx)(fr,{"aria-label":`新建 Session`,className:P(`size-8 border px-0 hover:-translate-y-px hover:opacity-80`,`bg-surface`,`text-ink`,`border-line-strong`),disabled:!e||e.status!==`healthy`,onClick:l,size:`icon`,variant:`outline`,children:(0,j.jsx)(Ce,{className:`size-4`})})]})]}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`px-4 pb-3`,children:(0,j.jsxs)(`label`,{className:P(`flex h-[34px] items-center gap-2 rounded-md border px-2.5`,`bg-surface`,`border-line`),children:[(0,j.jsx)(Ee,{className:P(`size-3.5`,`text-muted`)}),(0,j.jsx)(`input`,{"aria-label":`搜索 Session`,className:P(`min-w-0 flex-1 bg-transparent text-xs outline-none`,`text-ink`,`placeholder:text-faint`),onChange:e=>u(e.target.value),placeholder:`搜索 Session`,value:a})]})}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2.5 pb-4`,children:[(0,j.jsxs)(`div`,{className:P(`px-2.5 py-2 font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-faint`),children:[(0,j.jsx)(`span`,{children:c?`已归档`:`会话`}),(0,j.jsx)(`span`,{className:`float-right font-mono`,children:c?r:t})]}),o.map(e=>(0,j.jsx)(pQ,{onDeleteSession:m,onSession:f,onUpdateSession:p,selected:s===e.session_id,session:e},e.session_id)),!i&&!o.length&&(0,j.jsx)(`div`,{className:P(`px-3 py-8 text-center text-xs`,`text-muted`),children:c?`暂无已归档 Session`:`当前 Agent 暂无 Session`})]}),(0,j.jsx)(`footer`,{className:P(`border-t px-3 py-2`,`border-line`),children:(0,j.jsxs)(`button`,{className:P(`flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-xs transition-opacity hover:opacity-80`,`text-muted`),onClick:h,type:`button`,children:[(0,j.jsx)(ne,{className:`size-3.5`}),(0,j.jsx)(`span`,{className:`flex-1`,children:c?`返回 Sessions`:`已归档`}),(0,j.jsx)(`span`,{className:`font-mono text-xs`,children:c?t:r})]})})]})]})}function hQ({agent:e,session:t,runState:n,menuOpen:r,menuView:i,panelOpen:a,renameDraft:o,onDelete:s,onMenu:c,onMenuView:l,onRenameDraft:u,onTogglePanel:d,onUpdate:f}){let p=dQ(r,c);return(0,j.jsxs)(`header`,{className:P(`flex min-h-[72px] min-w-0 shrink-0 items-center justify-between gap-5 border-b px-8 py-4`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 overflow-hidden`,children:[(0,j.jsx)(fr,{"aria-label":a?`收起 Session 面板`:`展开 Session 面板`,className:P(`size-8 shrink-0 px-0`,`text-muted`),onClick:d,size:`icon`,title:a?`收起面板`:`展开面板`,variant:`ghost`,children:(0,j.jsx)(oe,{className:P(`size-4 transition-transform`,a?`rotate-90`:`-rotate-90`)})}),e&&(0,j.jsx)(`span`,{"aria-hidden":`true`,className:P(`w-[3px] self-stretch shrink-0 rounded-full`,Ve(e.agent_id))}),` `,(0,j.jsx)(`span`,{className:P(`grid size-7 shrink-0 place-items-center rounded-md border`,`bg-accent`,`text-accent-ink`,`border-line-strong`),children:e?(0,j.jsx)(He,{agentId:e.agent_id,className:`size-3.5`}):(0,j.jsx)(oQ,{className:`size-3.5`})}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(`h2`,{className:P(`truncate font-brand text-sm font-normal tracking-[-0.02em]`,`text-ink`),title:t?.title||void 0,children:t?.title||(e?`${e.display_name} Session`:`CodeBridge`)}),(0,j.jsxs)(`p`,{className:P(`mt-0.5 truncate text-xs`,`text-muted`),children:[t?.cwd||e?.display_name||`Agent Workbench`,e&&e.status!==`healthy`?` · ${yn[e.status]??e.status}`:``]})]})]}),t&&(0,j.jsxs)(`div`,{className:`relative flex shrink-0 items-center gap-2`,ref:p,children:[n!==`idle`&&(0,j.jsxs)(`span`,{className:P(`hidden items-center gap-1.5 text-xs sm:flex`,`text-muted`),children:[(0,j.jsx)(`span`,{className:P(`size-1.5 rounded-full`,n===`running`?`bg-success`:`bg-warning`)}),n===`running`?`运行中`:`已暂停`]}),(0,j.jsx)(fr,{"aria-label":`Session 操作`,className:P(`size-8 px-0`,`text-muted`),onClick:c,size:`icon`,variant:`ghost`,children:(0,j.jsx)(fe,{className:`size-4`})}),r&&(0,j.jsx)(`div`,{className:P(`absolute right-0 top-11 z-30 w-56 rounded-lg border p-1`,`bg-surface`,`border-line-strong`,`shadow-panel`),children:i===`rename`?(0,j.jsxs)(`div`,{className:`space-y-2 p-2`,children:[(0,j.jsx)(`label`,{className:P(`text-xs`,`text-muted`),htmlFor:`session-name`,children:`Session 名称`}),(0,j.jsx)(`input`,{autoFocus:!0,className:P(`h-9 w-full rounded-md border bg-transparent px-2.5 text-sm outline-none`,`text-ink`,`border-line-strong`,`focus:border-muted focus-visible:ring-line-strong`),id:`session-name`,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o.trim()&&f({title:o.trim()}),e.key===`Escape`&&l(`actions`)},value:o}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,j.jsx)(gQ,{onClick:()=>l(`actions`),children:`取消`}),(0,j.jsx)(gQ,{disabled:!o.trim(),onClick:()=>f({title:o.trim()}),children:`保存`})]})]}):i===`delete`?(0,j.jsxs)(`div`,{className:`space-y-3 p-2`,children:[(0,j.jsx)(`p`,{className:P(`text-xs leading-5`,`text-muted`),children:`删除后无法从 CodeBridge 恢复这个 Session。`}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,j.jsx)(gQ,{onClick:()=>l(`actions`),children:`取消`}),(0,j.jsx)(gQ,{danger:!0,onClick:s,children:`删除`})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(gQ,{onClick:()=>f({pinned:!t.pinned_at}),children:[(0,j.jsx)(xe,{className:`size-3.5`}),t.pinned_at?`取消 PIN`:`PIN Session`]}),(0,j.jsxs)(gQ,{onClick:()=>{u(t.title||``),l(`rename`)},children:[(0,j.jsx)(be,{className:`size-3.5`}),`重命名`]}),(0,j.jsxs)(gQ,{onClick:()=>f({archived:!t.archived_at}),children:[(0,j.jsx)(ne,{className:`size-3.5`}),t.archived_at?`恢复 Session`:`归档`]}),(0,j.jsxs)(gQ,{danger:!0,onClick:()=>l(`delete`),children:[(0,j.jsx)(Ne,{className:`size-3.5`}),`删除`]})]})})]})]})}function gQ({children:e,danger:t=!1,disabled:n=!1,onClick:r}){return(0,j.jsx)(fr,{className:P(`w-full justify-start text-xs`,t?`text-danger`:`text-ink-soft`),disabled:n,onClick:r,size:`sm`,variant:`ghost`,children:e})}function _Q(e){if(!e.turns.length&&e.runtime.queue_state===`ready`)return null;let t=vQ(e.runtime.queue_pause_reason);return(0,j.jsxs)(`section`,{"aria-label":`下一轮队列`,className:`min-w-0 overflow-hidden rounded-lg border border-line bg-surface`,children:[(0,j.jsxs)(`header`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,j.jsxs)(`span`,{className:`text-xs font-semibold text-ink`,children:[`下一轮队列 · `,e.turns.length]}),e.runtime.queue_state===`paused`&&(0,j.jsx)(fr,{onClick:()=>e.onResume(e.runtime.version),size:`sm`,children:`继续队列`})]}),e.runtime.queue_state===`paused`&&(0,j.jsxs)(`p`,{className:`border-b border-line px-3 py-2 text-xs leading-5 text-ink-soft`,children:[t,e.turns.length?``:` 当前没有排队消息,再发一条会自动继续。`]}),(0,j.jsx)(`ol`,{className:`max-h-[min(40vh,24rem)] min-w-0 divide-y divide-line overflow-y-auto`,children:e.turns.map(t=>(0,j.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 py-2.5`,children:[(0,j.jsx)(`span`,{className:`font-mono text-xs text-faint`,children:t.queue_position}),(0,j.jsx)(`span`,{className:`line-clamp-2 min-w-0 [overflow-wrap:anywhere] text-xs text-ink-soft`,title:t.message.text,children:t.message.text}),(0,j.jsx)(fr,{"aria-label":`取消排队消息 ${t.queue_position}`,disabled:e.cancellingTurnId===t.turn_id,onClick:()=>e.onCancel(t.turn_id,t.version),size:`sm`,variant:`ghost`,children:`取消`})]},t.turn_id))}),e.runtime.queue.next_cursor!==null&&(0,j.jsx)(fr,{className:`w-full`,"data-load-more-queue":!0,disabled:e.loadingMore,onClick:e.onLoadMore,size:`sm`,variant:`ghost`,children:e.loadingMore?`正在加载…`:`加载更多排队消息`})]})}function vQ(e){switch(e){case`cancelled`:return`已取消,队列暂停。`;case`interrupted`:return`上一轮被中断,队列暂停。`;case`failed`:return`上一轮失败,队列暂停。`;case`stale`:return`排队已过期,未自动执行。`;default:return`队列已暂停。`}}function yQ(e,t){let n=e[t];return typeof n==`string`&&n?n:null}function bQ(e){switch(e.status){case`granted`:return`granted`;case`rejected`:return`rejected`;case`expired`:return`expired`;default:return`requested`}}function xQ(e){let t=e.block.metadata,n=yQ(t,`approval_id`),r=yQ(t,`step_id`)??`run`,i=yQ(t,`capability_id`),a=yQ(t,`environment`),o=yQ(t,`target_resource`),s=yQ(t,`expires_at`),c=e.effectiveStatus??bQ(e.block),l=n?{runId:e.runId,approvalId:n}:null;if(c!==`requested`){let e=c===`granted`,t=c===`expired`;return(0,j.jsxs)(`section`,{className:P(`grid max-w-[780px] gap-2 rounded-lg border p-3.5 shadow-card`,t?`border-warning/40 bg-warning-soft`:e?`border-success/40 bg-success-soft`:`border-danger/40 bg-danger-soft`),"data-runtime-approval":c,children:[(0,j.jsxs)(`p`,{className:P(`flex items-center gap-2 text-xs font-semibold`,t?`text-warning`:e?`text-success`:`text-danger`),children:[t?(0,j.jsx)(ue,{className:`size-3.5`}):e?(0,j.jsx)(ae,{className:`size-3.5`}):(0,j.jsx)(Ie,{className:`size-3.5`}),t?`审批已过期`:e?`Runtime 步骤已批准`:`Runtime 步骤已拒绝`]}),(0,j.jsx)(`p`,{className:`font-mono text-xs text-muted`,children:i??r}),t&&(0,j.jsx)(`p`,{className:`text-xs text-ink-soft`,children:`请重新发起 Run,或取消当前等待中的 Run。`})]})}return(0,j.jsxs)(`section`,{className:`grid max-w-[780px] gap-3 rounded-lg border border-warning/50 bg-surface p-3.5 shadow-card`,"data-runtime-approval":`requested`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-semibold text-ink`,children:[(0,j.jsx)(ke,{className:`size-3.5 text-warning`}),`Runtime 步骤需要审批`]}),(0,j.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:`仅本次 Run 有效`})]}),(0,j.jsxs)(`dl`,{className:`grid gap-1 font-mono text-xs text-muted`,children:[(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`步骤`}),(0,j.jsx)(`dd`,{className:`text-ink-soft`,children:r})]}),i&&(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`能力`}),(0,j.jsx)(`dd`,{className:`text-ink-soft`,children:i})]}),a&&(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`环境`}),(0,j.jsx)(`dd`,{className:`text-ink-soft`,children:a})]}),o&&(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`目标`}),(0,j.jsx)(`dd`,{className:`break-all text-ink-soft`,children:o})]}),s&&(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`过期`}),(0,j.jsx)(`dd`,{className:`text-ink-soft`,children:s})]})]}),!n&&(0,j.jsx)(`p`,{className:`text-xs text-danger`,children:`审批记录缺少 approval_id,无法安全操作。`}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(fr,{className:`h-8 text-xs`,disabled:!l||e.busy||!e.onResolve,onClick:()=>l&&e.onResolve?.(l,!0),size:`sm`,children:`允许一次`}),(0,j.jsx)(fr,{className:`h-8 text-xs`,disabled:!l||e.busy||!e.onResolve,onClick:()=>l&&e.onResolve?.(l,!1),size:`sm`,variant:`outline`,children:`拒绝并停止`})]})]})}function SQ(e){let t=(0,E.useRef)(null),n=(0,E.useRef)(null),r=null;for(let t of e.turns)if(t.run_id===e.activeRunId){for(let e of t.blocks)if(e.kind===`assistant`)for(let t of e.segments)t.sealed||(r=t.segment_id)}return(0,E.useEffect)(()=>{let r=e.turns.flatMap(e=>e.blocks.flatMap(e=>e.segments.map(e=>e.segment_id)));if(n.current===null){n.current=new Set(r);return}let i=new Set(e.turns.flatMap(t=>t.run_id===e.activeRunId?t.blocks.flatMap(e=>e.kind===`assistant`?e.segments.filter(e=>!e.sealed&&!n.current?.has(e.segment_id)).map(e=>e.segment_id):[]):[]));t.current?.querySelectorAll(`[data-segment-id]`).forEach(e=>{e.dataset.segmentId&&i.has(e.dataset.segmentId)&&e.classList.add(`assistant-reveal`)});for(let e of r)n.current.add(e)},[e.activeRunId,e.turns]),(0,j.jsxs)(`div`,{className:`grid gap-6`,ref:t,children:[e.hasEarlier&&(0,j.jsx)(fr,{className:`mx-auto`,"data-load-earlier":!0,disabled:e.loadingEarlier,onClick:e.onLoadEarlier,size:`sm`,variant:`ghost`,children:e.loadingEarlier?`正在加载…`:`加载更早对话`}),e.turns.map(t=>{let n=OQ(t,e.activeRunId);return(0,j.jsx)(`article`,{className:`grid gap-4`,"data-timeline-turn":t.turn_id,children:TQ(t.blocks).map(i=>i.kind===`group`?(0,j.jsx)(wQ,{blocks:i.blocks,liveBlockId:n,loadingBlockId:e.loadingBlockId,onLoadSegments:e.onLoadSegments},i.blocks.map(e=>e.block_id).join(`:`)):(0,j.jsx)(CQ,{activeAssistantSegmentId:i.block.kind===`assistant`?r:null,block:i.block,isLive:n===i.block.block_id,loading:e.loadingBlockId===i.block.block_id,onLoadSegments:e.onLoadSegments,onResolveApproval:e.onResolveApproval,resolvingApprovalId:e.resolvingApprovalId??null,approvalStatusOverrides:e.approvalStatusOverrides??{},runId:t.run_id},i.block.block_id))},t.turn_id)})]})}var CQ=(0,E.memo)(function(e){let{block:t}=e;if(AQ(t)&&!e.isLive)return null;let n=t.next_segment_cursor!==null&&!e.isLive&&(0,j.jsx)(fr,{disabled:e.loading,onClick:()=>e.onLoadSegments(t.block_id,t.next_segment_cursor),size:`sm`,variant:`ghost`,children:e.loading?`正在加载…`:`加载更多输出`});if(t.kind===`user_message`)return(0,j.jsxs)(`div`,{className:`grid justify-items-end gap-2`,children:[(0,j.jsx)(`span`,{className:`font-brand text-xs uppercase tracking-[0.1em] text-muted`,children:`你`}),(0,j.jsx)(`div`,{className:`max-w-[72%] rounded-xl bg-accent-soft px-3.5 py-3 text-sm leading-6 text-ink`,children:(0,j.jsx)(tQ,{content:t.segments.map(e=>e.content).join(``)})}),n]});if(t.kind===`assistant`)return(0,j.jsxs)(`div`,{className:`grid max-w-[780px] gap-2`,children:[(0,j.jsx)(`span`,{className:`font-brand text-xs font-normal uppercase tracking-[0.1em] text-muted`,children:`Agent`}),(0,j.jsx)(`div`,{className:`rounded-lg border border-line bg-surface px-3.5 py-3 shadow-card`,children:t.segments.map(t=>(0,j.jsx)(PQ,{segment:t,streamingCaret:t.segment_id===e.activeAssistantSegmentId},t.segment_id))}),n]});if(t.kind===`approval`){let n=typeof t.metadata.approval_id==`string`?t.metadata.approval_id:null;return(0,j.jsx)(xQ,{block:t,busy:n!==null&&n===e.resolvingApprovalId,effectiveStatus:n?e.approvalStatusOverrides[n]:void 0,onResolve:e.onResolveApproval,runId:e.runId})}return(0,j.jsx)(wQ,{blocks:[t],liveBlockId:e.isLive?t.block_id:null,loadingBlockId:e.loading?t.block_id:null,onLoadSegments:e.onLoadSegments})});function wQ(e){let[t]=(0,E.useState)(()=>new Date().toISOString()),n=e.blocks.filter(t=>!AQ(t)||t.block_id===e.liveBlockId);if(n.length===0)return null;let r=n.some(t=>t.block_id===e.liveBlockId),i=n.some(e=>e.kind===`thought`),a=EQ(n.map(MQ)),o=n.every(e=>NQ(e))?DQ(n.map(NQ)):null,s=a??(r?t:null),c=!r&&a&&o?xn(a,o):null;return(0,j.jsxs)(`details`,{open:i||r||n.some(e=>e.kind===`error`)||void 0,className:`group max-w-[780px] border-t border-line`,children:[(0,j.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 py-3 text-xs text-muted`,children:[r&&(0,j.jsx)(ve,{className:`size-3.5 animate-spin text-control-accent`}),(0,j.jsx)(`span`,{className:`font-medium text-ink-soft`,children:r?`工作中`:c?`耗时 ${c}`:FQ(n[0].kind)}),r&&s&&(0,j.jsx)(qZ,{startedAt:s}),(0,j.jsx)(oe,{className:`size-3.5 transition-transform group-open:rotate-180`})]}),(0,j.jsx)(`div`,{className:`grid gap-2 pb-4`,children:n.map(t=>{let n=t.next_segment_cursor!==null&&t.block_id!==e.liveBlockId&&(0,j.jsx)(fr,{disabled:e.loadingBlockId===t.block_id,onClick:()=>e.onLoadSegments(t.block_id,t.next_segment_cursor),size:`sm`,variant:`ghost`,children:e.loadingBlockId===t.block_id?`正在加载…`:`加载更多输出`});if(t.segments.length===0)return n;let r=MQ(t)&&NQ(t)?xn(MQ(t),NQ(t)):null;return(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsxs)(`div`,{className:P(`rounded-md border border-line bg-surface-tint px-3 py-2`,t.kind===`error`?`text-danger`:`text-ink-soft`),children:[t.kind===`thought`&&(0,j.jsx)(`p`,{className:`mb-1 font-brand text-xs font-normal uppercase tracking-[0.1em] text-warning`,children:r?`推理 ${r}`:`推理`}),t.segments.map(e=>(0,j.jsx)(PQ,{segment:e,tone:`work`},e.segment_id))]}),n]},t.block_id)})})]})}function TQ(e){let t=[];for(let n of e){if(!kQ(n.kind)){t.push({kind:`single`,block:n});continue}let e=t.at(-1);e?.kind===`group`?e.blocks.push(n):t.push({kind:`group`,blocks:[n]})}return t}function EQ(e){let t=e.filter(e=>!!e);return t.length?t.reduce((e,t)=>t<e?t:e):null}function DQ(e){let t=e.filter(e=>!!e);return t.length?t.reduce((e,t)=>t>e?t:e):null}function OQ(e,t){if(!t||e.run_id!==t)return null;let n=e.blocks.filter(e=>kQ(e.kind)&&e.status===`running`),r=n.find(e=>e.segments.some(e=>!e.sealed&&e.content));if(r)return r.block_id;let i=n.find(e=>e.kind===`thought`);if(i)return i.block_id;let a=n.find(e=>e.kind===`work`&&e.segments.some(e=>e.content));if(a)return a.block_id;let o=n.find(e=>e.kind===`tool`);return o?o.block_id:n[0]?.block_id??null}function kQ(e){return e===`thought`||e===`work`||e===`tool`}function AQ(e){return kQ(e.kind)&&e.segments.every(e=>!e.content)}function jQ(e,t){let n=e.metadata[t];return typeof n==`string`&&n?n:null}function MQ(e){return jQ(e,`started_at`)}function NQ(e){return jQ(e,`ended_at`)}var PQ=(0,E.memo)(function({segment:e,streamingCaret:t=!1,tone:n=`answer`}){return(0,j.jsx)(`div`,{"data-active-segment":!e.sealed||void 0,"data-segment-id":e.segment_id,"data-streaming-caret":t?!0:void 0,children:n===`work`?(0,j.jsx)(YZ,{content:e.content}):(0,j.jsx)(tQ,{content:e.content})})},(e,t)=>e.streamingCaret===t.streamingCaret&&e.tone===t.tone&&e.segment.segment_id===t.segment.segment_id&&e.segment.content===t.segment.content&&e.segment.sealed===t.segment.sealed);function FQ(e){switch(e){case`user_message`:return`消息`;case`assistant`:return`回复`;case`thought`:return`推理`;case`work`:return`工作过程`;case`tool`:return`工具调用`;case`approval`:return`等待批准`;case`error`:return`错误`;default:return`历史记录`}}function IQ(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`session_event_schema_mismatch`);let t=e;if(t.schema_version!==1||typeof t.event_id!=`string`||!Number.isInteger(t.sequence)||typeof t.work_item_id!=`string`||typeof t.run_id!=`string`&&t.run_id!==null||t.execution_kind!==`agent`&&t.execution_kind!==`flow`&&t.execution_kind!==null||t.run_id===null!=(t.execution_kind===null)||typeof t.type!=`string`||typeof t.occurred_at!=`string`||typeof t.actor!=`string`||typeof t.target!=`string`&&t.target!==null||typeof t.input_hash!=`string`&&t.input_hash!==null||typeof t.result_ref!=`string`&&t.result_ref!==null||!t.payload||typeof t.payload!=`object`||Array.isArray(t.payload))throw Error(`session_event_schema_mismatch`);return t}function LQ(e){let t=e.split(`
556
+
557
+ `),n=t.pop()??``,r=[];for(let e of t){let t=e.split(`
558
+ `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
559
+ `);t&&r.push(JSON.parse(t))}return{events:r,remainder:n}}var RQ=``;function zQ(e){RQ=e}var BQ=class extends Error{status;code;body;constructor(e,t,n,r=null){super(n),this.status=e,this.code=t,this.body=r,this.name=`ApiError`}};function VQ(e){let t=new Headers(e.headers);return RQ&&!t.has(`authorization`)&&t.set(`authorization`,`Bearer ${RQ}`),e.body!=null&&!t.has(`content-type`)&&t.set(`content-type`,`application/json`),t}async function HQ(e,t={}){let n=await fetch(e,{...t,headers:VQ(t)});if(!n.ok){let e=await n.json().catch(()=>null),t=e?.issues?.length?e.issues.join(`; `):void 0,r=[e?.message,e?.detail??e?.details??t].filter(e=>!!e).join(` · `)||`HTTP ${n.status}`;throw new BQ(n.status,e?.code??e?.error??`http_error`,r,e)}if(n.status!==204)return n.json()}async function UQ(e){let t=await HQ(`/v1/sessions/`+encodeURIComponent(e));return{...t,events:t.events??[],options:t.options??[],runs:t.runs??[]}}async function WQ(e={}){return HQ(`/v1/sessions/import`,{method:`POST`,body:JSON.stringify({cwd:e.cwd,agent_id:e.agentId})})}function GQ(e,t){let n=t.idempotencyKey?{"Idempotency-Key":t.idempotencyKey}:void 0,r={message:t.message,model:t.model,permission_mode:t.permissionMode,effort:t.effort,attachments:t.attachments};return HQ(`/v1/sessions/${encodeURIComponent(e)}/messages`,{method:`POST`,...n?{headers:n}:{},body:JSON.stringify(r)})}function KQ(e,t,n){return typeof t==`number`&&typeof n==`string`?HQ(`/v1/runs/${encodeURIComponent(e)}/cancel`,{method:`POST`,headers:{"Idempotency-Key":n,"If-Match":String(t)}}):HQ(`/v1/sessions/${encodeURIComponent(e)}/cancel`,{method:`POST`,body:`{}`})}async function qQ(e,t=0){let n=new URLSearchParams({after_sequence:String(t)}),r=await HQ(`/v1/sessions/${encodeURIComponent(e)}/events?${n}`);if(!Array.isArray(r.events)||!Number.isInteger(r.next_sequence)||typeof r.has_more!=`boolean`)throw Error(`session_event_schema_mismatch`);return{events:r.events.map(IQ),next_sequence:r.next_sequence,has_more:r.has_more}}async function JQ(e,t){let n=new URLSearchParams({limit:`100`});return t!==null&&n.set(`after_position`,String(t)),HQ(`/v1/sessions/${encodeURIComponent(e)}/queue?${n}`)}async function YQ(e,t){let n=new URLSearchParams({before:String(t),limit:`50`});return HQ(`/v1/sessions/${encodeURIComponent(e)}/timeline?${n}`)}async function XQ(e,t,n){let r=new URLSearchParams({after:String(n),limit:`100`});return HQ(`/v1/sessions/${encodeURIComponent(e)}/blocks/${encodeURIComponent(t)}/segments?${r}`)}async function ZQ(e,t,n){return HQ(`/v1/sessions/${encodeURIComponent(e)}/queue/resume`,{method:`POST`,headers:{"Idempotency-Key":n,"If-Match":String(t)}})}async function QQ(e,t,n,r){return HQ(`/v1/sessions/${encodeURIComponent(e)}/queue/${encodeURIComponent(t)}`,{method:`DELETE`,headers:{"Idempotency-Key":r,"If-Match":String(n)}})}async function $Q(e,t){return HQ(`/v1/sessions/${encodeURIComponent(e)}/submissions/${encodeURIComponent(t)}`)}var e$={skills:()=>HQ(`/v1/skills`),pickSkillSource:()=>HQ(`/v1/skills/sources/pick`,{method:`POST`,body:`{}`}),previewSkillAssignment:e=>HQ(`/v1/skills/assignments/preview`,{method:`POST`,body:JSON.stringify(e)}),previewSkillAdopt:e=>HQ(`/v1/skills/${encodeURIComponent(e)}/adopt/preview`,{method:`POST`}),previewSkillGlobalState:(e,t)=>HQ(`/v1/skills/${encodeURIComponent(e)}/global-state/preview`,{method:`POST`,body:JSON.stringify({enabled:t})}),previewSkillUnmanage:e=>HQ(`/v1/skills/${encodeURIComponent(e)}/unmanage/preview`,{method:`POST`}),applySkillPlan:(e,t)=>HQ(`/v1/skills/${e}-plans/${encodeURIComponent(t)}/apply`,{method:`POST`}),agents:()=>HQ(`/v1/agents`),detectAgent:e=>HQ(`/v1/agents/${encodeURIComponent(e)}/detect`,{method:`POST`}),detectAllAgents:()=>HQ(`/v1/agents/detect`,{method:`POST`}),installAgent:(e,t)=>HQ(`/v1/agents/${encodeURIComponent(e)}/install`,{method:`POST`,body:JSON.stringify({strategy_id:t})}),setDefaultAgent:e=>HQ(`/v1/settings/default-agent`,{method:`PATCH`,body:JSON.stringify({agent_id:e})}),sessions:async(e=!1,t=!1)=>{let n=new URLSearchParams;e&&n.set(`import`,`true`),t&&n.set(`include_archived`,`true`);let r=n.toString();return(await HQ(`/v1/sessions${r?`?${r}`:``}`)).sessions},importSessions:WQ,session:e=>HQ(`/v1/sessions/${encodeURIComponent(e)}`),openSession:UQ,previewProviderHistory:e=>HQ(`/v1/sessions/${encodeURIComponent(e)}/provider-history/preview`,{method:`POST`}),importProviderHistory:(e,t)=>HQ(`/v1/sessions/${encodeURIComponent(e)}/provider-history/import`,{method:`POST`,headers:{"Idempotency-Key":t},body:JSON.stringify({confirm:!0})}),createSession:e=>HQ(`/v1/sessions`,{method:`POST`,body:JSON.stringify({agent_id:e})}),updateSession:(e,t)=>HQ(`/v1/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteSession:e=>HQ(`/v1/sessions/${encodeURIComponent(e)}`,{method:`DELETE`}),configOptions:async e=>(await HQ(`/v1/sessions/${encodeURIComponent(e)}/config-options`)).options??[],providers:async()=>(await HQ(`/v1/providers`)).providers??{},saveProviders:e=>HQ(`/v1/providers`,{method:`PUT`,body:JSON.stringify(e)}),providerPresets:async()=>(await HQ(`/v1/providers/presets`)).presets??[],testProvider:e=>HQ(`/v1/providers/test`,{method:`POST`,body:JSON.stringify(e)}),commands:async e=>(await HQ(`/v1/sessions/${encodeURIComponent(e)}/commands`)).commands??[],pickDirectory:e=>HQ(`/v1/sessions/${encodeURIComponent(e)}/directories/pick`,{method:`POST`,body:`{}`}),workspaceEntries:(e,t,n=``)=>{let r=new URLSearchParams({path:n});return t&&r.set(`root`,t),HQ(`/v1/sessions/${encodeURIComponent(e)}/files?${r}`)},sendMessage:GQ,runs:async e=>(await HQ(`/v1/sessions/${encodeURIComponent(e)}/runs`)).runs,cancelRun:KQ,events:qQ,approvals:async e=>(await HQ(`/v1/runs/${encodeURIComponent(e)}/approvals`)).approvals,approve:(e,t)=>HQ(`/v1/runs/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify({approval_id:t})}),reject:(e,t)=>HQ(`/v1/runs/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify({approval_id:t})}),queue:JQ,timeline:YQ,segments:XQ,resumeQueue:ZQ,cancelQueuedTurn:QQ,submission:$Q};async function t$(e,t,n,r){let i=await fetch(`/v1/sessions/${encodeURIComponent(e)}/events?live=true&after_sequence=${t}`,{headers:VQ({}),signal:n});if(!i.ok||!i.body)throw Error(`无法连接事件流`);if(!(i.headers.get(`content-type`)?.toLowerCase()??``).includes(`text/event-stream`))throw Error(`session_event_transport_mismatch`);let a=i.body.getReader(),o=new TextDecoder,s=``,c=()=>{a.cancel().catch(()=>void 0)};n.aborted?c():n.addEventListener(`abort`,c,{once:!0});try{for(;;){let e=await a.read();if(e.done)return;s+=o.decode(e.value,{stream:!0});let t=LQ(s);s=t.remainder,t.events.map(IQ).forEach(r)}}finally{n.removeEventListener(`abort`,c),await a.cancel().catch(()=>void 0),a.releaseLock()}}var n$=ur(`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium tracking-wide`,{variants:{variant:{default:`border-line-strong bg-surface-soft text-ink-soft`,success:`border-line bg-surface text-success`,warning:`border-warning/25 bg-warning/10 text-warning`,muted:`border-line bg-surface-tint text-muted`}},defaultVariants:{variant:`default`}});function r$({className:e,variant:t,...n}){return(0,j.jsx)(`div`,{className:P(n$({variant:t}),e),...n})}var i$=[`openai-completions`,`openai-responses`,`anthropic-messages`],a$=[[`128K`,128e3],[`200K`,2e5],[`272K`,272e3],[`1M`,1e6]],o$={off:`none`,minimal:`minimal`,low:`low`,medium:`medium`,high:`high`};function s$({density:e,reading:t,onDensity:n,onReading:r,onNotify:i,agents:a,defaultAgentId:o,effectiveDefaultAgentId:s,onAgentsChanged:c,onProvidersChanged:l}){let[u,d]=(0,E.useState)(null),[f,p]=(0,E.useState)([]),[m,h]=(0,E.useState)(null),[g,_]=(0,E.useState)(null),[v,y]=(0,E.useState)(null),[b,x]=(0,E.useState)(!1),[S,C]=(0,E.useState)(!1),[w,T]=(0,E.useState)(null),[ee,D]=(0,E.useState)(null),[te,O]=(0,E.useState)(null),[ne,re]=(0,E.useState)({}),ie=(0,E.useCallback)(async()=>{try{let[e,t]=await Promise.all([e$.providers(),e$.providerPresets()]);d(e),p(t)}catch(e){T(e instanceof Error?e.message:String(e))}},[]);(0,E.useEffect)(()=>{ie()},[ie]);let ae=a.filter(e=>e.setup_manifest),oe=a.find(e=>e.agent_id===s)??null,k=!!(o&&o!==s);async function A(){await c()}function se(e,t){re(n=>({...n,[e]:t}))}async function ce(e){O({id:e.agent_id,kind:`detect`}),se(e.agent_id,null);try{await e$.detectAgent(e.agent_id),await A(),i(`${e.display_name} 已重新检测`)}catch(t){let n=t instanceof Error?t.message:String(t);se(e.agent_id,n),await A(),i(n,`error`)}finally{O(null)}}async function le(){O({id:`*`,kind:`detect`}),re({});try{await e$.detectAllAgents(),await A(),i(`全部 Agent 已重新检测`)}catch(e){i(e instanceof Error?e.message:String(e),`error`),await A()}finally{O(null)}}async function ue(e,t){let n=t.install_strategies.find(e=>e.available)??t.install_strategies[0];if(!n){i(`${t.display_name} 没有可用的安装策略`,`error`);return}let r=[n.command,...n.args].join(` `);if(window.confirm(`将执行以下安装命令:\n\n${r}\n\n继续吗?`)){O({id:e.agent_id,kind:`install`}),se(e.agent_id,null);try{await e$.installAgent(e.agent_id,n.id),await A(),i(`${t.display_name} 安装已完成`)}catch(t){let n=t instanceof Error?t.message:String(t);se(e.agent_id,n),await A(),i(n,`error`)}finally{O(null)}}}async function de(e){O({id:e.agent_id,kind:`default`}),se(e.agent_id,null);try{await e$.setDefaultAgent(e.agent_id),await A(),i(`${e.display_name} 已设为默认`)}catch(t){let n=t instanceof Error?t.message:String(t);se(e.agent_id,n),i(n,`error`)}finally{O(null)}}function fe(e){_(null),h(e?{id:e.id,baseUrl:e.baseUrl,api:e.api,apiKey:``,authHeader:!0,models:e.models.map(e=>({...e})),passthrough:{}}:{id:``,baseUrl:``,api:`openai-completions`,apiKey:``,authHeader:!0,models:[],passthrough:{}})}function pe(e,t){let{baseUrl:n,api:r,apiKey:i,authHeader:a,models:o,...s}=t;_(e),h({id:e,baseUrl:n,api:r,apiKey:i??``,authHeader:a??!0,models:(o??[]).map(e=>({...e})),passthrough:s})}async function me(){if(!(!m||!u)){C(!0),D(null);try{let e={providers:{...u}};g&&g!==m.id&&delete e.providers[g],e.providers[m.id]={...m.passthrough,baseUrl:m.baseUrl,api:m.api,apiKey:m.apiKey,authHeader:m.authHeader,models:m.models},await e$.saveProviders(e),d(e.providers),h(null),l(),i(`Provider 已保存`)}catch(e){D(e instanceof Error?e.message:String(e))}finally{C(!1)}}}async function he(e){if(!u)return;let t={providers:{...u}};delete t.providers[e];try{await e$.saveProviders(t),d(t.providers),y(null),i(`已删除 ${e}`)}catch(e){T(e instanceof Error?e.message:String(e))}}async function ge(){if(m){x(!0);try{let e=await e$.testProvider({baseUrl:m.baseUrl,apiKey:m.apiKey,authHeader:m.authHeader,api:m.api,model:m.models.find(e=>e.id.trim())?.id.trim()});e.compatSuggestion?(h({...m,models:m.models.map(t=>({...t,compat:{...t.compat,...e.compatSuggestion}}))}),i(`${e.detail},点击保存生效`,`info`)):i(e.detail,e.ok?`info`:`error`)}catch(e){i(e instanceof Error?e.message:String(e),`error`)}finally{x(!1)}}}return(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-[760px] px-8 py-8`,children:[(0,j.jsx)(`h1`,{className:P(`font-brand text-lg font-normal tracking-[-0.035em]`,`text-ink`),children:`设置`}),w&&(0,j.jsxs)(`div`,{className:P(`mt-4 flex items-start gap-2 rounded-md border px-3 py-2.5 text-xs`,`bg-danger-soft`,`text-danger`,`border-line-strong`),role:`alert`,children:[(0,j.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1`,children:w})]}),(0,j.jsxs)(`section`,{className:`mt-8`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`h2`,{className:P(`font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-faint`),children:`AGENTS`}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k&&(0,j.jsxs)(`span`,{className:P(`rounded-full border px-2 py-1 text-[11px]`,`bg-warning-soft`,`text-warning`,`border-warning/30`),children:[`默认 Agent 当前不可用`,oe?` · 正在使用 ${oe.display_name}`:``]}),(0,j.jsx)(`button`,{className:P(`rounded-full border px-2.5 py-1 text-[11px]`,`border-line-strong`,`text-ink-soft`,te?.id===`*`&&`opacity-50`),disabled:te!==null,onClick:()=>void le(),type:`button`,children:te?.id===`*`?`检测中…`:`检测全部`})]})]}),(0,j.jsx)(`div`,{className:`mt-4 grid gap-2`,children:ae.map(e=>{let t=e.setup,n=e.setup_manifest,r=o===e.agent_id,i=s===e.agent_id,a=te?.id===e.agent_id,c=t?.diagnostic,l=n.install_strategies.find(e=>e.available)??n.install_strategies[0]??null;return(0,j.jsxs)(`div`,{className:P(`grid gap-3 rounded-xl border px-4 py-4`,`bg-surface`,`border-line-strong`),children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`div`,{className:P(`flex flex-wrap items-center gap-2`,`text-ink`),children:[(0,j.jsx)(`span`,{className:`font-brand text-sm font-normal tracking-[-0.02em]`,children:n.display_name}),r&&(0,j.jsx)(r$,{children:`已保存默认`}),!r&&i&&(0,j.jsx)(r$,{children:`当前生效默认`})]}),(0,j.jsxs)(`div`,{className:P(`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-xs`,`text-muted`),children:[(0,j.jsx)(`span`,{children:f$(t)}),(0,j.jsx)(`span`,{children:p$(t)}),(0,j.jsx)(`span`,{children:m$(t)})]})]}),(0,j.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[(0,j.jsx)(`button`,{className:P(`rounded-full border px-2 py-1 text-[11px]`,`border-line-strong`,`text-muted`,a&&`opacity-50`),disabled:a,onClick:()=>void ce(e),type:`button`,children:te?.id===e.agent_id&&te.kind===`detect`?`检测中…`:`重新检测`}),(0,j.jsx)(`button`,{className:P(`rounded-full border px-2 py-1 text-[11px]`,`border-line-strong`,`text-muted`,!t?.can_select_default&&`opacity-40`,a&&`opacity-50`),disabled:!t?.can_select_default||a,onClick:()=>void de(e),type:`button`,children:r?`当前默认`:`设为默认`})]})]}),(0,j.jsxs)(`div`,{className:P(`grid gap-2 rounded-lg border px-3 py-3`,`bg-surface-tint`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,j.jsx)(`span`,{className:P(`rounded-full border px-2 py-0.5`,t?.installation===`installed`?`border-line bg-surface text-success`:t?.installation===`missing`?`border-danger/25 bg-danger-soft text-danger`:`border-line bg-surface text-muted`),children:f$(t)}),(0,j.jsx)(`span`,{className:P(`rounded-full border px-2 py-0.5`,t?.configuration===`configured`?`border-line bg-surface text-success`:t?.configuration===`needs_configuration`?`border-warning/25 bg-warning/10 text-warning`:`border-line bg-surface text-muted`),children:p$(t)}),(0,j.jsx)(`span`,{className:P(`rounded-full border px-2 py-0.5`,t?.runtime===`healthy`?`border-line bg-surface text-success`:t?.runtime===`unavailable`?`border-danger/25 bg-danger-soft text-danger`:`border-line bg-surface text-muted`),children:m$(t)}),t?.version&&(0,j.jsxs)(`span`,{className:`text-muted`,children:[`版本 `,t.version]})]}),(0,j.jsxs)(`div`,{className:`text-xs leading-5 text-muted`,children:[(0,j.jsx)(`div`,{children:n.configuration_owner===`codebridge`?`CodeBridge 管理该 Agent 的配置入口。`:n.documentation_url?`打开官方文档完成配置。`:`该 Agent 由自身配置入口管理。`}),n.configuration_path&&(0,j.jsx)(`div`,{className:`font-mono`,children:n.configuration_path}),l&&t?.installation===`missing`&&(0,j.jsxs)(`div`,{className:`mt-1 text-[11px]`,children:[`安装命令: `,(0,j.jsx)(`span`,{className:`font-mono`,children:[l.command,...l.args].join(` `)})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t?.installation===`missing`&&l?(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-accent`,`text-accent-ink`,`border-line-strong`,a&&`opacity-50`),disabled:a,onClick:()=>void ue(e,n),type:`button`,children:te?.id===e.agent_id&&te.kind===`install`?`安装中…`:`安装 ${n.display_name}`}):null,n.configuration_owner===`codebridge`?(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),onClick:()=>{document.getElementById(`providers-pi`)?.scrollIntoView({behavior:`smooth`,block:`start`})},type:`button`,children:`前往 Providers(Pi)`}):n.documentation_url?(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),onClick:()=>window.open(n.documentation_url,`_blank`,`noopener`),type:`button`,children:t?.configuration===`needs_configuration`?`查看配置方法`:`打开文档`}):null]})]}),(c||ne[e.agent_id])&&(0,j.jsxs)(`div`,{className:P(`rounded-lg border px-3 py-2 text-xs`,`bg-danger-soft`,`text-danger`,`border-danger/30`),children:[c&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`font-medium`,children:[c.stage,` · `,c.code]}),(0,j.jsx)(`div`,{className:`mt-1 leading-5`,children:c.message}),c.details&&(0,j.jsx)(`div`,{className:`mt-1 font-mono leading-5 text-[11px]`,children:c.details}),c.exit_code!==void 0&&(0,j.jsxs)(`div`,{className:`mt-1 font-mono text-[11px]`,children:[`exit code: `,c.exit_code]})]}),ne[e.agent_id]&&(0,j.jsx)(`div`,{className:c?`mt-1`:``,children:ne[e.agent_id]})]})]},e.agent_id)})})]}),(0,j.jsxs)(`section`,{className:`mt-8`,children:[(0,j.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,j.jsx)(`h2`,{className:P(`font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-faint`),id:`providers-pi`,children:`Providers(Pi)`})}),(0,j.jsx)(`p`,{className:P(`mt-1.5 text-xs leading-5`,`text-muted`),children:`管理 Pi 的模型供应商,写入本机 ~/.pi/agent/models.json。密钥仅保存在本机。`}),u===null?(0,j.jsxs)(`div`,{className:P(`mt-4 grid gap-2`),children:[(0,j.jsx)(`div`,{className:P(`skeleton-pixel h-14 animate-pulse rounded-lg`,`bg-surface-soft`)}),(0,j.jsx)(`div`,{className:P(`skeleton-pixel h-14 animate-pulse rounded-lg`,`bg-surface-soft`)})]}):(0,j.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[Object.entries(u).map(([e,t])=>(0,j.jsxs)(`div`,{className:P(`flex items-center gap-3 rounded-lg border px-3.5 py-3`,`bg-surface`,`border-line`),children:[(0,j.jsx)(Se,{className:P(`size-4 shrink-0`,`text-muted`)}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`div`,{className:P(`flex items-center gap-2 text-sm font-medium`,`text-ink`),children:[(0,j.jsx)(`span`,{className:`font-mono`,children:e}),(0,j.jsx)(`span`,{className:P(`text-xs font-normal`,t.apiKey?`text-success`:`text-warning`),children:t.apiKey?`已配置 key`:`缺 key`})]}),(0,j.jsxs)(`div`,{className:P(`mt-0.5 truncate text-xs`,`text-muted`),children:[t.baseUrl,` · `,t.models?.length??0,` 个模型`]})]}),v===e?(0,j.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:P(`text-xs`,`text-danger`),children:`确认删除?`}),(0,j.jsx)(`button`,{className:P(`rounded-md border px-2 py-1 text-xs`,`text-danger`,`border-line-strong`),onClick:()=>void he(e),type:`button`,children:`删除`}),(0,j.jsx)(`button`,{className:P(`rounded-md px-2 py-1 text-xs`,`text-muted`),onClick:()=>y(null),type:`button`,children:`取消`})]}):(0,j.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(`button`,{"aria-label":`编辑 ${e}`,className:P(`grid size-8 place-items-center rounded-md`,`text-muted`,`hover:bg-surface-soft`),onClick:()=>pe(e,t),type:`button`,children:(0,j.jsx)(be,{className:`size-3.5`})}),(0,j.jsx)(`button`,{"aria-label":`删除 ${e}`,className:P(`grid size-8 place-items-center rounded-md`,`text-muted`,`hover:bg-surface-soft`),onClick:()=>y(e),type:`button`,children:(0,j.jsx)(Ne,{className:`size-3.5`})})]})]},e)),Object.keys(u).length===0&&(0,j.jsx)(`div`,{className:P(`rounded-lg border border-dashed px-4 py-8 text-center text-xs`,`border-line-strong`,`text-muted`),children:`尚未配置 Provider,从下方预设开始`}),(0,j.jsxs)(`div`,{className:P(`mt-2 flex flex-wrap gap-2`),children:[f.map(e=>(0,j.jsxs)(`button`,{className:P(`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs transition-colors`,`bg-surface`,`text-ink-soft`,`border-line`,`hover:bg-surface-soft`),onClick:()=>fe(e),type:`button`,children:[(0,j.jsx)(Ce,{className:`size-3`}),e.name]},e.id)),(0,j.jsxs)(`button`,{className:P(`flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs`,`text-muted`,`border-line-strong`,`hover:bg-surface-soft`),onClick:()=>fe(null),type:`button`,children:[(0,j.jsx)(Ce,{className:`size-3`}),`自定义`]})]})]})]}),(0,j.jsxs)(`section`,{className:`mt-10`,children:[(0,j.jsx)(`h2`,{className:P(`font-brand text-xs font-normal uppercase tracking-[0.1em]`,`text-faint`),children:`显示`}),(0,j.jsxs)(`div`,{className:P(`mt-3 grid gap-3 rounded-lg border px-4 py-4`,`bg-surface`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:P(`text-xs`,`text-ink-soft`),children:`对话密度`}),(0,j.jsx)(`div`,{className:P(`flex rounded-md border p-0.5`,`border-line`),children:[`compact`,`comfortable`].map(t=>(0,j.jsx)(`button`,{"aria-pressed":e===t,className:P(`h-6 rounded px-2 text-xs transition-colors`,e===t?P(`bg-surface-soft`,`text-ink`):`text-muted`),onClick:()=>n(t),type:`button`,children:t===`compact`?`紧凑`:`舒展`},t))})]}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:P(`text-xs`,`text-ink-soft`),children:`衬线阅读模式`}),(0,j.jsx)(`button`,{"aria-pressed":t,className:P(`h-6 rounded-md border px-2 text-xs transition-colors`,`border-line`,t?P(`bg-surface-soft`,`text-ink`):`text-muted`),onClick:()=>r(!t),type:`button`,children:t?`已开启`:`已关闭`})]})]})]}),m&&(0,j.jsx)(l$,{draft:m,originalId:g,saveError:ee,saving:S,testing:b,onChange:e=>{h(e),D(null)},onClose:()=>h(null),onSave:()=>void me(),onTest:()=>void ge()})]})}var c$=/^[a-z0-9][a-z0-9_-]*$/;function l$({draft:e,originalId:t,saveError:n,saving:r,testing:i,onChange:a,onClose:o,onSave:s,onTest:c}){let l=e.id&&!c$.test(e.id)?`ID 只能含小写字母/数字/连字符/下划线,且以字母或数字开头`:null;function u(t){a({...e,...t})}function d(t,n){u({models:e.models.map((e,r)=>r===t?{...e,...n}:e)})}let f=e.id.trim()&&!l&&/^https?:\/\//.test(e.baseUrl)&&e.apiKey.trim();return(0,j.jsx)(`div`,{className:`fixed inset-0 z-50 bg-canvas/80`,onClick:o,role:`dialog`,"aria-modal":`true`,children:(0,j.jsxs)(`div`,{className:P(`mx-auto mt-[6vh] max-h-[86vh] w-full max-w-[560px] overflow-y-auto rounded-xl border p-5`,`bg-surface`,`border-line-strong`,`shadow-panel`),onClick:e=>e.stopPropagation(),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`h3`,{className:P(`text-sm font-semibold`,`text-ink`),children:t?`编辑 Provider · ${t}`:`添加 Provider`}),(0,j.jsx)(`button`,{"aria-label":`关闭`,className:P(`grid size-8 place-items-center rounded-md`,`text-muted`,`hover:bg-surface-soft`),onClick:o,type:`button`,children:(0,j.jsx)(k,{className:`size-4 rotate-90`})})]}),(0,j.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,j.jsxs)(u$,{label:`ID(小写字母/数字/连字符/下划线)`,children:[(0,j.jsx)(`input`,{"aria-invalid":!!l,className:P(d$(),l&&`border-danger`),disabled:!!t,onChange:e=>u({id:e.target.value.trim()}),placeholder:`deepseek`,value:e.id}),l&&(0,j.jsx)(`span`,{className:P(`text-[11px]`,`text-danger`),children:l})]}),(0,j.jsx)(u$,{label:`Base URL`,children:(0,j.jsx)(`input`,{className:d$(),onChange:e=>u({baseUrl:e.target.value.trim()}),placeholder:`https://api.deepseek.com/v1`,value:e.baseUrl})}),(0,j.jsx)(u$,{label:`API 协议`,children:(0,j.jsx)(`select`,{className:d$(),onChange:e=>u({api:e.target.value}),value:e.api,children:i$.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))})}),(0,j.jsx)(u$,{label:`API Key(明文保存在本机 models.json)`,children:(0,j.jsx)(`input`,{className:d$(),onChange:e=>u({apiKey:e.target.value}),placeholder:`sk-…`,value:e.apiKey})}),(0,j.jsxs)(`label`,{className:P(`flex items-center gap-2 text-xs`,`text-ink-soft`),children:[(0,j.jsx)(`input`,{checked:e.authHeader,onChange:e=>u({authHeader:e.target.checked}),type:`checkbox`}),`使用 Authorization: Bearer 头(关闭则发 x-api-key)`]}),(0,j.jsxs)(`div`,{className:`mt-1 flex items-center justify-between`,children:[(0,j.jsxs)(`span`,{className:P(`font-brand text-xs font-normal uppercase tracking-[0.08em]`,`text-faint`),children:[`模型(`,e.models.length,`)`]}),(0,j.jsxs)(`button`,{className:P(`flex items-center gap-1 rounded-md border px-2 py-1 text-xs`,`text-ink-soft`,`border-line`,`hover:bg-surface-soft`),onClick:()=>u({models:[...e.models,{id:``,reasoning:!1,input:[`text`]}]}),type:`button`,children:[(0,j.jsx)(Ce,{className:`size-3`}),`添加模型`]})]}),e.models.map((t,n)=>(0,j.jsxs)(`div`,{className:P(`grid gap-2 rounded-lg border p-3`,`bg-surface-tint`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{"aria-label":`模型 id`,className:P(d$(),`flex-1`),onChange:e=>d(n,{id:e.target.value.trim()}),placeholder:`模型 id,如 glm-4.6`,value:t.id}),(0,j.jsx)(`button`,{"aria-label":`移除模型`,className:P(`grid size-8 shrink-0 place-items-center rounded-md`,`text-muted`,`hover:bg-surface-soft`),onClick:()=>u({models:e.models.filter((e,t)=>t!==n)}),type:`button`,children:(0,j.jsx)(Ne,{className:`size-3.5`})})]}),(0,j.jsx)(`input`,{"aria-label":`显示名`,className:d$(),onChange:e=>d(n,{name:e.target.value}),placeholder:`显示名(可选)`,value:t.name??``}),(0,j.jsxs)(`div`,{className:`flex items-center gap-4 text-xs`,children:[(0,j.jsxs)(`label`,{className:P(`flex items-center gap-1.5`,`text-ink-soft`),children:[(0,j.jsx)(`input`,{checked:t.reasoning??!1,onChange:e=>d(n,e.target.checked?{reasoning:!0,thinkingLevelMap:t.thinkingLevelMap??{...o$}}:{reasoning:!1,thinkingLevelMap:void 0}),type:`checkbox`}),`支持推理(思考等级)`]}),(0,j.jsxs)(`label`,{className:P(`flex items-center gap-1.5`,`text-ink-soft`),children:[`上下文`,(0,j.jsxs)(`select`,{className:P(d$(),`w-28`),onChange:e=>d(n,{contextWindow:e.target.value===`custom`?t.contextWindow??128e3:Number(e.target.value)||void 0}),value:a$.some(([,e])=>e===t.contextWindow)?String(t.contextWindow):t.contextWindow?`custom`:`128000`,children:[a$.map(([e,t])=>(0,j.jsx)(`option`,{value:t,children:e},t)),t.contextWindow&&!a$.some(([,e])=>e===t.contextWindow)&&(0,j.jsxs)(`option`,{value:`custom`,children:[Math.round(t.contextWindow/1e3),`K(自定义)`]})]})]})]})]},n))]}),n&&(0,j.jsxs)(`div`,{className:P(`mt-4 flex items-start gap-2 rounded-md border px-3 py-2.5 text-xs`,`bg-danger-soft`,`text-danger`,`border-line-strong`),role:`alert`,children:[(0,j.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:n})]}),(0,j.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{className:P(`flex h-8 items-center gap-1.5 rounded-md border px-3 text-xs`,`bg-accent`,`text-accent-ink`,`border-line-strong`,(!f||r)&&`opacity-40`),disabled:!f||r,onClick:s,type:`button`,children:[r?(0,j.jsx)(ve,{className:`size-3.5 animate-spin`}):(0,j.jsx)(ae,{className:`size-3.5`}),`保存`]}),(0,j.jsxs)(`button`,{className:P(`flex h-8 items-center gap-1.5 rounded-md border px-3 text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),disabled:!/^https?:\/\//.test(e.baseUrl)||i,onClick:c,type:`button`,children:[i?(0,j.jsx)(ve,{className:`size-3.5 animate-spin`}):(0,j.jsx)(Le,{className:`size-3.5`}),`测试连接`]}),(0,j.jsx)(`span`,{className:`flex-1`}),(0,j.jsx)(`button`,{className:P(`h-8 rounded-md px-3 text-xs`,`text-muted`),onClick:o,type:`button`,children:`取消`})]})]})})}function u$({label:e,children:t}){return(0,j.jsxs)(`label`,{className:`grid gap-1`,children:[(0,j.jsx)(`span`,{className:P(`text-xs`,`text-muted`),children:e}),t]})}function d$(){return P(`h-8 w-full rounded-md border bg-transparent px-2.5 text-xs outline-none`,`text-ink`,`border-line-strong`,`placeholder:text-faint`,`focus:border-muted focus-visible:ring-line-strong`)}function f$(e){return e?e.installation===`installed`?e.version?`已安装 · ${e.version}`:`已安装`:e.installation===`missing`?`未安装`:`安装状态未知`:`安装状态未知`}function p$(e){return e?e.configuration===`configured`?`已配置`:e.configuration===`needs_configuration`?`待配置`:`配置状态未知`:`配置状态未知`}function m$(e){return e?e.runtime===`healthy`?`运行正常`:e.runtime===`unavailable`?`运行不可用`:`未启动`:`运行状态未知`}var h$={shared:`共享主目录`,disabled:`全局停用目录`,adopted:`已登记目录`,agent_native:`Agent 原生`},g$={follows_global:`跟随全局`,linked:`目录可见`,absent:`未分发`,conflict:`目标冲突`,broken:`软链断开`};function _$({onNotify:e}){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)(`catalog`),[a,o]=(0,E.useState)(``),[s,c]=(0,E.useState)(`all`),[l,u]=(0,E.useState)(`all`),[d,f]=(0,E.useState)(!0),[p,m]=(0,E.useState)(!1),[h,g]=(0,E.useState)(null),[_,v]=(0,E.useState)(null),[y,b]=(0,E.useState)(null),[x,S]=(0,E.useState)(null),[C,w]=(0,E.useState)(!1),[T,ee]=(0,E.useState)([]),D=(0,E.useCallback)(async(e=!1)=>{e||f(!0),g(null);try{n(await e$.skills())}catch(e){g(I$(e))}finally{f(!1)}},[]);(0,E.useEffect)(()=>{D()},[D]);let te=(0,E.useMemo)(()=>{let e=a.trim().toLowerCase();return(t?.skills??[]).filter(t=>{if(s!==`all`&&t.source_kind!==s)return!1;let n=!t.can_apply||t.global_state===`split_brain`||t.global_state===`invalid`||t.targets.some(e=>e.state===`conflict`||e.state===`broken`);return l===`healthy`&&n||l===`issue`&&!n?!1:!e||[t.name,t.description??``,t.source_path,...t.tags].join(` `).toLowerCase().includes(e)})},[a,t,s,l]),O=(0,E.useMemo)(()=>(t?.skills??[]).flatMap(e=>e.targets.filter(e=>e.state===`conflict`||e.state===`broken`).map(t=>({skill:e,target:t}))),[t]),ne=(0,E.useMemo)(()=>(t?.skills??[]).filter(e=>!e.can_apply||e.global_state===`split_brain`||e.global_state===`invalid`),[t]);function re(e,t,n=`ok`){ee(r=>[{id:crypto.randomUUID(),label:e,detail:t,kind:n},...r].slice(0,20))}async function ie(){m(!0),g(null);try{let t=await e$.pickSkillSource();if(`cancelled`in t)return;n(t),re(`Source 已登记`,`Runner 已重新扫描本机 Skill 目录`),e(`Skill Source 已登记`)}catch(t){let n=I$(t);g(n),re(`Source 登记失败`,n,`error`),e(n,`error`)}finally{m(!1)}}async function ae(t,n,r){let i=`${t.id}:${n}`;S(i),g(null);try{b(await e$.previewSkillAssignment({skill_id:t.id,agent_id:n,enabled:r}))}catch(t){let n=I$(t);g(n),e(n,`error`)}finally{S(null)}}async function oe(t,n){S(`${t.id}:${n}`),g(null);try{let e=n===`adopt`?await e$.previewSkillAdopt(t.id):n===`unmanage`?await e$.previewSkillUnmanage(t.id):await e$.previewSkillGlobalState(t.id,t.global_state!==`enabled`);b(e)}catch(t){let n=I$(t);g(n),e(n,`error`)}finally{S(null)}}async function k(){if(y){w(!0),g(null);try{let t=await e$.applySkillPlan(y.kind,y.plan_id);n(t.snapshot),re(`Skill 变更已应用`,`${y.skill_id} · ${y.kind}`),b(null),v(null),e(`Skill 变更已应用`)}catch(t){let n=I$(t);g(n),re(`Skill 变更失败`,n,`error`),e(n,`error`)}finally{w(!1)}}}return(0,j.jsxs)(`section`,{"aria-label":`Skill 管理`,className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,j.jsxs)(`header`,{className:P(`flex min-h-[72px] shrink-0 items-center justify-between gap-4 border-b px-8`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:P(`font-brand text-xs uppercase tracking-[0.1em]`,`text-muted`),children:`Skills / 本机能力资产`}),(0,j.jsx)(`h1`,{className:P(`mt-1 truncate font-brand text-lg font-normal tracking-[-0.035em]`,`text-ink`),children:`Skill 管理`})]}),(0,j.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,j.jsxs)(`button`,{"aria-label":`重新扫描 Skill`,className:A$(!1),disabled:d,onClick:()=>void D(),title:`重新扫描 Skill`,type:`button`,children:[(0,j.jsx)(we,{className:P(`size-4`,d&&`animate-spin`)}),(0,j.jsx)(`span`,{className:`hidden sm:inline`,children:`重新扫描`})]}),(0,j.jsxs)(`button`,{"aria-label":`添加 Skill`,className:A$(!0),disabled:p,onClick:()=>void ie(),title:`添加本机 Skill Source`,type:`button`,children:[p?(0,j.jsx)(ve,{className:`size-4 animate-spin`}):(0,j.jsx)(he,{className:`size-4`}),(0,j.jsx)(`span`,{className:`hidden sm:inline`,children:`添加 Skill`})]})]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-8 py-6 max-md:px-4 max-md:py-4`,children:[h&&(0,j.jsxs)(`div`,{className:P(`mb-4 flex items-start gap-2 rounded-md border px-3 py-2.5 text-xs`,`bg-danger-soft text-danger border-line-strong`),role:`alert`,children:[(0,j.jsx)(Pe,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1`,children:h}),(0,j.jsx)(`button`,{"aria-label":`关闭错误`,onClick:()=>g(null),type:`button`,children:(0,j.jsx)(Ie,{className:`size-3.5`})})]}),(0,j.jsxs)(`div`,{className:P(`mb-5 grid grid-cols-4 overflow-hidden rounded-md border max-lg:grid-cols-2 max-sm:grid-cols-1`,`border-line`),children:[(0,j.jsx)(v$,{label:`技能目录`,note:`${t?.summary.sources??0} 类来源`,value:t?.summary.total??0}),(0,j.jsx)(v$,{label:`目录投影`,note:`含 Agent 原生目录`,value:t?.summary.linked??0}),(0,j.jsx)(v$,{label:`目标 Agent`,note:`Runner Adapter`,value:t?.targets.length??0}),(0,j.jsx)(v$,{label:`需要处理`,note:`冲突与断链`,tone:`warning`,value:t?.summary.issues??0})]}),(0,j.jsx)(`nav`,{"aria-label":`Skill 管理视图`,className:P(`mb-4 flex h-10 gap-6 overflow-x-auto border-b`,`border-line`),children:[[`catalog`,`技能目录`],[`assignment`,`Agent 分发`],[`reconcile`,`软链对账`],[`activity`,`活动记录`]].map(([e,t])=>(0,j.jsx)(`button`,{"aria-pressed":r===e,className:P(`h-10 shrink-0 border-b-2 border-transparent px-0.5 font-brand text-xs`,`text-muted`,r===e&&`border-accent text-accent`),onClick:()=>i(e),type:`button`,children:t},e))}),r===`catalog`&&(0,j.jsx)(y$,{filtered:te,loading:d,query:a,source:s,state:l,total:t?.skills.length??0,onQuery:o,onSelect:v,onSource:c,onState:u}),r===`assignment`&&(0,j.jsx)(x$,{previewing:x,snapshot:t,onPreview:(e,t,n)=>void ae(e,t,n)}),r===`reconcile`&&(0,j.jsx)(S$,{issues:O,packageIssues:ne}),r===`activity`&&(0,j.jsx)(C$,{activities:T,scannedAt:t?.scanned_at??null})]}),_&&(0,j.jsx)(w$,{previewing:x,skill:_,onClose:()=>v(null),onPreview:e=>void oe(_,e)}),y&&(0,j.jsx)(T$,{applying:C,preview:y,onApply:()=>void k(),onClose:()=>b(null)})]})}function v$({label:e,value:t,note:n,tone:r}){return(0,j.jsxs)(`div`,{className:P(`min-w-0 border-r p-4 last:border-r-0 max-lg:[&:nth-child(2)]:border-r-0 max-sm:border-b max-sm:border-r-0 max-sm:last:border-b-0`,`bg-surface border-line`),children:[(0,j.jsx)(`div`,{className:P(`text-xs`,`text-muted`),children:e}),(0,j.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-baseline gap-2`,children:[(0,j.jsx)(`span`,{className:P(`font-mono text-2xl`,r===`warning`?`text-warning`:`text-ink`),children:t}),(0,j.jsx)(`span`,{className:P(`truncate text-[11px]`,`text-faint`),children:n})]})]})}function y$({filtered:e,loading:t,query:n,source:r,state:i,total:a,onQuery:o,onSelect:s,onSource:c,onState:l}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`mb-4 grid min-w-0 grid-cols-[minmax(220px,360px)_132px_132px_minmax(0,1fr)] gap-2 max-lg:grid-cols-[minmax(160px,1fr)_120px_120px] max-sm:grid-cols-[minmax(0,1fr)_44px_44px]`,children:[(0,j.jsxs)(`label`,{className:P(`flex h-9 min-w-0 items-center gap-2 rounded-md border px-3`,`bg-surface border-line`),children:[(0,j.jsx)(Ee,{className:P(`size-3.5 shrink-0`,`text-faint`)}),(0,j.jsx)(`input`,{"aria-label":`搜索 Skill`,className:P(`min-w-0 flex-1 bg-transparent text-xs outline-none`,`text-ink placeholder:text-faint`),onChange:e=>o(e.target.value),placeholder:`搜索名称、说明、标签或来源`,value:n})]}),(0,j.jsx)(k$,{label:`筛选 Skill 来源`,options:[[`all`,`全部来源`],[`shared`,`共享主目录`],[`disabled`,`全局停用`],[`adopted`,`已登记目录`],[`agent_native`,`Agent 原生`]],value:r,onValue:e=>c(e)}),(0,j.jsx)(k$,{label:`筛选 Skill 状态`,options:[[`all`,`全部状态`],[`healthy`,`正常`],[`issue`,`需处理`]],value:i,onValue:e=>l(e)}),(0,j.jsxs)(`div`,{className:P(`self-center truncate text-right text-xs max-lg:hidden`,`text-faint`),children:[`显示 `,e.length,` / `,a,` 个 Skill`]})]}),t&&!e.length?(0,j.jsx)(`div`,{className:P(`grid min-h-48 place-items-center rounded-md border`,`bg-surface border-line text-muted`),children:(0,j.jsx)(ve,{className:`size-5 animate-spin`})}):e.length?(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-3 max-xl:grid-cols-2 max-md:grid-cols-1`,children:e.map(e=>(0,j.jsx)(b$,{onSelect:s,skill:e},e.id))}):(0,j.jsx)(`div`,{className:P(`grid min-h-48 place-items-center rounded-md border border-dashed text-xs`,`border-line-strong text-muted`),children:`没有匹配的 Skill`})]})}function b$({skill:e,onSelect:t}){let n=e.targets.filter(e=>e.state===`conflict`||e.state===`broken`).length+ +!e.can_apply,r=e.targets.filter(e=>e.state===`linked`||e.state===`follows_global`).length;return(0,j.jsxs)(`button`,{className:P(`group flex min-h-48 min-w-0 flex-col rounded-md border p-4 text-left transition-all hover:-translate-y-px hover:opacity-90`,`bg-surface border-line hover:border-line-strong`),onClick:()=>t(e),type:`button`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,j.jsx)(`span`,{className:P(`grid size-9 shrink-0 place-items-center rounded-md border`,`bg-surface-soft border-line-strong text-muted`),children:(0,j.jsx)(re,{className:`size-4`})}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h2`,{className:P(`truncate text-sm font-semibold`,`text-ink`),children:e.name}),(0,j.jsxs)(`p`,{className:P(`mt-0.5 truncate font-mono text-[10px]`,`text-faint`),children:[h$[e.source_kind],` · `,N$(e.source_path)]})]}),(0,j.jsx)(O$,{issue:n>0,label:n?`${n} 项异常`:`正常`})]}),(0,j.jsx)(`p`,{className:P(`my-4 line-clamp-2 min-h-10 text-xs leading-5`,`text-muted`),children:e.description||`未提供说明`}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.tags.slice(0,4).map(e=>(0,j.jsx)(`span`,{className:P(`rounded border px-1.5 py-0.5 font-mono text-[9px]`,`bg-canvas border-line text-faint`),children:e},e))}),(0,j.jsxs)(`div`,{className:P(`mt-auto flex items-center justify-between border-t pt-3 text-[10px]`,`border-line text-faint`),children:[(0,j.jsx)(`span`,{className:`font-mono`,children:e.package_revision.slice(0,8)}),(0,j.jsxs)(`span`,{children:[P$(e.global_state),` · `,r,` 个目标`]})]})]})}function x$({snapshot:e,previewing:t,onPreview:n}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:P(`mb-3 flex items-start gap-2 border-l-2 px-3 py-2.5 text-xs leading-5`,`bg-surface border-accent text-muted`),children:[(0,j.jsx)(_e,{className:`mt-0.5 size-3.5 shrink-0 text-accent`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{className:`text-ink`,children:`共享原生 Agent 跟随全局状态。`}),`只有 Claude Code 使用独立软链开关;目录正确不代表运行中的 Agent 已热加载。`]})]}),(0,j.jsx)(`div`,{className:P(`w-full max-w-full overflow-x-auto overflow-y-hidden rounded-md border`,`border-line`),children:(0,j.jsxs)(`table`,{className:`w-full min-w-[1080px] table-fixed border-collapse`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsx)(`tr`,{children:[`Skill`,...e?.targets.map(e=>e.display_name)??[]].map((e,t)=>(0,j.jsx)(`th`,{className:P(`h-12 border-b border-r px-3 text-left text-[10px] last:border-r-0`,`bg-surface-tint border-line text-muted`,t===0&&`sticky left-0 z-10 w-[250px]`),children:e},e))})}),(0,j.jsx)(`tbody`,{children:e?.skills.map(r=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{className:P(`sticky left-0 z-10 h-[68px] w-[250px] border-b border-r px-3`,`bg-surface border-line`),children:(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:P(`grid size-8 shrink-0 place-items-center rounded-md border`,`bg-surface-soft border-line text-muted`),children:(0,j.jsx)(re,{className:`size-3.5`})}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`truncate text-xs font-medium`,children:r.name}),(0,j.jsx)(`div`,{className:P(`truncate font-mono text-[9px]`,`text-faint`),children:r.revision.slice(0,8)})]})]})}),e.targets.map(e=>{let i=r.targets.find(t=>t.agent_id===e.agent_id),a=i.state===`linked`,o=!i.mutable,s=`${r.id}:${e.agent_id}`;return(0,j.jsx)(`td`,{className:P(`h-[68px] border-b border-r px-3 last:border-r-0`,`bg-surface border-line`),children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:P(`truncate text-[11px]`,M$(i.state)),children:g$[i.state]}),(0,j.jsx)(`div`,{className:P(`truncate text-[9px]`,`text-faint`),children:o?P$(r.global_state):i.state===`linked`?`受管软链可读`:i.state===`absent`?`未创建软链`:i.detail})]}),o?(0,j.jsx)(`span`,{className:P(`shrink-0 rounded border px-1.5 py-0.5 text-[9px]`,`border-line text-faint`),children:`只读`}):(0,j.jsx)(`button`,{"aria-label":`${a?`移除`:`分发`} ${r.name} ${a?`从`:`到`} ${e.display_name}`,"aria-pressed":a,className:P(`relative h-[18px] w-[30px] shrink-0 rounded-full border`,a?`border-accent/50 bg-accent/20`:`bg-surface-soft border-line-strong`),disabled:t===s||r.ownership!==`codebridge_managed`,onClick:()=>n(r,e.agent_id,!a),type:`button`,children:(0,j.jsx)(`span`,{className:P(`absolute top-[3px] size-[10px] rounded-full transition-transform`,a?`left-[15px] bg-accent`:`left-[3px] bg-faint`)})})]})},e.agent_id)})]},r.id))})]})})]})}function S$({issues:e,packageIssues:t}){return!e.length&&!t.length?(0,j.jsx)(`div`,{className:P(`grid min-h-48 place-items-center rounded-md border text-xs`,`bg-surface border-line text-muted`),children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(ae,{className:`size-4 text-success`}),`当前没有包冲突、软链冲突或断链`]})}):(0,j.jsxs)(`div`,{className:P(`overflow-hidden rounded-md border`,`bg-surface border-line`),children:[t.map(e=>(0,j.jsxs)(`div`,{className:P(`grid min-w-0 grid-cols-[minmax(160px,1fr)_minmax(220px,1.6fr)_110px] items-center gap-4 border-b px-4 py-3 max-md:grid-cols-[minmax(0,1fr)_100px]`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`div`,{className:`truncate text-xs font-medium`,children:[e.name,` · Package`]}),(0,j.jsx)(`div`,{className:P(`mt-0.5 truncate text-[10px]`,`text-faint`),children:`需要人工处理,CodeBridge 不会自动选边或覆盖`})]}),(0,j.jsx)(`div`,{className:P(`truncate font-mono text-[10px] max-md:hidden`,`text-muted`),children:e.source_path}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-warning`,children:[(0,j.jsx)(Pe,{className:`size-3.5`}),P$(e.global_state)]})]},`${e.id}:package`)),e.map(({skill:e,target:t})=>(0,j.jsxs)(`div`,{className:P(`grid min-w-0 grid-cols-[minmax(160px,1fr)_minmax(220px,1.6fr)_110px] items-center gap-4 border-b px-4 py-3 last:border-b-0 max-md:grid-cols-[minmax(0,1fr)_100px]`,`border-line`),children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`div`,{className:`truncate text-xs font-medium`,children:[e.name,` → `,t.agent_id]}),(0,j.jsx)(`div`,{className:P(`mt-0.5 truncate text-[10px]`,`text-faint`),children:t.detail})]}),(0,j.jsx)(`div`,{className:P(`truncate font-mono text-[10px] max-md:hidden`,`text-muted`),children:t.target_path}),(0,j.jsxs)(`div`,{className:P(`flex items-center gap-1.5 text-[11px]`,M$(t.state)),children:[(0,j.jsx)(Pe,{className:`size-3.5`}),g$[t.state]]})]},`${e.id}:${t.agent_id}`))]})}function C$({activities:e,scannedAt:t}){let n=e.length?e:[{id:`scan`,label:`目录扫描完成`,detail:t?new Date(t).toLocaleString():`等待首次扫描`,kind:`ok`}];return(0,j.jsx)(`div`,{className:P(`overflow-hidden rounded-md border`,`bg-surface border-line`),children:n.map(e=>(0,j.jsxs)(`div`,{className:P(`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,`border-line`),children:[(0,j.jsx)(`span`,{className:P(`grid size-7 shrink-0 place-items-center rounded-full`,e.kind===`ok`?`bg-success/10 text-success`:`bg-danger-soft text-danger`),children:e.kind===`ok`?(0,j.jsx)(ae,{className:`size-3.5`}):(0,j.jsx)(Pe,{className:`size-3.5`})}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`text-xs font-medium`,children:e.label}),(0,j.jsx)(`div`,{className:P(`mt-0.5 truncate text-[10px]`,`text-faint`),children:e.detail})]})]},e.id))})}function w$({skill:e,previewing:t,onClose:n,onPreview:r}){let i=e.ownership===`codebridge_managed`;return(0,j.jsx)(`div`,{className:`fixed inset-y-0 left-[60px] right-0 z-40 bg-black/60`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,j.jsxs)(`aside`,{className:P(`ml-auto flex h-full w-[min(450px,calc(100vw-60px))] flex-col border-l`,`bg-surface border-line-strong`),children:[(0,j.jsxs)(`header`,{className:P(`flex min-h-[72px] items-center justify-between border-b px-5`,`border-line`),children:[(0,j.jsx)(`h2`,{className:`font-brand text-sm`,children:`Skill 详情`}),(0,j.jsx)(`button`,{"aria-label":`关闭 Skill 详情`,className:j$(),onClick:n,type:`button`,children:(0,j.jsx)(Ie,{className:`size-4`})})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`span`,{className:P(`grid size-11 place-items-center rounded-md border`,`bg-surface-soft border-line-strong text-muted`),children:(0,j.jsx)(re,{className:`size-5`})}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`h3`,{className:`truncate text-base font-semibold`,children:e.name}),(0,j.jsxs)(`p`,{className:P(`truncate font-mono text-[10px]`,`text-faint`),children:[h$[e.source_kind],` · `,P$(e.global_state)]})]})]}),(0,j.jsx)(`p`,{className:P(`my-5 text-xs leading-6`,`text-muted`),children:e.description||`未提供说明`}),(0,j.jsxs)(`div`,{className:`mb-5 flex flex-wrap gap-2`,children:[!i&&e.ownership!==`native_managed`&&(0,j.jsx)(`button`,{className:A$(!0),disabled:!e.can_apply||t!==null,onClick:()=>r(`adopt`),type:`button`,children:`纳管 Skill`}),i&&(0,j.jsx)(`button`,{className:A$(!0),disabled:!e.can_apply||t!==null,onClick:()=>r(`global_state`),type:`button`,children:e.global_state===`enabled`?`全局停用`:`全局启用`}),i&&(0,j.jsx)(`button`,{className:A$(!1),disabled:t!==null,onClick:()=>r(`unmanage`),type:`button`,children:`取消纳管`})]}),(0,j.jsxs)(E$,{title:`包信息`,children:[(0,j.jsx)(D$,{label:`Source`,value:e.source_path,mono:!0}),(0,j.jsx)(D$,{label:`Revision`,value:e.package_revision,mono:!0}),(0,j.jsx)(D$,{label:`Ownership`,value:e.ownership}),(0,j.jsx)(D$,{label:`更新时间`,value:new Date(e.updated_at).toLocaleString()})]}),(0,j.jsx)(E$,{title:`Agent 目录状态`,children:e.targets.map(e=>(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,j.jsx)(`span`,{className:P(`grid size-6 shrink-0 place-items-center rounded border`,`border-line text-muted`),children:(0,j.jsx)(He,{agentId:e.agent_id,className:`size-3`})}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`text-xs`,children:e.agent_id}),(0,j.jsx)(`div`,{className:P(`truncate font-mono text-[9px]`,`text-faint`),children:e.target_path})]})]}),(0,j.jsx)(`span`,{className:P(`shrink-0 text-[10px]`,M$(e.state)),children:g$[e.state]})]},e.agent_id))})]})]})})}function T$({preview:e,applying:t,onApply:n,onClose:r}){return(0,j.jsx)(`div`,{className:`fixed inset-0 z-50 grid place-items-center bg-black/70 p-4`,children:(0,j.jsxs)(`section`,{"aria-modal":`true`,className:P(`w-full max-w-[600px] overflow-hidden rounded-lg border`,`bg-surface border-line-strong`),role:`dialog`,children:[(0,j.jsxs)(`header`,{className:P(`flex items-center justify-between border-b px-5 py-4`,`border-line`),children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:P(`font-brand text-[10px] uppercase tracking-[0.1em]`,`text-muted`),children:`变更预览`}),(0,j.jsxs)(`h2`,{className:`mt-1 text-base font-semibold`,children:[F$(e.kind),` · `,e.skill_id]})]}),(0,j.jsx)(`button`,{"aria-label":`关闭变更预览`,className:j$(),onClick:r,type:`button`,children:(0,j.jsx)(Ie,{className:`size-4`})})]}),(0,j.jsxs)(`div`,{className:`max-h-[65vh] space-y-4 overflow-y-auto p-5`,children:[(0,j.jsxs)(`div`,{className:P(`grid grid-cols-[88px_minmax(0,1fr)] gap-2 rounded-md border p-3 text-xs`,`bg-canvas border-line`),children:[(0,j.jsx)(`span`,{className:`text-faint`,children:`Source`}),(0,j.jsx)(`code`,{className:`min-w-0 break-all text-ink-soft`,children:e.source_path}),(0,j.jsx)(`span`,{className:`text-faint`,children:`Target`}),(0,j.jsx)(`code`,{className:`min-w-0 break-all text-ink-soft`,children:e.target_path}),(0,j.jsx)(`span`,{className:`text-faint`,children:`Revision`}),(0,j.jsx)(`code`,{className:`min-w-0 break-all text-ink-soft`,children:e.package_revision}),(0,j.jsx)(`span`,{className:`text-faint`,children:`有效期`}),(0,j.jsx)(`span`,{children:new Date(e.expires_at).toLocaleString()})]}),(0,j.jsx)(`div`,{className:`space-y-2`,children:e.steps.map((e,t)=>(0,j.jsxs)(`div`,{className:P(`flex gap-3 rounded-md border px-3 py-2.5 text-xs`,`border-line bg-surface-soft`),children:[(0,j.jsx)(`span`,{className:`font-mono text-faint`,children:t+1}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`font-medium`,children:e.action}),(0,j.jsx)(`div`,{className:`mt-0.5 text-muted`,children:e.detail})]})]},`${e.action}:${t}`))}),!e.can_apply&&(0,j.jsxs)(`div`,{className:P(`flex gap-2 rounded-md border px-3 py-2.5 text-xs`,`bg-warning-soft border-warning/30 text-warning`),children:[(0,j.jsx)(Pe,{className:`size-4 shrink-0`}),e.detail||`观察到冲突,禁止 Apply`]}),(0,j.jsx)(`p`,{className:P(`text-xs leading-5`,`text-muted`),children:`Apply 会重新校验 Package、Source 和 Target 指纹;预览后事实变化将返回 409,不会覆盖。`})]}),(0,j.jsxs)(`footer`,{className:P(`flex justify-end gap-2 border-t px-5 py-4`,`border-line`),children:[(0,j.jsx)(`button`,{className:A$(!1),onClick:r,type:`button`,children:`取消`}),(0,j.jsxs)(`button`,{className:A$(!0),disabled:!e.can_apply||t,onClick:n,type:`button`,children:[t&&(0,j.jsx)(ve,{className:`size-4 animate-spin`}),`确认应用`]})]})]})})}function E$({title:e,children:t}){return(0,j.jsxs)(`section`,{className:P(`border-t py-4`,`border-line`),children:[(0,j.jsx)(`h4`,{className:P(`mb-3 font-brand text-[10px] uppercase tracking-[0.08em]`,`text-muted`),children:e}),t]})}function D$({label:e,value:t,mono:n=!1}){return(0,j.jsxs)(`div`,{className:`grid grid-cols-[82px_minmax(0,1fr)] gap-2 py-1.5 text-xs`,children:[(0,j.jsx)(`span`,{className:`text-faint`,children:e}),(0,j.jsx)(`span`,{className:P(`min-w-0 break-all`,n&&`font-mono text-[10px]`,`text-ink-soft`),children:t})]})}function O$({label:e,issue:t}){return(0,j.jsxs)(`span`,{className:P(`flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[9px]`,t?`border-warning/30 text-warning`:`border-line text-muted`),children:[(0,j.jsx)(`span`,{className:P(`size-1.5 rounded-full`,t?`bg-warning`:`bg-success`)}),e]})}function k$({label:e,options:t,value:n,onValue:r}){return(0,j.jsxs)(ed,{onValueChange:r,value:n,children:[(0,j.jsx)(nd,{"aria-label":e,className:`h-9 w-full min-w-0 border-line bg-surface px-2.5 text-xs text-ink shadow-none focus-visible:ring-1 max-sm:w-11 max-sm:px-2`,children:(0,j.jsx)(td,{})}),(0,j.jsx)(ad,{className:`border-line-strong text-ink-soft shadow-panel`,surface:`frosted`,children:t.map(([e,t])=>(0,j.jsx)(od,{className:`data-[highlighted]:bg-surface-soft`,value:e,children:t},e))})]})}function A$(e){return P(`inline-flex h-9 min-w-9 items-center justify-center gap-2 rounded-md border px-3 text-xs transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,e?`bg-accent text-accent-ink border-accent`:`bg-surface text-ink border-line-strong`)}function j$(){return P(`grid size-9 place-items-center rounded-md border transition-opacity hover:opacity-80`,`border-line text-muted`)}function M$(e){return e===`linked`||e===`follows_global`?`text-success`:e===`conflict`||e===`broken`?`text-warning`:`text-muted`}function N$(e){let t=e.split(`/`).filter(Boolean);return t.length>3?`…/${t.slice(-3).join(`/`)}`:e}function P$(e){return{enabled:`全局启用`,disabled:`全局停用`,external:`外部观察`,split_brain:`启停冲突`,invalid:`包无效`}[e]}function F$(e){return{adopt:`纳管`,global_state:`全局状态`,assignment:`Agent 分发`,unmanage:`取消纳管`}[e]}function I$(e){return e instanceof Error?e.message:String(e)}var L$=class{dependencies;abort=null;refreshPromises=new Map;constructor(e){this.dependencies=e}async open(e){this.close();let t=new AbortController;for(this.abort=t,await this.refresh(e);!t.signal.aborted;){let n=this.dependencies.store.get(e);if(!n){await this.refresh(e);continue}let r=n.snapshot.runtime.last_event_sequence;try{await(this.dependencies.stream??t$)(e,r,t.signal,t=>{let n=this.dependencies.store.receive(e,t);(n===`gap`||n===`refresh_required`)&&this.refresh(e)})}catch{if(t.signal.aborted)return;await this.refresh(e),await new Promise(e=>setTimeout(e,250))}}}close(){this.abort?.abort(),this.abort=null}refresh(e){let t=this.refreshPromises.get(e);if(t){let n=t.catch(()=>{}).then(()=>{if(this.refreshPromises.get(e)===n)return this.refreshPromises.delete(e),this.refresh(e)});return this.refreshPromises.set(e,n),n}let n=this.dependencies.openSession(e).then(e=>{this.dependencies.store.hydrate(e)}).finally(()=>{this.refreshPromises.get(e)===n&&this.refreshPromises.delete(e)});return this.refreshPromises.set(e,n),n}},R$=16384,z$=new TextEncoder;function B$(e){if(typeof requestAnimationFrame==`function`){requestAnimationFrame(()=>e());return}setTimeout(e,0)}var V$=new class{options;entries=new Map;listeners=new Map;pendingNotifications=new Set;flushScheduled=!1;constructor(e={}){this.options=e}get(e){return this.entries.get(e)}hydrate(e){let t=this.entries.get(e.session.session_id);t&&t.snapshot.runtime.last_event_sequence>e.runtime.last_event_sequence||(this.entries.set(e.session.session_id,{snapshot:e,status:`ready`}),this.notify(e.session.session_id))}receive(e,t){let n=this.entries.get(e);if(!n)return`refresh_required`;if(t.sequence<=n.snapshot.runtime.last_event_sequence)return`duplicate`;if(t.sequence!==n.snapshot.runtime.last_event_sequence+1)return this.entries.set(e,{snapshot:n.snapshot,status:`recovering`}),this.notify(e),`gap`;if(n.status===`recovering`)return`gap`;if(t.type===`MESSAGE_RECEIVED`)return this.entries.set(e,{snapshot:W$(n.snapshot,t),status:`ready`}),this.notify(e),`applied`;let r=t1(t);if(r?.type===`text_delta`||r?.type===`thought_delta`){let i=typeof r.text==`string`?r.text:``;if(!i)return`duplicate`;let a=U$(n.snapshot,t,r.type,i);return this.entries.set(e,{snapshot:a.snapshot,status:a.refreshRequired?`recovering`:`ready`}),this.notify(e),a.refreshRequired?`refresh_required`:`applied`}return this.entries.set(e,{snapshot:{...n.snapshot,runtime:{...n.snapshot.runtime,last_event_sequence:t.sequence}},status:`ready`}),this.notify(e),`refresh_required`}mergeTimelinePage(e,t){let n=this.entries.get(e);if(!n)return;let r=new Set(n.snapshot.timeline.turns.map(e=>e.turn_id));this.entries.set(e,{...n,snapshot:{...n.snapshot,timeline:{turns:[...t.turns.filter(e=>!r.has(e.turn_id)),...n.snapshot.timeline.turns].sort((e,t)=>e.timeline_index-t.timeline_index),previous_cursor:t.previous_cursor,truncated_block_ids:[...new Set([...n.snapshot.timeline.truncated_block_ids,...t.truncated_block_ids])]}}}),this.notify(e)}mergeSegmentPage(e,t,n){let r=this.entries.get(e);if(!r)return;let i=r.snapshot.timeline.turns.map(e=>({...e,blocks:e.blocks.map(e=>{if(e.block_id!==t)return e;let r=new Set(e.segments.map(e=>e.segment_id));return{...e,segments:[...e.segments,...n.segments.filter(e=>!r.has(e.segment_id))].sort((e,t)=>e.segment_index-t.segment_index),next_segment_cursor:n.next_cursor}})}));this.entries.set(e,{...r,snapshot:{...r.snapshot,timeline:{...r.snapshot.timeline,turns:i}}}),this.notify(e)}mergeQueuePage(e,t){let n=this.entries.get(e);if(!n)return;let r=new Set(n.snapshot.runtime.queue.turns.map(e=>e.turn_id));this.entries.set(e,{...n,snapshot:{...n.snapshot,runtime:{...n.snapshot.runtime,queue:{turns:[...n.snapshot.runtime.queue.turns,...t.turns.filter(e=>!r.has(e.turn_id))].sort((e,t)=>e.queue_position-t.queue_position),total:t.total,next_cursor:t.next_cursor}}}}),this.notify(e)}subscribe(e,t){let n=this.listeners.get(e)??new Set;return n.add(t),this.listeners.set(e,n),()=>{let n=this.listeners.get(e);n&&(n.delete(t),n.size||this.listeners.delete(e))}}notify(e){this.pendingNotifications.add(e),!this.flushScheduled&&(this.flushScheduled=!0,(this.options.schedule??B$)(()=>this.flush()))}flush(){this.flushScheduled=!1;let e=[...this.pendingNotifications];this.pendingNotifications.clear();for(let t of e)this.listeners.get(t)?.forEach(e=>e());this.pendingNotifications.size>0&&(this.flushScheduled=!0,(this.options.schedule??B$)(()=>this.flush()))}};function H$(e){return(0,E.useSyncExternalStore)(t=>e?V$.subscribe(e,t):()=>{},()=>e?V$.get(e):void 0)}function U$(e,t,n,r){let i=[...e.timeline.turns],a=G$(i,t);a<0&&(i.push(K$(e,t,n)),a=i.length-1);let o=i.map((e,i)=>i===a?q$(e,n,r,t):e);return{snapshot:{...e,runtime:{...e.runtime,last_event_sequence:t.sequence},timeline:{...e.timeline,turns:o}},refreshRequired:!1}}function W$(e,t){let n=typeof t.payload?.message==`string`?t.payload.message:``,r=t.run_id??e.session.session_id,i=[...e.timeline.turns],a=i.findIndex(e=>e.run_id===r);a<0&&(i.push({turn_id:r,status:`running`,timeline_index:(i.at(-1)?.timeline_index??0)+1,run_id:r,blocks:[]}),a=i.length-1);let o=i[a];if(o.blocks.some(e=>e.kind===`user_message`))return{...e,runtime:{...e.runtime,last_event_sequence:t.sequence},timeline:{...e.timeline,turns:i}};let s={block_id:`user:${o.turn_id}`,block_index:0,kind:`user_message`,status:`completed`,metadata:{started_at:t.occurred_at},segments:[{segment_id:`user:${o.turn_id}:0`,segment_index:0,content:n,byte_length:e1(n),sealed:!0}],next_segment_cursor:null};return i[a]={...o,blocks:[s,...o.blocks.map((e,t)=>({...e,block_index:t+1}))]},{...e,runtime:{...e.runtime,last_event_sequence:t.sequence},timeline:{...e.timeline,turns:i}}}function G$(e,t){return t.run_id?e.findIndex(e=>e.run_id===t.run_id):e.length?e.length-1:-1}function K$(e,t,n){return{turn_id:t.run_id??e.session.session_id,status:`running`,timeline_index:0,run_id:t.run_id??e.session.session_id,blocks:[X$(n===`text_delta`?`assistant`:`thought`,t)]}}function q$(e,t,n,r){let i=[...e.blocks];if(t===`thought_delta`){let e=J$(i,`thought`),t=e>=0?i[e]:void 0;if(t?.status===`running`)i[e]={...t,segments:Q$(t.segments,n),next_segment_cursor:null};else{let e=X$(`thought`,r);i.splice(Y$(i),0,{...e,segments:Q$(e.segments,n),next_segment_cursor:null})}}else{for(let[e,t]of i.entries())t.kind===`thought`&&t.status===`running`&&(i[e]={...t,status:`completed`,metadata:{...t.metadata,ended_at:r.occurred_at}});let e=i.at(-1);if(e?.kind===`assistant`)i[i.length-1]={...e,segments:Q$(e.segments,n),next_segment_cursor:null};else{let e=X$(`assistant`,r);i.push({...e,segments:Q$(e.segments,n),next_segment_cursor:null})}}return{...e,blocks:i.map((e,t)=>({...e,block_index:t,segments:e.segments.map((e,t)=>({...e,segment_index:t}))}))}}function J$(e,t){for(let n=e.length-1;n>=0;--n)if(e[n]?.kind===t)return n;return-1}function Y$(e){let t=J$(e,`thought`);if(t>=0)return t+1;let n=e.findIndex(e=>e.kind===`assistant`||e.kind===`tool`);return n>=0?n:e.length}function X$(e,t){return{block_id:t.event_id,block_index:0,kind:e,status:`running`,metadata:{started_at:t.occurred_at},segments:[Z$(``)],next_segment_cursor:null}}function Z$(e){return{segment_id:`segment-${n1()}`,segment_index:0,content:e,byte_length:e1(e),sealed:!1}}function Q$(e,t){let n=e.map(e=>({...e})),r=t,i=n.at(-1);for(i||(i=Z$(``),n.push(i));r;){i||(i=Z$(``),n.push(i));let e=R$-i.byte_length;if(e<=0){i.sealed=!0,i=Z$(``),n.push(i);continue}let t=$$(r,e);if(!t.chunk){i.sealed=!0,i=Z$(``),n.push(i);continue}i.content+=t.chunk,i.byte_length=e1(i.content),r=t.rest,r&&(i.sealed=!0,i=Z$(``),n.push(i))}n.forEach((e,t)=>{e.segment_index=t});let a=n.at(-1);return a&&(a.sealed=a.byte_length>=R$),n}function $$(e,t){let n=0,r=0;for(let i of e){let e=e1(i);if(n+e>t)break;n+=e,r+=i.length}return{chunk:e.slice(0,r),rest:e.slice(r)}}function e1(e){return z$.encode(e).byteLength}function t1(e){let t=e.payload;if(!t||typeof t!=`object`)return;let n=t.event;return n&&typeof n==`object`?n:t}function n1(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():Math.random().toString(36).slice(2)}async function r1(e){let t={...e.input,idempotencyKey:e.idempotencyKey};try{return{kind:`accepted`,receipt:await e.send(e.sessionId,t)}}catch(e){if(e instanceof BQ)return{kind:`rejected`,error:e}}try{return{kind:`accepted`,receipt:await e.send(e.sessionId,t)}}catch(e){if(e instanceof BQ)return{kind:`rejected`,error:e}}try{return{kind:`accepted`,receipt:await e.lookup(e.sessionId,e.idempotencyKey)}}catch{return{kind:`unknown`,idempotencyKey:e.idempotencyKey}}}function i1(){let[e,t]=(0,E.useState)(()=>o1()),[n,r]=(0,E.useState)(`agents`),[i,a]=(0,E.useState)([]),[o,s]=(0,E.useState)(null),[c,l]=(0,E.useState)(null),[u,d]=(0,E.useState)([]),[f,p]=(0,E.useState)(null),[m,h]=(0,E.useState)(null),[g,_]=(0,E.useState)(!1),[v,y]=(0,E.useState)([]),[b,x]=(0,E.useState)([]),[S,C]=(0,E.useState)(``),[w,T]=(0,E.useState)(``),[ee,D]=(0,E.useState)({}),[te,O]=(0,E.useState)(``),[ne,re]=(0,E.useState)(null),[ie,ae]=(0,E.useState)({}),[k,A]=(0,E.useState)(``),[se,ce]=(0,E.useState)(``),[le,ue]=(0,E.useState)([]),[de,fe]=(0,E.useState)(!1),pe=(0,E.useRef)(null),[me,he]=(0,E.useState)({kind:`idle`}),ge=(0,E.useRef)(0),_e=(0,E.useRef)(null),ve=(0,E.useRef)(null),ye=(0,E.useRef)(null),[be,xe]=(0,E.useState)(!0),[Se,Ce]=(0,E.useState)(!1),[we,Te]=(0,E.useState)(!1),[Ee,De]=(0,E.useState)(null),[Oe,ke]=(0,E.useState)(null),[Ae,je]=(0,E.useState)(!1),[Me,Ne]=(0,E.useState)(null),[Pe,Fe]=(0,E.useState)(!1),[Le,Re]=(0,E.useState)(null),[ze,Be]=(0,E.useState)(!1),[Ve,Ue]=(0,E.useState)(`actions`),[We,Ge]=(0,E.useState)(``),[Ke,qe]=(0,E.useState)(!1),[Je,Ye]=(0,E.useState)(!1),[Xe,Ze]=(0,E.useState)(null),[Qe,$e]=(0,E.useState)(!1),et=(0,E.useRef)(null),tt=(0,E.useRef)(!1),nt=(0,E.useRef)(null),rt=(0,E.useRef)(null),it=(0,E.useRef)(null),at=(0,E.useMemo)(()=>new L$({store:V$,openSession:e$.openSession}),[]),ot=H$(m),st=u.find(e=>e.session_id===m)??null,ct=i.find(e=>e.agent_id===(st?.agent_id??f))??null,lt=ct?.setup??null,ut=ct?.setup_manifest??null,dt=!!(ct&&ct.status===`needs_setup`&&!st),ft=!!(ct&&ct.status===`unavailable`&&!st),pt=(0,E.useMemo)(()=>Mn(u.filter(e=>e.agent_id===f)).filter(e=>g?!!e.archived_at:!e.archived_at).filter(e=>(e.title||`未命名 Session`).toLowerCase().includes(k.toLowerCase())),[k,f,u,g]),mt=u.filter(e=>e.agent_id===f&&!e.archived_at).length,ht=u.filter(e=>e.agent_id===f&&e.archived_at).length,gt=!!ot?.snapshot.runtime.active_run,_t=gt?`running`:ot?.snapshot.runtime.queue_state===`paused`?`paused`:`idle`,vt=(0,E.useMemo)(()=>b.find(En),[b]),yt=(0,E.useMemo)(()=>b.find(On),[b]),bt=(0,E.useMemo)(()=>b.find(kn),[b]),xt=(0,E.useMemo)(()=>b.find(Dn),[b]),St=(0,E.useMemo)(()=>ot?.snapshot.timeline.turns.flatMap(e=>e.blocks.flatMap(t=>{let n=typeof t.metadata.approval_id==`string`?t.metadata.approval_id:null;return t.kind===`approval`&&t.status===`waiting`&&n?[{runId:e.run_id,approvalId:n}]:[]}))??[],[ot?.snapshot.timeline.turns]),Ct=(0,E.useCallback)((e,t=`info`)=>{ke({text:e,kind:t}),window.setTimeout(()=>ke(t=>t?.text===e?null:t),4e3)},[]),wt=(0,E.useCallback)(async e=>{let t=++ge.current;he({kind:`previewing`,sessionId:e});try{let n=await e$.previewProviderHistory(e);if(it.current!==e||ge.current!==t)return;if(ye.current=n,n.importableEvents>0){he({kind:`available`,sessionId:e,preview:n});return}let r=(V$.get(e)?.snapshot.timeline.turns.length??0)===0;he(r?{kind:`empty`,sessionId:e}:{kind:`idle`})}catch(n){if(it.current!==e||ge.current!==t)return;let r=cQ(n,`preview`);he({kind:`error`,sessionId:e,...r})}},[]),Tt=(0,E.useCallback)(async(e=!1,t=!1)=>{t||xe(!0),t||De(null);try{e&&await e$.importSessions();let[t,n]=await Promise.all([e$.agents(),e$.sessions(!1,!0)]),r=t.agents;a(r),s(t.default_agent_id),l(t.effective_default_agent_id),d(n);let i=rt.current&&r.some(e=>e.agent_id===rt.current)?rt.current:Pn(r,t.effective_default_agent_id);p(i),h(i?Nn(n,it.current,i,window.localStorage.getItem(`codebridge:last-session:${i}`)):null)}catch(e){t||De(wn(e))}finally{t||xe(!1)}},[]);(0,E.useEffect)(()=>{Tt(!1).then(()=>void Tt(!0,!0))},[Tt]),(0,E.useEffect)(()=>{rt.current=f},[f]),(0,E.useEffect)(()=>{it.current=m,ge.current+=1,_e.current=null,ve.current=null,ye.current=null,he({kind:`idle`})},[m]),(0,E.useEffect)(()=>{if(be||tt.current)return;let e=new URLSearchParams(window.location.search).get(`session`);e&&(tt.current=!0,queueMicrotask(()=>{if(e){let t=u.find(t=>t.session_id===e);if(!t){Ct(`深链中的 Session 不存在或不可访问`,`error`);return}p(t.agent_id),h(t.session_id)}}))},[be,Ct,u]),(0,E.useEffect)(()=>{let e=!0;if(!m||!St.length)return queueMicrotask(()=>{e&&ae({})}),()=>{e=!1};let t=new Map;for(let e of St)t.set(e.runId,[...t.get(e.runId)??[],e.approvalId]);return Promise.all(Array.from(t,async([e,t])=>(await e$.approvals(e).catch(()=>[])).filter(e=>t.includes(e.id)&&e.status===`expired`))).then(t=>{e&&ae(Object.fromEntries(t.flat().map(e=>[e.id,`expired`])))}),()=>{e=!1}},[m,St]),(0,E.useEffect)(()=>{window.localStorage.setItem(`codebridge:web-theme`,e),document.documentElement.dataset.theme=e},[e]),(0,E.useEffect)(()=>{if(!m){at.close(),y([]),x([]),C(``),T(``),D({}),O(``),Ce(!1),Ze(null);return}let e=m,t=!0;return Ce(!V$.get(e)),De(null),Be(!1),Ue(`actions`),qe(!1),Ye(!1),Ze(null),(async()=>{try{let n=await e$.openSession(e);if(!t)return;V$.hydrate(n);let{session:r}=n;d(e=>e.map(e=>e.session_id===r.session_id?r:e)),y(n.commands);let[i,a]=await Promise.all([e$.configOptions(e),e$.commands(e).catch(()=>n.commands)]);if(!t)return;x(i),y(a),C(r.model??``),T(r.effort??``),D(r.config_overrides??{}),O(r.permission_mode??``),Ce(!1),r.provider_session_id&&wt(e),await at.open(e)}catch(e){t&&De(wn(e)),t&&Ce(!1)}})(),()=>{t=!1,at.close()}},[wt,m,at]);let[Et,Dt]=(0,E.useState)(!0),Ot=(0,E.useRef)(!0),kt=(0,E.useRef)(!1);(0,E.useEffect)(()=>{Ot.current=!0,Dt(!0)},[m]),(0,E.useEffect)(()=>{if(Se||!m||!nt.current||!Ot.current&&!Et)return;let e=nt.current,t=()=>{kt.current=!0,e.scrollTop=e.scrollHeight,window.requestAnimationFrame(()=>{kt.current=!1})};t();let n=window.requestAnimationFrame(()=>{t(),Ot.current&&(Ot.current=!1,Dt(!0))});return()=>window.cancelAnimationFrame(n)},[ot,m,Se,Et]);function At(){if(kt.current)return;let e=nt.current;e&&Dt(e.scrollHeight-e.scrollTop-e.clientHeight<80)}let[jt,Mt]=(0,E.useState)(!1),[Nt,Pt]=(0,E.useState)(!0),[Ft,It]=(0,E.useState)(()=>window.localStorage.getItem(`codebridge:web-density`)===`comfortable`?`comfortable`:`compact`),[Lt,Rt]=(0,E.useState)(()=>window.localStorage.getItem(`codebridge:web-reading`)===`serif`);(0,E.useEffect)(()=>{window.localStorage.setItem(`codebridge:web-density`,Ft)},[Ft]),(0,E.useEffect)(()=>{window.localStorage.setItem(`codebridge:web-reading`,Lt?`serif`:`sans`)},[Lt]);function zt(){let n=e===`paper`?`carbon`:`paper`,r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,i=document.startViewTransition;if(r||!i){t(n);return}i.call(document,()=>t(n))}(0,E.useEffect)(()=>{function e(e){if((e.metaKey||e.ctrlKey)&&((e.key===`k`||e.key===`K`)&&(e.preventDefault(),Mt(e=>!e)),e.key===`n`||e.key===`N`)){e.preventDefault();let t=rt.current;t&&Gt(t)}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let[Bt,Vt]=(0,E.useState)(0);function Ht(e){e!==rt.current&&!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(Vt(e=>e+1),window.setTimeout(()=>Vt(0),650)),rt.current=e,p(e),r(`agents`),A(``),_(!1);let t=window.localStorage.getItem(`codebridge:last-session:${e}`),n=Nn(u,it.current,e,t);it.current=n,n===m&&e!==f&&(y([]),x([]),C(``),T(``),D({}),O(``)),h(n)}function Ut(e){r(e)}function Wt(e){rt.current=e.agent_id,it.current=e.session_id,p(e.agent_id),h(e.session_id),window.localStorage.setItem(`codebridge:last-session:${e.agent_id}`,e.session_id)}async function Gt(e){De(null);try{let t=await e$.createSession(e);return d(e=>[t,...e]),Wt(t),t}catch(e){De(wn(e));return}}async function M(){let e=it.current,t=ye.current;if(!e||!t||ve.current)return;let n=++ge.current;ve.current={sessionId:e,requestVersion:n};let r=()=>{let t=ve.current;t?.sessionId===e&&t.requestVersion===n&&(ve.current=null)},i=_e.current,a=i?.sessionId===e?i.key:crypto.randomUUID();_e.current={sessionId:e,key:a},he({kind:`importing`,sessionId:e,preview:t});let o;try{o=await e$.importProviderHistory(e,a)}catch(t){if(r(),it.current!==e||ge.current!==n)return;let i=cQ(t,`import`);if(i.code===`provider_history_cursor_conflict`){_e.current=null,await wt(e);return}i.retry===null&&(_e.current=null),he({kind:`error`,sessionId:e,...i}),i.code===`session_not_found`&&Tt(!1,!0);return}if(it.current!==e||ge.current!==n){r();return}_e.current=null;try{let t=await e$.openSession(e);if(it.current!==e||ge.current!==n){r();return}V$.hydrate(t),d(e=>e.map(e=>e.session_id===t.session.session_id?t.session:e)),r(),he({kind:`imported`,sessionId:e,result:o})}catch{if(r(),it.current!==e||ge.current!==n)return;he({kind:`error`,sessionId:e,code:`session_refresh_failed`,message:`历史已导入,但刷新 Session 失败,请重新检查。`,retry:`preview`})}}async function Kt(){let e=ot?.snapshot.runtime,t=e?.active_run;if(t)try{let n=await e$.cancelRun(t.run_id,e.version,crypto.randomUUID());Ct(n.disposition===`already_terminal`?`当前 Run 已结束`:`已请求停止当前 Run`),m&&await at.refresh(m)}catch(e){Ct(wn(e),`error`)}}async function qt(e,t){if(!(!m||ne)){re(e.approvalId);try{t?await e$.approve(e.runId,e.approvalId):await e$.reject(e.runId,e.approvalId),ae(t=>{let n={...t};return delete n[e.approvalId],n}),await at.refresh(m)}catch(t){await at.refresh(m).catch(()=>{}),(await e$.approvals(e.runId).catch(()=>[])).find(t=>t.id===e.approvalId)?.status===`expired`&&ae(t=>({...t,[e.approvalId]:`expired`})),Ct(wn(t),`error`)}finally{re(null)}}}async function Jt(){let e=se.trim();if(!e||de)return;fe(!0),De(null);let t=le;ce(``),ue([]);let n=m;if(!n){if(!ct||ct.status!==`healthy`){ce(e),ue(t),De(ct?`${ct.display_name} 当前不可用(${yn[ct.status]??ct.status}),请先在设置中完成安装/配置`:`请选择一个可用的 Agent`),fe(!1);return}n=(await Gt(ct.agent_id))?.session_id??null}if(!n){ce(e),ue(t),fe(!1);return}let r=pe.current??crypto.randomUUID();pe.current=r;let i=await r1({send:e$.sendMessage,lookup:e$.submission,sessionId:n,idempotencyKey:r,input:{message:e,model:S||null,attachments:t,permissionMode:te||null,effort:w||null}});if(i.kind===`unknown`){ce(e),ue(t),De(`发送结果未知。重试时将使用请求 ${i.idempotencyKey}`),fe(!1);return}if(i.kind===`rejected`){pe.current=null,ce(e),ue(t),De(wn(i.error)),fe(!1);return}pe.current=null;try{i.receipt.acceptance===`queued`&&i.receipt.runtime.queue_state===`paused`&&!i.receipt.runtime.active_run&&await e$.resumeQueue(n,i.receipt.runtime.version,crypto.randomUUID()),await at.refresh(n),d(t=>t.map(t=>t.session_id===n?{...t,status:`active`,title:t.title??e.slice(0,60),updated_at:new Date().toISOString()}:t))}catch(e){De(wn(e))}finally{fe(!1)}}async function Yt(e,t){De(null);try{let n=await e$.updateSession(e,t);if(d(e=>e.map(e=>e.session_id===n.session_id?n:e)),m===e&&(C(n.model??``),T(n.effort??``),D(n.config_overrides??{}),O(n.permission_mode??``),Object.hasOwn(t,`model`))){let t=await e$.configOptions(e).catch(()=>null);t&&x(t)}n.archived_at&&m===e&&(window.localStorage.removeItem(`codebridge:last-session:${n.agent_id}`),it.current=null,h(null),_(!1)),Be(!1)}catch(e){De(wn(e))}}async function Xt(e){m&&await Yt(m,e)}function Zt(e){O(e),Xt({permission_mode:e||null})}function Qt(e){T(e),Xt({effort:e||null})}function N(e,t){let n={...ee};t?n[e.id]=An(e,t):delete n[e.id],D(n),Xt({config_overrides:n})}async function $t(e){try{await e$.deleteSession(e),d(t=>t.filter(t=>t.session_id!==e)),m===e&&(st&&window.localStorage.removeItem(`codebridge:last-session:${st.agent_id}`),it.current=null,h(null),Be(!1)),Ct(`Session 已删除`)}catch(e){De(wn(e))}}async function en(){m&&await $t(m)}async function tn(){if(ct)try{await e$.detectAgent(ct.agent_id),await Tt(!1,!0),Ct(`${ct.display_name} 已重新检测`)}catch(e){Ct(wn(e),`error`)}}async function nn(){if(!(!ct||!lt?.can_select_default))try{await e$.setDefaultAgent(ct.agent_id),await Tt(!1,!0),Ct(`${ct.display_name} 已设为默认`)}catch(e){Ct(wn(e),`error`)}}async function rn(){if(!(!m||we)){Te(!0),De(null);try{let e=await e$.pickDirectory(m);`cancelled`in e||(d(t=>t.map(t=>t.session_id===e.session_id?e:t)),Ct(`Workspace 已添加`))}catch(e){De(wn(e))}finally{Te(!1)}}}async function an(e){let t=await Promise.allSettled(Array.from(e).map(s1)),n=t.flatMap(e=>e.status===`fulfilled`?[e.value]:[]);n.length&&ue(e=>[...e,...n]);let r=t.find(e=>e.status===`rejected`);r&&De(wn(r.reason))}async function on(e=``,t){if(m){Ye(!0),$e(!0);try{Ze(await e$.workspaceEntries(m,t,e))}catch(e){De(wn(e))}finally{$e(!1)}}}function sn(e){Ye(e),e&&!Xe&&m&&on()}function cn(e){let t=In(e);qe(t?.kind===`command`);let n=t?.kind===`context`&&Fn(st).length>0;Ye(n),n&&!Xe&&m&&on(),ce(e)}async function ln(){if(!m||Ae)return;let e=ot?.snapshot.timeline.previous_cursor;if(e!=null){je(!0);try{V$.mergeTimelinePage(m,await e$.timeline(m,e))}catch(e){De(wn(e))}finally{je(!1)}}}async function un(e,t){if(!(!m||Me)){Ne(e);try{V$.mergeSegmentPage(m,e,await e$.segments(m,e,t))}catch(e){De(wn(e))}finally{Ne(null)}}}async function dn(e,t){if(!(!m||Le)){Re(e);try{await e$.cancelQueuedTurn(m,e,t,crypto.randomUUID()),await at.refresh(m)}catch(e){De(wn(e))}finally{Re(null)}}}async function fn(e){if(m)try{await e$.resumeQueue(m,e,crypto.randomUUID()),await at.refresh(m)}catch(e){De(wn(e))}}async function pn(){if(!m||Pe)return;let e=ot?.snapshot.runtime.queue.next_cursor;if(e!=null){Fe(!0);try{V$.mergeQueuePage(m,await e$.queue(m,e))}catch(e){De(wn(e))}finally{Fe(!1)}}}let mn=me.kind!==`idle`&&me.sessionId===m?me:null,hn=mn?(0,j.jsx)(lQ,{onImport:()=>{M()},onRetryImport:()=>{M()},onRetryPreview:()=>{let e=it.current;e&&wt(e)},state:mn}):null,gn=!!ot?.snapshot.timeline.turns.length,_n=gn&&mn!=null&&[`available`,`importing`,`error`,`imported`].includes(mn.kind);return(0,j.jsxs)(`div`,{className:P(`grid h-[100dvh] min-h-[100dvh] overflow-hidden font-sans text-sm tracking-[-0.01em]`,Nt&&n===`agents`?`grid-cols-[60px_minmax(0,1fr)] md:grid-cols-[60px_286px_minmax(0,1fr)]`:`grid-cols-[60px_minmax(0,1fr)]`,`bg-canvas text-ink`),"data-density":Ft,"data-reading":Lt?`serif`:`sans`,"data-theme":e,children:[(0,j.jsx)(fQ,{agents:i,area:n,selectedAgentId:f,theme:e,onAgent:Ht,onArea:Ut,onTheme:zt}),Nt&&n===`agents`&&(0,j.jsx)(`div`,{className:`hidden min-h-0 min-w-0 md:contents`,children:(0,j.jsx)(mQ,{agent:ct,agents:i,activeSessionCount:mt,area:n,archivedSessionCount:ht,loading:be,query:k,sessions:pt,selectedSessionId:m,onCreate:()=>ct&&void Gt(ct.agent_id),onQuery:A,onRefresh:()=>{Tt(!0)},onSession:Wt,onUpdateSession:(e,t)=>Yt(e.session_id,t),onDeleteSession:e=>$t(e.session_id),onToggleArchived:()=>_(e=>!e),showArchived:g})}),(0,j.jsxs)(`main`,{className:P(`relative flex min-h-0 min-w-0 flex-col overflow-hidden`,`bg-canvas text-ink`),children:[Bt>0&&(0,j.jsx)(a1,{seed:Bt},Bt),n===`agents`&&(0,j.jsx)(hQ,{agent:ct,session:st,runState:_t,menuOpen:ze,menuView:Ve,panelOpen:Nt,renameDraft:We,onDelete:()=>void en(),onTogglePanel:()=>Pt(e=>!e),onMenu:()=>{Be(e=>!e),Ue(`actions`)},onMenuView:Ue,onRenameDraft:Ge,onUpdate:e=>void Xt(e)}),Ee&&(0,j.jsxs)(`div`,{className:P(`mx-8 mt-4 flex items-start gap-2 rounded-md border px-3 py-2.5 text-xs`,`bg-danger-soft`,`text-danger`,`border-line-strong`),role:`alert`,children:[(0,j.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1`,children:Ee}),(0,j.jsx)(`button`,{"aria-label":`关闭错误`,onClick:()=>De(null),type:`button`,children:(0,j.jsx)(Ie,{className:`size-3.5`})})]}),n===`skills`?(0,j.jsx)(_$,{onNotify:Ct}):n===`settings`?(0,j.jsx)(`section`,{"aria-label":`设置`,className:`min-h-0 flex-1 overflow-y-auto`,children:(0,j.jsx)(s$,{density:Ft,agents:i,defaultAgentId:o,effectiveDefaultAgentId:c,onAgentsChanged:()=>Tt(!1,!0),reading:Lt,onDensity:It,onNotify:Ct,onProvidersChanged:()=>{st?.agent_id===`pi`&&e$.configOptions(st.session_id).then(x).catch(e=>De(wn(e)))},onReading:Rt})}):st?(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsx)(`section`,{"aria-label":`Session conversation`,className:`min-h-0 flex-1 overflow-y-auto px-8 pt-7`,onScroll:At,ref:nt,children:(0,j.jsxs)(`div`,{className:`mx-auto w-full max-w-[880px] pb-7`,children:[!Se&&_n&&(0,j.jsx)(`div`,{className:`mb-5`,children:hn}),Se?(0,j.jsx)(aQ,{}):ot&&gn?(0,j.jsx)(SQ,{activeRunId:ot.snapshot.runtime.active_run?.run_id??null,approvalStatusOverrides:ie,hasEarlier:ot.snapshot.timeline.previous_cursor!==null,loadingBlockId:Me,loadingEarlier:Ae,onLoadEarlier:()=>void ln(),onLoadSegments:(e,t)=>void un(e,t),onResolveApproval:(e,t)=>void qt(e,t),resolvingApprovalId:ne,turns:ot.snapshot.timeline.turns},m):hn?(0,j.jsx)(`div`,{className:`flex min-h-[42vh] items-center justify-center`,children:(0,j.jsx)(`div`,{className:`w-full max-w-[680px]`,children:hn})}):(0,j.jsxs)(`div`,{"aria-label":`Empty Session`,className:`flex min-h-[42vh] flex-col items-center justify-center text-center`,children:[(0,j.jsx)(`div`,{className:P(`mb-4 grid size-10 place-items-center rounded-md border`,`bg-accent`,`text-accent-ink`,`border-line-strong`),children:ct?(0,j.jsx)(He,{agentId:ct.agent_id,className:`size-[18px]`}):(0,j.jsx)(oQ,{className:`size-5`})}),(0,j.jsx)(`h2`,{className:P(`font-brand text-xl font-normal tracking-[-0.02em]`,`text-ink`),children:st.title||(ct?`${ct.display_name} Session`:`Session`)}),(0,j.jsx)(`p`,{className:P(`mt-2 text-xs`,`text-muted`),children:`输入目标开始当前 Session`})]})]})}),!Et&&(0,j.jsxs)(`button`,{"aria-label":`回到底部`,className:P(`absolute bottom-32 left-1/2 z-20 flex h-8 -translate-x-1/2 items-center gap-1.5 rounded-full border px-3 text-xs shadow-panel transition-opacity`,`bg-surface`,`text-ink-soft`,`border-line-strong`),onClick:()=>{let e=nt.current;e&&e.scrollTo({top:e.scrollHeight,behavior:`smooth`})},type:`button`,children:[(0,j.jsx)(oe,{className:`size-3.5`}),`回到最新`]}),(0,j.jsx)(`footer`,{className:`px-8 pb-5 pt-3`,children:(0,j.jsxs)(`div`,{className:`mx-auto grid min-w-0 w-full max-w-[880px] gap-3`,children:[ot&&(0,j.jsx)(_Q,{cancellingTurnId:Le,loadingMore:Pe,onCancel:(e,t)=>void dn(e,t),onLoadMore:()=>void pn(),onResume:e=>void fn(e),runtime:ot.snapshot.runtime,turns:ot.snapshot.runtime.queue.turns}),(0,j.jsx)(_P,{attachments:le,commands:v,contextOpen:Je,workspaceListing:Xe,workspaceLoading:Qe,disabled:!1,draft:se,model:S,modelOption:vt,effort:w,thoughtLevelOption:yt,configOverrides:ee,speedOption:bt,permissionMode:te,permissionOption:xt,sending:de,session:st,commandOpen:Ke,onAddFiles:an,onCommandOpen:qe,onContext:e=>ce(t=>Rn(t,`@${e} `)),onContextNavigate:(e,t)=>void on(e,t),onContextOpen:sn,onDraft:cn,onFiles:()=>et.current?.click(),onModel:e=>{C(e),Xt({model:e||null})},onEffort:Qt,onConfigOverride:N,onPermissionMode:Zt,onPickDirectory:()=>void rn(),onRemoveAttachment:e=>ue(t=>t.filter((t,n)=>n!==e)),onSubmit:()=>void Jt(),onStop:()=>void Kt(),running:gt})]})})]}):dt||ft?(0,j.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-8 pb-20`,children:(0,j.jsxs)(`div`,{className:`w-full max-w-[760px]`,children:[(0,j.jsxs)(`div`,{className:`mb-7 text-center`,children:[(0,j.jsx)(`div`,{className:P(`mx-auto mb-4 grid size-10 place-items-center rounded-md border`,`bg-accent`,`text-accent-ink`,`border-line-strong`),children:ct?(0,j.jsx)(He,{agentId:ct.agent_id,className:`size-[18px]`}):(0,j.jsx)(oQ,{className:`size-5`})}),(0,j.jsx)(`h1`,{className:P(`font-brand text-2xl font-normal leading-none tracking-normal`,`text-ink`),children:ct?ct.display_name:`CodeBridge`}),(0,j.jsx)(`p`,{className:P(`mt-2 text-xs`,`text-muted`),children:dt?`先完成安装或配置后再创建 Session`:`Agent 当前运行不可用,先排查诊断`})]}),(0,j.jsxs)(`div`,{className:P(`grid gap-3 rounded-xl border px-5 py-5`,`bg-surface`,`border-line-strong`),children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,j.jsx)(`span`,{className:P(`rounded-full border px-2 py-0.5`,`bg-surface-soft`,`text-ink-soft`,`border-line`),children:yn[ct?.status??`needs_setup`]??ct?.status??`未知`}),lt?.version&&(0,j.jsxs)(`span`,{className:`text-muted`,children:[`版本 `,lt.version]})]}),(0,j.jsxs)(`div`,{className:`grid gap-1 text-xs leading-5 text-muted`,children:[(0,j.jsxs)(`div`,{children:[`安装:`,lt?lt.installation===`installed`?`已安装`:lt.installation===`missing`?`未安装`:`状态未知`:`未知`]}),(0,j.jsxs)(`div`,{children:[`配置:`,lt?lt.configuration===`configured`?`已配置`:lt.configuration===`needs_configuration`?`待配置`:`状态未知`:`未知`]}),(0,j.jsxs)(`div`,{children:[`运行:`,lt?lt.runtime===`healthy`?`健康`:lt.runtime===`unavailable`?`不可用`:`未启动`:`未知`]}),lt?.diagnostic&&(0,j.jsxs)(`div`,{className:`rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-danger`,children:[(0,j.jsxs)(`div`,{children:[lt.diagnostic.stage,` · `,lt.diagnostic.code]}),(0,j.jsx)(`div`,{children:lt.diagnostic.message}),lt.diagnostic.details&&(0,j.jsx)(`div`,{className:`mt-1 font-mono text-[11px]`,children:lt.diagnostic.details}),lt.diagnostic.exit_code!==void 0&&(0,j.jsxs)(`div`,{className:`mt-1 font-mono text-[11px]`,children:[`exit code: `,lt.diagnostic.exit_code]})]}),ut?.install_strategies[0]&&dt&&(0,j.jsxs)(`div`,{className:`rounded-lg border border-line px-3 py-2 font-mono text-xs text-ink-soft`,children:[ut.install_strategies[0].command,` `,ut.install_strategies[0].args.join(` `)]}),ut?.configuration_path&&(0,j.jsx)(`div`,{className:`font-mono`,children:ut.configuration_path}),ut?.documentation_url&&(0,j.jsx)(`a`,{className:`text-accent hover:underline`,href:ut.documentation_url,rel:`noreferrer`,target:`_blank`,children:`打开文档`})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),onClick:()=>r(`settings`),type:`button`,children:`打开设置`}),(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-surface`,`text-ink`,`border-line-strong`),onClick:()=>void tn(),type:`button`,children:`重新检测`}),(0,j.jsx)(`button`,{className:P(`rounded-md border px-3 py-1.5 text-xs`,`bg-accent`,`text-accent-ink`,`border-line-strong`,!lt?.can_select_default&&`opacity-50`),disabled:!lt?.can_select_default,onClick:()=>void nn(),type:`button`,children:`设为默认`})]})]})]})}):(0,j.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-8 pb-20`,children:(0,j.jsxs)(`div`,{className:`w-full max-w-[760px]`,children:[(0,j.jsxs)(`div`,{className:`mb-7 text-center`,children:[(0,j.jsx)(`div`,{className:P(`mx-auto mb-4 grid size-10 place-items-center rounded-md border`,`bg-accent`,`text-accent-ink`,`border-line-strong`),children:ct?(0,j.jsx)(He,{agentId:ct.agent_id,className:`size-[18px]`}):(0,j.jsx)(oQ,{className:`size-5`})}),(0,j.jsx)(`h1`,{className:P(`font-brand text-2xl font-normal leading-none tracking-normal`,`text-ink`),children:ct?ct.display_name:`CodeBridge`}),(0,j.jsx)(`p`,{className:P(`mt-2 text-xs`,`text-muted`),children:ct?`创建 Session,或直接输入目标`:`选择一个可用的 Agent`})]}),(0,j.jsx)(_P,{attachments:le,commands:v,contextOpen:Je,workspaceListing:null,workspaceLoading:!1,disabled:!ct||ct.status!==`healthy`,draft:se,model:S,modelOption:vt,effort:w,thoughtLevelOption:yt,configOverrides:ee,speedOption:bt,permissionMode:te,permissionOption:xt,sending:de,session:null,commandOpen:Ke,onAddFiles:an,onCommandOpen:qe,onContext:()=>void 0,onContextNavigate:()=>void 0,onContextOpen:sn,onDraft:cn,onFiles:()=>et.current?.click(),onModel:e=>{C(e),Xt({model:e||null})},onEffort:Qt,onConfigOverride:N,onPermissionMode:Zt,onPickDirectory:()=>Ct(`Session 创建后可添加 Workspace`),onRemoveAttachment:e=>ue(t=>t.filter((t,n)=>n!==e)),onSubmit:()=>void Jt(),onStop:()=>void Kt(),running:!1})]})})]}),jt&&(0,j.jsx)(Tn,{agents:i,canCreate:!!(ct&&ct.status===`healthy`),onClose:()=>Mt(!1),onCreateSession:()=>{ct&&Gt(ct.agent_id)},onSelectAgent:e=>{Ht(e)},onSelectSession:Wt,onToggleTheme:zt,sessions:u.filter(e=>e.agent_id===f&&!e.archived_at)}),(0,j.jsx)(`input`,{className:`hidden`,multiple:!0,onChange:e=>{e.target.files&&an(e.target.files),e.target.value=``},ref:et,type:`file`}),Oe&&(0,j.jsxs)(`div`,{className:P(`fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-md border px-3 py-2 text-xs`,Oe.kind===`error`?P(`bg-danger-soft`,`text-danger`,`border-line-strong`):P(`bg-surface`,`text-ink`,`border-line-strong`),`shadow-panel`),role:`status`,children:[Oe.kind===`error`&&(0,j.jsx)(Ie,{className:`size-3.5 shrink-0`}),Oe.text]})]})}function a1({seed:e}){let[t,n]=(0,E.useState)(!1),[r,i]=(0,E.useState)(!1);(0,E.useEffect)(()=>{let e=requestAnimationFrame(()=>n(!0)),t=window.setTimeout(()=>i(!0),400);return()=>{cancelAnimationFrame(e),window.clearTimeout(t)}},[]);let a=(0,E.useMemo)(()=>Array.from({length:60},(t,n)=>(n*73+e*191)%37*8),[e]);return(0,j.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-30 grid grid-cols-10 grid-rows-6`,children:a.map((e,n)=>(0,j.jsx)(`span`,{className:P(`bg-canvas transition-opacity duration-150`,t&&!r?`opacity-100`:`opacity-0`),style:{transitionDelay:`${r?0:e}ms`}},n))})}function o1(){let e=window.localStorage.getItem(`codebridge:web-theme`);return e===`paper`||e===`carbon`?e:window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`carbon`:`paper`}function s1(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`无法读取 ${e.name}`)),r.onload=()=>{let n=typeof r.result==`string`?r.result:``,i=n.includes(`,`)?n.slice(n.indexOf(`,`)+1):n;t({name:e.name,mimeType:e.type||`application/octet-stream`,dataBase64:i})},r.readAsDataURL(e)})}var c1=[{agent_id:`codex`,display_name:`Codex`,adapter:`acp`,status:`healthy`,capabilities:[],models:[],session_features:[],setup:{installation:`installed`,configuration:`configured`,runtime:`healthy`,can_select_default:!0,can_create_session:!0},setup_manifest:{agent_id:`codex`,display_name:`Codex`,adapter:`acp`,install_strategies:[{id:`npm-global`,label:`Install Codex globally`,command:`npm`,args:[`install`,`-g`,`@openai/codex`],available:!0,requires_confirmation:!0}],configuration_owner:`agent`,documentation_url:`https://developers.openai.com/codex/`,supports_managed_configuration:!1}},{agent_id:`pi`,display_name:`Pi`,adapter:`sdk`,status:`healthy`,capabilities:[],models:[],session_features:[],setup:{installation:`installed`,configuration:`configured`,runtime:`healthy`,can_select_default:!0,can_create_session:!0},setup_manifest:{agent_id:`pi`,display_name:`Pi`,adapter:`sdk`,install_strategies:[],configuration_owner:`codebridge`,configuration_path:`~/.pi/agent/models.json`,documentation_url:`https://docs.orchestration/agent-providers#pi`,supports_managed_configuration:!0}},{agent_id:`cursor`,display_name:`Cursor`,adapter:`acp`,status:`needs_setup`,capabilities:[],models:[],session_features:[],setup:{installation:`missing`,configuration:`unknown`,runtime:`not_started`,can_select_default:!1,can_create_session:!1},setup_manifest:{agent_id:`cursor`,display_name:`Cursor`,adapter:`acp`,install_strategies:[],configuration_owner:`agent`,documentation_url:`https://cursor.com/`,supports_managed_configuration:!1}},{agent_id:`claude`,display_name:`Claude Code`,adapter:`acp`,status:`needs_setup`,capabilities:[],models:[],session_features:[],setup:{installation:`installed`,configuration:`needs_configuration`,runtime:`not_started`,can_select_default:!1,can_create_session:!1},setup_manifest:{agent_id:`claude`,display_name:`Claude Code`,adapter:`acp`,install_strategies:[{id:`npm-global`,label:`Install Claude Code globally`,command:`npm`,args:[`install`,`-g`,`@anthropic-ai/claude-code`],available:!0,requires_confirmation:!0}],configuration_owner:`agent`,documentation_url:`https://docs.anthropic.com/en/docs/claude-code`,supports_managed_configuration:!1}},{agent_id:`opencode`,display_name:`OpenCode`,adapter:`acp`,status:`unavailable`,capabilities:[],models:[],session_features:[],setup:{installation:`installed`,configuration:`configured`,runtime:`unavailable`,can_select_default:!0,can_create_session:!1},setup_manifest:{agent_id:`opencode`,display_name:`OpenCode`,adapter:`acp`,install_strategies:[{id:`npm-global`,label:`Install OpenCode globally`,command:`npm`,args:[`install`,`-g`,`opencode-ai`],available:!0,requires_confirmation:!0}],configuration_owner:`agent`,configuration_path:`~/.config/opencode/opencode.json`,documentation_url:`https://opencode.ai/docs/cli/`,supports_managed_configuration:!1}}];function l1(e,t,n,r,i,a=!1){let o=new Date(Date.now()-i*6e4).toISOString();return{session_id:e,agent_id:t,provider_session_id:null,task_record_id:null,model:null,effort:null,permission_mode:null,cwd:`/Users/demo/projects/codebridge`,additional_directories:[],title:n,status:r,pinned_at:a?o:null,archived_at:null,created_at:o,updated_at:o}}var u1=[l1(`s1`,`codex`,`Session 切换性能排查`,`active`,0,!0),l1(`s2`,`codex`,`Provider 历史合并 Review`,`idle`,47),l1(`s3`,`codex`,`工作台交互走查`,`idle`,132),l1(`s4`,`codex`,null,`closed`,1560)],d1=[{name:`plan`,description:`先产出计划再执行`},{name:`review`,description:`对当前变更做代码审查`,input:{hint:`路径或分支`}}],f1={id:`model`,name:`模型`,type:`select`,category:`model`,currentValue:`gpt-5.4`,values:[{value:`gpt-5.4`,name:`GPT-5.4`,description:`默认模型`},{value:`gpt-5.4-mini`,name:`GPT-5.4 mini`,description:`更快、更便宜`}]},p1={id:`reasoning`,name:`推理强度`,type:`select`,category:`thought_level`,currentValue:`medium`,values:[{value:`low`,name:`低`},{value:`medium`,name:`中`},{value:`high`,name:`高`},{value:`max`,name:`最高`}]},m1={id:`fast-mode`,name:`Fast mode`,type:`boolean`,category:`model_config`,currentValue:`false`,values:[{value:`false`,name:`Standard`},{value:`true`,name:`Fast`,description:`响应更快,配额消耗更高`}]},h1={id:`permission-mode`,name:`权限`,type:`select`,category:`mode`,values:[{value:`auto`,name:`自动`,description:`自动放行低风险操作`},{value:`strict`,name:`严格`,description:`所有写入都需审批`}]},g1=Date.now(),_1=e=>new Date(g1-e*6e4).toISOString(),v1=[{kind:`user`,content:`分析当前 Session 切换链路,并确认下一步需要哪些上下文。`,eventId:`e1`},{kind:`work`,id:`w1`,startedAt:_1(2),endedAt:_1(1),runId:`r1`,running:!1,entries:[{kind:`thought`,content:`先检查 Session、事件、资源加载和 Provider 恢复四段链路。`},{kind:`tool`,id:`t1`,name:`exec_command`,status:`completed`,input:{cmd:`pnpm test`},output:`Tests 47 passed (47)`,runId:`r1`},{kind:`tool`,id:`t2`,name:`read_file`,status:`completed`,locations:[{path:`/Users/demo/projects/codebridge/apps/web/src/lib/events.ts`}],runId:`r1`},{kind:`tool`,id:`t3`,name:`edit_file`,status:`completed`,locations:[{path:`/Users/demo/projects/codebridge/apps/web/src/lib/events.ts`}],input:{old_string:`return "就绪";`,new_string:`return status === "idle" ? "" : "就绪";`},runId:`r1`}]},{kind:`plan`,runId:`r1`,entries:[{content:`梳理事件投影链路`,priority:`high`,status:`completed`},{content:`验证 Provider 会话集合`,priority:`medium`,status:`in_progress`},{content:`输出下一步建议`,priority:`medium`,status:`pending`}]},{kind:`assistant`,phase:`final_answer`,runId:`r1`,content:"入口追踪已完成。**结论**:Session 切换由 `History → Commands → Config → Live Events` 四段组成,恢复逻辑集中在 `restoreSessionSelection`。\n\n```ts\n// 恢复上次选择的 Session\nconst remembered = localStorage.getItem(`codebridge:last-session:${agentId}`);\n```\n\n下一步需要确认 Provider 侧的会话集合。"},{kind:`approval`,requestId:`ap1`,title:`允许在当前目录写入文件:apps/web/src/lib/events.ts`,runId:`r1`}],y1={kind:`work`,id:`w2`,startedAt:_1(1),endedAt:_1(1),runId:`r2`,running:!0,entries:[{kind:`thought`,content:`正在验证 Provider 侧的会话集合…`},{kind:`tool`,id:`t4`,name:`exec_command`,status:`running`,input:{cmd:`pnpm test -- --watch`},runId:`r2`}]},b1=[{id:`ap1`,run_id:`r1`,step_id:`step-1`,capability_id:`fs.write`,session_id:`s1`,environment:`local`,target_resource:`apps/web/src/lib/events.ts`,status:`requested`,created_at:_1(1),expires_at:null}],x1=[{title:`加载中(像素 skeleton)`,node:(0,j.jsx)(aQ,{})},{title:`进行中的 Work(实时计时 + 呼吸节点)`,node:(0,j.jsx)(KZ,{approvals:[],cwd:`/Users/demo/projects/codebridge`,item:y1,onApproval:async()=>void 0})},{title:`错误`,node:(0,j.jsx)(KZ,{approvals:[],cwd:null,item:{kind:`error`,content:`会话流中断:SSE 连接超时`,fatal:!1,runId:`r2`},onApproval:async()=>void 0})},{title:`已解决的审批`,node:(0,j.jsx)(KZ,{approvals:[{...b1[0],status:`granted`}],cwd:null,item:{kind:`approval`,requestId:`ap1`,title:`允许写入文件`,runId:`r1`},onApproval:async()=>void 0})}];function S1(){let[e,t]=(0,E.useState)(`paper`),[n]=(0,E.useState)(`compact`),[r]=(0,E.useState)(!1),[i,a]=(0,E.useState)(`agents`),[o,s]=(0,E.useState)(`codex`),[c,l]=(0,E.useState)(`s1`),[u,d]=(0,E.useState)(!0),[f,p]=(0,E.useState)(!1),[m,h]=(0,E.useState)(``),[g,_]=(0,E.useState)(``),[v,y]=(0,E.useState)(``),[b,x]=(0,E.useState)(``),[S,C]=(0,E.useState)({}),w=()=>void 0,T=async()=>void 0,ee=c1.find(e=>e.agent_id===o)??null,D=u1.find(e=>e.session_id===c)??null,te=u1.filter(e=>e.agent_id===o);return(0,j.jsxs)(`div`,{className:P(`grid h-[100dvh] min-h-[100dvh] overflow-hidden font-sans text-sm tracking-[-0.01em]`,u&&i===`agents`?`grid-cols-[60px_286px_minmax(0,1fr)]`:`grid-cols-[60px_minmax(0,1fr)]`,`bg-canvas text-ink`),"data-density":n,"data-reading":r?`serif`:`sans`,"data-theme":e,children:[(0,j.jsx)(fQ,{agents:c1,area:i,selectedAgentId:o,theme:e,onAgent:e=>{s(e),a(`agents`)},onArea:a,onTheme:()=>t(e=>e===`paper`?`carbon`:`paper`)}),u&&i===`agents`&&(0,j.jsx)(mQ,{agent:ee,activeSessionCount:te.length,archivedSessionCount:0,area:i,loading:!1,query:``,sessions:i===`agents`?te:[],selectedSessionId:c,showArchived:!1,onCreate:w,onDeleteSession:T,onQuery:w,onRefresh:w,onSession:e=>l(e.session_id),onToggleArchived:w,onUpdateSession:T}),(0,j.jsxs)(`main`,{className:P(`relative flex min-h-0 min-w-0 flex-col overflow-hidden`,`bg-canvas text-ink`),children:[i===`agents`&&(0,j.jsx)(hQ,{agent:ee,menuOpen:!1,menuView:`actions`,panelOpen:u,renameDraft:``,session:D,runState:`running`,onDelete:w,onMenu:w,onMenuView:w,onRenameDraft:w,onTogglePanel:()=>d(e=>!e),onUpdate:w}),i===`skills`?(0,j.jsx)(_$,{onNotify:w}):(0,j.jsx)(`section`,{"aria-label":`预览对话`,className:`min-h-0 flex-1 overflow-y-auto px-8 pt-7`,children:new URLSearchParams(window.location.search).get(`state`)===`states`?(0,j.jsx)(`div`,{className:`mx-auto grid w-full max-w-[880px] gap-8 pb-7`,children:x1.map(e=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{className:P(`mb-2 text-xs font-semibold uppercase tracking-[0.1em]`,`text-faint`),children:e.title}),e.node]},e.title))}):(0,j.jsx)(`div`,{className:`mx-auto grid w-full max-w-[880px] gap-6 pb-7`,children:v1.map((e,t)=>(0,j.jsx)(KZ,{approvals:b1,cwd:D?.cwd??null,item:e,onApproval:T},t))})}),i!==`skills`&&(0,j.jsx)(`footer`,{className:`px-8 pb-5 pt-3`,children:(0,j.jsx)(`div`,{className:`mx-auto w-full max-w-[880px]`,children:(0,j.jsx)(_P,{attachments:[],commandOpen:!1,commands:d1,configOverrides:S,contextOpen:!1,disabled:!1,draft:m,effort:v,model:g,modelOption:f1,permissionMode:b,permissionOption:h1,running:!1,sending:!1,session:D,speedOption:m1,thoughtLevelOption:p1,workspaceListing:null,workspaceLoading:!1,onAddFiles:T,onCommandOpen:w,onConfigOverride:(e,t)=>C(n=>({...n,[e.id]:t})),onContext:w,onContextNavigate:w,onContextOpen:w,onDraft:h,onEffort:y,onFiles:w,onModel:_,onPermissionMode:x,onPickDirectory:w,onRemoveAttachment:w,onStop:w,onSubmit:()=>h(``)})})})]}),f&&(0,j.jsx)(Tn,{agents:c1,canCreate:!0,onClose:()=>p(!1),onCreateSession:w,onSelectAgent:s,onSelectSession:e=>l(e.session_id),onToggleTheme:()=>t(e=>e===`paper`?`carbon`:`paper`),sessions:te})]})}function C1(){return new URLSearchParams(window.location.search).get(`preview`)===`design`?(0,j.jsx)(S1,{}):(0,j.jsx)(i1,{})}(async()=>{zQ((await fetch(`/workbench/config.json`).then(e=>e.ok?e.json():{}).catch(()=>({}))).token??``),(0,Re.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(E.StrictMode,{children:(0,j.jsx)(C1,{})}))})();export{l as i,aH as n,o as r,RZ as t};