kiki-agent 0.5.1 → 0.6.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 (1283) hide show
  1. package/dist/builtin/examples/custom-json.mjs +7 -1
  2. package/dist/builtin/rules/claude/entry.mjs +8 -7
  3. package/dist/builtin/rules/codex/entry.mjs +8 -7
  4. package/dist/builtin/rules/files.mjs +6 -1
  5. package/dist/builtin/rules/grok.mjs +2 -2
  6. package/dist/builtin/rules/opencode.mjs +2 -2
  7. package/dist/builtin/rules/pi.mjs +3 -3
  8. package/dist/cpu-worker.mjs +7964 -3067
  9. package/dist/docs/en/configuration/config-files.md +180 -23
  10. package/dist/docs/en/configuration/data-locations.md +7 -4
  11. package/dist/docs/en/configuration/env-vars.md +1 -1
  12. package/dist/docs/en/configuration/providers.md +65 -17
  13. package/dist/docs/en/customization/agent-profiles.md +2 -2
  14. package/dist/docs/en/customization/agents-and-subagents.md +77 -15
  15. package/dist/docs/en/customization/hooks.md +77 -21
  16. package/dist/docs/en/customization/personas.md +3 -3
  17. package/dist/docs/en/customization/plugins.md +157 -7
  18. package/dist/docs/en/customization/prompt-fields.md +7 -5
  19. package/dist/docs/en/customization/recipes.md +3 -3
  20. package/dist/docs/en/customization/skills.md +1 -1
  21. package/dist/docs/en/customization/skins.md +1 -1
  22. package/dist/docs/en/features/agent-workflows.md +1 -1
  23. package/dist/docs/en/features/daily.md +5 -3
  24. package/dist/docs/en/features/ecosystem.md +1 -1
  25. package/dist/docs/en/features/freedom.md +4 -4
  26. package/dist/docs/en/features/index.md +4 -3
  27. package/dist/docs/en/features/long-work.md +4 -2
  28. package/dist/docs/en/features/look.md +1 -1
  29. package/dist/docs/en/features/people.md +2 -2
  30. package/dist/docs/en/features/phone.md +1 -1
  31. package/dist/docs/en/features/spaces.md +38 -26
  32. package/dist/docs/en/features/workbench.md +2 -0
  33. package/dist/docs/en/getting-started/first-launch.md +11 -9
  34. package/dist/docs/en/getting-started/installation.md +65 -2
  35. package/dist/docs/en/getting-started/use-cases.md +2 -2
  36. package/dist/docs/en/guides/interaction.md +12 -10
  37. package/dist/docs/en/guides/interface.md +22 -12
  38. package/dist/docs/en/guides/memory.md +3 -3
  39. package/dist/docs/en/guides/sessions.md +8 -4
  40. package/dist/docs/en/guides/settings.md +53 -52
  41. package/dist/docs/en/index.md +9 -6
  42. package/dist/docs/en/reference/command.md +58 -11
  43. package/dist/docs/en/reference/keyboard.md +32 -15
  44. package/dist/docs/en/reference/model-vocabulary.md +5 -9
  45. package/dist/docs/en/reference/slash-commands.md +10 -4
  46. package/dist/docs/en/reference/tools.md +80 -44
  47. package/dist/docs/en/server/local-server.md +11 -5
  48. package/dist/docs/en/server/mcp.md +2 -2
  49. package/dist/docs/en/server/rest-api.md +185 -59
  50. package/dist/docs/en/server/script-tools.md +1 -1
  51. package/dist/docs/zh/configuration/config-files.md +180 -23
  52. package/dist/docs/zh/configuration/data-locations.md +7 -4
  53. package/dist/docs/zh/configuration/env-vars.md +1 -1
  54. package/dist/docs/zh/configuration/providers.md +65 -17
  55. package/dist/docs/zh/customization/agent-profiles.md +2 -2
  56. package/dist/docs/zh/customization/agents-and-subagents.md +77 -15
  57. package/dist/docs/zh/customization/hooks.md +78 -22
  58. package/dist/docs/zh/customization/personas.md +3 -3
  59. package/dist/docs/zh/customization/plugins.md +157 -7
  60. package/dist/docs/zh/customization/prompt-fields.md +7 -5
  61. package/dist/docs/zh/customization/recipes.md +3 -3
  62. package/dist/docs/zh/customization/skills.md +1 -1
  63. package/dist/docs/zh/customization/skins.md +1 -1
  64. package/dist/docs/zh/features/agent-workflows.md +1 -1
  65. package/dist/docs/zh/features/daily.md +5 -3
  66. package/dist/docs/zh/features/ecosystem.md +1 -1
  67. package/dist/docs/zh/features/freedom.md +4 -4
  68. package/dist/docs/zh/features/index.md +4 -3
  69. package/dist/docs/zh/features/long-work.md +4 -2
  70. package/dist/docs/zh/features/look.md +1 -1
  71. package/dist/docs/zh/features/people.md +2 -2
  72. package/dist/docs/zh/features/phone.md +1 -1
  73. package/dist/docs/zh/features/spaces.md +39 -27
  74. package/dist/docs/zh/features/workbench.md +2 -0
  75. package/dist/docs/zh/getting-started/first-launch.md +11 -9
  76. package/dist/docs/zh/getting-started/installation.md +65 -2
  77. package/dist/docs/zh/getting-started/use-cases.md +2 -2
  78. package/dist/docs/zh/guides/interaction.md +12 -10
  79. package/dist/docs/zh/guides/interface.md +22 -12
  80. package/dist/docs/zh/guides/memory.md +4 -4
  81. package/dist/docs/zh/guides/sessions.md +8 -4
  82. package/dist/docs/zh/guides/settings.md +54 -53
  83. package/dist/docs/zh/index.md +9 -6
  84. package/dist/docs/zh/reference/command.md +58 -11
  85. package/dist/docs/zh/reference/keyboard.md +32 -15
  86. package/dist/docs/zh/reference/model-vocabulary.md +5 -9
  87. package/dist/docs/zh/reference/slash-commands.md +10 -4
  88. package/dist/docs/zh/reference/tools.md +79 -43
  89. package/dist/docs/zh/server/local-server.md +11 -5
  90. package/dist/docs/zh/server/mcp.md +2 -2
  91. package/dist/docs/zh/server/rest-api.md +176 -52
  92. package/dist/docs/zh/server/script-tools.md +1 -1
  93. package/dist/external-harness/agy-cli-acp.mjs +3859 -857
  94. package/dist/external-harness/agy-hook-registration.mjs +72 -20
  95. package/dist/external-harness/agy-permission-hook.mjs +10 -1
  96. package/dist/history-navigation-worker.mjs +25565 -0
  97. package/dist/hostRunner.mjs +753 -7
  98. package/dist/mailbox-worker.mjs +158 -57
  99. package/dist/main.mjs +2 -2
  100. package/dist/memory-worker.mjs +240 -64
  101. package/dist/native/windows-process-helper.exe +0 -0
  102. package/dist/plugin-isolation-worker.mjs +57 -0
  103. package/dist/query-store-worker.mjs +766 -53
  104. package/dist/sqlite-indexer.mjs +6088 -294
  105. package/dist/sqlite-query-worker.mjs +5896 -234
  106. package/dist/usage-parser-worker.mjs +36 -0
  107. package/dist/usage-read-model-worker.mjs +135 -37
  108. package/dist/web/assets/App-DCxEkgD4.js +181 -0
  109. package/dist/web/assets/App-DCxEkgD4.js.br +0 -0
  110. package/dist/web/assets/App-DCxEkgD4.js.gz +0 -0
  111. package/dist/web/assets/AppErrorBoundary-C2kI_Mfb.js +1 -0
  112. package/dist/web/assets/AppErrorBoundary-C2kI_Mfb.js.br +0 -0
  113. package/dist/web/assets/AppErrorBoundary-C2kI_Mfb.js.gz +0 -0
  114. package/dist/web/assets/ArchivedSessionsPage-CJQBRKlz.js +1 -0
  115. package/dist/web/assets/ArchivedSessionsPage-CJQBRKlz.js.br +0 -0
  116. package/dist/web/assets/ArchivedSessionsPage-CJQBRKlz.js.gz +0 -0
  117. package/dist/web/assets/CapabilitiesPage-C4ggBXI7.js +15 -0
  118. package/dist/web/assets/CapabilitiesPage-C4ggBXI7.js.br +0 -0
  119. package/dist/web/assets/CapabilitiesPage-C4ggBXI7.js.gz +0 -0
  120. package/dist/web/assets/CodeEditor-BAdDaRcl.js +4 -0
  121. package/dist/web/assets/CodeEditor-BAdDaRcl.js.br +0 -0
  122. package/dist/web/assets/CodeEditor-BAdDaRcl.js.gz +0 -0
  123. package/dist/web/assets/ExternalEnginesSection-Ci1_RIkB.js +2 -0
  124. package/dist/web/assets/ExternalEnginesSection-Ci1_RIkB.js.br +0 -0
  125. package/dist/web/assets/ExternalEnginesSection-Ci1_RIkB.js.gz +0 -0
  126. package/dist/web/assets/GlobalCronPanel-DEYDD-iB.js +1 -0
  127. package/dist/web/assets/GlobalCronPanel-DEYDD-iB.js.br +0 -0
  128. package/dist/web/assets/GlobalCronPanel-DEYDD-iB.js.gz +0 -0
  129. package/dist/web/assets/ImageViewport-osmMzHUM.js +1 -0
  130. package/dist/web/assets/ImageViewport-osmMzHUM.js.br +0 -0
  131. package/dist/web/assets/ImageViewport-osmMzHUM.js.gz +0 -0
  132. package/dist/web/assets/ListParts-DL6n2vZD.js +1 -0
  133. package/dist/web/assets/ListParts-DL6n2vZD.js.br +0 -0
  134. package/dist/web/assets/ListParts-DL6n2vZD.js.gz +0 -0
  135. package/dist/web/assets/MediaLightbox-DfDTfyyo.js +1 -0
  136. package/dist/web/assets/MediaLightbox-DfDTfyyo.js.br +0 -0
  137. package/dist/web/assets/MediaLightbox-DfDTfyyo.js.gz +0 -0
  138. package/dist/web/assets/MemoryPage-C4VM8pO8.js +1 -0
  139. package/dist/web/assets/MemoryPage-C4VM8pO8.js.br +0 -0
  140. package/dist/web/assets/MemoryPage-C4VM8pO8.js.gz +0 -0
  141. package/dist/web/assets/Middleware-CQ3TZHhI.js +67 -0
  142. package/dist/web/assets/Middleware-CQ3TZHhI.js.br +0 -0
  143. package/dist/web/assets/Middleware-CQ3TZHhI.js.gz +0 -0
  144. package/dist/web/assets/MobileAppShell-CPW83S2x.js +23 -0
  145. package/dist/web/assets/MobileAppShell-CPW83S2x.js.br +0 -0
  146. package/dist/web/assets/MobileAppShell-CPW83S2x.js.gz +0 -0
  147. package/dist/web/assets/ModelConnectCard-CY1w-R_8.js +2 -0
  148. package/dist/web/assets/ModelConnectCard-CY1w-R_8.js.br +0 -0
  149. package/dist/web/assets/ModelConnectCard-CY1w-R_8.js.gz +0 -0
  150. package/dist/web/assets/NavScopeBoundary-7FLzmaAe.js +1 -0
  151. package/dist/web/assets/NavScopeBoundary-7FLzmaAe.js.br +0 -0
  152. package/dist/web/assets/NavScopeBoundary-7FLzmaAe.js.gz +0 -0
  153. package/dist/web/assets/PersonasPage-CB5q8dUU.js +3 -0
  154. package/dist/web/assets/PersonasPage-CB5q8dUU.js.br +0 -0
  155. package/dist/web/assets/PersonasPage-CB5q8dUU.js.gz +0 -0
  156. package/dist/web/assets/PluginPanelHost-BNSzFpXj.js +1 -0
  157. package/dist/web/assets/PluginPanelHost-BNSzFpXj.js.br +0 -0
  158. package/dist/web/assets/PluginPanelHost-BNSzFpXj.js.gz +0 -0
  159. package/dist/web/assets/PreviewWorkspace-itdg7TxB.js +1 -0
  160. package/dist/web/assets/PreviewWorkspace-itdg7TxB.js.br +0 -0
  161. package/dist/web/assets/PreviewWorkspace-itdg7TxB.js.gz +0 -0
  162. package/dist/web/assets/RoomPage-DqICeoEq.js +1 -0
  163. package/dist/web/assets/RoomPage-DqICeoEq.js.br +0 -0
  164. package/dist/web/assets/RoomPage-DqICeoEq.js.gz +0 -0
  165. package/dist/web/assets/SecretField-DhvasDWA.js +1 -0
  166. package/dist/web/assets/SecretField-DhvasDWA.js.br +0 -0
  167. package/dist/web/assets/SecretField-DhvasDWA.js.gz +0 -0
  168. package/dist/web/assets/SectionCard-CDWn1QiO.js +1 -0
  169. package/dist/web/assets/SectionCard-CDWn1QiO.js.br +0 -0
  170. package/dist/web/assets/SectionCard-CDWn1QiO.js.gz +0 -0
  171. package/dist/web/assets/SettingsPage-BhaVVzpG.js +259 -0
  172. package/dist/web/assets/SettingsPage-BhaVVzpG.js.br +0 -0
  173. package/dist/web/assets/SettingsPage-BhaVVzpG.js.gz +0 -0
  174. package/dist/web/assets/ShellEntry-DNaOXNB7.js +2 -0
  175. package/dist/web/assets/ShellEntry-DNaOXNB7.js.br +0 -0
  176. package/dist/web/assets/ShellEntry-DNaOXNB7.js.gz +0 -0
  177. package/dist/web/assets/TasksPage-HHJ20hzK.js +1 -0
  178. package/dist/web/assets/TasksPage-HHJ20hzK.js.br +0 -0
  179. package/dist/web/assets/TasksPage-HHJ20hzK.js.gz +0 -0
  180. package/dist/web/assets/TerminalPanel-D7EDH4hR.js +9 -0
  181. package/dist/web/assets/TerminalPanel-D7EDH4hR.js.br +0 -0
  182. package/dist/web/assets/TerminalPanel-D7EDH4hR.js.gz +0 -0
  183. package/dist/web/assets/UsagePage-CyB5c-8F.js +1 -0
  184. package/dist/web/assets/UsagePage-CyB5c-8F.js.br +0 -0
  185. package/dist/web/assets/UsagePage-CyB5c-8F.js.gz +0 -0
  186. package/dist/web/assets/WorkPage-hiw_Nngy.js +1 -0
  187. package/dist/web/assets/WorkPage-hiw_Nngy.js.br +0 -0
  188. package/dist/web/assets/WorkPage-hiw_Nngy.js.gz +0 -0
  189. package/dist/web/assets/abap-BdImnpbu.js.br +0 -0
  190. package/dist/web/assets/abap-BdImnpbu.js.gz +0 -0
  191. package/dist/web/assets/actionscript-3-CoDkCxhg.js.br +0 -0
  192. package/dist/web/assets/actionscript-3-CoDkCxhg.js.gz +0 -0
  193. package/dist/web/assets/ada-bCR0ucgS.js.br +0 -0
  194. package/dist/web/assets/ada-bCR0ucgS.js.gz +0 -0
  195. package/dist/web/assets/androidBridge-DgaAG2Pi.js +1 -0
  196. package/dist/web/assets/androidBridge-DgaAG2Pi.js.br +0 -0
  197. package/dist/web/assets/androidBridge-DgaAG2Pi.js.gz +0 -0
  198. package/dist/web/assets/andromeeda-C4gqWexZ.js.br +0 -0
  199. package/dist/web/assets/andromeeda-C4gqWexZ.js.gz +0 -0
  200. package/dist/web/assets/angular-html-CU67Zn6k.js.br +0 -0
  201. package/dist/web/assets/angular-html-CU67Zn6k.js.gz +0 -0
  202. package/dist/web/assets/angular-ts-BwZT4LLn.js.br +0 -0
  203. package/dist/web/assets/angular-ts-BwZT4LLn.js.gz +0 -0
  204. package/dist/web/assets/apache-Pmp26Uib.js.br +0 -0
  205. package/dist/web/assets/apache-Pmp26Uib.js.gz +0 -0
  206. package/dist/web/assets/apex-D8_7TLub.js.br +0 -0
  207. package/dist/web/assets/apex-D8_7TLub.js.gz +0 -0
  208. package/dist/web/assets/apl-B4CMkyY2.js.br +0 -0
  209. package/dist/web/assets/apl-B4CMkyY2.js.gz +0 -0
  210. package/dist/web/assets/apl-dKokRX4l.js.br +0 -0
  211. package/dist/web/assets/apl-dKokRX4l.js.gz +0 -0
  212. package/dist/web/assets/applescript-Co6uUVPk.js.br +0 -0
  213. package/dist/web/assets/applescript-Co6uUVPk.js.gz +0 -0
  214. package/dist/web/assets/ara-BRHolxvo.js.br +0 -0
  215. package/dist/web/assets/ara-BRHolxvo.js.gz +0 -0
  216. package/dist/web/assets/arc-DoGfTGgR.js +1 -0
  217. package/dist/web/assets/arc-DoGfTGgR.js.br +0 -0
  218. package/dist/web/assets/arc-DoGfTGgR.js.gz +0 -0
  219. package/dist/web/assets/asciiarmor-Df11BRmG.js.br +0 -0
  220. package/dist/web/assets/asciiarmor-Df11BRmG.js.gz +0 -0
  221. package/dist/web/assets/asciidoc-Ve4PFQV2.js.br +0 -0
  222. package/dist/web/assets/asciidoc-Ve4PFQV2.js.gz +0 -0
  223. package/dist/web/assets/askKiki-CgAsWGRZ.js +2 -0
  224. package/dist/web/assets/askKiki-CgAsWGRZ.js.br +0 -0
  225. package/dist/web/assets/askKiki-CgAsWGRZ.js.gz +0 -0
  226. package/dist/web/assets/asm-D_Q5rh1f.js.br +0 -0
  227. package/dist/web/assets/asm-D_Q5rh1f.js.gz +0 -0
  228. package/dist/web/assets/asn1-EdZsLKOL.js.br +0 -0
  229. package/dist/web/assets/asn1-EdZsLKOL.js.gz +0 -0
  230. package/dist/web/assets/asterisk-B-8jnY81.js.br +0 -0
  231. package/dist/web/assets/asterisk-B-8jnY81.js.gz +0 -0
  232. package/dist/web/assets/astro-CbQHKStN.js.br +0 -0
  233. package/dist/web/assets/astro-CbQHKStN.js.gz +0 -0
  234. package/dist/web/assets/aurora-x-D-2ljcwZ.js.br +0 -0
  235. package/dist/web/assets/aurora-x-D-2ljcwZ.js.gz +0 -0
  236. package/dist/web/assets/awk-DMzUqQB5.js.br +0 -0
  237. package/dist/web/assets/awk-DMzUqQB5.js.gz +0 -0
  238. package/dist/web/assets/ayu-dark-DYE7WIF3.js.br +0 -0
  239. package/dist/web/assets/ayu-dark-DYE7WIF3.js.gz +0 -0
  240. package/dist/web/assets/ayu-light-BA47KaF1.js.br +0 -0
  241. package/dist/web/assets/ayu-light-BA47KaF1.js.gz +0 -0
  242. package/dist/web/assets/ayu-mirage-32ctXXKs.js.br +0 -0
  243. package/dist/web/assets/ayu-mirage-32ctXXKs.js.gz +0 -0
  244. package/dist/web/assets/ballerina-BFfxhgS-.js.br +0 -0
  245. package/dist/web/assets/ballerina-BFfxhgS-.js.gz +0 -0
  246. package/dist/web/assets/band-dPffDWoQ.js +1 -0
  247. package/dist/web/assets/band-dPffDWoQ.js.br +0 -0
  248. package/dist/web/assets/band-dPffDWoQ.js.gz +0 -0
  249. package/dist/web/assets/bat-BkioyH1T.js.br +0 -0
  250. package/dist/web/assets/bat-BkioyH1T.js.gz +0 -0
  251. package/dist/web/assets/beancount-k_qm7-4y.js.br +0 -0
  252. package/dist/web/assets/beancount-k_qm7-4y.js.gz +0 -0
  253. package/dist/web/assets/berry-uYugtg8r.js.br +0 -0
  254. package/dist/web/assets/berry-uYugtg8r.js.gz +0 -0
  255. package/dist/web/assets/bibtex-CHM0blh-.js.br +0 -0
  256. package/dist/web/assets/bibtex-CHM0blh-.js.gz +0 -0
  257. package/dist/web/assets/bicep-Bmn6On1c.js.br +0 -0
  258. package/dist/web/assets/bicep-Bmn6On1c.js.gz +0 -0
  259. package/dist/web/assets/bird2-DPOp833l.js.br +0 -0
  260. package/dist/web/assets/bird2-DPOp833l.js.gz +0 -0
  261. package/dist/web/assets/blade-D4QpJJKB.js.br +0 -0
  262. package/dist/web/assets/blade-D4QpJJKB.js.gz +0 -0
  263. package/dist/web/assets/brainfuck-C4LP7Hcl.js.br +0 -0
  264. package/dist/web/assets/brainfuck-C4LP7Hcl.js.gz +0 -0
  265. package/dist/web/assets/bsl-BO_Y6i37.js.br +0 -0
  266. package/dist/web/assets/bsl-BO_Y6i37.js.gz +0 -0
  267. package/dist/web/assets/c-BIGW1oBm.js.br +0 -0
  268. package/dist/web/assets/c-BIGW1oBm.js.gz +0 -0
  269. package/dist/web/assets/c3-eo99z4R2.js.br +0 -0
  270. package/dist/web/assets/c3-eo99z4R2.js.gz +0 -0
  271. package/dist/web/assets/cadence-Bv_4Rxtq.js.br +0 -0
  272. package/dist/web/assets/cadence-Bv_4Rxtq.js.gz +0 -0
  273. package/dist/web/assets/cairo-KRGpt6FW.js.br +0 -0
  274. package/dist/web/assets/cairo-KRGpt6FW.js.gz +0 -0
  275. package/dist/web/assets/catppuccin-frappe-DFWUc33u.js.br +0 -0
  276. package/dist/web/assets/catppuccin-frappe-DFWUc33u.js.gz +0 -0
  277. package/dist/web/assets/catppuccin-latte-C9dUb6Cb.js.br +0 -0
  278. package/dist/web/assets/catppuccin-latte-C9dUb6Cb.js.gz +0 -0
  279. package/dist/web/assets/catppuccin-macchiato-DQyhUUbL.js.br +0 -0
  280. package/dist/web/assets/catppuccin-macchiato-DQyhUUbL.js.gz +0 -0
  281. package/dist/web/assets/catppuccin-mocha-D87Tk5Gz.js.br +0 -0
  282. package/dist/web/assets/catppuccin-mocha-D87Tk5Gz.js.gz +0 -0
  283. package/dist/web/assets/channel-BwCaPRlV.js +1 -0
  284. package/dist/web/assets/channel-BwCaPRlV.js.br +0 -0
  285. package/dist/web/assets/channel-BwCaPRlV.js.gz +0 -0
  286. package/dist/web/assets/clarity-D53aC0YG.js.br +0 -0
  287. package/dist/web/assets/clarity-D53aC0YG.js.gz +0 -0
  288. package/dist/web/assets/client-cAizUM-b.js +7 -0
  289. package/dist/web/assets/client-cAizUM-b.js.br +0 -0
  290. package/dist/web/assets/client-cAizUM-b.js.gz +0 -0
  291. package/dist/web/assets/clike-B9uivgTg.js.br +0 -0
  292. package/dist/web/assets/clike-B9uivgTg.js.gz +0 -0
  293. package/dist/web/assets/clojure-BMjYHr_A.js.br +0 -0
  294. package/dist/web/assets/clojure-BMjYHr_A.js.gz +0 -0
  295. package/dist/web/assets/clojure-P80f7IUj.js.br +0 -0
  296. package/dist/web/assets/clojure-P80f7IUj.js.gz +0 -0
  297. package/dist/web/assets/clone-JiRK1kR-.js +1 -0
  298. package/dist/web/assets/clone-JiRK1kR-.js.br +0 -0
  299. package/dist/web/assets/clone-JiRK1kR-.js.gz +0 -0
  300. package/dist/web/assets/cmake-BQqOBYOt.js.br +0 -0
  301. package/dist/web/assets/cmake-BQqOBYOt.js.gz +0 -0
  302. package/dist/web/assets/cmake-D1j8_8rp.js.br +0 -0
  303. package/dist/web/assets/cmake-D1j8_8rp.js.gz +0 -0
  304. package/dist/web/assets/cobol-CWcv1MsR.js.br +0 -0
  305. package/dist/web/assets/cobol-CWcv1MsR.js.gz +0 -0
  306. package/dist/web/assets/cobol-nwyudZeR.js.br +0 -0
  307. package/dist/web/assets/cobol-nwyudZeR.js.gz +0 -0
  308. package/dist/web/assets/codeowners-Bp6g37R7.js.br +0 -0
  309. package/dist/web/assets/codeowners-Bp6g37R7.js.gz +0 -0
  310. package/dist/web/assets/codeql-DsOJ9woJ.js.br +0 -0
  311. package/dist/web/assets/codeql-DsOJ9woJ.js.gz +0 -0
  312. package/dist/web/assets/coffee-Ch7k5sss.js.br +0 -0
  313. package/dist/web/assets/coffee-Ch7k5sss.js.gz +0 -0
  314. package/dist/web/assets/coffeescript-S37ZYGWr.js.br +0 -0
  315. package/dist/web/assets/coffeescript-S37ZYGWr.js.gz +0 -0
  316. package/dist/web/assets/common-lisp-Cg-RD9OK.js.br +0 -0
  317. package/dist/web/assets/common-lisp-Cg-RD9OK.js.gz +0 -0
  318. package/dist/web/assets/commonlisp-DBKNyK5s.js.br +0 -0
  319. package/dist/web/assets/commonlisp-DBKNyK5s.js.gz +0 -0
  320. package/dist/web/assets/connection-5XKg4sL2.js +404 -0
  321. package/dist/web/assets/connection-5XKg4sL2.js.br +0 -0
  322. package/dist/web/assets/connection-5XKg4sL2.js.gz +0 -0
  323. package/dist/web/assets/controls-C3UrNiBn.js +1 -0
  324. package/dist/web/assets/controls-C3UrNiBn.js.br +0 -0
  325. package/dist/web/assets/controls-C3UrNiBn.js.gz +0 -0
  326. package/dist/web/assets/coq-DkFqJrB1.js.br +0 -0
  327. package/dist/web/assets/coq-DkFqJrB1.js.gz +0 -0
  328. package/dist/web/assets/cpp-CofmeUqb.js.br +0 -0
  329. package/dist/web/assets/cpp-CofmeUqb.js.gz +0 -0
  330. package/dist/web/assets/crystal-SjHAIU92.js.br +0 -0
  331. package/dist/web/assets/crystal-SjHAIU92.js.gz +0 -0
  332. package/dist/web/assets/crystal-tKQVLTB8.js.br +0 -0
  333. package/dist/web/assets/crystal-tKQVLTB8.js.gz +0 -0
  334. package/dist/web/assets/csharp-COcwbKMJ.js.br +0 -0
  335. package/dist/web/assets/csharp-COcwbKMJ.js.gz +0 -0
  336. package/dist/web/assets/css-BnMrqG3P.js.br +0 -0
  337. package/dist/web/assets/css-BnMrqG3P.js.gz +0 -0
  338. package/dist/web/assets/css-DPfMkruS.js.br +0 -0
  339. package/dist/web/assets/css-DPfMkruS.js.gz +0 -0
  340. package/dist/web/assets/csv-fuZLfV_i.js.br +0 -0
  341. package/dist/web/assets/csv-fuZLfV_i.js.gz +0 -0
  342. package/dist/web/assets/cue-D82EKSYY.js.br +0 -0
  343. package/dist/web/assets/cue-D82EKSYY.js.gz +0 -0
  344. package/dist/web/assets/cypher-COkxafJQ.js.br +0 -0
  345. package/dist/web/assets/cypher-COkxafJQ.js.gz +0 -0
  346. package/dist/web/assets/cypher-C_CwsFkJ.js.br +0 -0
  347. package/dist/web/assets/cypher-C_CwsFkJ.js.gz +0 -0
  348. package/dist/web/assets/cytoscape-cose-bilkent-CGdh9URw.js +1 -0
  349. package/dist/web/assets/cytoscape-cose-bilkent-CGdh9URw.js.br +0 -0
  350. package/dist/web/assets/cytoscape-cose-bilkent-CGdh9URw.js.gz +0 -0
  351. package/dist/web/assets/cytoscape-fcose-ZavmgdCc.js +1 -0
  352. package/dist/web/assets/cytoscape-fcose-ZavmgdCc.js.br +0 -0
  353. package/dist/web/assets/cytoscape-fcose-ZavmgdCc.js.gz +0 -0
  354. package/dist/web/assets/cytoscape.esm-nFXppDBa.js.br +0 -0
  355. package/dist/web/assets/cytoscape.esm-nFXppDBa.js.gz +0 -0
  356. package/dist/web/assets/d-85-TOEBH.js.br +0 -0
  357. package/dist/web/assets/d-85-TOEBH.js.gz +0 -0
  358. package/dist/web/assets/d-pRatUO7H.js.br +0 -0
  359. package/dist/web/assets/d-pRatUO7H.js.gz +0 -0
  360. package/dist/web/assets/dark-plus-C3mMm8J8.js.br +0 -0
  361. package/dist/web/assets/dark-plus-C3mMm8J8.js.gz +0 -0
  362. package/dist/web/assets/dart-CF10PKvl.js.br +0 -0
  363. package/dist/web/assets/dart-CF10PKvl.js.gz +0 -0
  364. package/dist/web/assets/dax-CEL-wOlO.js.br +0 -0
  365. package/dist/web/assets/dax-CEL-wOlO.js.gz +0 -0
  366. package/dist/web/assets/{defaultLocale-DX6XiGOO.js → defaultLocale-5voVPcsN.js} +1 -1
  367. package/dist/web/assets/defaultLocale-5voVPcsN.js.br +0 -0
  368. package/dist/web/assets/defaultLocale-5voVPcsN.js.gz +0 -0
  369. package/dist/web/assets/desktop-BmXAJ9_W.js.br +0 -0
  370. package/dist/web/assets/desktop-BmXAJ9_W.js.gz +0 -0
  371. package/dist/web/assets/diff-D97Zzqfu.js.br +0 -0
  372. package/dist/web/assets/diff-D97Zzqfu.js.gz +0 -0
  373. package/dist/web/assets/diff-DbItnlRl.js.br +0 -0
  374. package/dist/web/assets/diff-DbItnlRl.js.gz +0 -0
  375. package/dist/web/assets/docker-BcOcwvcX.js.br +0 -0
  376. package/dist/web/assets/docker-BcOcwvcX.js.gz +0 -0
  377. package/dist/web/assets/dockerfile-BKs6k2Af.js.br +0 -0
  378. package/dist/web/assets/dockerfile-BKs6k2Af.js.gz +0 -0
  379. package/dist/web/assets/dotenv-Da5cRb03.js.br +0 -0
  380. package/dist/web/assets/dotenv-Da5cRb03.js.gz +0 -0
  381. package/dist/web/assets/dracula-BzJJZx-M.js.br +0 -0
  382. package/dist/web/assets/dracula-BzJJZx-M.js.gz +0 -0
  383. package/dist/web/assets/dracula-soft-BXkSAIEj.js.br +0 -0
  384. package/dist/web/assets/dracula-soft-BXkSAIEj.js.gz +0 -0
  385. package/dist/web/assets/dream-maker-BtqSS_iP.js.br +0 -0
  386. package/dist/web/assets/dream-maker-BtqSS_iP.js.gz +0 -0
  387. package/dist/web/assets/dtd-DF_7sFjM.js.br +0 -0
  388. package/dist/web/assets/dtd-DF_7sFjM.js.gz +0 -0
  389. package/dist/web/assets/duration-BNAPaH6N.js +1 -0
  390. package/dist/web/assets/duration-BNAPaH6N.js.br +0 -0
  391. package/dist/web/assets/duration-BNAPaH6N.js.gz +0 -0
  392. package/dist/web/assets/dylan-DwRh75JA.js.br +0 -0
  393. package/dist/web/assets/dylan-DwRh75JA.js.gz +0 -0
  394. package/dist/web/assets/ebnf-CDyGwa7X.js.br +0 -0
  395. package/dist/web/assets/ebnf-CDyGwa7X.js.gz +0 -0
  396. package/dist/web/assets/ecl-Cabwm37j.js.br +0 -0
  397. package/dist/web/assets/ecl-Cabwm37j.js.gz +0 -0
  398. package/dist/web/assets/edge-BkV0erSs.js.br +0 -0
  399. package/dist/web/assets/edge-BkV0erSs.js.gz +0 -0
  400. package/dist/web/assets/eiffel-CnydiIhH.js.br +0 -0
  401. package/dist/web/assets/eiffel-CnydiIhH.js.gz +0 -0
  402. package/dist/web/assets/elixir-CDX3lj18.js.br +0 -0
  403. package/dist/web/assets/elixir-CDX3lj18.js.gz +0 -0
  404. package/dist/web/assets/elm-DbKCFpqz.js.br +0 -0
  405. package/dist/web/assets/elm-DbKCFpqz.js.gz +0 -0
  406. package/dist/web/assets/elm-vLlmbW-K.js.br +0 -0
  407. package/dist/web/assets/elm-vLlmbW-K.js.gz +0 -0
  408. package/dist/web/assets/emacs-lisp-C9XAeP06.js.br +0 -0
  409. package/dist/web/assets/emacs-lisp-C9XAeP06.js.gz +0 -0
  410. package/dist/web/assets/erb-B12qg9BL.js.br +0 -0
  411. package/dist/web/assets/erb-B12qg9BL.js.gz +0 -0
  412. package/dist/web/assets/erlang-BNw1qcRV.js.br +0 -0
  413. package/dist/web/assets/erlang-BNw1qcRV.js.gz +0 -0
  414. package/dist/web/assets/erlang-DsQrWhSR.js.br +0 -0
  415. package/dist/web/assets/erlang-DsQrWhSR.js.gz +0 -0
  416. package/dist/web/assets/everforest-dark-BgDCqdQA.js.br +0 -0
  417. package/dist/web/assets/everforest-dark-BgDCqdQA.js.gz +0 -0
  418. package/dist/web/assets/everforest-light-C8M2exoo.js.br +0 -0
  419. package/dist/web/assets/everforest-light-C8M2exoo.js.gz +0 -0
  420. package/dist/web/assets/export-BlURphmw.js +2 -0
  421. package/dist/web/assets/export-BlURphmw.js.br +0 -0
  422. package/dist/web/assets/export-BlURphmw.js.gz +0 -0
  423. package/dist/web/assets/factor-kuTfRLto.js.br +0 -0
  424. package/dist/web/assets/factor-kuTfRLto.js.gz +0 -0
  425. package/dist/web/assets/fcl-Kvtd6kyn.js.br +0 -0
  426. package/dist/web/assets/fcl-Kvtd6kyn.js.gz +0 -0
  427. package/dist/web/assets/fennel-BYunw83y.js.br +0 -0
  428. package/dist/web/assets/fennel-BYunw83y.js.gz +0 -0
  429. package/dist/web/assets/fish-BvzEVeQv.js.br +0 -0
  430. package/dist/web/assets/fish-BvzEVeQv.js.gz +0 -0
  431. package/dist/web/assets/fluent-C4IJs8-o.js.br +0 -0
  432. package/dist/web/assets/fluent-C4IJs8-o.js.gz +0 -0
  433. package/dist/web/assets/forth-Ffai-XNe.js.br +0 -0
  434. package/dist/web/assets/forth-Ffai-XNe.js.gz +0 -0
  435. package/dist/web/assets/fortran-DYz_wnZ1.js.br +0 -0
  436. package/dist/web/assets/fortran-DYz_wnZ1.js.gz +0 -0
  437. package/dist/web/assets/fortran-fixed-form-CkoXwp7k.js.br +0 -0
  438. package/dist/web/assets/fortran-fixed-form-CkoXwp7k.js.gz +0 -0
  439. package/dist/web/assets/fortran-free-form-BxgE0vQu.js.br +0 -0
  440. package/dist/web/assets/fortran-free-form-BxgE0vQu.js.gz +0 -0
  441. package/dist/web/assets/fsharp-CXgrBDvD.js.br +0 -0
  442. package/dist/web/assets/fsharp-CXgrBDvD.js.gz +0 -0
  443. package/dist/web/assets/gas-Bneqetm1.js.br +0 -0
  444. package/dist/web/assets/gas-Bneqetm1.js.gz +0 -0
  445. package/dist/web/assets/gdresource-BOOCDP_w.js.br +0 -0
  446. package/dist/web/assets/gdresource-BOOCDP_w.js.gz +0 -0
  447. package/dist/web/assets/gdscript-C5YyOfLZ.js.br +0 -0
  448. package/dist/web/assets/gdscript-C5YyOfLZ.js.gz +0 -0
  449. package/dist/web/assets/gdshader-DkwncUOv.js.br +0 -0
  450. package/dist/web/assets/gdshader-DkwncUOv.js.gz +0 -0
  451. package/dist/web/assets/genie-D0YGMca9.js.br +0 -0
  452. package/dist/web/assets/genie-D0YGMca9.js.gz +0 -0
  453. package/dist/web/assets/gherkin-DyxjwDmM.js.br +0 -0
  454. package/dist/web/assets/gherkin-DyxjwDmM.js.gz +0 -0
  455. package/dist/web/assets/gherkin-heZmZLOM.js.br +0 -0
  456. package/dist/web/assets/gherkin-heZmZLOM.js.gz +0 -0
  457. package/dist/web/assets/git-commit-F4YmCXRG.js.br +0 -0
  458. package/dist/web/assets/git-commit-F4YmCXRG.js.gz +0 -0
  459. package/dist/web/assets/git-rebase-r7XF79zn.js.br +0 -0
  460. package/dist/web/assets/git-rebase-r7XF79zn.js.gz +0 -0
  461. package/dist/web/assets/github-dark-DHJKELXO.js.br +0 -0
  462. package/dist/web/assets/github-dark-DHJKELXO.js.gz +0 -0
  463. package/dist/web/assets/github-dark-default-Cuk6v7N8.js.br +0 -0
  464. package/dist/web/assets/github-dark-default-Cuk6v7N8.js.gz +0 -0
  465. package/dist/web/assets/github-dark-dimmed-DH5Ifo-i.js.br +0 -0
  466. package/dist/web/assets/github-dark-dimmed-DH5Ifo-i.js.gz +0 -0
  467. package/dist/web/assets/github-dark-high-contrast-E3gJ1_iC.js.br +0 -0
  468. package/dist/web/assets/github-dark-high-contrast-E3gJ1_iC.js.gz +0 -0
  469. package/dist/web/assets/github-light-DAi9KRSo.js.br +0 -0
  470. package/dist/web/assets/github-light-DAi9KRSo.js.gz +0 -0
  471. package/dist/web/assets/github-light-default-D7oLnXFd.js.br +0 -0
  472. package/dist/web/assets/github-light-default-D7oLnXFd.js.gz +0 -0
  473. package/dist/web/assets/github-light-high-contrast-BfjtVDDH.js.br +0 -0
  474. package/dist/web/assets/github-light-high-contrast-BfjtVDDH.js.gz +0 -0
  475. package/dist/web/assets/gleam-BspZqrRM.js.br +0 -0
  476. package/dist/web/assets/gleam-BspZqrRM.js.gz +0 -0
  477. package/dist/web/assets/glimmer-js-Rg0-pVw9.js.br +0 -0
  478. package/dist/web/assets/glimmer-js-Rg0-pVw9.js.gz +0 -0
  479. package/dist/web/assets/glimmer-ts-U6CK756n.js.br +0 -0
  480. package/dist/web/assets/glimmer-ts-U6CK756n.js.gz +0 -0
  481. package/dist/web/assets/glsl-DplSGwfg.js.br +0 -0
  482. package/dist/web/assets/glsl-DplSGwfg.js.gz +0 -0
  483. package/dist/web/assets/gn-n2N0HUVH.js.br +0 -0
  484. package/dist/web/assets/gn-n2N0HUVH.js.gz +0 -0
  485. package/dist/web/assets/gnuplot-DdkO51Og.js.br +0 -0
  486. package/dist/web/assets/gnuplot-DdkO51Og.js.gz +0 -0
  487. package/dist/web/assets/go-CxLEBnE3.js.br +0 -0
  488. package/dist/web/assets/go-CxLEBnE3.js.gz +0 -0
  489. package/dist/web/assets/graph--OzhPTMs.js.br +0 -0
  490. package/dist/web/assets/graph--OzhPTMs.js.gz +0 -0
  491. package/dist/web/assets/graphql-ChdNCCLP.js.br +0 -0
  492. package/dist/web/assets/graphql-ChdNCCLP.js.gz +0 -0
  493. package/dist/web/assets/groovy-D9Dt4D0W.js.br +0 -0
  494. package/dist/web/assets/groovy-D9Dt4D0W.js.gz +0 -0
  495. package/dist/web/assets/groovy-gcz8RCvz.js.br +0 -0
  496. package/dist/web/assets/groovy-gcz8RCvz.js.gz +0 -0
  497. package/dist/web/assets/gruvbox-dark-hard-CFHQjOhq.js.br +0 -0
  498. package/dist/web/assets/gruvbox-dark-hard-CFHQjOhq.js.gz +0 -0
  499. package/dist/web/assets/gruvbox-dark-medium-GsRaNv29.js.br +0 -0
  500. package/dist/web/assets/gruvbox-dark-medium-GsRaNv29.js.gz +0 -0
  501. package/dist/web/assets/gruvbox-dark-soft-CVdnzihN.js.br +0 -0
  502. package/dist/web/assets/gruvbox-dark-soft-CVdnzihN.js.gz +0 -0
  503. package/dist/web/assets/gruvbox-light-hard-CH1njM8p.js.br +0 -0
  504. package/dist/web/assets/gruvbox-light-hard-CH1njM8p.js.gz +0 -0
  505. package/dist/web/assets/gruvbox-light-medium-DRw_LuNl.js.br +0 -0
  506. package/dist/web/assets/gruvbox-light-medium-DRw_LuNl.js.gz +0 -0
  507. package/dist/web/assets/gruvbox-light-soft-hJgmCMqR.js.br +0 -0
  508. package/dist/web/assets/gruvbox-light-soft-hJgmCMqR.js.gz +0 -0
  509. package/dist/web/assets/hack-CaT9iCJl.js.br +0 -0
  510. package/dist/web/assets/hack-CaT9iCJl.js.gz +0 -0
  511. package/dist/web/assets/haml-B8DHNrY2.js.br +0 -0
  512. package/dist/web/assets/haml-B8DHNrY2.js.gz +0 -0
  513. package/dist/web/assets/handlebars-BL8al0AC.js.br +0 -0
  514. package/dist/web/assets/handlebars-BL8al0AC.js.gz +0 -0
  515. package/dist/web/assets/haskell-Cw1EW3IL.js.br +0 -0
  516. package/dist/web/assets/haskell-Cw1EW3IL.js.gz +0 -0
  517. package/dist/web/assets/haskell-Df6bDoY_.js.br +0 -0
  518. package/dist/web/assets/haskell-Df6bDoY_.js.gz +0 -0
  519. package/dist/web/assets/haxe-CzTSHFRz.js.br +0 -0
  520. package/dist/web/assets/haxe-CzTSHFRz.js.gz +0 -0
  521. package/dist/web/assets/haxe-H-WmDvRZ.js.br +0 -0
  522. package/dist/web/assets/haxe-H-WmDvRZ.js.gz +0 -0
  523. package/dist/web/assets/hcl-BWvSN4gD.js.br +0 -0
  524. package/dist/web/assets/hcl-BWvSN4gD.js.gz +0 -0
  525. package/dist/web/assets/highlighted-body-OFNGDK62-CF-6XyfM.js +1 -0
  526. package/dist/web/assets/highlighted-body-OFNGDK62-CF-6XyfM.js.br +0 -0
  527. package/dist/web/assets/highlighted-body-OFNGDK62-CF-6XyfM.js.gz +0 -0
  528. package/dist/web/assets/hjson-D5-asLiD.js.br +0 -0
  529. package/dist/web/assets/hjson-D5-asLiD.js.gz +0 -0
  530. package/dist/web/assets/hlsl-D3lLCCz7.js.br +0 -0
  531. package/dist/web/assets/hlsl-D3lLCCz7.js.gz +0 -0
  532. package/dist/web/assets/horizon-BUw7H-hv.js.br +0 -0
  533. package/dist/web/assets/horizon-BUw7H-hv.js.gz +0 -0
  534. package/dist/web/assets/horizon-bright-Cn-bp-IR.js.br +0 -0
  535. package/dist/web/assets/horizon-bright-Cn-bp-IR.js.gz +0 -0
  536. package/dist/web/assets/houston-DnULxvSX.js.br +0 -0
  537. package/dist/web/assets/houston-DnULxvSX.js.gz +0 -0
  538. package/dist/web/assets/html-GMplVEZG.js.br +0 -0
  539. package/dist/web/assets/html-GMplVEZG.js.gz +0 -0
  540. package/dist/web/assets/html-derivative-BFtXZ54Q.js.br +0 -0
  541. package/dist/web/assets/html-derivative-BFtXZ54Q.js.gz +0 -0
  542. package/dist/web/assets/http-DBlCnlav.js.br +0 -0
  543. package/dist/web/assets/http-DBlCnlav.js.gz +0 -0
  544. package/dist/web/assets/http-jrhK8wxY.js.br +0 -0
  545. package/dist/web/assets/http-jrhK8wxY.js.gz +0 -0
  546. package/dist/web/assets/hurl-irOxFIW8.js.br +0 -0
  547. package/dist/web/assets/hurl-irOxFIW8.js.gz +0 -0
  548. package/dist/web/assets/hxml-Bvhsp5Yf.js.br +0 -0
  549. package/dist/web/assets/hxml-Bvhsp5Yf.js.gz +0 -0
  550. package/dist/web/assets/hy-DFXneXwc.js.br +0 -0
  551. package/dist/web/assets/hy-DFXneXwc.js.gz +0 -0
  552. package/dist/web/assets/idl-BEugSyMb.js.br +0 -0
  553. package/dist/web/assets/idl-BEugSyMb.js.gz +0 -0
  554. package/dist/web/assets/imba-DGztddWO.js.br +0 -0
  555. package/dist/web/assets/imba-DGztddWO.js.gz +0 -0
  556. package/dist/web/assets/{index-DmwFFSkV.js → index-AtrTtxWl.js} +1 -1
  557. package/dist/web/assets/index-AtrTtxWl.js.br +0 -0
  558. package/dist/web/assets/index-AtrTtxWl.js.gz +0 -0
  559. package/dist/web/assets/index-BBEGEj83.js +1 -0
  560. package/dist/web/assets/index-BBEGEj83.js.br +0 -0
  561. package/dist/web/assets/index-BBEGEj83.js.gz +0 -0
  562. package/dist/web/assets/index-BDdIDEp4.js +1 -0
  563. package/dist/web/assets/index-BDdIDEp4.js.br +0 -0
  564. package/dist/web/assets/index-BDdIDEp4.js.gz +0 -0
  565. package/dist/web/assets/index-BIfumokk.js +1 -0
  566. package/dist/web/assets/index-BIfumokk.js.br +0 -0
  567. package/dist/web/assets/index-BIfumokk.js.gz +0 -0
  568. package/dist/web/assets/index-BLi2nTxe.js +206 -0
  569. package/dist/web/assets/index-BLi2nTxe.js.br +0 -0
  570. package/dist/web/assets/index-BLi2nTxe.js.gz +0 -0
  571. package/dist/web/assets/index-BNFiIuBC.js +1 -0
  572. package/dist/web/assets/index-BNFiIuBC.js.br +0 -0
  573. package/dist/web/assets/index-BNFiIuBC.js.gz +0 -0
  574. package/dist/web/assets/index-BOXDlCpS.js +1 -0
  575. package/dist/web/assets/index-BOXDlCpS.js.br +0 -0
  576. package/dist/web/assets/index-BOXDlCpS.js.gz +0 -0
  577. package/dist/web/assets/{index-CBvwNH_H.js → index-BPG2nU9y.js} +1 -1
  578. package/dist/web/assets/index-BPG2nU9y.js.br +0 -0
  579. package/dist/web/assets/index-BPG2nU9y.js.gz +0 -0
  580. package/dist/web/assets/index-BSVOVe3D.js +1 -0
  581. package/dist/web/assets/index-BSVOVe3D.js.br +0 -0
  582. package/dist/web/assets/index-BSVOVe3D.js.gz +0 -0
  583. package/dist/web/assets/{index-CPSWYh_R.js → index-BT8zjpNF.js} +5 -5
  584. package/dist/web/assets/index-BT8zjpNF.js.br +0 -0
  585. package/dist/web/assets/index-BT8zjpNF.js.gz +0 -0
  586. package/dist/web/assets/index-BTHoDcN1.js +7 -0
  587. package/dist/web/assets/index-BTHoDcN1.js.br +0 -0
  588. package/dist/web/assets/index-BTHoDcN1.js.gz +0 -0
  589. package/dist/web/assets/{index-DRo5Y_9p.js → index-BWFj-16K.js} +1 -1
  590. package/dist/web/assets/index-BWFj-16K.js.br +0 -0
  591. package/dist/web/assets/index-BWFj-16K.js.gz +0 -0
  592. package/dist/web/assets/index-BYkQjRc-.js +1 -0
  593. package/dist/web/assets/index-BYkQjRc-.js.br +0 -0
  594. package/dist/web/assets/index-BYkQjRc-.js.gz +0 -0
  595. package/dist/web/assets/{index-BxYCSNg_.js → index-BbmM2LEW.js} +2 -2
  596. package/dist/web/assets/index-BbmM2LEW.js.br +0 -0
  597. package/dist/web/assets/index-BbmM2LEW.js.gz +0 -0
  598. package/dist/web/assets/index-C6n6XERd.js +1 -0
  599. package/dist/web/assets/index-C6n6XERd.js.br +0 -0
  600. package/dist/web/assets/index-C6n6XERd.js.gz +0 -0
  601. package/dist/web/assets/index-C83WoUbd.js +1 -0
  602. package/dist/web/assets/index-C83WoUbd.js.br +0 -0
  603. package/dist/web/assets/index-C83WoUbd.js.gz +0 -0
  604. package/dist/web/assets/index-C8DDOUJx.css +1 -0
  605. package/dist/web/assets/index-C8DDOUJx.css.br +0 -0
  606. package/dist/web/assets/index-C8DDOUJx.css.gz +0 -0
  607. package/dist/web/assets/index-C9DdZFNJ.js +1 -0
  608. package/dist/web/assets/index-C9DdZFNJ.js.br +0 -0
  609. package/dist/web/assets/index-C9DdZFNJ.js.gz +0 -0
  610. package/dist/web/assets/index-CP99-KdF.js +1 -0
  611. package/dist/web/assets/index-CP99-KdF.js.br +0 -0
  612. package/dist/web/assets/index-CP99-KdF.js.gz +0 -0
  613. package/dist/web/assets/index-CVrtusX9.js +1 -0
  614. package/dist/web/assets/index-CVrtusX9.js.br +0 -0
  615. package/dist/web/assets/index-CVrtusX9.js.gz +0 -0
  616. package/dist/web/assets/{index-DfUpwUTM.js → index-ChTpz7dO.js} +2 -2
  617. package/dist/web/assets/index-ChTpz7dO.js.br +0 -0
  618. package/dist/web/assets/index-ChTpz7dO.js.gz +0 -0
  619. package/dist/web/assets/index-CjceQ8Nh.js +1 -0
  620. package/dist/web/assets/index-CjceQ8Nh.js.br +0 -0
  621. package/dist/web/assets/index-CjceQ8Nh.js.gz +0 -0
  622. package/dist/web/assets/{index-CjvqtF2I.js → index-CsKZwkF5.js} +1 -1
  623. package/dist/web/assets/index-CsKZwkF5.js.br +0 -0
  624. package/dist/web/assets/index-CsKZwkF5.js.gz +0 -0
  625. package/dist/web/assets/index-CvYzv8kf.js +1 -0
  626. package/dist/web/assets/index-CvYzv8kf.js.br +0 -0
  627. package/dist/web/assets/index-CvYzv8kf.js.gz +0 -0
  628. package/dist/web/assets/index-D2CHDVPg.js +1 -0
  629. package/dist/web/assets/index-D2CHDVPg.js.br +0 -0
  630. package/dist/web/assets/index-D2CHDVPg.js.gz +0 -0
  631. package/dist/web/assets/index-D4M-EXnj.js +1 -0
  632. package/dist/web/assets/index-D4M-EXnj.js.br +0 -0
  633. package/dist/web/assets/index-D4M-EXnj.js.gz +0 -0
  634. package/dist/web/assets/{index-BvRBCpc6.js → index-DHqpUC48.js} +2 -2
  635. package/dist/web/assets/index-DHqpUC48.js.br +0 -0
  636. package/dist/web/assets/index-DHqpUC48.js.gz +0 -0
  637. package/dist/web/assets/index-Da0Nrt28.js +1 -0
  638. package/dist/web/assets/index-Da0Nrt28.js.br +0 -0
  639. package/dist/web/assets/index-Da0Nrt28.js.gz +0 -0
  640. package/dist/web/assets/index-DyWRj5df.js +1 -0
  641. package/dist/web/assets/index-DyWRj5df.js.br +0 -0
  642. package/dist/web/assets/index-DyWRj5df.js.gz +0 -0
  643. package/dist/web/assets/{index-Dkbz748K.js → index-DyZAPivK.js} +4 -4
  644. package/dist/web/assets/index-DyZAPivK.js.br +0 -0
  645. package/dist/web/assets/index-DyZAPivK.js.gz +0 -0
  646. package/dist/web/assets/index-FqFCN7CT.js +13 -0
  647. package/dist/web/assets/index-FqFCN7CT.js.br +0 -0
  648. package/dist/web/assets/index-FqFCN7CT.js.gz +0 -0
  649. package/dist/web/assets/{index-Br3AlBrQ.js → index-L9ABPsXe.js} +1 -1
  650. package/dist/web/assets/index-L9ABPsXe.js.br +0 -0
  651. package/dist/web/assets/index-L9ABPsXe.js.gz +0 -0
  652. package/dist/web/assets/ini-BEwlwnbL.js.br +0 -0
  653. package/dist/web/assets/ini-BEwlwnbL.js.gz +0 -0
  654. package/dist/web/assets/init-Gi6I4Gst.js.br +0 -0
  655. package/dist/web/assets/init-Gi6I4Gst.js.gz +0 -0
  656. package/dist/web/assets/java-CylS5w8V.js.br +0 -0
  657. package/dist/web/assets/java-CylS5w8V.js.gz +0 -0
  658. package/dist/web/assets/javascript-iXu5QeM3.js.br +0 -0
  659. package/dist/web/assets/javascript-iXu5QeM3.js.gz +0 -0
  660. package/dist/web/assets/javascript-wDzz0qaB.js.br +0 -0
  661. package/dist/web/assets/javascript-wDzz0qaB.js.gz +0 -0
  662. package/dist/web/assets/jinja-4LBKfQ-Z.js.br +0 -0
  663. package/dist/web/assets/jinja-4LBKfQ-Z.js.gz +0 -0
  664. package/dist/web/assets/jison-wvAkD_A8.js.br +0 -0
  665. package/dist/web/assets/jison-wvAkD_A8.js.gz +0 -0
  666. package/dist/web/assets/json-Cp-IABpG.js.br +0 -0
  667. package/dist/web/assets/json-Cp-IABpG.js.gz +0 -0
  668. package/dist/web/assets/json-DQCdPPbD.js +1 -0
  669. package/dist/web/assets/json-DQCdPPbD.js.br +0 -0
  670. package/dist/web/assets/json-DQCdPPbD.js.gz +0 -0
  671. package/dist/web/assets/json5-C9tS-k6U.js.br +0 -0
  672. package/dist/web/assets/json5-C9tS-k6U.js.gz +0 -0
  673. package/dist/web/assets/jsonc-Des-eS-w.js.br +0 -0
  674. package/dist/web/assets/jsonc-Des-eS-w.js.gz +0 -0
  675. package/dist/web/assets/jsonl-DcaNXYhu.js.br +0 -0
  676. package/dist/web/assets/jsonl-DcaNXYhu.js.gz +0 -0
  677. package/dist/web/assets/jsonnet-DFQXde-d.js.br +0 -0
  678. package/dist/web/assets/jsonnet-DFQXde-d.js.gz +0 -0
  679. package/dist/web/assets/jssm-C2t-YnRu.js.br +0 -0
  680. package/dist/web/assets/jssm-C2t-YnRu.js.gz +0 -0
  681. package/dist/web/assets/jsx-g9-lgVsj.js.br +0 -0
  682. package/dist/web/assets/jsx-g9-lgVsj.js.gz +0 -0
  683. package/dist/web/assets/julia-CxzCAyBv.js.br +0 -0
  684. package/dist/web/assets/julia-CxzCAyBv.js.gz +0 -0
  685. package/dist/web/assets/julia-DuME0IfC.js.br +0 -0
  686. package/dist/web/assets/julia-DuME0IfC.js.gz +0 -0
  687. package/dist/web/assets/just-Cw27pwNe.js.br +0 -0
  688. package/dist/web/assets/just-Cw27pwNe.js.gz +0 -0
  689. package/dist/web/assets/kanagawa-dragon-CkXjmgJE.js.br +0 -0
  690. package/dist/web/assets/kanagawa-dragon-CkXjmgJE.js.gz +0 -0
  691. package/dist/web/assets/kanagawa-lotus-CfQXZHmo.js.br +0 -0
  692. package/dist/web/assets/kanagawa-lotus-CfQXZHmo.js.gz +0 -0
  693. package/dist/web/assets/kanagawa-wave-DWedfzmr.js.br +0 -0
  694. package/dist/web/assets/kanagawa-wave-DWedfzmr.js.gz +0 -0
  695. package/dist/web/assets/katex-HP8lGamR.js.br +0 -0
  696. package/dist/web/assets/katex-HP8lGamR.js.gz +0 -0
  697. package/dist/web/assets/kdl-DV7GczEv.js.br +0 -0
  698. package/dist/web/assets/kdl-DV7GczEv.js.gz +0 -0
  699. package/dist/web/assets/kotlin-BdnUsdx6.js.br +0 -0
  700. package/dist/web/assets/kotlin-BdnUsdx6.js.gz +0 -0
  701. package/dist/web/assets/kusto-DZf3V79B.js.br +0 -0
  702. package/dist/web/assets/kusto-DZf3V79B.js.gz +0 -0
  703. package/dist/web/assets/laserwave-DUszq2jm.js.br +0 -0
  704. package/dist/web/assets/laserwave-DUszq2jm.js.gz +0 -0
  705. package/dist/web/assets/latex-CWtU0Tv5.js.br +0 -0
  706. package/dist/web/assets/latex-CWtU0Tv5.js.gz +0 -0
  707. package/dist/web/assets/layout-SsrduOYp.js.br +0 -0
  708. package/dist/web/assets/layout-SsrduOYp.js.gz +0 -0
  709. package/dist/web/assets/layoutHooks-BzE4xDdh.js +1 -0
  710. package/dist/web/assets/layoutHooks-BzE4xDdh.js.br +0 -0
  711. package/dist/web/assets/layoutHooks-BzE4xDdh.js.gz +0 -0
  712. package/dist/web/assets/lean-BZvkOJ9d.js.br +0 -0
  713. package/dist/web/assets/lean-BZvkOJ9d.js.gz +0 -0
  714. package/dist/web/assets/less-B1dDrJ26.js.br +0 -0
  715. package/dist/web/assets/less-B1dDrJ26.js.gz +0 -0
  716. package/dist/web/assets/light-plus-B7mTdjB0.js.br +0 -0
  717. package/dist/web/assets/light-plus-B7mTdjB0.js.gz +0 -0
  718. package/dist/web/assets/linear-8XOvhBtb.js +1 -0
  719. package/dist/web/assets/linear-8XOvhBtb.js.br +0 -0
  720. package/dist/web/assets/linear-8XOvhBtb.js.gz +0 -0
  721. package/dist/web/assets/liquid-DYVedYrR.js.br +0 -0
  722. package/dist/web/assets/liquid-DYVedYrR.js.gz +0 -0
  723. package/dist/web/assets/livescript-BwQOo05w.js.br +0 -0
  724. package/dist/web/assets/livescript-BwQOo05w.js.gz +0 -0
  725. package/dist/web/assets/llvm-DjAJT7YJ.js.br +0 -0
  726. package/dist/web/assets/llvm-DjAJT7YJ.js.gz +0 -0
  727. package/dist/web/assets/log-2UxHyX5q.js.br +0 -0
  728. package/dist/web/assets/log-2UxHyX5q.js.gz +0 -0
  729. package/dist/web/assets/logo-BtOb2qkB.js.br +0 -0
  730. package/dist/web/assets/logo-BtOb2qkB.js.gz +0 -0
  731. package/dist/web/assets/lua-BaeVxFsk.js.br +0 -0
  732. package/dist/web/assets/lua-BaeVxFsk.js.gz +0 -0
  733. package/dist/web/assets/lua-VAEuO923.js.br +0 -0
  734. package/dist/web/assets/lua-VAEuO923.js.gz +0 -0
  735. package/dist/web/assets/luau-C-HG3fhB.js.br +0 -0
  736. package/dist/web/assets/luau-C-HG3fhB.js.gz +0 -0
  737. package/dist/web/assets/make-CHLpvVh8.js.br +0 -0
  738. package/dist/web/assets/make-CHLpvVh8.js.gz +0 -0
  739. package/dist/web/assets/markdown-Cvjx9yec.js.br +0 -0
  740. package/dist/web/assets/markdown-Cvjx9yec.js.gz +0 -0
  741. package/dist/web/assets/marko-CnJfTvn9.js.br +0 -0
  742. package/dist/web/assets/marko-CnJfTvn9.js.gz +0 -0
  743. package/dist/web/assets/material-theme-D5KoaKCx.js.br +0 -0
  744. package/dist/web/assets/material-theme-D5KoaKCx.js.gz +0 -0
  745. package/dist/web/assets/material-theme-darker-BfHTSMKl.js.br +0 -0
  746. package/dist/web/assets/material-theme-darker-BfHTSMKl.js.gz +0 -0
  747. package/dist/web/assets/material-theme-lighter-B0m2ddpp.js.br +0 -0
  748. package/dist/web/assets/material-theme-lighter-B0m2ddpp.js.gz +0 -0
  749. package/dist/web/assets/material-theme-ocean-CyktbL80.js.br +0 -0
  750. package/dist/web/assets/material-theme-ocean-CyktbL80.js.gz +0 -0
  751. package/dist/web/assets/material-theme-palenight-Csfq5Kiy.js.br +0 -0
  752. package/dist/web/assets/material-theme-palenight-Csfq5Kiy.js.gz +0 -0
  753. package/dist/web/assets/mathematica-DTrFuWx2.js.br +0 -0
  754. package/dist/web/assets/mathematica-DTrFuWx2.js.gz +0 -0
  755. package/dist/web/assets/matlab-D7o27uSR.js.br +0 -0
  756. package/dist/web/assets/matlab-D7o27uSR.js.gz +0 -0
  757. package/dist/web/assets/mbox-CNhZ1qSd.js.br +0 -0
  758. package/dist/web/assets/mbox-CNhZ1qSd.js.gz +0 -0
  759. package/dist/web/assets/mdc-BMNejdWA.js.br +0 -0
  760. package/dist/web/assets/mdc-BMNejdWA.js.gz +0 -0
  761. package/dist/web/assets/mdx-Cmh6b_Ma.js.br +0 -0
  762. package/dist/web/assets/mdx-Cmh6b_Ma.js.gz +0 -0
  763. package/dist/web/assets/memoryAuthority-B8YSN2MI.js +1 -0
  764. package/dist/web/assets/memoryAuthority-B8YSN2MI.js.br +0 -0
  765. package/dist/web/assets/memoryAuthority-B8YSN2MI.js.gz +0 -0
  766. package/dist/web/assets/mermaid-GHXKKRXX-D3Z62_uv.css +1 -0
  767. package/dist/web/assets/mermaid-GHXKKRXX-D3Z62_uv.css.br +0 -0
  768. package/dist/web/assets/mermaid-GHXKKRXX-D3Z62_uv.css.gz +0 -0
  769. package/dist/web/assets/mermaid-GHXKKRXX-DmcDxWiS.js +190 -0
  770. package/dist/web/assets/mermaid-GHXKKRXX-DmcDxWiS.js.br +0 -0
  771. package/dist/web/assets/mermaid-GHXKKRXX-DmcDxWiS.js.gz +0 -0
  772. package/dist/web/assets/mermaid-engine-AE7SfXFQ.js +2547 -0
  773. package/dist/web/assets/mermaid-engine-AE7SfXFQ.js.br +0 -0
  774. package/dist/web/assets/mermaid-engine-AE7SfXFQ.js.gz +0 -0
  775. package/dist/web/assets/mermaid-mWjccvbQ.js.br +0 -0
  776. package/dist/web/assets/mermaid-mWjccvbQ.js.gz +0 -0
  777. package/dist/web/assets/min-dark-CafNBF8u.js.br +0 -0
  778. package/dist/web/assets/min-dark-CafNBF8u.js.gz +0 -0
  779. package/dist/web/assets/min-light-CTRr51gU.js.br +0 -0
  780. package/dist/web/assets/min-light-CTRr51gU.js.gz +0 -0
  781. package/dist/web/assets/mipsasm-CKIfxQSi.js.br +0 -0
  782. package/dist/web/assets/mipsasm-CKIfxQSi.js.gz +0 -0
  783. package/dist/web/assets/mirc-CjQqDB4T.js.br +0 -0
  784. package/dist/web/assets/mirc-CjQqDB4T.js.gz +0 -0
  785. package/dist/web/assets/mllike-CXdrOF99.js.br +0 -0
  786. package/dist/web/assets/mllike-CXdrOF99.js.gz +0 -0
  787. package/dist/web/assets/modelica-Dc1JOy9r.js.br +0 -0
  788. package/dist/web/assets/modelica-Dc1JOy9r.js.gz +0 -0
  789. package/dist/web/assets/mojo-rZm6bMo-.js.br +0 -0
  790. package/dist/web/assets/mojo-rZm6bMo-.js.gz +0 -0
  791. package/dist/web/assets/monokai-D4h5O-jR.js.br +0 -0
  792. package/dist/web/assets/monokai-D4h5O-jR.js.gz +0 -0
  793. package/dist/web/assets/moonbit-_H4v1dQx.js.br +0 -0
  794. package/dist/web/assets/moonbit-_H4v1dQx.js.gz +0 -0
  795. package/dist/web/assets/move-IF9eRakj.js.br +0 -0
  796. package/dist/web/assets/move-IF9eRakj.js.gz +0 -0
  797. package/dist/web/assets/mscgen-BA5vi2Kp.js.br +0 -0
  798. package/dist/web/assets/mscgen-BA5vi2Kp.js.gz +0 -0
  799. package/dist/web/assets/mumps-BT43cFF4.js.br +0 -0
  800. package/dist/web/assets/mumps-BT43cFF4.js.gz +0 -0
  801. package/dist/web/assets/narrat-DRg8JJMk.js.br +0 -0
  802. package/dist/web/assets/narrat-DRg8JJMk.js.gz +0 -0
  803. package/dist/web/assets/nextflow-Zz6hmt5N.js.br +0 -0
  804. package/dist/web/assets/nextflow-Zz6hmt5N.js.gz +0 -0
  805. package/dist/web/assets/nextflow-groovy-BeH2EWoN.js.br +0 -0
  806. package/dist/web/assets/nextflow-groovy-BeH2EWoN.js.gz +0 -0
  807. package/dist/web/assets/nginx-BpAMiNFr.js.br +0 -0
  808. package/dist/web/assets/nginx-BpAMiNFr.js.gz +0 -0
  809. package/dist/web/assets/nginx-DdIZxoE0.js.br +0 -0
  810. package/dist/web/assets/nginx-DdIZxoE0.js.gz +0 -0
  811. package/dist/web/assets/night-owl-C39BiMTA.js.br +0 -0
  812. package/dist/web/assets/night-owl-C39BiMTA.js.gz +0 -0
  813. package/dist/web/assets/night-owl-light-CMTm3GFP.js.br +0 -0
  814. package/dist/web/assets/night-owl-light-CMTm3GFP.js.gz +0 -0
  815. package/dist/web/assets/nim-CVrawwO9.js.br +0 -0
  816. package/dist/web/assets/nim-CVrawwO9.js.gz +0 -0
  817. package/dist/web/assets/nix-CwoSXNpI.js.br +0 -0
  818. package/dist/web/assets/nix-CwoSXNpI.js.gz +0 -0
  819. package/dist/web/assets/nord-Ddv68eIx.js.br +0 -0
  820. package/dist/web/assets/nord-Ddv68eIx.js.gz +0 -0
  821. package/dist/web/assets/nsis-LdVXkNf5.js.br +0 -0
  822. package/dist/web/assets/nsis-LdVXkNf5.js.gz +0 -0
  823. package/dist/web/assets/ntriples-BfvgReVJ.js.br +0 -0
  824. package/dist/web/assets/ntriples-BfvgReVJ.js.gz +0 -0
  825. package/dist/web/assets/nushell-Cz2AlsmD.js.br +0 -0
  826. package/dist/web/assets/nushell-Cz2AlsmD.js.gz +0 -0
  827. package/dist/web/assets/objective-c-DXmwc3jG.js.br +0 -0
  828. package/dist/web/assets/objective-c-DXmwc3jG.js.gz +0 -0
  829. package/dist/web/assets/objective-cpp-CLxacb5B.js.br +0 -0
  830. package/dist/web/assets/objective-cpp-CLxacb5B.js.gz +0 -0
  831. package/dist/web/assets/ocaml-C0hk2d4L.js.br +0 -0
  832. package/dist/web/assets/ocaml-C0hk2d4L.js.gz +0 -0
  833. package/dist/web/assets/octave-Ck1zUtKM.js.br +0 -0
  834. package/dist/web/assets/octave-Ck1zUtKM.js.gz +0 -0
  835. package/dist/web/assets/odin-BBf5iR-q.js.br +0 -0
  836. package/dist/web/assets/odin-BBf5iR-q.js.gz +0 -0
  837. package/dist/web/assets/one-dark-pro-DVMEJ2y_.js.br +0 -0
  838. package/dist/web/assets/one-dark-pro-DVMEJ2y_.js.gz +0 -0
  839. package/dist/web/assets/one-light-C3Wv6jpd.js.br +0 -0
  840. package/dist/web/assets/one-light-C3Wv6jpd.js.gz +0 -0
  841. package/dist/web/assets/openscad-C4EeE6gA.js.br +0 -0
  842. package/dist/web/assets/openscad-C4EeE6gA.js.gz +0 -0
  843. package/dist/web/assets/ordinal-Cboi1Yqb.js.br +0 -0
  844. package/dist/web/assets/ordinal-Cboi1Yqb.js.gz +0 -0
  845. package/dist/web/assets/oz-BzwKVEFT.js.br +0 -0
  846. package/dist/web/assets/oz-BzwKVEFT.js.gz +0 -0
  847. package/dist/web/assets/packs-Bee69jWU.js +1 -0
  848. package/dist/web/assets/packs-Bee69jWU.js.br +0 -0
  849. package/dist/web/assets/packs-Bee69jWU.js.gz +0 -0
  850. package/dist/web/assets/pascal--L3eBynH.js.br +0 -0
  851. package/dist/web/assets/pascal--L3eBynH.js.gz +0 -0
  852. package/dist/web/assets/pascal-D93ZcfNL.js.br +0 -0
  853. package/dist/web/assets/pascal-D93ZcfNL.js.gz +0 -0
  854. package/dist/web/assets/pdf-CIFzrehN.js +13 -0
  855. package/dist/web/assets/pdf-CIFzrehN.js.br +0 -0
  856. package/dist/web/assets/pdf-CIFzrehN.js.gz +0 -0
  857. package/dist/web/assets/perl-C0TMdlhV.js.br +0 -0
  858. package/dist/web/assets/perl-C0TMdlhV.js.gz +0 -0
  859. package/dist/web/assets/perl-CdXCOZ3F.js.br +0 -0
  860. package/dist/web/assets/perl-CdXCOZ3F.js.gz +0 -0
  861. package/dist/web/assets/php-Dhbhpdrm.js.br +0 -0
  862. package/dist/web/assets/php-Dhbhpdrm.js.gz +0 -0
  863. package/dist/web/assets/pie-DJOJsNN1.js +1 -0
  864. package/dist/web/assets/pie-DJOJsNN1.js.br +0 -0
  865. package/dist/web/assets/pie-DJOJsNN1.js.gz +0 -0
  866. package/dist/web/assets/pig-CevX1Tat.js.br +0 -0
  867. package/dist/web/assets/pig-CevX1Tat.js.gz +0 -0
  868. package/dist/web/assets/pkl-u5AG7uiY.js.br +0 -0
  869. package/dist/web/assets/pkl-u5AG7uiY.js.gz +0 -0
  870. package/dist/web/assets/plastic-3e1v2bzS.js.br +0 -0
  871. package/dist/web/assets/plastic-3e1v2bzS.js.gz +0 -0
  872. package/dist/web/assets/plsql-ChMvpjG-.js.br +0 -0
  873. package/dist/web/assets/plsql-ChMvpjG-.js.gz +0 -0
  874. package/dist/web/assets/po-BTJTHyun.js.br +0 -0
  875. package/dist/web/assets/po-BTJTHyun.js.gz +0 -0
  876. package/dist/web/assets/poimandres-CS3Unz2-.js.br +0 -0
  877. package/dist/web/assets/poimandres-CS3Unz2-.js.gz +0 -0
  878. package/dist/web/assets/polar-C0HS_06l.js.br +0 -0
  879. package/dist/web/assets/polar-C0HS_06l.js.gz +0 -0
  880. package/dist/web/assets/postcss-CXtECtnM.js.br +0 -0
  881. package/dist/web/assets/postcss-CXtECtnM.js.gz +0 -0
  882. package/dist/web/assets/powerquery-CEu0bR-o.js.br +0 -0
  883. package/dist/web/assets/powerquery-CEu0bR-o.js.gz +0 -0
  884. package/dist/web/assets/powershell-CFHJl5sT.js.br +0 -0
  885. package/dist/web/assets/powershell-CFHJl5sT.js.gz +0 -0
  886. package/dist/web/assets/powershell-Dpen1YoG.js.br +0 -0
  887. package/dist/web/assets/powershell-Dpen1YoG.js.gz +0 -0
  888. package/dist/web/assets/prisma-Dd19v3D-.js.br +0 -0
  889. package/dist/web/assets/prisma-Dd19v3D-.js.gz +0 -0
  890. package/dist/web/assets/prolog-CbFg5uaA.js.br +0 -0
  891. package/dist/web/assets/prolog-CbFg5uaA.js.gz +0 -0
  892. package/dist/web/assets/properties-C78fOPTZ.js.br +0 -0
  893. package/dist/web/assets/properties-C78fOPTZ.js.gz +0 -0
  894. package/dist/web/assets/proto-C7zT0LnQ.js.br +0 -0
  895. package/dist/web/assets/proto-C7zT0LnQ.js.gz +0 -0
  896. package/dist/web/assets/protobuf-ChK-085T.js.br +0 -0
  897. package/dist/web/assets/protobuf-ChK-085T.js.gz +0 -0
  898. package/dist/web/assets/pug-CGlum2m_.js.br +0 -0
  899. package/dist/web/assets/pug-CGlum2m_.js.gz +0 -0
  900. package/dist/web/assets/pug-DeIclll2.js.br +0 -0
  901. package/dist/web/assets/pug-DeIclll2.js.gz +0 -0
  902. package/dist/web/assets/puppet-BMWR74SV.js.br +0 -0
  903. package/dist/web/assets/puppet-BMWR74SV.js.gz +0 -0
  904. package/dist/web/assets/puppet-DMA9R1ak.js.br +0 -0
  905. package/dist/web/assets/puppet-DMA9R1ak.js.gz +0 -0
  906. package/dist/web/assets/purescript-CklMAg4u.js.br +0 -0
  907. package/dist/web/assets/purescript-CklMAg4u.js.gz +0 -0
  908. package/dist/web/assets/python-B6aJPvgy.js.br +0 -0
  909. package/dist/web/assets/python-B6aJPvgy.js.gz +0 -0
  910. package/dist/web/assets/python-BuPzkPfP.js.br +0 -0
  911. package/dist/web/assets/python-BuPzkPfP.js.gz +0 -0
  912. package/dist/web/assets/q-pXgVlZs6.js.br +0 -0
  913. package/dist/web/assets/q-pXgVlZs6.js.gz +0 -0
  914. package/dist/web/assets/qml-3beO22l8.js.br +0 -0
  915. package/dist/web/assets/qml-3beO22l8.js.gz +0 -0
  916. package/dist/web/assets/qmldir-C8lEn-DE.js.br +0 -0
  917. package/dist/web/assets/qmldir-C8lEn-DE.js.gz +0 -0
  918. package/dist/web/assets/qss-IeuSbFQv.js.br +0 -0
  919. package/dist/web/assets/qss-IeuSbFQv.js.gz +0 -0
  920. package/dist/web/assets/r-B6wPVr8A.js.br +0 -0
  921. package/dist/web/assets/r-B6wPVr8A.js.gz +0 -0
  922. package/dist/web/assets/r-Dspwwk_N.js.br +0 -0
  923. package/dist/web/assets/r-Dspwwk_N.js.gz +0 -0
  924. package/dist/web/assets/racket-BqYA7rlc.js.br +0 -0
  925. package/dist/web/assets/racket-BqYA7rlc.js.gz +0 -0
  926. package/dist/web/assets/raku-DXvB9xmW.js.br +0 -0
  927. package/dist/web/assets/raku-DXvB9xmW.js.gz +0 -0
  928. package/dist/web/assets/razor-Uh8Bk_45.js.br +0 -0
  929. package/dist/web/assets/razor-Uh8Bk_45.js.gz +0 -0
  930. package/dist/web/assets/red-bN70gL4F.js.br +0 -0
  931. package/dist/web/assets/red-bN70gL4F.js.gz +0 -0
  932. package/dist/web/assets/reg-C-SQnVFl.js.br +0 -0
  933. package/dist/web/assets/reg-C-SQnVFl.js.gz +0 -0
  934. package/dist/web/assets/regexp-CDVJQ6XC.js.br +0 -0
  935. package/dist/web/assets/regexp-CDVJQ6XC.js.gz +0 -0
  936. package/dist/web/assets/rel-C3B-1QV4.js.br +0 -0
  937. package/dist/web/assets/rel-C3B-1QV4.js.gz +0 -0
  938. package/dist/web/assets/riscv-BM1_JUlF.js.br +0 -0
  939. package/dist/web/assets/riscv-BM1_JUlF.js.gz +0 -0
  940. package/dist/web/assets/ron-D8l8udqQ.js.br +0 -0
  941. package/dist/web/assets/ron-D8l8udqQ.js.gz +0 -0
  942. package/dist/web/assets/rose-pine-dawn-DHQR4-dF.js.br +0 -0
  943. package/dist/web/assets/rose-pine-dawn-DHQR4-dF.js.gz +0 -0
  944. package/dist/web/assets/rose-pine-moon-D4_iv3hh.js.br +0 -0
  945. package/dist/web/assets/rose-pine-moon-D4_iv3hh.js.gz +0 -0
  946. package/dist/web/assets/rose-pine-qdsjHGoJ.js.br +0 -0
  947. package/dist/web/assets/rose-pine-qdsjHGoJ.js.gz +0 -0
  948. package/dist/web/assets/rosmsg-BJDFO7_C.js.br +0 -0
  949. package/dist/web/assets/rosmsg-BJDFO7_C.js.gz +0 -0
  950. package/dist/web/assets/rpm-CTu-6PCP.js.br +0 -0
  951. package/dist/web/assets/rpm-CTu-6PCP.js.gz +0 -0
  952. package/dist/web/assets/rst-BrH8l1NY.js.br +0 -0
  953. package/dist/web/assets/rst-BrH8l1NY.js.gz +0 -0
  954. package/dist/web/assets/ruby-B2Rjki9n.js.br +0 -0
  955. package/dist/web/assets/ruby-B2Rjki9n.js.gz +0 -0
  956. package/dist/web/assets/ruby-Dw2BHqvy.js.br +0 -0
  957. package/dist/web/assets/ruby-Dw2BHqvy.js.gz +0 -0
  958. package/dist/web/assets/rust-B1yitclQ.js.br +0 -0
  959. package/dist/web/assets/rust-B1yitclQ.js.gz +0 -0
  960. package/dist/web/assets/sankeyLinkHorizontal-FH_jDQz2.js +1 -0
  961. package/dist/web/assets/sankeyLinkHorizontal-FH_jDQz2.js.br +0 -0
  962. package/dist/web/assets/sankeyLinkHorizontal-FH_jDQz2.js.gz +0 -0
  963. package/dist/web/assets/sas-B4kiWyti.js.br +0 -0
  964. package/dist/web/assets/sas-B4kiWyti.js.gz +0 -0
  965. package/dist/web/assets/sas-cz2c8ADy.js.br +0 -0
  966. package/dist/web/assets/sas-cz2c8ADy.js.gz +0 -0
  967. package/dist/web/assets/sass-Cj5Yp3dK.js.br +0 -0
  968. package/dist/web/assets/sass-Cj5Yp3dK.js.gz +0 -0
  969. package/dist/web/assets/scala-C151Ov-r.js.br +0 -0
  970. package/dist/web/assets/scala-C151Ov-r.js.gz +0 -0
  971. package/dist/web/assets/scheme-C41bIUwD.js.br +0 -0
  972. package/dist/web/assets/scheme-C41bIUwD.js.gz +0 -0
  973. package/dist/web/assets/scheme-C98Dy4si.js.br +0 -0
  974. package/dist/web/assets/scheme-C98Dy4si.js.gz +0 -0
  975. package/dist/web/assets/scss-OYdSNvt2.js.br +0 -0
  976. package/dist/web/assets/scss-OYdSNvt2.js.gz +0 -0
  977. package/dist/web/assets/sdbl-DVxCFoDh.js.br +0 -0
  978. package/dist/web/assets/sdbl-DVxCFoDh.js.gz +0 -0
  979. package/dist/web/assets/shaderlab-Dg9Lc6iA.js.br +0 -0
  980. package/dist/web/assets/shaderlab-Dg9Lc6iA.js.gz +0 -0
  981. package/dist/web/assets/shell-CjFT_Tl9.js.br +0 -0
  982. package/dist/web/assets/shell-CjFT_Tl9.js.gz +0 -0
  983. package/dist/web/assets/shellscript-Yzrsuije.js.br +0 -0
  984. package/dist/web/assets/shellscript-Yzrsuije.js.gz +0 -0
  985. package/dist/web/assets/shellsession-BADoaaVG.js.br +0 -0
  986. package/dist/web/assets/shellsession-BADoaaVG.js.gz +0 -0
  987. package/dist/web/assets/sieve-C3Gn_uJK.js.br +0 -0
  988. package/dist/web/assets/sieve-C3Gn_uJK.js.gz +0 -0
  989. package/dist/web/assets/simple-mode-GW_nhZxv.js.br +0 -0
  990. package/dist/web/assets/simple-mode-GW_nhZxv.js.gz +0 -0
  991. package/dist/web/assets/slack-dark-BthQWCQV.js.br +0 -0
  992. package/dist/web/assets/slack-dark-BthQWCQV.js.gz +0 -0
  993. package/dist/web/assets/slack-ochin-DqwNpetd.js.br +0 -0
  994. package/dist/web/assets/slack-ochin-DqwNpetd.js.gz +0 -0
  995. package/dist/web/assets/smalltalk-BERRCDM3.js.br +0 -0
  996. package/dist/web/assets/smalltalk-BERRCDM3.js.gz +0 -0
  997. package/dist/web/assets/smalltalk-CnHTOXQT.js.br +0 -0
  998. package/dist/web/assets/smalltalk-CnHTOXQT.js.gz +0 -0
  999. package/dist/web/assets/snazzy-light-Bw305WKR.js.br +0 -0
  1000. package/dist/web/assets/snazzy-light-Bw305WKR.js.gz +0 -0
  1001. package/dist/web/assets/solarized-dark-DXbdFlpD.js.br +0 -0
  1002. package/dist/web/assets/solarized-dark-DXbdFlpD.js.gz +0 -0
  1003. package/dist/web/assets/solarized-light-L9t79GZl.js.br +0 -0
  1004. package/dist/web/assets/solarized-light-L9t79GZl.js.gz +0 -0
  1005. package/dist/web/assets/solidity-rGO070M0.js.br +0 -0
  1006. package/dist/web/assets/solidity-rGO070M0.js.gz +0 -0
  1007. package/dist/web/assets/solr-DehyRSwq.js.br +0 -0
  1008. package/dist/web/assets/solr-DehyRSwq.js.gz +0 -0
  1009. package/dist/web/assets/soy-Brmx7dQM.js.br +0 -0
  1010. package/dist/web/assets/soy-Brmx7dQM.js.gz +0 -0
  1011. package/dist/web/assets/spaces-wH3o95f_.js +1 -0
  1012. package/dist/web/assets/spaces-wH3o95f_.js.br +0 -0
  1013. package/dist/web/assets/spaces-wH3o95f_.js.gz +0 -0
  1014. package/dist/web/assets/sparql-DkYu6x3z.js.br +0 -0
  1015. package/dist/web/assets/sparql-DkYu6x3z.js.gz +0 -0
  1016. package/dist/web/assets/sparql-rVzFXLq3.js.br +0 -0
  1017. package/dist/web/assets/sparql-rVzFXLq3.js.gz +0 -0
  1018. package/dist/web/assets/splunk-BtCnVYZw.js.br +0 -0
  1019. package/dist/web/assets/splunk-BtCnVYZw.js.gz +0 -0
  1020. package/dist/web/assets/spreadsheet-BCZA_wO0.js.br +0 -0
  1021. package/dist/web/assets/spreadsheet-BCZA_wO0.js.gz +0 -0
  1022. package/dist/web/assets/sql-BLtJtn59.js.br +0 -0
  1023. package/dist/web/assets/sql-BLtJtn59.js.gz +0 -0
  1024. package/dist/web/assets/sql-D0XecflT.js.br +0 -0
  1025. package/dist/web/assets/sql-D0XecflT.js.gz +0 -0
  1026. package/dist/web/assets/ssh-config-_ykCGR6B.js.br +0 -0
  1027. package/dist/web/assets/ssh-config-_ykCGR6B.js.gz +0 -0
  1028. package/dist/web/assets/stata-BH5u7GGu.js.br +0 -0
  1029. package/dist/web/assets/stata-BH5u7GGu.js.gz +0 -0
  1030. package/dist/web/assets/stex-C3f8Ysf7.js.br +0 -0
  1031. package/dist/web/assets/stex-C3f8Ysf7.js.gz +0 -0
  1032. package/dist/web/assets/stylus-B533Al4x.js.br +0 -0
  1033. package/dist/web/assets/stylus-B533Al4x.js.gz +0 -0
  1034. package/dist/web/assets/stylus-BEDo0Tqx.js.br +0 -0
  1035. package/dist/web/assets/stylus-BEDo0Tqx.js.gz +0 -0
  1036. package/dist/web/assets/surrealql-Bq5Q-fJD.js.br +0 -0
  1037. package/dist/web/assets/surrealql-Bq5Q-fJD.js.gz +0 -0
  1038. package/dist/web/assets/svelte-C_ipcX3V.js.br +0 -0
  1039. package/dist/web/assets/svelte-C_ipcX3V.js.gz +0 -0
  1040. package/dist/web/assets/swift-BzpIVaGY.js.br +0 -0
  1041. package/dist/web/assets/swift-BzpIVaGY.js.gz +0 -0
  1042. package/dist/web/assets/swift-D82vCrfD.js.br +0 -0
  1043. package/dist/web/assets/swift-D82vCrfD.js.gz +0 -0
  1044. package/dist/web/assets/synthwave-84-CbfX1IO0.js.br +0 -0
  1045. package/dist/web/assets/synthwave-84-CbfX1IO0.js.gz +0 -0
  1046. package/dist/web/assets/system-verilog-CnnmHF94.js.br +0 -0
  1047. package/dist/web/assets/system-verilog-CnnmHF94.js.gz +0 -0
  1048. package/dist/web/assets/systemd-4A_iFExJ.js.br +0 -0
  1049. package/dist/web/assets/systemd-4A_iFExJ.js.gz +0 -0
  1050. package/dist/web/assets/talonscript-CkByrt1z.js.br +0 -0
  1051. package/dist/web/assets/talonscript-CkByrt1z.js.gz +0 -0
  1052. package/dist/web/assets/tasl-QIJgUcNo.js.br +0 -0
  1053. package/dist/web/assets/tasl-QIJgUcNo.js.gz +0 -0
  1054. package/dist/web/assets/tcl-DVfN8rqt.js.br +0 -0
  1055. package/dist/web/assets/tcl-DVfN8rqt.js.gz +0 -0
  1056. package/dist/web/assets/tcl-dwOrl1Do.js.br +0 -0
  1057. package/dist/web/assets/tcl-dwOrl1Do.js.gz +0 -0
  1058. package/dist/web/assets/templ-P3uqSqPl.js.br +0 -0
  1059. package/dist/web/assets/templ-P3uqSqPl.js.gz +0 -0
  1060. package/dist/web/assets/terraform-BETggiCN.js.br +0 -0
  1061. package/dist/web/assets/terraform-BETggiCN.js.gz +0 -0
  1062. package/dist/web/assets/tex-idrVyKtj.js.br +0 -0
  1063. package/dist/web/assets/tex-idrVyKtj.js.gz +0 -0
  1064. package/dist/web/assets/textile-CnDTJFAw.js.br +0 -0
  1065. package/dist/web/assets/textile-CnDTJFAw.js.gz +0 -0
  1066. package/dist/web/assets/theme-DVIt3W-5.js +1 -0
  1067. package/dist/web/assets/theme-DVIt3W-5.js.br +0 -0
  1068. package/dist/web/assets/theme-DVIt3W-5.js.gz +0 -0
  1069. package/dist/web/assets/tiddlywiki-DO-Gjzrf.js.br +0 -0
  1070. package/dist/web/assets/tiddlywiki-DO-Gjzrf.js.gz +0 -0
  1071. package/dist/web/assets/tiki-DGYXhP31.js.br +0 -0
  1072. package/dist/web/assets/tiki-DGYXhP31.js.gz +0 -0
  1073. package/dist/web/assets/tokyo-night-hegEt444.js.br +0 -0
  1074. package/dist/web/assets/tokyo-night-hegEt444.js.gz +0 -0
  1075. package/dist/web/assets/toml-Bm5Em-hy.js.br +0 -0
  1076. package/dist/web/assets/toml-Bm5Em-hy.js.gz +0 -0
  1077. package/dist/web/assets/toml-vGWfd6FD.js.br +0 -0
  1078. package/dist/web/assets/toml-vGWfd6FD.js.gz +0 -0
  1079. package/dist/web/assets/troff-wAsdV37c.js.br +0 -0
  1080. package/dist/web/assets/troff-wAsdV37c.js.gz +0 -0
  1081. package/dist/web/assets/ts-tags-zn1MmPIZ.js.br +0 -0
  1082. package/dist/web/assets/ts-tags-zn1MmPIZ.js.gz +0 -0
  1083. package/dist/web/assets/tsv-B_m7g4N7.js.br +0 -0
  1084. package/dist/web/assets/tsv-B_m7g4N7.js.gz +0 -0
  1085. package/dist/web/assets/tsx-COt5Ahok.js.br +0 -0
  1086. package/dist/web/assets/tsx-COt5Ahok.js.gz +0 -0
  1087. package/dist/web/assets/ttcn-CfJYG6tj.js.br +0 -0
  1088. package/dist/web/assets/ttcn-CfJYG6tj.js.gz +0 -0
  1089. package/dist/web/assets/ttcn-cfg-B9xdYoR4.js.br +0 -0
  1090. package/dist/web/assets/ttcn-cfg-B9xdYoR4.js.gz +0 -0
  1091. package/dist/web/assets/turtle-B1tBg_DP.js.br +0 -0
  1092. package/dist/web/assets/turtle-B1tBg_DP.js.gz +0 -0
  1093. package/dist/web/assets/turtle-BsS91CYL.js.br +0 -0
  1094. package/dist/web/assets/turtle-BsS91CYL.js.gz +0 -0
  1095. package/dist/web/assets/twig-DNn4PbVi.js.br +0 -0
  1096. package/dist/web/assets/twig-DNn4PbVi.js.gz +0 -0
  1097. package/dist/web/assets/typescript-BPQ3VLAy.js.br +0 -0
  1098. package/dist/web/assets/typescript-BPQ3VLAy.js.gz +0 -0
  1099. package/dist/web/assets/typespec-BGHnOYBU.js.br +0 -0
  1100. package/dist/web/assets/typespec-BGHnOYBU.js.gz +0 -0
  1101. package/dist/web/assets/typst-DHCkPAjA.js.br +0 -0
  1102. package/dist/web/assets/typst-DHCkPAjA.js.gz +0 -0
  1103. package/dist/web/assets/uiZoom-CfR9h3Dy.js +1 -0
  1104. package/dist/web/assets/uiZoom-CfR9h3Dy.js.br +0 -0
  1105. package/dist/web/assets/uiZoom-CfR9h3Dy.js.gz +0 -0
  1106. package/dist/web/assets/v-BcVCzyr7.js.br +0 -0
  1107. package/dist/web/assets/v-BcVCzyr7.js.gz +0 -0
  1108. package/dist/web/assets/v4-Dnyct6Ft.js +1 -0
  1109. package/dist/web/assets/v4-Dnyct6Ft.js.br +0 -0
  1110. package/dist/web/assets/v4-Dnyct6Ft.js.gz +0 -0
  1111. package/dist/web/assets/vala-CsfeWuGM.js.br +0 -0
  1112. package/dist/web/assets/vala-CsfeWuGM.js.gz +0 -0
  1113. package/dist/web/assets/vb-CmGdzxic.js.br +0 -0
  1114. package/dist/web/assets/vb-CmGdzxic.js.gz +0 -0
  1115. package/dist/web/assets/vb-D17OF-Vu.js.br +0 -0
  1116. package/dist/web/assets/vb-D17OF-Vu.js.gz +0 -0
  1117. package/dist/web/assets/vbscript-BuJXcnF6.js.br +0 -0
  1118. package/dist/web/assets/vbscript-BuJXcnF6.js.gz +0 -0
  1119. package/dist/web/assets/velocity-D8B20fx6.js.br +0 -0
  1120. package/dist/web/assets/velocity-D8B20fx6.js.gz +0 -0
  1121. package/dist/web/assets/vendor-react-BqVzR-It.js +61 -0
  1122. package/dist/web/assets/vendor-react-BqVzR-It.js.br +0 -0
  1123. package/dist/web/assets/vendor-react-BqVzR-It.js.gz +0 -0
  1124. package/dist/web/assets/venn.esm-D6tdiC58.js +7 -0
  1125. package/dist/web/assets/venn.esm-D6tdiC58.js.br +0 -0
  1126. package/dist/web/assets/venn.esm-D6tdiC58.js.gz +0 -0
  1127. package/dist/web/assets/verilog-BQ8w6xss.js.br +0 -0
  1128. package/dist/web/assets/verilog-BQ8w6xss.js.gz +0 -0
  1129. package/dist/web/assets/verilog-C6RDOZhf.js.br +0 -0
  1130. package/dist/web/assets/verilog-C6RDOZhf.js.gz +0 -0
  1131. package/dist/web/assets/vesper-DU1UobuO.js.br +0 -0
  1132. package/dist/web/assets/vesper-DU1UobuO.js.gz +0 -0
  1133. package/dist/web/assets/vhdl-CeAyd5Ju.js.br +0 -0
  1134. package/dist/web/assets/vhdl-CeAyd5Ju.js.gz +0 -0
  1135. package/dist/web/assets/vhdl-lSbBsy5d.js.br +0 -0
  1136. package/dist/web/assets/vhdl-lSbBsy5d.js.gz +0 -0
  1137. package/dist/web/assets/viml-CJc9bBzg.js.br +0 -0
  1138. package/dist/web/assets/viml-CJc9bBzg.js.gz +0 -0
  1139. package/dist/web/assets/vitesse-black-Bkuqu6BP.js.br +0 -0
  1140. package/dist/web/assets/vitesse-black-Bkuqu6BP.js.gz +0 -0
  1141. package/dist/web/assets/vitesse-dark-D0r3Knsf.js.br +0 -0
  1142. package/dist/web/assets/vitesse-dark-D0r3Knsf.js.gz +0 -0
  1143. package/dist/web/assets/vitesse-light-CVO1_9PV.js.br +0 -0
  1144. package/dist/web/assets/vitesse-light-CVO1_9PV.js.gz +0 -0
  1145. package/dist/web/assets/vue-DN_0RTcg.js.br +0 -0
  1146. package/dist/web/assets/vue-DN_0RTcg.js.gz +0 -0
  1147. package/dist/web/assets/vue-html-AaS7Mt5G.js.br +0 -0
  1148. package/dist/web/assets/vue-html-AaS7Mt5G.js.gz +0 -0
  1149. package/dist/web/assets/vue-vine-CQOfvN7w.js.br +0 -0
  1150. package/dist/web/assets/vue-vine-CQOfvN7w.js.gz +0 -0
  1151. package/dist/web/assets/vyper-CDx5xZoG.js.br +0 -0
  1152. package/dist/web/assets/vyper-CDx5xZoG.js.gz +0 -0
  1153. package/dist/web/assets/{wardley-L42UT6IY-Bp3q2izt.js → wardley-L42UT6IY-CptWIPkK.js} +1 -1
  1154. package/dist/web/assets/wardley-L42UT6IY-CptWIPkK.js.br +0 -0
  1155. package/dist/web/assets/wardley-L42UT6IY-CptWIPkK.js.gz +0 -0
  1156. package/dist/web/assets/wasm-CG6Dc4jp.js.br +0 -0
  1157. package/dist/web/assets/wasm-CG6Dc4jp.js.gz +0 -0
  1158. package/dist/web/assets/wasm-MzD3tlZU.js.br +0 -0
  1159. package/dist/web/assets/wasm-MzD3tlZU.js.gz +0 -0
  1160. package/dist/web/assets/webidl-ZXfAyPTL.js.br +0 -0
  1161. package/dist/web/assets/webidl-ZXfAyPTL.js.gz +0 -0
  1162. package/dist/web/assets/wenyan-BV7otONQ.js.br +0 -0
  1163. package/dist/web/assets/wenyan-BV7otONQ.js.gz +0 -0
  1164. package/dist/web/assets/wgsl-Dx-B1_4e.js.br +0 -0
  1165. package/dist/web/assets/wgsl-Dx-B1_4e.js.gz +0 -0
  1166. package/dist/web/assets/wikitext-BhOHFoWU.js.br +0 -0
  1167. package/dist/web/assets/wikitext-BhOHFoWU.js.gz +0 -0
  1168. package/dist/web/assets/wit-5i3qLPDT.js.br +0 -0
  1169. package/dist/web/assets/wit-5i3qLPDT.js.gz +0 -0
  1170. package/dist/web/assets/wolfram-lXgVvXCa.js.br +0 -0
  1171. package/dist/web/assets/wolfram-lXgVvXCa.js.gz +0 -0
  1172. package/dist/web/assets/xml-sdJ4AIDG.js.br +0 -0
  1173. package/dist/web/assets/xml-sdJ4AIDG.js.gz +0 -0
  1174. package/dist/web/assets/xquery-DzFWVndE.js.br +0 -0
  1175. package/dist/web/assets/xquery-DzFWVndE.js.gz +0 -0
  1176. package/dist/web/assets/xsl-CtQFsRM5.js.br +0 -0
  1177. package/dist/web/assets/xsl-CtQFsRM5.js.gz +0 -0
  1178. package/dist/web/assets/yacas-BJ4BC0dw.js.br +0 -0
  1179. package/dist/web/assets/yacas-BJ4BC0dw.js.gz +0 -0
  1180. package/dist/web/assets/yaml-Buea-lGh.js.br +0 -0
  1181. package/dist/web/assets/yaml-Buea-lGh.js.gz +0 -0
  1182. package/dist/web/assets/z80-Hz9HOZM7.js.br +0 -0
  1183. package/dist/web/assets/z80-Hz9HOZM7.js.gz +0 -0
  1184. package/dist/web/assets/zenscript-DVFEvuxE.js.br +0 -0
  1185. package/dist/web/assets/zenscript-DVFEvuxE.js.gz +0 -0
  1186. package/dist/web/assets/zig-VOosw3JB.js.br +0 -0
  1187. package/dist/web/assets/zig-VOosw3JB.js.gz +0 -0
  1188. package/dist/web/index.html +12 -17
  1189. package/dist/web/index.html.br +0 -0
  1190. package/dist/web/index.html.gz +0 -0
  1191. package/dist/web/pdfjs/pdf.worker.min.mjs +1 -1
  1192. package/dist/web/pdfjs/pdf.worker.min.mjs.br +0 -0
  1193. package/dist/web/pdfjs/pdf.worker.min.mjs.gz +0 -0
  1194. package/dist/web/theme-boot.js +20 -0
  1195. package/dist/web/theme-boot.js.br +0 -0
  1196. package/dist/web/theme-boot.js.gz +0 -0
  1197. package/native/auth-native/index.cjs +6 -0
  1198. package/native/auth-native/index.d.ts +14 -0
  1199. package/native/auth-native/package.json +1 -2
  1200. package/native/auth-native/prebuilds/darwin-arm64/auth-native.node +0 -0
  1201. package/native/auth-native/prebuilds/darwin-x64/auth-native.node +0 -0
  1202. package/native/auth-native/prebuilds/linux-arm64/auth-native.node +0 -0
  1203. package/native/auth-native/prebuilds/linux-x64/auth-native.node +0 -0
  1204. package/native/auth-native/prebuilds/win32-arm64/auth-native.node +0 -0
  1205. package/native/auth-native/prebuilds/win32-x64/auth-native.node +0 -0
  1206. package/package.json +1 -1
  1207. package/dist/web/assets/AppErrorBoundary-B5Fc4f6-.js +0 -1
  1208. package/dist/web/assets/NavScopeBoundary-C7MnGQio.js +0 -1
  1209. package/dist/web/assets/arc-DGB9OVgQ.js +0 -1
  1210. package/dist/web/assets/architectureDiagram-3BPJPVTR-glnQCMub.js +0 -36
  1211. package/dist/web/assets/blockDiagram-GPEHLZMM-bM0tnGby.js +0 -132
  1212. package/dist/web/assets/c4Diagram-AAUBKEIU-DMf_rTtt.js +0 -10
  1213. package/dist/web/assets/channel-Cj8SKJ38.js +0 -1
  1214. package/dist/web/assets/chunk-2J33WTMH-mTccJ3tW.js +0 -1
  1215. package/dist/web/assets/chunk-4BX2VUAB-DhqPYMjY.js +0 -1
  1216. package/dist/web/assets/chunk-55IACEB6-BujrYRoO.js +0 -1
  1217. package/dist/web/assets/chunk-727SXJPM-ciMmSI4G.js +0 -206
  1218. package/dist/web/assets/chunk-AQP2D5EJ-CZW9pKTc.js +0 -231
  1219. package/dist/web/assets/chunk-FMBD7UC4-hdALNnnU.js +0 -15
  1220. package/dist/web/assets/chunk-ND2GUHAM-CgKyqUdb.js +0 -1
  1221. package/dist/web/assets/chunk-QZHKN3VN-B2mmUz_E.js +0 -1
  1222. package/dist/web/assets/classDiagram-4FO5ZUOK-f8V9p-dD.js +0 -1
  1223. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-f8V9p-dD.js +0 -1
  1224. package/dist/web/assets/client-ClWQBErG.js +0 -3
  1225. package/dist/web/assets/connection-C0J3BPgk.js +0 -1
  1226. package/dist/web/assets/cose-bilkent-S5V4N54A-UV3uPjkK.js +0 -1
  1227. package/dist/web/assets/dagre-BM42HDAG-Zjy-gQ6C.js +0 -4
  1228. package/dist/web/assets/diagram-2AECGRRQ-DL-kilIf.js +0 -43
  1229. package/dist/web/assets/diagram-5GNKFQAL-CjB_xR5B.js +0 -10
  1230. package/dist/web/assets/diagram-KO2AKTUF-CjN4i3b9.js +0 -3
  1231. package/dist/web/assets/diagram-LMA3HP47-CPCAMndo.js +0 -24
  1232. package/dist/web/assets/diagram-OG6HWLK6-DVeBWBKd.js +0 -24
  1233. package/dist/web/assets/erDiagram-TEJ5UH35-CHKzBHrr.js +0 -85
  1234. package/dist/web/assets/export-CXoWon32.js +0 -2
  1235. package/dist/web/assets/flowDiagram-I6XJVG4X-C5rQa2pq.js +0 -162
  1236. package/dist/web/assets/ganttDiagram-6RSMTGT7-BrLjEsNJ.js +0 -292
  1237. package/dist/web/assets/gitGraphDiagram-PVQCEYII-3DRR5VZj.js +0 -106
  1238. package/dist/web/assets/highlighted-body-OFNGDK62-Bdj5SJfv.js +0 -1
  1239. package/dist/web/assets/index-2Vx5mHRn.js +0 -1
  1240. package/dist/web/assets/index-B1UXw2C9.js +0 -1
  1241. package/dist/web/assets/index-BJxtlf4P.js +0 -309
  1242. package/dist/web/assets/index-BY7jPurv.js +0 -1
  1243. package/dist/web/assets/index-Bq79v-Sa.js +0 -1
  1244. package/dist/web/assets/index-BqD3iTIl.js +0 -1
  1245. package/dist/web/assets/index-C62wjCF_.js +0 -1
  1246. package/dist/web/assets/index-CG9e6lgq.js +0 -1
  1247. package/dist/web/assets/index-CS4xJLZV.js +0 -1
  1248. package/dist/web/assets/index-CprdjRRk.js +0 -13
  1249. package/dist/web/assets/index-CypTtrCB.js +0 -1
  1250. package/dist/web/assets/index-DDJQGcUL.js +0 -1
  1251. package/dist/web/assets/index-DLWzxUOO.js +0 -1
  1252. package/dist/web/assets/index-DQxkxZmn.js +0 -7
  1253. package/dist/web/assets/index-De_LkTZx.js +0 -1
  1254. package/dist/web/assets/index-DpcWEDhW.js +0 -1
  1255. package/dist/web/assets/index-Dqq1RDP4.js +0 -1
  1256. package/dist/web/assets/index-H1uMvIoa.css +0 -1
  1257. package/dist/web/assets/index-ICHWJ2SM.js +0 -1
  1258. package/dist/web/assets/index-O5fSd569.js +0 -229
  1259. package/dist/web/assets/index-odjtqLLS.js +0 -1
  1260. package/dist/web/assets/index-v_yAQ0Am.js +0 -1
  1261. package/dist/web/assets/infoDiagram-5YYISTIA-CCwV4Z0v.js +0 -2
  1262. package/dist/web/assets/ishikawaDiagram-YF4QCWOH-BwwZcGyZ.js +0 -70
  1263. package/dist/web/assets/journeyDiagram-JHISSGLW-Dc6WqniQ.js +0 -139
  1264. package/dist/web/assets/kanban-definition-UN3LZRKU-DVUqULOS.js +0 -89
  1265. package/dist/web/assets/linear-d6rWsNOU.js +0 -1
  1266. package/dist/web/assets/memoryAdvisor-DBQXJB1o.js +0 -1
  1267. package/dist/web/assets/mermaid-GHXKKRXX-Ik6SkVDT.js +0 -642
  1268. package/dist/web/assets/mindmap-definition-RKZ34NQL-_JHAkhHL.js +0 -96
  1269. package/dist/web/assets/navViewState-DaCMIYWA.js +0 -1
  1270. package/dist/web/assets/pdf-C-olXVQ4.js +0 -12
  1271. package/dist/web/assets/pieDiagram-4H26LBE5-BlhlygGy.js +0 -30
  1272. package/dist/web/assets/quadrantDiagram-W4KKPZXB-jn6R_C0S.js +0 -7
  1273. package/dist/web/assets/requirementDiagram-4Y6WPE33-B9fXCHBr.js +0 -84
  1274. package/dist/web/assets/sankeyDiagram-5OEKKPKP-fPJwIxkl.js +0 -40
  1275. package/dist/web/assets/sequenceDiagram-3UESZ5HK-1v1DTNGt.js +0 -162
  1276. package/dist/web/assets/spaces-CvL2DRZM.js +0 -1
  1277. package/dist/web/assets/stateDiagram-AJRCARHV-CEc_PLov.js +0 -1
  1278. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-iAMctzaT.js +0 -1
  1279. package/dist/web/assets/theme-LRSmy8mD.js +0 -1
  1280. package/dist/web/assets/timeline-definition-PNZ67QCA-CEjhuitj.js +0 -120
  1281. package/dist/web/assets/vennDiagram-CIIHVFJN-CActt9h9.js +0 -34
  1282. package/dist/web/assets/wardleyDiagram-YWT4CUSO-C_zutiQ2.js +0 -78
  1283. package/dist/web/assets/xychartDiagram-2RQKCTM6-CRafvv33.js +0 -7
@@ -0,0 +1,190 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-CF-6XyfM.js","assets/vendor-react-BqVzR-It.js","assets/index-BLi2nTxe.js","assets/index-C8DDOUJx.css","assets/connection-5XKg4sL2.js","assets/index-C9DdZFNJ.js","assets/client-cAizUM-b.js","assets/controls-C3UrNiBn.js","assets/spaces-wH3o95f_.js","assets/androidBridge-DgaAG2Pi.js","assets/layoutHooks-BzE4xDdh.js","assets/uiZoom-CfR9h3Dy.js","assets/index-ChTpz7dO.js","assets/index-DyZAPivK.js","assets/katex-HP8lGamR.js","assets/mermaid-engine-AE7SfXFQ.js","assets/Middleware-CQ3TZHhI.js","assets/graph--OzhPTMs.js","assets/layout-SsrduOYp.js","assets/json-DQCdPPbD.js","assets/cytoscape.esm-nFXppDBa.js","assets/cytoscape-cose-bilkent-CGdh9URw.js","assets/channel-BwCaPRlV.js","assets/wardley-L42UT6IY-CptWIPkK.js","assets/duration-BNAPaH6N.js","assets/linear-8XOvhBtb.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-5voVPcsN.js","assets/arc-DoGfTGgR.js","assets/ordinal-Cboi1Yqb.js","assets/pie-DJOJsNN1.js","assets/band-dPffDWoQ.js","assets/v4-Dnyct6Ft.js","assets/sankeyLinkHorizontal-FH_jDQz2.js","assets/clone-JiRK1kR-.js","assets/cytoscape-fcose-ZavmgdCc.js","assets/venn.esm-D6tdiC58.js","assets/index-CvYzv8kf.js"])))=>i.map(i=>d[i]);
2
+ import{j_ as Oo,a5 as _t,aZ as cw,r as vb,jQ as dw,jP as fw,f_ as Yd,kx as hw,iW as Ca,ky as pw,iZ as mw,kz as gw,iV as Gd,j9 as kb,kA as Cu,ja as Xd,kB as Tb,jb as bw,kC as xw,E as pl,ke as rp,kD as yw,kd as Ew,gc as vw,jx as kw,q as Ua,s as Tw,f$ as ww,gb as Sw,k as ci,e as _w,g as wb,_ as Qs,v as Sb,x as _b,kE as Cw,kF as Aw,ix as Iw,kG as Cb,jN as Nw,p as Qd,u as di,kH as Rw,Y as Ow,h as Lw}from"./index-BLi2nTxe.js";import{b2 as ip,b3 as Pw,b4 as Mw,I as Je,u as Au,aq as Dw,ak as Fw,b5 as jw,b6 as Bw,A as Hw,O as Uw,n as yi,aB as $w,g as Bn,a as Vt,b7 as zw,b as qw,aG as Cc,f as Ab,aH as Ww,b8 as Aa,b9 as Vw,j as Kw,ba as ml,bb as Yw,bc as gl,D as Ib,d as Zd}from"./connection-5XKg4sL2.js";import{r as b,o as Nb,j as p,d as Kt,N as Gw,L as $a,n as Xw,c as Qw}from"./vendor-react-BqVzR-It.js";import{u as je}from"./index-C9DdZFNJ.js";import{W as Zw,C as fi,v as rr,ap as Rb,l as He,o as et,N as Jd,aq as Lo,w as kt,z as bt,k as yn,ar as Wt,$ as Ob,q as Ht,K as Un,s as Iu,J as Jw,E as xr,as as eS,m as Mn,A as za,Z as sp,x as Jr,a4 as Lb,t as mo,a0 as ef,at as Fi,au as go,av as tS,M as nS,aw as rS,a7 as Ac,ax as _r,ay as tf,az as iS,aA as Pb,aB as sS,aC as nf,aD as Nu,aE as Mb,aF as op,ag as oS,c as aS,r as Db,aa as uS,a8 as Fb,f as lS,h as jb,L as cS,F as dS,e as fS,S as ap}from"./controls-C3UrNiBn.js";import{e as Bb,A as rf,a as Ni,x as hS}from"./client-cAizUM-b.js";import{u as pS,g as mS,M as gS}from"./spaces-wH3o95f_.js";import{h as bS,a as xS}from"./androidBridge-DgaAG2Pi.js";import{u as Hb,a as Ub,f as oa}from"./layoutHooks-BzE4xDdh.js";import{unzoomedPoint as yS}from"./uiZoom-CfR9h3Dy.js";class ES{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(t,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),u=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,u,r,i)}diffWithOptionsObj(t,n,r,i){var s;const o=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},a=n.length,u=t.length;let l=1,c=a+u;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=u&&m+1>=a)return o(this.buildValues(h[0].lastComponent,n,t));let x=-1/0,E=1/0;const y=()=>{for(let v=Math.max(x,-l);v<=Math.min(E,l);v+=2){let k;const S=h[v-1],T=h[v+1];S&&(h[v-1]=void 0);let w=!1;if(T){const A=T.oldPos-v;w=T&&0<=A&&A<a}const I=S&&S.oldPos+1<u;if(!w&&!I){h[v]=void 0;continue}if(!I||w&&S.oldPos<T.oldPos?k=this.addToPath(T,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),m=this.extractCommon(k,n,t,v,r),k.oldPos+1>=u&&m+1>=a)return o(this.buildValues(k.lastComponent,n,t))||!0;h[v]=k,k.oldPos+1>=u&&(E=Math.min(E,v-1)),m+1>=a&&(x=Math.max(x,v+1))}l++};if(i)(function v(){setTimeout(function(){if(l>c||Date.now()>f)return i(void 0);y()||v()},0)})();else for(;l<=c&&Date.now()<=f;){const v=y();if(v)return v}}addToPath(t,n,r,i,s){const o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(t,n,r,i,s){const o=n.length,a=r.length;let u=t.oldPos,l=u-i,c=0;for(;l+1<o&&u+1<a&&this.equals(r[u+1],n[l+1],s);)l++,u++,c++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=u,l}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const o=i.length;let a=0,u=0,l=0;for(;a<o;a++){const c=i[a];if(c.removed)c.value=this.join(r.slice(l,l+c.count)),l+=c.count;else{if(!c.added&&this.useLongestToken){let d=n.slice(u,u+c.count);d=d.map(function(f,h){const m=r[l+h];return m.length>f.length?m:f}),c.value=this.join(d)}else c.value=this.join(n.slice(u,u+c.count));u+=c.count,c.added||(l+=c.count)}}return i}}class vS extends ES{constructor(){super(...arguments),this.tokenize=wS}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
3
+ `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
4
+ `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
5
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
6
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const kS=new vS;function TS(e,t,n){return kS.diff(e,t,n)}function wS(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
7
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const s=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}const bl=3;function $b(e,t,n=1){const r=TS(e,t),i=[];let s=n,o=n;for(const l of r){const c=l.added?"insert":l.removed?"delete":"equal",d=l.value.split(`
8
+ `);d.at(-1)===""&&d.pop();for(const f of d)i.push({text:f,lo:s,ln:o,tag:c}),c!=="insert"&&(s+=1),c!=="delete"&&(o+=1)}const a=[];let u=0;for(;u<i.length;){if(i[u].tag==="equal"){u+=1;continue}const l=Math.max(0,u-bl);let c=u,d=u;for(;c<i.length;){if(i[c].tag!=="equal")d=c;else if(c-d>2*bl)break;c+=1}const f=Math.min(i.length,d+1+bl);let h=l,m=f;for(;h<m&&i[h].tag==="equal"&&i[h].text.trim()==="";)h+=1;for(;m>h&&i[m-1].tag==="equal"&&i[m-1].text.trim()==="";)m-=1;a.push(i.slice(h,m)),u=c}return a}function iq(e){let t=0,n=0;for(const r of e)for(const i of r)i.tag==="insert"?t+=1:i.tag==="delete"&&(n+=1);return{insertions:t,deletions:n}}function zb(e,t){const n=e.toReversed().find(s=>s.tag!=="delete"),r=t.find(s=>s.tag!=="delete");if(n===void 0||r===void 0)return;const i=r.ln-n.ln-1;return i>0?i:void 0}function ji(e,t){return $b(e,t)}function sq(e,t){const n=SS(e);return n!==void 0?n:_S(t)}function SS(e){if(typeof e!="object"||e===null)return;const t=e.kind;if(t==="diff"){const n=e;return typeof n.before=="string"&&typeof n.after=="string"?{path:n.path,hunks:ji(n.before,n.after)}:void 0}if(t==="file_io"){const n=e;if(n.operation==="edit"&&typeof n.before=="string"&&typeof n.after=="string")return{path:n.path,hunks:ji(n.before,n.after)};if(n.operation==="write"&&typeof n.content=="string")return{path:n.path,hunks:ji(typeof n.before=="string"?n.before:"",n.content)}}}function _S(e){if(typeof e!="object"||e===null)return;const t=e,n=t.file_path??t.path;if(Array.isArray(t.edits)){const r=[];for(const i of t.edits)typeof i.old_string=="string"&&typeof i.new_string=="string"&&r.push(...ji(i.old_string,i.new_string));return r.length>0?{path:n,hunks:r}:void 0}if(typeof t.old_string=="string"&&typeof t.new_string=="string")return{path:n,hunks:ji(t.old_string,t.new_string)};if(typeof t.content=="string"&&n!==void 0)return{path:n,hunks:ji("",t.content)}}const Bi="kiki.sessionSeen.v1",Ru="kiki.conversationSeen.v2",CS=`${Ru}.legacySeed.`;function yt(e){return JSON.stringify([e.spaceKey,e.kind,e.id])}const Ia={};let Ri,Ic;const Na=new Set;let up=!1;function AS(e){if(e===null)return Ia;try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return Ia;const n={};for(const[r,i]of Object.entries(t))typeof i!="number"||!Number.isFinite(i)||(n[r]=Math.max(0,Math.trunc(i)));return n}catch{return Ia}}function Po(){try{return AS(_t.getItem(Bi))}catch{return Ia}}function Ou(e,t){const n={...e};let r=!1;for(const[i,s]of Object.entries(t)){const o=Math.max(0,Math.trunc(s));(n[i]??-1)<o&&(n[i]=o,r=!0)}return r?n:e}function Mo(){const e=Oo(Bi);return Ri!==void 0&&Ic===e||(Ic=e,Ri=Po()),Ri}function ei(e,t=!1){Ic=Oo(Bi),Ri=e;try{t?_t.removeItem(Bi):_t.setItem(Bi,JSON.stringify(e))}catch{}for(const n of Na)n()}function oq(){return Mo()}function aq(e){if(Na.add(e),!up){up=!0;try{window.addEventListener("storage",t=>{if(!(t.key!==null&&t.key!==Oo(Bi))){Ri=void 0;for(const n of Na)n()}})}catch{}}return()=>{Na.delete(e)}}function qb(e,t){if(e===""||!Number.isFinite(t))return;const n=Math.max(0,Math.trunc(t)),r=Mo(),i=Ou(r,Po());if((i[e]??-1)>=n){i!==r&&ei(i);return}ei({...i,[e]:n})}function uq(e,t){if(e===""||!Number.isFinite(t))return;const n=Math.max(0,Math.trunc(t)-1),r=Mo(),i=Ou(r,Po());if(i[e]===n){i!==r&&ei(i);return}ei({...i,[e]:n})}function lq(e){const t=Mo(),n=Ou(t,Po()),r={...n};let i=n!==t;for(const{sessionId:s,lastSeq:o}of e){if(s===""||!Number.isFinite(o))continue;const a=Math.max(0,Math.trunc(o));(r[s]??-1)>=a||(r[s]=a,i=!0)}i&&ei(r)}function IS(e){const t=Mo(),n=Ou(t,Po());if(!(e in n)){n!==t&&ei(n);return}const r={...n};delete r[e],ei(r)}const Oi={};let bn,Dn,Er=0;const Nc=new Set;let lp=!1,NS=0;const qr=new Map;function Do(){try{return globalThis.localStorage}catch{return}}function Lu(e){if(!(e===null||typeof e!="object")&&!(typeof e.spaceKey!="string"||e.spaceKey==="")&&!(e.kind!=="session"&&e.kind!=="room")&&!(typeof e.id!="string"||e.id===""))return e}function Pu(e){if(e===null||typeof e!="object"||!Number.isFinite(e.seq))return;const t=Math.max(0,Math.trunc(e.seq));if(!(e.epoch!==void 0&&typeof e.epoch!="string"))return e.epoch===void 0?{seq:t}:{epoch:e.epoch,seq:t}}function Mu(e,t=Date.now()){return e.epoch===void 0?{seq:e.seq,updatedAt:t}:{epoch:e.epoch,seq:e.seq,updatedAt:t}}function RS(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;if(typeof t.seq!="number"||!Number.isFinite(t.seq))return;const n=t.epoch;if(n!==void 0&&typeof n!="string")return;const r=typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?Math.max(0,Math.trunc(t.updatedAt)):0,i=Math.max(0,Math.trunc(t.seq));return n===void 0?{seq:i,updatedAt:r}:{epoch:n,seq:i,updatedAt:r}}function OS(e){if(e===null)return Oi;try{const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return Oi;const n={};for(const[r,i]of Object.entries(t)){const s=RS(i);s!==void 0&&(n[r]=s)}return Object.keys(n).length===0?Oi:n}catch{return Oi}}function Wb(){const e=Do();if(e===void 0)return bn??Oi;try{return OS(e.getItem(Ru))}catch{return bn??Oi}}function Vb(){return bn===void 0&&(bn=Wb(),Er+=1),bn}function Xi(e,t){return e?.epoch===t?.epoch}function Kb(e,t){return e?.epoch===t?.epoch&&e?.seq===t?.seq&&e?.updatedAt===t?.updatedAt}function Zs(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Kb(e[i],t[i]))return!1;return!0}function Fo(e,t){return e===void 0?t:Xi(e,t)?t.seq>e.seq?t:e:t.epoch===void 0&&e.epoch!==void 0?e:t}function jo(e,t,n){return Kb(e[t],n)?e:{...e,[t]:n}}function LS(e,t){const n=t[e.key];return n===void 0||Xi(n,e.record)||e.baselineGeneration>=Er?!0:Xi(n,e.baselineRecord)}function PS(e){if(qr.size===0)return e;const t={...e};for(const n of qr.values()){if(!LS(n,e))continue;const r=Fo(t[n.key],n.record);r!==void 0&&(t[n.key]=r)}return t}function Hi(){for(const e of Nc)e()}function sf(e){const t=Do();if(t===void 0)return!1;try{return t.setItem(Ru,JSON.stringify(e)),!0}catch{return!1}}function of(){return bn=Wb(),Er+=1,Dn=void 0,bn}function MS(e,t,n){n&&sf(t),bn=t,Er+=1,Dn=void 0;const r=rn();Zs(e,r)?Dn=e:Hi()}function af(e){const t=rn(),n=of(),r=e(n);return MS(t,r,r!==n),{next:r,changed:r!==n}}function DS(e){if(!(e.key!==null&&e.key!==Ru)){if(e.storageArea!==void 0&&e.storageArea!==null){const t=Do();if(t!==void 0&&e.storageArea!==t)return}bn=void 0,Dn=void 0,Er+=1,Hi()}}function FS(){lp||typeof window>"u"||typeof window.addEventListener!="function"||(window.addEventListener("storage",DS),lp=!0)}function rn(){return Dn??=PS(Vb()),Dn}function jS(e){return Nc.add(e),FS(),()=>{Nc.delete(e)}}function BS(e,t){const n=Lu(e),r=Pu(t);if(n===void 0||r===void 0)return;const i=yt(n),s=Mu(r);af(o=>{const a=Fo(o[i],s);return a===void 0?o:jo(o,i,a)})}function cq(e){const t=e.flatMap(({ref:n,cursor:r})=>{const i=Lu(n),s=Pu(r);return i===void 0||s===void 0?[]:[{key:yt(i),record:Mu(s)}]});t.length!==0&&af(n=>{let r=n;for(const{key:i,record:s}of t){const o=Fo(r[i],s);o!==void 0&&(r=jo(r,i,o))}return r})}function dq(e,t){const n=Lu(e),r=Pu(t);if(n===void 0||r===void 0)return;const i=yt(n),s=Math.max(0,r.seq-1);af(o=>{const a=o[i],u=r.epoch??a?.epoch,l=u===void 0?{seq:s,updatedAt:Date.now()}:{epoch:u,seq:s,updatedAt:Date.now()};return a!==void 0&&Xi(a,l)&&a.seq<=s?o:jo(o,i,l)})}function Yb(e){return`${CS}${encodeURIComponent(e)}`}function HS(e){const t=Do();if(t===void 0)return!1;try{return t.getItem(Yb(e))!==null}catch{return!1}}function US(e){const t=Do();if(t===void 0)return!1;try{return t.setItem(Yb(e),"1"),!0}catch{return!1}}function $S(e,t){if(t.startsWith("room:")){const n=t.slice(5);return n===""?void 0:{spaceKey:e,kind:"room",id:n}}return t===""?void 0:{spaceKey:e,kind:"session",id:t}}function fq(e,t){if(typeof e!="string"||e===""||HS(e))return;const n=[],r=Date.now();for(const[l,c]of Object.entries(t)){if(typeof c!="number"||!Number.isFinite(c))continue;const d=$S(e,l);d!==void 0&&n.push({key:yt(d),record:Mu({seq:Math.max(0,Math.trunc(c))},r)})}const i=rn(),s=of();let o=s;for(const{key:l,record:c}of n){const d=Fo(o[l],c);d!==void 0&&(o=jo(o,l,d))}const a=o===s?!0:sf(o);bn=o,Er+=1,Dn=void 0;const u=rn();Zs(i,u)||Hi(),a&&US(e)}function zS(e,t){const n=Lu(e),r=Pu(t);if(n===void 0||r===void 0)return{commit:()=>{},cancel:()=>{}};const i=yt(n),s=Vb(),o=++NS,a={id:o,key:i,record:Mu(r),baselineGeneration:Er,baselineRecord:s[i]},u=rn();qr.set(o,a),Dn=void 0;const l=rn();Zs(u,l)||Hi();let c=!1;return{commit:()=>{if(c)return;c=!0;const d=qr.get(o);if(d===void 0)return;const f=rn(),h=of(),m=h[i],E=m===void 0||Xi(m,d.record)||Xi(m,d.baselineRecord)?Fo(m,d.record):m,y=E===void 0||E===m?h:jo(h,i,E);y!==h&&sf(y),qr.delete(o),bn=y,Er+=1,Dn=void 0;const v=rn();Zs(f,v)||Hi()},cancel:()=>{if(c||(c=!0,!qr.has(o)))return;const d=rn();qr.delete(o),Dn=void 0;const f=rn();Zs(d,f)||Hi()}}}const qa="kiki.conversationTriage.v1",qS=720*60*60*1e3,WS=new Set(["approval","question","budget","interrupted","completed","failed","cancelled","running"]),Pn={};function VS(e,t){const n=t??new Date;switch(e){case"30m":return n.getTime()+30*6e4;case"1h":return n.getTime()+60*6e4;case"3h":return n.getTime()+180*6e4;case"tomorrow":{const r=new Date(n.getTime());return r.setDate(r.getDate()+1),r.setHours(9,0,0,0),r.getTime()}}}function uf(e,t){return!Number.isFinite(e.seq)||Math.max(0,Math.trunc(e.seq))!==t.seq?!1:e.epoch!==void 0&&t.epoch!==void 0?e.epoch===t.epoch:!0}function cp(e,t,n){const r=t!==void 0&&uf(e.cursor,t),i=r&&t.s==="snoozed"&&t.u!==void 0&&n<t.u,s=r&&t.s==="snoozed"&&t.u!==void 0&&n>=t.u;return e.needsYou?i?"snoozed":"active":e.busy?r&&t.s==="archived"?"archived":"working":s?"active":e.unread?r&&t.s==="archived"?"archived":i?"snoozed":r&&t.s==="settled"?"settled":"active":i?"snoozed":r&&t.s==="archived"?"archived":"hidden"}function hq(e,t=Date.now()){let n;for(const r of Object.values(e))r.s!=="snoozed"||r.u===void 0||r.u<=t||(n===void 0||r.u<n)&&(n=r.u);return n}let ti;const Rc=new Set;let dp=!1;function lf(){try{return globalThis.localStorage}catch{return}}function cf(e){if(!(e===null||typeof e!="object")&&!(typeof e.spaceKey!="string"||e.spaceKey==="")&&!(e.kind!=="session"&&e.kind!=="room")&&!(typeof e.id!="string"||e.id===""))return e}function KS(e){if(e===null||typeof e!="object"||!Number.isFinite(e.seq))return;const t=Math.max(0,Math.trunc(e.seq));return e.epoch!==void 0?typeof e.epoch!="string"?void 0:e.epoch===""?{seq:t}:{epoch:e.epoch,seq:t}:{seq:t}}function Gb(e){return typeof e=="string"&&WS.has(e)?e:void 0}function YS(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e,n=t.s;if(n!=="settled"&&n!=="snoozed"&&n!=="archived"||typeof t.seq!="number"||!Number.isFinite(t.seq))return;const r=Math.max(0,Math.trunc(t.seq)),i=t.epoch;if(i!==void 0&&typeof i!="string")return;const s=typeof i=="string"&&i!==""?i:void 0,o=Gb(t.reason),a=t.u,u=typeof a=="number"&&Number.isFinite(a)?Math.max(0,Math.trunc(a)):void 0;if(n==="snoozed"&&u===void 0)return;const l=t.t,c=typeof l=="number"&&Number.isFinite(l)?Math.max(0,Math.trunc(l)):0;return{s:n,...s!==void 0?{epoch:s}:{},seq:r,...o!==void 0?{reason:o}:{},...u!==void 0?{u}:{},t:c}}function GS(e){if(e===null)return Pn;try{const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return Pn;const n={};for(const[r,i]of Object.entries(t)){const s=YS(i);s!==void 0&&(n[r]=s)}return Object.keys(n).length===0?Pn:n}catch{return Pn}}function Xb(){const e=lf();if(e===void 0)return ti??Pn;try{return GS(e.getItem(qa))}catch{return ti??Pn}}function Qb(){return ti??=Xb(),ti}function Zb(e,t){return e?.s===t?.s&&e?.epoch===t?.epoch&&e?.seq===t?.seq&&e?.reason===t?.reason&&e?.u===t?.u&&e?.t===t?.t}function XS(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Zb(e[i],t[i]))return!1;return!0}function QS(e,t){const n=Object.entries(e);if(n.length===0)return Pn;const r=n.filter(([,s])=>{const o=t-s.t>qS,a=s.s==="snoozed"&&s.u!==void 0&&t<s.u;return!o||a});if(r.length===n.length)return e;if(r.length===0)return Pn;const i={};for(const[s,o]of r)i[s]=o;return i}function ZS(e){const t=lf();if(t!==void 0)try{Object.keys(e).length===0?t.removeItem(qa):t.setItem(qa,JSON.stringify(e))}catch{}}function Jb(){for(const e of Rc)e()}function df(e){const t=Qb(),n=Xb(),r=e(n);if(r!==n&&ZS(r),ti=r,XS(t,r)){ti=t;return}Jb()}function JS(e){if(!(e.key!==null&&e.key!==qa)){if(e.storageArea!==void 0&&e.storageArea!==null){const t=lf();if(t!==void 0&&e.storageArea!==t)return}ti=void 0,Jb()}}function e_(){if(dp)return;const e=globalThis;typeof e.addEventListener=="function"&&(e.addEventListener("storage",JS),dp=!0)}function pq(){return Qb()}function mq(e){return Rc.add(e),e_(),()=>{Rc.delete(e)}}function ff(e,t,n,r,i,s){const o=cf(e),a=KS(t);if(o===void 0||a===void 0||n==="snoozed"&&(i===void 0||!Number.isFinite(i)))return;const u=yt(o),l=Gb(r),c=Number.isFinite(s)?Math.max(0,Math.trunc(s)):Date.now(),d={s:n,...a.epoch!==void 0?{epoch:a.epoch}:{},seq:a.seq,...l!==void 0?{reason:l}:{},...i!==void 0?{u:Math.max(0,Math.trunc(i))}:{},t:c};df(f=>{const h=Zb(f[u],d)?f:{...f,[u]:d};return QS(h,c)})}function gq(e,t,n,r=Date.now()){ff(e,t,"settled",n,void 0,r)}function bq(e,t,n,r,i=Date.now()){const s=Number.isFinite(i)?Math.max(0,Math.trunc(i)):Date.now(),o=typeof n=="string"?VS(n,new Date(s)):n;ff(e,t,"snoozed",r,o,s)}function xq(e,t,n,r=Date.now()){ff(e,t,"archived",n,void 0,r)}function yq(e){const t=cf(e);if(t===void 0)return;const n=yt(t);df(r=>{if(!(n in r))return r;const i={...r};return delete i[n],Object.keys(i).length===0?Pn:i})}function Eq(e){const t=[];if(e instanceof Map)for(const[r,i]of e)t.push([r,i]);else if(Array.isArray(e))for(const r of e){const i=cf(r.ref);i!==void 0&&t.push([yt(i),r.cursor])}else for(const[r,i]of Object.entries(e))t.push([r,i]);if(t.length===0)return 0;let n=0;return df(r=>{let i;for(const[s,o]of t){const a=r[s];a!==void 0&&(uf(o,a)||(i??={...r},delete i[s],n+=1))}return i===void 0?r:Object.keys(i).length===0?Pn:i}),n}function Cr(e){return`room:${e}`}function t_(e,t){e!==""&&qb(Cr(e),t)}function vq(e){IS(Cr(e))}function e1(e,t,n){return Math.max(0,t-(n[Cr(e)]??0))}const Du="native";function kq(e){const t=e.executor;return t===void 0||t===""?Du:t}function t1(e){return e===void 0||e===""||e===Du}const n1={executor:Du,profile:void 0,profile_file:void 0,overrides:void 0};function r1(e){return e===void 0?n1:{executor:e.executor,profile:e.profile,profile_file:e.profile_file,overrides:e.overrides}}function Tq(e){const t=e.replaceAll("\\","/").replace(/\/+$/,""),n=t.slice(t.lastIndexOf("/")+1);return n===""?e:n}function i1(e){if(typeof e=="object"&&e!==null&&"external_connection_id"in e){const n=e;if(typeof n.external_connection_id=="string")return{executor:typeof n.executor=="string"?n.executor:"external-client",profile:void 0,external_connection_id:n.external_connection_id,external_connection_name:typeof n.external_connection_name=="string"?n.external_connection_name:void 0,overrides:void 0}}const t=cw.safeParse(e);return t.success?r1(t.data):void 0}function wq(e){return i1(e)}function Sq(e){return{executor:e.executor,profile:e.profile,profile_file:e.profile_file,overrides:e.overrides}}function n_(e,t){const n=e?.overrides;return n!==void 0&&Object.hasOwn(n,t)}function r_(e){return e!==void 0&&e.external_connection_id===void 0&&t1(e.executor)&&e.profile!==void 0}function _q(e,t,n){const r=r_(e)&&t!=="permission_mode";return n_(e,t)&&!r?!1:n?!0:e===void 0||t1(e.executor)||e.profile!==void 0}function i_(e,t){return e===void 0||t===void 0?e===t:e.executor===t.executor&&e.profile===t.profile&&e.profile_file===t.profile_file&&e.external_connection_id===t.external_connection_id&&s1(e.overrides,t.overrides)}function fp(e){if(e===void 0||!Object.hasOwn(e,"thinking"))return e;const t={...e};return delete t.thinking,t}function Cq(e,t){return t===void 0||e.executor!==t.executor||e.profile!==t.profile||e.profile_file!==t.profile_file||e.external_connection_id!==t.external_connection_id||i_(e,t)?!1:s1(fp(e.overrides),fp(t.overrides))}function s1(e,t){return e===t?!0:e===void 0||t===void 0||Ei(e)||Ei(t)?Ei(e)&&Ei(t):e.model===t.model&&e.thinking===t.thinking&&e.permission_mode===t.permission_mode&&e.allow_kiki_subagents===t.allow_kiki_subagents&&s_(e.kiki_context,t.kiki_context)&&hp(e.executor_instance,t.executor_instance)&&hp(e.executor_launch,t.executor_launch)}function hp(e,t){return e===t?!0:e===void 0||t===void 0||e===null||t===null?!1:JSON.stringify(e)===JSON.stringify(t)}function Ei(e){return e===void 0||Object.values(e).every(t=>t===void 0)}function s_(e,t){return e===t?!0:e===void 0||t===void 0||e===null||t===null?!1:e.length===t.length&&e.every((n,r)=>n===t[r])}function Aq(e,t){return e!==void 0?r1(e.selection):t!==void 0&&t!==""?{executor:Du,profile:t,profile_file:void 0,overrides:void 0}:n1}const bo="kiki.drafts",Js="kiki.composerStates",Wa="kiki.newSessionDraft",Oc=new Map,pp=new Set,Zn=new Map,o_=400;let cn,mp=!1;function Ar(){return Oo(bo)}function a_(e=Ar()){let t=Oc.get(e);return t===void 0&&(t=new Map,Oc.set(e,t)),t}function u_(){return typeof localStorage<"u"&&Yd().draftPersistence}function ls(){return typeof localStorage<"u"&&vb().draftPersistence}function o1(e=_t){try{const t=e.getItem(bo);if(t===null)return{};const n=JSON.parse(t);return typeof n=="object"&&n!==null?n:{}}catch{return{}}}function l_(){cn!==void 0&&clearTimeout(cn),cn=void 0,Zn.clear()}function c_(e){Zn.delete(e),Zn.size===0&&cn!==void 0&&(clearTimeout(cn),cn=void 0)}function aa(){if(cn!==void 0&&clearTimeout(cn),cn=void 0,Zn.size===0)return;if(!ls()){Zn.clear();return}const e=[...Zn.values()];Zn.clear();for(const t of e){const n=o1(t.storage);for(const[r,i]of t.drafts)i===""?delete n[r]:n[r]=i;try{Object.keys(n).length===0?t.storage.removeItem(bo):t.storage.setItem(bo,JSON.stringify(n))}catch{}}}function d_(){!mp&&typeof window<"u"&&(window.addEventListener("pagehide",aa),window.addEventListener("beforeunload",aa),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&aa()}),mp=!0),cn!==void 0&&clearTimeout(cn),cn=setTimeout(aa,o_)}function a1(e=Ar()){const t=a_(e);if(pp.has(e)||(pp.add(e),!ls()))return t;for(const[n,r]of Object.entries(o1()))typeof r=="string"&&r!==""&&t.set(n,r);return t}function Bo(e){return a1().get(e)??""}function Fu(e,t){const n=Ar(),r=a1(n);if(t===""?r.delete(e):r.set(e,t),!u_()){l_();return}const i=Zn.get(n)??{storage:_t.capture(),drafts:new Map};i.drafts.set(e,t),Zn.set(n,i),d_()}function Iq(){c_(Ar());try{_t.removeItem(bo),_t.removeItem(Js),_t.removeItem(Wa)}catch{}}function xl(e,t){return e!==void 0&&e.model===t.model&&e.thinking===t.thinking}function Nq(e){const t=s=>{const o=e.acceptedBindingChange;return!e.pendingBinding&&o!==void 0&&xl(s,o.previous)&&xl(e.binding,o.next)?e.binding:s},n=t(e.modelChoice),r=t(e.effortChoice),i=s=>!e.conversationStarted||e.pendingBinding||e.modelSwitchMode!==void 0&&e.modelOverride!==void 0&&e.modelChoice!==void 0||xl(s,e.binding);return{modelOverride:i(n)?e.modelOverride:void 0,effortOverride:i(r)?e.effortOverride:void 0,modelChoice:i(n)?n:void 0,effortChoice:i(r)?r:void 0,modelSwitchMode:i(n)&&e.modelOverride!==void 0?e.modelSwitchMode:void 0}}function gp(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e,n=t.model,r=t.thinking;if(!(n!==void 0&&typeof n!="string"||r!==void 0&&typeof r!="string"))return{model:n,thinking:r}}const bp=new Map;function u1(e=Ar()){let t=bp.get(e);return t===void 0&&(t=new Map,bp.set(e,t)),t}function l1(){try{const e=_t.getItem(Js);if(e===null)return{};const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};const n={};for(const[r,i]of Object.entries(t)){if(typeof i!="object"||i===null||Array.isArray(i))continue;const s=i,o=typeof s.modelOverride=="string"?s.modelOverride:void 0,a=typeof s.effortOverride=="string"?s.effortOverride:void 0;if(o!==void 0||a!==void 0){const u=gp(s.modelChoice),l=gp(s.effortChoice),c=s.modelSwitchMode;Object.defineProperty(n,r,{value:{modelOverride:o,effortOverride:a,modelChoice:u,effortChoice:l,modelSwitchMode:o!==void 0&&(c==="direct"||c==="compact"||c==="fresh")?c:void 0},enumerable:!0,configurable:!0,writable:!0})}}return n}catch{return{}}}function xp(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.model===t.model&&e.thinking===t.thinking}function f_(e,t){return e.modelOverride===t.modelOverride&&e.effortOverride===t.effortOverride&&e.modelSwitchMode===t.modelSwitchMode&&xp(e.modelChoice,t.modelChoice)&&xp(e.effortChoice,t.effortChoice)}function h_(e,t){if(!ls())return;const n=t.modelOverride===void 0&&t.effortOverride===void 0;if(n)try{if(_t.getItem(Js)===null)return}catch{return}const r=l1();if(n){if(!(e in r))return;delete r[e]}else r[e]=t;try{Object.keys(r).length===0?_t.removeItem(Js):_t.setItem(Js,JSON.stringify(r))}catch{}}function Rq(){if(!ls())return{};try{const e=_t.getItem(Wa);if(e===null)return{};const t=JSON.parse(e);if(typeof t!="object"||t===null)return{};const n=t;return{workspaceId:typeof n.workspaceId=="string"?n.workspaceId:void 0,cwd:typeof n.cwd=="string"?n.cwd:void 0,profile:typeof n.profile=="string"?n.profile:void 0,execution:i1(n.execution),modelOverride:typeof n.modelOverride=="string"?n.modelOverride:void 0,effortOverride:typeof n.effortOverride=="string"?n.effortOverride:void 0,modelFromProfile:typeof n.modelFromProfile=="boolean"?n.modelFromProfile:void 0,effortFromProfile:typeof n.effortFromProfile=="boolean"?n.effortFromProfile:void 0,prefillSource:typeof n.prefillSource=="string"?n.prefillSource:void 0,dismissedPersonaSource:typeof n.dismissedPersonaSource=="string"?n.dismissedPersonaSource:void 0}}catch{return{}}}function Oq(e){if(ls())try{e.workspaceId!==void 0&&e.workspaceId!==""||e.cwd!==void 0&&e.cwd!==""||e.execution!==void 0||e.profile!==void 0&&e.profile!==""||e.modelOverride!==void 0&&e.modelOverride!==""||e.effortOverride!==void 0&&e.effortOverride!==""?_t.setItem(Wa,JSON.stringify({workspaceId:e.workspaceId,cwd:e.cwd,profile:e.profile,execution:e.execution,modelOverride:e.modelOverride,effortOverride:e.effortOverride,modelFromProfile:e.modelFromProfile,effortFromProfile:e.effortFromProfile,prefillSource:e.prefillSource,dismissedPersonaSource:e.dismissedPersonaSource})):_t.removeItem(Wa)}catch{}}function ju(e){const t=u1().get(e);if(t!==void 0)return t;if(!ls())return{};const n=l1()[e];return typeof n!="object"||n===null?{}:{modelOverride:typeof n.modelOverride=="string"?n.modelOverride:void 0,effortOverride:typeof n.effortOverride=="string"?n.effortOverride:void 0,modelChoice:n.modelChoice,effortChoice:n.effortChoice,modelSwitchMode:n.modelSwitchMode}}function Bu(e,t){const n=u1(),r=n.get(e);n.set(e,t);const i={modelOverride:t.modelOverride,effortOverride:t.effortOverride,modelChoice:t.modelChoice,effortChoice:t.effortChoice,modelSwitchMode:t.modelSwitchMode};r!==void 0&&f_(r,i)||h_(e,i)}const xo=new Map;let yp=0;function Ho(e=Ar()){let t=xo.get(e);return t===void 0&&(t=new Map,xo.set(e,t)),t}const Lc=new Set;function Qi(e){for(const t of Lc)t(e)}function Lq(e){return Lc.add(e),()=>{Lc.delete(e)}}function Pq(e){return Ho().get(e)}function Mq(e,t){const n=Ho().get(e);return n?.inFlightGeneration===void 0?!1:t===void 0||n.scope===t}function Dq(e,t,n){yp+=1;const r=yp,i={...t,inFlightGeneration:r,inFlightPromise:n};return Ho().set(e,i),Qi(e),{submission:i,generation:r}}function Fq(e,t){const n=Ar();let r,i,s;const o=xo.get(n),a=o?.get(e);if(a?.inFlightGeneration===t)r=n,i=o,s=a;else for(const[l,c]of xo){const d=c.get(e);if(d?.inFlightGeneration===t){r=l,i=c,s=d;break}}if(s===void 0||i===void 0||r===void 0)return;const u=r===n?Bo(e):Oc.get(r)?.get(e)??"";s.retryInvalidated===!0||u!==s.draftText?i.delete(e):i.set(e,{scope:s.scope,connectionScopeId:s.connectionScopeId,payload:s.payload,key:s.key,draftText:s.draftText,afterModelSwitch:s.afterModelSwitch,appendTiming:s.appendTiming,skills:s.skills}),Qi(e)}function hf(e){const t=Ho(),n=t.get(e);if(n!==void 0){if(n.inFlightGeneration===void 0){t.delete(e),Qi(e);return}n.retryInvalidated!==!0&&t.set(e,{...n,retryInvalidated:!0})}}function jq(e){const t=[];for(const n of xo.values())for(const[r,i]of n)i.connectionScopeId===e&&(n.delete(r),t.push(r));for(const n of t)Qi(n)}function Bq(e,t,n){const r=Ho(),i=r.get(e);if(i===void 0||i.key!==t)return!1;if(i.retryInvalidated===!0||Bo(e)!==i.draftText)return r.delete(e),Qi(e),!1;r.delete(e),Qi(e),Fu(e,"");const s=ju(e);hw(s.attachments);const o=n!==void 0&&n.size>0?(s.annotations??[]).filter(a=>!n.has(a.id)):s.annotations??[];Bu(e,{...s,attachments:[],quotes:[],annotations:o,permissionMode:s.permissionMode,planMode:s.planMode,planGate:s.planGate,goalObjective:s.goalObjective,modelOverride:s.modelOverride,effortOverride:s.effortOverride});for(const a of ni)a(e,[]);return!0}const p_=50,Ep=new Map;function c1(e=Ar()){let t=Ep.get(e);return t===void 0&&(t=new Map,Ep.set(e,t)),t}function Hq(e,t){const n=t.trim();if(n==="")return;const r=c1(),i=r.get(e)??[];for(i.at(-1)!==n&&i.push(n);i.length>p_;)i.shift();r.set(e,i)}function Uq(e){return c1().get(e)??[]}const m_=/^\/(?:p\/[^/]+\/)?s\/([^/]+)\/agent\/([^/]+)/;function d1(e,t,n){return n===void 0||n===""||n==="main"?t:JSON.stringify([e??"",t,n])}function g_(e,t,n){if(t===void 0||t==="")return;let r;if(n!==void 0&&n!=="")if(n.startsWith("/")){const i=m_.exec(n);if(i!==null)try{const s=decodeURIComponent(i[1]),o=decodeURIComponent(i[2]);s===t&&o!==""&&o!=="main"&&(r=o)}catch{}}else n!=="main"&&(r=n);return d1(e,t,r)}function $q(e,t){hf(e);const n=ju(e),r=n.attachments??[];if(r.length>=dw)return{added:!1,reason:"too_many"};if(t.kind==="image"&&r.filter(o=>o.kind==="image").reduce((o,a)=>o+a.size,0)+t.size>fw)return{added:!1,reason:"total_too_large"};const i=[...r,t];Bu(e,{attachments:i,annotations:n.annotations??[],quotes:n.quotes,quote:n.quote,quoteSource:n.quoteSource,permissionMode:n.permissionMode,planMode:n.planMode,planGate:n.planGate,goalObjective:n.goalObjective,modelOverride:n.modelOverride,effortOverride:n.effortOverride,modelChoice:n.modelChoice,effortChoice:n.effortChoice,modelSwitchMode:n.modelSwitchMode,execution:n.execution});for(const s of ni)s(e,[t]);return{added:!0}}function b_(e,t){if(t==="")return;hf(e);const n=Bo(e),r=n!==""&&!/[\s]$/.test(n)?" ":"";Fu(e,`${n}${r}${t}`);for(const i of ni)i(e)}function zq(e,t,n){const r=ju(e);if(Bo(e)!==""||(r.attachments?.length??0)!==0)return!1;Fu(e,t),Bu(e,{...r,attachments:n,annotations:r.annotations??[],permissionMode:r.permissionMode,planMode:r.planMode,planGate:r.planGate,goalObjective:r.goalObjective,modelOverride:r.modelOverride,effortOverride:r.effortOverride});for(const i of ni)i(e,n);return!0}function qq(e,t){hf(e);const n=t.filter(o=>o.type==="text").map(o=>o.text).join(`
9
+
10
+ `),r=t.flatMap(o=>o.type!=="image"&&o.type!=="video"&&o.type!=="audio"&&o.type!=="file"?[]:[{kind:"retained",name:o.name??(o.type==="file"?o.file_id:o.type),content:o}]),i=Bo(e);Fu(e,i===""?n:n===""?i:`${i}
11
+
12
+ ${n}`);const s=ju(e);Bu(e,{attachments:[...s.attachments??[],...r],annotations:s.annotations??[],quotes:s.quotes,quote:s.quote,quoteSource:s.quoteSource,permissionMode:s.permissionMode,planMode:s.planMode,planGate:s.planGate,goalObjective:s.goalObjective,modelOverride:s.modelOverride,effortOverride:s.effortOverride,modelChoice:s.modelChoice,effortChoice:s.effortChoice,modelSwitchMode:s.modelSwitchMode,execution:s.execution});for(const o of ni)o(e,r)}const ni=new Set;function Wq(e){return ni.add(e),()=>{ni.delete(e)}}function Uo(e){return`/rooms/${encodeURIComponent(e)}`}function Vq(e,t){return e==="room"?Uo(t):`/s/${t}`}function Kq(e){let t=e;if(e.startsWith("kiki://"))try{const o=new URL(e);if(o.username!==""||o.password!==""||o.port!=="")return;t=`/${o.host}${o.pathname}${o.search}${o.hash}`}catch{return}const n=/^\/(s|r|rooms)\/([A-Za-z0-9][A-Za-z0-9_-]{0,127})([?#].*)?$/.exec(t);if(n===null)return;const r=n[1]==="s"?"session":"room",i=n[2],s=r==="room"?Uo(i):`/s/${i}`;return{kind:r,id:i,href:s+(n[3]??"")}}const x_=128,Fr=new Map,y_=16,jr=new Map;function E_(e){return e===32||e===9||e===10||e===13||e===11||e===12}function v_(e){const t=jr.get(e);if(t!==void 0)return jr.delete(e),jr.set(e,t),t;const n=e.length,r=Ui(e),i=new Int32Array(r.length);let s=0;for(let a=0;a<n;a+=1){const u=e.charCodeAt(a);if(u<=32){if(E_(u))continue}else if(u>=128&&/\s/u.test(e[a]))continue;i[s]=a,s+=1}const o={canonical:r,offsets:s===i.length?i:i.subarray(0,s)};if(jr.size>=y_){const a=jr.keys().next().value;a!==void 0&&jr.delete(a)}return jr.set(e,o),o}function Ui(e){return e.replaceAll(/\s/gu,"")}function f1(e){if(typeof e=="string"){const i=Fr.get(e);if(i!==void 0)return Fr.delete(e),Fr.set(e,i),i;let s=2166136261;const o=e.length;for(let l=0;l<o;){const c=e.codePointAt(l);s=Math.imul(s^c,16777619),l+=c>65535?2:1}const a=s<0?s+4294967296:s,u=`${o}-${a.toString(16)}`;if(Fr.size>=x_){const l=Fr.keys().next().value;l!==void 0&&Fr.delete(l)}return Fr.set(e,u),u}const t=e;let n=2166136261;for(const i of t)n=Math.imul(n^(i.codePointAt(0)??0),16777619);const r=n<0?n+4294967296:n;return`${t.length}-${r.toString(16)}`}function Yq(e){if(e.rangeCount!==1||e.isCollapsed)return null;const t=e.getRangeAt(0),r=(t.startContainer.nodeType===1?t.startContainer:t.startContainer.parentElement)?.closest("[data-source-block-id]");if(r==null||!r.contains(t.endContainer))return null;const i=r.dataset.sourceBlockId,s=r.dataset.sourceVersion;if(i===void 0||s===void 0)return null;let o="",a="",u=!1,l=0,c=!1,d=!1;const f=x=>{for(let E=x.firstChild;E!==null;E=E.nextSibling){if(E.nodeType===3){const y=E.textContent??"",v=y.length,k=t.comparePoint(E,0);if(t.comparePoint(E,v)===-1)o+=y;else if(k!==1){const T=E===t.startContainer?t.startOffset:0,w=E===t.endContainer?t.endOffset:v;o+=y.slice(0,T);const I=y.slice(T,w);Ui(I)!==""&&(c&&(d=!0),u=!0),a+=I}continue}if(E.nodeType===1){const y=E;if(y.matches('button, [data-source-ignore], .kiki-cb-tools, [data-streamdown="code-block-header"]'))continue;f(y);const v=y.getAttribute("data-source-omitted-canonical-chars");if(v!==null){const k=Number(v);if(Number.isSafeInteger(k)&&k>0){const S=t.comparePoint(y,y.childNodes.length);S===-1||S===0&&!u?l+=k:S===0&&(c=!0)}}}}};if(f(r),d)return null;const h=Ui(o).length+l,m=Ui(a);return m===""?null:{blockId:i,version:s,start:h,end:h+m.length,text:m}}function k_(e){return e===void 0?"":`<!-- kiki-source:${encodeURIComponent(JSON.stringify(e))} -->
13
+
14
+ `}function T_(e){if(!e.startsWith("<!-- kiki-source:")||!e.endsWith(" -->"))return null;try{const t=JSON.parse(decodeURIComponent(e.slice(17,-4)));if(t!==null&&typeof t.blockId=="string"&&typeof t.version=="string"&&Number.isSafeInteger(t.start)&&Number.isSafeInteger(t.end)&&t.start>=0&&t.end>t.start&&typeof t.text=="string"&&t.text.length===t.end-t.start)return t}catch{}return null}function w_(e,t){if(t.start<0||t.end<=t.start)return null;const n=v_(e);if(t.end>n.canonical.length||!n.canonical.startsWith(t.text,t.start))return null;const r=n.offsets[t.start],i=n.offsets[t.end-1];return r===void 0||i===void 0?null:{start:r,end:i+1}}let yl=0;function S_(e,t,n){return yl+=1,n===void 0?{id:`annotation-${yl}`,quote:e,comment:t}:{id:`annotation-${yl}`,quote:e,comment:t,source:n}}function Gq(e,t,n,r){return[...e,S_(t,n,r)]}function Xq(e,t){return e.filter(n=>n.id!==t)}function h1(e,t){return`${e.replaceAll(`\r
15
+ `,`
16
+ `).replaceAll("\r",`
17
+ `).split(`
18
+ `).map(i=>{const s=i.trimEnd();return s===""?">":`> ${s}`}).join(`
19
+ `)}
20
+
21
+ ${k_(t)}`}function __(e){const t=e.comment.replaceAll(`\r
22
+ `,`
23
+ `).replaceAll("\r",`
24
+ `).trim(),n=h1(e.quote,e.source);return t===""?n:`${n}Comment: ${t}
25
+
26
+ `}function Qq(e,t){if(t.isCollapsed||t.rangeCount===0)return null;const{anchorNode:n,focusNode:r}=t;if(n===null||r===null||!e.contains(n)||!e.contains(r))return null;const i=t.toString().trim();return i===""?null:i}function Zq(e){if(e.rangeCount===0)return null;const t=e.getRangeAt(0);if(typeof t.getBoundingClientRect!="function")return null;const n=t.getBoundingClientRect();return n.width===0&&n.height===0?null:n}function Jq(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches||"ontouchstart"in window}function eW(e,t,n){let r="";const i=[];for(const o of e){const a=r.length;r+=__(o);const u=o.comment.trim();i.push({start:a,end:r.length,kind:"selection",quote:o.quote,comment:u===""?void 0:o.comment,source:o.source})}const s=Array.isArray(t)?t:t!==null?[{quote:t,source:n}]:[];for(const o of s){const a=r.length;r+=h1(o.quote,o.source),i.push({start:a,end:r.length,kind:"selection",quote:o.quote,source:o.source})}return{prefix:r,presentation:{spans:i}}}function C_(e,t,n="",r=0){const i=`${n}
27
+ ${r}
28
+ ${e}
29
+ ${t}`;let s=5381;for(const a of i)s=Math.imul(s,33)^(a.codePointAt(0)??0);return`ta-${(s<0?s+4294967296:s).toString(16)}`}function A_(e){let t=0;const n=[],r=[],i=[];for(;t<e.length&&e.slice(t).startsWith(">");){let s=t;const o=[];for(;s<e.length;){const f=e.indexOf(`
30
+ `,s),h=f===-1?e.length:f,m=e.slice(s,h).replace(/\r$/,"");if(m===">")o.push(""),s=f===-1?e.length:f+1;else if(m.startsWith("> "))o.push(m.slice(2)),s=f===-1?e.length:f+1;else break}if(o.length===0)break;if(e.startsWith(`\r
31
+ `,s))s+=2;else if(e.startsWith(`
32
+ `,s))s+=1;else break;const a=e.indexOf(`
33
+ `,s),u=a===-1?e.length:a,l=e.slice(s,u).replace(/\r$/,""),c=T_(l);if(c===null&&l!=="<!-- kiki-source:null -->")break;if(s=a===-1?e.length:a+1,e.startsWith(`\r
34
+ `,s))s+=2;else if(e.startsWith(`
35
+ `,s))s+=1;else break;const d=o.join(`
36
+ `);if(e.slice(s).startsWith("Comment: ")){s+=9;const f=/\r?\n\r?\n/.exec(e.slice(s));let h;f!==null?(h=e.slice(s,s+f.index).trim(),s=s+f.index+f[0].length):(h=e.slice(s).trim(),s=e.length);const m={quote:d,comment:h,source:c};n.push(m),i.push(m),t=s}else{const f={quote:d,source:c};r.push(f),i.push({...f,comment:""}),t=s}}return n.length===0&&r.length===0?null:{annotations:n,quotes:r,selections:i,body:e.slice(t)}}function I_(e,t){const n=t?.spans.filter(i=>i.kind==="selection"&&i.quote!==void 0)??[];if(n.length>0){const i=n.flatMap(u=>u.comment===void 0?[]:[{quote:u.quote,comment:u.comment,source:u.source}]),s=n.filter(u=>u.comment===void 0),o=s.map(u=>({quote:u.quote,source:u.source})),a=s[0];return{annotations:i,quotes:o,selections:n.map(u=>({quote:u.quote,comment:u.comment??"",source:u.source})),quote:a?.quote??null,quoteSource:a?.source,body:Ca(e,t)}}const r=A_(Ca(e,t));if(r!==null){const i=r.quotes[0];return{annotations:r.annotations,quotes:r.quotes,selections:r.selections,quote:i?.quote??null,quoteSource:i?.source,body:r.body}}return{annotations:[],quotes:[],selections:[],quote:null,quoteSource:null,body:Ca(e,t)}}function tW(e){if(e.body.trim()!=="")return e.body;const t=e.annotations.map(r=>r.comment.trim()).filter(r=>r!=="");return t.length>0?t.join(" · "):(e.selections.length>0?e.selections.map(r=>r.quote.trim()).filter(r=>r!==""):e.quotes.map(r=>r.quote.trim()).filter(r=>r!=="")).join(" · ")}function Pc(e,t){const n=e.indexOf(t);if(n!==-1)return{start:n,end:n+t.length};const r=/[\p{L}\p{N}]/u,i=d=>{const f=[];for(const h of d)r.test(h)&&f.push(h);return f},s=i(t);if(s.length===0)return null;const o=i(e),a=[],u=[];let l=0,c=0;for(const d of e)r.test(d)&&(a.push(l),u.push(d.length),c+=1),l+=d.length;if(c!==o.length||s.length>o.length)return null;e:for(let d=0;d+s.length<=o.length;d+=1){for(let x=0;x<s.length;x+=1)if(o[d+x]!==s[x])continue e;const f=a[d],h=a[d+s.length-1],m=u[d+s.length-1];return f===void 0||h===void 0||m===void 0?null:{start:f,end:h+m}}return null}const p1=new Set(["user","assistant"]),vp=new WeakMap;function N_(e){const t=vp.get(e);if(t!==void 0&&t.length===e.length)return t;const n=new Map,r=[];for(let s=0;s<e.length;s+=1){const o=e[s];o===void 0||!p1.has(o.kind)||o.text===void 0||(n.has(o.id)||n.set(o.id,o),r.push(o))}const i={length:e.length,byId:n,anchorable:r};return vp.set(e,i),i}function m1(){const e=new Map;return t=>{const n=e.get(t);if(n!==void 0)return n;const r=f1(t);return e.set(t,r),r}}function g1(e,t,n,r,i){if(r.trim()===""||i===null)return;if(i!==void 0){const o=e.get(i.blockId);return o===void 0||o.text===void 0?void 0:n(o.text)===i.version?o:void 0}let s;for(let o=0;o<t.length;o+=1){const a=t[o];if(Pc(a.text,r)!==null){if(s!==void 0)return;s=a}}return s}function nW(e){const t=m1(),n=new Map,r=new Map,i=[];for(let s=0;s<e.length;s+=1){const o=e[s];if(o!==void 0){if(o.kind==="user"&&o.text!==void 0&&(o.presentation!==void 0||typeof o.text=="string"&&o.text.startsWith(">"))){const a=I_(o.text,o.presentation);if(a.annotations.length+a.quotes.length>0){const l=[...a.annotations,...a.quotes.map(c=>({quote:c.quote,comment:null,source:c.source}))];for(const[c,d]of l.entries()){const f=g1(r,i,t,d.quote,d.source);if(f===void 0)continue;const h={id:C_(d.quote,d.comment??"",o.id,c),quote:d.quote,comment:d.comment},m=d.source===void 0?h:{...h,source:d.source};let x=n.get(f.id);x===void 0&&(x=[],n.set(f.id,x)),x.push(m)}}}p1.has(o.kind)&&o.text!==void 0&&(r.has(o.id)||r.set(o.id,o),i.push(o))}}return n}function rW(e,t){const n=new Map;if(t.length===0)return n;const r=m1(),{byId:i,anchorable:s}=N_(e);for(const o of t){const a=g1(i,s,r,o.quote,o.source);if(a===void 0)continue;let u=n.get(a.id);u===void 0&&(u=[],n.set(a.id,u)),u.push(o)}return n}const Va="kiki.annotationOverrides",b1=Object.freeze({}),kp=new Map,Tp=new Set,x1=new Map,y1=new Set,$s=new Map,Ka=new Set,Mc=new Set;let wp=!1,Sp=!1,Dc=!1;const $i=new Map;function E1(){wp||(wp=!0,pw(()=>{for(const e of y1)e();for(const e of Mc)e();for(const e of Ka)e(null)}))}function $o(){return Oo(Va)}function R_(e=$o()){let t=kp.get(e);return t===void 0&&(t=new Map,kp.set(e,t)),t}function v1(){return vb().draftPersistence}function O_(){return typeof localStorage<"u"&&Yd().draftPersistence}function L_(){try{const e=_t.getItem(Va);if(e===null)return{};const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};const n={};for(const[r,i]of Object.entries(t)){if(typeof i!="object"||i===null||Array.isArray(i))continue;const s=i,o={comment:typeof s.comment=="string"?s.comment:void 0,deleted:s.deleted===!0?!0:void 0};(o.comment!==void 0||o.deleted!==void 0)&&Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0})}return n}catch{return{}}}function P_(e,t){const n=Object.fromEntries(t);try{t.size===0?e.removeItem(Va):e.setItem(Va,JSON.stringify(n))}catch{}}function ua(){if(Dc=!1,$i.size===0)return;const e=[...$i.values()];if($i.clear(),!!v1())for(const t of e)P_(t.storage,t.scoped)}function M_(e,t){if(!O_()){$i.delete(e);return}const n=globalThis;!Sp&&typeof n.addEventListener=="function"&&(n.addEventListener("pagehide",ua),n.addEventListener("beforeunload",ua),n.document?.addEventListener?.("visibilitychange",()=>{n.document?.visibilityState==="hidden"&&ua()}),Sp=!0);const r=$i.get(e);$i.set(e,{storage:r?.storage??_t.capture(),scoped:t}),Dc||(Dc=!0,queueMicrotask(ua))}function Fc(e,t){x1.set(e,t.size===0?b1:Object.freeze(Object.fromEntries(t)))}function pf(e=$o()){const t=R_(e);if(Tp.has(e))return t;if(Tp.add(e),!v1())return Fc(e,t),t;for(const[n,r]of Object.entries(L_()))t.set(n,r);return Fc(e,t),t}function iW(){const e=$o();return pf(e),x1.get(e)??b1}function sW(e){const t=$o();return pf(t).get(e)}function oW(e,t){const n=$o(),r=pf(n),i=r.get(e),s=t===null||t.comment===void 0&&t.deleted===void 0?void 0:t;if(i?.comment===s?.comment&&i?.deleted===s?.deleted)return;s===void 0?r.delete(e):r.set(e,s),Fc(n,r),M_(n,r);for(const a of y1)a();const o=$s.get(e);if(o!==void 0)for(const a of o)a();for(const a of Ka)a(e)}function aW(e,t){E1(),Mc.add(t);for(const n of e){let r=$s.get(n);r===void 0&&(r=new Set,$s.set(n,r)),r.add(t)}return()=>{Mc.delete(t);for(const n of e){const r=$s.get(n);r!==void 0&&(r.delete(t),r.size===0&&$s.delete(n))}}}function uW(e){return Ka.add(e),E1(),()=>{Ka.delete(e)}}function D_(e){if(typeof window>"u"||typeof window.open!="function")throw new Error(e);const t=window.open("about:blank","_blank");if(t===null)throw new Error(e);try{t.opener=null;const n=t.document.createElement("meta");n.name="referrer",n.content="no-referrer",t.document.head.append(n)}catch(n){throw t.close(),n}return{navigate:n=>{if(t.closed)throw new Error(e);const r=t.document.createElement("a");r.href=n,r.target="_self",r.rel="noreferrer",r.referrerPolicy="no-referrer",t.document.body.append(r),r.click(),r.remove()},close:()=>t.close()}}function mf(e,t,n){if(e.openUrl!==void 0)return e.openUrl(t);let r;try{return r=D_(n),r.navigate(t),Promise.resolve()}catch(i){return r?.close(),Promise.reject(i)}}var F_=class extends mw{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:ip()})}getOptimisticResult(e){return e.behavior=ip(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:o,isRefetchError:a}=r,u=n.fetchMeta?.fetchMore?.direction,l=o&&u==="forward",c=i&&u==="forward",d=o&&u==="backward",f=i&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Mw(t,n.data),hasPreviousPage:Pw(t,n.data),isFetchNextPageError:l,isFetchingNextPage:c,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:a&&!l&&!d,isRefetching:s&&!c&&!f}}};function lW(e,t){return gw(e,F_,t)}const j_=10,B_=5,H_=8,U_=3;function $_(e,t,n){return`/settings/${e}${n===void 0?"":`?tab=${n}`}#${t}`}function gf(e,t){return e.title.trim()!==""?e.title:e.last_prompt!==void 0&&e.last_prompt.trim()!==""?e.last_prompt:t}function z_(e){return e.toSorted((t,n)=>n.updated_at.localeCompare(t.updated_at))}function _p(e,t){return{kind:"session",sessionId:e.id,title:gf(e,t),cwd:e.metadata.cwd,updatedAt:e.updated_at}}function q_(e,t,n){return gf(e,n).toLowerCase().includes(t)||e.metadata.cwd.toLowerCase().includes(t)}function cW(e){const t=z_(e.sessions),n=e.query.trim().toLowerCase(),r=(e.actions??[]).filter(a=>n===""||a.title.toLowerCase().includes(n)||(a.keywords?.some(u=>u.toLowerCase().includes(n))??!1)).map(a=>({kind:"action",...a}));if(n==="")return[...r,...t.slice(0,j_).map(a=>_p(a,e.untitled))];const i=(e.localMatches??t.filter(a=>q_(a,n,e.untitled))).slice(0,B_).map(a=>_p(a,e.untitled)),s=e.hits.slice(0,H_).map(a=>({kind:"hit",sessionId:a.session_id,sessionTitle:a.session_title,snippet:a.snippet,role:a.role,time:a.time,turn:a.turn,stepId:a.step_id,agentId:a.agent_id})),o=(e.settings??[]).slice(0,U_);return[...r,...i,...s,...o]}function zo(e){return e.pending_interaction==="approval"||e.pending_interaction==="question"?e.pending_interaction:"none"}function W_(e){for(const t of e)if(t.type==="text"&&t.text.trim()!=="")return t.text.trim()}function Cp(e,t,n,r,i){const s=t?.active!==null&&t?.active!==void 0?W_(t.active.content):void 0,o=e.last_prompt?.trim(),a=(n??[]).filter(u=>u.status==="running"&&u.kind!=="subagent").map(u=>({id:u.id,kind:u.kind,description:u.description,command:u.command,startedAt:u.started_at??u.created_at})).toSorted((u,l)=>(u.startedAt??"").localeCompare(l.startedAt??""));return{sessionId:e.id,title:gf(e,r),mainTurnActive:e.main_turn_active===!0,pendingInteraction:zo(e),turnStartedAt:t?.active?.created_at,promptPreview:s??(o!==void 0&&o!==""?o:void 0),queuedCount:i!==void 0?i:t?.queued.length??0,runningTaskCount:a.length,runningTasks:a,updatedAt:e.updated_at}}function dW(e){const t=(i,s)=>s.updatedAt.localeCompare(i.updatedAt),n=e.sessions.filter(i=>Gd(i)===!0).map(i=>Cp(i,e.prompts[i.id],e.tasks[i.id],e.untitled,e.liveQueuedCounts?.[i.id])).toSorted(t),r=e.sessions.filter(i=>!i.busy&&zo(i)!=="none").map(i=>Cp(i,void 0,void 0,e.untitled)).toSorted(t);return{running:n,waiting:r,queuedTotal:n.reduce((i,s)=>i+s.queuedCount,0),runningTaskTotal:n.reduce((i,s)=>i+s.runningTaskCount,0)}}function fW(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,s=`${r}:${String(i).padStart(2,"0")}`;return n>0?`${n}:${String(r).padStart(2,"0")}:${String(i).padStart(2,"0")}`:s}function V_(e){return e.attention_cursor!==void 0?{epoch:e.attention_cursor.epoch,seq:Math.max(0,Math.trunc(e.attention_cursor.seq))}:{seq:Math.max(0,Math.trunc(e.last_seq))}}function K_(e){return e.attention_cursor!==void 0}function Ap(e,t,n){return!Number.isFinite(e.seq)||e.seq<=0?!1:t===void 0||e.epoch!==void 0&&t.epoch!==void 0&&e.epoch!==t.epoch?!0:t.seq<Math.trunc(e.seq)}function k1(e,t){const n=e.attention_cursor?.seq??e.last_seq;if(n<=0)return!1;const r=t[e.id];return r===void 0||r<n}function T1(e){switch(e.last_turn_reason){case"failed":return"failed";case"cancelled":return"cancelled";case"completed":return"completed";default:return"completed"}}function w1(e){const t=e.agent_config?.persona;if(t?.id){const r=typeof t.name=="string"&&t.name.trim()!==""?t.name.trim():void 0;return{personaId:t.id,personaName:r}}const n=e.metadata;if(n===void 0)return{};for(const r of["bot_persona_id","room_persona_id","persona_id"]){const i=n[r];if(typeof i=="string"&&i.trim()!=="")return{personaId:i.trim()}}return{}}function S1(e){if(e.cleanup_pending===!0)return!1;const t=Gd(e);return t!==void 0?t:e.busy===!0}function pr(e){const t=Date.parse(e);return Number.isFinite(t)?t:0}function El(e,t){return pr(e.at)-pr(t.at)}function Y_(e,t){const n=[],r=[],i=[];for(const s of e){if(s.archived===!0||s.private===!0)continue;const{personaId:o,personaName:a}=w1(s),u=s.agent_config?.model,l=typeof u=="string"&&u.trim()!==""?u.trim():void 0,c=s.usage?.turn_count,d=typeof c=="number"&&c>0?c:void 0,f=s.last_prompt!==void 0&&s.last_prompt.trim()!==""?s.last_prompt.replace(/\s+/gu," ").trim():void 0,h={sessionId:s.id,roomId:s.roomId,title:s.title,workspaceId:s.workspace_id,at:s.updated_at,busy:s.busy,lastSeq:s.last_seq,preview:f,personaId:o,personaName:a,model:l,turnCount:d},m=zo(s);if(m!=="none"){n.push({...h,reason:m});continue}if(s.needsYouReason!==void 0){n.push({...h,reason:s.needsYouReason});continue}if(!s.busy&&s.interrupted_work!==void 0){n.push({...h,reason:"interrupted",interruptedWork:s.interrupted_work});continue}if(S1(s)){i.push({...h,reason:"running"});continue}if(s.busy||!k1(s,t))continue;const x=T1(s);x!==void 0&&r.push({...h,reason:x})}return n.sort(El),r.sort((s,o)=>El(o,s)),i.sort((s,o)=>El(o,s)),{needsYou:n,unread:r,running:i,total:n.length+r.length}}function hW(e,t={}){const{workspaceId:n,filter:r="all"}=t,i=l=>n===void 0?l:l.filter(c=>c.workspaceId===n),s=i(e.needsYou),o=i(e.unread),a=i(e.running),u=r==="needs-you"?s:r==="unread"?o:r==="running"?a:[...s,...o,...a];return{needsYou:s,unread:o,running:a,total:s.length+o.length,visibleItems:u}}function pW(e,t,n){if(e.length===0)return;if(t===void 0)return n>0?e[0]?.sessionId:e[e.length-1]?.sessionId;const r=e.findIndex(s=>s.sessionId===t);if(r===-1)return n>0?e[0]?.sessionId:e[e.length-1]?.sessionId;const i=Math.max(0,Math.min(e.length-1,r+n));return e[i]?.sessionId}function mW(e,t){const n=e.findIndex(r=>r.sessionId===t);return n===-1?e[0]?.sessionId:e[n+1]?.sessionId??e[n-1]?.sessionId}function gW(e,t){return zo(e)!=="none"?"needs-me":e.cleanup_pending===!0?"cleanup-pending":Gd(e)===!0?"running":k1(e,t)?"unread":"read"}const bW={active:[],working:[],snoozed:[],archived:[],needsYouCount:0,unreadCount:0,total:0};function Ip(e){return e.needsYou?0:e.reason==="failed"||e.reason==="cancelled"?1:2}function G_(e,t){const n=Ip(e),r=Ip(t);return n!==r?n-r:n===0?pr(e.at)-pr(t.at)||e.encodedKey.localeCompare(t.encodedKey):pr(t.at)-pr(e.at)||e.encodedKey.localeCompare(t.encodedKey)}function jc(e,t){return pr(t.at)-pr(e.at)||e.encodedKey.localeCompare(t.encodedKey)}function X_(e,t){const n=e.snoozedUntil??Number.POSITIVE_INFINITY,r=t.snoozedUntil??Number.POSITIVE_INFINITY;return n!==r?n-r:jc(e,t)}function Q_(e){if(!(e===void 0||e.trim()===""))return e.replace(/\s+/gu," ").trim()}function Np(e,t,n){if(!(t===void 0||t.s!=="snoozed"||t.u===void 0)&&!(n>=t.u))return uf(e,t)?t.u:void 0}function xW(e,t,n,r=Date.now(),i={}){const s=[],o=[],a=[],u=[],l=new Set,c=i.pinnedViewingKey,d=i.activeConversationKey,f=x=>{if(d!==void 0&&x.encodedKey===d&&x.triageClass!=="archived"){s.push(x);return}switch(x.triageClass){case"active":s.push(x);break;case"working":o.push(x);break;case"snoozed":a.push(x);break;case"archived":u.push(x);break;case"hidden":c!==void 0&&x.encodedKey===c&&s.push(x);break}};for(const x of e){if(x.kind==="session"){const{session:U}=x;if(U.archived===!0||U.private===!0)continue;const F={spaceKey:x.spaceKey,kind:"session",id:U.id},R=yt(F);if(l.has(R))continue;l.add(R);const j=V_(U);K_(U);const B=zo(U),q=B!=="none"?B:U.needsYouReason??(!U.busy&&U.interrupted_work!==void 0?"interrupted":void 0),$=q!==void 0,X=!$&&S1(U),C=!U.busy&&Ap(j,t[R]),se=q??(X?"running":T1(U)??"completed"),xe=n[R],L=cp({needsYou:$,busy:X,unread:C,cursor:j},xe,r),G=Np(j,xe,r),{personaId:re,personaName:ne}=w1(U),pe=U.agent_config?.model,Ae=typeof pe=="string"&&pe.trim()!==""?pe.trim():void 0,ee=U.usage?.turn_count,he=typeof ee=="number"&&ee>0?ee:void 0;f({ref:F,encodedKey:R,spaceKey:x.spaceKey,spaceName:x.spaceName,isRemote:x.isRemote,workspaceId:U.workspace_id,workspaceName:x.workspaceName,sessionId:U.id,roomId:U.roomId,title:U.title,reason:se,at:U.updated_at,busy:U.busy,attentionCursor:j,lastSeq:U.last_seq,snoozedUntil:G,triageClass:L,unread:C,needsYou:$,preview:Q_(U.last_prompt),personaId:re,personaName:ne,model:Ae,turnCount:he,interruptedWork:U.busy?void 0:U.interrupted_work});continue}const{room:E}=x;if(E.archived===!0)continue;const y={spaceKey:x.spaceKey,kind:"room",id:E.id},v=yt(y);if(l.has(v))continue;l.add(v);const k={seq:Math.max(0,Math.trunc(E.lastSeq))},S=E.pendingInteraction!=="none"?E.pendingInteraction:E.needsYou?"budget":void 0,T=S!==void 0,w=!T&&E.busy,I=!E.busy&&Ap(k,t[v]),A=S??(w?"running":E.failed?"failed":"completed"),O=n[v],_=cp({needsYou:T,busy:w,unread:I,cursor:k},O,r),D=Np(k,O,r);f({ref:y,encodedKey:v,spaceKey:x.spaceKey,spaceName:x.spaceName,isRemote:x.isRemote,workspaceId:x.workspaceId??E.workspace,workspaceName:x.workspaceName,sessionId:Cr(E.id),roomId:E.id,title:E.title,reason:A,at:E.updatedAt,busy:E.busy,attentionCursor:k,lastSeq:E.lastSeq,snoozedUntil:D,triageClass:_,unread:I,needsYou:T})}s.sort(G_),o.sort(jc),a.sort(X_),u.sort(jc);let h=0,m=0;for(const x of s)x.triageClass==="active"&&(x.needsYou?h+=1:m+=1);return{active:s,working:o,snoozed:a,archived:u,needsYouCount:h,unreadCount:m,total:h+m}}function cs(e,t){const n=t.find(i=>i.id===e);if(n!==void 0)return n.id;const r=Rp(e);return t.find(i=>i.root!==void 0&&Rp(i.root)===r)?.id??e}function Rp(e){const n=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/.test(e)?e.replaceAll("\\","/").toLowerCase():e;return n.length>1?n.replace(/\/+$/,""):n}function yW(e,t,n,r="updated-desc",i=[]){const s=e.map(a=>({...a,updated_at:a.own_updated_at??a.updated_at,kind:"session",session:a,key:`session:${a.id}`,href:`/s/${a.id}`,unread_count:Math.max(0,(a.attention_cursor?.seq??a.last_seq)-(n[a.id]??0)),needs_you:a.pending_interaction==="approval"||a.pending_interaction==="question",failed:a.last_turn_reason==="failed",pinned:kb(a)})),o=t.map(a=>({kind:"room",room:a,id:a.id,key:Cr(a.id),href:Uo(a.id),title:a.title,workspace_id:cs(a.workspace,i),created_at:a.createdAt,updated_at:a.updatedAt,metadata:{cwd:"",[Cu]:a.pinned},archived:a.archived,busy:a.busy,pending_interaction:a.pendingInteraction,last_seq:a.lastSeq,unread_count:e1(a.id,a.lastSeq,n),needs_you:a.needsYou,failed:a.failed,pinned:a.pinned,member_count:a.memberCount}));return Xd([...s,...o],r)}function EW(e,t){const n=e.map(s=>s.kind==="room"?{...s,workspace_id:cs(s.room.workspace,t.workspaces)}:{...s,updated_at:s.session.own_updated_at??s.session.updated_at}),r=Tb(n,{...t.filters,status:[]}).filter(s=>t.filters.status.length===0||t.filters.status.includes(s.needs_you?"needs-me":s.busy?"running":"idle")),i=Xd(r,t.order??"updated-desc");return t.groupBy==="time"?bw(i,t.nowMs,t.labels):t.groupBy==="workspace"?xw(i,t.workspaces,void 0,t.ungroupedLabel,t.labels?.pinned):i.length===0?[]:[{key:"all",label:"",items:i}]}function vW(e,t,n,r=[]){const i=t.map(s=>({id:Cr(s.id),roomId:s.id,title:s.title,workspace_id:cs(s.workspace,r),updated_at:s.updatedAt,last_seq:s.lastSeq,archived:s.archived,busy:s.busy,pending_interaction:s.pendingInteraction,needsYouReason:s.needsYou&&s.pendingInteraction==="none"?"budget":void 0,last_turn_reason:s.failed?"failed":"completed"}));return Y_([...e,...i],n)}function kW(e){const t=[];for(const n of e){const r=n.workspaces??[],i=new Map;for(const s of r)i.set(s.id,s.name);for(const s of n.sessions)t.push({kind:"session",spaceKey:n.spaceKey,spaceName:n.spaceName,isRemote:n.isRemote,workspaceName:i.get(s.workspace_id),session:s});for(const s of n.rooms??[]){const o=cs(s.workspace,r);t.push({kind:"room",spaceKey:n.spaceKey,spaceName:n.spaceName,isRemote:n.isRemote,workspaceId:o,workspaceName:i.get(o),room:s})}}return t}function TW(e,t,n="updated-desc",r="main",i={}){const s=[],o=new Set;for(const a of e){const u=a.workspaces??[],l=a.isRemote&&a.spaceKey.startsWith("remote:")?a.spaceKey.slice(7):void 0,c=l!==void 0?`/p/${encodeURIComponent(l)}`:"",d=!a.isRemote&&a.spaceKey===r;for(const f of a.sessions){const h=a.isRemote?`${a.spaceKey}:session:${f.id}`:`session:${f.id}`;if(o.has(h))continue;o.add(h);const m=yt({spaceKey:a.spaceKey,kind:"session",id:f.id}),x=t[m]?.seq??(d?i[f.id]??0:0);s.push({...f,updated_at:f.own_updated_at??f.updated_at,kind:"session",session:f,key:h,href:`${c}/s/${encodeURIComponent(f.id)}`,unread_count:Math.max(0,(f.attention_cursor?.seq??f.last_seq)-x),needs_you:f.pending_interaction==="approval"||f.pending_interaction==="question",failed:f.last_turn_reason==="failed",pinned:kb(f),spaceKey:a.spaceKey,spaceName:a.spaceName,isRemote:a.isRemote})}for(const f of a.rooms??[]){const h=Cr(f.id),m=a.isRemote?`${a.spaceKey}:${h}`:h;if(o.has(m))continue;o.add(m);const x=yt({spaceKey:a.spaceKey,kind:"room",id:f.id}),E=t[x]?.seq??(d?i[h]??0:0);s.push({kind:"room",room:f,id:f.id,key:m,href:`${c}${Uo(f.id)}`,title:f.title,workspace_id:cs(f.workspace,u),created_at:f.createdAt,updated_at:f.updatedAt,metadata:{cwd:"",[Cu]:f.pinned},archived:f.archived,busy:f.busy,pending_interaction:f.pendingInteraction,last_seq:f.lastSeq,unread_count:Math.max(0,f.lastSeq-E),needs_you:f.needsYou,failed:f.failed,pinned:f.pinned,member_count:f.memberCount,spaceKey:a.spaceKey,spaceName:a.spaceName,isRemote:a.isRemote})}}return Xd(s,n)}function dt(e){return`${e.kind==="group"?"g":"s"}:${e.id}`}function Z_(e){return e?.capabilities?.sidebar_groups===!0}function gn(e){return e.kind==="session"?[e.row]:e.members}function J_(e){return e.kind==="session"?e.row.pinned===!0:e.has_pinned===!0||e.members.some(t=>t.pinned===!0)}function _1(e,t){return t===void 0?e:e===void 0||t.epoch!==e.epoch||t.seq>=e.seq?t:e}function C1(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.epoch===t.epoch&&e.seq===t.seq}function Bc(e,t){if(t===void 0)return e;const n=_1(t.attention_cursor,e.attention_cursor),i=e.attention_cursor?.epoch!==void 0&&t.attention_cursor?.epoch!==void 0&&e.attention_cursor.epoch===t.attention_cursor.epoch?Math.max(e.last_seq,t.last_seq):e.last_seq;return i===e.last_seq&&C1(n,e.attention_cursor)?e:{...e,last_seq:i,...n!==void 0?{attention_cursor:n}:{}}}function A1(e,t){if(e.kind==="session"){const i=Bc(e.row,t.get(e.row.id));return i===e.row?e:{...e,row:i}}let n=!1;const r=e.members.map(i=>{const s=Bc(i,t.get(i.id));return s!==i&&(n=!0),s});return n?{...e,members:r}:e}function I1(e){const t=new Map;if(e===void 0)return t;for(const n of e.pages)for(const r of n.units)for(const i of gn(r))t.has(i.id)||t.set(i.id,i);return t}function Op(e){return(e.kind==="group"?e.title:e.row.title).trim().toLowerCase()}function Lp(e){if(e.kind==="session"){const n=Date.parse(e.row.created_at);return Number.isFinite(n)?n:0}let t=0;for(const n of e.members){const r=Date.parse(n.created_at);Number.isFinite(r)&&r>t&&(t=r)}return t}function Ra(e,t,n="updated_desc"){if(n==="title"){const s=Op(e),o=Op(t);return s!==o?s<o?-1:1:e.sort_at!==t.sort_at?t.sort_at-e.sort_at:dt(t).localeCompare(dt(e))}if(n==="created_desc"){const s=Lp(e),o=Lp(t);return s!==o?o-s:e.sort_at!==t.sort_at?t.sort_at-e.sort_at:dt(t).localeCompare(dt(e))}if(e.sort_at!==t.sort_at)return t.sort_at-e.sort_at;const r=dt(e),i=dt(t);return r===i?0:i<r?-1:1}function Pp(e,t){if(e.id!==t.sessionId)return e;const n=_1(e.attention_cursor,t.attention_cursor),r=t.pending_interaction==="none"?void 0:t.pending_interaction,i=t.main_turn_active?!0:void 0;return e.busy===t.busy&&e.executing===t.executing&&e.cleanup_pending===t.cleanup_pending&&e.main_turn_active===i&&e.pending_interaction===r&&e.last_turn_reason===t.last_turn_reason&&C1(e.attention_cursor,n)?e:{...e,busy:t.busy,...t.executing!==void 0?{executing:t.executing}:{},...t.cleanup_pending!==void 0?{cleanup_pending:t.cleanup_pending}:{},...i!==void 0?{main_turn_active:i}:{main_turn_active:void 0},...r!==void 0?{pending_interaction:r}:{pending_interaction:void 0},...t.last_turn_reason!==void 0?{last_turn_reason:t.last_turn_reason}:{},...n!==void 0?{attention_cursor:n}:{}}}function wW(e,t){if(e==null||!Array.isArray(e.pages))return e;let n=!1;const r=e.pages.map(i=>{let s=!1;const o=i.units.map(a=>{if(a.kind==="session"){const c=Pp(a.row,t);return c===a.row?a:(s=!0,{...a,row:c})}let u=!1;const l=a.members.map(c=>{const d=Pp(c,t);return d!==c&&(u=!0),d});return u?(s=!0,{...a,members:l}):a});return s?(n=!0,{...i,units:o}):i});return n?{...e,pages:r}:e}function fr(e){if(e==null||!Array.isArray(e.pages))return[];const t=new Set;for(const i of e.pages)for(const s of i.units)if(s.kind==="group")for(const o of s.members)t.add(o.id);const n=new Set,r=[];for(const i of e.pages)for(const s of i.units){const o=dt(s);n.has(o)||s.kind==="session"&&t.has(s.row.id)||(n.add(o),r.push(s))}return r}function SW(e,t){const n=fr(e),r=new Set(n.map(dt)),i=new Set;for(const o of n)for(const a of gn(o))i.add(a.id);const s=fr(t).filter(o=>!(!J_(o)||r.has(dt(o))||o.kind==="session"&&i.has(o.row.id)));return s.length===0?n:[...n,...s]}function un(e,t,n,r,i=!1){const s=e[n]??-1;if(r>s&&(e[n]=r),i){const o=t[n]??-1;r>o&&(t[n]=r)}else(t[n]??-1)<=r&&delete t[n]}function Fn(e,t,n,r){const i=e[n];if(i!==void 0&&r<i)return!0;const s=t[n];return s!==void 0&&r<s}function e2(e,t,n={}){if(e==null||!Array.isArray(e.pages)||e.pages.length===0)return e;const r=e.pages[0]?.generation;if(t.generation!==void 0&&r!==void 0&&t.generation<r)return e;const i=n.sort??"updated_desc",s=n.insertMissingAtHead??!0,o=t.revision,a=I1(e),u={...e.unitRevisions??{}},l={...e.tombstones??{}},c=[],d=new Set,f=new Set;for(const S of t.units){const T=dt(S);if(Fn(u,l,T,o))continue;const w=A1(S,a);c.push(w),d.add(T),un(u,l,T,o,!1);for(const I of gn(w))f.add(I.id),un(u,l,`s:${I.id}`,o,!1)}const h=new Set,m=new Set;for(const S of t.missing_session_ids){const T=`s:${S}`;Fn(u,l,T,o)||(h.add(T),m.add(S),un(u,l,T,o,!0))}for(const S of t.missing_group_ids){const T=`g:${S}`;Fn(u,l,T,o)||(h.add(T),un(u,l,T,o,!0))}if(c.length===0&&h.size===0)return e;const x=new Set,E=new Set;for(const S of e.pages)for(const T of S.units){x.add(dt(T));for(const w of gn(T))E.add(w.id)}const y=e.pages.map(S=>{let T=!1;const w=[];for(const I of S.units){const A=dt(I);if(d.has(A)||h.has(A)){T=!0;continue}if(I.kind==="session"){if(f.has(I.row.id)||m.has(I.row.id)){T=!0;continue}w.push(I);continue}let O=!1;const _=I.members.filter(D=>f.has(D.id)||m.has(D.id)?(O=!0,!1):!0);if(!O){w.push(I);continue}if(T=!0,_.length>0){const D=Math.max(_.length,I.member_count-(I.members.length-_.length));w.push({...I,member_count:D,members:_})}}return T?{...S,units:w}:S}),v=[...c].sort((S,T)=>Ra(S,T,i)),k=[...y];for(const S of v){const T=x.has(dt(S))||gn(S).some(_=>E.has(_.id));let w=-1;for(let _=0;_<k.length;_+=1){const U=k[_].units.at(-1);if(U===void 0){if(_===0){w=0;break}continue}if(Ra(S,U,i)<=0){w=_;break}}if(w===-1)if(!k.at(-1).has_more||T)w=k.length-1;else if(s)w=0;else continue;const I=k[w],A=[...I.units];let O=A.findIndex(_=>Ra(S,_,i)<0);O===-1&&(O=A.length),A.splice(O,0,S),k[w]={...I,units:A}}return{...e,pages:k,unitRevisions:u,tombstones:l}}function t2(e,t,n="updated_desc"){if(e==null||!Array.isArray(e.pages)||e.pages.length===0)return{pages:[t],pageParams:[void 0],unitRevisions:Object.fromEntries(t.units.map(E=>[dt(E),t.revision])),tombstones:{}};const r=e.pages[0]?.generation;if(t.generation!==void 0&&r!==void 0&&t.generation!==r)return t.generation<r?e:{pages:[t],pageParams:[void 0],unitRevisions:Object.fromEntries(t.units.map(E=>[dt(E),t.revision])),tombstones:{}};const i=I1(e),s=new Map;for(const E of e.pages[0].units)s.set(dt(E),E);const o={...e.unitRevisions??{}},a={...e.tombstones??{}},u=[],l=new Set,c=new Set;let d=!1;for(const E of t.units){const y=dt(E),v=Fn(o,a,y,t.revision),k=gn(E).some(T=>Fn(o,a,`s:${T.id}`,t.revision));if(v||k){const T=s.get(y);if(T!==void 0&&!l.has(y)){u.push(T),l.add(y);for(const w of gn(T))c.add(w.id);d=!0}continue}const S=A1(E,i);u.push(S),l.add(y),un(o,a,y,t.revision,!1);for(const T of gn(S))c.add(T.id),un(o,a,`s:${T.id}`,t.revision,!1)}for(const E of e.pages[0].units){const y=dt(E);if(l.has(y))continue;const v=o[y]??-1,k=a[y]??-1;if(v>t.revision&&k<v){u.push(E),l.add(y);for(const S of gn(E))c.add(S.id);d=!0}}d&&u.sort((E,y)=>Ra(E,y,n));const f=t.revision<e.pages[0].revision,h=Math.max(t.revision,e.pages[0].revision),m={...t,revision:h,has_more:f?e.pages[0].has_more:t.has_more,next_cursor:f?e.pages[0].next_cursor:t.next_cursor,units:u};if(e.pages.length===1)return{...e,pages:[m],unitRevisions:o,tombstones:a};const x=e.pages.slice(1).map(E=>{let y=!1;const v=E.units.filter(k=>{const S=dt(k);return l.has(S)||k.kind==="session"&&c.has(k.row.id)?(y=!0,!1):!0});return y?{...E,units:v}:E});return{...e,pages:[m,...x],unitRevisions:o,tombstones:a}}function n2(e,t,n){if(e==null||!Array.isArray(e.pages)||e.pages.length===0)return{pages:[t],pageParams:[n],unitRevisions:Object.fromEntries(t.units.map(d=>[dt(d),t.revision])),tombstones:{}};const r=e.pages[0]?.generation;if(t.generation!==void 0&&r!==void 0&&t.generation!==r)return e;const i=new Set,s=new Set;for(const d of e.pages)for(const f of d.units){i.add(dt(f));for(const h of gn(f))s.add(h.id)}const o={...e.unitRevisions??{}},a={...e.tombstones??{}},u=[];let l=!1;for(const d of t.units){const f=dt(d);if(i.has(f)||Fn(o,a,f,t.revision)){l=!0;continue}if(d.kind==="session"){if(s.has(d.row.id)||Fn(o,a,`s:${d.row.id}`,t.revision)){l=!0;continue}un(o,a,f,t.revision,!1),un(o,a,`s:${d.row.id}`,t.revision,!1),u.push(d);continue}const h=d.members.filter(m=>!s.has(m.id)&&!Fn(o,a,`s:${m.id}`,t.revision));if(h.length===0){l=!0;continue}un(o,a,f,t.revision,!1);for(const m of h)un(o,a,`s:${m.id}`,t.revision,!1);h.length===d.members.length?u.push(d):(l=!0,u.push({...d,members:h,member_count:Math.max(h.length,d.member_count-(d.members.length-h.length))}))}const c=l?{...t,units:u}:t;return{pages:[...e.pages,c],pageParams:[...e.pageParams,n],unitRevisions:o,tombstones:a}}function r2(e,t){if(e==null||!Array.isArray(e.pages))return e;const n=e.pages[0]?.generation;if(t.generation!==void 0&&n!==void 0&&t.generation!==n)return e;const r=e.unitRevisions??{},i=e.tombstones??{},s=`g:${t.group_id}`;if(Fn(r,i,s,t.revision))return e;let o=!1;const a={...r},u={...i},l=e.pages.map(c=>{let d=!1;const f=c.units.map(h=>{if(h.kind!=="group"||h.id!==t.group_id)return h;const m=new Map;for(const y of h.members)m.set(y.id,y);for(const y of t.members){if(Fn(r,i,`s:${y.id}`,t.revision))continue;const v=m.get(y.id);m.set(y.id,Bc(y,v)),un(a,u,`s:${y.id}`,t.revision,!1)}un(a,u,s,t.revision,!1);const x=[...m.values()],E={...h,has_pinned:h.has_pinned||x.some(y=>y.pinned===!0),member_count:Math.max(t.member_count,x.length),members:x,...t.has_more&&t.next_cursor!==void 0?{members_next_cursor:t.next_cursor}:{members_next_cursor:void 0}};return d=!0,E});return d?(o=!0,{...c,units:f}):c});return o?{...e,pages:l,unitRevisions:a,tombstones:u}:e}const vl=1440*60*1e3;function i2(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function Hc(e){const t={cwd:e.cwd??""};return e.pinned===!0&&(t[Cu]=!0),e.bot_persona_id!==void 0&&(t.bot_persona_id=e.bot_persona_id),e.room_persona_id!==void 0&&(t.room_persona_id=e.room_persona_id),e.room_member_of!==void 0&&(t.room_member_of=e.room_member_of),e.persona_id!==void 0&&(t.persona_id=e.persona_id),e.created_by_session_id!==void 0&&(t.created_by_session_id=e.created_by_session_id),e.group_id!==void 0&&(t["kiki.group_id"]=e.group_id),e.group_detached===!0&&(t["kiki.group_detached"]=!0),e.child_session_kind!==void 0&&(t.child_session_kind=e.child_session_kind),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.created_by_agent_id!==void 0&&(t.created_by_agent_id=e.created_by_agent_id),e.external_client!==void 0&&(t.externalClient=e.external_client),{id:e.id,workspace_id:e.workspace_id,title:e.title,created_at:e.created_at,updated_at:e.updated_at,own_updated_at:e.own_updated_at,busy:e.busy,...e.executing!==void 0?{executing:e.executing}:{},...e.cleanup_pending!==void 0?{cleanup_pending:e.cleanup_pending}:{},...e.main_turn_active!==void 0?{main_turn_active:e.main_turn_active}:{},...e.pending_interaction!==void 0?{pending_interaction:e.pending_interaction}:{},...e.last_turn_reason!==void 0?{last_turn_reason:e.last_turn_reason}:{},...e.execution_phase!==void 0?{execution_phase:e.execution_phase}:{},...e.delivery!==void 0?{delivery:e.delivery}:{},...e.executor_id!==void 0?{executor_id:e.executor_id}:{},...e.archived!==void 0?{archived:e.archived}:{},...e.archived_at!==void 0?{archived_at:e.archived_at}:{},...e.private!==void 0?{private:e.private}:{},...e.worktree!==void 0?{worktree:e.worktree}:{},...e.forked_from!==void 0?{forked_from:e.forked_from}:{},...e.promoted_from!==void 0?{promoted_from:e.promoted_from}:{},metadata:t,agent_config:{model:"",...e.persona!==void 0?{persona:e.persona}:e.persona_id!==void 0?{persona:{id:e.persona_id,name:e.persona_id}}:{}},usage:yw(),permission_rules:[],message_count:0,last_seq:e.last_seq,...e.attention_cursor!==void 0?{attention_cursor:e.attention_cursor}:{}}}function _W(e){return e==="created-desc"?"created_desc":e==="title"?"title":"updated_desc"}function N1(e){if(e==null)return!1;if(typeof e=="object"){const t=e;if(t.code===pl.PAGE_TOKEN_MISMATCH||t.code==="PAGE_TOKEN_MISMATCH"||t.data?.code===pl.PAGE_TOKEN_MISMATCH||t.cause!==void 0&&t.cause!==e&&N1(t.cause))return!0}return e instanceof Error?e.message.includes("PAGE_TOKEN_MISMATCH")||e.message.includes(String(pl.PAGE_TOKEN_MISMATCH)):!1}function eo(e){const t=new Set,n=[];for(const r of e)for(const i of gn(r))t.has(i.id)||(t.add(i.id),n.push(Hc(i)));return n}function CW(e,t,n){if(e==null||!Array.isArray(e.pages))return e;let r=!1;const i=e.pages.map(s=>{if(!Array.isArray(s?.units))return s;let o=!1;const a=s.units.map(u=>{if(u.kind==="session"){if(u.row.id!==t)return u;const x=n(u.row);return x===u.row?u:(o=!0,{...u,row:x})}let l=!1;const c=u.members.map(x=>{if(x.id!==t)return x;const E=n(x);return E!==x&&(l=!0),E});if(!l)return u;o=!0;const d=u.opener_id!==void 0?c.find(x=>x.id===u.opener_id):c[0],f=d!==void 0&&d.title.trim()!==""?d.title:u.title,h=c.some(x=>x.pinned===!0),m=u.members_next_cursor!==void 0?h||u.has_pinned:h;return{...u,title:f,has_pinned:m,members:c}});return o?(r=!0,{...s,units:a}):s});return r?{...e,pages:i}:e}function s2(e,t){return e.home_id===t.home_id&&e.host_id===t.host_id}function o2(e,t){if(e.source.spaceKey===t.source.spaceKey||e.source.serverHomeId!==void 0&&t.origins.some(n=>n.home_id===e.source.serverHomeId)||t.source.serverHomeId!==void 0&&e.origins.some(n=>n.home_id===t.source.serverHomeId))return!0;for(const n of e.origins)for(const r of t.origins)if(s2(n,r))return!0;return!1}function Oa(e){if(e===void 0)return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function Mp(e,t,n,r,i,s){const o=n.isRemote&&n.spaceKey.startsWith("remote:")?n.spaceKey.slice(7):void 0,a=o!==void 0?`/p/${encodeURIComponent(o)}`:"",u=!n.isRemote&&n.spaceKey===i,l=n.isRemote?`${n.spaceKey}:session:${e.id}`:`session:${e.id}`,c=yt({spaceKey:n.spaceKey,kind:"session",id:e.id}),d=r[c]?.seq??(u?s[e.id]??0:0);return{...t,updated_at:e.own_updated_at??e.updated_at,kind:"session",session:t,key:l,href:`${a}/s/${encodeURIComponent(e.id)}`,unread_count:Math.max(0,(e.attention_cursor?.seq??e.last_seq)-d),needs_you:e.pending_interaction==="approval"||e.pending_interaction==="question",failed:e.last_turn_reason==="failed",pinned:e.pinned===!0,spaceKey:n.spaceKey,spaceName:n.spaceName,isRemote:n.isRemote,...e.group_id!==void 0?{groupId:e.group_id}:{},...e.group_origin!==void 0?{groupOrigin:e.group_origin}:{}}}function Dp(e,t,n,r,i){const s=e.archived===!0;if(n.archived==="hide"&&s||n.archived==="only"&&!s)return!1;const o=e.private===!0,a=n.private??"hide";return!(a==="hide"&&o||a==="only"&&!o||r.size>0&&!r.has(e.workspace_id)||i.size>0&&!i.has(Ew(t)))}function hn(e){return e.kind==="session-group"?e.sortAt:Oa(e.updated_at)}function Fp(e){return e.kind==="session-group"?e.createdAt:e.created_at}function jp(e){return e.title.trim()}function a2(e){return e.kind==="session-group"?e.workspaceId:e.workspace_id}function u2(e,t,n){if(e.pinned!==t.pinned)return e.pinned?-1:1;if(e.pinned&&t.pinned){const i=hn(t)-hn(e);return i!==0?i:e.key.localeCompare(t.key)}if(n==="title"){const i=jp(e),s=jp(t);if(i!==s)return i.localeCompare(s,void 0,{sensitivity:"base",numeric:!0});const o=hn(t)-hn(e);return o!==0?o:e.key.localeCompare(t.key)}if(n==="created-desc"){const i=Fp(t).localeCompare(Fp(e));if(i!==0)return i;const s=hn(t)-hn(e);return s!==0?s:e.key.localeCompare(t.key)}if(n==="updated-asc"){const i=hn(e)-hn(t);return i!==0?i:e.key.localeCompare(t.key)}const r=hn(t)-hn(e);return r!==0?r:e.key.localeCompare(t.key)}function l2(e){const t=new Set;for(const n of e)for(const r of n.units)r.kind==="group"?t.add(r.id):r.row.group_id!==void 0&&t.add(r.row.group_id);return[...t]}function AW(e,t){const n=t.seenV2??{},r=t.fallbackLocalSpaceKey??"main",i=t.fallbackLocalSeen??{},s=t.order??"updated-desc",o=new Set(t.filters.workspaces),a=new Set(t.filters.status),u=e.some(F=>F.partialCoverage===!0),l=o.size>0||a.size>0,c=new Map,d=[],f=new Set;for(const F of e)for(const R of F.units){if(R.kind==="session"){const $=Hc(R.row);if(t.shouldHideRow?.(R.row,$,F.spaceKey,F.isRemote)===!0||!Dp(R.row,$,t.filters,o,a))continue;const X=Mp(R.row,$,F,n,r,i);if(f.has(X.key))continue;f.add(X.key),d.push(X);continue}const j=[];for(const $ of R.members)$.group_origin!==void 0&&j.push($.group_origin);const B=c.get(R.id),q={source:F,unit:R,origins:j};B===void 0?c.set(R.id,[q]):B.push(q)}const h=[];for(const[F,R]of c){const j=[];for(const B of R){let q;for(const $ of j)if($.some(X=>o2(X,B))){q=$;break}q===void 0?j.push([B]):q.push(B)}for(const B of j){const q=[],$=new Set;let X=0,C=0,se=0,xe=!1,L=0,G,re,ne="",pe=B[0].source.spaceKey,Ae,ee=B.length>1,he=!1;for(const K of B){se+=K.unit.member_count,K.unit.has_pinned&&(xe=!0),K.unit.sort_at>L&&(L=K.unit.sort_at),G===void 0&&K.unit.opener_id!==void 0&&(G=K.unit.opener_id),re===void 0&&K.unit.primary_workspace_id!==void 0&&(re=K.unit.primary_workspace_id),ne===""&&K.unit.title.trim()!==""&&(ne=K.unit.title),Ae===void 0&&K.unit.members_next_cursor!==void 0&&(Ae=K.unit.members_next_cursor,pe=K.source.spaceKey),K.source.isRemote||(pe=K.source.spaceKey),K.origins.length>0&&(he=!0);for(const be of K.unit.members){X+=1;const J=Hc(be);if(t.shouldHideRow?.(be,J,K.source.spaceKey,K.source.isRemote)===!0){C+=1;continue}if(!Dp(be,J,t.filters,o,a)){C+=1;continue}const H=Mp(be,J,K.source,n,r,i);$.has(H.key)||($.add(H.key),q.push(H))}}if(q.length===0)continue;q.sort((K,be)=>{const J=Oa(be.updated_at)-Oa(K.updated_at);return J!==0?J:K.key.localeCompare(be.key)});const Ie=C===0?Math.max(se,q.length):Math.max(q.length,se-C);if(q.length===1&&Ae===void 0&&Ie<=1){const K=q[0];f.has(K.key)||(f.add(K.key),d.push(K));continue}const Me=G!==void 0?q.find(K=>K.id===G):void 0,Be=Me??q[0],fe=Me!==void 0?Me.title.trim()!==""?Me.title:ne||Be.title:C===0&&ne!==""?ne:Be.title,Le=Me!==void 0?Me.workspace_id:re!==void 0&&q.some(K=>K.workspace_id===re)?re:q[0].workspace_id;let Re=0,De=q[0].created_at;for(const K of q){const be=Oa(K.updated_at);be>Re&&(Re=be),K.created_at.localeCompare(De)>0&&(De=K.created_at)}const ke=C===0&&(Ae!==void 0||X<se)?Math.max(L,Re):Re>0?Re:L,Ce=q.some(K=>K.pinned)||xe&&!l&&(Ae!==void 0||se>X),Fe=B.some(K=>!K.source.isRemote)?`group:${F}`:`${B[0].source.spaceKey}:group:${F}`;h.push({kind:"session-group",key:Fe,groupId:F,title:fe,sortAt:ke,updatedAt:new Date(ke).toISOString(),createdAt:De,workspaceId:Le,pinned:Ce,memberCount:Ie,members:q,...Ae!==void 0?{membersNextCursor:Ae}:{},spaceKey:pe,...Me!==void 0?{openerId:Me.id}:{},...u&&(ee||he)?{partialCoverage:!0}:{}})}}const m=[],x=new Set;for(const F of e){const R=F.workspaces??t.workspaces,j=F.isRemote&&F.spaceKey.startsWith("remote:")?F.spaceKey.slice(7):void 0,B=j!==void 0?`/p/${encodeURIComponent(j)}`:"",q=!F.isRemote&&F.spaceKey===r;for(const $ of F.rooms??[]){const X=Cr($.id),C=F.isRemote?`${F.spaceKey}:${X}`:X;if(x.has(C))continue;x.add(C);const se=yt({spaceKey:F.spaceKey,kind:"room",id:$.id}),xe=n[se]?.seq??(q?i[X]??0:0);m.push({kind:"room",room:$,id:$.id,key:C,href:`${B}${Uo($.id)}`,title:$.title,workspace_id:cs($.workspace,R),created_at:$.createdAt,updated_at:$.updatedAt,metadata:{cwd:"",[Cu]:$.pinned},archived:$.archived,busy:$.busy,pending_interaction:$.pendingInteraction,last_seq:$.lastSeq,unread_count:e1($.id,$.lastSeq,{[X]:xe}),needs_you:$.needsYou,failed:$.failed,pinned:$.pinned,member_count:$.memberCount,spaceKey:F.spaceKey,spaceName:F.spaceName,isRemote:F.isRemote})}}const E=Tb(m,{...t.filters,status:[]}).filter(F=>t.filters.status.length===0||t.filters.status.includes(F.needs_you?"needs-me":F.busy?"running":"idle")),y=new Set;for(const F of h)if(F.kind==="session-group")for(const R of F.members)y.add(R.key);const v=[...h,...d.filter(F=>!y.has(F.key)),...E];v.sort((F,R)=>u2(F,R,s));const k=F=>F.reduce((R,j)=>R+(j.kind==="session-group"?j.memberCount:1),0);if(t.groupBy==="none")return v.length===0?[]:[{key:"all",label:"",items:v,total:k(v)}];if(t.groupBy==="time"){const F=t.labels??{},j=["pinned","today","yesterday","week","month","older"].map(ne=>({key:ne,label:F[ne]??ne,items:[]})),[B,q,$,X,C,se]=j,xe=i2(t.nowMs),L=xe-vl,G=xe-6*vl,re=xe-29*vl;for(const ne of v){if(ne.pinned){B.items.push(ne);continue}const pe=hn(ne);pe<=0?se.items.push(ne):pe>=xe?q.items.push(ne):pe>=L?$.items.push(ne):pe>=G?X.items.push(ne):pe>=re?C.items.push(ne):se.items.push(ne)}return j.filter(ne=>ne.items.length>0).map(ne=>({...ne,total:k(ne.items)}))}const S=t.labels?.pinned,T=t.ungroupedLabel??"ungrouped",w=[],I=new Map(t.workspaces.map((F,R)=>[F.id,R])),A=new Map(t.workspaces.map(F=>[F.id,F.name])),O=new Map,_=(F,R)=>{let j=O.get(F);return j===void 0&&(j={key:F,label:R,items:[]},O.set(F,j)),j};for(const F of v){if(S!==void 0&&F.pinned){w.push(F);continue}const R=a2(F);I.has(R)?_(R,A.get(R)??R).items.push(F):_(rp,T).items.push(F)}const D=[];S!==void 0&&w.length>0&&D.push({key:"pinned",label:S,items:w,total:k(w)});for(const F of t.workspaces){const R=O.get(F.id);R!==void 0&&D.push({...R,total:k(R.items)})}const U=O.get(rp);return U!==void 0&&D.push({...U,total:k(U.items)}),D}function tt(e){return e?.ownerDocument||document}function Hu(e){b.useEffect(e,Zw)}const R1=b.createContext(void 0);function Uu(){const e=b.useContext(R1);if(!e)throw new Error(fi(73));return e}var kl={exports:{}},Tl={};/**
37
+ * @license React
38
+ * use-sync-external-store-shim.production.js
39
+ *
40
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */var Bp;function c2(){if(Bp)return Tl;Bp=1;var e=Nb();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(d,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),x=m[0].inst,E=m[1];return s(function(){x.value=h,x.getSnapshot=f,u(x)&&E({inst:x})},[d,h,f]),i(function(){return u(x)&&E({inst:x}),d(function(){u(x)&&E({inst:x})})},[d]),o(h),h}function u(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Tl.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Tl}var Hp;function O1(){return Hp||(Hp=1,kl.exports=c2()),kl.exports}var L1=O1(),wl={exports:{}},Sl={};/**
45
+ * @license React
46
+ * use-sync-external-store-shim/with-selector.production.js
47
+ *
48
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
49
+ *
50
+ * This source code is licensed under the MIT license found in the
51
+ * LICENSE file in the root directory of this source tree.
52
+ */var Up;function d2(){if(Up)return Sl;Up=1;var e=Nb(),t=O1();function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Sl.useSyncExternalStoreWithSelector=function(l,c,d,f,h){var m=s(null);if(m.current===null){var x={hasValue:!1,value:null};m.current=x}else x=m.current;m=a(function(){function y(w){if(!v){if(v=!0,k=w,w=f(w),h!==void 0&&x.hasValue){var I=x.value;if(h(I,w))return S=I}return S=w}if(I=S,r(k,w))return I;var A=f(w);return h!==void 0&&h(I,A)?(k=w,I):(k=w,S=A)}var v=!1,k,S,T=d===void 0?null:d;return[function(){return y(c())},T===null?void 0:function(){return y(T())}]},[c,d,f,h]);var E=i(l,m[0],m[1]);return o(function(){x.hasValue=!0,x.value=E},[E]),u(E),E},Sl}var $p;function f2(){return $p||($p=1,wl.exports=d2()),wl.exports}var h2=f2();const Uc=[];let $c;function p2(){return $c}function m2(e){Uc.push(e)}function bf(e){const t=(n,r)=>{const i=rr(g2).current;let s;try{$c=i;for(const o of Uc)o.before(i);s=e(n,r);for(const o of Uc)o.after(i);i.didInitialize=!0}finally{$c=void 0}return s};return t.displayName=e.displayName||e.name,t}function IW(e){return b.forwardRef(bf(e))}function g2(){return{didInitialize:!1}}const b2=Rb(19),x2=b2?E2:v2;function P1(e,t,n,r,i){return x2(e,t,n,r,i)}function y2(e,t,n,r,i){const s=b.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return L1.useSyncExternalStore(e.subscribe,s,s)}m2({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),L1.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function E2(e,t,n,r,i){const s=p2();if(!s)return y2(e,t,n,r,i);const o=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[o],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,i))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=i,a.value=t(e.getSnapshot(),n,r,i))):(a={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},s.syncHooks.push(a)),a.value}function v2(e,t,n,r,i){return h2.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,i))}class k2{static create(t){return new this(t)}constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return P1(this,t,n,r,i)}}class $u extends k2{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){b.useDebugValue(t);const r=this;He(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;He(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);He(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){b.useDebugValue(t);const r=this,i=n!==void 0;He(()=>{i&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,i])}select(t,n,r,i){const s=this.selectors[t];return s(this.state,n,r,i)}useState(t,n,r,i){return b.useDebugValue(t),P1(this,this.selectors[t],n,r,i)}useContextCallback(t,n){b.useDebugValue(t);const r=et(n??Jd);this.context[t]=r}useStateSetter(t){const n=b.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(s=>{const o=r(s);if(!Object.is(i,o)){const a=i;i=o,n(o,a,this)}})}}function yr(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ge(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const la=null;class T2{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let ca=new T2;class Rn{static create(){return new Rn}static request(t){return ca.request(t)}static cancel(t){return ca.cancel(t)}currentId=la;request(t){this.cancel(),this.currentId=ca.request(()=>{this.currentId=la,t()})}cancel=()=>{this.currentId!==la&&(ca.cancel(this.currentId),this.currentId=la)};disposeEffect=()=>this.cancel}function M1(){const e=rr(Rn.create).current;return Hu(e.disposeEffect),e}const ks=0;class En{static create(){return new En}currentId=ks;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ks,n()},t)}isStarted(){return this.currentId!==ks}clear=()=>{this.currentId!==ks&&(clearTimeout(this.currentId),this.currentId=ks)};disposeEffect=()=>this.clear}function Xr(){const e=rr(En.create).current;return Hu(e.disposeEffect),e}let zp=0;function D1(e){return zp+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${zp}`}function _l(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function w2(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:S2,platform:_2,maxTouchPoints:C2}=w2(),zu=S2.toLowerCase(),yo=_2.toLowerCase(),xf=/^i(os$|p)/.test(yo)||yo==="macintel"&&C2>1,qp="android",zc=yo===qp||zu.includes(qp),A2=!xf&&yo.startsWith("mac");yo.startsWith("win");const I2=A2||xf,ds=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),NW=!ds&&zu.includes("firefox");!ds&&zu.includes("chrom");const N2=I2,F1=/jsdom|happydom/.test(zu);function qt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ke(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Zi(e,t){let n=e;for(;n;){if(kt(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Lo(n)?n.host:null)}return null}function Nt(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const qc="data-base-ui-focusable",j1="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Cl="ArrowLeft",Al="ArrowRight",R2="ArrowUp",O2="ArrowDown",B1="data-starting-style",L2="data-ending-style",P2={[B1]:""},M2={[L2]:""},yf={transitionStatus(e){return e==="starting"?P2:e==="ending"?M2:null}},D2="data-open",F2="data-closed",j2="data-anchor-hidden",H1="data-popup-open",B2="data-pressed",H2={[H1]:""},U2={[H1]:"",[B2]:""},$2={[D2]:""},z2={[F2]:""},q2={[j2]:""},RW={open(e){return e?H2:null}},OW={open(e){return e?U2:null}},Ef={open(e){return e?$2:z2},anchorHidden(e){return e?q2:null}},U1={...Ef,...yf},Wp="data-trigger-disabled";function W2(e,t){if(!kt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(Wp);for(const[,r]of t.entries())if(Ke(r,n))return!r.hasAttribute(Wp);return!1}function Il(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function V2(e){return e.matches("html,body")}function $1(e){return bt(e)&&e.matches(j1)}function K2(e){return Zi(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${j1}`)!=null}function Vp(e){return e?e.getAttribute("role")==="combobox"&&$1(e):!1}function Wc(e){if(!e||F1)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Kp(e){return e?e.hasAttribute(qc)?e:e.querySelector(`[${qc}]`)||e:null}function ri(e,t,n=!0){return e.filter(i=>i.parentId===t).flatMap(i=>[...!n||i.context?.open?[i]:[],...ri(e,i.id,n)])}function Yp(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function La(e){e.preventDefault(),e.stopPropagation()}function Y2(e){return"nativeEvent"in e}function Ya(e){return e.pointerType===""&&e.isTrusted?!0:zc&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function G2(e){return F1?!1:!zc&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(zc||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function X2(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Q2(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Ji=Math.min,er=Math.max,Ga=Math.round,Yr=Math.floor,tr=e=>({x:e,y:e}),Z2={left:"right",right:"left",bottom:"top",top:"bottom"};function z1(e,t,n){return er(e,Ji(t,n))}function vr(e,t){return typeof e=="function"?e(t):e}function Zt(e){return e.split("-")[0]}function jn(e){return e.split("-")[1]}function vf(e){return e==="x"?"y":"x"}function kf(e){return e==="y"?"height":"width"}function ln(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tf(e){return vf(ln(e))}function J2(e,t,n){n===void 0&&(n=!1);const r=jn(e),i=Tf(e),s=kf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Xa(o)),[o,Xa(o)]}function eC(e){const t=Xa(e);return[Vc(e),t,Vc(t)]}function Vc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gp=["left","right"],Xp=["right","left"],tC=["top","bottom"],nC=["bottom","top"];function rC(e,t,n){switch(e){case"top":case"bottom":return n?t?Xp:Gp:t?Gp:Xp;case"left":case"right":return t?tC:nC;default:return[]}}function iC(e,t,n,r){const i=jn(e);let s=rC(Zt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Vc)))),s}function Xa(e){const t=Zt(e);return Z2[t]+e.slice(t.length)}function sC(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function q1(e){return typeof e!="number"?sC(e):{top:e,right:e,bottom:e,left:e}}function Qa(e){const{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 da(e,t,n){return Math.floor(e/t)!==n}function Kc(e,t){return t<0||t>=e.length}function LW(e,t){return nn(e.current,{disabledIndices:t})}function PW(e,t){return nn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function MW(e,t,n){const{decrement:r,loopFocus:i,allowEscape:s,disabledIndices:o,minIndex:a,maxIndex:u}=n,l=()=>nn(e,{startingIndex:t,decrement:r,disabledIndices:o});let c,d=!1;if(!i)c=r?Math.max(a,l()):Math.min(u,l());else if(r?t<=a:t>=u){const f=r?-1:e.length;s&&t!==f?c=-1:(c=r?u:a,d=!0)}else c=l();return{index:Kc(e,c)?-1:c,wrapped:d}}function nn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let s=t;do s+=n?-i:i;while(s>=0&&s<=e.length-1&&Yc(e,s,r));return s}function DW(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:s,cols:o,disabledIndices:a,minIndex:u,maxIndex:l,prevIndex:c,stopEvent:d=!1}){let f=c,h;if(t.key===R2?h="up":t.key===O2&&(h="down"),h){const m=[],x=[];let E=!1,y=0;{let O=null,_=-1;e.forEach((D,U)=>{if(D==null)return;y+=1;const F=Zi(D,'[role="row"]');F&&(E=!0),(F!==O||_===-1)&&(O=F,_+=1,m[_]=[]),m[_].push(U),x[U]=_})}let v=!1,k=0;if(E)for(const O of m){const _=O.length;_>k&&(k=_),_!==o&&(v=!0)}const S=v&&y<e.length,T=k||o,w=O=>{if(!v||c===-1)return;const _=x[c];if(_==null)return;const D=m[_].indexOf(c),U=O==="up"?-1:1;for(let F=_+U,R=0;R<m.length;R+=1,F+=U){if(F<0||F>=m.length){if(!r||S)return;if(F=F<0?m.length-1:0,i){const B=Math.min(D,m[F].length-1),q=m[F][B]??m[F][0],$=i(t,c,q);F=x[$]??F}}const j=m[F];for(let B=Math.min(D,j.length-1);B>=0;B-=1){const q=j[B];if(!Yc(e,q,a))return q}}},I=O=>{if(!S||c===-1)return;const _=c%T,D=O==="up"?-T:T,U=l-l%T,F=Yr(l/T)+1;for(let R=c-_+D,j=0;j<F;j+=1,R+=D){if(R<0||R>l){if(!r)return;R=R<0?U:0}const B=Math.min(R+T-1,l);for(let q=Math.min(R+_,B);q>=R;q-=1)if(!Yc(e,q,a))return q}};d&&La(t);const A=w(h)??I(h);if(A!==void 0)f=A;else if(c===-1)f=h==="up"?l:u;else if(f=nn(e,{startingIndex:c,amount:T,decrement:h==="up",disabledIndices:a}),r){if(h==="up"&&(c-T<u||f<0)){const O=c%T,_=l%T,D=l-(_-O);_===O?f=l:f=_>O?D:D-T,i&&(f=i(t,c,f))}h==="down"&&c+T>l&&(f=nn(e,{startingIndex:c%T-T,amount:T,disabledIndices:a}),i&&(f=i(t,c,f)))}Kc(e,f)&&(f=c)}if(n==="both"){const m=Yr(c/o);t.key===(s?Cl:Al)&&(d&&La(t),c%o!==o-1?(f=nn(e,{startingIndex:c,disabledIndices:a}),r&&da(f,o,m)&&(f=nn(e,{startingIndex:c-c%o-1,disabledIndices:a}),i&&(f=i(t,c,f)))):r&&(f=nn(e,{startingIndex:c-c%o-1,disabledIndices:a}),i&&(f=i(t,c,f))),da(f,o,m)&&(f=c)),t.key===(s?Al:Cl)&&(d&&La(t),c%o!==0?(f=nn(e,{startingIndex:c,decrement:!0,disabledIndices:a}),r&&da(f,o,m)&&(f=nn(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a}),i&&(f=i(t,c,f)))):r&&(f=nn(e,{startingIndex:c+(o-c%o),decrement:!0,disabledIndices:a}),i&&(f=i(t,c,f))),da(f,o,m)&&(f=c));const x=Yr(l/o)===m;Kc(e,f)&&(r&&x?(f=t.key===(s?Al:Cl)?l:nn(e,{startingIndex:c-c%o-1,disabledIndices:a}),i&&(f=i(t,c,f))):f=c)}return f}function Yc(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?!wf(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function oC(e){return e.visibility==="hidden"||e.visibility==="collapse"}function wf(e,t=e?yn(e):null){return!e||!e.isConnected||!t||oC(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const aC='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function uC(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Lo(n)?n.host:null}function Gc(e){for(const t of Array.from(e.children))if(Wt(t)==="summary")return t;return null}function lC(e,t){const n=Gc(t);return!!n&&(e===n||Ke(n,e))}function W1(e){const t=e?Wt(e):"";return e!=null&&e.matches(aC)&&(t!=="summary"||e.parentElement!=null&&Wt(e.parentElement)==="details"&&Gc(e.parentElement)===e)&&(t!=="details"||Gc(e)==null)&&(t!=="input"||e.type!=="hidden")}function Sf(e){if(!W1(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=uC(t)){const n=t!==e,r=Wt(t)==="slot";if(t.hasAttribute("inert")||n&&Wt(t)==="details"&&!t.open&&!lC(e,t)||t.hasAttribute("hidden")||!r&&!cC(t,n))return!1}return!0}function cC(e,t){const n=yn(e);return t?n.display!=="none":wf(e,n)}function V1(e){const t=e.tabIndex;if(t<0){const n=Wt(e);if(n==="details"||n==="audio"||n==="video"||bt(e)&&e.isContentEditable)return 0}return t}function Nl(e){if(Wt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function K1(e,t){const n=Nl(e);if(!n)return!0;const r=t.find(i=>{const s=Nl(i);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(i=>{const s=Nl(i);return s?.name===n.name&&s.form===n.form})===n}function Y1(e){if(bt(e)&&Wt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return bt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function _f(e,t){Y1(e).forEach(n=>{W1(n)&&t.push(n),_f(n,t)})}function G1(e,t,n){Y1(e).forEach(r=>{bt(r)&&r.matches(t)&&n.push(r),G1(r,t,n)})}function qu(e){return Sf(e)&&V1(e)>=0}function X1(e){const t=[];return _f(e,t),t.filter(Sf)}function Wu(e){const t=X1(e);return t.filter(n=>V1(n)>=0&&K1(n,t))}function Q1(e,t){const n=Wu(e),r=n.length;if(r===0)return;const i=qt(tt(e)),s=n.indexOf(i),o=s===-1?t===1?0:r-1:s+t;return n[o]}function Z1(e){return Q1(tt(e).body,1)||e}function J1(e){return Q1(tt(e).body,-1)||e}function FW(e,t,n){if(!e)return null;const r=[];_f(tt(e).body,r);const i=r.indexOf(e);if(i===-1)return null;const s=r.filter(Sf);for(let o=1;o<r.length;o+=1){const a=r[(i+t*o+r.length)%r.length];if(!Ke(n,a)&&qu(a)&&K1(a,s))return a}return r[i]}function to(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ke(n,r)}function dC(e){Wu(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Qp(e){const t=[];G1(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Rl(e){const t=new Map;let n=0,r=0;return e.forEach((i,s)=>{const o=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:s,visibleIndex:o?-1:n,offsetY:r}),r+=i.height||0,o||(n+=1)}),t}function Ol(e,t){let n=0;return e.map(r=>{if(r.transitionStatus==="ending")return r;const i=n>=t;return n+=1,r.limited===i?r:{...r,limited:i}})}const fn={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class fC extends $u{timers=new Map;areTimersPaused=!1;constructor(t){super({...t,toastMetadata:Rl(t.toasts)},{},fn)}setViewport=t=>{this.set("viewport",t)};syncProviderProps(t,n){const r=this.state.limit!==n;if(this.state.timeout===t&&!r)return;const i={timeout:t,limit:n};if(r){const s=Ol(this.state.toasts,n);i.toasts=s,i.toastMetadata=Rl(s)}this.update(i)}disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n=!1){const r=fn.toastIndex(this.state,t);if(r===-1)return;const i=this.state.toasts[r];n||i?.onRemove?.();const s=[...this.state.toasts];s.splice(r,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:r}=this.state,i=t.id||D1("toast");if(t.id){const u=fn.toast(this.state,t.id);if(u)if(u.transitionStatus==="ending")this.removeToast(t.id,!0);else{const{id:l,transitionStatus:c,...d}=t;return this.updateToastInternal(t.id,d,!0,!0),t.id}}const s={...t,id:i,updateKey:0,transitionStatus:"starting"},o=[s,...this.state.toasts];this.setToasts(Ol(o,r));const a=s.timeout??n;return s.type!=="loading"&&a>0&&this.scheduleTimer(i,a,()=>this.closeToast(i)),fn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(t,n)=>{const r=fn.toast(this.state,t);!r||r.transitionStatus==="ending"||this.updateToastInternal(t,typeof n=="function"?n(r):n,!1,!0)};updateToastInternal=(t,n,r=!1,i=!1)=>{const{timeout:s,toasts:o}=this.state,a=fn.toast(this.state,t);if(!a||a.transitionStatus==="ending")return;const u={...a,...n,...i&&{updateKey:a.updateKey+1}};this.setToasts(o.map(E=>E.id===t?u:E));const l=u.timeout??s,c=a.timeout??s,d=Object.hasOwn(n,"timeout"),f=u.transitionStatus!=="ending"&&u.type!=="loading"&&l>0,h=this.timers.has(t),m=c!==l,x=a.type==="loading";if(!f&&h){this.clearTimer(t);return}f&&(!h||m||d||x||r)&&(this.clearTimer(t),this.scheduleTimer(t,l,()=>this.closeToast(t)),fn.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=t=>{const n=t===void 0,{limit:r,toasts:i}=this.state;let s;if(n)s=i,this.clearTimers();else{const u=fn.toast(this.state,t);if(!u)return;s=[u],this.clearTimer(t)}const o=i.map(u=>n||u.id===t?{...u,transitionStatus:"ending",height:0}:u),a=Ol(o,r);this.setToasts(a,!a.some(u=>u.transitionStatus!=="ending")),s.forEach(u=>{u.transitionStatus!=="ending"&&u.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=_l(n.loading),i=this.addToast({...r,type:"loading"}),s=t.then(o=>{const a=_l(n.success,o);return this.updateToast(i,{...a,type:"success",timeout:a.timeout}),o}).catch(o=>{const a=_l(n.error,o);return this.updateToast(i,{...a,type:"error",timeout:a.timeout}),Promise.reject(o)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{t.timeout&&(t.timeout.clear(),t.remaining=Math.max(t.remaining-(Date.now()-t.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=En.create(),t.timeout.start(t.remaining,()=>{this.handleTimerFired(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=Nt(t);Ke(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const i=Date.now(),o=!fn.expandedOrOutOfFocus(this.state)?En.create():void 0;o?.start(n,()=>{this.handleTimerFired(t),r()}),this.timers.set(t,{timeout:o,start:i,delay:n,remaining:n,callback:r})}clearTimers(){this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(t){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(t){this.timers.delete(t),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(t,n=t.length===0){const r={toasts:t,toastMetadata:Rl(t)};n&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(t){const n=qt(tt(this.state.viewport));if(!this.state.viewport||!Ke(this.state.viewport,n)||!Wc(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=fn.toasts(this.state),i=fn.toastIndex(this.state,t),s=(a,u)=>{for(let l=a;l>=0&&l<r.length;l+=u)if(r[l].transitionStatus!=="ending")return r[l];return null},o=s(i+1,1)??s(i-1,-1);o?o.ref?.current?.focus():this.restoreFocusToPrevElement()}}const hC=function(t){const{children:n,timeout:r=5e3,limit:i=3,toastManager:s}=t,o=rr(()=>new fC({timeout:r,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Hu(o.disposeEffect),b.useEffect(function(){return s?s[" subscribe"](({action:l,options:c})=>{const d=c.id;l==="promise"&&c.promise?o.promiseToast(c.promise,c):l==="update"&&d?o.updateToast(d,c.updates):l==="close"?o.closeToast(d):o.addToast(c)}):void 0},[o,s]),p.jsxs(R1.Provider,{value:o,children:[p.jsx(pC,{store:o,timeout:r,limit:i}),n]})};function pC(e){const{store:t,timeout:n,limit:r}=e;return He(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}const Eo=b.forwardRef(function(t,n){const[r,i]=b.useState();He(()=>{N2&&ds&&i("button")},[]);const s={tabIndex:0,role:r};return p.jsx("span",{...t,ref:n,style:Ob,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})}),mC="--toast-frontmost-height",gC=b.forwardRef(function(t,n){const{render:r,className:i,style:s,children:o,...a}=t,u=Uu(),l=Xr(),c=b.useRef(!1),d=b.useRef(!1),f=b.useRef(!1),h=u.useState("isEmpty"),m=u.useState("toasts"),x=u.useState("focused"),E=u.useState("expanded"),y=u.useState("prevFocusElement"),v=m[0]?.height,k=m.some($=>$.transitionStatus==="ending"),S=m.filter($=>$.priority==="high");b.useEffect(()=>{const $=u.state.viewport;if(!$||h)return;const X=Ht($),C=tt($);function se(G){G.key==="F6"&&Nt(G)!==$&&(G.preventDefault(),u.set("prevFocusElement",qt(C)),$?.focus({preventScroll:!0}),u.pauseTimers(),u.set("focused",!0))}function xe(G){Nt(G)===X&&(u.set("isWindowFocused",!1),u.pauseTimers())}function L(G){if(G.relatedTarget)return;const re=Nt(G),ne=qt(tt($));(re===X||!Ke($,re)||!Wc(ne))&&u.resumeTimers(),l.start(0,()=>u.set("isWindowFocused",!0))}return yr(Ge(X,"keydown",se),Ge(X,"blur",xe,!0),Ge(X,"focus",L,!0),Ge(C,"pointerdown",u.handleDocumentPointerDown,!0))},[u,l,h]);function T($){c.current=!0;const X=$.relatedTarget===u.state.viewport?m.find(C=>C.transitionStatus!=="ending"&&!C.limited):void 0;X?X.ref?.current?.focus():u.restoreFocusToPrevElement()}function w($){$.key==="Tab"&&$.shiftKey&&Nt($.nativeEvent)===u.state.viewport&&($.preventDefault(),u.restoreFocusToPrevElement())}function I(){u.state.toasts.some(X=>X.transitionStatus==="ending")||f.current||!d.current||(u.set("hovering",!1),u.select("expandedOrOutOfFocus")||u.resumeTimers(),d.current=!1)}b.useEffect(I,[k,u]);function A(){u.pauseTimers(),u.set("hovering",!0),d.current=!1}function O(){d.current=!0,I()}function _($){$.pointerType==="touch"&&(f.current=!0)}function D($){$.pointerType==="touch"&&(f.current=!1,I())}function U(){if(c.current){c.current=!1;return}x||Wc(qt(tt(u.state.viewport)))&&(u.set("focused",!0),u.pauseTimers())}function F($){!x||Ke(u.state.viewport,$.relatedTarget)||(u.set("focused",!1),u.select("expandedOrOutOfFocus")||u.resumeTimers())}const R={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:A,onMouseMove:A,onMouseLeave:O,onFocus:U,onBlur:F,onKeyDown:w,onClick:U,onPointerDown:_,onPointerUp:D,onPointerCancel:D,style:{[mC]:v?`${v}px`:void 0}},j={expanded:E},B=!h&&y&&p.jsx(Eo,{onFocus:T}),q=Un("div",t,{ref:[n,u.setViewport],state:j,props:[R,a,{children:p.jsxs(b.Fragment,{children:[B,o,B]})}]});return p.jsxs(b.Fragment,{children:[B,q,!x&&S.length>0&&p.jsx("div",{style:Ob,children:S.map($=>p.jsxs("div",{role:"alert","aria-atomic":!0,children:[p.jsx("div",{children:$.title}),p.jsx("div",{children:$.description})]},$.id))})]})});function Cf(e){return Rb(19)?e:e?"true":void 0}const ex=b.createContext(void 0);function tx(){const e=b.useContext(ex);if(!e)throw new Error(fi(66));return e}function Yn(e){return e==null?e:"current"in e?e.current:e}function Zp(e,t){return e.getAnimations(t).filter(n=>{const r=n.effect?.getTiming();return r?.duration!==1/0&&r?.iterations!==1/0})}let fa=null;function bC(e){if(!fa){const t=[];fa=t,queueMicrotask(()=>{fa=null,Kt.flushSync(()=>{for(const n of t)n()})})}fa.push(e)}function nx(e,t=!1,n=!1){const r=M1();return et((i,s=null)=>{r.cancel();const o=Yn(e);if(o==null)return;const a=o,u=()=>{if(!n){Kt.flushSync(i);return}bC(()=>{s?.aborted||i()})};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Zp(a).map(c=>c.finished.then(Jd))).then(()=>{s?.aborted||u()},()=>{if(s?.aborted)return;if(Zp(a).some(d=>d.pending||d.playState!=="finished")){l();return}u()})}if(t){const c=B1;if(!a.hasAttribute(c)){r.request(l);return}const d=new MutationObserver(()=>{a.hasAttribute(c)||(d.disconnect(),l())});d.observe(a,{attributes:!0,attributeFilter:[c]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(l)})}function Vu(e){const{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:s}=e,o=et(s),a=nx(r,n,i);b.useEffect(()=>{if(!t)return;const u=new AbortController;return a(o,u.signal),()=>{u.abort()}},[t,n,o,a])}const xC=500,yC={style:{transition:"none"}},EC="data-base-ui-click-trigger",vC="data-base-ui-swipe-ignore",kC="data-swipe-ignore",TC=`[${vC}]`,wC=`[${kC}]`,SC={fallbackAxisSide:"end"},_C={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function CC(e,t){const n=Ht(e).getComputedStyle(e).transform;let r=0,i=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const a=o[1].split(", ").map(parseFloat);a.length===6?(r=a[4],i=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],i=a[13],s=a[0])}}return{x:r,y:i,scale:s}}function Ll(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}const AC="--toast-index",IC="--toast-offset-y",NC="--toast-height",RC="--toast-swipe-movement-x",OC="--toast-swipe-movement-y",LC="data-swipe-direction",PC={...yf,swipeDirection(e){return e?{[LC]:e}:null}},Jp=40,MC=10,em=.5,DC=1,FC=`${TC},${wC}`,jC=b.forwardRef(function(t,n){const{toast:r,render:i,className:s,swipeDirection:o=["down","right"],style:a,...u}=t,l=r.positionerProps?.anchor!==void 0;let c=[];l||(c=Array.isArray(o)?o:[o]);const d=c.length>0,f=Uu(),[h,m]=b.useState(void 0),[x,E]=b.useState(!1),[y,v]=b.useState(!1),[k,S]=b.useState({x:0,y:0}),[T,w]=b.useState({x:0,y:0,scale:1}),[I,A]=b.useState(),[O,_]=b.useState(),[D,U]=b.useState(null),F=b.useRef(null),R=b.useRef(void 0),j=b.useRef({x:0,y:0}),B=b.useRef({x:0,y:0,scale:1}),q=b.useRef(void 0),$=b.useRef(0),X=b.useRef(!1),C=b.useRef({x:0,y:0}),se=b.useRef(!1),xe=b.useRef({x:0,y:0}),L=b.useRef(null),G=b.useRef(null),re=f.useState("toastIndex",r.id),ne=f.useState("toastVisibleIndex",r.id),pe=f.useState("toastOffsetY",r.id),Ae=f.useState("focused"),ee=f.useState("expanded");Vu({open:r.transitionStatus!=="ending",ref:F,onComplete(){r.transitionStatus==="ending"&&f.removeToast(r.id)}});const he=et((K=!1)=>{const be=F.current;if(!be)return;const J=be.style.height;be.style.height="auto";const H=be.offsetHeight;be.style.height=J;function Q(){f.updateToastInternal(r.id,{ref:F,height:H,transitionStatus:void 0})}K?Kt.flushSync(Q):Q()});He(()=>{const K=R.current;r.transitionStatus!=="starting"&&K===r.id||(K!==void 0&&(m(void 0),w({x:0,y:0,scale:1}),Ie({x:0,y:0})),R.current=r.id,he())},[he,r.id,r.transitionStatus]);function Ie(K){xe.current=K,S(K)}He(()=>()=>{G.current?.abort()},[]);function Me(K,be){const J=W=>W>0?W**em:-(Math.abs(W)**em),H=K>0&&!c.includes("right")||K<0&&!c.includes("left"),Q=be>0&&!c.includes("down")||be<0&&!c.includes("up");return{x:H?J(K):K,y:Q?J(be):be}}const Be=et(K=>{if(K.pointerId!==L.current)return;L.current=null,G.current?.abort(),G.current=null,E(!1),v(!1),U(null);const be=B.current;if(K.type==="pointercancel"||X.current){Ie({x:be.x,y:be.y}),m(void 0);return}const J=xe.current,H=J.x-be.x,Q=J.y-be.y;let W;for(const Z of c)if(Ll(Z,H,Q)>Jp){W=Z;break}W?(m(W),f.closeToast(r.id)):(Ie({x:be.x,y:be.y}),m(void 0))});function fe(K){if(K.button!==0)return;K.pointerType==="touch"&&f.pauseTimers();const be=Nt(K.nativeEvent);if(Zi(be,`button,a,input,textarea,[role="button"],${FC}`))return;X.current=!1,q.current=void 0,$.current=0,L.current=K.pointerId,j.current={x:K.clientX,y:K.clientY},C.current=j.current;const H=K.currentTarget,Q=CC(H);B.current=Q,w(Q),Ie({x:Q.x,y:Q.y}),f.set("hovering",!0),E(!0),v(!1),U(null),se.current=!0,G.current?.abort();const W=new AbortController;G.current=W;const Z=tt(H);Z.addEventListener("pointerup",Be,{signal:W.signal}),Z.addEventListener("pointercancel",Be,{signal:W.signal}),H.setPointerCapture?.(K.pointerId)}function Le(K){if(K.pointerId!==L.current)return;K.preventDefault(),se.current&&(j.current={x:K.clientX,y:K.clientY},se.current=!1);const{clientY:be,clientX:J,movementX:H,movementY:Q}=K;(Q<0&&be>C.current.y||Q>0&&be<C.current.y)&&(C.current={x:C.current.x,y:be}),(H<0&&J>C.current.x||H>0&&J<C.current.x)&&(C.current={x:J,y:C.current.y});const W=J-j.current.x,Z=be-j.current.y,ae=be-C.current.y,ue=J-C.current.x;let Se=D;if(!y&&Math.sqrt(W*W+Z*Z)>=DC){v(!0);const ce=c.includes("left")||c.includes("right"),ut=c.includes("up")||c.includes("down");if(ce&&ut){const rt=Math.abs(W),qn=Math.abs(Z);Se=rt>qn?"horizontal":"vertical",U(Se)}}let me;if(!q.current)Se==="vertical"?Z>0?me="down":Z<0&&(me="up"):Se==="horizontal"?W>0?me="right":W<0&&(me="left"):Math.abs(W)>=Math.abs(Z)?me=W>0?"right":"left":me=Z>0?"down":"up",me&&c.includes(me)&&(q.current=me,$.current=Ll(me,W,Z),m(me));else{const Ne=q.current,ce=Ll(Ne,ue,ae);ce>Jp?(X.current=!1,m(Ne)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&$.current-ce>=MC&&(X.current=!0)}const de=Me(W,Z);let ve=B.current.x,_e=B.current.y;const Pe=c.includes("left")||c.includes("right"),ye=c.includes("up")||c.includes("down");Se!=="vertical"&&Pe&&(ve+=de.x),Se!=="horizontal"&&ye&&(_e+=de.y),Ie({x:ve,y:_e})}function Re(K){if(K.key==="Escape"){if(!F.current||!Ke(F.current,qt(tt(F.current))))return;f.closeToast(r.id)}}b.useEffect(()=>{const K=F.current;if(!d||!K)return;function be(J){L.current===null||!Ke(K,Nt(J))||J.preventDefault()}return Ge(K,"touchmove",be,{passive:!1})},[d]);function De(){const K=k.x-T.x,be=k.y-T.y;return{transition:x?"none":void 0,transform:x?`translateX(${k.x}px) translateY(${k.y}px) scale(${T.scale})`:void 0,[RC]:`${K}px`,[OC]:`${be}px`}}const ke=r.priority==="high",le={role:ke?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":I,"aria-describedby":O,"aria-hidden":ke&&!Ae?!0:void 0,onPointerDown:d?fe:void 0,onPointerMove:d?Le:void 0,onPointerUp:d?Be:void 0,onPointerCancel:d?Be:void 0,onKeyDown:Re,inert:Cf(r.limited),style:{...De(),[AC]:r.transitionStatus==="ending"?re:ne,[IC]:`${pe}px`,[NC]:r.height?`${r.height}px`:void 0}},Ce=b.useMemo(()=>({toast:r,setTitleId:A,setDescriptionId:_,recalculateHeight:he,visibleIndex:ne,expanded:ee}),[r,A,_,he,ne,ee]),ge={transitionStatus:r.transitionStatus,expanded:ee,limited:r.limited||!1,type:r.type,swiping:x,swipeDirection:h},Fe=Un("div",t,{ref:[n,F],state:ge,stateAttributesMapping:PC,props:[le,u]});return p.jsx(ex.Provider,{value:Ce,children:Fe})});function rx(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(rx):!0}function BC(e){return b.isValidElement(e)&&rx(e.props.children)}function HC(e,t,n){const{toast:r,setTitleId:i,setDescriptionId:s}=tx(),o=i,a=t??r.title;return{id:Iu(e),children:a,type:r.type,setId:o}}function UC(e,t,n){const r=BC(e);return He(()=>{if(r)return n(t),()=>{n(i=>i===t?void 0:i)}},[r,t,n]),r?e:null}const $C=b.forwardRef(function(t,n){const{render:r,className:i,style:s,id:o,children:a,...u}=t,{id:l,children:c,type:d,setId:f}=HC(o,a),m=Un("h2",t,{ref:n,state:{type:d},props:{...u,id:l,children:c}});return UC(m,l,f)}),zC=b.forwardRef(function(t,n){const{render:r,className:i,style:s,disabled:o,nativeButton:a=!0,...u}=t,l=Uu(),{toast:c,expanded:d}=tx(),[f,h]=b.useState(!1),{getButtonProps:m,buttonRef:x}=Jw({disabled:o,native:a}),E={type:c.type};return Un("button",t,{ref:[n,x],state:E,props:[{"aria-hidden":!d&&!f,onClick(){l.closeToast(c.id)},onFocus(){h(!0)},onBlur(){h(!1)}},u,m]})});function no(e){return`data-base-ui-${e}`}const ix=b.createContext(null),sx=()=>b.useContext(ix),qC=no("portal");function ox(e={}){const{ref:t,container:n,componentProps:r=xr,elementProps:i}=e,s=Iu(),a=sx()?.portalNode,[u,l]=b.useState(null),[c,d]=b.useState(null),f=et(E=>{E!==null&&d(E)}),h=b.useRef(null);He(()=>{if(n===null){h.current&&(h.current=null,d(null),l(null));return}const E=(n&&(eS(n)?n:n.current))??a??document.body;if(E==null){h.current&&(h.current=null,d(null),l(null));return}h.current!==E&&(h.current=E,d(null),l(E))},[n,a]);const m=Un("div",r,{ref:[t,f],props:[{id:s,[qC]:""},i]}),x=u&&m?Kt.createPortal(m,u):null;return{node:c,nodeId:b.isValidElement(m)?m.props.id:void 0,subtree:x}}const ax=b.forwardRef(function(t,n){const{render:r,className:i,style:s,children:o,container:a,portalOwnerRole:u,...l}=t,{node:c,nodeId:d,subtree:f}=ox({container:a,ref:n,componentProps:t,elementProps:l}),h=b.useRef(null),m=b.useRef(null),x=b.useRef(null),E=b.useRef(null),[y,v]=b.useState(null),k=b.useRef(!1),S=y?.modal,T=y?.open,w=!!y&&!y.modal&&y.open&&!!c;b.useEffect(()=>{if(!c||S)return;function A(O){c&&O.relatedTarget&&to(O)&&(O.type==="focusin"?k.current&&(Qp(c),k.current=!1):(dC(c),k.current=!0))}return yr(Ge(c,"focusin",A,!0),Ge(c,"focusout",A,!0))},[c,S]),He(()=>{!c||T!==!0||!k.current||(Qp(c),k.current=!1)},[T,c]);const I=b.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:x,afterInsideRef:E,portalNode:c,setFocusManagerState:v}),[c]);return p.jsxs(b.Fragment,{children:[f,p.jsxs(ix.Provider,{value:I,children:[w&&c&&p.jsx(Eo,{"data-type":"outside",ref:h,onFocus:A=>{if(to(A,c))x.current?.focus();else{const O=y?y.domReference:null;J1(O)?.focus()}}}),w&&c&&p.jsx("span",{role:u,"aria-owns":d,style:_C}),c&&Kt.createPortal(o,c),w&&c&&p.jsx(Eo,{"data-type":"outside",ref:m,onFocus:A=>{if(to(A,c))E.current?.focus();else{const O=y?y.domReference:null;Z1(O)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Mn(za,A.nativeEvent))}}})]})]})}),WC=b.forwardRef(function(t,n){const{children:r,container:i,className:s,render:o,style:a,...u}=t,{node:l,subtree:c}=ox({container:i,ref:n,componentProps:t,elementProps:u});return!c&&!l?null:p.jsxs(b.Fragment,{children:[c,l&&Kt.createPortal(r,l)]})}),VC=b.forwardRef(function(t,n){return p.jsx(WC,{ref:n,...t})});function Gn(e){const t=rr(KC,e).current;return t.next=e,He(t.effect),t}function KC(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function YC(e,t){return t!=null&&!X2(t)?0:typeof e=="function"?e():e}function GC(e,t,n){const r=YC(e,n);return typeof r=="number"?r:r?.[t]}function jW(e){return typeof e=="function"?e():e}function XC(e,t){return t||e==="click"||e==="mousedown"}function QC(e){return e?.includes("mouse")&&e!=="mousedown"}let ha=0;function Pl(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(ha);function s(){i&&!i()||e?.focus({preventScroll:n})}if(r)return s(),Jd;const o=requestAnimationFrame(s);return ha=o,()=>{ha===o&&(cancelAnimationFrame(o),ha=0)}}const tm="data-base-ui-inert";let Ts=new WeakMap,pa=new WeakSet,ws=new WeakMap,Ml=0;function ux(e){return e?Lo(e)?e.host:ux(e.parentNode):null}const nm=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ux(n);return e.contains(r)?r:null}).filter(n=>n!=null),rm=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},im=(e,t,n)=>{const r=[],i=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{Wt(o)!=="script"&&(t.has(o)?i(o):r.push(o))})};return i(e),r};function ZC(e,t,n,{mark:r=!0}){const i=nm(t,e),s=r?im(t,rm(i),new Set(i)):[],o=[],a=[];if(n){const u=nm(t,Array.from(t.querySelectorAll("[aria-live]"))),l=i.concat(u);im(t,rm(l),new Set(l)).forEach(d=>{const f=d.getAttribute("aria-hidden"),h=f!==null&&f!=="false",m=(Ts.get(d)||0)+1;Ts.set(d,m),o.push(d),m===1&&h&&pa.add(d),h||d.setAttribute("aria-hidden","true")})}return r&&s.forEach(u=>{const l=(ws.get(u)||0)+1;ws.set(u,l),a.push(u),l===1&&u.setAttribute(tm,"")}),Ml+=1,()=>{o.forEach(u=>{const l=(Ts.get(u)||0)-1;Ts.set(u,l),l||(pa.has(u)||u.removeAttribute("aria-hidden"),pa.delete(u))}),r&&a.forEach(u=>{const l=(ws.get(u)||0)-1;ws.set(u,l),l||u.removeAttribute(tm)}),Ml-=1,Ml||(Ts=new WeakMap,pa=new WeakSet,ws=new WeakMap)}}function sm(e,t={}){const{ariaHidden:n=!1,mark:r=!0}=t,i=tt(e[0]).body;return ZC(e,i,n,{mark:r})}function lx(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class JC{nodesRef={current:[]};events=lx();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const cx=b.createContext(null),dx=b.createContext(null),Ku=()=>b.useContext(cx)?.id||null,qo=e=>{const t=b.useContext(dx);return e??t};function eA(e){const t=Iu(),n=qo(e),r=Ku();return He(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function tA(e){const{children:t,id:n}=e,r=Ku();return p.jsx(cx.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function nA(e){const{children:t,externalTree:n}=e,r=rr(()=>n??new JC).current;return p.jsx(dx.Provider,{value:r,children:t})}function rA(e,t){const n=Ht(Nt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(Ya(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const om=20;let mr=[];function Af(){mr=mr.filter(e=>e.deref()?.isConnected)}function am(e){Af(),e&&Wt(e)!=="body"&&(mr.push(new WeakRef(e)),mr.length>om&&(mr=mr.slice(-om)))}function um(){return Af(),mr[mr.length-1]?.deref()}function iA(e){return e?qu(e)?e:Wu(e)[0]||e:null}function lm(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=X1(e).filter(i=>{const s=i.getAttribute("data-tabindex")||"";return qu(i)||i.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function fx(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,explicitReturnFocus:o,restoreFocus:a=!1,modal:u=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:x}=e,E=t.useState("open"),y=t.useState("domReferenceElement"),v=t.useState("floatingElement"),{events:k,dataRef:S}=t.context,T=et(()=>S.current.floatingContext?.nodeId),w=i===!1,I=Vp(y)&&w,A=Gn(i),O=Gn(s),_=Gn(o),D=Gn(c),U=Gn(E),F=qo(m),R=sx(),j=b.useRef(!1),B=b.useRef(!1),q=b.useRef(!1),$=b.useRef(null),X=b.useRef(""),C=b.useRef(""),se=b.useRef(null),xe=b.useRef(null),L=sp(se,h,R?.beforeInsideRef),G=sp(xe,R?.afterInsideRef),re=Xr(),ne=Xr(),pe=M1(),Ae=R!=null,ee=Kp(v),he=et((fe=ee)=>fe?Wu(fe):[]),Ie=et(()=>x?.().filter(fe=>fe!=null)??[]);b.useEffect(()=>{if(r||!u)return;function fe(Re){Re.key==="Tab"&&Ke(ee,qt(tt(ee)))&&he().length===0&&!I&&La(Re)}const Le=tt(ee);return Ge(Le,"keydown",fe)},[r,ee,u,I,he]),b.useEffect(()=>{if(r||!E)return;const fe=tt(ee);function Le(){q.current=!1}function Re(ke){const le=Nt(ke),Ce=Ie(),ge=Ke(v,le)||Ke(y,le)||Ke(R?.portalNode,le)||Ce.some(Fe=>Fe===le||Ke(Fe,le));q.current=!ge,C.current=ke.pointerType||"keyboard",Zi(le,`[${EC}]`)&&(B.current=!0,ne.start(0,()=>{B.current=!1}))}function De(){C.current="keyboard"}return yr(Ge(fe,"pointerdown",Re,!0),Ge(fe,"pointerup",Le,!0),Ge(fe,"pointercancel",Le,!0),Ge(fe,"keydown",De,!0),Le)},[r,v,y,ee,E,R,ne,Ie]),b.useEffect(()=>{if(r||!l)return;const fe=tt(ee);function Le(){B.current=!0,ne.start(0,()=>{B.current=!1})}function Re(Ce){const ge=Nt(Ce);qu(ge)&&($.current=ge)}function De(Ce){const ge=Ce.relatedTarget,Fe=Ce.currentTarget,K=Nt(Ce);u&&ge==null&&K!=null&&Ke(v,K)&&am(K),queueMicrotask(()=>{const be=T(),J=t.context.triggerElements,H=Ie(),Q=ge?.hasAttribute(no("focus-guard"))&&[se.current,xe.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,Yn(f),Yn(d)].includes(ge),W=!(Ke(y,ge)||Ke(v,ge)||Ke(ge,v)||Ke(R?.portalNode,ge)||H.some(Z=>Z===ge||Ke(Z,ge))||J.hasMatchingElement(Z=>Ke(Z,ge))||Q||F&&(ri(F.nodesRef.current,be).find(Z=>Ke(Z.context?.elements.floating,ge)||Ke(Z.context?.elements.domReference,ge))||Yp(F.nodesRef.current,be).find(Z=>[Z.context?.elements.floating,Kp(Z.context?.elements.floating)].includes(ge)||Z.context?.elements.domReference===ge)));if(Fe===y&&ee&&lm(ee),a&&Fe!==y&&!wf(K)&&qt(fe)===fe.body){if(bt(ee)&&(ee.focus(),a==="popup")){pe.request(()=>{ee.focus()});return}const Z=he(),ae=$.current,ue=(ae&&Z.includes(ae)?ae:null)||Z[Z.length-1]||ee;bt(ue)&&ue.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(I||!u)&&ge&&W&&!B.current&&(I||ge!==um())&&(j.current=!0,t.setOpen(!1,Mn(za,Ce)))})}function ke(){q.current||(S.current.insideReactTree=!0,re.start(0,()=>{S.current.insideReactTree=!1}))}const le=bt(y)?y:null;if(!(!v&&!le))return yr(le&&Ge(le,"focusout",De),le&&Ge(le,"pointerdown",Le),v&&Ge(v,"focusin",Re),v&&Ge(v,"focusout",De),v&&R&&Ge(v,"focusout",ke,!0))},[r,y,v,ee,u,F,R,t,l,a,he,I,T,S,re,ne,pe,d,f,Ie]),b.useEffect(()=>{if(r||!v||!E)return;const fe=Array.from(R?.portalNode?.querySelectorAll(`[${no("portal")}]`)||[]),Re=(F?Yp(F.nodesRef.current,T()):[]).find(Fe=>Vp(Fe.context?.elements.domReference||null))?.context?.elements.domReference,ke=[...[v,...fe,se.current,xe.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Ie()],Re,Yn(f),Yn(d),I?y:null].filter(Fe=>Fe!=null),le=sm(ke,{ariaHidden:u||I,mark:!1}),Ce=[v,...fe].filter(Fe=>Fe!=null),ge=sm(Ce);return()=>{ge(),le()}},[E,r,y,v,u,R,I,F,T,d,f,Ie]),He(()=>{if(!E||r||!bt(ee))return;X.current="",C.current="";const fe=tt(ee),Le=qt(fe);queueMicrotask(()=>{const Re=A.current,De=typeof Re=="function"?Re(D.current||""):Re;if(De===void 0||De===!1||Ke(ee,Le))return;let le=null;const Ce=()=>(le==null&&(le=he(ee)),le[0]||ee);let ge;De===!0||De===null?ge=Ce():ge=Yn(De),ge=ge||Ce();const Fe=Ke(ee,qt(fe)),K=S.current.openEvent,be=K?.type==="mousedown"&&Ya(K);Pl(ge,{sync:be,preventScroll:ge===ee,shouldFocus(){if(!U.current)return!1;if(Fe)return!0;const J=qt(fe);return!(J!==ge&&Ke(ee,J))}})})},[r,E,ee,he,A,D,U,S]);const Me=b.useRef(null);He(()=>{if(r||!ee){Me.current=null;return}Me.current&&(Me.current.cancelled=!0,Me.current=null);const fe=tt(ee),Le=qt(fe),Re=D.current==null;am(Le);function De(le){if(le.open||(X.current=rA(le.nativeEvent,C.current)),(le.reason===za&&le.triggerElement?.hasAttribute(no("focus-guard"))||le.reason===Jr&&le.nativeEvent.type==="mouseleave")&&(j.current=!0),le.reason===Lb)if(le.nested)j.current=!1;else if(Ya(le.nativeEvent)||G2(le.nativeEvent))j.current=!1;else{let Ce=!1;tt(ee).createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?j.current=!1:j.current=!0}}k.on("openchange",De);function ke(le){const Ce=O.current;let ge=typeof Ce=="function"?Ce(le):Ce;if(ge===void 0||ge===!1)return null;ge===null&&(ge=!0);const Fe=y?.isConnected?y:null,K=Le?.isConnected&&Wt(Le)!=="body"?Le:null;let be=Re?K||Fe:Fe||K;return be||(be=um()||null),typeof ge=="boolean"?be:Yn(ge)||be||null}return()=>{k.off("openchange",De);const le=qt(fe),Ce=Ie(),ge=Ke(v,le)||Ce.some(H=>H===le||Ke(H,le))||F&&ri(F.nodesRef.current,T(),!1).some(H=>Ke(H.context?.elements.floating,le)),Fe=O.current,K=X.current,be=ke(K),J={cancelled:!1};Me.current=J,queueMicrotask(()=>{Me.current===J&&(Me.current=null);const H=iA(be),Q=_.current??typeof Fe!="boolean";if(!J.cancelled&&Fe&&!j.current&&bt(H)&&(!(!Q&&H!==le&&le!==fe.body)||ge)){const W={preventScroll:!0};K==="keyboard"&&(W.focusVisible=!0),H.focus(W)}j.current=!1})}},[r,v,ee,O,_,D,k,F,y,T,Ie]),He(()=>{if(!ds||E||!v)return;const fe=qt(tt(v));!bt(fe)||!$1(fe)||Ke(v,fe)&&fe.blur()},[E,v]),He(()=>{if(!(r||!R))return R.setFocusManagerState({modal:u,closeOnFocusOut:l,open:E,onOpenChange:t.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,u,E,t,l,y]),He(()=>{if(!(r||!ee))return lm(ee),()=>{queueMicrotask(Af)}},[r,ee]);const Be=!r&&(u?!I:!0)&&(Ae||u);return p.jsxs(b.Fragment,{children:[Be&&p.jsx(Eo,{"data-type":"inside",ref:L,onFocus:fe=>{if(u){const Le=he();Pl(Le[Le.length-1])}else R?.portalNode&&(j.current=!1,to(fe,R.portalNode)?Z1(y)?.focus():Yn(f??R.beforeOutsideRef)?.focus())}}),n,Be&&p.jsx(Eo,{"data-type":"inside",ref:G,onFocus:fe=>{u?Pl(he()[0]):R?.portalNode&&(l&&(j.current=!0),to(fe,R.portalNode)?J1(y)?.focus():Yn(d??R.afterOutsideRef)?.focus())}})]})}function sA(){return!1}function oA(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function hx(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:s="sloppy",referencePress:o=sA,bubbles:a,externalTree:u}=t,l=e.useState("open"),c=e.useState("floatingElement"),{dataRef:d,events:f}=e.context,h=qo(u),m=et(typeof i=="function"?i:()=>!1),x=typeof i=="function"?m:i,E=x!==!1,y=et(()=>s),{escapeKey:v,outsidePress:k}=oA(a),S=b.useRef(!1),T=b.useRef(!1),w=b.useRef(!1),I=b.useRef(!1),A=b.useRef(!1),O=b.useRef(""),_=b.useRef(null),D=Xr(),U=Xr(),F=Xr(),R=et(()=>{U.clear(),d.current.insideReactTree=!1}),j=et(G=>{const re=d.current.floatingContext?.nodeId;return(h?ri(h.nodesRef.current,re):[]).some(pe=>pe.context?.open&&!pe.context.dataRef.current[G])}),B=et(G=>Il(G,e.select("floatingElement"))||Il(G,e.select("domReferenceElement"))),q=et(G=>{o()&&e.setOpen(!1,Mn(mo,G.nativeEvent))}),$=et(G=>{if(!l||!n||!r||G.key!=="Escape")return;const re=Y2(G)?G.nativeEvent:G;if(A.current||re.isComposing||!v&&j("__escapeKeyBubbles"))return;const ne=Mn(ef,re);e.setOpen(!1,ne),ne.isCanceled||G.preventDefault(),!v&&!ne.isPropagationAllowed&&G.stopPropagation()}),X=et(()=>{d.current.insideReactTree=!0,U.start(0,R)}),C=et(G=>{if(!l||!n||G.button!==0)return;const re=Nt(G.nativeEvent);Ke(e.select("floatingElement"),re)&&(S.current||(S.current=!0,T.current=!1))}),se=et(G=>{!l||!n||(G.defaultPrevented||G.nativeEvent.defaultPrevented)&&S.current&&(T.current=!0)});b.useEffect(()=>{function G(re){re.open||(I.current=!1)}return f.on("openchange",G),()=>{f.off("openchange",G)}},[f]),b.useEffect(()=>R,[R]),b.useEffect(()=>{if(!l||!n)return l||(I.current=!1,A.current=!1,O.current="",_.current=null),R;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=k;const G=new En,re=tt(c);function ne(){F.clear(),A.current=!0}function pe(){A.current=!0,F.start(ds?5:0,()=>{A.current=!1})}function Ae(){w.current=!0,G.start(0,()=>{w.current=!1})}function ee(){S.current=!1,T.current=!1}function he(){const J=O.current,H=J==="pen"||!J?"mouse":J,Q=y(),W=typeof Q=="function"?Q():Q;return typeof W=="string"?W:W[H]}function Ie(J){const H=he();return H==="intentional"&&J.type!=="click"||H==="sloppy"&&J.type==="click"}function Me(J){const H=d.current.floatingContext?.nodeId,Q=h&&ri(h.nodesRef.current,H).some(W=>Il(J,W.context?.elements.floating));return B(J)||Q}function Be(J){if(Ie(J)){J.type!=="click"&&!B(J)&&(G.clear(),w.current=!1),R();return}if(d.current.insideReactTree){R();return}const H=Nt(J),Q=`[${no("inert")}]`,W=kt(H)?H.getRootNode():null,Z=Array.from((Lo(W)?W:tt(e.select("floatingElement"))).querySelectorAll(Q)),ae=e.context.triggerElements;if(H&&(ae.hasElement(H)||ae.hasMatchingElement(Se=>Ke(Se,H))))return;let ue=kt(H)?H:null;for(;ue&&!Fi(ue);){const Se=go(ue);if(Fi(Se)||!kt(Se))break;ue=Se}if(!(Z.length&&kt(H)&&!V2(H)&&!Ke(H,e.select("floatingElement"))&&Z.every(Se=>!Ke(ue,Se)))){if(bt(H)&&!("touches"in J)){const Se=Fi(H),me=yn(H),de=/auto|scroll/,ve=Se||de.test(me.overflowX),_e=Se||de.test(me.overflowY),Pe=ve&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,ye=_e&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,Ne=me.direction==="rtl",ce=ye&&(Ne?J.offsetX<=H.offsetWidth-H.clientWidth:J.offsetX>H.clientWidth),ut=Pe&&J.offsetY>H.clientHeight;if(ce||ut)return}if(!Me(J)){if(he()==="intentional"){if(J.detail!==0&&!Ya(J)&&!I.current)return;if(w.current){G.clear(),w.current=!1;return}}typeof x=="function"&&!x(J)||j("__outsidePressBubbles")||(e.setOpen(!1,Mn(Lb,J)),R())}}}function fe(J){he()!=="sloppy"||J.pointerType==="touch"||!e.select("open")||!n||B(J)||Be(J)}function Le(J){if(he()!=="sloppy"||!e.select("open")||!n||B(J))return;const H=J.touches[0];H&&(_.current={startTime:Date.now(),startX:H.clientX,startY:H.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{_.current&&(_.current.dismissOnTouchEnd=!1,_.current.dismissOnMouseDown=!1)}))}function Re(J,H){const Q=Nt(J);if(!Q)return;const W=Ge(Q,J.type,()=>{H(J),W()})}function De(J){O.current="touch",Re(J,Le)}function ke(J){D.clear(),J.type==="pointerdown"&&(J.button===0&&(I.current=!0),O.current=J.pointerType),!(J.type==="mousedown"&&_.current&&!_.current.dismissOnMouseDown)&&Re(J,H=>{H.type==="pointerdown"?fe(H):Be(H)})}function le(J){if(J.type==="pointercancel"&&(I.current=!1),!S.current)return;const H=T.current;if(ee(),he()==="intentional"){if(J.type==="pointercancel"){H&&Ae();return}if(!Me(J)){if(H){Ae();return}typeof x=="function"&&!x(J)||(G.clear(),w.current=!0,R())}}}function Ce(J){if(he()!=="sloppy"||!_.current||B(J))return;const H=J.touches[0];if(!H)return;const Q=Math.abs(H.clientX-_.current.startX),W=Math.abs(H.clientY-_.current.startY),Z=Math.sqrt(Q*Q+W*W);Z>5&&(_.current.dismissOnTouchEnd=!0),Z>10&&(Be(J),D.clear(),_.current=null)}function ge(J){Re(J,Ce)}function Fe(J){he()!=="sloppy"||!_.current||B(J)||(_.current.dismissOnTouchEnd&&Be(J),D.clear(),_.current=null)}function K(J){Re(J,Fe)}const be=yr(r&&yr(Ge(re,"keydown",$),Ge(re,"compositionstart",ne),Ge(re,"compositionend",pe)),E&&yr(Ge(re,"click",ke,!0),Ge(re,"pointerdown",ke,!0),Ge(re,"pointerup",le,!0),Ge(re,"pointercancel",le,!0),Ge(re,"mousedown",ke,!0),Ge(re,"mouseup",le,!0),Ge(re,"touchstart",De,{capture:!0,passive:!0}),Ge(re,"touchmove",ge,{capture:!0,passive:!0}),Ge(re,"touchend",K,{capture:!0,passive:!0})));return()=>{be(),G.clear(),ee(),w.current=!1}},[d,c,r,E,x,l,n,v,k,$,R,y,j,B,h,e,D,F]);const xe=b.useMemo(()=>({onKeyDown:$,onPointerDown:q,onClick:q}),[$,q]),L=b.useMemo(()=>({onKeyDown:$,onPointerDown:se,onMouseDown:se,onClickCapture:X,onMouseDownCapture(G){X(),C(G)},onPointerDownCapture(G){X(),C(G)},onMouseUpCapture:X,onTouchEndCapture:X,onTouchMoveCapture:X}),[$,X,C,se]);return b.useMemo(()=>n?{reference:xe,floating:L,trigger:xe}:{},[n,xe,L])}function aA(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:s,onOpenChange:o}=e,a=t.useState("open"),u=t.useState("activeTriggerElement"),l=t.useState(n?"popupElement":"positionerElement"),c=o;return t.useSyncedValue("floatingId",i),He(()=>{const d={open:a,floatingId:i,referenceElement:u,floatingElement:l};kt(u)&&(d.domReferenceElement=u),r.state.positionReference===r.state.referenceElement&&(d.positionReference=u),r.update(d)},[a,i,u,l,r]),r.context.onOpenChange=c,r.context.nested=s,r}function uA(e,t=!1,n=!1,r=!1){const[i,s]=b.useState(e&&t?"idle":void 0),[o,a]=b.useState(e&&!r);return e&&!o&&(a(!0),s("starting")),!e&&o&&i!=="ending"&&!n&&s("ending"),!e&&!o&&i==="ending"&&s(void 0),He(()=>{if(!e&&o&&i!=="ending"&&n){const u=Rn.request(()=>{s("ending")});return()=>{Rn.cancel(u)}}},[e,o,i,n]),He(()=>{if(!e||t||i===void 0)return;const u=Rn.request(()=>{s(void 0)});return()=>{Rn.cancel(u)}},[t,e,i]),He(()=>{if(!e||!t)return;e&&o&&i!=="idle"&&s("starting");const u=Rn.request(()=>{s("idle")});return()=>{Rn.cancel(u)}},[t,e,o,i]),{mounted:o,setMounted:a,transitionStatus:i}}function lA(e){const{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:s,animateInitialOpen:o}=e,a=et(i),{mounted:u,setMounted:l,transitionStatus:c}=uA(t,!1,!1,o),d=t?!1:r;He(()=>{t&&a(!1)},[t,a]);const f=b.useRef(u),h=b.useRef(!1),m=tS(),x=()=>{f.current=!1,l(!1),s()};He(()=>{f.current=u,h.current&&(h.current=!1,!t&&u&&x())});const E=et(()=>{if(f.current){if(t){h.current=!0,m();return}x()}});return Vu({enabled:u&&!t&&!d,open:t,ref:n,onComplete(){t||E()}}),{mounted:u,transitionStatus:c,preventUnmountingOnClose:d,forceUnmount:E}}const px={tabIndex:-1,[qc]:""};function mx(e){return t=>t==="touch"?e.current:!0}function gx(e,t=!1){const n=Iu(),r=Ku()!=null,i=rr(()=>e(n,r)).current;return aA({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function bx({handle:e,store:t}){return He(()=>e.attachStore(t),[e,t]),null}function cm(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function cA(e,t){const n=b.useRef(null);return et(r=>{const i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;const s=i.store;s.context.triggerElements.getById(i.id)===i.element&&(s.context.triggerElements.delete(i.id),cm(s))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),cm(t))})}function If(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);const s=n?.id??null;let o=e.activeTriggerId,a=e.activeTriggerElement;return(s||t)&&(o=s,a=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:a,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function xx(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function BW(e,t,n,r={}){const i=n.reason,s=i===Jr,o=t&&i===rS,a=!t&&(i===mo||i===ef),u=xx(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const l=()=>{const c=If(e.state,t,n.trigger,u()),d={...r.extraState,...c};o?d.instantType="focus":a?d.instantType="dismiss":s&&(d.instantType=void 0),e.update(d)};s?Kt.flushSync(l):l()}function HW(e,t,n,r){const i=n.useState("isMountedByTrigger",e),s=cA(e,n),o=et(u=>{const l=n.select("open"),c=n.select("activeTriggerId");if(c===e){const d={activeTriggerElement:u,...l?r:null};n.update(d);return}if(c==null&&l&&!n.state.openedWithoutTrigger){const d={activeTriggerId:e??null,activeTriggerElement:u,...r};n.update(d)}}),a=et(u=>{s(u),u&&o(u)});return He(()=>(a(t.current),()=>a(null)),[a,t,n,e]),He(()=>{if(i){const u={activeTriggerElement:t.current,...r};n.update(u)}},[i,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:i}}function yx(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=b.useRef(null),i=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");He(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const u=e.context.triggerElements.size,l={};e.state.triggerCount!==u&&(l.triggerCount=u);const c=e.select("activeTriggerId");let d=null;if(c){const f=e.context.triggerElements.getById(c);if(f)r.current=c,f!==e.state.activeTriggerElement&&(l.activeTriggerElement=f);else{for(const[h,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){l.activeTriggerId=h,l.activeTriggerElement=m,r.current=h;break}l.activeTriggerId===void 0&&(r.current===c?d=c:r.current=null)}}else r.current=null;if(!d&&!c&&!e.state.openedWithoutTrigger&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[h,m]=f.value;l.activeTriggerId=h,l.activeTriggerElement=m,r.current=h}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const f=Mn(nS);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,s,o,a,n])}function Ex(e,t,n,r){const{mounted:i,transitionStatus:s,forceUnmount:o}=lA({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:a=>t.set("preventUnmountingOnClose",a),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return rr(()=>(t.set("mounted",i),null)),t.useSyncedValues({mounted:i,transitionStatus:s}),{forceUnmount:o,transitionStatus:s}}function vx(e,t){e.useSyncedValues(t),He(()=>()=>{e.update({activeTriggerProps:xr,inactiveTriggerProps:xr,popupProps:xr})},[e])}function kx(e,t){He(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),He(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Tx{idMap=new Map;add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}const dA={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class fA extends $u{constructor(t){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:s,...o}=t;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:lx(),nested:r,triggerElements:s},dA),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Q2(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function wx(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new fA({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:xr,inactiveTriggerProps:xr,popupProps:xr}}const ro=e=>e.triggerIdProp??e.activeTriggerId,Za=e=>e.openProp??e.open,dm=e=>(e.popupElement?.id??e.floatingId)||void 0;function Sx(e,t){return t!==void 0&&Za(e)&&ro(e)===t}function hA(e,t){return Sx(e,t)?!0:t!==void 0&&Za(e)&&ro(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const zs={open:Za,mounted:e=>e.mounted,transitionStatus:e=>Za(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ro,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:dm,isTriggerActive:(e,t)=>t!==void 0&&ro(e)===t,isOpenedByTrigger:(e,t)=>Sx(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ro(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>hA(e,t)?dm(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};class Nf{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new En;restTimeout=new En;handleCloseOptions=void 0;static create(){return new Nf}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Ja=new WeakMap;function Xc(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ja.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Ja.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function pA(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t,s=Ja.get(n);s&&s!==e&&Xc(s),Xc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ja.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function mA(e){const t=e.context.dataRef.current,n=rr(()=>t.hoverInteractionState??Nf.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Hu(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function gA(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,s=e.useState("open"),o=e.useState("floatingElement"),a=e.useState("domReferenceElement"),{dataRef:u}=e.context,l=qo(),c=Ku(),d=mA(e),f=Xr(),h=et(()=>XC(u.current.openEvent?.type,d.interactedInside)),m=et(()=>QC(u.current.openEvent?.type)),x=et(()=>{Xc(d)});He(()=>{s||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,x())},[s,d,x]),b.useEffect(()=>x,[x]),He(()=>{if(n&&s&&d.handleCloseOptions?.blockPointerEvents&&m()&&kt(a)&&o){const E=a,y=o,v=tt(o),k=l?.nodesRef.current.find(I=>I.id===c)?.context?.elements.floating;k&&(k.style.pointerEvents="");const S=d.pointerEventsScopeElement!==y?d.pointerEventsScopeElement:null,T=k!==y?k:null,w=d.handleCloseOptions?.getScope?.()??S??T??Zi(E,"[data-rootownerid]")??v.body;return pA(d,{scopeElement:w,referenceElement:E,floatingElement:y}),()=>{x()}}},[n,s,a,o,d,m,l,c,x]),b.useEffect(()=>{if(!n)return;function E(){return!!(l&&c&&ri(l.nodesRef.current,c).length>0)}function y(I){const A=GC(r,"close",d.pointerType),O=()=>{e.setOpen(!1,Mn(Jr,I)),l?.events.emit("floating.closed",I)};A?d.openChangeTimeout.start(A,O):(d.openChangeTimeout.clear(),O())}function v(I){const A=Nt(I);if(!K2(A)){d.interactedInside=!1;return}d.interactedInside=Zi(A,"[aria-haspopup]")!=null}function k(){d.openChangeTimeout.clear(),f.clear(),l?.events.off("floating.closed",T),x()}function S(I){if(E()&&l){l.events.on("floating.closed",T);return}if(W2(I.relatedTarget,e.context.triggerElements))return;const A=u.current.floatingContext?.nodeId??i,O=I.relatedTarget;if(!(l&&A&&kt(O)&&ri(l.nodesRef.current,A,!1).some(D=>Ke(D.context?.elements.floating,O)))){if(d.handler){d.handler(I);return}x(),m()&&!h()&&y(I)}}function T(I){!l||!c||E()||f.start(0,()=>{l.events.off("floating.closed",T),e.setOpen(!1,Mn(Jr,I)),l.events.emit("floating.closed",I)})}const w=o;return yr(w&&Ge(w,"mouseenter",k),w&&Ge(w,"mouseleave",S),w&&Ge(w,"pointerdown",v,!0),()=>{l?.events.off("floating.closed",T)})},[n,o,e,u,r,i,m,h,x,d,l,c,f])}function fm(e,t,n){let{reference:r,floating:i}=e;const s=ln(t),o=Tf(t),a=kf(o),u=Zt(t),l=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}const m=jn(t);return m&&(h[o]+=f*(m==="end"?1:-1)*(n&&l?-1:1)),h}async function bA(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=vr(t,e),m=q1(h),E=a[f?d==="floating"?"reference":"floating":d],y=Qa(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(E)))==null||n?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(k))&&await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1},T=Qa(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:u}):v);return{top:(y.top-T.top+m.top)/S.y,bottom:(T.bottom-y.bottom+m.bottom)/S.y,left:(y.left-T.left+m.left)/S.x,right:(T.right-y.right+m.right)/S.x}}const xA=50,yA=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:bA},u=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=fm(l,r,u),f=r,h=0;const m={};for(let x=0;x<s.length;x++){const E=s[x];if(!E)continue;const{name:y,fn:v}=E,{x:k,y:S,data:T,reset:w}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});c=k??c,d=S??d,m[y]={...m[y],...T},w&&h<xA&&(h++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(l=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:d}=fm(l,f,u)),x=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:m}},EA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:x=!0,...E}=vr(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Zt(i),v=ln(a),k=Zt(a)===a,S=await(u.isRTL==null?void 0:u.isRTL(l.floating)),T=f||(k||!x?[Xa(a)]:eC(a)),w=m!=="none";!f&&w&&T.push(...iC(a,x,m,S));const I=[a,...T],A=await u.detectOverflow(t,E),O=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&O.push(A[y]),d){const R=J2(i,o,S);O.push(A[R[0]],A[R[1]])}if(_=[..._,{placement:i,overflows:O}],!O.every(R=>R<=0)){var D,U;const R=(((D=s.flip)==null?void 0:D.index)||0)+1,j=I[R];if(j&&(!(d==="alignment"?v!==ln(j):!1)||_.every($=>ln($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:R,overflows:_},reset:{placement:j}};let B=(U=_.filter(q=>q.overflows[0]<=0).sort((q,$)=>q.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!B)switch(h){case"bestFit":{var F;const q=(F=_.filter($=>{if(w){const X=ln($.placement);return X===v||X==="y"}return!0}).map($=>[$.placement,$.overflows.filter(X=>X>0).reduce((X,C)=>X+C,0)]).sort(($,X)=>$[1]-X[1])[0])==null?void 0:F[0];q&&(B=q);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}},_x=new Set(["left","top"]);async function vA(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zt(n),a=jn(n),u=ln(n)==="y",l=_x.has(o)?-1:1,c=s&&u?-1:1,d=vr(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),u?{x:h*c,y:f*l}:{x:f*l,y:h*c}}const kA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,u=await vA(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:o}}}}},TA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:v=>{let{x:k,y:S}=v;return{x:k,y:S}}},...l}=vr(e,t),c={x:n,y:r},d=await s.detectOverflow(t,l),f=ln(i),h=vf(f);let m=c[h],x=c[f];const E=(v,k)=>z1(k+d[v==="y"?"top":"left"],k,k-d[v==="y"?"bottom":"right"]);o&&(m=E(h,m)),a&&(x=E(f,x));const y=u.fn({...t,[h]:m,[f]:x});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[f]:a}}}}}},wA=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:s,placement:o,rects:a,middlewareData:u}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=vr(e,t),f={x:i,y:s},h=ln(o),m=vf(h);let x=f[m],E=f[h];const y=vr(l,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(r=y.crossAxis)!=null?r:0};if(c){const T=m==="y"?"height":"width",w=a.reference[m]-a.floating[T]+v.mainAxis,I=a.reference[m]+a.reference[T]-v.mainAxis;x<w?x=w:x>I&&(x=I)}if(d){var k,S;const T=m==="y"?"width":"height",w=_x.has(Zt(o)),I=a.reference[h]-a.floating[T]+(w&&((k=u.offset)==null?void 0:k[h])||0)+(w?0:v.crossAxis),A=a.reference[h]+a.reference[T]+(w?0:((S=u.offset)==null?void 0:S[h])||0)-(w?v.crossAxis:0);E<I?E=I:E>A&&(E=A)}return{[m]:x,[h]:E}}}},SA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=vr(e,t),u=await i.detectOverflow(t,a),l=Zt(n),c=jn(n),d=ln(n)==="y",{width:f,height:h}=r.floating;let m,x;l==="top"||l==="bottom"?(m=l,x=c===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(x=l,m=c==="end"?"top":"bottom");const E=h-u.top-u.bottom,y=f-u.left-u.right,v=Ji(h-u[m],E),k=Ji(f-u[x],y),S=t.middlewareData.shift,T=!S;let w=v,I=k;S!=null&&S.enabled.x&&(I=y),S!=null&&S.enabled.y&&(w=E),T&&!c&&(d?I=f-2*er(u.left,u.right):w=h-2*er(u.top,u.bottom)),await o({...t,availableWidth:I,availableHeight:w});const A=await i.getDimensions(s.floating);return f!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function Cx(e){const t=yn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=bt(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Ga(n)!==s||Ga(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Rf(e){return kt(e)?e:e.contextElement}function zi(e){const t=Rf(e);if(!bt(t))return tr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Cx(t);let o=(s?Ga(n.width):n.width)/r,a=(s?Ga(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const _A=tr(0);function Ax(e){const t=Ht(e);return!Mb()||!t.visualViewport?_A:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CA(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ht(e)}function ii(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Rf(e);let o=tr(1);t&&(r?kt(r)&&(o=zi(r)):o=zi(e));const a=CA(s,n,r)?Ax(s):tr(0);let u=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s&&r){const f=Ht(s),h=kt(r)?Ht(r):r;let m=f,x=op(m);for(;x&&h!==m;){const E=zi(x),y=x.getBoundingClientRect(),v=yn(x),k=y.left+(x.clientLeft+parseFloat(v.paddingLeft))*E.x,S=y.top+(x.clientTop+parseFloat(v.paddingTop))*E.y;u*=E.x,l*=E.y,c*=E.x,d*=E.y,u+=k,l+=S,m=Ht(x),x=op(m)}}return Qa({width:c,height:d,x:u,y:l})}function Yu(e,t){const n=Nu(e).scrollLeft;return t?t.left+n:ii(_r(e)).left+n}function Ix(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yu(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function AA(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=_r(r),a=t?tf(t.floating):!1;if(r===o||a&&s)return n;let u={scrollLeft:0,scrollTop:0},l=tr(1);const c=tr(0),d=bt(r);if((d||!s)&&((Wt(r)!=="body"||nf(o))&&(u=Nu(r)),d)){const h=ii(r);l=zi(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!s?Ix(o,u):tr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x+f.x,y:n.y*l.y-u.scrollTop*l.y+c.y+f.y}}function IA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function NA(e){const t=Nu(e),n=e.ownerDocument.body,r=er(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=er(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+Yu(e);const o=-t.scrollTop;return yn(n).direction==="rtl"&&(s+=er(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:o}}const RA=25;function OA(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=Ht(e),s=_r(e),o=i.visualViewport;let a=s.clientWidth,u=s.clientHeight,l=0,c=0;if(o){const f=!Mb()||t==="fixed";r?f||(l=-o.offsetLeft,c=-o.offsetTop):(a=o.width,u=o.height,f&&(l=o.offsetLeft,c=o.offsetTop))}if(Yu(s)<=0){const f=s.ownerDocument,h=f.body,m=getComputedStyle(h),x=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,E=Math.abs(s.clientWidth-h.clientWidth-x),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?E/2:E;y<=RA&&(a-=y)}return{width:a,height:u,x:l,y:c}}function LA(e,t){const n=ii(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zi(e),o=e.clientWidth*s.x,a=e.clientHeight*s.y,u=i*s.x,l=r*s.y;return{width:o,height:a,x:u,y:l}}function hm(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=OA(e,n,t);else if(t==="document")r=NA(_r(e));else if(kt(t))r=LA(t,n);else{const i=Ax(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qa(r)}function PA(e,t){const n=t.get(e);if(n)return n;let r=Ac(e,[],!1).filter(a=>kt(a)&&Wt(a)!=="body"),i=null;const s=yn(e).position==="fixed";let o=s?go(e):e;for(;kt(o)&&!Fi(o);){const a=yn(o),u=Pb(o),l=i?i.position:s?"fixed":"";!u&&(l==="fixed"||l==="absolute"&&a.position==="static")?r=r.filter(d=>d!==o):i=a,o=go(o)}return t.set(e,r),r}function MA(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?tf(t)?[]:PA(t,this._c):[].concat(n),r],a=hm(t,o[0],i);let u=a.top,l=a.right,c=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const h=hm(t,o[f],i);u=er(h.top,u),l=Ji(h.right,l),c=Ji(h.bottom,c),d=er(h.left,d)}return{width:l-d,height:c-u,x:d,y:u}}function DA(e){const{width:t,height:n}=Cx(e);return{width:t,height:n}}function FA(e,t,n){const r=bt(t),i=_r(t),s=n==="fixed",o=ii(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=tr(0);if((r||!s)&&((Wt(t)!=="body"||nf(i))&&(a=Nu(t)),r)){const f=ii(t,!0,s,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}!r&&i&&(u.x=Yu(i));const l=i&&!r&&!s?Ix(i,a):tr(0),c=o.left+a.scrollLeft-u.x-l.x,d=o.top+a.scrollTop-u.y-l.y;return{x:c,y:d,width:o.width,height:o.height}}function Dl(e){return yn(e).position==="static"}function pm(e,t){if(!bt(e)||yn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _r(e)===n&&(n=n.ownerDocument.body),n}function Nx(e,t){const n=Ht(e);if(tf(e))return n;if(!bt(e)){let i=go(e);for(;i&&!Fi(i);){if(kt(i)&&!Dl(i))return i;i=go(i)}return n}let r=pm(e,t);for(;r&&iS(r)&&Dl(r);)r=pm(r,t);return r&&Fi(r)&&Dl(r)&&!Pb(r)?n:r||sS(e)||n}const jA=async function(e){const t=this.getOffsetParent||Nx,n=this.getDimensions,r=await n(e.floating);return{reference:FA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function BA(e){return yn(e).direction==="rtl"}const HA={convertOffsetParentRelativeRectToViewportRelativeRect:AA,getDocumentElement:_r,getClippingRect:MA,getOffsetParent:Nx,getElementRects:jA,getClientRects:IA,getDimensions:DA,getScale:zi,isElement:kt,isRTL:BA};function Rx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UA(e,t,n){let r=null,i;const s=_r(e);function o(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:h,top:m,width:x,height:E}=f;if(c||t(),!x||!E)return;const y=Yr(m),v=Yr(s.clientWidth-(h+x)),k=Yr(s.clientHeight-(m+E)),S=Yr(h),w={rootMargin:-y+"px "+-v+"px "+-k+"px "+-S+"px",threshold:er(0,Ji(1,d))||1};let I=!0;function A(O){const _=O[0].intersectionRatio;if(!Rx(f,e.getBoundingClientRect()))return a();if(_!==d){if(!I)return a();_?a(!1,_):i=setTimeout(()=>{a(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(A,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(A,w)}r.observe(e)}const u=Ht(e),l=()=>a(n);return u.addEventListener("resize",l),a(!0),()=>{u.removeEventListener("resize",l),o()}}function mm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Rf(e),c=i||s?[...l?Ac(l):[],...t?Ac(t):[]]:[];c.forEach(y=>{i&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const d=l&&a?UA(l,n,s):null;let f=-1,h=null;o&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var k;(k=h)==null||k.observe(t)})),n()}),l&&!u&&h.observe(l),t&&h.observe(t));let m,x=u?ii(e):null;u&&E();function E(){const y=ii(e);x&&!Rx(x,y)&&n(),x=y,m=requestAnimationFrame(E)}return n(),()=>{var y;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,u&&cancelAnimationFrame(m)}}const $A=kA,zA=TA,qA=EA,WA=SA,VA=wA,KA=(e,t,n)=>{const r=new Map,i=n??{},s={...HA,...i.platform,_c:r};return yA(e,t,{...i,platform:s})};var YA=typeof document<"u",GA=function(){},Pa=YA?b.useLayoutEffect:GA;function eu(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(!eu(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;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!eu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ox(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gm(e,t){const n=Ox(e);return Math.round(t*n)/n}function Fl(e){const t=b.useRef(e);return Pa(()=>{t.current=e}),t}function XA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[c,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=b.useState(r);eu(f,r)||h(r);const[m,x]=b.useState(null),[E,y]=b.useState(null),v=b.useCallback($=>{$!==w.current&&(w.current=$,x($))},[]),k=b.useCallback($=>{$!==I.current&&(I.current=$,y($))},[]),S=s||m,T=o||E,w=b.useRef(null),I=b.useRef(null),A=b.useRef(c),O=u!=null,_=Fl(u),D=Fl(i),U=Fl(l),F=b.useCallback(()=>{if(!w.current||!I.current)return;const $={placement:t,strategy:n,middleware:f};D.current&&($.platform=D.current),KA(w.current,I.current,$).then(X=>{const C={...X,isPositioned:U.current!==!1};R.current&&!eu(A.current,C)&&(A.current=C,Kt.flushSync(()=>{d(C)}))})},[f,t,n,D,U]);Pa(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[l]);const R=b.useRef(!1);Pa(()=>(R.current=!0,()=>{R.current=!1}),[]),Pa(()=>{if(S&&(w.current=S),T&&(I.current=T),S&&T){if(_.current)return _.current(S,T,F);F()}},[S,T,F,_,O]);const j=b.useMemo(()=>({reference:w,floating:I,setReference:v,setFloating:k}),[v,k]),B=b.useMemo(()=>({reference:S,floating:T}),[S,T]),q=b.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const X=gm(B.floating,c.x),C=gm(B.floating,c.y);return a?{...$,transform:"translate("+X+"px, "+C+"px)",...Ox(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:C}},[n,a,B.floating,c.x,c.y]);return b.useMemo(()=>({...c,update:F,refs:j,elements:B,floatingStyles:q}),[c,F,j,B,q])}const QA=(e,t)=>{const n=$A(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZA=(e,t)=>{const n=zA(e);return{name:n.name,fn:n.fn,options:[e,t]}},JA=(e,t)=>({fn:VA(e).fn,options:[e,t]}),eI=(e,t)=>{const n=qA(e);return{name:n.name,fn:n.fn,options:[e,t]}},tI=(e,t)=>{const n=WA(e);return{name:n.name,fn:n.fn,options:[e,t]}};function nI(e){const{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState("referenceElement"),s=r.useState("floatingElement"),o=r.useState("domReferenceElement"),a=r.useState("open"),u=r.useState("floatingId"),[l,c]=b.useState(null),d=b.useRef(null),f=qo(n),h=b.useMemo(()=>({reference:i,floating:s,domReference:o}),[i,s,o]),m=XA({...e,elements:{...h,...l&&{reference:l}}}),x=b.useCallback(k=>{const S=kt(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;c(S),m.refs.setReference(S)},[m.refs]),E=b.useMemo(()=>({...m.refs,setPositionReference:x,domReference:d}),[m.refs,x]),y=b.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=b.useMemo(()=>({...m,dataRef:r.context.dataRef,open:a,onOpenChange:r.setOpen,events:r.context.events,floatingId:u,refs:E,elements:y,nodeId:t,rootStore:r}),[m,E,y,t,r,a,u]);return He(()=>{o&&(d.current=o)},[o]),He(()=>{r.context.dataRef.current.floatingContext=v;const k=f?.nodesRef.current.find(S=>S.id===t);k&&(k.context=v)}),b.useMemo(()=>({...m,context:v,refs:E,elements:y,rootStore:r}),[m,E,y,v,r])}const rI=b.createContext(void 0);function iI(){return b.useContext(rI)?.direction??"ltr"}const sI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:u}=t,{element:l,padding:c=0}=vr(e,t)||{};if(l==null)return{};const d=q1(c),f={x:n,y:r},h=Tf(i),m=kf(h),x=await o.getDimensions(l),E=h==="y",y=E?"top":"left",v=E?"bottom":"right",k=E?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[h]-f[h]-s.floating[m],T=f[h]-s.reference[h],w=a.floating[k]||s.floating[m],I=S/2-T/2,A=w/2-x[m]/2-1,O=Math.min(d[y],A),_=Math.min(d[v],A),D=O,U=w-x[m]-_,F=w/2-x[m]/2+I,R=z1(D,F,U),j=!u.arrow&&jn(i)!=null&&F!==R&&s.reference[m]/2-(F<D?O:_)-x[m]/2<0,B=j?F<D?F-D:F-U:0;return{[h]:f[h]+B,data:{[h]:R,centerOffset:F-R-B,...j&&{alignmentOffset:B}},reset:j}}}),oI=(e,t)=>{const{name:n,fn:r}=sI(e);return{name:n,fn:r,options:[e,t]}},aI={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,s=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},uI={sideX:"left",sideY:"top"},lI="--available-width",cI="--available-height",dI="--anchor-width",fI="--anchor-height",hI="--transform-origin",bm=lI,xm=cI;function Lx(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function ym(e,t,n){const{rects:r,placement:i}=e;return{side:Lx(t,Zt(i),n),align:jn(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function pI(e){return mI(e,nI)}function mI(e,t){const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,collisionBoundary:u,collisionPadding:l=5,sticky:c=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:h,keepMounted:m=!1,floatingRootContext:x,mounted:E,collisionAvoidance:y,shift:v,nodeId:k,adaptiveOrigin:S,lazyFlip:T=!1,externalTree:w}=e,I=y.side||"flip",A=y.align||"flip",O=y.fallbackAxisSide||"end",_=v?.crossAxis??!1,D=v?.rootBoundary,U=typeof n=="function"?n:void 0,F=et(U),R=U?F:n,j=Gn(n),B=Gn(E),$=iI()==="rtl",[X,C]=b.useState(null);!E&&X!==null&&C(null);const se=T==="placement",xe=X?Zt(X):null,L=X&&se?jn(X)||"center":null,G=xe||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[i],re=L||o,ne=re==="center"?G:`${G}-${re}`;let pe=l;typeof pe=="number"?pe={top:pe,right:pe,bottom:pe,left:pe}:pe&&(pe={top:pe.top||0,right:pe.right||0,bottom:pe.bottom||0,left:pe.left||0});const Ae=1,ee=i==="bottom"?Ae:0,he=i==="top"?Ae:0,Ie=i==="right"?Ae:0,Me=i==="left"?Ae:0,Be={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:pe},fe=b.useRef(null),Le=Gn(s),Re=Gn(a),De=typeof s!="function"?s:0,ke=typeof a!="function"?a:0,le=[];h&&le.push(h),le.push(QA(ze=>{const ot=ym(ze,i,$),Mt=typeof Le.current=="function"?Le.current(ot):Le.current,ct=typeof Re.current=="function"?Re.current(ot):Re.current;return{mainAxis:Mt,crossAxis:ct,alignmentAxis:ct}},[De,ke,$,i]));const Ce=A==="none"&&I!=="shift",ge=!Ce&&(c||_||I==="shift"),Fe=I==="none"?null:eI({...Be,padding:{top:pe.top+Ae+ee,right:pe.right+Ae+Me,bottom:pe.bottom+Ae+he,left:pe.left+Ae+Ie},mainAxis:!_&&I==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:O}),K=Ce?null:ZA({...Be,rootBoundary:D,mainAxis:A!=="none",crossAxis:ge,limiter:c||_?void 0:JA(ze=>{if(!fe.current)return{};const{width:ot,height:Mt}=fe.current.getBoundingClientRect(),ct=ln(Zt(ze.placement)),dn=ct==="y"?ot:Mt,Dt=ct==="y"?pe.left+pe.right:pe.top+pe.bottom;return{offset:dn/2+Dt/2}})},[Be,c,_,D,pe,A]);I==="shift"||A==="shift"||re==="center"?le.push(K,Fe):le.push(Fe,K),le.push(tI({...Be,apply({elements:{floating:ze},availableWidth:ot,availableHeight:Mt,rects:ct}){if(!B.current)return;const dn=ze.style;dn.setProperty(bm,`${ot}px`),dn.setProperty(xm,`${Mt}px`);const Dt=Ht(ze).devicePixelRatio||1,{x:Lr,y:Vn,width:Pr,height:At}=ct.reference,Mr=(Math.round((Lr+Pr)*Dt)-Math.round(Lr*Dt))/Dt,or=(Math.round((Vn+At)*Dt)-Math.round(Vn*Dt))/Dt;dn.setProperty(dI,`${Mr}px`),dn.setProperty(fI,`${or}px`)}}),oI(ze=>({element:fe.current||tt(ze.elements.floating).createElement("div"),padding:fe.current?d:0}),[d]),{name:"transformOrigin",fn(ze){const{elements:{floating:ot},middlewareData:Mt,placement:ct,platform:dn,rects:Dt,y:Lr}=ze,Vn=Zt(ct),Pr=jn(ct),At=ln(Vn)==="y",Mr=fe.current,or=typeof s=="function"?s(ym(ze,i,$)):s;let Dr;if(!Mr&&Pr&&Math.abs(At?Mt.shift?.x||0:Mt.shift?.y||0)<=1)Dr=Pr==="start"===(At&&dn.isRTL?.(ot)===!0)?"100%":"0%";else{const V=At?Mt.arrow?.x||0:Mt.arrow?.y||0,Ee=At?Mr?.clientWidth||0:Mr?.clientHeight||0;Dr=`${V+Ee/2}px`}let vs=Vn==="top"||Vn==="left"?`calc(100% + ${or}px)`:`${-or}px`;return ge&&At&&Math.abs(Mt.shift?.y||0)>or&&(vs=`${Dt.reference.y+Dt.reference.height/2-Lr}px`),ot.style.setProperty(hI,At?`${Dr} ${vs}`:`${vs} ${Dr}`),{}}},aI,S),He(()=>{!E&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[E,x]);const be=b.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:J,elements:H,x:Q,y:W,middlewareData:Z,update:ae,placement:ue,context:Se,isPositioned:me,floatingStyles:de}=t({rootContext:x,open:m?E:void 0,placement:ne,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...ze)=>mm(...ze,be),nodeId:k,externalTree:w}),{sideX:ve,sideY:_e}=Z.adaptiveOrigin||uI,Pe=me?r:"fixed",ye=b.useMemo(()=>{let ze;return me?S?ze={position:Pe,[ve]:Q,[_e]:W}:ze={...de,position:Pe}:ze={position:Pe,top:0,left:0},ze[bm]="100vw",ze[xm]="100vh",me||(ze.opacity=0),ze},[S,Pe,ve,Q,_e,W,de,me]),Ne=b.useRef(null);He(()=>{if(!E)return;const ze=j.current,ot=typeof ze=="function"?ze():ze,ct=(Em(ot)?ot.current:ot)||null||null;ct!==Ne.current&&(J.setPositionReference(ct),Ne.current=ct)},[E,J,R,j]),b.useEffect(()=>{if(!E)return;const ze=j.current;typeof ze!="function"&&Em(ze)&&ze.current!==Ne.current&&(J.setPositionReference(ze.current),Ne.current=ze.current)},[E,J,R,j]),b.useEffect(()=>{if(m&&E&&H.reference&&H.floating)return mm(H.reference,H.floating,ae,be)},[m,E,H,ae,be]);const ce=Zt(ue),ut=Lx(i,ce,$),rt=jn(ue)||"center",qn=!!Z.hide?.referenceHidden;He(()=>{T&&E&&me&&(ce!==G||se&&rt!==re)&&C(ue)},[T,se,E,me,ue,ce,rt,G,re]);const Wn=b.useMemo(()=>({position:"absolute",top:Z.arrow?.y,left:Z.arrow?.x}),[Z.arrow]),pt=Z.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:ye,arrowStyles:Wn,arrowRef:fe,arrowUncentered:pt,side:ut,align:rt,physicalSide:ce,anchorHidden:qn,refs:J,context:Se,isPositioned:me,update:ae}),[ye,Wn,fe,pt,ut,rt,ce,qn,J,Se,me,ae])}function Em(e){return e!=null&&"current"in e}function Px(e){return e==="starting"?yC:xr}function gI(e,t,{styles:n,transitionStatus:r,props:i,refs:s,hidden:o,inert:a=!1}){const u={...n};return a&&(u.pointerEvents="none"),Un("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:u},Px(r),i],stateAttributesMapping:Ef})}function bI(){const e=Uu(),t=e.useState("toasts");return b.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function xI(){const e=new Set;function t(n){e.forEach(r=>r(n))}return{" subscribe":function(r){return e.add(r),()=>{e.delete(r)}},add(n){const r=n.id||D1("toast"),i={...n,id:r,transitionStatus:"starting"};return t({action:"add",options:i}),r},close(n){t({action:"close",options:{id:n}})},update(n,r){t({action:"update",options:{id:n,updates:r}})},promise(n,r){let i=n;return t({action:"promise",options:{...r,promise:n,setPromise(s){i=s}}}),i}}}async function nr(e){if(vw()){await kw.writeClipboard(e);return}try{await navigator.clipboard.writeText(e);return}catch{}if(bS()&&await xS.writeClipboard(e))return;const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select();try{if(!document.execCommand("copy"))throw new Error("Clipboard fallback rejected the copy command.")}finally{t.remove()}}const yI=[137,80,78,71,13,10,26,10];function Mx(e){return typeof e.arrayBuffer=="function"?e.arrayBuffer().then(t=>new Uint8Array(t)):new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(new Uint8Array(r.result))},r.onerror=()=>{n(r.error??new Error("Failed to read blob"))},r.readAsArrayBuffer(e)})}async function Dx(e){if(e.size<8)return!1;const t=typeof e.slice=="function"?e.slice(0,8):e,n=(await Mx(t)).subarray(0,8);return n.length<8?!1:yI.every((r,i)=>n[i]===r)}async function EI(e){let t;const n=Promise.resolve(e).then(async i=>{if(i.type!=="image/png"||!await Dx(i))throw new Error("Clipboard image write requires a valid PNG image");return i});n.catch(i=>{t=i});const r=typeof navigator<"u"?navigator.clipboard:void 0;if(r===void 0||typeof r.write!="function"||typeof ClipboardItem>"u")throw new Error("Clipboard image write is unavailable");try{await r.write([new ClipboardItem({"image/png":n})])}catch(i){if(t!==void 0)throw t instanceof Error?t:new Error("Clipboard image preparation failed",{cause:t});if(!(i instanceof TypeError))throw i;const s=await n;await r.write([new ClipboardItem({"image/png":s})])}}const Of=3600,Fx=5,vI=8e3,es=xI();let wt=[],vm=1;const kI=new Set;function vo(){for(const e of kI)e()}function TI(e){wt.some(t=>t.id===e)&&(wt=wt.filter(t=>t.id!==e),vo())}function jx(e){return e.tone==="error"?0:e.durationMs??Of}function Bx(e){es.add({id:String(e.id),title:e.text,type:e.undo!==void 0?"undo":e.tone,timeout:jx(e),priority:e.tone==="error"?"high":"low",data:e,onClose:()=>{TI(e.id)}})}function wI(){return wt}function km(e){return e.undo!==void 0?null:JSON.stringify([e.tone,e.text,e.detail??"",e.code??"",e.requestId??""])}function kr(e){const t=km(e);if(t!==null){const a=wt.findIndex(u=>km(u)===t);if(a!==-1){const u=wt[a],l={...e,id:u.id};return wt=[...wt.slice(0,a),...wt.slice(a+1),l],es.update(String(u.id),{title:l.text,type:l.tone,timeout:jx(l),priority:l.tone==="error"?"high":"low",data:l}),vo(),u.id}}const n=vm;vm+=1;const r={...e,id:n},i=[...wt,r],s=Math.max(0,i.length-Fx),o=i.slice(0,s);wt=i.slice(s);for(const a of o)es.close(String(a.id));return Bx(r),vo(),n}function UW(e){return kr({tone:"success",text:e.text,durationMs:e.durationMs??vI,undo:{label:e.label,run:async()=>{try{await e.undo()}catch(n){kr({tone:"error",text:e.undoFailedText===void 0?Qc(n):`${e.undoFailedText}: ${Qc(n)}`})}}}})}function Qc(e){return Ua(e)}function Lf(e,t){const n=r=>{kr({tone:"error",text:`${e}: ${Qc(r)}`,retry:{run:()=>{Lf(e,t)}}})};try{Promise.resolve(t()).catch(n)}catch(r){n(r)}}function ma(e){wt.some(t=>t.id===e)&&(wt=wt.filter(t=>t.id!==e),es.close(String(e)),vo())}function $W(){const e=wt.filter(t=>t.tone==="error");if(e.length!==0){wt=wt.filter(t=>t.tone!=="error");for(const t of e)es.close(String(t.id));vo()}}const Tm={success:"border-success/40 text-success",info:"border-hairline text-ink",error:"border-danger/40 text-danger"},wm={success:"check",info:null,error:"warning"};function SI({toastObj:e,toast:t,paused:n}){const{t:r}=je(),[i,s]=b.useState(!1),[o,a]=b.useState(!1),u=t.durationMs??Of,l=[t.code!==void 0?`code ${t.code}`:void 0,t.requestId!==void 0?`req ${t.requestId}`:void 0].filter(Boolean).join(" · "),c=[t.text,l!==""?l:void 0,t.detail!==void 0?t.detail:void 0].filter(Boolean).join(`
53
+
54
+ `),d=()=>{nr(c).then(()=>{a(!0),setTimeout(()=>{a(!1)},1500)})};return p.jsxs(jC,{toast:e,role:"status","data-toast":t.undo!==void 0?"undo":t.tone,className:`anim-enter pointer-events-auto relative flex w-88 max-w-full flex-col overflow-hidden rounded-xl border bg-panel p-2 shadow-[0_8px_24px_-10px_rgba(28,25,23,0.3)] ${t.undo!==void 0?Tm.info:Tm[t.tone]}`,children:[p.jsxs("div",{className:"flex items-start gap-2",children:[t.undo===void 0&&wm[t.tone]!==null?p.jsx("span",{"aria-hidden":!0,className:"mt-[2px] flex w-3.5 shrink-0 justify-center",children:p.jsx(Je,{name:wm[t.tone]})}):null,p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx($C,{className:"text-[12px] leading-snug break-words",children:t.text}),l!==""?p.jsx("p",{className:"mt-0.5 font-mono text-[10px] opacity-75",children:l}):null]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.tone==="error"?p.jsxs("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 rounded-md bg-danger/10 px-2 py-0.5 text-[11px] font-medium text-danger transition-colors hover:bg-danger/15 focus-visible:outline-2 focus-visible:outline-selected-ink",title:c,children:[o?p.jsx(Je,{name:"check",size:12}):null,r(o?"connect.desktopCopied":"contextMenu.copy")]}):null,t.action!==void 0?p.jsx("button",{type:"button","data-toast-action":!0,onClick:()=>{ma(t.id),t.action?.run()},className:"rounded-md px-2 py-0.5 text-[12px] font-semibold text-selected-ink transition-colors hover:bg-selected-ink/10 focus-visible:outline-2 focus-visible:outline-selected-ink pointer-coarse:py-2",children:t.action.label}):null,t.undo!==void 0?p.jsx("button",{type:"button","data-toast-undo":!0,onClick:()=>{ma(t.id),t.undo?.run()},className:"rounded-md px-2 py-0.5 text-[12px] font-semibold text-selected-ink transition-colors hover:bg-selected-ink/10 focus-visible:outline-2 focus-visible:outline-selected-ink pointer-coarse:py-2",children:t.undo.label??r("toast.undo")}):null,t.retry!==void 0?p.jsx("button",{type:"button",onClick:()=>{ma(t.id),t.retry?.run()},className:"rounded-md border border-current px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-75",children:t.retry.label??r("common.retry")}):null,t.undo!==void 0||t.tone==="error"?p.jsx(zC,{"aria-label":r("toast.dismissAria"),onClick:()=>{ma(t.id)},className:t.undo!==void 0?"flex h-6 w-6 items-center justify-center rounded-md text-ink-faint transition-colors hover:text-ink pointer-coarse:h-9 pointer-coarse:w-9":"flex h-5 w-5 items-center justify-center rounded-md transition-opacity hover:opacity-70",children:p.jsx(Je,{name:"close",size:12})}):null]})]}),t.undo!==void 0?p.jsx("span",{"aria-hidden":!0,"data-toast-countdown":!0,className:"toast-countdown absolute inset-x-0 bottom-0 h-[2px] origin-left bg-selected-ink/35",style:{animationDuration:`${u}ms`,animationPlayState:n?"paused":"running"}}):null,t.detail!==void 0&&t.detail!==""?p.jsxs("div",{className:"mt-1.5 pt-1 border-t border-hairline/50",children:[p.jsx("button",{type:"button",onClick:()=>{s(f=>!f)},className:"text-[10px] font-medium underline opacity-80 hover:opacity-100",children:r(i?"cb.collapse":"ia.detail.details")}),i?p.jsx("pre",{className:"mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap rounded bg-paper/60 p-1.5 font-mono text-[10px] text-ink-soft",children:t.detail}):null]}):null]})}let tu=[];const Zc=new Set;function _I(e){return Zc.add(e),()=>{Zc.delete(e)}}function Sm(){return tu.at(-1)??null}function _m(e){tu=e;for(const t of Zc)t()}function zW({className:e}){const[t,n]=b.useState(null);return b.useLayoutEffect(()=>{if(t!==null)return _m([...tu,t]),()=>{_m(tu.filter(r=>r!==t))}},[t]),p.jsx("div",{ref:n,"data-toast-anchor":"",className:e})}function CI({anchor:e}){const{toasts:t}=bI(),[n,r]=b.useState(!1);if(b.useEffect(()=>{const s=wI();if(s.length===0)return;const o=new Set(t.map(a=>a.id));for(const a of s)o.has(String(a.id))||Bx(a)},[]),t.length===0)return null;const i=p.jsx(gC,{"data-toast-stack":e===null?"viewport":"anchored",onPointerEnter:()=>{r(!0)},onPointerLeave:()=>{r(!1)},onFocusCapture:()=>{r(!0)},onBlurCapture:s=>{s.currentTarget.contains(s.relatedTarget)||r(!1)},className:`pointer-events-none flex flex-col items-end gap-2 ${e===null?"fixed right-4 bottom-[max(1rem,var(--kiki-safe-bottom-inset))] z-[60]":"absolute right-0 bottom-0 max-w-full"}`,children:t.map(s=>{const o=s.data;return o===void 0?null:p.jsx(SI,{toastObj:s,toast:o,paused:n},s.id)})});return e===null?i:p.jsx(VC,{container:e,children:i})}function qW(){const e=b.useSyncExternalStore(_I,Sm,Sm);return p.jsx(hC,{toastManager:es,timeout:Of,limit:Fx,children:p.jsx(CI,{anchor:e})})}const Qt=new Map,AI=15e3;function WW(){return b.useSyncExternalStore(jS,rn,rn)}function VW(e,t,n){const r=yt(e),i=Qt.get(r);i!==void 0&&(Qt.delete(r),i.handle.cancel());const s=n?.syncLegacy===!0,o=zS(e,t),a={ref:e,cursor:t,at:Date.now(),syncLegacy:s,handle:o};Qt.set(r,a);let u=!1;return{commit:()=>{u||(u=!0,Qt.get(r)===a&&Qt.delete(r),o.commit(),s&&Jc(e,t.seq))},cancel:()=>{u||(u=!0,Qt.get(r)===a&&Qt.delete(r),o.cancel())}}}function KW(e,t=Date.now()){const n=yt(e),r=Qt.get(n);return r===void 0?!1:t-r.at>AI?(Qt.delete(n),r.handle.cancel(),!1):!0}function YW(e,t,n=!1){const r=yt(e),i=Qt.get(r);return i!==void 0&&(Qt.delete(r),i.handle.commit()),t!==void 0?(BS(e,t),(n||i?.syncLegacy===!0)&&Jc(e,t.seq)):i!==void 0&&(n||i.syncLegacy)&&Jc(e,i.cursor.seq),i!==void 0}function GW(e){const t=yt(e),n=Qt.get(t);n!==void 0&&(Qt.delete(t),n.handle.cancel())}function Jc(e,t){!Number.isFinite(t)||t<0||(e.kind==="room"?t_(e.id,t):qb(e.id,t))}function XW(e,t,n){const r=Object.entries(n);if(r.length===0)return e;let i;for(const[s,o]of r){if(!Number.isFinite(o))continue;const a=s.startsWith("room:")?{spaceKey:t,kind:"room",id:s.slice(5)}:{spaceKey:t,kind:"session",id:s};if(a.id==="")continue;const u=yt(a);e[u]===void 0&&(i??={...e},i[u]={seq:Math.max(0,Math.trunc(o)),updatedAt:0})}return i??e}const Hx=b.createContext(null);function Ux(){return b.useContext(Hx)}function QW({children:e}){const{client:t,localClient:n,config:r}=Au(),i=Dw(),s=b.useRef(i);s.current=i;const a=b.useSyncExternalStore(Tw,Yd,ww).requestTimeoutSeconds*1e3,l=(n??t).baseUrl??r.url,c=r.token,d=b.useRef(new Map),f=b.useRef(new Set),h=b.useCallback(S=>{s.current?.evictScope?.(S.client),S.queryClient.clear(),S.queryClient.unmount(),S.client.dispose?.().catch?.(()=>{})},[]),m=b.useCallback(S=>{const T=d.current.get(S);T!==void 0&&(d.current.delete(S),h(T))},[h]),x=b.useCallback(S=>{for(const[T,w]of Array.from(d.current.entries()))S.has(T)||(d.current.delete(T),h(w))},[h]);b.useEffect(()=>{const S=`${l}|${c}|`;for(const[T,w]of Array.from(d.current.entries()))w.generationKey.startsWith(S)||(d.current.delete(T),h(w))},[l,c,h]),b.useEffect(()=>{const S=d.current;return()=>{for(const T of S.values())h(T);S.clear()}},[h]);const E=b.useCallback(S=>{if(S.trim()==="")return null;const T=`${l}|${c}|${S}`,w=d.current.get(S);if(w!==void 0&&w.generationKey===T)return w;w!==void 0&&(d.current.delete(S),h(w));const I=new Fw({defaultOptions:{queries:{retry:1,staleTime:0,refetchOnWindowFocus:!1}}}),A=Bb({endpoint:l,token:c,connectionId:S,timeoutMs:a,onSessionMutation:_=>{jw(I,_);for(const D of f.current)D(S,_)}}),O={connectionId:S,generationKey:T,client:A,queryClient:I,meta:null,metaPromise:null};return d.current.set(S,O),O},[l,c,a,h]),y=b.useCallback(S=>E(S)?.client??null,[E]),v=b.useCallback(S=>(f.current.add(S),()=>{f.current.delete(S)}),[]),k=b.useMemo(()=>({getOrCreateEntry:E,getOrCreateClient:y,revoke:m,retainOnly:x,subscribeMutation:v}),[E,y,m,x,v]);return p.jsx(Hx.Provider,{value:k,children:e})}function ZW({connectionId:e,remoteConnections:t,remoteLoaded:n=!1,children:r}){const i=Au(),s=Ux(),{t:o}=je(),a=b.useMemo(()=>e===void 0?void 0:t?.find(A=>A.id===e),[e,t]),u=e!==void 0&&n&&a===void 0,l=b.useMemo(()=>e===void 0||u||s===null?null:s.getOrCreateEntry(e),[e,u,s]),[c,d]=b.useState(()=>({connectionId:e,meta:l?.meta??null,error:null})),[f,h]=b.useState(0),[m,x]=b.useState("connecting"),[E,y]=b.useState(!0),v=a?.target.homeId,k=i.meta.server_home_id;b.useEffect(()=>{if(l===null||e===void 0)return;let A=!1;if(l.meta!==null){if(k!==void 0&&l.meta.server_home_id===k||v!==void 0&&l.meta.server_home_id!==v){d({connectionId:e,meta:null,error:o("sidebar.space.fail.identityChanged")});return}d({connectionId:e,meta:l.meta,error:null});return}d({connectionId:e,meta:null,error:null});const O=l.metaPromise??l.client.meta();return l.metaPromise=O,O.then(_=>{if(l.metaPromise===O&&(l.metaPromise=null),k!==void 0&&_.server_home_id===k||v!==void 0&&_.server_home_id!==v){A||d({connectionId:e,meta:null,error:o("sidebar.space.fail.identityChanged")});return}l.meta=_,A||d({connectionId:e,meta:_,error:null})},_=>{l.metaPromise===O&&(l.metaPromise=null),A||d({connectionId:e,meta:null,error:_ instanceof Error&&_.message!==""?_.message:o("sidebar.space.fail.unreachable")})}),()=>{A=!0}},[l,e,v,k,f,o]),b.useEffect(()=>{if(l===null)return;x("connecting"),y(!0);const A=setTimeout(()=>{y(!1)},1800),O=l.client.klient.terminal,_=O.onStatus(D=>{x(D),D==="open"&&y(!1)});return O.nudge(),()=>{clearTimeout(A),_()}},[l]);const S=e!==void 0&&c.connectionId===e?c.meta??l?.meta??null:l?.meta??null,T=e!==void 0&&c.connectionId===e?c.error:null,w=e===void 0?i.scopeId:`remote:${e}`,I=b.useMemo(()=>e===void 0||l===null||S===null?null:{...i,connectionId:e,connectionSource:"remote",spaceKey:w,scopeId:w,localSpaceKey:i.localSpaceKey??i.spaceKey,localScopeId:i.localScopeId??i.scopeId,localServerHomeId:i.localServerHomeId??i.meta.server_home_id,connectionRef:e,sshLabel:null,client:l.client,localClient:i.localClient??i.client,klient:l.client.klient,socket:l.client.klient.terminal,meta:S,wsStatus:m,wsBannerSuppressed:E,nudge:()=>{l.client.klient.terminal.nudge()}},[e,l,S,i,w,m,E]);if(e===void 0)return p.jsx(p.Fragment,{children:r});if(u)return p.jsx(Gw,{to:"/new",replace:!0});if(T!==null){const A=a?.label??o("sidebar.space.fail.unreachable");return p.jsxs("div",{role:"alert","data-place-error":e,className:"m-6 flex max-w-md flex-col gap-3 rounded-xl border border-hairline bg-panel p-5 text-[13px] text-ink",children:[p.jsx("p",{className:"font-medium text-ink",children:A}),p.jsx("p",{className:"text-[12.5px] text-ink-soft",children:T}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("button",{type:"button","data-place-retry":!0,onClick:()=>{l!==null&&(l.meta=null),h(O=>O+1)},className:"rounded-lg border border-hairline-strong px-3 py-1.5 text-[12.5px] font-medium text-ink transition-colors hover:bg-paper",children:o("common.retry")})})]})}return l===null||I===null?p.jsx("div",{"data-place-loading":e,className:"p-8 text-[12.5px] text-ink-faint",children:o("sidebar.loadingSessions")}):p.jsx(Bw,{value:I,children:p.jsx(Sw,{client:l.queryClient,children:r},w)})}function II(e){const t=e.visibility??(typeof document>"u"?void 0:document);let n=!1,r=!1,i=!1,s;const o=()=>t?.visibilityState==="hidden",a=()=>{s!==void 0&&(clearTimeout(s),s=void 0)},u=d=>{n||r||o()||(a(),s=setTimeout(()=>{s=void 0,l()},d))},l=async()=>{if(!(n||o())){if(r){i=!0;return}r=!0;try{await e.task()}catch(d){try{e.onError?.(d)}catch{}}finally{r=!1,!n&&!o()&&(i?(i=!1,u(0)):u(e.intervalMs))}}},c=()=>{if(o()){a();return}r?i=!0:u(0)};return t?.addEventListener("visibilitychange",c),u(e.intervalMs),()=>{n=!0,i=!1,a(),t?.removeEventListener("visibilitychange",c)}}const qi="all",NI=2e4,jl=3;function JW(e){return e===""||e===qi?qi:e.startsWith("remote:")||e.startsWith("local:")?e:`local:${e}`}function RI(e){if(!(e===void 0||e===""||e===qi))return e.startsWith("local:")?e.slice(6):e}function Cm(e,t){const n=RI(e);return n===void 0||n===t}function $x(e){return{page_size:50,...e?.sort!==void 0?{sort:e.sort}:{},...e?.showArchived?{include_archive:!0}:{},...e?.includePrivate?{include_private:!0}:{},...e?.privateOnly?{private_only:!0}:{}}}function zx(e){return JSON.stringify({a:e?.showArchived===!0,ip:e?.includePrivate===!0,po:e?.privateOnly===!0,s:e?.sort??"updated_desc"})}async function Bl(e,t,n,r){const i=e.klient.rest?.rooms!==void 0?e.klient.rest.rooms.listItems():void 0;let s=r.get(e);if(s===void 0)try{s=await e.meta(),r.set(e,s)}catch{s=null,r.set(e,null)}const o=e.klient.rest?.sidebar,a=s!=null&&Z_(s)&&o!==void 0,u=zx(n),l=$x(n);if(a){const[h,m,x]=await Promise.all([o.list(l,{signal:t}),Promise.allSettled([e.listWorkspaceCatalog()]).then(([y])=>y),i!==void 0?Promise.allSettled([i]).then(([y])=>y):Promise.resolve({status:"fulfilled",value:[]})]);return{sessions:eo(h.units),unitPage:h,sidebarGroupsCapable:!0,serverHomeId:s?.server_home_id,filterSignature:u,hasMoreSessions:h.has_more&&h.next_cursor!==void 0,nextSessionCursor:h.has_more?h.next_cursor:void 0,rooms:x.status==="fulfilled"?x.value??[]:void 0,workspaces:m.status==="fulfilled"?m.value.items:void 0,partialFailure:m.status==="rejected"||x.status==="rejected"}}const[c,d,f]=await Promise.all([e.listSessions({include_archive:n?.showArchived||void 0,include_private:n?.includePrivate||void 0,private_only:n?.privateOnly||void 0},{signal:t}),Promise.allSettled([e.listWorkspaceCatalog()]).then(([h])=>h),i!==void 0?Promise.allSettled([i]).then(([h])=>h):Promise.resolve({status:"fulfilled",value:[]})]);return{sessions:c.items,sidebarGroupsCapable:!1,serverHomeId:s?.server_home_id,filterSignature:u,hasMoreSessions:c.has_more,nextSessionCursor:c.has_more?c.next_cursor??c.items.at(-1)?.id:void 0,rooms:f.status==="fulfilled"?f.value??[]:void 0,workspaces:d.status==="fulfilled"?d.value.items:void 0,partialFailure:d.status==="rejected"||f.status==="rejected"}}function Hl(e,t,n,r="updated_desc"){const i=e!==void 0&&e.filterSignature!==t.filterSignature;if(t.sidebarGroupsCapable&&t.unitPage!==void 0){const u=i?void 0:e?.unitPages,l=t2(u,t.unitPage,r)??{pages:[t.unitPage],pageParams:[void 0]},c=l.pages.at(-1),d=fr(l);return{sessions:eo(d),unitPages:l,sidebarGroupsCapable:!0,serverHomeId:t.serverHomeId??e?.serverHomeId,filterSignature:t.filterSignature,hasMoreSessions:c?.has_more===!0&&c.next_cursor!==void 0,nextSessionCursor:c?.has_more?c.next_cursor:void 0,rooms:t.rooms??e?.rooms??[],workspaces:t.workspaces??e?.workspaces??[],lastSyncedAt:t.partialFailure?e?.lastSyncedAt??n:n,stale:t.partialFailure}}const s=new Set(t.sessions.map(u=>u.id)),o=i?[]:(e?.sessions??[]).filter(u=>!s.has(u.id)),a=!i&&o.length>0&&e!==void 0;return{sessions:a?[...t.sessions,...o]:t.sessions,sidebarGroupsCapable:!1,serverHomeId:t.serverHomeId??e?.serverHomeId,filterSignature:t.filterSignature,hasMoreSessions:a?e.hasMoreSessions:t.hasMoreSessions,nextSessionCursor:a?e.nextSessionCursor:t.nextSessionCursor,rooms:t.rooms??e?.rooms??[],workspaces:t.workspaces??e?.workspaces??[],lastSyncedAt:t.partialFailure?e?.lastSyncedAt??n:n,stale:t.partialFailure}}async function Ul(e,t,n){if(e.length===0)return;let r=0;const i=Math.min(t,e.length);await Promise.all(Array.from({length:i},async()=>{for(;r<e.length;){const s=e[r];r+=1,s!==void 0&&await n(s)}}))}function eV({activeSessions:e,activeSidebarUnits:t,activeRooms:n,activeWorkspaces:r,sidebarFilter:i,spaceScope:s=qi,enabled:o=!0}){const a=ci(),{t:u}=je(),{client:l,localClient:c,config:d,meta:f,connectionId:h,connectionSource:m,spaceKey:x,localSpaceKey:E,sshLabel:y}=Au(),v=Ux(),k=typeof h=="string"&&h!==""||typeof y=="string"&&y.length>0||m==="remote",S=a.kind==="tauri",T=S?c:c??(k?null:l),w=T?.klient?.rest?.connections!==void 0,I=Hw(w?T:null,{poll:o&&w}),A=pS(S?c:null);mS(a);const O=E??(k?"main":x),_=_w(),D=(A.data??[]).find(W=>W.id===O),U=O===gS?u("st.spaces.main"):D?.name??(_!==null&&!_.homeId.startsWith("remote:")?_.name:void 0)??O,F=k?void 0:f?.server_home_id,R=b.useMemo(()=>(I.data??[]).filter(W=>Uw(W)&&(F===void 0||W.target.homeId!==F)),[I.data,F]),j=b.useMemo(()=>R.filter(W=>W.enabled&&W.state==="online"),[R]),B=b.useMemo(()=>j.map(W=>`${W.id}:${W.target.homeId}`).toSorted().join(","),[j]),q=b.useRef(new Map),$=b.useRef(new WeakMap),X=b.useRef(new Map),[C,se]=b.useState(()=>new Map),[xe,L]=b.useState(()=>new Set),G=b.useRef(C);G.current=C;const re=b.useRef(new Set),ne=b.useRef(i);ne.current=i;const pe=zx(i),Ae=T?.baseUrl??d.url,ee=d.token;b.useEffect(()=>{const W=q.current,Z=new Set(j.map(ue=>ue.id));for(const[ue,Se]of Array.from(W.entries())){const me=`${Ae}|${ee}|${ue}`;(!Z.has(ue)||Se.generationKey!==me||!w)&&(W.delete(ue),Se.client.dispose?.().catch?.(()=>{}))}if(v!==null){const ue=new Set(R.filter(Se=>Se.enabled).map(Se=>Se.id));v.retainOnly(ue)}const ae=new Set([O,...R.filter(ue=>ue.enabled).map(ue=>yi(ue.id))]);se(ue=>{let Se=!1;for(const de of ue.keys())if(!ae.has(de)){Se=!0;break}if(!Se)return ue;const me=new Map(ue);for(const de of ue.keys())ae.has(de)||me.delete(de);return me})},[j,R,Ae,ee,w,O,v]),b.useEffect(()=>{const W=q.current;return()=>{for(const Z of W.values())Z.client.dispose?.().catch?.(()=>{});W.clear()}},[]);const he=b.useCallback(W=>{if(!w||T===null)return null;if(v!==null)return v.getOrCreateClient(W);const Z=`${Ae}|${ee}|${W}`,ae=q.current.get(W);if(ae!==void 0&&ae.generationKey===Z)return ae.client;ae!==void 0&&(q.current.delete(W),ae.client.dispose?.().catch?.(()=>{}));const ue=Bb({endpoint:Ae,token:ee,connectionId:W});return q.current.set(W,{generationKey:Z,client:ue}),ue},[w,T,Ae,ee,v]),Ie=b.useCallback(W=>!k||h!==W.id?!1:f?.server_home_id!==void 0&&f.server_home_id===W.target.homeId,[k,h,f?.server_home_id]),Me=b.useCallback(async W=>{const Z=he(W);if(Z===null)return;const ae=new AbortController,ue=yi(W),Se=ne.current;try{const me=await Bl(Z,ae.signal,Se,$.current);se(de=>{const ve=new Map(de);return ve.set(ue,Hl(de.get(ue),me,Date.now(),Se?.sort??"updated_desc")),ve})}catch{if(ae.signal.aborted)return;se(me=>{const de=me.get(ue);if(de===void 0||de.stale)return me;const ve=new Map(me);return ve.set(ue,{...de,stale:!0}),ve})}},[he]);b.useEffect(()=>{if(v!==null)return v.subscribeMutation(W=>{Me(W)})},[v,Me]);const Be=b.useRef(j);Be.current=j,b.useEffect(()=>{if(!o||!Be.current.some(de=>!Ie(de))&&!(k&&T!==null))return;const ae=new AbortController;let ue=!1;const Se=async()=>{if(!(ue||ae.signal.aborted)){ue=!0;try{const de=[];k&&T!==null&&de.push({key:O,client:T});for(const ve of Be.current){if(Ie(ve))continue;const _e=he(ve.id);_e!==null&&de.push({key:yi(ve.id),client:_e})}await Ul(de,jl,async ve=>{if(ae.signal.aborted)return;const _e=ne.current;try{const Pe=await Bl(ve.client,ae.signal,_e,$.current);if(ae.signal.aborted)return;se(ye=>{const Ne=new Map(ye);return Ne.set(ve.key,Hl(ye.get(ve.key),Pe,Date.now(),_e?.sort??"updated_desc")),Ne})}catch{if(ae.signal.aborted)return;se(Pe=>{const ye=Pe.get(ve.key);if(ye===void 0||ye.stale)return Pe;const Ne=new Map(Pe);return Ne.set(ve.key,{...ye,stale:!0}),Ne})}})}finally{ue=!1}}};Se();const me=II({intervalMs:NI,task:Se});return()=>{me(),ae.abort()}},[o,B,pe,Ie,k,T,O,he]);const{sources:fe,unitSources:Le,healthBySpace:Re,hasMoreBySpace:De,nextCursorBySpace:ke}=b.useMemo(()=>{const W=[],Z=[],ae=new Map,ue=new Map,Se=new Map,me=Ne=>Ne.map(ce=>({kind:"session",id:ce.id,sort_at:Date.parse(ce.own_updated_at??ce.updated_at)||0,row:{id:ce.id,workspace_id:ce.workspace_id,cwd:ce.metadata?.cwd,title:ce.title,created_at:ce.created_at,updated_at:ce.updated_at,own_updated_at:ce.own_updated_at??ce.updated_at,archived:ce.archived,archived_at:ce.archived_at,private:ce.private,pinned:ce.metadata?.["kiki.pinned"]===!0,busy:ce.busy,executing:ce.executing,cleanup_pending:ce.cleanup_pending,main_turn_active:ce.main_turn_active,pending_interaction:ce.pending_interaction,last_turn_reason:ce.last_turn_reason,execution_phase:ce.execution_phase,delivery:ce.delivery,executor_id:ce.executor_id,persona_id:ce.agent_config?.persona?.id,persona:ce.agent_config?.persona,bot_persona_id:typeof ce.metadata?.bot_persona_id=="string"?ce.metadata.bot_persona_id:void 0,room_persona_id:typeof ce.metadata?.room_persona_id=="string"?ce.metadata.room_persona_id:void 0,room_member_of:typeof ce.metadata?.room_member_of=="string"?ce.metadata.room_member_of:void 0,worktree:ce.worktree,forked_from:ce.forked_from,promoted_from:ce.promoted_from,created_by_session_id:typeof ce.metadata?.created_by_session_id=="string"?ce.metadata.created_by_session_id:void 0,last_seq:ce.last_seq,attention_cursor:ce.attention_cursor}})),de=C.get(O),ve=k?de?.sessions??[]:e,_e=k?de?.rooms??[]:n,Pe=k?de?.workspaces??[]:r,ye=k?de?.unitPages!==void 0?fr(de.unitPages):me(de?.sessions??[]):t??me(e);W.push({spaceKey:O,spaceName:U,isRemote:!1,sessions:ve,rooms:_e,workspaces:Pe}),Z.push({spaceKey:O,spaceName:U,isRemote:!1,serverHomeId:k?de?.serverHomeId:f?.server_home_id,units:ye,rooms:_e,workspaces:Pe,partialCoverage:k&&(de===void 0||de.stale||de.sidebarGroupsCapable===!1)}),k&&de!==void 0&&(ue.set(O,de.hasMoreSessions),de.hasMoreSessions&&de.nextSessionCursor!==void 0&&Se.set(O,de.nextSessionCursor)),ae.set(O,{spaceKey:O,spaceName:U,isRemote:!1,state:k&&de?.stale?"stale":"online",lastSyncedAt:de?.lastSyncedAt,color:D?.color});for(const Ne of R){if(!Ne.enabled)continue;const ce=yi(Ne.id),ut=Ie(Ne),rt=C.get(ce),qn=ut?e:rt?.sessions??[],Wn=ut?n:rt?.rooms??[],pt=ut?r:rt?.workspaces??[],ze=ut?t??me(e):rt?.unitPages!==void 0?fr(rt.unitPages):me(rt?.sessions??[]),ot=Ne.state!=="online"&&!ut?"offline":!ut&&rt?.stale===!0?"stale":"online";ut||Ne.state==="online"||rt!==void 0?(W.push({spaceKey:ce,spaceName:Ne.label,isRemote:!0,sessions:qn,rooms:Wn,workspaces:pt}),Z.push({spaceKey:ce,spaceName:Ne.label,isRemote:!0,serverHomeId:ut?f?.server_home_id:rt?.serverHomeId??Ne.target.homeId,units:ze,rooms:Wn,workspaces:pt,partialCoverage:!ut&&(ot!=="online"||rt?.sidebarGroupsCapable===!1)}),!ut&&rt!==void 0&&(ue.set(ce,rt.hasMoreSessions),rt.hasMoreSessions&&rt.nextSessionCursor!==void 0&&Se.set(ce,rt.nextSessionCursor))):Z.push({spaceKey:ce,spaceName:Ne.label,isRemote:!0,serverHomeId:Ne.target.homeId,units:[],rooms:[],workspaces:[],partialCoverage:!0}),ae.set(ce,{spaceKey:ce,spaceName:Ne.label,isRemote:!0,state:ot,lastSyncedAt:rt?.lastSyncedAt??Ne.summary?.lastSeen,connectionId:Ne.id})}return{sources:W,unitSources:Z,healthBySpace:ae,hasMoreBySpace:ue,nextCursorBySpace:Se}},[C,O,U,D?.color,k,f?.server_home_id,e,t,n,r,R,Ie]),le=b.useMemo(()=>{const W=[];for(const[Z,ae]of C.entries())ae.sidebarGroupsCapable===!0&&W.push(Z);return W.toSorted().join(",")},[C]),Ce=b.useMemo(()=>!o||s!==qi||Le.length<=1?"":l2(Le).slice(0,100).toSorted().join(","),[o,s,Le]);b.useEffect(()=>{if(!o||s!==qi||Ce===""||le==="")return;const W=Ce.split(",").filter(Boolean);if(W.length===0)return;const Z=new AbortController,ae=ne.current,ue=ae?.sort??"updated_desc",Se=[];k&&T!==null&&G.current.get(O)?.sidebarGroupsCapable===!0&&Se.push({key:O,client:T});for(const me of Be.current){if(Ie(me))continue;const de=yi(me.id);if(G.current.get(de)?.sidebarGroupsCapable!==!0)continue;const _e=he(me.id);_e!==null&&Se.push({key:de,client:_e})}if(Se.length!==0)return Ul(Se,jl,async me=>{if(Z.signal.aborted)return;const de=me.client.klient.rest?.sidebar;if(de===void 0)return;const ve=`${me.key}|${pe}|${Ce}`;if(X.current.get(me.key)!==ve){X.current.set(me.key,ve);try{const _e=await de.resolveUnits({group_ids:W,...ae?.showArchived?{include_archive:!0}:{},...ae?.includePrivate?{include_private:!0}:{},...ae?.privateOnly?{private_only:!0}:{}},{signal:Z.signal});if(Z.signal.aborted||_e.units.length===0)return;se(Pe=>{const ye=Pe.get(me.key);if(ye?.unitPages===void 0)return Pe;const Ne=e2(ye.unitPages,_e,{sort:ue,insertMissingAtHead:!0});if(Ne===void 0||Ne===ye.unitPages)return Pe;const ce=new Map(Pe);return ce.set(me.key,{...ye,unitPages:Ne,sessions:eo(fr(Ne))}),ce})}catch{}}}),()=>{Z.abort()}},[o,s,Ce,le,pe,k,T,O,Ie,he]);const ge=b.useCallback(async W=>{const Z=G.current.get(W);if(Z===void 0||!Z.hasMoreSessions||Z.nextSessionCursor===void 0||re.current.has(W))return;const ae=W===O?T:W.startsWith("remote:")?he(W.slice(7)):null;if(ae===null)return;re.current.add(W),L(new Set(re.current));const ue=ne.current,Se=ue?.sort??"updated_desc";try{const me=ae.klient.rest?.sidebar;if(Z.sidebarGroupsCapable&&me!==void 0&&Z.unitPages!==void 0){try{const ve=await me.list({...$x(ue),cursor:Z.nextSessionCursor});se(_e=>{const Pe=_e.get(W);if(Pe?.unitPages===void 0)return _e;const ye=n2(Pe.unitPages,ve,Z.nextSessionCursor),Ne=ye.pages.at(-1),ce=new Map(_e);return ce.set(W,{...Pe,unitPages:ye,sessions:eo(fr(ye)),hasMoreSessions:Ne?.has_more===!0&&Ne.next_cursor!==void 0,nextSessionCursor:Ne?.has_more?Ne.next_cursor:void 0}),ce})}catch(ve){if(N1(ve)){const _e=await Bl(ae,new AbortController().signal,ue,$.current);se(Pe=>{const ye=new Map(Pe);return ye.set(W,Hl(void 0,_e,Date.now(),Se)),ye});return}throw ve}return}const de=await ae.listSessions({before_id:Z.nextSessionCursor,include_archive:ue?.showArchived||void 0,include_private:ue?.includePrivate||void 0,private_only:ue?.privateOnly||void 0});se(ve=>{const _e=ve.get(W);if(_e===void 0)return ve;const Pe=new Set(_e.sessions.map(ce=>ce.id)),ye=de.items.filter(ce=>!Pe.has(ce.id)),Ne=new Map(ve);return Ne.set(W,{..._e,sessions:[..._e.sessions,...ye],hasMoreSessions:de.has_more,nextSessionCursor:de.has_more?de.next_cursor??de.items.at(-1)?.id:void 0}),Ne})}finally{re.current.delete(W),L(new Set(re.current))}},[T,he,O]),Fe=b.useCallback(async(W,Z,ae)=>{const Se=(W===O?T:W.startsWith("remote:")?he(W.slice(7)):null)?.klient.rest?.sidebar;if(Se===void 0)return;const me=ne.current,de=await Se.groupMembers(Z,{cursor:ae,page_size:50,...me?.showArchived?{include_archive:!0}:{},...me?.includePrivate?{include_private:!0}:{},...me?.privateOnly?{private_only:!0}:{}});se(ve=>{const _e=ve.get(W);if(_e?.unitPages===void 0)return ve;const Pe=r2(_e.unitPages,de);if(Pe===void 0||Pe===_e.unitPages)return ve;const ye=new Map(ve);return ye.set(W,{..._e,unitPages:Pe,sessions:eo(fr(Pe))}),ye})},[T,he,O]),K=b.useCallback(async(W,Z,ae)=>{const ue=W.trim();if(ue==="")return[];const Se=[];if(Cm(Z,O)){const de=k?T:l;if(de!==null){const ve=k?G.current.get(O)?.workspaces??[]:r;Se.push({spaceKey:O,spaceName:U,isRemote:!1,client:de,workspaces:ve})}}for(const de of R){if(!de.enabled)continue;const ve=yi(de.id);if(!Cm(Z,ve))continue;const _e=Ie(de);if(!_e&&de.state!=="online")continue;const Pe=_e?l:he(de.id);if(Pe===null)continue;const ye=_e?r:G.current.get(ve)?.workspaces??[];Se.push({spaceKey:ve,spaceName:de.label,isRemote:!0,client:Pe,workspaces:ye})}const me=[];return await Ul(Se,jl,async de=>{if(!ae.aborted)try{const ve=[],_e=new Set;let Pe;for(;!ae.aborted;){const ye=await de.client.listSessions({q:ue,before_id:Pe},{signal:ae});for(const ce of ye.items)_e.has(ce.id)||(_e.add(ce.id),ve.push(ce));if(!ye.has_more)break;const Ne=ye.next_cursor??ye.items.at(-1)?.id;if(Ne===void 0||Ne===Pe)break;Pe=Ne}if(ae.aborted)return;me.push({spaceKey:de.spaceKey,spaceName:de.spaceName,isRemote:de.isRemote,sessions:ve,rooms:[],workspaces:de.workspaces})}catch(ve){if(ae.aborted)return;if(Se.length===1)throw ve}}),me},[r,l,T,he,k,Ie,O,U,R]),J=(S?Math.max(1,(A.data??[]).length):1)>1||R.length>0,H=w&&I.isPending&&I.data===void 0,Q=b.useCallback(async()=>{w&&await I.refetch()},[w,I]);return{sources:fe,unitSources:Le,healthBySpace:Re,hasMoreBySpace:De,nextCursorBySpace:ke,loadingMoreSpaces:xe,localSpaceKey:O,localSpaceName:U,remoteConnections:R,remoteLoading:H,hasMultipleSpaces:J,refetchRemotes:Q,refreshRemoteSpace:Me,loadMoreSpaceSessions:ge,loadMoreSpaceGroupMembers:Fe,searchAcrossSpaces:K}}function nu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}const Tt=[],OI=Math.random().toString(36).slice(2,10);let Am=0,Im=!1,Wi=0,ed=!1;function qx(){const e=nu(nu(window.history.state)?.usr)?.kikiLayerToken;return typeof e=="string"?e:void 0}function Wx(e){const t=nu(window.history.state)??{},n=nu(t.usr)??{},r=n.kikiLayerToken;e.below=typeof r=="string"?r:void 0,window.history.pushState({...t,usr:{...n,kikiLayer:e.id,kikiLayerToken:e.token}},""),e.pushed=!0}function td(){if(ed=!1,Wi>0)return;let e=Tt.length-1;for(;e>=0&&!Tt[e].pushed;)e-=1;if(e>=0&&Tt[e].closed){let t=e;if(qx()===Tt[e].token){for(;t>0&&Tt[t-1].closed&&Tt[t].below===Tt[t-1].token;)t-=1;Tt.splice(t,e-t+1),Wi+=1,window.history.go(-(e-t+1));return}for(;t>0&&Tt[t-1].closed;)t-=1;Tt.splice(t,e-t+1)}for(const t of Tt)!t.pushed&&!t.closed&&Wx(t)}function LI(){ed||(ed=!0,queueMicrotask(td))}function PI(){if(Wi>0){Wi-=1,Wi===0&&td();return}const e=qx(),t=e===void 0?-1:Tt.findIndex(r=>r.token===e),n=t===-1?Tt.splice(-1):Tt.splice(t+1);for(const r of n.reverse())r.closed||r.onClose();td()}function MI(){Im||(Im=!0,window.addEventListener("popstate",PI))}function Pf(e,t,n){const r=b.useRef(n);r.current=n,b.useEffect(()=>{if(!t)return;MI(),Am+=1;const i={id:e,token:`${OI}:${Am}`,below:void 0,onClose:()=>r.current(),pushed:!1,closed:!1};return Tt.push(i),Wi===0&&Wx(i),()=>{const s=Tt.indexOf(i);if(s!==-1){if(!i.pushed){Tt.splice(s,1);return}i.closed=!0,LI()}}},[e,t])}const ru=new Set,Qr=[],Jn=50,Vx="data-modal-id",Kx="data-modal-depth";function ts(){return Qr.reduce((e,t)=>!e||t.depth>=e.depth?t:e,void 0)}function Yx(){return ts()?.id}function DI(){return(ts()?.depth??0)+1}function FI(e,t,n){const r={id:e,depth:t,panel:n};return Qr.push(r),{isTop:()=>ts()===r,unregister:()=>{const i=Qr.indexOf(r);i!==-1&&Qr.splice(i,1)}}}function Nm(e){const t=ts();return e.isConnected&&(!t||t.panel.contains(e))}function Mf(e){if(e!==null)for(let t=e;t!==null;t=t.parentElement){const n=Qr.find(i=>i.panel.contains(t));if(n!==void 0)return n.id;const r=t.getAttribute(Vx);if(r!==null&&r!=="")return r}}function Df(e){for(let t=e;t!==null;t=t.parentElement){const n=Qr.find(i=>i.panel.contains(t));if(n!==void 0)return Jn+n.depth+1;const r=t.getAttribute(Kx);if(r!==null&&r!==""){const i=Number(r);if(Number.isFinite(i))return Jn+i+1}}return e===null&&ts()!==void 0?Jn+ts().depth+1:Jn}function Gu(e){return ru.add(e),()=>{ru.delete(e)}}function tV(e=[]){if(Qr.some(t=>!e.includes(t.id)))return!0;if(ru.size===0)return!1;if(e.length===0)return!0;for(const t of ru)if(!e.includes(t))return!0;return!1}const ko="data-floating-owner",ns="data-floating-owners";function Gx(e,t){const n=[];return(i=>{for(let s=i;s!==null;s=s.parentElement){const o=s.getAttribute(ns);if(o!==null&&o!=="")for(const u of o.split(/\s+/))u!==""&&u!==t&&!n.includes(u)&&n.push(u);const a=s.getAttribute(ko);a!==null&&a!==""&&a!==t&&!n.includes(a)&&n.push(a)}})(e),n.length>0?n.join(" "):void 0}function Ff(e,t,n){if(e===null||!(t instanceof Node))return!1;if(e.contains(t))return!0;const r=n??e.getAttribute(ko)??void 0;if(r===void 0||r==="")return!1;const i=t instanceof Element?t:t.parentElement;for(let s=i;s!==null;s=s.parentElement){const o=s.getAttribute(ns);if(o!==null&&o.split(/\s+/).includes(r))return!0}return!1}function To(e){if(e===void 0||e===""||typeof document>"u")return!1;for(const t of document.querySelectorAll(`[${ns}]`)){if(t.getAttribute(ko)===e)continue;const n=t.getAttribute(ns);if(n!==null&&n.split(/\s+/).includes(e))return!0}return!1}const Rm="composer",qs=new Map;function jI(e,t,n){let r=qs.get(e);r===void 0&&(r=new Map,qs.set(e,r));const i=(s,o)=>{s!==t&&!o.has(t)&&n()};return r.set(t,i),()=>{const s=qs.get(e);s!==void 0&&(s.delete(t),s.size===0&&qs.delete(e))}}function BI(e,t,n){const r=qs.get(e);if(r===void 0)return;const i=new Set([t]),s=n===void 0?void 0:Gx(n);if(s!==void 0)for(const o of s.split(/\s+/))o!==""&&i.add(o);for(const[o,a]of Array.from(r.entries()))i.has(o)||a(t,i)}const Om='[role="menuitem"]:not([disabled]), [role="menuitemcheckbox"]:not([disabled]), [role="menuitemradio"]:not([disabled])';function Ss(e,t,n){for(let r=0;r<e.length;r+=1){const i=e[((t+r*n)%e.length+e.length)%e.length];if(i.focus(),document.activeElement===i)return}}function HI({id:e,role:t="menu",ariaLabel:n,overlayId:r,onClose:i,dataAttribute:s,modalOwnerId:o,autofocus:a=!0,restoreFocus:u=!0,returnFocusRef:l,sheetClassName:c,onKeyDown:d,children:f}){const[h]=b.useState(()=>o??Mf(typeof document<"u"?document.activeElement:null)??Yx()),m=o??h,x=b.useRef(null),E=b.useRef(i);E.current=i;const y=b.useRef(l);y.current=l,Pf(r,!0,i),b.useLayoutEffect(()=>{const k=document.activeElement instanceof HTMLElement?document.activeElement:null,S=x.current;if(S!==null)if(a&&t==="menu"){const T=[...S.querySelectorAll(Om)];T.length>0?Ss(T,0,1):S.focus()}else if(a){const T=S.querySelector("[data-autofocus]:not([disabled])")??S.querySelector('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');T!==null?T.focus():S.focus()}else S.focus();return()=>{const T=document.activeElement,w=T===null||T===document.body||S!==null&&S.contains(T);!u||S===null||!w||queueMicrotask(()=>{const I=document.activeElement;if(I!==null&&I!==document.body&&I instanceof HTMLElement&&I.isConnected)return;if(k!==null&&k!==document.body&&k.isConnected){k.focus();return}const A=y.current?.current;A!=null&&A!==document.body&&A.isConnected&&A.focus()})}},[]),b.useEffect(()=>{const k=Gu(r),S=T=>{T.key==="Escape"&&(T.preventDefault(),E.current())};return window.addEventListener("keydown",S),()=>{k(),window.removeEventListener("keydown",S)}},[r]);const v=s===void 0?{}:{[s]:!0};return Kt.createPortal(p.jsxs("div",{...v,"data-modal-escape":m,className:"kiki-action-sheet-layer",style:{zIndex:Df(null)},onClick:k=>{k.stopPropagation()},children:[p.jsx("div",{"aria-hidden":!0,className:"kiki-action-sheet-scrim",onClick:()=>{E.current()}}),p.jsx("div",{ref:x,id:e,role:t,"aria-label":n,tabIndex:-1,className:c===void 0?"kiki-action-sheet outline-none":`kiki-action-sheet outline-none ${c}`,onKeyDown:k=>{if(d?.(k),k.defaultPrevented||t!=="menu"||k.key!=="ArrowDown"&&k.key!=="ArrowUp"&&k.key!=="Home"&&k.key!=="End")return;const S=[...x.current?.querySelectorAll(Om)??[]];if(S.length===0)return;k.preventDefault();const T=S.indexOf(document.activeElement);k.key==="Home"?Ss(S,0,1):k.key==="End"?Ss(S,S.length-1,-1):k.key==="ArrowDown"?Ss(S,T+1,1):Ss(S,T-1,-1)},children:f})]}),document.body)}function UI(e){return e.kind==="subagent"?e.parentTurnId:e.kind==="question"||e.kind==="approval"?e.request.turn_id===void 0?void 0:`t${e.request.turn_id}`:e.turnId}function $I(e,t){const n=[];for(const r of e){const i=UI(r);i!==void 0&&!n.includes(i)&&n.push(i)}return t.busy?t.liveTurnId===void 0?n.slice(0,-1):n.filter(r=>r!==t.liveTurnId):n}function zI(e){return e.handoff!==void 0}function qI(e){return e.peerThread?.personaId!==void 0||e.peerThread?.senderName!==void 0}function nV(e,t){return $w(e,{completedTurnIds:$I(e,{busy:t.busy,liveTurnId:t.liveTurnId}),failedTurnIds:t.failedTurnIds,personaName:t.personaName})}function rV(e){if(e!==void 0){if(e.kind==="message")return e.status==="failed"||e.status==="cancelled"||e.status==="pending"||zI(e)?void 0:`bot:${e.personaId??"self"}`;if(e.kind==="question")return"bot:self";if(e.kind==="user")return qI(e)?void 0:"user"}}function iV(e,t){if(!t)return;const n=e[e.length-1];if(n?.kind==="message"&&n.status==="sending"){const s=n.sourceTool?.argsText??"";return/"text"\s*:\s*"[^"]/.test(s)||n.text!==""?void 0:{kind:"typing"}}if(n?.kind==="question"||n?.kind==="approval")return;const r=n?.kind==="activity-summary"?n:void 0,i=r===void 0?0:r.members.filter(s=>s.kind==="tool"||s.kind==="shell").length;return{kind:"working",reads:r?.counts.reads??0,commands:r?.counts.commands??0,steps:i}}const Xu=(function(e){if(e==null)return YI;if(typeof e=="function")return Qu(e);if(typeof e=="object")return Array.isArray(e)?WI(e):VI(e);if(typeof e=="string")return KI(e);throw new Error("Expected function, string, or object as test")});function WI(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Qu(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function VI(e){const t=e;return Qu(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function KI(e){return Qu(t);function t(n){return n&&n.type===e}}function Qu(e){return t;function t(n,r,i){return!!(GI(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function YI(){return!0}function GI(e){return e!==null&&typeof e=="object"&&"type"in e}const Xx=[],Ws=!0,nd=!1,Li="skip";function jf(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Xu(i),o=r?-1:1;a(e,void 0,[])();function a(u,l,c){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=Xx,m,x,E;if((!t||s(u,l,c[c.length-1]||void 0))&&(h=XI(n(u,c)),h[0]===nd))return h;if("children"in u&&u.children){const y=u;if(y.children&&h[0]!==Li)for(x=(r?y.children.length:-1)+o,E=c.concat(y);x>-1&&x<y.children.length;){const v=y.children[x];if(m=a(v,x,E)(),m[0]===nd)return m;x=typeof m[1]=="number"?m[1]:x+o}}return h}}}function XI(e){return Array.isArray(e)?e:typeof e=="number"?[Ws,e]:e==null?Xx:[e]}function vn(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),jf(e,s,a,i);function a(u,l){const c=l[l.length-1],d=c?c.children.indexOf(u):void 0;return o(u,d,c)}}const rs={indicator:"indicator",textOnly:"text-only",remove:"remove"};function QI({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:o="text-gray-500",linkBlockPolicy:a=rs.indicator,imageBlockPolicy:u=rs.indicator}){const l=t.length&&!t.every(d=>d==="*"),c=n.length&&!n.every(d=>d==="*");if(!e&&(l||c))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return d=>{const f=rN(e,t,n,r,i,s,o,a,u);Qx(d),vn(d,f)}}function Lm(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function ZI(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const JI=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),eN=new Set(["javascript:","data:","file:","vbscript:"]);function Pm(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const c=e.substring(5);if(c&&c.length>0&&c!=="invalid")return e}}catch{return null}return null}const o=Lm(e,n);if(!o||eN.has(o.protocol)||!(JI.has(o.protocol)||s.includes(o.protocol)||s.includes("*")))return null;if(o.protocol==="mailto:"||!o.protocol.match(/^https?:$/))return o.href;const u=ZI(e);return o&&t.some(l=>{const c=Lm(l,n);return!c||c.origin!==o.origin?!1:o.href.startsWith(c.href)})?u?o.pathname+o.search+o.hash:o.href:t.includes("*")?o.protocol!=="https:"&&o.protocol!=="http:"?null:u?o.pathname+o.search+o.hash:o.href:null}function Qx(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)Qx(t)}}const $l=Symbol("node-seen");function tN(e,t,n){return t===rs.remove?{type:"remove"}:t===rs.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function nN(e,t,n){if(t===rs.remove)return{type:"remove"};if(t===rs.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const rN=(e,t,n,r,i,s,o,a,u)=>{const l=(c,d,f)=>{if(c.type!=="element"||c[$l])return Ws;if(c.tagName==="a"){const h=Pm(c.properties.href,t,e,!1,!1,i);if(h===null){if(c[$l]=!0,vn(c,l),f&&typeof d=="number"){const m=tN(c,a,o);if(m.type==="remove")return f.children.splice(d,1),[Li,d];f.children[d]=m.element}return Li}else return c.properties.href=h,c.properties.target="_blank",c.properties.rel="noopener noreferrer",Ws}if(c.tagName==="img"){const h=Pm(c.properties.src,n,e,r,!0,i);if(h===null){if(c[$l]=!0,vn(c,l),f&&typeof d=="number"){const m=nN(c,u,s);if(m.type==="remove")return f.children.splice(d,1),[Li,d];f.children[d]=m.element}return Li}else return c.properties.src=h,Ws}return Ws};return l},Zx=-1,Zu=0,io=1,iu=2,Bf=3,Hf=4,Uf=5,$f=6,Jx=7,ey=8,iN=typeof self=="object"?self:globalThis,Mm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new iN[e](t)},sN=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Zu:case Zx:return n(o,i);case io:{const a=n([],i);for(const u of o)a.push(r(u));return a}case iu:{const a=n({},i);for(const[u,l]of o)a[r(u)]=r(l);return a}case Bf:return n(new Date(o),i);case Hf:{const{source:a,flags:u}=o;return n(new RegExp(a,u),i)}case Uf:{const a=n(new Map,i);for(const[u,l]of o)a.set(r(u),r(l));return a}case $f:{const a=n(new Set,i);for(const u of o)a.add(r(u));return a}case Jx:{const{name:a,message:u}=o;return n(Mm(a,u),i)}case ey:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(Mm(s,o),i)};return r},Dm=e=>sN(new Map,e)(0),vi="",{toString:oN}={},{keys:aN}=Object,_s=e=>{const t=typeof e;if(t!=="object"||!e)return[Zu,t];const n=oN.call(e).slice(8,-1);switch(n){case"Array":return[io,vi];case"Object":return[iu,vi];case"Date":return[Bf,vi];case"RegExp":return[Hf,vi];case"Map":return[Uf,vi];case"Set":return[$f,vi];case"DataView":return[io,n]}return n.includes("Array")?[io,n]:n.includes("Error")?[Jx,n]:[iu,n]},ga=([e,t])=>e===Zu&&(t==="function"||t==="symbol"),uN=(e,t,n,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return n.set(a,u),u},s=o=>{if(n.has(o))return n.get(o);let[a,u]=_s(o);switch(a){case Zu:{let c=o;switch(u){case"bigint":a=ey,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([Zx],o)}return i([a,c],o)}case io:{if(u){let f=o;return u==="DataView"?f=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(o)),i([u,[...f]],o)}const c=[],d=i([a,c],o);for(const f of o)c.push(s(f));return d}case iu:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const c=[],d=i([a,c],o);for(const f of aN(o))(e||!ga(_s(o[f])))&&c.push([s(f),s(o[f])]);return d}case Bf:return i([a,o.toISOString()],o);case Hf:{const{source:c,flags:d}=o;return i([a,{source:c,flags:d}],o)}case Uf:{const c=[],d=i([a,c],o);for(const[f,h]of o)(e||!(ga(_s(f))||ga(_s(h))))&&c.push([s(f),s(h)]);return d}case $f:{const c=[],d=i([a,c],o);for(const f of o)(e||!ga(_s(f)))&&c.push(s(f));return d}}const{message:l}=o;return i([a,{name:u,message:l}],o)};return s},Fm=(e,{json:t,lossy:n}={})=>{const r=[];return uN(!(t||n),!!t,new Map,r)(e),r},si=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dm(Fm(e,t)):structuredClone(e):(e,t)=>Dm(Fm(e,t));function sV(){}class Wo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Wo.prototype.normal={};Wo.prototype.property={};Wo.prototype.space=void 0;function ty(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Wo(n,r,t)}function wo(e){return e.toLowerCase()}class Yt{constructor(t,n){this.attribute=n,this.property=t}}Yt.prototype.attribute="";Yt.prototype.booleanish=!1;Yt.prototype.boolean=!1;Yt.prototype.commaOrSpaceSeparated=!1;Yt.prototype.commaSeparated=!1;Yt.prototype.defined=!1;Yt.prototype.mustUseProperty=!1;Yt.prototype.number=!1;Yt.prototype.overloadedBoolean=!1;Yt.prototype.property="";Yt.prototype.spaceSeparated=!1;Yt.prototype.space=void 0;let lN=0;const $e=hi(),mt=hi(),rd=hi(),oe=hi(),at=hi(),Vi=hi(),Gt=hi();function hi(){return 2**++lN}const id=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:mt,commaOrSpaceSeparated:Gt,commaSeparated:Vi,number:oe,overloadedBoolean:rd,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),zl=Object.keys(id);class zf extends Yt{constructor(t,n,r,i){let s=-1;if(super(t,n),jm(this,"space",i),typeof r=="number")for(;++s<zl.length;){const o=zl[s];jm(this,zl[s],(r&id[o])===id[o])}}}zf.prototype.defined=!0;function jm(e,t,n){n&&(e[t]=n)}function fs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new zf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[wo(r)]=r,n[wo(s.attribute)]=r}return new Wo(t,n,e.space)}const ny=fs({properties:{ariaActiveDescendant:null,ariaAtomic:mt,ariaAutoComplete:null,ariaBusy:mt,ariaChecked:mt,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:mt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:mt,ariaFlowTo:at,ariaGrabbed:mt,ariaHasPopup:null,ariaHidden:mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:oe,ariaLive:null,ariaModal:mt,ariaMultiLine:mt,ariaMultiSelectable:mt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:mt,ariaReadOnly:mt,ariaRelevant:null,ariaRequired:mt,ariaRoleDescription:at,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:mt,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ry(e,t){return t in e?e[t]:t}function iy(e,t){return ry(e,t.toLowerCase())}const cN=fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vi,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:at,autoFocus:$e,autoPlay:$e,blocking:at,capture:null,charSet:null,checked:$e,cite:null,className:at,cols:oe,colSpan:null,content:null,contentEditable:mt,controls:$e,controlsList:at,coords:oe|Vi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:rd,draggable:mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:at,height:oe,hidden:rd,high:oe,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:at,itemRef:at,itemScope:$e,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:oe,pattern:null,ping:at,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:at,required:$e,reversed:$e,rows:oe,rowSpan:oe,sandbox:at,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:mt,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:mt,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:iy}),dN=fs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gt,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:at,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:Vi,g2:Vi,glyphName:Vi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gt,rev:Gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gt,requiredFeatures:Gt,requiredFonts:Gt,requiredFormats:Gt,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gt,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ry}),sy=fs({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()}}),oy=fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iy}),ay=fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),fN={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"},hN=/[A-Z]/g,Bm=/-[a-z]/g,pN=/^data[-\w.:]+$/i;function Ju(e,t){const n=wo(t);let r=t,i=Yt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pN.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Bm,gN);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Bm.test(s)){let o=s.replace(hN,mN);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=zf}return new i(r,t)}function mN(e){return"-"+e.toLowerCase()}function gN(e){return e.charAt(1).toUpperCase()}const Vo=ty([ny,cN,sy,oy,ay],"html"),Ir=ty([ny,dN,sy,oy,ay],"svg");function Hm(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function uy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Um=/[#.]/g;function bN(e,t){const n=e||"",r={};let i=0,s,o;for(;i<n.length;){Um.lastIndex=i;const a=Um.exec(n),u=n.slice(i,a?a.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:o=u,i+=u.length),a&&(s=a[0],i++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function $m(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ly(e){return e.join(" ").trim()}function cy(e,t,n){const r=n?vN(n):void 0;function i(s,o,...a){let u;if(s==null){u={type:"root",children:[]};const l=o;a.unshift(l)}else{u=bN(s,t);const l=u.tagName.toLowerCase(),c=r?r.get(l):void 0;if(u.tagName=c||l,xN(o))a.unshift(o);else for(const[d,f]of Object.entries(o))yN(e,u.properties,d,f)}for(const l of a)sd(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function xN(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function yN(e,t,n,r){const i=Ju(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=$m(r):i.commaSeparated?s=Hm(r):i.commaOrSpaceSeparated?s=$m(Hm(r).join(" ")):s=zm(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?EN(r):String(r);if(Array.isArray(s)){const o=[];for(const a of s)o.push(zm(i,i.property,a));s=o}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function sd(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(const n of t)sd(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?sd(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function zm(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||wo(n)===wo(t)))return!0}return n}function EN(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function vN(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const kN=["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"],TN=cy(Vo,"div"),wN=cy(Ir,"g",kN);function SN(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let o=0;for(;;){let a=n[o];if(a===void 0){const u=qm(t,n[o-1]);a=u===-1?t.length+1:u+1,n[o]=a}if(a>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const a=n[n.length-1],u=qm(t,a),l=u===-1?t.length+1:u+1;if(a===l)break;n.push(l)}const o=(s.line>1?n[s.line-2]:0)+s.column-1;if(o<n[s.line-1])return o}}}function qm(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
55
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Gr={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/"},dy={}.hasOwnProperty,_N=Object.prototype;function CN(e,t){const n=t||{};return qf({file:n.file||void 0,location:!1,schema:n.space==="svg"?Ir:Vo,verbose:n.verbose||!1},e)}function qf(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Ma(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:fy(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),o=SN(s),a=o.toPoint(0),u=o.toPoint(s.length);n.position={start:a,end:u}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Ma(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Ma(e,r,n),n}default:return n=AN(e,t),n}}function fy(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=qf(e,t[n]);r.push(i)}return r}function AN(e,t){const n=e.schema;e.schema=t.namespaceURI===Gr.svg?Ir:Vo;let r=-1;const i={};for(;++r<t.attrs.length;){const a=t.attrs[r],u=(a.prefix?a.prefix+":":"")+a.name;dy.call(_N,u)||(i[u]=a.value)}const o=(e.schema.space==="svg"?wN:TN)(t.tagName,i,fy(e,t.childNodes));if(Ma(e,t,o),o.tagName==="template"){const a=t,u=a.sourceCodeLocation,l=u&&u.startTag&&Pi(u.startTag),c=u&&u.endTag&&Pi(u.endTag),d=qf(e,a.content);l&&c&&e.file&&(d.position={start:l.end,end:c.start}),o.content=d}return e.schema=n,o}function Ma(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=IN(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function IN(e,t,n){const r=Pi(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let o;if(n.attrs)for(o in n.attrs)dy.call(n.attrs,o)&&(s[Ju(e.schema,o).property]=Pi(n.attrs[o]));n.startTag;const a=Pi(n.startTag),u=n.endTag?Pi(n.endTag):void 0,l={opening:a};u&&(l.closing=u),l.properties=s,t.data={position:l}}}return r}function Pi(e){const t=Wm({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Wm({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Wm(e){return e.line&&e.column?e:void 0}const Vm={}.hasOwnProperty;function hy(e,t){const n=t||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&Vm.call(i,e)){const u=String(i[e]);o=Vm.call(a,u)?a[u]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const NN={},RN={}.hasOwnProperty,py=hy("type",{handlers:{root:LN,element:jN,text:DN,comment:FN,doctype:MN}});function ON(e,t){const r=(t||NN).space;return py(e,r==="svg"?Ir:Vo)}function LN(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Wf(e.children,n,t),hs(e,n),n}function PN(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Wf(e.children,n,t),hs(e,n),n}function MN(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return hs(e,t),t}function DN(e){const t={nodeName:"#text",value:e.value,parentNode:null};return hs(e,t),t}function FN(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return hs(e,t),t}function jN(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Ir);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&RN.call(e.properties,s)){const u=BN(r,s,e.properties[s]);u&&i.push(u)}}const o=r.space,a={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Gr[o],childNodes:[],parentNode:null};return a.childNodes=Wf(e.children,a,r),hs(e,a),e.tagName==="template"&&e.content&&(a.content=PN(e.content,r)),a}function BN(e,t,n){const r=Ju(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?uy(n):ly(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=Gr[r.space]}return i}function Wf(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=py(e[r],n);s.parentNode=t,i.push(s)}return i}function hs(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const HN=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],UN=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),lt="�";var N;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(N||(N={}));const $t={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function my(e){return e>=55296&&e<=57343}function $N(e){return e>=56320&&e<=57343}function zN(e,t){return(e-55296)*1024+9216+t}function gy(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function by(e){return e>=64976&&e<=65007||UN.has(e)}var Y;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Y||(Y={}));const qN=65536;class WN{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=qN,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,o=i+n,a=s+n;return{code:t,startLine:r,endLine:r,startCol:o,endCol:o,startOffset:a,endOffset:a}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if($N(n))return this.pos++,this._addGap(),zN(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(Y.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;let t=this.html.charCodeAt(this.pos);return t===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):t===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,my(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===N.LINE_FEED||t===N.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){gy(t)?this._err(Y.controlCharacterInInputStream):by(t)&&this._err(Y.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var We;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(We||(We={}));function xy(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const VN=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),KN=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function YN(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=KN.get(e))!==null&&t!==void 0?t:e}var vt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(vt||(vt={}));const GN=32;var gr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(gr||(gr={}));function od(e){return e>=vt.ZERO&&e<=vt.NINE}function XN(e){return e>=vt.UPPER_A&&e<=vt.UPPER_F||e>=vt.LOWER_A&&e<=vt.LOWER_F}function QN(e){return e>=vt.UPPER_A&&e<=vt.UPPER_Z||e>=vt.LOWER_A&&e<=vt.LOWER_Z||od(e)}function ZN(e){return e===vt.EQUALS||QN(e)}var Et;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Et||(Et={}));var Xn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Xn||(Xn={}));class JN{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Et.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Xn.Strict}startEntity(t){this.decodeMode=t,this.state=Et.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Et.EntityStart:return t.charCodeAt(n)===vt.NUM?(this.state=Et.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Et.NamedEntity,this.stateNamedEntity(t,n));case Et.NumericStart:return this.stateNumericStart(t,n);case Et.NumericDecimal:return this.stateNumericDecimal(t,n);case Et.NumericHex:return this.stateNumericHex(t,n);case Et.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|GN)===vt.LOWER_X?(this.state=Et.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Et.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(od(i)||XN(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(od(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===vt.SEMI)this.consumed+=1;else if(this.decodeMode===Xn.Strict)return 0;return this.emitCodePoint(YN(this.result),this.consumed),this.errors&&(t!==vt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&gr.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=e3(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Xn.Attribute&&(s===0||ZN(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&gr.VALUE_LENGTH)>>14,s!==0){if(o===vt.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Xn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&gr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~gr.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Et.NamedEntity:return this.result!==0&&(this.decodeMode!==Xn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Et.NumericDecimal:return this.emitNumericEntity(0,2);case Et.NumericHex:return this.emitNumericEntity(0,3);case Et.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Et.EntityStart:return 0}}}function e3(e,t,n,r){const i=(t&gr.BRANCH_LENGTH)>>7,s=t&gr.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:e[n+u]-1}let o=n,a=o+i-1;for(;o<=a;){const u=o+a>>>1,l=e[u];if(l<r)o=u+1;else if(l>r)a=u-1;else return e[u+i]}return-1}var te;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(te||(te={}));var Zr;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Zr||(Zr={}));var sn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(sn||(sn={}));var z;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(z||(z={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const t3=new Map([[z.A,g.A],[z.ADDRESS,g.ADDRESS],[z.ANNOTATION_XML,g.ANNOTATION_XML],[z.APPLET,g.APPLET],[z.AREA,g.AREA],[z.ARTICLE,g.ARTICLE],[z.ASIDE,g.ASIDE],[z.B,g.B],[z.BASE,g.BASE],[z.BASEFONT,g.BASEFONT],[z.BGSOUND,g.BGSOUND],[z.BIG,g.BIG],[z.BLOCKQUOTE,g.BLOCKQUOTE],[z.BODY,g.BODY],[z.BR,g.BR],[z.BUTTON,g.BUTTON],[z.CAPTION,g.CAPTION],[z.CENTER,g.CENTER],[z.CODE,g.CODE],[z.COL,g.COL],[z.COLGROUP,g.COLGROUP],[z.DD,g.DD],[z.DESC,g.DESC],[z.DETAILS,g.DETAILS],[z.DIALOG,g.DIALOG],[z.DIR,g.DIR],[z.DIV,g.DIV],[z.DL,g.DL],[z.DT,g.DT],[z.EM,g.EM],[z.EMBED,g.EMBED],[z.FIELDSET,g.FIELDSET],[z.FIGCAPTION,g.FIGCAPTION],[z.FIGURE,g.FIGURE],[z.FONT,g.FONT],[z.FOOTER,g.FOOTER],[z.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[z.FORM,g.FORM],[z.FRAME,g.FRAME],[z.FRAMESET,g.FRAMESET],[z.H1,g.H1],[z.H2,g.H2],[z.H3,g.H3],[z.H4,g.H4],[z.H5,g.H5],[z.H6,g.H6],[z.HEAD,g.HEAD],[z.HEADER,g.HEADER],[z.HGROUP,g.HGROUP],[z.HR,g.HR],[z.HTML,g.HTML],[z.I,g.I],[z.IMG,g.IMG],[z.IMAGE,g.IMAGE],[z.INPUT,g.INPUT],[z.IFRAME,g.IFRAME],[z.KEYGEN,g.KEYGEN],[z.LABEL,g.LABEL],[z.LI,g.LI],[z.LINK,g.LINK],[z.LISTING,g.LISTING],[z.MAIN,g.MAIN],[z.MALIGNMARK,g.MALIGNMARK],[z.MARQUEE,g.MARQUEE],[z.MATH,g.MATH],[z.MENU,g.MENU],[z.META,g.META],[z.MGLYPH,g.MGLYPH],[z.MI,g.MI],[z.MO,g.MO],[z.MN,g.MN],[z.MS,g.MS],[z.MTEXT,g.MTEXT],[z.NAV,g.NAV],[z.NOBR,g.NOBR],[z.NOFRAMES,g.NOFRAMES],[z.NOEMBED,g.NOEMBED],[z.NOSCRIPT,g.NOSCRIPT],[z.OBJECT,g.OBJECT],[z.OL,g.OL],[z.OPTGROUP,g.OPTGROUP],[z.OPTION,g.OPTION],[z.P,g.P],[z.PARAM,g.PARAM],[z.PLAINTEXT,g.PLAINTEXT],[z.PRE,g.PRE],[z.RB,g.RB],[z.RP,g.RP],[z.RT,g.RT],[z.RTC,g.RTC],[z.RUBY,g.RUBY],[z.S,g.S],[z.SCRIPT,g.SCRIPT],[z.SEARCH,g.SEARCH],[z.SECTION,g.SECTION],[z.SELECT,g.SELECT],[z.SOURCE,g.SOURCE],[z.SMALL,g.SMALL],[z.SPAN,g.SPAN],[z.STRIKE,g.STRIKE],[z.STRONG,g.STRONG],[z.STYLE,g.STYLE],[z.SUB,g.SUB],[z.SUMMARY,g.SUMMARY],[z.SUP,g.SUP],[z.TABLE,g.TABLE],[z.TBODY,g.TBODY],[z.TEMPLATE,g.TEMPLATE],[z.TEXTAREA,g.TEXTAREA],[z.TFOOT,g.TFOOT],[z.TD,g.TD],[z.TH,g.TH],[z.THEAD,g.THEAD],[z.TITLE,g.TITLE],[z.TR,g.TR],[z.TRACK,g.TRACK],[z.TT,g.TT],[z.U,g.U],[z.UL,g.UL],[z.SVG,g.SVG],[z.VAR,g.VAR],[z.WBR,g.WBR],[z.XMP,g.XMP]]);function ps(e){var t;return(t=t3.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const ie=g,n3={[te.HTML]:new Set([ie.ADDRESS,ie.APPLET,ie.AREA,ie.ARTICLE,ie.ASIDE,ie.BASE,ie.BASEFONT,ie.BGSOUND,ie.BLOCKQUOTE,ie.BODY,ie.BR,ie.BUTTON,ie.CAPTION,ie.CENTER,ie.COL,ie.COLGROUP,ie.DD,ie.DETAILS,ie.DIR,ie.DIV,ie.DL,ie.DT,ie.EMBED,ie.FIELDSET,ie.FIGCAPTION,ie.FIGURE,ie.FOOTER,ie.FORM,ie.FRAME,ie.FRAMESET,ie.H1,ie.H2,ie.H3,ie.H4,ie.H5,ie.H6,ie.HEAD,ie.HEADER,ie.HGROUP,ie.HR,ie.HTML,ie.IFRAME,ie.IMG,ie.INPUT,ie.LI,ie.LINK,ie.LISTING,ie.MAIN,ie.MARQUEE,ie.MENU,ie.META,ie.NAV,ie.NOEMBED,ie.NOFRAMES,ie.NOSCRIPT,ie.OBJECT,ie.OL,ie.P,ie.PARAM,ie.PLAINTEXT,ie.PRE,ie.SCRIPT,ie.SECTION,ie.SELECT,ie.SOURCE,ie.STYLE,ie.SUMMARY,ie.TABLE,ie.TBODY,ie.TD,ie.TEMPLATE,ie.TEXTAREA,ie.TFOOT,ie.TH,ie.THEAD,ie.TITLE,ie.TR,ie.TRACK,ie.UL,ie.WBR,ie.XMP]),[te.MATHML]:new Set([ie.MI,ie.MO,ie.MN,ie.MS,ie.MTEXT,ie.ANNOTATION_XML]),[te.SVG]:new Set([ie.TITLE,ie.FOREIGN_OBJECT,ie.DESC]),[te.XLINK]:new Set,[te.XML]:new Set,[te.XMLNS]:new Set},ad=new Set([ie.H1,ie.H2,ie.H3,ie.H4,ie.H5,ie.H6]);z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT;var P;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(P||(P={}));const ht={DATA:P.DATA,RCDATA:P.RCDATA,RAWTEXT:P.RAWTEXT,SCRIPT_DATA:P.SCRIPT_DATA,PLAINTEXT:P.PLAINTEXT,CDATA_SECTION:P.CDATA_SECTION};function r3(e){return e>=N.DIGIT_0&&e<=N.DIGIT_9}function Vs(e){return e>=N.LATIN_CAPITAL_A&&e<=N.LATIN_CAPITAL_Z}function i3(e){return e>=N.LATIN_SMALL_A&&e<=N.LATIN_SMALL_Z}function lr(e){return i3(e)||Vs(e)}function Km(e){return lr(e)||r3(e)}function ba(e){return e+32}function yy(e){return e===N.SPACE||e===N.LINE_FEED||e===N.TABULATION||e===N.FORM_FEED}function Ym(e){return yy(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN}function s3(e){return e===N.NULL?Y.nullCharacterReference:e>1114111?Y.characterReferenceOutsideUnicodeRange:my(e)?Y.surrogateCharacterReference:by(e)?Y.noncharacterCharacterReference:gy(e)||e===N.CARRIAGE_RETURN?Y.controlCharacterReference:null}class o3{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=P.DATA,this.returnState=P.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new WN(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new JN(VN,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Y.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Y.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=s3(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:We.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:We.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:We.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:We.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(xy(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Y.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=ps(t.tagName),t.type===We.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Y.endTagWithAttributes),t.selfClosing&&this._err(Y.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case We.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case We.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case We.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:We.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=yy(t)?We.WHITESPACE_CHARACTER:t===N.NULL?We.NULL_CHARACTER:We.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(We.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=P.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Xn.Attribute:Xn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===P.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===P.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case P.DATA:{this._stateData(t);break}case P.RCDATA:{this._stateRcdata(t);break}case P.RAWTEXT:{this._stateRawtext(t);break}case P.SCRIPT_DATA:{this._stateScriptData(t);break}case P.PLAINTEXT:{this._statePlaintext(t);break}case P.TAG_OPEN:{this._stateTagOpen(t);break}case P.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case P.TAG_NAME:{this._stateTagName(t);break}case P.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case P.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case P.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case P.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case P.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case P.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case P.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case P.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case P.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case P.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case P.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case P.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case P.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case P.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case P.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case P.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case P.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case P.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case P.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case P.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case P.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case P.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case P.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case P.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case P.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case P.BOGUS_COMMENT:{this._stateBogusComment(t);break}case P.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case P.COMMENT_START:{this._stateCommentStart(t);break}case P.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case P.COMMENT:{this._stateComment(t);break}case P.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case P.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case P.COMMENT_END:{this._stateCommentEnd(t);break}case P.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case P.DOCTYPE:{this._stateDoctype(t);break}case P.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case P.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case P.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case P.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case P.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case P.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case P.CDATA_SECTION:{this._stateCdataSection(t);break}case P.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case P.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case P.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case P.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=P.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitCodePoint(t);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=P.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case N.LESS_THAN_SIGN:{this.state=P.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(lr(t))this._createStartTagToken(),this.state=P.TAG_NAME,this._stateTagName(t);else switch(t){case N.EXCLAMATION_MARK:{this.state=P.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=P.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(Y.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t);break}case N.EOF:{this._err(Y.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Y.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=P.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(lr(t))this._createEndTagToken(),this.state=P.TAG_NAME,this._stateTagName(t);else switch(t){case N.GREATER_THAN_SIGN:{this._err(Y.missingEndTagName),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Y.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=P.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.tagName+=lt;break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Vs(t)?ba(t):t)}}_stateRcdataLessThanSign(t){t===N.SOLIDUS?this.state=P.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){lr(t)?(this.state=P.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=P.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=P.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=P.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=P.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===N.SOLIDUS?this.state=P.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){lr(t)?(this.state=P.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case N.SOLIDUS:{this.state=P.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=P.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=P.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){lr(t)?(this.state=P.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===N.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===N.HYPHEN_MINUS?(this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=P.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=P.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_ESCAPED,this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===N.SOLIDUS?this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:lr(t)?(this._emitChars("<"),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){lr(t)?(this.state=P.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith($t.SCRIPT,!1)&&Ym(this.preprocessor.peek($t.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$t.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case N.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case N.HYPHEN_MINUS:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=P.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(lt);break}case N.EOF:{this._err(Y.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===N.SOLIDUS?(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith($t.SCRIPT,!1)&&Ym(this.preprocessor.peek($t.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<$t.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=P.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=P.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._err(Y.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=P.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=P.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=P.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(Y.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.currentAttr.name+=lt;break}default:this.currentAttr.name+=String.fromCodePoint(Vs(t)?ba(t):t)}}_stateAfterAttributeName(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=P.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=P.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=P.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=P.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=P.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingAttributeValue),this.state=P.DATA,this.emitCurrentTagToken();break}default:this.state=P.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case N.QUOTATION_MARK:{this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.currentAttr.value+=lt;break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case N.APOSTROPHE:{this.state=P.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.currentAttr.value+=lt;break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),this.currentAttr.value+=lt;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(Y.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=P.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=P.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=P.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this._err(Y.missingWhitespaceBetweenAttributes),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=P.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(Y.eofInTag),this._emitEOFToken();break}default:this._err(Y.unexpectedSolidusInTag),this.state=P.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.data+=lt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch($t.DASH_DASH,!0)?(this._createCommentToken($t.DASH_DASH.length+1),this.state=P.COMMENT_START):this._consumeSequenceIfMatch($t.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation($t.DOCTYPE.length+1),this.state=P.DOCTYPE):this._consumeSequenceIfMatch($t.CDATA_START,!0)?this.inForeignNode?this.state=P.CDATA_SECTION:(this._err(Y.cdataInHtmlContent),this._createCommentToken($t.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=P.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Y.incorrectlyOpenedComment),this._createCommentToken(2),this.state=P.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case N.HYPHEN_MINUS:{this.state=P.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptClosingOfEmptyComment),this.state=P.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=P.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=P.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptClosingOfEmptyComment),this.state=P.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(Y.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=P.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=P.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=P.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.data+=lt;break}case N.EOF:{this._err(Y.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case N.EXCLAMATION_MARK:{n.data+="!",this.state=P.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=P.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===N.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=P.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===N.HYPHEN_MINUS?this.state=P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=P.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==N.GREATER_THAN_SIGN&&t!==N.EOF&&this._err(Y.nestedComment),this.state=P.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{this.state=P.COMMENT_END;break}case N.EOF:{this._err(Y.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=P.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=P.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(Y.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=P.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case N.HYPHEN_MINUS:{n.data+="--!",this.state=P.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(Y.incorrectlyClosedComment),this.state=P.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(Y.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=P.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case N.EOF:{this._err(Y.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingWhitespaceBeforeDoctypeName),this.state=P.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Vs(t))this._createDoctypeToken(String.fromCharCode(ba(t))),this.state=P.DOCTYPE_NAME;else switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(Y.unexpectedNullCharacter),this._createDoctypeToken(lt),this.state=P.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=P.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.name+=lt;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Vs(t)?ba(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch($t.PUBLIC,!1)?this.state=P.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch($t.SYSTEM,!1)?this.state=P.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Y.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(Y.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(Y.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.publicId+=lt;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case N.APOSTROPHE:{this.state=P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.publicId+=lt;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(Y.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(Y.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(Y.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(Y.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(Y.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case N.QUOTATION_MARK:{this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.systemId+=lt;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case N.APOSTROPHE:{this.state=P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(Y.unexpectedNullCharacter),n.systemId+=lt;break}case N.GREATER_THAN_SIGN:{this._err(Y.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.EOF:{this._err(Y.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Y.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=P.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=P.DATA;break}case N.NULL:{this._err(Y.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case N.RIGHT_SQUARE_BRACKET:{this.state=P.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(Y.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===N.RIGHT_SQUARE_BRACKET?this.state=P.CDATA_SECTION_END:(this._emitChars("]"),this.state=P.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case N.GREATER_THAN_SIGN:{this.state=P.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=P.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Km(this.preprocessor.peek(1))?P.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Km(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===N.SEMICOLON&&this._err(Y.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Ey=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),Gm=new Set([...Ey,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),su=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),a3=new Set([...su,g.OL,g.UL]),u3=new Set([...su,g.BUTTON]),Xm=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Qm=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),l3=new Set([g.TR,g.TEMPLATE,g.HTML]),c3=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),d3=new Set([g.TABLE,g.TEMPLATE,g.HTML]),f3=new Set([g.TD,g.TH]);class h3{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===te.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==te.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ad,te.HTML)}popUntilTableCellPopped(){this.popUntilPopped(f3,te.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(d3,te.HTML)}clearBackToTableBodyContext(){this.clearBackTo(c3,te.HTML)}clearBackToTableRowContext(){this.clearBackTo(l3,te.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case te.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case te.SVG:{if(Qm.has(i))return!1;break}case te.MATHML:{if(Xm.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,su)}hasInListItemScope(t){return this.hasInDynamicScope(t,a3)}hasInButtonScope(t){return this.hasInDynamicScope(t,u3)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case te.HTML:{if(ad.has(n))return!0;if(su.has(n))return!1;break}case te.SVG:{if(Qm.has(n))return!1;break}case te.MATHML:{if(Xm.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===te.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===te.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===te.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ey.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gm.has(this.currentTagId);)this.pop()}}const ql=3;var On;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(On||(On={}));const Zm={type:On.Marker};class p3{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let a=0;a<this.entries.length;a++){const u=this.entries[a];if(u.type===On.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===o){const c=this.treeAdapter.getAttrList(l);c.length===i&&r.push({idx:a,attrs:c})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<ql)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<ql)return;const i=new Map(n.map(o=>[o.name,o.value]));let s=0;for(let o=0;o<r.length;o++){const a=r[o];a.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=ql&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(Zm)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:On.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:On.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Zm);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===On.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===On.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===On.Element&&n.element===t)}}const cr={createDocument(){return{nodeName:"#document",mode:sn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};cr.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(cr.isTextNode(n)){n.value+=t;return}}cr.appendChild(e,cr.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&cr.isTextNode(r)?r.value+=t:cr.insertBefore(e,cr.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},vy="html",m3="about:legacy-compat",g3="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ky=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],b3=[...ky,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],x3=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ty=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],y3=[...Ty,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Jm(e,t){return t.some(n=>e.startsWith(n))}function E3(e){return e.name===vy&&e.publicId===null&&(e.systemId===null||e.systemId===m3)}function v3(e){if(e.name!==vy)return sn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===g3)return sn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),x3.has(n))return sn.QUIRKS;let r=t===null?b3:ky;if(Jm(n,r))return sn.QUIRKS;if(r=t===null?Ty:y3,Jm(n,r))return sn.LIMITED_QUIRKS}return sn.NO_QUIRKS}const e0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},k3="definitionurl",T3="definitionURL",w3=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),S3=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:te.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:te.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:te.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:te.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:te.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:te.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:te.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:te.XML}],["xml:space",{prefix:"xml",name:"space",namespace:te.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:te.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:te.XMLNS}]]),_3=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),C3=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function A3(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===Zr.COLOR||r===Zr.SIZE||r===Zr.FACE)||C3.has(t)}function wy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===k3){e.attrs[t].name=T3;break}}function Sy(e){for(let t=0;t<e.attrs.length;t++){const n=w3.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Vf(e){for(let t=0;t<e.attrs.length;t++){const n=S3.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function I3(e){const t=_3.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ps(e.tagName))}function N3(e,t){return t===te.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function R3(e,t,n){if(t===te.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Zr.ENCODING){const i=n[r].value.toLowerCase();return i===e0.TEXT_HTML||i===e0.APPLICATION_XML}}return t===te.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function O3(e,t,n,r){return(!r||r===te.HTML)&&R3(e,t,n)||(!r||r===te.MATHML)&&N3(e,t)}const L3="hidden",P3=8,M3=3;var M;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(M||(M={}));const D3={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},_y=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),t0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:cr,onParseError:null};class n0{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=M.INITIAL,this.originalInsertionMode=M.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...t0,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new o3(this.options,this),this.activeFormattingElements=new p3(this.treeAdapter),this.fragmentContextID=r?ps(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new h3(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...t0,...n};t??(t=r.treeAdapter.createElement(z.TEMPLATE,te.HTML,[]));const i=r.treeAdapter.createElement("documentmock",te.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===g.TEMPLATE&&s.tmplInsertionModeStack.unshift(M.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:D3,o={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(o)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===te.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,te.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=M.TEXT}switchToPlaintextParsing(){this.insertionMode=M.TEXT,this.originalInsertionMode=M.IN_BODY,this.tokenizer.state=ht.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==te.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=ht.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=ht.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=ht.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=ht.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,te.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,te.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(z.HTML,te.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,o=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:u,endCol:l,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:u,endCol:l,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===We.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===te.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,te.HTML)}_processToken(t){switch(t.type){case We.CHARACTER:{this.onCharacter(t);break}case We.NULL_CHARACTER:{this.onNullCharacter(t);break}case We.COMMENT:{this.onComment(t);break}case We.DOCTYPE:{this.onDoctype(t);break}case We.START_TAG:{this._processStartTag(t);break}case We.END_TAG:{this.onEndTag(t);break}case We.EOF:{this.onEof(t);break}case We.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return O3(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===On.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=M.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=M.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=M.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=M.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=M.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=M.IN_TABLE;return}case g.BODY:{this.insertionMode=M.IN_BODY;return}case g.FRAMESET:{this.insertionMode=M.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?M.AFTER_HEAD:M.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=M.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=M.IN_HEAD;return}break}}this.insertionMode=M.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=M.IN_SELECT_IN_TABLE;return}}this.insertionMode=M.IN_SELECT}_isElementCausesFosterParenting(t){return _y.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===te.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return n3[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){fO(this,t);return}switch(this.insertionMode){case M.INITIAL:{Cs(this,t);break}case M.BEFORE_HTML:{so(this,t);break}case M.BEFORE_HEAD:{oo(this,t);break}case M.IN_HEAD:{ao(this,t);break}case M.IN_HEAD_NO_SCRIPT:{uo(this,t);break}case M.AFTER_HEAD:{lo(this,t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:{Ay(this,t);break}case M.TEXT:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{Wl(this,t);break}case M.IN_TABLE_TEXT:{Py(this,t);break}case M.IN_COLUMN_GROUP:{ou(this,t);break}case M.AFTER_BODY:{au(this,t);break}case M.AFTER_AFTER_BODY:{Da(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){dO(this,t);return}switch(this.insertionMode){case M.INITIAL:{Cs(this,t);break}case M.BEFORE_HTML:{so(this,t);break}case M.BEFORE_HEAD:{oo(this,t);break}case M.IN_HEAD:{ao(this,t);break}case M.IN_HEAD_NO_SCRIPT:{uo(this,t);break}case M.AFTER_HEAD:{lo(this,t);break}case M.TEXT:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{Wl(this,t);break}case M.IN_COLUMN_GROUP:{ou(this,t);break}case M.AFTER_BODY:{au(this,t);break}case M.AFTER_AFTER_BODY:{Da(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ud(this,t);return}switch(this.insertionMode){case M.INITIAL:case M.BEFORE_HTML:case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_TEMPLATE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{ud(this,t);break}case M.IN_TABLE_TEXT:{As(this,t);break}case M.AFTER_BODY:{z3(this,t);break}case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{q3(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case M.INITIAL:{W3(this,t);break}case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:{this._err(t,Y.misplacedDoctype);break}case M.IN_TABLE_TEXT:{As(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Y.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?hO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Cs(this,t);break}case M.BEFORE_HTML:{V3(this,t);break}case M.BEFORE_HEAD:{Y3(this,t);break}case M.IN_HEAD:{kn(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Q3(this,t);break}case M.AFTER_HEAD:{J3(this,t);break}case M.IN_BODY:{Lt(this,t);break}case M.IN_TABLE:{is(this,t);break}case M.IN_TABLE_TEXT:{As(this,t);break}case M.IN_CAPTION:{GR(this,t);break}case M.IN_COLUMN_GROUP:{Gf(this,t);break}case M.IN_TABLE_BODY:{nl(this,t);break}case M.IN_ROW:{rl(this,t);break}case M.IN_CELL:{ZR(this,t);break}case M.IN_SELECT:{Fy(this,t);break}case M.IN_SELECT_IN_TABLE:{eO(this,t);break}case M.IN_TEMPLATE:{nO(this,t);break}case M.AFTER_BODY:{iO(this,t);break}case M.IN_FRAMESET:{sO(this,t);break}case M.AFTER_FRAMESET:{aO(this,t);break}case M.AFTER_AFTER_BODY:{lO(this,t);break}case M.AFTER_AFTER_FRAMESET:{cO(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?pO(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Cs(this,t);break}case M.BEFORE_HTML:{K3(this,t);break}case M.BEFORE_HEAD:{G3(this,t);break}case M.IN_HEAD:{X3(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Z3(this,t);break}case M.AFTER_HEAD:{eR(this,t);break}case M.IN_BODY:{tl(this,t);break}case M.TEXT:{BR(this,t);break}case M.IN_TABLE:{So(this,t);break}case M.IN_TABLE_TEXT:{As(this,t);break}case M.IN_CAPTION:{XR(this,t);break}case M.IN_COLUMN_GROUP:{QR(this,t);break}case M.IN_TABLE_BODY:{ld(this,t);break}case M.IN_ROW:{Dy(this,t);break}case M.IN_CELL:{JR(this,t);break}case M.IN_SELECT:{jy(this,t);break}case M.IN_SELECT_IN_TABLE:{tO(this,t);break}case M.IN_TEMPLATE:{rO(this,t);break}case M.AFTER_BODY:{Hy(this,t);break}case M.IN_FRAMESET:{oO(this,t);break}case M.AFTER_FRAMESET:{uO(this,t);break}case M.AFTER_AFTER_BODY:{Da(this,t);break}}}onEof(t){switch(this.insertionMode){case M.INITIAL:{Cs(this,t);break}case M.BEFORE_HTML:{so(this,t);break}case M.BEFORE_HEAD:{oo(this,t);break}case M.IN_HEAD:{ao(this,t);break}case M.IN_HEAD_NO_SCRIPT:{uo(this,t);break}case M.AFTER_HEAD:{lo(this,t);break}case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{Oy(this,t);break}case M.TEXT:{HR(this,t);break}case M.IN_TABLE_TEXT:{As(this,t);break}case M.IN_TEMPLATE:{By(this,t);break}case M.AFTER_BODY:case M.IN_FRAMESET:case M.AFTER_FRAMESET:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Yf(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===N.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.TEXT:case M.IN_COLUMN_GROUP:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{this._insertCharacters(t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:case M.AFTER_BODY:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{Cy(this,t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{Wl(this,t);break}case M.IN_TABLE_TEXT:{Ly(this,t);break}}}}function F3(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Ry(e,t),n}function j3(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function B3(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,o=i;o!==n;s++,o=i){i=e.openElements.getCommonAncestor(o);const a=e.activeFormattingElements.getElementEntry(o),u=a&&s>=M3;!a||u?(u&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(o)):(o=H3(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function H3(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function U3(e,t,n){const r=e.treeAdapter.getTagName(t),i=ps(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===g.TEMPLATE&&s===te.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function $3(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Kf(e,t){for(let n=0;n<P3;n++){const r=F3(e,t);if(!r)break;const i=j3(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=B3(e,i,r.element),o=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),o&&U3(e,o,s),$3(e,i,r)}}function ud(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function z3(e,t){e._appendCommentNode(t,e.openElements.items[0])}function q3(e,t){e._appendCommentNode(t,e.document)}function Yf(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function W3(e,t){e._setDocumentType(t);const n=t.forceQuirks?sn.QUIRKS:v3(t);E3(t)||e._err(t,Y.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=M.BEFORE_HTML}function Cs(e,t){e._err(t,Y.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,sn.QUIRKS),e.insertionMode=M.BEFORE_HTML,e._processToken(t)}function V3(e,t){t.tagID===g.HTML?(e._insertElement(t,te.HTML),e.insertionMode=M.BEFORE_HEAD):so(e,t)}function K3(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&so(e,t)}function so(e,t){e._insertFakeRootElement(),e.insertionMode=M.BEFORE_HEAD,e._processToken(t)}function Y3(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.HEAD:{e._insertElement(t,te.HTML),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD;break}default:oo(e,t)}}function G3(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?oo(e,t):e._err(t,Y.endTagWithoutMatchingOpenElement)}function oo(e,t){e._insertFakeElement(z.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD,e._processToken(t)}function kn(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,te.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,ht.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,ht.RAWTEXT):(e._insertElement(t,te.HTML),e.insertionMode=M.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,ht.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,ht.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=M.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(M.IN_TEMPLATE);break}case g.HEAD:{e._err(t,Y.misplacedStartTagForHeadElement);break}default:ao(e,t)}}function X3(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=M.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{ao(e,t);break}case g.TEMPLATE:{pi(e,t);break}default:e._err(t,Y.endTagWithoutMatchingOpenElement)}}function pi(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,Y.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Y.endTagWithoutMatchingOpenElement)}function ao(e,t){e.openElements.pop(),e.insertionMode=M.AFTER_HEAD,e._processToken(t)}function Q3(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{kn(e,t);break}case g.NOSCRIPT:{e._err(t,Y.nestedNoscriptInHead);break}default:uo(e,t)}}function Z3(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=M.IN_HEAD;break}case g.BR:{uo(e,t);break}default:e._err(t,Y.endTagWithoutMatchingOpenElement)}}function uo(e,t){const n=t.type===We.EOF?Y.openElementsLeftAfterEof:Y.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=M.IN_HEAD,e._processToken(t)}function J3(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.BODY:{e._insertElement(t,te.HTML),e.framesetOk=!1,e.insertionMode=M.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,te.HTML),e.insertionMode=M.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,Y.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),kn(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,Y.misplacedStartTagForHeadElement);break}default:lo(e,t)}}function eR(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{lo(e,t);break}case g.TEMPLATE:{pi(e,t);break}default:e._err(t,Y.endTagWithoutMatchingOpenElement)}}function lo(e,t){e._insertFakeElement(z.BODY,g.BODY),e.insertionMode=M.IN_BODY,el(e,t)}function el(e,t){switch(t.type){case We.CHARACTER:{Ay(e,t);break}case We.WHITESPACE_CHARACTER:{Cy(e,t);break}case We.COMMENT:{ud(e,t);break}case We.START_TAG:{Lt(e,t);break}case We.END_TAG:{tl(e,t);break}case We.EOF:{Oy(e,t);break}}}function Cy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Ay(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function tR(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function nR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function rR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_FRAMESET)}function iR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML)}function sR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ad.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,te.HTML)}function oR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function aR(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML),n||(e.formElement=e.openElements.current))}function uR(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===g.LI&&i===g.LI||(n===g.DD||n===g.DT)&&(i===g.DD||i===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==g.ADDRESS&&i!==g.DIV&&i!==g.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML)}function lR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML),e.tokenizer.state=ht.PLAINTEXT}function cR(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML),e.framesetOk=!1}function dR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(Kf(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function hR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(Kf(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,te.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function mR(e,t){e.treeAdapter.getDocumentMode(e.document)!==sn.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,te.HTML),e.framesetOk=!1,e.insertionMode=M.IN_TABLE}function Iy(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ny(e){const t=xy(e,Zr.TYPE);return t!=null&&t.toLowerCase()===L3}function gR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,te.HTML),Ny(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function bR(e,t){e._appendElement(t,te.HTML),t.ackSelfClosing=!0}function xR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,te.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function yR(e,t){t.tagName=z.IMG,t.tagID=g.IMG,Iy(e,t)}function ER(e,t){e._insertElement(t,te.HTML),e.skipNextNewLine=!0,e.tokenizer.state=ht.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=M.TEXT}function vR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,ht.RAWTEXT)}function kR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,ht.RAWTEXT)}function r0(e,t){e._switchToTextParsing(t,ht.RAWTEXT)}function TR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===M.IN_TABLE||e.insertionMode===M.IN_CAPTION||e.insertionMode===M.IN_TABLE_BODY||e.insertionMode===M.IN_ROW||e.insertionMode===M.IN_CELL?M.IN_SELECT_IN_TABLE:M.IN_SELECT}function wR(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML)}function SR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,te.HTML)}function _R(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,te.HTML)}function CR(e,t){e._reconstructActiveFormattingElements(),wy(t),Vf(t),t.selfClosing?e._appendElement(t,te.MATHML):e._insertElement(t,te.MATHML),t.ackSelfClosing=!0}function AR(e,t){e._reconstructActiveFormattingElements(),Sy(t),Vf(t),t.selfClosing?e._appendElement(t,te.SVG):e._insertElement(t,te.SVG),t.ackSelfClosing=!0}function i0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,te.HTML)}function Lt(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{fR(e,t);break}case g.A:{dR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{sR(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{iR(e,t);break}case g.LI:case g.DD:case g.DT:{uR(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{Iy(e,t);break}case g.HR:{xR(e,t);break}case g.RB:case g.RTC:{SR(e,t);break}case g.RT:case g.RP:{_R(e,t);break}case g.PRE:case g.LISTING:{oR(e,t);break}case g.XMP:{vR(e,t);break}case g.SVG:{AR(e,t);break}case g.HTML:{tR(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{kn(e,t);break}case g.BODY:{nR(e,t);break}case g.FORM:{aR(e,t);break}case g.NOBR:{hR(e,t);break}case g.MATH:{CR(e,t);break}case g.TABLE:{mR(e,t);break}case g.INPUT:{gR(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{bR(e,t);break}case g.IMAGE:{yR(e,t);break}case g.BUTTON:{cR(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{pR(e,t);break}case g.IFRAME:{kR(e,t);break}case g.SELECT:{TR(e,t);break}case g.OPTION:case g.OPTGROUP:{wR(e,t);break}case g.NOEMBED:case g.NOFRAMES:{r0(e,t);break}case g.FRAMESET:{rR(e,t);break}case g.TEXTAREA:{ER(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?r0(e,t):i0(e,t);break}case g.PLAINTEXT:{lR(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:i0(e,t)}}function IR(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function NR(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=M.AFTER_BODY,Hy(e,t))}function RR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function OR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function LR(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(z.P,g.P),e._closePElement()}function PR(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function MR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function DR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function FR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function jR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function Ry(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],o=e.openElements.tagIDs[i];if(r===o&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,o))break}}function tl(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{Kf(e,t);break}case g.P:{LR(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{RR(e,t);break}case g.LI:{PR(e);break}case g.DD:case g.DT:{MR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{DR(e);break}case g.BR:{jR(e);break}case g.BODY:{IR(e,t);break}case g.HTML:{NR(e,t);break}case g.FORM:{OR(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{FR(e,t);break}case g.TEMPLATE:{pi(e,t);break}default:Ry(e,t)}}function Oy(e,t){e.tmplInsertionModeStack.length>0?By(e,t):Yf(e,t)}function BR(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function HR(e,t){e._err(t,Y.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Wl(e,t){if(e.openElements.currentTagId!==void 0&&_y.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=M.IN_TABLE_TEXT,t.type){case We.CHARACTER:{Py(e,t);break}case We.WHITESPACE_CHARACTER:{Ly(e,t);break}}else Ko(e,t)}function UR(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_CAPTION}function $R(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_COLUMN_GROUP}function zR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,g.COLGROUP),e.insertionMode=M.IN_COLUMN_GROUP,Gf(e,t)}function qR(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_TABLE_BODY}function WR(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,g.TBODY),e.insertionMode=M.IN_TABLE_BODY,nl(e,t)}function VR(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function KR(e,t){Ny(t)?e._appendElement(t,te.HTML):Ko(e,t),t.ackSelfClosing=!0}function YR(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,te.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function is(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{WR(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{kn(e,t);break}case g.COL:{zR(e,t);break}case g.FORM:{YR(e,t);break}case g.TABLE:{VR(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{qR(e,t);break}case g.INPUT:{KR(e,t);break}case g.CAPTION:{UR(e,t);break}case g.COLGROUP:{$R(e,t);break}default:Ko(e,t)}}function So(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{pi(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Ko(e,t)}}function Ko(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,el(e,t),e.fosterParentingEnabled=n}function Ly(e,t){e.pendingCharacterTokens.push(t)}function Py(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function As(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ko(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const My=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function GR(e,t){const n=t.tagID;My.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=M.IN_TABLE,is(e,t)):Lt(e,t)}function XR(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=M.IN_TABLE,n===g.TABLE&&So(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:tl(e,t)}}function Gf(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.COL:{e._appendElement(t,te.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{kn(e,t);break}default:ou(e,t)}}function QR(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE);break}case g.TEMPLATE:{pi(e,t);break}case g.COL:break;default:ou(e,t)}}function ou(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=M.IN_TABLE,e._processToken(t))}function nl(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(z.TR,g.TR),e.insertionMode=M.IN_ROW,rl(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE,is(e,t));break}default:is(e,t)}}function ld(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE,So(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:So(e,t)}}function rl(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,te.HTML),e.insertionMode=M.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY,nl(e,t));break}default:is(e,t)}}function Dy(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY,ld(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=M.IN_TABLE_BODY,ld(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:So(e,t)}}function ZR(e,t){const n=t.tagID;My.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),rl(e,t)):Lt(e,t)}function JR(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=M.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Dy(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:tl(e,t)}}function Fy(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,te.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,te.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,te.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{kn(e,t);break}}}function jy(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{pi(e,t);break}}}function eO(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Fy(e,t)}function tO(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):jy(e,t)}function nO(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{kn(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=M.IN_TABLE,e.insertionMode=M.IN_TABLE,is(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=M.IN_COLUMN_GROUP,e.insertionMode=M.IN_COLUMN_GROUP,Gf(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=M.IN_TABLE_BODY,e.insertionMode=M.IN_TABLE_BODY,nl(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=M.IN_ROW,e.insertionMode=M.IN_ROW,rl(e,t);break}default:e.tmplInsertionModeStack[0]=M.IN_BODY,e.insertionMode=M.IN_BODY,Lt(e,t)}}function rO(e,t){t.tagID===g.TEMPLATE&&pi(e,t)}function By(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Yf(e,t)}function iO(e,t){t.tagID===g.HTML?Lt(e,t):au(e,t)}function Hy(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=M.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else au(e,t)}function au(e,t){e.insertionMode=M.IN_BODY,el(e,t)}function sO(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.FRAMESET:{e._insertElement(t,te.HTML);break}case g.FRAME:{e._appendElement(t,te.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{kn(e,t);break}}}function oO(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=M.AFTER_FRAMESET))}function aO(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.NOFRAMES:{kn(e,t);break}}}function uO(e,t){t.tagID===g.HTML&&(e.insertionMode=M.AFTER_AFTER_FRAMESET)}function lO(e,t){t.tagID===g.HTML?Lt(e,t):Da(e,t)}function Da(e,t){e.insertionMode=M.IN_BODY,el(e,t)}function cO(e,t){switch(t.tagID){case g.HTML:{Lt(e,t);break}case g.NOFRAMES:{kn(e,t);break}}}function dO(e,t){t.chars=lt,e._insertCharacters(t)}function fO(e,t){e._insertCharacters(t),e.framesetOk=!1}function Uy(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==te.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function hO(e,t){if(A3(t))Uy(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===te.MATHML?wy(t):r===te.SVG&&(I3(t),Sy(t)),Vf(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function pO(e,t){if(t.tagID===g.P||t.tagID===g.BR){Uy(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===te.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR;const il=$y("end"),$n=$y("start");function $y(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function zy(e){const t=$n(e),n=il(e);if(t&&n)return{start:t,end:n}}const mO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,gO=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),s0={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function qy(e,t){const n=_O(e),r=hy("type",{handlers:{root:bO,element:xO,text:yO,comment:Vy,doctype:EO,raw:kO},unknown:TO}),i={parser:n?new n0(s0):n0.getFragmentParser(void 0,s0),handle(a){r(a,i)},stitches:!1,options:t||{}};r(e,i),ms(i,$n());const s=n?i.parser.document:i.parser.getFragment(),o=CN(s,{file:i.options.file});return i.stitches&&vn(o,"comment",function(a,u,l){const c=a;if(c.value.stitch&&l&&u!==void 0){const d=l.children;return d[u]=c.value.stitch,u}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function Wy(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function bO(e,t){Wy(e.children,t)}function xO(e,t){wO(e,t),Wy(e.children,t),SO(e,t)}function yO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:We.CHARACTER,chars:e.value,location:Yo(e)};ms(t,$n(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function EO(e,t){const n={type:We.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Yo(e)};ms(t,$n(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function vO(e,t){t.stitches=!0;const n=CO(e);if("children"in e&&"children"in n){const r=qy({type:"root",children:e.children},t.options);n.children=r.children}Vy({type:"comment",value:{stitch:n}},t)}function Vy(e,t){const n=e.value,r={type:We.COMMENT,data:n,location:Yo(e)};ms(t,$n(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function kO(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Ky(t,$n(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(mO,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function TO(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))vO(n,t);else{let r="";throw gO.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function ms(e,t){Ky(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=ht.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Ky(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function wO(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===ht.PLAINTEXT)return;ms(t,$n(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:Gr.html;i===Gr.html&&n==="svg"&&(i=Gr.svg);const s=ON({...e,children:[]},{space:i===Gr.svg?"svg":"html"}),o={type:We.START_TAG,tagName:n,tagID:ps(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Yo(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function SO(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&HN.includes(n)||t.parser.tokenizer.state===ht.PLAINTEXT)return;ms(t,il(e));const r={type:We.END_TAG,tagName:n,tagID:ps(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Yo(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===ht.RCDATA||t.parser.tokenizer.state===ht.RAWTEXT||t.parser.tokenizer.state===ht.SCRIPT_DATA)&&(t.parser.tokenizer.state=ht.DATA)}function _O(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Yo(e){const t=$n(e)||{line:void 0,column:void 0,offset:void 0},n=il(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function CO(e){return"children"in e?si({...e,children:[]}):si(e)}function cd(e){return function(t,n){return qy(t,{...e,file:n})}}const Br=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Wr={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Br,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Br],h2:[["className","sr-only"]],img:[...Br,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Br,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Br],table:[...Br],ul:[...Br,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},dr={}.hasOwnProperty;function AO(e,t){let n={type:"root",children:[]};const r={schema:t?{...Wr,...t}:Wr,stack:[]},i=Yy(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function Yy(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return IO(e,n);case"doctype":return NO(e,n);case"element":return RO(e,n);case"root":return OO(e,n);case"text":return LO(e,n)}}}function IO(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return Go(s,t),s}}function NO(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Go(n,t),n}}function RO(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Gy(e,t.children),i=PO(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&dr.call(e.schema.ancestors,n))){const a=e.schema.ancestors[n];let u=-1;for(s=!1;++u<a.length;)e.stack.includes(a[u])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return Go(o,t),o}function OO(e,t){const r={type:"root",children:Gy(e,t.children)};return Go(r,t),r}function LO(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Go(r,t),r}function Gy(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=Yy(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function PO(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&dr.call(r,n)?r[n]:void 0,o=r&&dr.call(r,"*")?r["*"]:void 0,a=t&&typeof t=="object"?t:{},u={};let l;for(l in a)if(dr.call(a,l)){const c=a[l];let d=o0(e,a0(s,l),l,c);d==null&&(d=o0(e,a0(o,l),l,c)),d!=null&&(u[l]=d)}if(i&&dr.call(i,n)){const c=i[n];for(l in c)dr.call(c,l)&&!dr.call(u,l)&&(u[l]=c[l])}return u}function o0(e,t,n,r){return t?Array.isArray(r)?MO(e,t,n,r):Xy(e,t,n,r):void 0}function MO(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const o=Xy(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&s.push(o)}return s}function Xy(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&DO(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const o=t[s];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function DO(e,t,n){const r=e.schema.protocols&&dr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),o=i.indexOf("?"),a=i.indexOf("#"),u=i.indexOf("/");if(s<0||u>-1&&s>u||o>-1&&s>o||a>-1&&s>a)return!0;let l=-1;for(;++l<r.length;){const c=r[l];if(s===c.length&&i.slice(0,c.length)===c)return!0}return!1}function Go(e,t){const n=zy(t);t.data&&(e.data=si(t.data)),n&&(e.position=n)}function a0(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Qy(e){return function(t){return AO(t,e)}}function u0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const jt=Nr(/[A-Za-z]/),Rt=Nr(/[\dA-Za-z]/),FO=Nr(/[#-'*+\--9=?A-Z^-~]/);function uu(e){return e!==null&&(e<32||e===127)}const dd=Nr(/\d/),jO=Nr(/[\dA-Fa-f]/),BO=Nr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const sl=Nr(/\p{P}|\p{S}/u),oi=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function HO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function UO(e,t,n){const i=Xu((n||{}).ignore||[]),s=$O(t);let o=-1;for(;++o<s.length;)jf(e,"text",a);function a(l,c){let d=-1,f;for(;++d<c.length;){const h=c[d],m=f?f.children:void 0;if(i(h,m?m.indexOf(h):void 0,f))return;f=h}if(f)return u(l,c)}function u(l,c){const d=c[c.length-1],f=s[o][0],h=s[o][1];let m=0;const E=d.children.indexOf(l);let y=!1,v=[];f.lastIndex=0;let k=f.exec(l.value);for(;k;){const S=k.index,T={index:k.index,input:k.input,stack:[...c,l]};let w=h(...k,T);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?f.lastIndex=S+1:(m!==S&&v.push({type:"text",value:l.value.slice(m,S)}),Array.isArray(w)?v.push(...w):w&&v.push(w),m=S+k[0].length,y=!0),!f.global)break;k=f.exec(l.value)}return y?(m<l.value.length&&v.push({type:"text",value:l.value.slice(m)}),d.children.splice(E,1,...v)):v=[l],E+v.length}}function $O(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([zO(i[0]),qO(i[1])])}return t}function zO(e){return typeof e=="string"?new RegExp(HO(e),"g"):e}function qO(e){return typeof e=="function"?e:function(){return e}}const Vl="phrasing",Kl=["autolink","link","image","label"];function WO(){return{transforms:[ZO],enter:{literalAutolink:KO,literalAutolinkEmail:Yl,literalAutolinkHttp:Yl,literalAutolinkWww:Yl},exit:{literalAutolink:QO,literalAutolinkEmail:XO,literalAutolinkHttp:YO,literalAutolinkWww:GO}}}function VO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vl,notInConstruct:Kl},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vl,notInConstruct:Kl},{character:":",before:"[ps]",after:"\\/",inConstruct:Vl,notInConstruct:Kl}]}}function KO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yl(e){this.config.enter.autolinkProtocol.call(this,e)}function YO(e){this.config.exit.autolinkProtocol.call(this,e)}function GO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function XO(e){this.config.exit.autolinkEmail.call(this,e)}function QO(e){this.exit(e)}function ZO(e){UO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JO],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,e6]],{ignore:["link","linkReference"]})}function JO(e,t,n,r,i){let s="";if(!Zy(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!t6(n)))return!1;const o=n6(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function e6(e,t,n,r){return!Zy(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function t6(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function n6(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=u0(e,"(");let s=u0(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Zy(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||oi(n)||sl(n))&&(!t||n!==47)}function xn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Jy.peek=d6;function r6(){this.buffer()}function i6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function s6(){this.buffer()}function o6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function a6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function u6(e){this.exit(e)}function l6(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function c6(e){this.exit(e)}function d6(){return"["}function Jy(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function f6(){return{enter:{gfmFootnoteCallString:r6,gfmFootnoteCall:i6,gfmFootnoteDefinitionLabelString:s6,gfmFootnoteDefinition:o6},exit:{gfmFootnoteCallString:a6,gfmFootnoteCall:u6,gfmFootnoteDefinitionLabelString:l6,gfmFootnoteDefinition:c6}}}function h6(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Jy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let u=a.move("[^");const l=s.enter("footnoteDefinition"),c=s.enter("label");return u+=a.move(s.safe(s.associationId(r),{before:u,after:"]"})),c(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
56
+ `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?eE:p6))),l(),u}}function p6(e,t,n){return t===0?e:eE(e,t,n)}function eE(e,t,n){return(n?"":" ")+e}const m6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];tE.peek=E6;function g6(){return{canContainEols:["delete"],enter:{strikethrough:x6},exit:{strikethrough:y6}}}function b6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:m6}],handlers:{delete:tE}}}function x6(e){this.enter({type:"delete",children:[]},e)}function y6(e){this.exit(e)}function tE(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function E6(){return"~"}function v6(e){return e.length}function k6(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||v6,s=[],o=[],a=[],u=[];let l=0,c=-1;for(;++c<e.length;){const x=[],E=[];let y=-1;for(e[c].length>l&&(l=e[c].length);++y<e[c].length;){const v=T6(e[c][y]);if(n.alignDelimiters!==!1){const k=i(v);E[y]=k,(u[y]===void 0||k>u[y])&&(u[y]=k)}x.push(v)}o[c]=x,a[c]=E}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<l;)s[d]=l0(r[d]);else{const x=l0(r);for(;++d<l;)s[d]=x}d=-1;const f=[],h=[];for(;++d<l;){const x=s[d];let E="",y="";x===99?(E=":",y=":"):x===108?E=":":x===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,u[d]-E.length-y.length);const k=E+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=E.length+v+y.length,v>u[d]&&(u[d]=v),h[d]=v),f[d]=k}o.splice(1,0,f),a.splice(1,0,h),c=-1;const m=[];for(;++c<o.length;){const x=o[c],E=a[c];d=-1;const y=[];for(;++d<l;){const v=x[d]||"";let k="",S="";if(n.alignDelimiters!==!1){const T=u[d]-(E[d]||0),w=s[d];w===114?k=" ".repeat(T):w===99?T%2?(k=" ".repeat(T/2+.5),S=" ".repeat(T/2-.5)):(k=" ".repeat(T/2),S=k):S=" ".repeat(T)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(k),y.push(v),n.alignDelimiters!==!1&&y.push(S),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==l-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
57
+ `)}function T6(e){return e==null?"":String(e)}function l0(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function w6(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),S6);return i(),o}function S6(e,t,n){return">"+(n?"":" ")+e}function _6(e,t){return c0(e,t.inConstruct,!0)&&!c0(e,t.notInConstruct,!1)}function c0(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 d0(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
58
+ `&&_6(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
59
+ `}function C6(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function A6(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 I6(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function N6(e,t,n,r){const i=I6(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(A6(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,R6);return d(),f}const a=n.createTracker(r),u=i.repeat(Math.max(C6(s,i)+1,3)),l=n.enter("codeFenced");let c=a.move(u);if(e.lang){const d=n.enter(`codeFencedLang${o}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:`
60
+ `,encode:["`"],...a.current()})),d()}return c+=a.move(`
61
+ `),s&&(c+=a.move(s+`
62
+ `)),c+=a.move(u),l(),c}function R6(e,t,n){return(n?"":" ")+e}function Xf(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function O6(e,t,n,r){const i=Xf(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":`
63
+ `,...u.current()}))),a(),e.title&&(a=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),o(),l}function L6(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function _o(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ss(e){if(e===null||st(e)||oi(e))return 1;if(sl(e))return 2}function lu(e,t,n){const r=ss(e),i=ss(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}}nE.peek=P6;function nE(e,t,n,r){const i=L6(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const l=u.charCodeAt(0),c=lu(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=_o(l)+u.slice(1));const d=u.charCodeAt(u.length-1),f=lu(r.after.charCodeAt(0),d,i);f.inside&&(u=u.slice(0,-1)+_o(d));const h=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},a+u+h}function P6(e,t,n){return n.options.emphasis||"*"}const M6={};function Qf(e,t){const n=M6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rE(e,r,i)}function rE(e,t,n){if(D6(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 f0(e.children,t,n)}return Array.isArray(e)?f0(e,t,n):""}function f0(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=rE(e[i],t,n);return r.join("")}function D6(e){return!!(e&&typeof e=="object")}function F6(e,t){let n=!1;return vn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,nd}),!!((!e.depth||e.depth<3)&&Qf(e)&&(t.options.setext||n))}function j6(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(F6(e,n)){const c=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
64
+ `,after:`
65
+ `});return d(),c(),f+`
66
+ `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
67
+ `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");s.move(o+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
68
+ `,...s.current()});return/^[\t ]/.test(l)&&(l=_o(l.charCodeAt(0))+l.slice(1)),l=l?o+" "+l:o,n.options.closeAtx&&(l+=" "+o),u(),a(),l}iE.peek=B6;function iE(e){return e.value||""}function B6(){return"<"}sE.peek=H6;function sE(e,t,n,r){const i=Xf(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(e.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),o(),l}function H6(){return"!"}oE.peek=U6;function oE(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const l=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!l||l!==d?u+=a.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function U6(){return"!"}aE.peek=$6;function aE(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let u;if(o.atBreak)for(;u=a.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function $6(){return"`"}function uE(e,t){const n=Qf(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))}lE.peek=z6;function lE(e,t,n,r){const i=Xf(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,u;if(uE(e,n)){const c=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=c,d}a=n.enter("link"),u=n.enter("label");let l=o.move("[");return l+=o.move(n.containerPhrasing(e,{before:l,after:"](",...o.current()})),l+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(e.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(e.url,{before:l,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),l+=o.move(" "+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),a(),l}function z6(e,t,n){return uE(e,n)?"<":"["}cE.peek=q6;function cE(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const l=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!l||l!==d?u+=a.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function q6(){return"["}function Zf(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function W6(e){const t=Zf(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function V6(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dE(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function K6(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?V6(n):Zf(n);const a=e.ordered?o==="."?")":".":W6(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),dE(n)===o&&c){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=a),n.bulletCurrent=o;const l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),l}function Y6(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function G6(e,t,n,r){const i=Y6(n);let s=n.bulletCurrent||Zf(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,a.current()),c);return u(),l;function c(d,f,h){return f?(h?"":" ".repeat(o))+d:(h?s:s+" ".repeat(o-s.length))+d}}function X6(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const Q6=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Z6(e,t,n,r){return(e.children.some(function(o){return Q6(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function J6(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fE.peek=eL;function fE(e,t,n,r){const i=J6(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const l=u.charCodeAt(0),c=lu(r.before.charCodeAt(r.before.length-1),l,i);c.inside&&(u=_o(l)+u.slice(1));const d=u.charCodeAt(u.length-1),f=lu(r.after.charCodeAt(0),d,i);f.inside&&(u=u.slice(0,-1)+_o(d));const h=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},a+u+h}function eL(e,t,n){return n.options.strong||"*"}function tL(e,t,n,r){return n.safe(e.value,r)}function nL(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function rL(e,t,n){const r=(dE(n)+(n.options.ruleSpaces?" ":"")).repeat(nL(n));return n.options.ruleSpaces?r.slice(0,-1):r}const hE={blockquote:w6,break:d0,code:N6,definition:O6,emphasis:nE,hardBreak:d0,heading:j6,html:iE,image:sE,imageReference:oE,inlineCode:aE,link:lE,linkReference:cE,list:K6,listItem:G6,paragraph:X6,root:Z6,strong:fE,text:tL,thematicBreak:rL},h0=document.createElement("i");function Jf(e){const t="&"+e+";";h0.innerHTML=t;const n=h0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const iL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sL(e){return e.replace(iL,oL)}function oL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return pE(n.slice(s?2:1),s?16:10)}return Jf(n)||e}function aL(){return{enter:{table:uL,tableData:p0,tableHeader:p0,tableRow:cL},exit:{codeText:dL,table:lL,tableData:Gl,tableHeader:Gl,tableRow:Gl}}}function uL(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function lL(e){this.exit(e),this.data.inTable=void 0}function cL(e){this.enter({type:"tableRow",children:[]},e)}function Gl(e){this.exit(e)}function p0(e){this.enter({type:"tableCell",children:[]},e)}function dL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fL));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fL(e,t){return t==="|"?t:e}function hL(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
69
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:u,tableRow:a}};function o(h,m,x,E){return l(c(h,x,E),h.align)}function a(h,m,x,E){const y=d(h,x,E),v=l([y]);return v.slice(0,v.indexOf(`
70
+ `))}function u(h,m,x,E){const y=x.enter("tableCell"),v=x.enter("phrasing"),k=x.containerPhrasing(h,{...E,before:s,after:s});return v(),y(),k}function l(h,m){return k6(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function c(h,m,x){const E=h.children;let y=-1;const v=[],k=m.enter("table");for(;++y<E.length;)v[y]=d(E[y],m,x);return k(),v}function d(h,m,x){const E=h.children;let y=-1;const v=[],k=m.enter("tableRow");for(;++y<E.length;)v[y]=u(E[y],h,m,x);return k(),v}function f(h,m,x){let E=hE.inlineCode(h,m,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function pL(){return{exit:{taskListCheckValueChecked:m0,taskListCheckValueUnchecked:m0,paragraph:gL}}}function mL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bL}}}function m0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function bL(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let u=hE.listItem(e,t,n,{...r,...a.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+o}}function xL(){return[WO(),f6(),g6(),aL(),pL()]}function yL(e){return{extensions:[VO(),h6(e),b6(),hL(e),mL()]}}function Ct(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t: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);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function St(e,t){return e.length>0?(Ct(e,e.length,0,t),e):t}const g0={}.hasOwnProperty;function mE(e){const t={};let n=-1;for(;++n<e.length;)EL(t,e[n]);return t}function EL(e,t){let n;for(n in t){const i=(g0.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){g0.call(i,o)||(i[o]=[]);const a=s[o];vL(i[o],Array.isArray(a)?a:a?[a]:[])}}}function vL(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ct(e,0,0,r)}const kL={tokenize:AL,partial:!0},gE={tokenize:IL,partial:!0},bE={tokenize:NL,partial:!0},xE={tokenize:RL,partial:!0},TL={tokenize:OL,partial:!0},yE={name:"wwwAutolink",tokenize:_L,previous:vE},EE={name:"protocolAutolink",tokenize:CL,previous:kE},ir={name:"emailAutolink",tokenize:SL,previous:TE},zn={};function wL(){return{text:zn}}let Hr=48;for(;Hr<123;)zn[Hr]=ir,Hr++,Hr===58?Hr=65:Hr===91&&(Hr=97);zn[43]=ir;zn[45]=ir;zn[46]=ir;zn[95]=ir;zn[72]=[ir,EE];zn[104]=[ir,EE];zn[87]=[ir,yE];zn[119]=[ir,yE];function SL(e,t,n){const r=this;let i,s;return o;function o(d){return!fd(d)||!TE.call(r,r.previous)||eh(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return fd(d)?(e.consume(d),a):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(TL,c,l)(d):d===45||d===95||Rt(d)?(s=!0,e.consume(d),u):c(d)}function l(d){return e.consume(d),i=!0,u}function c(d){return s&&i&&jt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function _L(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!vE.call(r,r.previous)||eh(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kL,e.attempt(gE,e.attempt(bE,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function CL(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&kE.call(r,r.previous)&&!eh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(jt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),s?l:(s=!0,u)):n(d)}function l(d){return d===null||uu(d)||st(d)||oi(d)||sl(d)?n(d):e.attempt(gE,e.attempt(bE,c),n)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function AL(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function IL(e,t,n){let r,i,s;return o;function o(l){return l===46||l===95?e.check(xE,u,a)(l):l===null||st(l)||oi(l)||l!==45&&sl(l)?u(l):(s=!0,e.consume(l),o)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),o}function u(l){return i||r||!s?n(l):t(l)}}function NL(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(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(xE,t,s)(o):o===null||st(o)||oi(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function RL(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||st(a)||oi(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||st(a)||oi(a)?t(a):r(a)}function s(a){return jt(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):jt(a)?(e.consume(a),o):n(a)}}function OL(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Rt(s)?n(s):t(s)}}function vE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function kE(e){return!jt(e)}function TE(e){return!(e===47||fd(e))}function fd(e){return e===43||e===45||e===46||e===95||Rt(e)}function eh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function gs(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Rt(e.charCodeAt(n+1))&&Rt(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function bs(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const hd={name:"attention",resolveAll:LL,tokenize:PL};function LL(e,t){let n=-1,r,i,s,o,a,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};b0(d,-u),b0(f,u),o={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=St(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=St(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),l=St(l,bs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=St(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=St(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ct(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function PL(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ss(r);let s;return o;function o(u){return s=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===s)return e.consume(u),a;const l=e.exit("attentionSequence"),c=ss(u),d=!c||c===2&&i||n.includes(u),f=!i||i===2&&c||n.includes(r);return l._open=!!(s===42?d:d&&(i||!f)),l._close=!!(s===42?f:f&&(c||!d)),t(u)}}function b0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ML={name:"autolink",tokenize:DL};function DL(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return jt(h)?(e.consume(h),o):h===64?n(h):l(h)}function o(h){return h===43||h===45||h===46||Rt(h)?(r=1,a(h)):l(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||Rt(h))&&r++<32?(e.consume(h),a):(r=0,l(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||uu(h)?n(h):(e.consume(h),u)}function l(h){return h===64?(e.consume(h),c):FO(h)?(e.consume(h),l):n(h)}function c(h){return Rt(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||Rt(h))&&r++<63){const m=h===45?f:d;return e.consume(h),m}return n(h)}}function Xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return Ye(u)?(e.enter(n),a(u)):t(u)}function a(u){return Ye(u)&&s++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Xo={partial:!0,tokenize:FL};function FL(e,t,n){return r;function r(s){return Ye(s)?Xe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Oe(s)?t(s):n(s)}}const wE={continuation:{tokenize:BL},exit:HL,name:"blockQuote",tokenize:jL};function jL(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Ye(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function BL(e,t,n){const r=this;return i;function i(o){return Ye(o)?Xe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(wE,t,n)(o)}}function HL(e){e.exit("blockQuote")}const SE={name:"characterEscape",tokenize:UL};function UL(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return BO(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const _E={name:"characterReference",tokenize:$L};function $L(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),s=31,o=Rt,c(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=jO,c):(e.enter("characterReferenceValue"),s=7,o=dd,c(d))}function c(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===Rt&&!Jf(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),c):n(d)}}const x0={partial:!0,tokenize:qL},y0={concrete:!0,name:"codeFenced",tokenize:zL};function zL(e,t,n){const r=this,i={partial:!0,tokenize:T};let s=0,o=0,a;return u;function u(w){return l(w)}function l(w){const I=r.events[r.events.length-1];return s=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(w)}function c(w){return w===a?(o++,e.consume(w),c):o<3?n(w):(e.exit("codeFencedFenceSequence"),Ye(w)?Xe(e,d,"whitespace")(w):d(w))}function d(w){return w===null||Oe(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(x0,x,S)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||Oe(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):Ye(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xe(e,h,"whitespace")(w)):w===96&&w===a?n(w):(e.consume(w),f)}function h(w){return w===null||Oe(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||Oe(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===a?n(w):(e.consume(w),m)}function x(w){return e.attempt(i,S,E)(w)}function E(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return s>0&&Ye(w)?Xe(e,v,"linePrefix",s+1)(w):v(w)}function v(w){return w===null||Oe(w)?e.check(x0,x,S)(w):(e.enter("codeFlowValue"),k(w))}function k(w){return w===null||Oe(w)?(e.exit("codeFlowValue"),v(w)):(e.consume(w),k)}function S(w){return e.exit("codeFenced"),t(w)}function T(w,I,A){let O=0;return _;function _(j){return w.enter("lineEnding"),w.consume(j),w.exit("lineEnding"),D}function D(j){return w.enter("codeFencedFence"),Ye(j)?Xe(w,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):U(j)}function U(j){return j===a?(w.enter("codeFencedFenceSequence"),F(j)):A(j)}function F(j){return j===a?(O++,w.consume(j),F):O>=o?(w.exit("codeFencedFenceSequence"),Ye(j)?Xe(w,R,"whitespace")(j):R(j)):A(j)}function R(j){return j===null||Oe(j)?(w.exit("codeFencedFence"),I(j)):A(j)}}}function qL(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Xl={name:"codeIndented",tokenize:VL},WL={partial:!0,tokenize:KL};function VL(e,t,n){const r=this;return i;function i(l){return e.enter("codeIndented"),Xe(e,s,"linePrefix",5)(l)}function s(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(l):n(l)}function o(l){return l===null?u(l):Oe(l)?e.attempt(WL,o,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||Oe(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function KL(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Xe(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):Oe(o)?i(o):n(o)}}const YL={name:"codeText",previous:XL,resolve:GL,tokenize:QL};function GL(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 XL(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QL(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(s=e.enter("codeTextSequence"),i=0,c(d)):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||Oe(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),l)}function c(d){return d===96?(e.consume(d),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",l(d))}}class ZL{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Is(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Is(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Is(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Is(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Is(this.left,n.reverse())}}}function Is(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 CE(e){const t={};let n=-1,r,i,s,o,a,u,l;const c=new ZL(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,JL(c,n)),n=t[n],l=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return Ct(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function JL(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,u=[],l={};let c,d,f=-1,h=n,m=0,x=0;const E=[x];for(;h;){for(;e.get(++i)[1]!==h;);s.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),d&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(x=f+1,E.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),f=E.length;f--;){const y=a.slice(E[f],E[f+1]),v=s.pop();u.push([v,v+y.length-1]),e.splice(v,2,y)}for(u.reverse(),f=-1;++f<u.length;)l[m+u[f][0]]=m+u[f][1],m+=u[f][1]-u[f][0]-1;return l}const eP={resolve:nP,tokenize:rP},tP={partial:!0,tokenize:iP};function nP(e){return CE(e),e}function rP(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):Oe(a)?e.check(tP,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function iP(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xe(e,s,"linePrefix")}function s(o){if(o===null||Oe(o))return n(o);const 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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function AE(e,t,n,r,i,s,o,a,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||uu(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),f(y)):y===null||y===60||Oe(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!c&&(y===null||y===41||st(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):c<l&&y===40?(e.consume(y),c++,x):y===41?(e.consume(y),c--,x):y===null||y===32||y===40||uu(y)?n(y):(e.consume(y),y===92?E:x)}function E(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function IE(e,t,n,r,i,s){const o=this;let a=0,u;return l;function l(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),c}function c(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Oe(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),u||(u=!Ye(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function NE(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,u):n(f)}function u(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),l(f))}function l(f){return f===o?(e.exit(s),u(o)):f===null?n(f):Oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Xe(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===o||f===null||Oe(f)?(e.exit("chunkString"),l(f)):(e.consume(f),f===92?d:c)}function d(f){return f===o||f===92?(e.consume(f),c):c(f)}}function co(e,t){let n;return r;function r(i){return Oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ye(i)?Xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const sP={name:"definition",tokenize:aP},oP={partial:!0,tokenize:uP};function aP(e,t,n){const r=this;let i;return s;function s(h){return e.enter("definition"),o(h)}function o(h){return IE.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return st(h)?co(e,l)(h):l(h)}function l(h){return AE(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(oP,d,d)(h)}function d(h){return Ye(h)?Xe(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Oe(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function uP(e,t,n){return r;function r(a){return st(a)?co(e,i)(a):n(a)}function i(a){return NE(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Ye(a)?Xe(e,o,"whitespace")(a):o(a)}function o(a){return a===null||Oe(a)?t(a):n(a)}}const lP={name:"hardBreakEscape",tokenize:cP};function cP(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Oe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const dP={name:"headingAtx",resolve:fP,tokenize:hP};function fP(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ct(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function hP(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||st(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||Oe(c)?(e.exit("atxHeading"),t(c)):Ye(c)?Xe(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||st(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}const pP=["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"],E0=["pre","script","style","textarea"],mP={concrete:!0,name:"htmlFlow",resolveTo:xP,tokenize:yP},gP={partial:!0,tokenize:vP},bP={partial:!0,tokenize:EP};function xP(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 yP(e,t,n){const r=this;let i,s,o,a,u;return l;function l(L){return c(L)}function c(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),s=!0,x):L===63?(e.consume(L),i=3,r.interrupt?t:C):jt(L)?(e.consume(L),o=String.fromCharCode(L),E):n(L)}function f(L){return L===45?(e.consume(L),i=2,h):L===91?(e.consume(L),i=5,a=0,m):jt(L)?(e.consume(L),i=4,r.interrupt?t:C):n(L)}function h(L){return L===45?(e.consume(L),r.interrupt?t:C):n(L)}function m(L){const G="CDATA[";return L===G.charCodeAt(a++)?(e.consume(L),a===G.length?r.interrupt?t:U:m):n(L)}function x(L){return jt(L)?(e.consume(L),o=String.fromCharCode(L),E):n(L)}function E(L){if(L===null||L===47||L===62||st(L)){const G=L===47,re=o.toLowerCase();return!G&&!s&&E0.includes(re)?(i=1,r.interrupt?t(L):U(L)):pP.includes(o.toLowerCase())?(i=6,G?(e.consume(L),y):r.interrupt?t(L):U(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):s?v(L):k(L))}return L===45||Rt(L)?(e.consume(L),o+=String.fromCharCode(L),E):n(L)}function y(L){return L===62?(e.consume(L),r.interrupt?t:U):n(L)}function v(L){return Ye(L)?(e.consume(L),v):_(L)}function k(L){return L===47?(e.consume(L),_):L===58||L===95||jt(L)?(e.consume(L),S):Ye(L)?(e.consume(L),k):_(L)}function S(L){return L===45||L===46||L===58||L===95||Rt(L)?(e.consume(L),S):T(L)}function T(L){return L===61?(e.consume(L),w):Ye(L)?(e.consume(L),T):k(L)}function w(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,I):Ye(L)?(e.consume(L),w):A(L)}function I(L){return L===u?(e.consume(L),u=null,O):L===null||Oe(L)?n(L):(e.consume(L),I)}function A(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||st(L)?T(L):(e.consume(L),A)}function O(L){return L===47||L===62||Ye(L)?k(L):n(L)}function _(L){return L===62?(e.consume(L),D):n(L)}function D(L){return L===null||Oe(L)?U(L):Ye(L)?(e.consume(L),D):n(L)}function U(L){return L===45&&i===2?(e.consume(L),B):L===60&&i===1?(e.consume(L),q):L===62&&i===4?(e.consume(L),se):L===63&&i===3?(e.consume(L),C):L===93&&i===5?(e.consume(L),X):Oe(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gP,xe,F)(L)):L===null||Oe(L)?(e.exit("htmlFlowData"),F(L)):(e.consume(L),U)}function F(L){return e.check(bP,R,xe)(L)}function R(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),j}function j(L){return L===null||Oe(L)?F(L):(e.enter("htmlFlowData"),U(L))}function B(L){return L===45?(e.consume(L),C):U(L)}function q(L){return L===47?(e.consume(L),o="",$):U(L)}function $(L){if(L===62){const G=o.toLowerCase();return E0.includes(G)?(e.consume(L),se):U(L)}return jt(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),$):U(L)}function X(L){return L===93?(e.consume(L),C):U(L)}function C(L){return L===62?(e.consume(L),se):L===45&&i===2?(e.consume(L),C):U(L)}function se(L){return L===null||Oe(L)?(e.exit("htmlFlowData"),xe(L)):(e.consume(L),se)}function xe(L){return e.exit("htmlFlow"),t(L)}}function EP(e,t,n){const r=this;return i;function i(o){return Oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function vP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xo,t,n)}}const kP={name:"htmlText",tokenize:TP};function TP(e,t,n){const r=this;let i,s,o;return a;function a(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),u}function u(C){return C===33?(e.consume(C),l):C===47?(e.consume(C),T):C===63?(e.consume(C),k):jt(C)?(e.consume(C),A):n(C)}function l(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),s=0,m):jt(C)?(e.consume(C),v):n(C)}function c(C){return C===45?(e.consume(C),h):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),f):Oe(C)?(o=d,q(C)):(e.consume(C),d)}function f(C){return C===45?(e.consume(C),h):d(C)}function h(C){return C===62?B(C):C===45?f(C):d(C)}function m(C){const se="CDATA[";return C===se.charCodeAt(s++)?(e.consume(C),s===se.length?x:m):n(C)}function x(C){return C===null?n(C):C===93?(e.consume(C),E):Oe(C)?(o=x,q(C)):(e.consume(C),x)}function E(C){return C===93?(e.consume(C),y):x(C)}function y(C){return C===62?B(C):C===93?(e.consume(C),y):x(C)}function v(C){return C===null||C===62?B(C):Oe(C)?(o=v,q(C)):(e.consume(C),v)}function k(C){return C===null?n(C):C===63?(e.consume(C),S):Oe(C)?(o=k,q(C)):(e.consume(C),k)}function S(C){return C===62?B(C):k(C)}function T(C){return jt(C)?(e.consume(C),w):n(C)}function w(C){return C===45||Rt(C)?(e.consume(C),w):I(C)}function I(C){return Oe(C)?(o=I,q(C)):Ye(C)?(e.consume(C),I):B(C)}function A(C){return C===45||Rt(C)?(e.consume(C),A):C===47||C===62||st(C)?O(C):n(C)}function O(C){return C===47?(e.consume(C),B):C===58||C===95||jt(C)?(e.consume(C),_):Oe(C)?(o=O,q(C)):Ye(C)?(e.consume(C),O):B(C)}function _(C){return C===45||C===46||C===58||C===95||Rt(C)?(e.consume(C),_):D(C)}function D(C){return C===61?(e.consume(C),U):Oe(C)?(o=D,q(C)):Ye(C)?(e.consume(C),D):O(C)}function U(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),i=C,F):Oe(C)?(o=U,q(C)):Ye(C)?(e.consume(C),U):(e.consume(C),R)}function F(C){return C===i?(e.consume(C),i=void 0,j):C===null?n(C):Oe(C)?(o=F,q(C)):(e.consume(C),F)}function R(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||st(C)?O(C):(e.consume(C),R)}function j(C){return C===47||C===62||st(C)?O(C):n(C)}function B(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function q(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return Ye(C)?Xe(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):X(C)}function X(C){return e.enter("htmlTextData"),o(C)}}const th={name:"labelEnd",resolveAll:CP,resolveTo:AP,tokenize:IP},wP={tokenize:NP},SP={tokenize:RP},_P={tokenize:OP};function CP(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ct(e,0,e.length,n),e}function AP(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const u={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",u,t],["enter",l,t]],a=St(a,e.slice(s+1,s+r+3)),a=St(a,[["enter",c,t]]),a=St(a,bs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=St(a,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),a=St(a,e.slice(o+1)),a=St(a,[["exit",u,t]]),Ct(e,s,e.length,a),e}function IP(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?d(f):(o=r.parser.defined.includes(xn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(wP,c,o?c:d)(f):f===91?e.attempt(SP,c,o?l:d)(f):o?c(f):d(f)}function l(f){return e.attempt(_P,c,d)(f)}function c(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function NP(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return st(d)?co(e,s)(d):s(d)}function s(d){return d===41?c(d):AE(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return st(d)?co(e,u)(d):c(d)}function a(d){return n(d)}function u(d){return d===34||d===39||d===40?NE(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return st(d)?co(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function RP(e,t,n){const r=this;return i;function i(a){return IE.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function OP(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const LP={name:"labelStartImage",resolveAll:th.resolveAll,tokenize:PP};function PP(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const MP={name:"labelStartLink",resolveAll:th.resolveAll,tokenize:DP};function DP(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ql={name:"lineEnding",tokenize:FP};function FP(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xe(e,t,"linePrefix")}}const Fa={name:"thematicBreak",tokenize:jP};function jP(e,t,n){let r=0,i;return s;function s(l){return e.enter("thematicBreak"),o(l)}function o(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||Oe(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),Ye(l)?Xe(e,a,"whitespace")(l):a(l))}}const zt={continuation:{tokenize:$P},exit:qP,name:"list",tokenize:UP},BP={partial:!0,tokenize:WP},HP={partial:!0,tokenize:zP};function UP(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:dd(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Fa,n,l)(h):l(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return dd(h)&&++o<10?(e.consume(h),u):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),l(h)):n(h)}function l(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Xo,r.interrupt?n:c,e.attempt(BP,f,d))}function c(h){return r.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ye(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function $P(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xo,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xe(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Ye(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(HP,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xe(e,e.attempt(zt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zP(e,t,n){const r=this;return Xe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function qP(e){e.exit(this.containerState.type)}function WP(e,t,n){const r=this;return Xe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Ye(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const v0={name:"setextUnderline",resolveTo:VP,tokenize:KP};function VP(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function KP(e,t,n){const r=this;let i;return s;function s(l){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=l,o(l)):n(l)}function o(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),Ye(l)?Xe(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||Oe(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const YP={tokenize:nM,partial:!0};function GP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:JP,continuation:{tokenize:eM},exit:tM}},text:{91:{name:"gfmFootnoteCall",tokenize:ZP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:XP,resolveTo:QP}}}}function XP(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!o||!o._balanced)return n(u);const l=xn(r.sliceSerialize({start:o.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function QP(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function ZP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(s>999||d===93&&!o||d===null||d===91||st(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(xn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return st(d)||(o=!0),s++,e.consume(d),d===92?c:l}function c(d){return d===91||d===92||d===93?(e.consume(d),s++,l):l(d)}}function JP(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(m)}function c(m){if(o>999||m===93&&!a||m===null||m===91||st(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return s=xn(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return st(m)||(a=!0),o++,e.consume(m),m===92?d:c}function d(m){return m===91||m===92||m===93?(e.consume(m),o++,c):c(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),Xe(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function eM(e,t,n){return e.check(Xo,t,e.attempt(YP,t,n))}function tM(e){e.exit("gfmFootnoteDefinition")}function nM(e,t,n){const r=this;return Xe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function rM(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let l=u;for(;l--;)if(o[l][0]==="exit"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[l][1].end.offset-o[l][1].start.offset){o[u][1].type="strikethroughSequence",o[l][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[l][1].start),end:Object.assign({},o[u][1].end)},d={type:"strikethroughText",start:Object.assign({},o[l][1].end),end:Object.assign({},o[u][1].start)},f=[["enter",c,a],["enter",o[l][1],a],["exit",o[l][1],a],["enter",d,a]],h=a.parser.constructs.insideSpan.null;h&&Ct(f,f.length,0,bs(h,o.slice(l+1,u),a)),Ct(f,f.length,0,[["exit",d,a],["enter",o[u][1],a],["exit",o[u][1],a],["exit",c,a]]),Ct(o,l-1,u-l+3,f),u=l+f.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function s(o,a,u){const l=this.previous,c=this.events;let d=0;return f;function f(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(o.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const x=ss(l);if(m===126)return d>1?u(m):(o.consume(m),d++,h);if(d<2&&!n)return u(m);const E=o.exit("strikethroughSequenceTemporary"),y=ss(m);return E._open=!y||y===2&&!!x,E._close=!x||x===2&&!!y,a(m)}}}class iM{constructor(){this.map=[]}add(t,n,r){sM(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function sM(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 oM(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="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 aM(){return{flow:{null:{name:"table",tokenize:uM,resolveAll:lM}}}}function uM(e,t,n){const r=this;let i=0,s=0,o;return a;function a(_){let D=r.events.length-1;for(;D>-1;){const R=r.events[D][1].type;if(R==="lineEnding"||R==="linePrefix")D--;else break}const U=D>-1?r.events[D][1].type:null,F=U==="tableHead"||U==="tableRow"?w:u;return F===w&&r.parser.lazy[r.now().line]?n(_):F(_)}function u(_){return e.enter("tableHead"),e.enter("tableRow"),l(_)}function l(_){return _===124||(o=!0,s+=1),c(_)}function c(_){return _===null?n(_):Oe(_)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),h):n(_):Ye(_)?Xe(e,c,"whitespace")(_):(s+=1,o&&(o=!1,i+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),o=!0,c):(e.enter("data"),d(_)))}function d(_){return _===null||_===124||st(_)?(e.exit("data"),c(_)):(e.consume(_),_===92?f:d)}function f(_){return _===92||_===124?(e.consume(_),d):d(_)}function h(_){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(_):(e.enter("tableDelimiterRow"),o=!1,Ye(_)?Xe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?E(_):_===124?(o=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),x):T(_)}function x(_){return Ye(_)?Xe(e,E,"whitespace")(_):E(_)}function E(_){return _===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),y):_===45?(s+=1,y(_)):_===null||Oe(_)?S(_):T(_)}function y(_){return _===45?(e.enter("tableDelimiterFiller"),v(_)):T(_)}function v(_){return _===45?(e.consume(_),v):_===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(_))}function k(_){return Ye(_)?Xe(e,S,"whitespace")(_):S(_)}function S(_){return _===124?m(_):_===null||Oe(_)?!o||i!==s?T(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):T(_)}function T(_){return n(_)}function w(_){return e.enter("tableRow"),I(_)}function I(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),I):_===null||Oe(_)?(e.exit("tableRow"),t(_)):Ye(_)?Xe(e,I,"whitespace")(_):(e.enter("data"),A(_))}function A(_){return _===null||_===124||st(_)?(e.exit("data"),I(_)):(e.consume(_),_===92?O:A)}function O(_){return _===92||_===124?(e.consume(_),A):A(_)}}function lM(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,u=0,l,c,d;const f=new iM;for(;++n<e.length;){const h=e[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(k0(f,t,u,l,c),c=void 0,u=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,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",c,t]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=xa(f,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=xa(f,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,s[1]!==0?(o[0]=o[1],d=xa(f,t,s,i,n,d)):o[1]!==0&&(d=xa(f,t,o,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(u!==0&&k0(f,t,u,l,c),f.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=oM(t.events,n))}return e}function xa(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Ai(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const u=Ai(t.events,n[1]);if(s={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const l=Ai(t.events,n[2]),c=Ai(t.events,n[3]),d={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],h=t.events[n[3]];if(f[1].end=Object.assign({},h[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,x=n[3]-n[2]-1;e.add(m,x,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Ai(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function k0(e,t,n,r,i){const s=[],o=Ai(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ai(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const cM={name:"tasklistCheck",tokenize:fM};function dM(){return{text:{91:cM}}}function fM(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return st(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return Oe(u)?t(u):Ye(u)?e.check({tokenize:hM},t,n)(u):n(u)}}function hM(e,t,n){return Xe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function pM(e){return mE([wL(),GP(),rM(e),aM(),dM()])}const mM={};function gM(e){const t=this,n=e||mM,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(pM(n)),s.push(xL()),o.push(yL(n))}var bM=Object.defineProperty,xM=Object.defineProperties,yM=Object.getOwnPropertyDescriptors,T0=Object.getOwnPropertySymbols,EM=Object.prototype.hasOwnProperty,vM=Object.prototype.propertyIsEnumerable,w0=(e,t,n)=>t in e?bM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RE=(e,t)=>{for(var n in t||(t={}))EM.call(t,n)&&w0(e,n,t[n]);if(T0)for(var n of T0(t))vM.call(t,n)&&w0(e,n,t[n]);return e},OE=(e,t)=>xM(e,yM(t)),Ut=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},kM=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},TM=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!kM(e,n)&&(t+=1)}return t},Tr=(e,t)=>{let n=!1,r=!1,i=-1;for(let s=0;s<e.length;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}if(!r&&e[s]==="`")if(n){if(i<t&&t<s)return!0;n=!1,i=-1}else n=!0,i=s}return!1},wM=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,SM=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(wM,(t,n,r,i)=>Ut(e,i)?t:`${n}\\>${r}`),_M=/(\*\*)([^*]*\*?)$/,CM=/(__)([^_]*?)$/,AM=/(\*\*\*)([^*]*?)$/,IM=/(\*)([^*]*?)$/,NM=/(_)([^_]*?)$/,RM=/(`)([^`]*?)$/,OM=/(~~)([^~]*?)$/,mi=/^[\s_~*`]*$/,LE=/^[\s]*[-*+][\s]+$/,LM=/[\p{L}\p{N}_]/u,PM=/^```[^`\n]*```?$/,MM=/^\*{4,}$/,DM=/(__)([^_]+)_$/,FM=/(~~)([^~]+)~$/,S0=/~~/g,wr=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:LM.test(e)},jM=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},PE=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},ol=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},BM=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
71
+ `)return!1}return!1},ME=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?BM(e,t):!1;if(e[n]===`
72
+ `)return!1}return!1},HM=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
73
+ `)return!1}return!1},nh=(e,t,n)=>{let r=0;for(let u=t-1;u>=0;u-=1)if(e[u]===`
74
+ `){r=u+1;break}let i=e.length;for(let u=t;u<e.length;u+=1)if(e[u]===`
75
+ `){i=u;break}let s=e.substring(r,i),o=0,a=!1;for(let u of s)if(u===n)o+=1;else if(u!==" "&&u!==" "){a=!0;break}return o>=3&&!a},UM=(e,t,n,r)=>n==="\\"||e.includes("$")&&ol(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&wr(n)&&wr(r)||(!n||n===" "||n===" "||n===`
76
+ `)&&(!r||r===" "||r===" "||r===`
77
+ `)),DE=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="*")continue;let s=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";UM(e,i,s,o)||(t+=1)}return t},$M=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&ol(e,t)||ME(e,t)||HM(e,t)||n==="_"||r==="_"||n&&r&&wr(n)&&wr(r)),zM=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!=="_")continue;let s=i>0?e[i-1]:"",o=i<r-1?e[i+1]:"";$M(e,i,s,o)||(t+=1)}return t},qM=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},rh=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},_0=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},WM=(e,t,n)=>{if(!t||mi.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
78
+ `),i=r===-1?0:r+1,s=e.substring(i,n);return LE.test(s)&&t.includes(`
79
+ `)?!0:nh(e,n,"*")},VM=e=>{let t=e.match(_M);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Ut(e,r)||Tr(e,r)||WM(e,n,r)?e:rh(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},KM=(e,t,n)=>{if(!t||mi.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
80
+ `),i=r===-1?0:r+1,s=e.substring(i,n);return LE.test(s)&&t.includes(`
81
+ `)?!0:nh(e,n,"_")},YM=e=>{let t=e.match(CM);if(!t){let i=e.match(DM);if(i){let s=e.lastIndexOf(i[1]);if(!(Ut(e,s)||Tr(e,s))&&_0(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Ut(e,r)||Tr(e,r)||KM(e,n,r)?e:_0(e)%2===1?`${e}__`:e},GM=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!ol(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
82
+ `)&&(!i||i===" "||i===" "||i===`
83
+ `)||r&&i&&wr(r)&&wr(i))continue;return n}}return-1},XM=e=>{if(!e.match(IM))return e;let t=GM(e);if(t===-1||Ut(e,t)||Tr(e,t))return e;let n=e.substring(t+1);return!n||mi.test(n)?e:DE(e)%2===1?`${e}*`:e},FE=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!ol(e,n)&&!ME(e,n)){let r=n>0?e[n-1]:"",i=n<e.length-1?e[n+1]:"";if(r&&i&&wr(r)&&wr(i))continue;return n}}return-1},QM=e=>{let t=e.length;for(;t>0&&e[t-1]===`
84
+ `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},ZM=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(rh(t)%2!==1)return null;let n=t.indexOf("**"),r=FE(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},JM=e=>{if(!e.match(NM))return e;let t=FE(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||mi.test(n)||Ut(e,t)||Tr(e,t))return e;if(zM(e)%2===1){let r=ZM(e);return r!==null?r:QM(e)}return e},e4=e=>{let t=rh(e),n=DE(e);return t%2===0&&n%2===0},t4=(e,t,n)=>!t||mi.test(t)||Ut(e,n)||Tr(e,n)?!0:nh(e,n,"*"),n4=e=>{if(MM.test(e))return e;let t=e.match(AM);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return t4(e,n,r)?e:qM(e)%2===1?e4(e)?e:`${e}***`:e},r4=/<[a-zA-Z/][^>]*$/,i4=e=>{let t=e.match(r4);return!t||t.index===void 0||Ut(e,t.index)?e:e.substring(0,t.index).trimEnd()},s4=e=>!e.match(PM)||e.includes(`
85
+ `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,o4=e=>(e.match(/```/g)||[]).length%2===1,a4=e=>{let t=s4(e);if(t!==null)return t;let n=e.match(RM);if(n&&!o4(e)){let r=n[2];if(!r||mi.test(r))return e;if(TM(e)%2===1)return`${e}\``}return e},jE=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",u4=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!jE(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},l4=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!jE(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},c4=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
86
+ `,t)!==-1&&!e.endsWith(`
87
+ `)?`${e}
88
+ $$`:`${e}$$`},d4=e=>u4(e)%2===0?e:c4(e),f4=e=>l4(e)%2===1?`${e}$`:e,h4=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=jM(e,t);if(r===-1||Ut(e,r))return null;let i=r>0&&e[r-1]==="!",s=i?r-1:r,o=e.substring(0,s);if(i)return o;let a=e.substring(r+1,t);return n==="text-only"?`${o}${a}`:`${o}[${a}](streamdown:incomplete-link)`},C0=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!Ut(e,n)){if(n>0&&e[n-1]==="!")continue;let r=PE(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return t},p4=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t;if(!e.substring(t+1).includes("]")){let s=e.substring(0,i);if(r)return s;if(n==="text-only"){let o=C0(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}if(PE(e,t)===-1){let s=e.substring(0,i);if(r)return s;if(n==="text-only"){let o=C0(e,t);return e.substring(0,o)+e.substring(o+1)}return`${e}](streamdown:incomplete-link)`}return null},BE=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Ut(e,n)){let r=h4(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Ut(e,r)){let i=p4(e,r,t);if(i!==null)return i}return e},m4=/^-{1,2}$/,g4=/^[\s]*-{1,2}[\s]+$/,b4=/^={1,2}$/,x4=/^[\s]*={1,2}[\s]+$/,y4=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
89
+ `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(m4.test(i)&&!n.match(g4)){let s=r.split(`
90
+ `).at(-1);if(s&&s.trim().length>0)return`${e}​`}if(b4.test(i)&&!n.match(x4)){let s=r.split(`
91
+ `).at(-1);if(s&&s.trim().length>0)return`${e}​`}return e},E4=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),v4=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(E4,(t,n)=>Ut(e,n)?t:"\\~"),k4=e=>{var t,n;let r=e.match(OM);if(r){let i=r[2];if(!i||mi.test(i))return e;let s=e.lastIndexOf(r[1]);if(Ut(e,s)||Tr(e,s))return e;if(((t=e.match(S0))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(FM);if(i){let s=e.lastIndexOf(i[0].slice(0,2));if(Ut(e,s)||Tr(e,s))return e;if(((n=e.match(S0))==null?void 0:n.length)%2===1)return`${e}~`}}return e},Zl=e=>e!==!1,T4=e=>e===!0,Ft={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},w4=[{handler:{name:"singleTilde",handle:v4,priority:Ft.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:SM,priority:Ft.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:i4,priority:Ft.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:y4,priority:Ft.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:BE,priority:Ft.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:n4,priority:Ft.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:VM,priority:Ft.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:YM,priority:Ft.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:XM,priority:Ft.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:JM,priority:Ft.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:a4,priority:Ft.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:k4,priority:Ft.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:d4,priority:Ft.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:f4,priority:Ft.INLINE_KATEX},optionKey:"inlineKatex"}],S4=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return w4.filter(({handler:r,optionKey:i})=>r.name==="links"?Zl(e?.links)||Zl(e?.images):r.name==="inlineKatex"?T4(e?.inlineKatex):Zl(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:OE(RE({},r),{handle:s=>BE(s,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},_4=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=S4(t),s=((n=t?.handlers)!=null?n:[]).map(a=>{var u;return{handler:OE(RE({},a),{priority:(u=a.priority)!=null?u:Ft.DEFAULT}),earlyReturn:void 0}}),o=[...i,...s].sort((a,u)=>{var l,c;return((l=a.handler.priority)!=null?l:0)-((c=u.handler.priority)!=null?c:0)});for(let{handler:a,earlyReturn:u}of o)if(r=a.handle(r),u!=null&&u(r))return r;return r},C4=_4;function HE(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=HE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function UE(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=HE(e))&&(r&&(r+=" "),r+=t);return r}const A4=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},I4=(e,t)=>({classGroupId:e,validator:t}),$E=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cu="-",A0=[],N4="arbitrary..",R4=e=>{const t=L4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return O4(o);const a=o.split(cu),u=a[0]===""&&a.length>1?1:0;return zE(a,u,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const u=r[o],l=n[o];return u?l?A4(l,u):u:l||A0}return n[o]||A0}}},zE=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const l=zE(e,t+1,s);if(l)return l}const o=n.validators;if(o===null)return;const a=t===0?e.join(cu):e.slice(t).join(cu),u=o.length;for(let l=0;l<u;l++){const c=o[l];if(c.validator(a))return c.classGroupId}},O4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?N4+r:void 0})(),L4=e=>{const{theme:t,classGroups:n}=e;return P4(n,t)},P4=(e,t)=>{const n=$E();for(const r in e){const i=e[r];ih(i,n,r,t)}return n},ih=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];M4(o,t,n,r)}},M4=(e,t,n,r)=>{if(typeof e=="string"){D4(e,t,n);return}if(typeof e=="function"){F4(e,t,n,r);return}j4(e,t,n,r)},D4=(e,t,n)=>{const r=e===""?t:qE(t,e);r.classGroupId=n},F4=(e,t,n,r)=>{if(B4(e)){ih(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(I4(n,e))},j4=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,u]=i[o];ih(u,qE(t,a),n,r)}},qE=(e,t)=>{let n=e;const r=t.split(cu),i=r.length;for(let s=0;s<i;s++){const o=r[s];let a=n.nextPart.get(o);a||(a=$E(),n.nextPart.set(o,a)),n=a}return n},B4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,H4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,o)=>{n[s]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=r[s])!==void 0)return i(s,o),o},set(s,o){s in n?n[s]=o:i(s,o)}}},pd="!",I0=":",U4=[],N0=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),$4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,a=0,u=0,l;const c=i.length;for(let x=0;x<c;x++){const E=i[x];if(o===0&&a===0){if(E===I0){s.push(i.slice(u,x)),u=x+1;continue}if(E==="/"){l=x;continue}}E==="["?o++:E==="]"?o--:E==="("?a++:E===")"&&a--}const d=s.length===0?i:i.slice(u);let f=d,h=!1;d.endsWith(pd)?(f=d.slice(0,-1),h=!0):d.startsWith(pd)&&(f=d.slice(1),h=!0);const m=l&&l>u?l-u:void 0;return N0(s,h,f,m)};if(t){const i=t+I0,s=r;r=o=>o.startsWith(i)?s(o.slice(i.length)):N0(U4,!1,o,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},z4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const o=n[s],a=o[0]==="[",u=t.has(o);a||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},q4=e=>({cache:H4(e.cacheSize),parseClassName:$4(e),sortModifiers:z4(e),postfixLookupClassGroupIds:W4(e),...R4(e)}),W4=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},V4=/\s+/,K4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:o}=t,a=[],u=e.trim().split(V4);let l="";for(let c=u.length-1;c>=0;c-=1){const d=u[c],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:E}=n(d);if(f){l=d+(l.length>0?" "+l:l);continue}let y=!!E,v;if(y){const I=x.substring(0,E);v=r(I);const A=v&&o[v]?r(x):void 0;A&&A!==v&&(v=A,y=!1)}else v=r(x);if(!v){if(!y){l=d+(l.length>0?" "+l:l);continue}if(v=r(x),!v){l=d+(l.length>0?" "+l:l);continue}y=!1}const k=h.length===0?"":h.length===1?h[0]:s(h).join(":"),S=m?k+pd:k,T=S+v;if(a.indexOf(T)>-1)continue;a.push(T);const w=i(v,y);for(let I=0;I<w.length;++I){const A=w[I];a.push(S+A)}l=d+(l.length>0?" "+l:l)}return l},Y4=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=WE(n))&&(i&&(i+=" "),i+=r);return i},WE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=WE(e[r]))&&(n&&(n+=" "),n+=t);return n},G4=(e,...t)=>{let n,r,i,s;const o=u=>{const l=t.reduce((c,d)=>d(c),e());return n=q4(l),r=n.cache.get,i=n.cache.set,s=a,a(u)},a=u=>{const l=r(u);if(l)return l;const c=K4(u,n);return i(u,c),c};return s=o,(...u)=>s(Y4(...u))},X4=[],gt=e=>{const t=n=>n[e]||X4;return t.isThemeGetter=!0,t},VE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Q4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Z4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,J4=/\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$/,e5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,t5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ar=e=>Q4.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),_n=e=>!!e&&Number.isInteger(Number(e)),Jl=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Kn=e=>Z4.test(e),YE=()=>!0,r5=e=>J4.test(e)&&!e5.test(e),sh=()=>!1,i5=e=>t5.test(e),s5=e=>n5.test(e),o5=e=>!Te(e)&&!we(e),a5=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)),u5=e=>Rr(e,QE,sh),Te=e=>VE.test(e),Ur=e=>Rr(e,ZE,r5),R0=e=>Rr(e,g5,qe),l5=e=>Rr(e,ev,YE),c5=e=>Rr(e,JE,sh),O0=e=>Rr(e,GE,sh),d5=e=>Rr(e,XE,s5),ya=e=>Rr(e,tv,i5),we=e=>KE.test(e),Ns=e=>gi(e,ZE),f5=e=>gi(e,JE),L0=e=>gi(e,GE),h5=e=>gi(e,QE),p5=e=>gi(e,XE),Ea=e=>gi(e,tv,!0),m5=e=>gi(e,ev,!0),Rr=(e,t,n)=>{const r=VE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gi=(e,t,n=!1)=>{const r=KE.exec(e);return r?r[1]?t(r[1]):n:!1},GE=e=>e==="position"||e==="percentage",XE=e=>e==="image"||e==="url",QE=e=>e==="length"||e==="size"||e==="bg-size",ZE=e=>e==="length",g5=e=>e==="number",JE=e=>e==="family-name",ev=e=>e==="number"||e==="weight",tv=e=>e==="shadow",b5=()=>{const e=gt("color"),t=gt("font"),n=gt("text"),r=gt("font-weight"),i=gt("tracking"),s=gt("leading"),o=gt("breakpoint"),a=gt("container"),u=gt("spacing"),l=gt("radius"),c=gt("shadow"),d=gt("inset-shadow"),f=gt("text-shadow"),h=gt("drop-shadow"),m=gt("blur"),x=gt("perspective"),E=gt("aspect"),y=gt("ease"),v=gt("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...S(),we,Te],w=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],A=()=>[we,Te,u],O=()=>[ar,"full","auto",...A()],_=()=>[_n,"none","subgrid",we,Te],D=()=>["auto",{span:["full",_n,we,Te]},_n,we,Te],U=()=>[_n,"auto",we,Te],F=()=>["auto","min","max","fr",we,Te],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],q=()=>[ar,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[ar,"screen","full","dvw","lvw","svw","min","max","fit",...A()],X=()=>[ar,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],C=()=>[e,we,Te],se=()=>[...S(),L0,O0,{position:[we,Te]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",h5,u5,{size:[we,Te]}],G=()=>[Jl,Ns,Ur],re=()=>["","none","full",l,we,Te],ne=()=>["",qe,Ns,Ur],pe=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[qe,Jl,L0,O0],he=()=>["","none",m,we,Te],Ie=()=>["none",qe,we,Te],Me=()=>["none",qe,we,Te],Be=()=>[qe,we,Te],fe=()=>[ar,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[YE],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[o5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",qe],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ar,Te,we,E]}],container:["container"],"container-type":[{"@container":["","normal","size",we,Te]}],"container-named":[a5],columns:[{columns:[qe,Te,we,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:T()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[_n,"auto",we,Te]}],basis:[{basis:[ar,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,ar,"auto","initial","none",Te]}],grow:[{grow:["",qe,we,Te]}],shrink:[{shrink:["",qe,we,Te]}],order:[{order:[_n,"first","last","none",we,Te]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Ns,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,m5,l5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jl,Te]}],"font-family":[{font:[f5,c5,t]}],"font-features":[{"font-features":[Te]}],"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,we,Te]}],"line-clamp":[{"line-clamp":[qe,"none",we,R0]}],leading:[{leading:[s,...A()]}],"list-image":[{"list-image":["none",we,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:C()}],"text-color":[{text:C()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,Ur]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[qe,"auto",we,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[_n,we,Te]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,Te]}],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",we,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_n,we,Te],radial:["",we,Te],conic:[_n,we,Te]},p5,d5]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-bs":[{"border-bs":C()}],"border-color-be":[{"border-be":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,Te]}],"outline-w":[{outline:["",qe,Ns,Ur]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",c,Ea,ya]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",d,Ea,ya]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[qe,Ur]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",f,Ea,ya]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[qe,we,Te]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[we,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,Te]}],filter:[{filter:["","none",we,Te]}],blur:[{blur:he()}],brightness:[{brightness:[qe,we,Te]}],contrast:[{contrast:[qe,we,Te]}],"drop-shadow":[{"drop-shadow":["","none",h,Ea,ya]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",qe,we,Te]}],"hue-rotate":[{"hue-rotate":[qe,we,Te]}],invert:[{invert:["",qe,we,Te]}],saturate:[{saturate:[qe,we,Te]}],sepia:[{sepia:["",qe,we,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",we,Te]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,Te]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,Te]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,Te]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,Te]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,Te]}],ease:[{ease:["linear","initial",y,we,Te]}],delay:[{delay:[qe,we,Te]}],animate:[{animate:["none",v,we,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,we,Te]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:Me()}],"scale-x":[{"scale-x":Me()}],"scale-y":[{"scale-y":Me()}],"scale-z":[{"scale-z":Me()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[we,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],zoom:[{zoom:[_n,we,Te]}],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"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",we,Te]}],"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":C()}],"scrollbar-track-color":[{"scrollbar-track":C()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",we,Te]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[qe,Ns,Ur,R0]}],stroke:[{stroke:["none",...C()]}],"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"]}},nv=G4(b5),x5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E5={};function P0(e,t){return(E5.jsx?y5:x5).test(e)}const v5=/[ \t\n\f\r]/g;function k5(e){return typeof e=="object"?e.type==="text"?M0(e.value):!1:M0(e)}function M0(e){return e.replace(v5,"")===""}var ki={},ec,D0;function T5(){if(D0)return ec;D0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
92
+ `,l="/",c="*",d="",f="comment",h="declaration";function m(E,y){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];y=y||{};var v=1,k=1;function S(R){var j=R.match(t);j&&(v+=j.length);var B=R.lastIndexOf(u);k=~B?R.length-B:k+R.length}function T(){var R={line:v,column:k};return function(j){return j.position=new w(R),O(),j}}function w(R){this.start=R,this.end={line:v,column:k},this.source=y.source}w.prototype.content=E;function I(R){var j=new Error(y.source+":"+v+":"+k+": "+R);if(j.reason=R,j.filename=y.source,j.line=v,j.column=k,j.source=E,!y.silent)throw j}function A(R){var j=R.exec(E);if(j){var B=j[0];return S(B),E=E.slice(B.length),j}}function O(){A(n)}function _(R){var j;for(R=R||[];j=D();)j!==!1&&R.push(j);return R}function D(){var R=T();if(!(l!=E.charAt(0)||c!=E.charAt(1))){for(var j=2;d!=E.charAt(j)&&(c!=E.charAt(j)||l!=E.charAt(j+1));)++j;if(j+=2,d===E.charAt(j-1))return I("End of comment missing");var B=E.slice(2,j-2);return k+=2,S(B),E=E.slice(j),k+=2,R({type:f,comment:B})}}function U(){var R=T(),j=A(r);if(j){if(D(),!A(i))return I("property missing ':'");var B=A(s),q=R({type:h,property:x(j[0].replace(e,d)),value:B?x(B[0].replace(e,d)):d});return A(o),q}}function F(){var R=[];_(R);for(var j;j=U();)j!==!1&&(R.push(j),_(R));return R}return O(),F()}function x(E){return E?E.replace(a,d):d}return ec=m,ec}var F0;function w5(){if(F0)return ki;F0=1;var e=ki&&ki.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ki,"__esModule",{value:!0}),ki.default=n;const t=e(T5());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),a=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:c}=u;a?i(l,c,u):c&&(s=s||{},s[l]=c)}),s}return ki}var Rs={},j0;function S5(){if(j0)return Rs;j0=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(l){return!l||n.test(l)||e.test(l)},o=function(l,c){return c.toUpperCase()},a=function(l,c){return"".concat(c,"-")},u=function(l,c){return c===void 0&&(c={}),s(l)?l:(l=l.toLowerCase(),c.reactCompat?l=l.replace(i,a):l=l.replace(r,a),l.replace(t,o))};return Rs.camelCase=u,Rs}var Os,B0;function _5(){if(B0)return Os;B0=1;var e=Os&&Os.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(w5()),n=S5();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(o[(0,n.camelCase)(a,s)]=u)}),o}return r.default=r,Os=r,Os}var C5=_5();const A5=wb(C5);function fo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?H0(e.position):"start"in e||"end"in e?H0(e):"line"in e||"column"in e?md(e):""}function md(e){return U0(e&&e.line)+":"+U0(e&&e.column)}function H0(e){return md(e&&e.start)+"-"+md(e&&e.end)}function U0(e){return e&&typeof e=="number"?e:1}class Pt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=fo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const oh={}.hasOwnProperty,I5=new Map,N5=/[A-Z]/g,R5=new Set(["table","tbody","thead","tfoot","tr"]),O5=new Set(["td","th"]),rv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function L5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=U5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=H5(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ir:Vo,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=iv(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function iv(e,t,n){if(t.type==="element")return P5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return M5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return F5(e,t,n);if(t.type==="mdxjsEsm")return D5(e,t);if(t.type==="root")return j5(e,t,n);if(t.type==="text")return B5(e,t)}function P5(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ir,e.schema=i),e.ancestors.push(t);const s=ov(e,t.tagName,!1),o=$5(e,t);let a=uh(e,t);return R5.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!k5(u):!0})),sv(e,o,s,t),ah(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function M5(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Co(e,t.position)}function D5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Co(e,t.position)}function F5(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ir,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ov(e,t.name,!0),o=z5(e,t),a=uh(e,t);return sv(e,o,s,t),ah(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function j5(e,t,n){const r={};return ah(r,uh(e,t)),e.create(t,e.Fragment,r,n)}function B5(e,t){return t.value}function sv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ah(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function H5(e,t,n){return r;function r(i,s,o,a){const l=Array.isArray(o.children)?n:t;return a?l(s,o,a):l(s,o)}}function U5(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),u=$n(r);return t(i,s,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function $5(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&oh.call(t.properties,i)){const s=q5(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&O5.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function z5(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Co(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Co(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function uh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:I5;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const l=i.get(u)||0;o=u+"-"+l,i.set(u,l+1)}}const a=iv(e,s,o);a!==void 0&&n.push(a)}return n}function q5(e,t,n){const r=Ju(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uy(n):ly(n)),r.property==="style"){let i=typeof n=="object"?n:W5(e,String(n));return e.stylePropertyNameCase==="css"&&(i=V5(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?fN[r.property]||r.property:r.attribute,n]}}function W5(e,t){try{return A5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Pt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=rv+"#cannot-parse-style-attribute",i}}function ov(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=P0(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=P0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return oh.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Co(e)}function Co(e,t){const n=new Pt("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=rv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function V5(e){const t={};let n;for(n in e)oh.call(e,n)&&(t[K5(n)]=e[n]);return t}function K5(e){let t=e.replace(N5,Y5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Y5(e){return"-"+e.toLowerCase()}const tc={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"]},G5={tokenize:X5};function X5(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Xe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Oe(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const Q5={tokenize:Z5},$0={tokenize:J5};function Z5(e){const t=this,n=[];let r=0,i,s,o;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,u,l)(k)}return l(k)}function u(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const S=t.events.length;let T=S,w;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){w=t.events[T][1].end;break}y(r);let I=S;for(;I<t.events.length;)t.events[I][1].end={...w},I++;return Ct(t.events,T+1,0,t.events.slice(S)),t.events.length=I,l(k)}return a(k)}function l(k){if(r===n.length){if(!i)return f(k);if(i.currentConstruct&&i.currentConstruct.concrete)return m(k);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($0,c,d)(k)}function c(k){return i&&v(),y(r),f(k)}function d(k){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(k)}function f(k){return t.containerState={},e.attempt($0,h,m)(k)}function h(k){return r++,n.push([t.currentConstruct,t.containerState]),f(k)}function m(k){if(k===null){i&&v(),y(0),e.consume(k);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(k)}function x(k){if(k===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(k);return}return Oe(k)?(e.consume(k),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),x)}function E(k,S){const T=t.sliceStream(k);if(S&&T.push(null),k.previous=s,s&&(s.next=k),s=k,i.defineSkip(k.start),i.write(T),t.parser.lazy[k.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const I=t.events.length;let A=I,O,_;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(O){_=t.events[A][1].end;break}O=!0}for(y(r),w=I;w<t.events.length;)t.events[w][1].end={..._},w++;Ct(t.events,A+1,0,t.events.slice(I)),t.events.length=w}}function y(k){let S=n.length;for(;S-- >k;){const T=n[S];t.containerState=T[1],T[0].exit.call(t,e)}n.length=k}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function J5(e,t,n){return Xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const eD={tokenize:tD};function tD(e){const t=this,n=e.attempt(Xo,r,e.attempt(this.parser.constructs.flowInitial,i,Xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eP,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const nD={resolveAll:uv()},rD=av("string"),iD=av("text");function av(e){return{resolveAll:uv(e==="text"?sD:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(c){return l(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),s(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;const d=i[c];let f=-1;if(d)for(;++f<d.length;){const h=d[f];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function uv(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function sD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,u;for(;s--;){const l=i[s];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(l===-2)u=!0,a++;else if(l!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const l={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const oD={42:zt,43:zt,45:zt,48:zt,49:zt,50:zt,51:zt,52:zt,53:zt,54:zt,55:zt,56:zt,57:zt,62:wE},aD={91:sP},uD={[-2]:Xl,[-1]:Xl,32:Xl},lD={35:dP,42:Fa,45:[v0,Fa],60:mP,61:v0,95:Fa,96:y0,126:y0},cD={38:_E,92:SE},dD={[-5]:Ql,[-4]:Ql,[-3]:Ql,33:LP,38:_E,42:hd,60:[ML,kP],91:MP,92:[lP,SE],93:th,95:hd,96:YL},fD={null:[hd,nD]},hD={null:[42,95]},pD={null:[]},mD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:hD,contentInitial:aD,disable:pD,document:oD,flow:lD,flowInitial:uD,insideSpan:fD,string:cD,text:dD},Symbol.toStringTag,{value:"Module"}));function gD(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const u={attempt:I(T),check:I(w),consume:v,enter:k,exit:S,interrupt:I(w,{interrupt:!0})},l={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:h,write:d};let c=t.tokenize.call(l,u);return t.resolveAll&&s.push(t),l;function d(D){return o=St(o,D),E(),o[o.length-1]!==null?[]:(A(t,0),l.events=bs(s,l.events,l),l.events)}function f(D,U){return xD(h(D),U)}function h(D){return bD(o,D)}function m(){const{_bufferIndex:D,_index:U,line:F,column:R,offset:j}=r;return{_bufferIndex:D,_index:U,line:F,column:R,offset:j}}function x(D){i[D.line]=D.column,_()}function E(){let D;for(;r._index<o.length;){const U=o[r._index];if(typeof U=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<U.length;)y(U.charCodeAt(r._bufferIndex));else y(U)}}function y(D){c=c(D)}function v(D){Oe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,_()):D!==-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=D}function k(D,U){const F=U||{};return F.type=D,F.start=m(),l.events.push(["enter",F,l]),a.push(F),F}function S(D){const U=a.pop();return U.end=m(),l.events.push(["exit",U,l]),U}function T(D,U){A(D,U.from)}function w(D,U){U.restore()}function I(D,U){return F;function F(R,j,B){let q,$,X,C;return Array.isArray(R)?xe(R):"tokenize"in R?xe([R]):se(R);function se(ne){return pe;function pe(Ae){const ee=Ae!==null&&ne[Ae],he=Ae!==null&&ne.null,Ie=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(he)?he:he?[he]:[]];return xe(Ie)(Ae)}}function xe(ne){return q=ne,$=0,ne.length===0?B:L(ne[$])}function L(ne){return pe;function pe(Ae){return C=O(),X=ne,ne.partial||(l.currentConstruct=ne),ne.name&&l.parser.constructs.disable.null.includes(ne.name)?re():ne.tokenize.call(U?Object.assign(Object.create(l),U):l,u,G,re)(Ae)}}function G(ne){return D(X,C),j}function re(ne){return C.restore(),++$<q.length?L(q[$]):B}}}function A(D,U){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&Ct(l.events,U,l.events.length-U,D.resolve(l.events.slice(U),l)),D.resolveTo&&(l.events=D.resolveTo(l.events,l))}function O(){const D=m(),U=l.previous,F=l.currentConstruct,R=l.events.length,j=Array.from(a);return{from:R,restore:B};function B(){r=D,l.previous=U,l.currentConstruct=F,l.events.length=R,a=j,_()}}function _(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bD(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function xD(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
93
+ `;break}case-3:{o=`\r
94
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function yD(e){const r={constructs:mE([mD,...(e||{}).extensions||[]]),content:i(G5),defined:[],document:i(Q5),flow:i(eD),lazy:{},string:i(rD),text:i(iD)};return r;function i(s){return o;function o(a){return gD(r,s,a)}}}function ED(e){for(;!CE(e););return e}const z0=/[\0\t\n\r]/g;function vD(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const u=[];let l,c,d,f,h;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(z0.lastIndex=d,l=z0.exec(s),f=l&&l.index!==void 0?l.index:s.length,h=s.charCodeAt(f),!l){t=s.slice(d);break}if(h===10&&d===f&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),d<f&&(u.push(s.slice(d,f)),e+=f-d),h){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const lv={}.hasOwnProperty;function kD(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),TD(n)(ED(yD(n).document().write(vD()(e,t,!0))))}function TD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(le),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(Le),blockQuote:s(he),characterEscape:O,characterReference:O,codeFenced:s(Ie),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Ie,o),codeText:s(Me,o),codeTextData:O,data:O,codeFlowValue:O,definition:s(Be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(fe),hardBreakEscape:s(Re),hardBreakTrailing:s(Re),htmlFlow:s(De,o),htmlFlowData:O,htmlText:s(De,o),htmlTextData:O,image:s(ke),label:o,link:s(le),listItem:s(ge),listItemValue:f,listOrdered:s(Ce,d),listUnordered:s(Ce),paragraph:s(Fe),reference:L,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Le),strong:s(K),thematicBreak:s(J)},exit:{atxHeading:u(),atxHeadingSequence:T,autolink:u(),autolinkEmail:ee,autolinkProtocol:Ae,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ne,characterReference:pe,codeFenced:u(E),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(y),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(U),hardBreakTrailing:u(U),htmlFlow:u(F),htmlFlowData:_,htmlText:u(R),htmlTextData:_,image:u(q),label:X,labelText:$,lineEnding:D,link:u(B),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:G,resourceDestinationString:C,resourceTitleString:se,resource:xe,setextHeading:u(A),setextHeadingLineSequence:I,setextHeadingText:w,strong:u(),thematicBreak:u()}};cv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let Q={type:"root",children:[]};const W={stack:[Q],tokenStack:[],config:t,enter:a,exit:l,buffer:o,resume:c,data:n},Z=[];let ae=-1;for(;++ae<H.length;)if(H[ae][1].type==="listOrdered"||H[ae][1].type==="listUnordered")if(H[ae][0]==="enter")Z.push(ae);else{const ue=Z.pop();ae=i(H,ue,ae)}for(ae=-1;++ae<H.length;){const ue=t[H[ae][0]];lv.call(ue,H[ae][1].type)&&ue[H[ae][1].type].call(Object.assign({sliceSerialize:H[ae][2].sliceSerialize},W),H[ae][1])}if(W.tokenStack.length>0){const ue=W.tokenStack[W.tokenStack.length-1];(ue[1]||q0).call(W,void 0,ue[0])}for(Q.position={start:ur(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:ur(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},ae=-1;++ae<t.transforms.length;)Q=t.transforms[ae](Q)||Q;return Q}function i(H,Q,W){let Z=Q-1,ae=-1,ue=!1,Se,me,de,ve;for(;++Z<=W;){const _e=H[Z];switch(_e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_e[0]==="enter"?ae++:ae--,ve=void 0;break}case"lineEndingBlank":{_e[0]==="enter"&&(Se&&!ve&&!ae&&!de&&(de=Z),ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ve=void 0}if(!ae&&_e[0]==="enter"&&_e[1].type==="listItemPrefix"||ae===-1&&_e[0]==="exit"&&(_e[1].type==="listUnordered"||_e[1].type==="listOrdered")){if(Se){let Pe=Z;for(me=void 0;Pe--;){const ye=H[Pe];if(ye[1].type==="lineEnding"||ye[1].type==="lineEndingBlank"){if(ye[0]==="exit")continue;me&&(H[me][1].type="lineEndingBlank",ue=!0),ye[1].type="lineEnding",me=Pe}else if(!(ye[1].type==="linePrefix"||ye[1].type==="blockQuotePrefix"||ye[1].type==="blockQuotePrefixWhitespace"||ye[1].type==="blockQuoteMarker"||ye[1].type==="listItemIndent"))break}de&&(!me||de<me)&&(Se._spread=!0),Se.end=Object.assign({},me?H[me][1].start:_e[1].end),H.splice(me||Z,0,["exit",Se,_e[2]]),Z++,W++}if(_e[1].type==="listItemPrefix"){const Pe={type:"listItem",_spread:!1,start:Object.assign({},_e[1].start),end:void 0};Se=Pe,H.splice(Z,0,["enter",Pe,_e[2]]),Z++,W++,de=void 0,ve=!0}}}return H[Q][1]._spread=ue,W}function s(H,Q){return W;function W(Z){a.call(this,H(Z),Z),Q&&Q.call(this,Z)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(H,Q,W){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([Q,W||void 0]),H.position={start:ur(Q.start),end:void 0}}function u(H){return Q;function Q(W){H&&H.call(this,W),l.call(this,W)}}function l(H,Q){const W=this.stack.pop(),Z=this.tokenStack.pop();if(Z)Z[0].type!==H.type&&(Q?Q.call(this,H,Z[0]):(Z[1]||q0).call(this,H,Z[0]));else throw new Error("Cannot close `"+H.type+"` ("+fo({start:H.start,end:H.end})+"): it’s not open");W.position.end=ur(H.end)}function c(){return Qf(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(H){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function h(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=H}function m(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=H}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.value=H.replace(/(\r?\n|\r)$/g,"")}function v(H){const Q=this.resume(),W=this.stack[this.stack.length-1];W.label=Q,W.identifier=xn(this.sliceSerialize(H)).toLowerCase()}function k(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.title=H}function S(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.url=H}function T(H){const Q=this.stack[this.stack.length-1];if(!Q.depth){const W=this.sliceSerialize(H).length;Q.depth=W}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function I(H){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function O(H){const W=this.stack[this.stack.length-1].children;let Z=W[W.length-1];(!Z||Z.type!=="text")&&(Z=be(),Z.position={start:ur(H.start),end:void 0},W.push(Z)),this.stack.push(Z)}function _(H){const Q=this.stack.pop();Q.value+=this.sliceSerialize(H),Q.position.end=ur(H.end)}function D(H){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const W=Q.children[Q.children.length-1];W.position.end=ur(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(O.call(this,H),_.call(this,H))}function U(){this.data.atHardBreak=!0}function F(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.value=H}function R(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.value=H}function j(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.value=H}function B(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function q(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function $(H){const Q=this.sliceSerialize(H),W=this.stack[this.stack.length-2];W.label=sL(Q),W.identifier=xn(Q).toLowerCase()}function X(){const H=this.stack[this.stack.length-1],Q=this.resume(),W=this.stack[this.stack.length-1];if(this.data.inReference=!0,W.type==="link"){const Z=H.children;W.children=Z}else W.alt=Q}function C(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.url=H}function se(){const H=this.resume(),Q=this.stack[this.stack.length-1];Q.title=H}function xe(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function G(H){const Q=this.resume(),W=this.stack[this.stack.length-1];W.label=Q,W.identifier=xn(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function re(H){this.data.characterReferenceType=H.type}function ne(H){const Q=this.sliceSerialize(H),W=this.data.characterReferenceType;let Z;W?(Z=pE(Q,W==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Z=Jf(Q);const ae=this.stack[this.stack.length-1];ae.value+=Z}function pe(H){const Q=this.stack.pop();Q.position.end=ur(H.end)}function Ae(H){_.call(this,H);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(H)}function ee(H){_.call(this,H);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(H)}function he(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function Me(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function fe(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:0,children:[]}}function Re(){return{type:"break"}}function De(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function le(){return{type:"link",title:null,url:"",children:[]}}function Ce(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function ge(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Fe(){return{type:"paragraph",children:[]}}function K(){return{type:"strong",children:[]}}function be(){return{type:"text",value:""}}function J(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function cv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cv(e,r):wD(e,r)}}function wD(e,t){let n;for(n in t)if(lv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function q0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fo({start:t.start,end:t.end})+") is still open")}function SD(e){const t=this;t.parser=n;function n(r){return kD(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function _D(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function CD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
95
+ `}]}function AD(e,t){const n=t.value?t.value+`
96
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function ID(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ND(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=gs(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,l),e.applyData(t,l)}function OD(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function PD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dv(e,t);const i={src:gs(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function MD(e,t){const n={src:gs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function DD(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function FD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return dv(e,t);const i={href:gs(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function jD(e,t){const n={href:gs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BD(e,t,n){const r=e.all(t),i=n?HD(n):fv(t),s={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
97
+ `}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
98
+ `});const l={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,l),e.applyData(t,l)}function HD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=fv(n[r])}return t}function fv(e){const t=e.spread;return t??e.children.length>1}function UD(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function $D(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function qD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WD(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=$n(t.children[1]),u=il(t.children[t.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function VD(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let u=-1;const l=[];for(;++u<a;){const d=t.children[u],f={},h=o?o[u]:void 0;h&&(f.align=h);let m={type:"element",tagName:s,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),l.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function KD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const W0=9,V0=32;function YD(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(K0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(K0(t.slice(i),i>0,!1)),s.join("")}function K0(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===W0||s===V0;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===W0||s===V0;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function GD(e,t){const n={type:"text",value:YD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const QD={blockquote:_D,break:CD,code:AD,delete:ID,emphasis:ND,footnoteReference:RD,heading:OD,html:LD,imageReference:PD,image:MD,inlineCode:DD,linkReference:FD,link:jD,listItem:BD,list:UD,paragraph:$D,root:zD,strong:qD,table:WD,tableCell:KD,tableRow:VD,text:GD,thematicBreak:XD,toml:va,yaml:va,definition:va,footnoteDefinition:va};function va(){}function ZD(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function JD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function e8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ZD,r=e.options.footnoteBackLabel||JD,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[u]);if(!l)continue;const c=e.all(l),d=String(l.identifier).toUpperCase(),f=gs(d.toLowerCase());let h=0;const m=[],x=e.footnoteCounts.get(d);for(;x!==void 0&&++h<=x;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(u,h);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const E=c[c.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const v=E.children[E.children.length-1];v&&v.type==="text"?v.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...m)}else c.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(c,!0)};e.patch(l,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...si(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
99
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
100
+ `}]}}const gd={}.hasOwnProperty,t8={};function n8(e,t){const n=t||t8,r=new Map,i=new Map,s=new Map,o={...QD,...n.handlers},a={all:l,applyData:i8,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:u,options:n,patch:r8,wrap:o8};return vn(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const d=c.type==="definition"?r:i,f=String(c.identifier).toUpperCase();d.has(f)||d.set(f,c)}}),a;function u(c,d){const f=c.type,h=a.handlers[f];if(gd.call(a.handlers,f)&&h)return h(a,c,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in c){const{children:x,...E}=c,y=si(E);return y.children=a.all(c),y}return si(c)}return(a.options.unknownHandler||s8)(a,c,d)}function l(c){const d=[];if("children"in c){const f=c.children;let h=-1;for(;++h<f.length;){const m=a.one(f[h],c);if(m){if(h&&f[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Y0(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=Y0(x.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function r8(e,t){e.position&&(t.position=zy(e))}function i8(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,si(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function s8(e,t){const n=t.data||{},r="value"in t&&!(gd.call(n,"hProperties")||gd.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 o8(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
101
+ `});++r<e.length;)r&&n.push({type:"text",value:`
102
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
103
+ `}),n}function Y0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function G0(e,t){const n=n8(e,t),r=n.one(e,void 0),i=e8(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
104
+ `},i),s}function a8(e,t){return e&&"run"in e?async function(n,r){const i=G0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return G0(n,{file:r,...e||t})}}function X0(e){if(e)throw e}var nc,Q0;function u8(){if(Q0)return nc;Q0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):t.call(l)==="[object Array]"},s=function(l){if(!l||t.call(l)!=="[object Object]")return!1;var c=e.call(l,"constructor"),d=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!c&&!d)return!1;var f;for(f in l);return typeof f>"u"||e.call(l,f)},o=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},a=function(l,c){if(c==="__proto__")if(e.call(l,c)){if(r)return r(l,c).value}else return;return l[c]};return nc=function u(){var l,c,d,f,h,m,x=arguments[0],E=1,y=arguments.length,v=!1;for(typeof x=="boolean"&&(v=x,x=arguments[1]||{},E=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});E<y;++E)if(l=arguments[E],l!=null)for(c in l)d=a(x,c),f=a(l,c),x!==f&&(v&&f&&(s(f)||(h=i(f)))?(h?(h=!1,m=d&&i(d)?d:[]):m=d&&s(d)?d:{},o(x,{name:c,newValue:u(v,m,f)})):typeof f<"u"&&o(x,{name:c,newValue:f}));return x},nc}var l8=u8();const rc=wb(l8);function bd(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function c8(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(u,...l){const c=e[++s];let d=-1;if(u){o(u);return}for(;++d<i.length;)(l[d]===null||l[d]===void 0)&&(l[d]=i[d]);i=l,c?d8(c,a)(...l):o(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function d8(e,t){let n;return r;function r(...o){const a=e.length>o.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(l){const c=l;if(a&&n)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const In={basename:f8,dirname:h8,extname:p8,join:m8,sep:"/"};function f8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qo(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function h8(e){if(Qo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function p8(e){Qo(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function m8(...e){let t=-1,n;for(;++t<e.length;)Qo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":g8(n)}function g8(e){Qo(e);const t=e.codePointAt(0)===47;let n=b8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function b8(e,t){let n="",r=0,i=-1,s=0,o=-1,a,u;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=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,s=0}else a===46&&s>-1?s++:s=-1}return n}function Qo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const x8={cwd:y8};function y8(){return"/"}function xd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function E8(e){if(typeof e=="string")e=new URL(e);else if(!xd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return v8(e)}function v8(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ic=["history","path","basename","stem","extname","dirname"];class k8{constructor(t){let n;t?xd(t)?n={path:t}:typeof t=="string"||T8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":x8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ic.length;){const s=ic[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ic.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?In.basename(this.path):void 0}set basename(t){oc(t,"basename"),sc(t,"basename"),this.path=In.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?In.dirname(this.path):void 0}set dirname(t){Z0(this.basename,"dirname"),this.path=In.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?In.extname(this.path):void 0}set extname(t){if(sc(t,"extname"),Z0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=In.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){xd(t)&&(t=E8(t)),oc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?In.basename(this.path,this.extname):void 0}set stem(t){oc(t,"stem"),sc(t,"stem"),this.path=In.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Pt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sc(e,t){if(e&&e.includes(In.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+In.sep+"`")}function oc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Z0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function T8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const w8=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),S8={}.hasOwnProperty;class lh extends w8{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=c8()}copy(){const t=new lh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(rc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lc("data",this.frozen),this.namespace[t]=n,this):S8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ka(t),r=this.parser||this.Parser;return ac("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ac("process",this.parser||this.Parser),uc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=ka(t),u=r.parse(a);r.run(u,a,function(c,d,f){if(c||!d||!f)return l(c);const h=d,m=r.stringify(h,f);A8(m)?f.value=m:f.result=m,l(c,f)});function l(c,d){c||!d?o(c):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ac("processSync",this.parser||this.Parser),uc("processSync",this.compiler||this.Compiler),this.process(t,i),eg("processSync","process",n),r;function i(s,o){n=!0,X0(s),r=o}}run(t,n,r){J0(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const u=ka(n);i.run(t,u,l);function l(c,d,f){const h=d||t;c?a(c):o?o(h):r(void 0,h,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),eg("runSync","run",r),i;function s(o,a){X0(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=ka(n),i=this.compiler||this.Compiler;return uc("stringify",i),J0(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(lc("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[c,...d]=l;u(c,d)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=rc(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){const d=l[c];s(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===l){f=d;break}if(f===-1)r.push([l,...c]);else if(c.length>0){let[h,...m]=c;const x=r[f][1];bd(x)&&bd(h)&&(h=rc(!0,x,h)),r[f]=[l,h,...m]}}}}const _8=new lh().freeze();function ac(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function J0(e){if(!bd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function eg(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ka(e){return C8(e)?e:new k8(e)}function C8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function A8(e){return typeof e=="string"||I8(e)}function I8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function ch(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bi=ch();function hv(e){bi=e}var Vr={exec:()=>null};function Qe(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Bt.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var N8=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Bt={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=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},R8=/^(?:[ \t]*(?:\n|$))+/,O8=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,L8=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,P8=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,dh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,mv=Qe(pv).replace(/bull/g,dh).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(),M8=Qe(pv).replace(/bull/g,dh).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(),fh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D8=/^[^\n]+/,hh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F8=Qe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j8=Qe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,dh).getRegex(),al="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",ph=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,B8=Qe("^ {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",ph).replace("tag",al).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gv=Qe(fh).replace("hr",Zo).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",al).getRegex(),H8=Qe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gv).getRegex(),mh={blockquote:H8,code:O8,def:F8,fences:L8,heading:P8,hr:Zo,html:B8,lheading:mv,list:j8,newline:R8,paragraph:gv,table:Vr,text:D8},tg=Qe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zo).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",al).getRegex(),U8={...mh,lheading:M8,table:tg,paragraph:Qe(fh).replace("hr",Zo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tg).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",al).getRegex()},$8={...mh,html:Qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ph).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:Vr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Qe(fh).replace("hr",Zo).replace("heading",` *#{1,6} *[^
105
+ ]`).replace("lheading",mv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},z8=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q8=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bv=/^( {2,}|\\)\n(?!\s*$)/,W8=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xs=/[\p{P}\p{S}]/u,ul=/[\s\p{P}\p{S}]/u,gh=/[^\s\p{P}\p{S}]/u,V8=Qe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ul).getRegex(),xv=/(?!~)[\p{P}\p{S}]/u,K8=/(?!~)[\s\p{P}\p{S}]/u,Y8=/(?:[^\s\p{P}\p{S}]|~)/u,G8=Qe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",N8?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),yv=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,X8=Qe(yv,"u").replace(/punct/g,xs).getRegex(),Q8=Qe(yv,"u").replace(/punct/g,xv).getRegex(),Ev="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Z8=Qe(Ev,"gu").replace(/notPunctSpace/g,gh).replace(/punctSpace/g,ul).replace(/punct/g,xs).getRegex(),J8=Qe(Ev,"gu").replace(/notPunctSpace/g,Y8).replace(/punctSpace/g,K8).replace(/punct/g,xv).getRegex(),e9=Qe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gh).replace(/punctSpace/g,ul).replace(/punct/g,xs).getRegex(),t9=Qe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,xs).getRegex(),n9="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",r9=Qe(n9,"gu").replace(/notPunctSpace/g,gh).replace(/punctSpace/g,ul).replace(/punct/g,xs).getRegex(),i9=Qe(/\\(punct)/,"gu").replace(/punct/g,xs).getRegex(),s9=Qe(/^<(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(),o9=Qe(ph).replace("(?:-->|$)","-->").getRegex(),a9=Qe("^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",o9).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),du=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,u9=Qe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",du).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vv=Qe(/^!?\[(label)\]\[(ref)\]/).replace("label",du).replace("ref",hh).getRegex(),kv=Qe(/^!?\[(ref)\](?:\[\])?/).replace("ref",hh).getRegex(),l9=Qe("reflink|nolink(?!\\()","g").replace("reflink",vv).replace("nolink",kv).getRegex(),ng=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bh={_backpedal:Vr,anyPunctuation:i9,autolink:s9,blockSkip:G8,br:bv,code:q8,del:Vr,delLDelim:Vr,delRDelim:Vr,emStrongLDelim:X8,emStrongRDelimAst:Z8,emStrongRDelimUnd:e9,escape:z8,link:u9,nolink:kv,punctuation:V8,reflink:vv,reflinkSearch:l9,tag:a9,text:W8,url:Vr},c9={...bh,link:Qe(/^!?\[(label)\]\((.*?)\)/).replace("label",du).getRegex(),reflink:Qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",du).getRegex()},yd={...bh,emStrongRDelimAst:J8,emStrongLDelim:Q8,delLDelim:t9,delRDelim:r9,url:Qe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ng).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:Qe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ng).getRegex()},d9={...yd,br:Qe(bv).replace("{2,}","*").getRegex(),text:Qe(yd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ta={normal:mh,gfm:U8,pedantic:$8},Ls={normal:bh,gfm:yd,breaks:d9,pedantic:c9},f9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rg=e=>f9[e];function An(e,t){if(t){if(Bt.escapeTest.test(e))return e.replace(Bt.escapeReplace,rg)}else if(Bt.escapeTestNoEncode.test(e))return e.replace(Bt.escapeReplaceNoEncode,rg);return e}function ig(e){try{e=encodeURI(e).replace(Bt.percentDecode,"%")}catch{return null}return e}function sg(e,t){let n=e.replace(Bt.findPipe,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(Bt.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Bt.slashPipe,"|");return r}function Ps(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function h9(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 p9(e,t=0){let n=t,r="";for(let i of e)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function og(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}function m9(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
106
+ `).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(`
107
+ `)}var fu=class{options;rules;lexer;constructor(e){this.options=e||bi}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 n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ps(n,`
108
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=m9(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Ps(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ps(t[0],`
109
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Ps(t[0],`
110
+ `).split(`
111
+ `),r="",i="",s=[];for(;n.length>0;){let o=!1,a=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))a.push(n[u]),o=!0;else if(!o)a.push(n[u]);else break;n=n.slice(u);let l=a.join(`
112
+ `),c=l.replace(this.rules.other.blockquoteSetextReplace,`
113
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
114
+ ${l}`:l,i=i?`${i}
115
+ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,s,!0),this.lexer.state.top=d,n.length===0)break;let f=s.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,m=h.raw+`
116
+ `+n.join(`
117
+ `),x=this.blockquote(m);s[s.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,i=i.substring(0,i.length-h.text.length)+x.text;break}else if(f?.type==="list"){let h=f,m=h.raw+`
118
+ `+n.join(`
119
+ `),x=this.list(m);s[s.length-1]=x,r=r.substring(0,r.length-f.raw.length)+x.raw,i=i.substring(0,i.length-h.raw.length)+x.raw,n=m.substring(s.at(-1).raw.length).split(`
120
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}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 s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,l="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let d=p9(t[2].split(`
121
+ `,1)[0],t[1].length),f=e.split(`
122
+ `,1)[0],h=!d.trim(),m=0;if(this.options.pedantic?(m=2,c=d.trimStart()):h?m=t[1].length+1:(m=d.search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=d.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(f)&&(l+=f+`
123
+ `,e=e.substring(f.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(m),E=this.rules.other.hrRegex(m),y=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),S=this.rules.other.blockquoteBeginRegex(m);for(;e;){let T=e.split(`
124
+ `,1)[0],w;if(f=T,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),y.test(f)||v.test(f)||k.test(f)||S.test(f)||x.test(f)||E.test(f))break;if(w.search(this.rules.other.nonSpaceChar)>=m||!f.trim())c+=`
125
+ `+w.slice(m);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||v.test(d)||E.test(d))break;c+=`
126
+ `+f}h=!f.trim(),l+=T+`
127
+ `,e=e.substring(T.length+1),d=w.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0)),i.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),i.raw+=l}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),u.tokens[0]?.type==="text"||u.tokens[0]?.type==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let l=this.rules.other.listTaskCheckbox.exec(u.raw);if(l){let c={type:"checkbox",raw:l[0]+" ",checked:l[0]!=="[ ]"};u.checked=c.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=c.raw+u.tokens[0].raw,u.tokens[0].text=c.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(c)):u.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):u.tokens.unshift(c)}}if(!i.loose){let l=u.tokens.filter(d=>d.type==="space"),c=l.length>0&&l.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=c}}if(i.loose)for(let u of i.items){u.loose=!0;for(let l of u.tokens)l.type==="text"&&(l.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 n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=sg(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
128
+ `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of i)s.rows.push(sg(o,s.header.length).map((a,u)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[u]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
129
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}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 n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Ps(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=h9(t[2],"()");if(s===-2)return;if(s>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),og(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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 r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return og(n,i,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 i=[...r[0]].length-1,s,o,a=i,u=0,l=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);(r=l.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){a+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){u+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+u);let c=[...r[0]][0].length,d=e.slice(0,i+r.index+c+o);if(Math.min(i,o)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}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 i=[...r[0]].length-1,s,o,a=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(r=u.exec(t))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(o=[...s].length,o!==i))continue;if(r[3]||r[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let l=[...r[0]][0].length,c=e.slice(0,i+r.index+l+o),d=c.slice(i,-i);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},on=class Ed{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||bi,this.options.tokenizer=this.options.tokenizer||new fu,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 n={other:Bt,block:Ta.normal,inline:Ls.normal};this.options.pedantic?(n.block=Ta.pedantic,n.inline=Ls.pedantic):this.options.gfm&&(n.block=Ta.gfm,this.options.breaks?n.inline=Ls.breaks:n.inline=Ls.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ta,inline:Ls}}static lex(t,n){return new Ed(n).lex(t)}static lexInline(t,n){return new Ed(n).inlineTokens(t)}lex(t){t=t.replace(Bt.carriageReturn,`
130
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Bt.tabCharGlobal," ").replace(Bt.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let o=n.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
131
+ `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
132
+ `)?"":`
133
+ `)+i.raw,o.text+=`
134
+ `+i.text,this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
135
+ `)?"":`
136
+ `)+i.raw,o.text+=`
137
+ `+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let s=t;if(this.options.extensions?.startBlock){let o=1/0,a=t.slice(1),u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},a),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=t.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
138
+ `)?"":`
139
+ `)+i.raw,o.text+=`
140
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i),r=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
141
+ `)?"":`
142
+ `)+i.raw,o.text+=`
143
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)u.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,a="";for(;t;){o||(a=""),o=!1;let u;if(this.options.extensions?.inline?.some(c=>(u=c.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);let c=n.at(-1);u.type==="text"&&c?.type==="text"?(c.raw+=u.raw,c.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,a)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t,r,a)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(u=this.tokenizer.inlineText(l)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),o=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=u.raw,c.text+=u.text):n.push(u);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},hu=class{options;parser;constructor(t){this.options=t||bi}space(t){return""}code({text:t,lang:n,escaped:r}){let i=(n||"").match(Bt.notSpaceStart)?.[0],s=t.replace(Bt.endingNewline,"")+`
144
+ `;return i?'<pre><code class="language-'+An(i)+'">'+(r?s:An(s,!0))+`</code></pre>
145
+ `:"<pre><code>"+(r?s:An(s,!0))+`</code></pre>
146
+ `}blockquote({tokens:t}){return`<blockquote>
147
+ ${this.parser.parse(t)}</blockquote>
148
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
149
+ `}hr(t){return`<hr>
150
+ `}list(t){let n=t.ordered,r=t.start,i="";for(let a=0;a<t.items.length;a++){let u=t.items[a];i+=this.listitem(u)}let s=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
151
+ `+i+"</"+s+`>
152
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
153
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
154
+ `}table(t){let n="",r="";for(let s=0;s<t.header.length;s++)r+=this.tablecell(t.header[s]);n+=this.tablerow({text:r});let i="";for(let s=0;s<t.rows.length;s++){let o=t.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
155
+ <thead>
156
+ `+n+`</thead>
157
+ `+i+`</table>
158
+ `}tablerow({text:t}){return`<tr>
159
+ ${t}</tr>
160
+ `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
161
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${An(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let i=this.parser.parseInline(r),s=ig(t);if(s===null)return i;t=s;let o='<a href="'+t+'"';return n&&(o+=' title="'+An(n)+'"'),o+=">"+i+"</a>",o}image({href:t,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let s=ig(t);if(s===null)return An(r);t=s;let o=`<img src="${t}" alt="${An(r)}"`;return n&&(o+=` title="${An(n)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:An(t.text)}},xh=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}},pn=class vd{options;renderer;textRenderer;constructor(t){this.options=t||bi,this.options.renderer=this.options.renderer||new hu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xh}static parse(t,n){return new vd(n).parse(t)}static parseInline(t,n){return new vd(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Ks=class{options;block;constructor(t){this.options=t||bi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?on.lex:on.lexInline}provideParser(t=this.block){return t?pn.parse:pn.parseInline}},g9=class{defaults=ch();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pn;Renderer=hu;TextRenderer=xh;Lexer=on;Tokenizer=fu;Hooks=Ks;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let s=i;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,n));for(let o of s.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,n));break}case"list":{let s=i;r=r.concat(this.walkTokens(s.items,n));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){let s=this.defaults.renderer||new hu(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,u=r.renderer[a],l=s[a];s[a]=(...c)=>{let d=u.apply(s,c);return d===!1&&(d=l.apply(s,c)),d||""}}i.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new fu(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,u=r.tokenizer[a],l=s[a];s[a]=(...c)=>{let d=u.apply(s,c);return d===!1&&(d=l.apply(s,c)),d}}i.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Ks;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,u=r.hooks[a],l=s[a];Ks.passThroughHooks.has(o)?s[a]=c=>{if(this.defaults.async&&Ks.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await u.call(s,c);return l.call(s,f)})();let d=u.call(s,c);return l.call(s,d)}:s[a]=(...c)=>{if(this.defaults.async)return(async()=>{let f=await u.apply(s,c);return f===!1&&(f=await l.apply(s,c)),f})();let d=u.apply(s,c);return d===!1&&(d=l.apply(s,c)),d}}i.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(a){let u=[];return u.push(o.call(this,a)),s&&(u=u.concat(s.call(this,a))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return on.lex(t,n??this.defaults)}parser(t,n){return pn.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return o(new 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 n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(n):n,u=await(s.hooks?await s.hooks.provideLexer(t):t?on.lex:on.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(t):t?pn.parse:pn.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=(s.hooks?s.hooks.provideLexer(t):t?on.lex:on.lexInline)(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let u=(s.hooks?s.hooks.provideParser(t):t?pn.parse:pn.parseInline)(a,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(a){return o(a)}}}onError(t,n){return r=>{if(r.message+=`
162
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+An(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},ai=new g9;function it(e,t){return ai.parse(e,t)}it.options=it.setOptions=function(e){return ai.setOptions(e),it.defaults=ai.defaults,hv(it.defaults),it};it.getDefaults=ch;it.defaults=bi;it.use=function(...e){return ai.use(...e),it.defaults=ai.defaults,hv(it.defaults),it};it.walkTokens=function(e,t){return ai.walkTokens(e,t)};it.parseInline=ai.parseInline;it.Parser=pn;it.parser=pn.parse;it.Renderer=hu;it.TextRenderer=xh;it.Lexer=on;it.lexer=on.lex;it.Tokenizer=fu;it.Hooks=Ks;it.parse=it;it.options;it.setOptions;it.use;it.walkTokens;it.parseInline;pn.parse;on.lex;var b9=300,x9="300px",y9=500;function E9(e={}){let{immediate:t=!1,debounceDelay:n=b9,rootMargin:r=x9,idleTimeout:i=y9}=e,[s,o]=b.useState(!1),a=b.useRef(null),u=b.useRef(null),l=b.useRef(null),c=b.useMemo(()=>h=>{let m=Date.now();return window.setTimeout(()=>{h({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=b.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(h,m)=>window.requestIdleCallback(h,m):c,[c]),f=b.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?h=>window.cancelIdleCallback(h):h=>{clearTimeout(h)},[]);return b.useEffect(()=>{if(t){o(!0);return}let h=a.current;if(!h)return;u.current&&(clearTimeout(u.current),u.current=null),l.current&&(f(l.current),l.current=null);let m=()=>{u.current&&(clearTimeout(u.current),u.current=null),l.current&&(f(l.current),l.current=null)},x=k=>{l.current=d(S=>{S.timeRemaining()>0||S.didTimeout?(o(!0),k.disconnect()):l.current=d(()=>{o(!0),k.disconnect()},{timeout:i/2})},{timeout:i})},E=k=>{m(),u.current=window.setTimeout(()=>{var S,T;let w=k.takeRecords();(w.length===0||(T=(S=w.at(-1))==null?void 0:S.isIntersecting)!=null&&T)&&x(k)},n)},y=(k,S)=>{k.isIntersecting?E(S):m()},v=new IntersectionObserver(k=>{for(let S of k)y(S,v)},{rootMargin:r,threshold:0});return v.observe(h),()=>{u.current&&clearTimeout(u.current),l.current&&f(l.current),v.disconnect()}},[t,n,r,i,f,d]),{shouldRender:s,containerRef:a}}var Tv=/\s/,v9=/^\s+$/,k9=new Set(["code","pre","svg","math","annotation"]),T9=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",w9=e=>e.some(t=>T9(t)&&k9.has(t.tagName)),S9=e=>{let t=[],n="",r=!1;for(let i of e){let s=Tv.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},_9=e=>{let t=[],n="";for(let r of e)Tv.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},C9=(e,t,n,r,i,s)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return s&&(o+=`;--sd-delay:${s}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},A9=(e,t,n,r,i)=>{let s=t.at(-1);if(!(s&&"children"in s))return;if(w9(t))return Li;let o=s,a=o.children.indexOf(e);if(a===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let l=n.sep==="char"?_9(u):S9(u),c=r.prevContentLength,d=l.map(f=>{let h=i.count;if(i.count+=f.length,v9.test(f))return{type:"text",value:f};let m=c>0&&h<c,x=m?0:i.newIndex++*n.stagger;return C9(f,n.animation,n.duration,n.easing,m,x)});return o.children.splice(a,1,...d),a+d.length},I9=0;function kd(e){var t,n,r,i,s;let o={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word",stagger:(s=e?.stagger)!=null?s:40},a={prevContentLength:0,lastRenderCharCount:0},u=I9++,l=()=>c=>{let d={count:0,newIndex:0};jf(c,"text",(f,h)=>A9(f,h,o,a,d)),a.lastRenderCharCount=d.count,a.prevContentLength=0};return Object.defineProperty(l,"name",{value:`rehypeAnimate$${u}`}),{name:"animate",type:"animate",rehypePlugin:l,setPrevContentLength(c){a.prevContentLength=c},getLastRenderCharCount(){let c=a.lastRenderCharCount;return a.lastRenderCharCount=0,c}}}kd();var wv=b.createContext(!1),N9=()=>b.useContext(wv),yh=(...e)=>nv(UE(e)),R9=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},O9=e=>e?(...t)=>R9(e,nv(UE(t))):yh,Ki=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,s=URL.createObjectURL(i),o=document.createElement("a");o.href=s,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s)},Td=b.createContext(yh),Ve=()=>b.useContext(Td),L9=yh("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),P9=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),s=n.slice(r+1).trim();i&&s&&(t[i]=s)}}return t},M9=b.memo(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:s=!0,...o})=>{let a=Ve(),u=b.useMemo(()=>a(L9),[a]),l=b.useMemo(()=>{let c={};return t.bg&&(c["--sdm-bg"]=t.bg),t.fg&&(c["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(c,P9(t.rootStyle)),c},[t.bg,t.fg,t.rootStyle]);return p.jsx("div",{className:a(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...o,children:p.jsx("pre",{className:a(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:l,children:p.jsx("code",{className:s?a("[counter-increment:line_0] [counter-reset:line]"):void 0,style:s&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((c,d)=>p.jsx("span",{className:s?u:void 0,children:c.length===0||c.length===1&&c[0].content===""?`
163
+ `:c.map((f,h)=>{let m={},x=!!f.bgColor;if(f.color&&(m["--sdm-c"]=f.color),f.bgColor&&(m["--sdm-tbg"]=f.bgColor),f.htmlStyle)for(let[E,y]of Object.entries(f.htmlStyle))E==="color"?m["--sdm-c"]=y:E==="background-color"?(m["--sdm-tbg"]=y,x=!0):m[E]=y;return p.jsx("span",{className:a("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",x&&"bg-[var(--sdm-tbg)]",x&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:m,...f.htmlAttrs,children:f.content},h)})},d))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),D9=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let s=Ve();return p.jsx("div",{className:s("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},Sv=b.createContext({code:""}),_v=()=>b.useContext(Sv),F9=({language:e})=>{let t=Ve();return p.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:p.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},j9=e=>{let t=e.length;for(;t>0&&e[t-1]===`
164
+ `;)t--;return e.slice(0,t)},B9=b.lazy(()=>Qs(()=>import("./highlighted-body-OFNGDK62-CF-6XyfM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(e=>({default:e.HighlightedCodeBlockBody}))),Cv=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:s,lineNumbers:o,...a})=>{let u=Ve(),l=b.useMemo(()=>j9(e),[e]),c=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:l.split(`
165
+ `).map(d=>[{content:d,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[l]);return p.jsx(Sv.Provider,{value:{code:e},children:p.jsxs(D9,{isIncomplete:i,language:t,children:[p.jsx(F9,{language:t}),r?p.jsx("div",{className:u("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:p.jsx("div",{className:u("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,p.jsx(b.Suspense,{fallback:p.jsx(M9,{className:n,language:t,lineNumbers:o,result:c,startLine:s,...a}),children:p.jsx(B9,{className:n,code:l,language:t,lineNumbers:o,raw:c,startLine:s,...a})})]})})},H9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),U9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),$9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),z9=e=>p.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[p.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),q9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),W9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),V9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),K9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Y9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),G9=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Ys={CheckIcon:H9,CopyIcon:U9,DownloadIcon:$9,ExternalLinkIcon:K9,Loader2Icon:z9,Maximize2Icon:q9,RotateCcwIcon:W9,XIcon:V9,ZoomInIcon:Y9,ZoomOutIcon:G9},Av=b.createContext(Ys),X9=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},ag=({icons:e,children:t})=>{let n=b.useRef(e),r=b.useRef(e?{...Ys,...e}:Ys);X9(n.current,e)||(n.current=e,r.current=e?{...Ys,...e}:Ys);let i=r.current;return p.jsx(Av.Provider,{value:i,children:t})},Tn=()=>b.useContext(Av),Iv={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},wd=b.createContext(Iv),sr=()=>b.useContext(wd),ug=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:s,...o})=>{let a=Ve(),[u,l]=b.useState(!1),c=b.useRef(0),{code:d}=_v(),{isAnimating:f}=b.useContext(en),h=sr(),m=s??d,x=async()=>{var v;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.writeText)){t?.(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(m),l(!0),e?.(),c.current=window.setTimeout(()=>l(!1),n))}catch(k){t?.(k)}};b.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let E=Tn(),y=u?E.CheckIcon:E.CopyIcon;return p.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:f,onClick:x,title:h.copyCode,type:"button",...o,children:r??p.jsx(y,{size:14})})},lg={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Q9=({onDownload:e,onError:t,language:n,children:r,className:i,code:s,...o})=>{let a=Ve(),{code:u}=_v(),{isAnimating:l}=b.useContext(en),c=sr(),d=Tn(),f=s??u,h=`file.${n&&n in lg?lg[n]:"txt"}`,m="text/plain",x=()=>{try{Ki(h,f,m),e?.()}catch(E){t?.(E)}};return p.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:l,onClick:x,title:c.downloadFile,type:"button",...o,children:r??p.jsx(d.DownloadIcon,{size:14})})},cg=()=>{let{Loader2Icon:e}=Tn(),t=Ve();return p.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[p.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),p.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:p.jsx(e,{className:t("size-4 animate-spin")})})]})},Z9=/\.[^/.]+$/,J9=({node:e,className:t,src:n,alt:r,onLoad:i,onError:s,...o})=>{let{DownloadIcon:a}=Tn(),u=Ve(),l=b.useRef(null),[c,d]=b.useState(!1),[f,h]=b.useState(!1),m=sr(),x=o.width!=null||o.height!=null,E=(c||x)&&!f,y=f&&!x;b.useEffect(()=>{let T=l.current;if(T!=null&&T.complete){let w=T.naturalWidth>0;d(w),h(!w)}},[]);let v=b.useCallback(T=>{d(!0),h(!1),i?.(T)},[i]),k=b.useCallback(T=>{d(!1),h(!0),s?.(T)},[s]),S=async()=>{if(n)try{let T=await(await fetch(n)).blob(),w=new URL(n,window.location.origin).pathname.split("/").pop()||"",I=w.split(".").pop(),A=w.includes(".")&&I!==void 0&&I.length<=4,O="";if(A)O=w;else{let _=T.type,D="png";_.includes("jpeg")||_.includes("jpg")?D="jpg":_.includes("png")?D="png":_.includes("svg")?D="svg":_.includes("gif")?D="gif":_.includes("webp")&&(D="webp"),O=`${(r||w||"image").replace(Z9,"")}.${D}`}Ki(O,T,T.type)}catch{window.open(n,"_blank")}};return n?p.jsxs("div",{className:u("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[p.jsx("img",{alt:r,className:u("max-w-full rounded-lg",y&&"hidden",t),"data-streamdown":"image",onError:k,onLoad:v,ref:l,src:n,...o}),y&&p.jsx("span",{className:u("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:m.imageNotAvailable}),p.jsx("div",{className:u("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),E&&p.jsx("button",{className:u("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:S,title:m.downloadImage,type:"button",children:p.jsx(a,{size:14})})]}):null},ho=0,Eh=()=>{ho+=1,ho===1&&(document.body.style.overflow="hidden")},vh=()=>{ho=Math.max(0,ho-1),ho===0&&(document.body.style.overflow="")},eF=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:s,ExternalLinkIcon:o,XIcon:a}=Tn(),u=Ve(),[l,c]=b.useState(!1),d=sr(),f=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[e]),h=b.useCallback(()=>{r(),n()},[r,n]);return b.useEffect(()=>{if(t){Eh();let m=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),vh()}}},[t,n]),t?p.jsx("div",{className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:m=>{m.key==="Escape"&&n()},role:"button",tabIndex:0,children:p.jsxs("div",{className:u("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),role:"presentation",children:[p.jsx("button",{className:u("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:d.close,type:"button",children:p.jsx(a,{size:16})}),p.jsxs("div",{className:u("flex flex-col gap-2"),children:[p.jsxs("div",{className:u("flex items-center gap-2 font-semibold text-lg"),children:[p.jsx(o,{size:20}),p.jsx("span",{children:d.openExternalLink})]}),p.jsx("p",{className:u("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),p.jsx("div",{className:u("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),p.jsxs("div",{className:u("flex gap-2"),children:[p.jsx("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:f,type:"button",children:l?p.jsxs(p.Fragment,{children:[p.jsx(i,{size:14}),p.jsx("span",{children:d.copied})]}):p.jsxs(p.Fragment,{children:[p.jsx(s,{size:14}),p.jsx("span",{children:d.copyLink})]})}),p.jsxs("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:h,type:"button",children:[p.jsx(o,{size:14}),p.jsx("span",{children:d.openLink})]})]})]})}):null},Sd=b.createContext(null),kh=()=>b.useContext(Sd),lV=()=>{var e;let t=kh();return(e=t?.code)!=null?e:null},Th=()=>{var e;let t=kh();return(e=t?.mermaid)!=null?e:null},tF=e=>{var t;let n=kh();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},nF=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,s)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{let u=document.createElement("canvas"),l=a.width*r,c=a.height*r;u.width=l,u.height=c;let d=u.getContext("2d");if(!d){s(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(a,0,0,l,c),u.toBlob(f=>{if(!f){s(new Error("Failed to create PNG blob"));return}i(f)},"image/png")},a.onerror=()=>s(new Error("Failed to load SVG image")),a.src=o})},rF=({chart:e,children:t,className:n,onDownload:r,config:i,onError:s})=>{let o=Ve(),[a,u]=b.useState(!1),l=b.useRef(null),{isAnimating:c}=b.useContext(en),d=Tn(),f=Th(),h=sr(),m=async x=>{try{if(x==="mmd"){Ki("diagram.mmd",e,"text/plain"),u(!1),r?.(x);return}if(!f){s?.(new Error("Mermaid plugin not available"));return}let E=f.getMermaid(i),y=e.split("").reduce((S,T)=>(S<<5)-S+T.charCodeAt(0)|0,0),v=`mermaid-${Math.abs(y)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:k}=await E.render(v,e);if(!k){s?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(x==="svg"){Ki("diagram.svg",k,"image/svg+xml"),u(!1),r?.(x);return}if(x==="png"){let S=await nF(k);Ki("diagram.png",S,"image/png"),r?.(x),u(!1);return}}catch(E){s?.(E)}};return b.useEffect(()=>{let x=E=>{let y=E.composedPath();l.current&&!y.includes(l.current)&&u(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[]),p.jsxs("div",{className:o("relative"),ref:l,children:[p.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:c,onClick:()=>u(!a),title:h.downloadDiagram,type:"button",children:t??p.jsx(d.DownloadIcon,{size:14})}),a?p.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[p.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("svg"),title:h.downloadDiagramAsSvg,type:"button",children:h.mermaidFormatSvg}),p.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("png"),title:h.downloadDiagramAsPng,type:"button",children:h.mermaidFormatPng}),p.jsx("button",{className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("mmd"),title:h.downloadDiagramAsMmd,type:"button",children:h.mermaidFormatMmd})]}):null]})},iF=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...s})=>{let{Maximize2Icon:o,XIcon:a}=Tn(),u=Ve(),[l,c]=b.useState(!1),{isAnimating:d,controls:f}=b.useContext(en),h=sr(),m=(()=>{if(typeof f=="boolean")return f;let E=f.mermaid;return E===!1?!1:E===!0||E===void 0?!0:E.panZoom!==!1})(),x=()=>{c(!l)};return b.useEffect(()=>{if(l){Eh();let E=y=>{y.key==="Escape"&&c(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),vh()}}},[l]),b.useEffect(()=>{l?n?.():r&&r()},[l,n,r]),p.jsxs(p.Fragment,{children:[p.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:d,onClick:x,title:h.viewFullscreen,type:"button",...s,children:p.jsx(o,{size:14})}),l?Kt.createPortal(p.jsxs("div",{className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:x,onKeyDown:E=>{E.key==="Escape"&&x()},role:"button",tabIndex:0,children:[p.jsx("button",{className:u("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:x,title:h.exitFullscreen,type:"button",children:p.jsx(a,{size:20})}),p.jsx("div",{className:u("flex size-full items-center justify-center p-4"),onClick:E=>E.stopPropagation(),onKeyDown:E=>E.stopPropagation(),role:"presentation",children:p.jsx(ck,{chart:e,className:u("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},Nv=e=>{var t,n;let r=[],i=[],s=e.querySelectorAll("thead th");for(let a of s)r.push(((t=a.textContent)==null?void 0:t.trim())||"");let o=e.querySelectorAll("tbody tr");for(let a of o){let u=[],l=a.querySelectorAll("td");for(let c of l)u.push(((n=c.textContent)==null?void 0:n.trim())||"");i.push(u)}return{headers:r,rows:i}},Rv=e=>{let{headers:t,rows:n}=e,r=a=>{let u=!1,l=!1;for(let c of a){if(c==='"'){u=!0,l=!0;break}(c===","||c===`
166
+ `)&&(u=!0)}return u?l?`"${a.replace(/"/g,'""')}"`:`"${a}"`:a},i=t.length>0?n.length+1:n.length,s=new Array(i),o=0;t.length>0&&(s[o]=t.map(r).join(","),o+=1);for(let a of n)s[o]=a.map(r).join(","),o+=1;return s.join(`
167
+ `)},sF=e=>{let{headers:t,rows:n}=e,r=a=>{let u=!1;for(let c of a)if(c===" "||c===`
168
+ `||c==="\r"){u=!0;break}if(!u)return a;let l=[];for(let c of a)c===" "?l.push("\\t"):c===`
169
+ `?l.push("\\n"):c==="\r"?l.push("\\r"):l.push(c);return l.join("")},i=t.length>0?n.length+1:n.length,s=new Array(i),o=0;t.length>0&&(s[o]=t.map(r).join(" "),o+=1);for(let a of n)s[o]=a.map(r).join(" "),o+=1;return s.join(`
170
+ `)},cc=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},_d=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,s=t.map(a=>cc(a));r[i]=`| ${s.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let a=0;a<t.length;a+=1)o[a]="---";r[i]=`| ${o.join(" | ")} |`,i+=1;for(let a of n)if(a.length<t.length){let u=new Array(t.length);for(let l=0;l<t.length;l+=1)u[l]=l<a.length?cc(a[l]):"";r[i]=`| ${u.join(" | ")} |`,i+=1}else{let u=a.map(l=>cc(l));r[i]=`| ${u.join(" | ")} |`,i+=1}return r.join(`
171
+ `)},Ov=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let s=Ve(),[o,a]=b.useState(!1),[u,l]=b.useState(!1),c=b.useRef(null),d=b.useRef(0),{isAnimating:f}=b.useContext(en),h=sr(),m=async y=>{var v,k;if(typeof window>"u"||!((v=navigator?.clipboard)!=null&&v.write)){r?.(new Error("Clipboard API not available"));return}try{let S=(k=c.current)==null?void 0:k.closest('[data-streamdown="table-wrapper"]'),T=S?.querySelector("table");if(!T){r?.(new Error("Table not found"));return}let w=Nv(T),I=({csv:Rv,tsv:sF,md:_d}[y]||_d)(w),A=new ClipboardItem({"text/plain":new Blob([I],{type:"text/plain"}),"text/html":new Blob([T.outerHTML],{type:"text/html"})});await navigator.clipboard.write([A]),l(!0),a(!1),n?.(y),d.current=window.setTimeout(()=>l(!1),i)}catch(S){r?.(S)}};b.useEffect(()=>{let y=v=>{let k=v.composedPath();c.current&&!k.includes(c.current)&&a(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y),window.clearTimeout(d.current)}},[]);let x=Tn(),E=u?x.CheckIcon:x.CopyIcon;return p.jsxs("div",{className:s("relative"),ref:c,children:[p.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>a(!o),title:h.copyTable,type:"button",children:e??p.jsx(E,{height:14,width:14})}),o?p.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[p.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("md"),title:h.copyTableAsMarkdown,type:"button",children:h.tableFormatMarkdown}),p.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("csv"),title:h.copyTableAsCsv,type:"button",children:h.tableFormatCsv}),p.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>m("tsv"),title:h.copyTableAsTsv,type:"button",children:h.tableFormatTsv})]}):null]})},Lv=({children:e,className:t,onDownload:n,onError:r})=>{let i=Ve(),[s,o]=b.useState(!1),a=b.useRef(null),{isAnimating:u}=b.useContext(en),l=sr(),c=Tn(),d=f=>{var h;try{let m=(h=a.current)==null?void 0:h.closest('[data-streamdown="table-wrapper"]'),x=m?.querySelector("table");if(!x){r?.(new Error("Table not found"));return}let E=Nv(x),y=f==="csv"?Rv(E):_d(E);Ki(`table.${f==="csv"?"csv":"md"}`,y,f==="csv"?"text/csv":"text/markdown"),o(!1),n?.(f)}catch(m){r?.(m)}};return b.useEffect(()=>{let f=h=>{let m=h.composedPath();a.current&&!m.includes(a.current)&&o(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),p.jsxs("div",{className:i("relative"),ref:a,children:[p.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>o(!s),title:l.downloadTable,type:"button",children:e??p.jsx(c.DownloadIcon,{size:14})}),s?p.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[p.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("csv"),title:l.downloadTableAsCsv,type:"button",children:l.tableFormatCsv}),p.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>d("markdown"),title:l.downloadTableAsMarkdown,type:"button",children:l.tableFormatMarkdown})]}):null]})},oF=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:s}=Tn(),o=Ve(),[a,u]=b.useState(!1),{isAnimating:l}=b.useContext(en),c=sr(),d=()=>{u(!0)},f=()=>{u(!1)};return b.useEffect(()=>{if(a){Eh();let h=m=>{m.key==="Escape"&&u(!1)};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h),vh()}}},[a]),p.jsxs(p.Fragment,{children:[p.jsx("button",{className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:d,title:c.viewFullscreen,type:"button",children:p.jsx(i,{size:14})}),a?Kt.createPortal(p.jsx("div",{"aria-label":c.viewFullscreen,"aria-modal":"true",className:o("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:h=>{h.key==="Escape"&&f()},role:"dialog",children:p.jsxs("div",{className:o("flex h-full flex-col"),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),role:"presentation",children:[p.jsxs("div",{className:o("flex items-center justify-end gap-1 p-4"),children:[n?p.jsx(Ov,{}):null,r?p.jsx(Lv,{}):null,p.jsx("button",{className:o("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:c.exitFullscreen,type:"button",children:p.jsx(s,{size:20})})]}),p.jsx("div",{className:o("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:p.jsx("table",{className:o("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},aF=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:s=!0,...o})=>{let a=Ve(),u=n&&r,l=n&&i,c=n&&s,d=u||l||c;return p.jsxs("div",{className:a("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[d?p.jsxs("div",{className:a("flex items-center justify-end gap-1"),children:[u?p.jsx(Ov,{}):null,l?p.jsx(Lv,{}):null,c?p.jsx(oF,{showCopy:u,showDownload:l,children:e}):null]}):null,p.jsx("div",{className:a("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:p.jsx("table",{className:a("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},uF=/startLine=(\d+)/,lF=/\bnoLineNumbers\b/,cF=b.lazy(()=>Qs(()=>Promise.resolve().then(()=>Kz),void 0).then(e=>({default:e.Mermaid}))),dF=/language-([^\s]+)/;function ll(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function ft(e,t){return e.className===t.className&&ll(e.node,t.node)}var Cd=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,dc=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},dg=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},wa=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},wh=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>ft(e,t));wh.displayName="MarkdownOl";var Pv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("li",{className:i("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&ll(e.node,t.node));Pv.displayName="MarkdownLi";var Mv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>ft(e,t));Mv.displayName="MarkdownUl";var Dv=b.memo(({className:e,node:t,...n})=>{let r=Ve();return p.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>ft(e,t));Dv.displayName="MarkdownHr";var Fv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>ft(e,t));Fv.displayName="MarkdownStrong";var fF=({children:e,className:t,href:n,node:r,...i})=>{let s=Ve(),{linkSafety:o}=b.useContext(en),[a,u]=b.useState(!1),l=n==="streamdown:incomplete-link",c=b.useCallback(async m=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(m.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[o,n,l]),d=b.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),f=b.useCallback(()=>{u(!1)},[]),h={url:n??"",isOpen:a,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?p.jsxs(p.Fragment,{children:[p.jsx("button",{className:s("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:c,type:"button",children:e}),o.renderModal?o.renderModal(h):p.jsx(eF,{...h})]}):p.jsx("a",{className:s("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},jv=b.memo(fF,(e,t)=>ft(e,t)&&e.href===t.href);jv.displayName="MarkdownA";var Bv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>ft(e,t));Bv.displayName="MarkdownH1";var Hv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>ft(e,t));Hv.displayName="MarkdownH2";var Uv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>ft(e,t));Uv.displayName="MarkdownH3";var $v=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>ft(e,t));$v.displayName="MarkdownH4";var zv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>ft(e,t));zv.displayName="MarkdownH5";var qv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>ft(e,t));qv.displayName="MarkdownH6";var Wv=b.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=b.useContext(en),s=Cd(i,"table"),o=dc(i,"copy"),a=dc(i,"download"),u=dc(i,"fullscreen");return p.jsx(aF,{className:t,showControls:s,showCopy:o,showDownload:a,showFullscreen:u,...r,children:e})},(e,t)=>ft(e,t));Wv.displayName="MarkdownTable";var Vv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>ft(e,t));Vv.displayName="MarkdownThead";var Kv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>ft(e,t));Kv.displayName="MarkdownTbody";var Yv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>ft(e,t));Yv.displayName="MarkdownTr";var Gv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>ft(e,t));Gv.displayName="MarkdownTh";var Xv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>ft(e,t));Xv.displayName="MarkdownTd";var Qv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>ft(e,t));Qv.displayName="MarkdownBlockquote";var Zv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>ft(e,t));Zv.displayName="MarkdownSup";var Jv=b.memo(({children:e,className:t,node:n,...r})=>{let i=Ve();return p.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>ft(e,t));Jv.displayName="MarkdownSub";var ek=b.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=o=>{var a,u;if(!b.isValidElement(o))return!1;let l=Array.isArray(o.props.children)?o.props.children:[o.props.children],c=!1,d=!1;for(let f of l)if(f){if(typeof f=="string")f.trim()!==""&&(c=!0);else if(b.isValidElement(f))if(((a=f.props)==null?void 0:a["data-footnote-backref"])!==void 0)d=!0;else{let h=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let m of h){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if(b.isValidElement(m)&&((u=m.props)==null?void 0:u["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},s=Array.isArray(e)?e.map(o=>{if(!b.isValidElement(o))return o;if(o.type===wh){let a=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(u=>!i(u));return a.length===0?null:{...o,props:{...o.props,children:a}}}return o}):e;return(Array.isArray(s)?s.some(o=>o!==null):s!==null)?p.jsx("section",{className:t,...r,children:s}):null}return p.jsx("section",{className:t,...r,children:e})},(e,t)=>ft(e,t));ek.displayName="MarkdownSection";var hF=({node:e,className:t,children:n,...r})=>{var i,s;let o=Ve(),a=!("data-block"in r),{mermaid:u,controls:l,lineNumbers:c}=b.useContext(en),d=Th(),f=N9(),h=t?.match(dF),m=(i=h?.at(1))!=null?i:"",x=tF(m);if(a)return p.jsx("code",{className:o("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let E=(s=e?.properties)==null?void 0:s.metastring,y=E?.match(uF),v=y?Number.parseInt(y[1],10):void 0,k=v!==void 0&&v>=1?v:void 0,S=!(E&&lF.test(E))&&c!==!1,T="";if(b.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?T=n.props.children:typeof n=="string"&&(T=n),x){let O=x.component;return p.jsx(b.Suspense,{fallback:p.jsx(cg,{}),children:p.jsx(O,{code:T,isIncomplete:f,language:m,meta:E})})}if(m==="mermaid"&&d){let O=Cd(l,"mermaid"),_=wa(l,"download"),D=wa(l,"copy"),U=wa(l,"fullscreen"),F=wa(l,"panZoom"),R=O&&(_||D||U);return p.jsx(b.Suspense,{fallback:p.jsx(cg,{}),children:p.jsxs("div",{className:o("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[p.jsx("div",{className:o("flex h-8 items-center text-muted-foreground text-xs"),children:p.jsx("span",{className:o("ml-1 font-mono lowercase"),children:"mermaid"})}),R?p.jsx("div",{className:o("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:p.jsxs("div",{className:o("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[_?p.jsx(rF,{chart:T,config:u?.config}):null,D?p.jsx(ug,{code:T}):null,U?p.jsx(iF,{chart:T,config:u?.config}):null]})}):null,p.jsx("div",{className:o("rounded-md border border-border bg-background"),children:p.jsx(cF,{chart:T,config:u?.config,showControls:F})})]})})}let w=Cd(l,"code"),I=dg(l,"download"),A=dg(l,"copy");return p.jsx(Cv,{className:t,code:T,isIncomplete:f,language:m,lineNumbers:S,startLine:k,children:w?p.jsxs(p.Fragment,{children:[I?p.jsx(Q9,{code:T,language:m}):null,A?p.jsx(ug,{}):null]}):null})},tk=b.memo(hF,(e,t)=>e.className===t.className&&ll(e.node,t.node));tk.displayName="MarkdownCode";var nk=b.memo(J9,(e,t)=>e.className===t.className&&ll(e.node,t.node));nk.displayName="MarkdownImg";var rk=b.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(r.length===1&&b.isValidElement(r[0])){let i=r[0].props.node,s=i?.tagName;if(s==="img")return p.jsx(p.Fragment,{children:e});if(s==="code"&&"data-block"in r[0].props)return p.jsx(p.Fragment,{children:e})}return p.jsx("p",{...n,children:e})},(e,t)=>ft(e,t));rk.displayName="MarkdownParagraph";var pF={ol:wh,li:Pv,ul:Mv,hr:Dv,strong:Fv,a:jv,h1:Bv,h2:Hv,h3:Uv,h4:$v,h5:zv,h6:qv,table:Wv,thead:Vv,tbody:Kv,tr:Yv,th:Gv,td:Xv,blockquote:Qv,code:tk,img:nk,pre:({children:e})=>b.isValidElement(e)?b.cloneElement(e,{"data-block":"true"}):e,sup:Zv,sub:Jv,p:rk,section:ek},mF=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,gF=/\p{L}/u;function fg(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(mF.test(n))return"rtl";if(gF.test(n))return"ltr"}return"ltr"}var bF=/^[ \t]{0,3}(`{3,}|~{3,})/,xF=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,hg=e=>{let t=e.split(`
172
+ `),n=null,r=0;for(let i of t){let s=bF.exec(i);if(n===null){if(s){let o=s[1];n=o[0],r=o.length}}else if(s){let o=s[1],a=o[0],u=o.length;a===n&&u>=r&&(n=null,r=0)}}return n!==null},yF=e=>{let t=e.split(`
173
+ `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&xF.test(r))return!0}return!1},EF=()=>e=>{vn(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},pg=[],mg={allowDangerousHtml:!0},Sa=new WeakMap,vF=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let c="default";return this.keyCache.set(e,c),c}let s=c=>{if(!c||c.length===0)return"";let d="";for(let f=0;f<c.length;f+=1){let h=c[f];if(f>0&&(d+=","),Array.isArray(h)){let[m,x]=h;if(typeof m=="function"){let E=Sa.get(m);E||(E=m.name,Sa.set(m,E)),d+=E}else d+=String(m);d+=":",d+=JSON.stringify(x)}else if(typeof h=="function"){let m=Sa.get(h);m||(m=h.name,Sa.set(h,m)),d+=m}else d+=String(h)}return d},o=s(n),a=s(r),u=i?JSON.stringify(i):"",l=`${a}::${o}::${u}`;return this.keyCache.set(e,l),l}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},gg=new vF,ik=e=>{let t=kF(e),n=e.children||"",r=t.runSync(t.parse(n),n);return IF(r,e)},kF=e=>{let t=gg.get(e);if(t)return t;let n=wF(e);return gg.set(e,n),n},TF=e=>e.some(t=>Array.isArray(t)?t[0]===cd:t===cd),wF=e=>{let t=e.rehypePlugins||pg,n=e.remarkPlugins||pg,r=TF(t)?n:[...n,EF],i=e.remarkRehypeOptions?{...mg,...e.remarkRehypeOptions}:mg;return _8().use(SD).use(r).use(a8,i).use(t)},SF=e=>e,_F=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},CF=(e,t)=>{var n;for(let r in tc)if(Object.hasOwn(tc,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],s=tc[r];(s===null||s.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},AF=(e,t,n,r,i,s)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&s&&typeof t=="number"&&(o=!s(e,t,n)),o},IF=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:s,unwrapDisallowed:o,urlTransform:a}=t;if(n||r||i||s||a){let u=a||SF;vn(e,(l,c,d)=>{if(l.type==="raw"&&d&&typeof c=="number")return _F(d,c,s,l.value),c;if(l.type==="element"&&(CF(l,u),AF(l,c,d,r,i,n)&&d&&typeof c=="number"))return o&&l.children?d.children.splice(c,1,...l.children):d.children.splice(c,1),c})}return L5(e,{Fragment:p.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})},NF=/\[\^[\w-]{1,200}\](?!:)/,RF=/\[\^[\w-]{1,200}\]:/,OF=/<(\w+)[\s>]/,LF=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bg=new Map,xg=new Map,PF=e=>{let t=e.toLowerCase(),n=bg.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return bg.set(t,r),r},MF=e=>{let t=e.toLowerCase(),n=xg.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return xg.set(t,r),r},yg=(e,t)=>{if(LF.has(t.toLowerCase()))return 0;let n=e.match(PF(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},Eg=(e,t)=>{let n=e.match(MF(t));return n?n.length:0},DF=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},sk=e=>{let t=NF.test(e),n=RF.test(e);if(t||n)return[e];let r=on.lex(e,{gfm:!0}),i=[],s=[],o=!1;for(let a of r){let u=a.raw,l=i.length;if(s.length>0){i[l-1]+=u;let c=s.at(-1),d=yg(u,c),f=Eg(u,c);for(let h=0;h<d;h+=1)s.push(c);for(let h=0;h<f;h+=1)s.length>0&&s.at(-1)===c&&s.pop();continue}if(a.type==="html"&&a.block){let c=u.match(OF);if(c){let d=c[1],f=yg(u,d),h=Eg(u,d);f>h&&s.push(d)}}if(l>0&&!o){let c=i[l-1];if(DF(c)%2===1){i[l-1]=c+u;continue}}i.push(u),a.type!=="space"&&(o=a.type==="code")}return i},FF=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(s,o,a,u)=>{if(!a.includes(`
174
+
175
+ `))return o+a+u;let l=a.replace(/\n\n/g,`
176
+ <!---->
177
+ `),c=(l.startsWith(`
178
+ `)?"":`
179
+ `)+l+(l.endsWith(`
180
+ `)?"":`
181
+ `);return`${o}${c}${u}
182
+
183
+ `})}return n},jF=/([\\`*_~[\]|])/g,BF=e=>e.replace(jF,"\\$1"),HF=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(s,o,a,u)=>{let l=BF(a).replace(/\n\n/g,"&#10;&#10;");return o+l+u})}return n},ok=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(ok).join(""):"",UF=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));vn(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let i=ok(r);r.children=i?[{type:"text",value:i}]:[]}})},$F=()=>e=>{vn(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},zF=/^[ \t]*<[\w!/?-]/,qF=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,WF=e=>typeof e!="string"||e.length===0||!zF.test(e)?e:e.replace(qF,"$1"),vg,kg,Tg,wg,ja={...Wr,protocols:{...Wr.protocols,href:[...(kg=(vg=Wr.protocols)==null?void 0:vg.href)!=null?kg:[],"tel"]},attributes:{...Wr.attributes,code:[...(wg=(Tg=Wr.attributes)==null?void 0:Tg.code)!=null?wg:[],"metastring"]}},pu={raw:cd,sanitize:[Qy,ja],harden:[QI,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Sh={gfm:[gM,{}],codeMeta:$F},Sg=Object.values(pu),VF=Object.values(Sh),KF={block:" ▋",circle:" ●"},ak=["github-light","github-dark"],uk={enabled:!0},YF={shikiTheme:ak,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:uk},en=b.createContext(YF),lk=b.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:s,animatePlugin:o,...a})=>{if(o){let c=o.getLastRenderCharCount();o.setPrevContentLength(c)}let u=typeof e=="string"&&n?WF(e):e,l=p.jsx(ik,{...a,children:u});return p.jsx(wv.Provider,{value:i,children:s?p.jsx("div",{dir:s,style:{display:"contents"},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,o;return((s=e.components)==null?void 0:s[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});lk.displayName="Block";var mu=b.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:s,rehypePlugins:o=Sg,remarkPlugins:a=VF,className:u,shikiTheme:l=ak,mermaid:c,controls:d=!0,isAnimating:f=!1,animated:h,BlockComponent:m=lk,parseMarkdownIntoBlocksFn:x=sk,caret:E,plugins:y,remend:v,linkSafety:k=uk,lineNumbers:S=!0,allowedTags:T,literalTagContent:w,translations:I,icons:A,prefix:O,onAnimationStart:_,onAnimationEnd:D,...U})=>{let F=b.useId(),[R,j]=b.useTransition(),B=b.useMemo(()=>O9(O),[O]),q=b.useRef(null),$=b.useRef(_),X=b.useRef(D);$.current=_,X.current=D,b.useEffect(()=>{var ke,le,Ce;if(t==="static")return;let ge=q.current;if(q.current=f,ge===null){f&&((ke=$.current)==null||ke.call($));return}f&&!ge?(le=$.current)==null||le.call($):!f&&ge&&((Ce=X.current)==null||Ce.call(X))},[f,t]);let C=b.useMemo(()=>T?Object.keys(T):[],[T]),se=b.useMemo(()=>{if(typeof e!="string")return"";let ke=t==="streaming"&&r?C4(e,v):e;return w&&w.length>0&&(ke=HF(ke,w)),C.length>0&&(ke=FF(ke,C)),ke},[e,t,r,v,C,w]),xe=b.useMemo(()=>x(se),[se,x]),[L,G]=b.useState(xe);b.useEffect(()=>{t==="streaming"&&!ee?j(()=>{G(xe)}):G(xe)},[xe,t]);let re=t==="streaming"?L:xe,ne=b.useMemo(()=>n==="auto"?re.map(fg):void 0,[re,n]),pe=b.useMemo(()=>re.map((ke,le)=>`${F}-${le}`),[re.length,F]),Ae=b.useMemo(()=>h===!0?"true":h?JSON.stringify(h):"",[h]),ee=b.useMemo(()=>Ae?Ae==="true"?kd():kd(h):null,[Ae]),he=b.useMemo(()=>{var ke,le;return{shikiTheme:(le=(ke=y?.code)==null?void 0:ke.getThemes())!=null?le:l,controls:d,isAnimating:f,lineNumbers:S,mode:t,mermaid:c,linkSafety:k}},[l,d,f,S,t,c,k,y?.code]),Ie=b.useMemo(()=>I?JSON.stringify(I):"",[I]),Me=b.useMemo(()=>({...Iv,...I}),[Ie]),Be=b.useMemo(()=>{let{inlineCode:ke,...le}=s??{},Ce={...pF,...le};if(ke){let ge=Ce.code;Ce.code=Fe=>"data-block"in Fe?ge?b.createElement(ge,Fe):null:b.createElement(ke,Fe)}return Ce},[s]),fe=b.useMemo(()=>{let ke=[];return y!=null&&y.cjk&&(ke=[...ke,...y.cjk.remarkPluginsBefore]),ke=[...ke,...a],y!=null&&y.cjk&&(ke=[...ke,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(ke=[...ke,y.math.remarkPlugin]),ke},[a,y?.math,y?.cjk]),Le=b.useMemo(()=>{var ke;let le=o;if(T&&Object.keys(T).length>0&&o===Sg){let Ce={...ja,tagNames:[...(ke=ja.tagNames)!=null?ke:[],...Object.keys(T)],attributes:{...ja.attributes,...T}};le=[pu.raw,[Qy,Ce],pu.harden]}return w&&w.length>0&&(le=[...le,[UF,w]]),y!=null&&y.math&&(le=[...le,y.math.rehypePlugin]),ee&&f&&(le=[...le,ee.rehypePlugin]),le},[o,y?.math,ee,f,T,w]),Re=b.useMemo(()=>{if(!f||re.length===0)return!1;let ke=re.at(-1);return hg(ke)||yF(ke)},[f,re]),De=b.useMemo(()=>E&&f&&!Re?{"--streamdown-caret":`"${KF[E]}"`}:void 0,[E,f,Re]);return t==="static"?p.jsx(wd.Provider,{value:Me,children:p.jsx(Sd.Provider,{value:y??null,children:p.jsx(en.Provider,{value:he,children:p.jsx(ag,{icons:A,children:p.jsx(Td.Provider,{value:B,children:p.jsx("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",u),dir:n==="auto"?fg(se):n,children:p.jsx(ik,{components:Be,rehypePlugins:Le,remarkPlugins:fe,...U,children:se})})})})})})}):p.jsx(wd.Provider,{value:Me,children:p.jsx(Sd.Provider,{value:y??null,children:p.jsx(en.Provider,{value:he,children:p.jsx(ag,{icons:A,children:p.jsx(Td.Provider,{value:B,children:p.jsxs("div",{className:B("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",E&&!Re?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,u),style:De,children:[re.length===0&&E&&f&&p.jsx("span",{}),re.map((ke,le)=>{var Ce;let ge=le===re.length-1,Fe=f&&ge&&hg(ke);return p.jsx(m,{animatePlugin:ee,components:Be,content:ke,dir:(Ce=ne?.[le])!=null?Ce:n!=="auto"?n:void 0,index:le,isIncomplete:Fe,rehypePlugins:Le,remarkPlugins:fe,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...U},pe[le])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);mu.displayName="Streamdown";var GF=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:o=1,fullscreen:a=!1})=>{let{RotateCcwIcon:u,ZoomInIcon:l,ZoomOutIcon:c}=Tn(),d=Ve(),f=b.useRef(null),h=b.useRef(null),[m,x]=b.useState(o),[E,y]=b.useState({x:0,y:0}),[v,k]=b.useState(!1),[S,T]=b.useState({x:0,y:0}),[w,I]=b.useState({x:0,y:0}),A=b.useCallback(B=>{x(q=>Math.max(n,Math.min(r,q+B)))},[n,r]),O=b.useCallback(()=>{A(i)},[A,i]),_=b.useCallback(()=>{A(-i)},[A,i]),D=b.useCallback(()=>{x(o),y({x:0,y:0})},[o]),U=b.useCallback(B=>{B.preventDefault();let q=B.deltaY>0?-i:i;A(q)},[A,i]),F=b.useCallback(B=>{if(B.button!==0||B.isPrimary===!1)return;k(!0),T({x:B.clientX,y:B.clientY}),I(E);let q=B.currentTarget;q instanceof HTMLElement&&q.setPointerCapture(B.pointerId)},[E]),R=b.useCallback(B=>{if(!v)return;B.preventDefault();let q=B.clientX-S.x,$=B.clientY-S.y;y({x:w.x+q,y:w.y+$})},[v,S,w]),j=b.useCallback(B=>{k(!1);let q=B.currentTarget;q instanceof HTMLElement&&q.releasePointerCapture(B.pointerId)},[]);return b.useEffect(()=>{let B=f.current;if(B)return B.addEventListener("wheel",U,{passive:!1}),()=>{B.removeEventListener("wheel",U)}},[U]),b.useEffect(()=>{let B=h.current;if(B&&v)return document.body.style.userSelect="none",B.addEventListener("pointermove",R,{passive:!1}),B.addEventListener("pointerup",j),B.addEventListener("pointercancel",j),()=>{document.body.style.userSelect="",B.removeEventListener("pointermove",R),B.removeEventListener("pointerup",j),B.removeEventListener("pointercancel",j)}},[v,R,j]),p.jsxs("div",{className:d("relative flex flex-col",a?"h-full w-full":"min-h-28 w-full",t),ref:f,style:{cursor:v?"grabbing":"grab"},children:[s?p.jsxs("div",{className:d("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",a?"bottom-4 left-4":"bottom-2 left-2"),children:[p.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:m>=r,onClick:O,title:"Zoom in",type:"button",children:p.jsx(l,{size:16})}),p.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:m<=n,onClick:_,title:"Zoom out",type:"button",children:p.jsx(c,{size:16})}),p.jsx("button",{className:d("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:D,title:"Reset zoom and pan",type:"button",children:p.jsx(u,{size:16})})]}):null,p.jsx("div",{className:d("flex-1 origin-center transition-transform duration-150 ease-out",a?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:F,ref:h,role:"application",style:{transform:`translate(${E.x}px, ${E.y}px) scale(${m})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},ck=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let s=Ve(),[o,a]=b.useState(null),[u,l]=b.useState(!1),[c,d]=b.useState(""),[f,h]=b.useState(""),[m,x]=b.useState(0),{mermaid:E}=b.useContext(en),y=Th(),v=E?.errorComponent,{shouldRender:k,containerRef:S}=E9({immediate:r});if(b.useEffect(()=>{if(k){if(!y){a("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{a(null),l(!0);let w=y.getMermaid(n),I=e.split("").reduce((_,D)=>(_<<5)-_+D.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(I)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:O}=await w.render(A,e);d(O),h(O)}catch(w){if(!(f||c)){let I=w instanceof Error?w.message:"Failed to render Mermaid chart";a(I)}}finally{l(!1)}})()}},[e,n,m,k,y]),!(k||c||f))return p.jsx("div",{className:s("my-4 min-h-[200px]",t),ref:S});if(u&&!c&&!f)return p.jsx("div",{className:s("my-4 flex justify-center p-4",t),ref:S,children:p.jsxs("div",{className:s("flex items-center space-x-2 text-muted-foreground"),children:[p.jsx("div",{className:s("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),p.jsx("span",{className:s("text-sm"),children:"Loading diagram..."})]})});if(o&&!c&&!f){let w=()=>x(I=>I+1);return v?p.jsx("div",{ref:S,children:p.jsx(v,{chart:e,error:o,retry:w})}):p.jsxs("div",{className:s("rounded-md bg-red-50 p-4",t),ref:S,children:[p.jsxs("p",{className:s("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",o]}),p.jsxs("details",{className:s("mt-2"),children:[p.jsx("summary",{className:s("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),p.jsx("pre",{className:s("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let T=c||f;return p.jsx("div",{className:s("size-full",t),"data-streamdown":"mermaid",ref:S,children:p.jsx(GF,{className:s(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:p.jsx("div",{"aria-label":"Mermaid chart",className:s("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:T},role:"img"})})})};function XF({href:e,onOpenFailed:t,onClick:n,children:r,...i}){const s=ci(),{t:o}=je();return p.jsx("a",{...i,href:e,target:i.target??"_blank",rel:i.rel??"noopener noreferrer",...n===void 0?{}:{onClick:n},onClickCapture:a=>{if(s.openUrl===void 0||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.button!==0)return;a.preventDefault();const u=()=>{if(t!==void 0){t();return}Lf(o("link.open"),()=>Promise.reject(new Error(o("common.popupBlocked"))))};mf(s,e,o("common.popupBlocked")).then(()=>{},u)},children:r})}function QF(e){let t=!1,n,r;const i=()=>{typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",u)},s=()=>{n!==void 0&&(cancelAnimationFrame(n),n=void 0),r?.(),r=void 0},o=()=>{t||(t=!0,i(),e())},a=()=>{s();const l=setTimeout(o,0);r=()=>{clearTimeout(l)}},u=()=>{!t&&typeof document<"u"&&document.visibilityState==="hidden"&&a()};if(typeof document<"u"){if(document.visibilityState==="hidden")return a(),()=>{t=!0,s()};typeof document.addEventListener=="function"&&document.addEventListener("visibilitychange",u)}return n=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{if(n=void 0,typeof requestIdleCallback=="function"){const l=requestIdleCallback(()=>{o()});r=()=>{cancelIdleCallback(l)}}else{const l=setTimeout(o,0);r=()=>{clearTimeout(l)}}})}),()=>{t=!0,i(),s()}}const dk="box-decoration-clone cursor-pointer rounded-[2px] bg-ink/[0.06] px-px [color:inherit] underline decoration-accent/45 decoration-1 underline-offset-[3px] outline-none transition-colors hover:bg-ink/[0.1] hover:decoration-accent/75 focus-visible:bg-ink/[0.1] focus-visible:ring-2 focus-visible:ring-selected-ink/40 focus-visible:ring-offset-1",fk="ml-0.5 inline-flex h-3 w-3 shrink-0 cursor-pointer select-none items-center justify-center align-middle text-accent/80 transition-colors hover:text-accent",ZF="M3 3.5h10c.6 0 1 .4 1 1v6c0 .6-.4 1-1 1H8.2L5 13.8v-2.3H3c-.6 0-1-.4-1-1v-6c0-.6.4-1 1-1z";function hk(e,t){const n=[];for(const s of t){if(s.source!==void 0&&s.source!==null&&Ui(s.quote)!==s.source.text)continue;const o=s.source===null?null:s.source===void 0?Pc(e,s.quote):w_(e,s.source);if(o!==null){if(s.source===void 0&&Pc(e.slice(o.end),s.quote)!==null)continue;n.push({...o,annotationId:s.id})}}n.sort((s,o)=>s.start-o.start||o.end-s.end);const r=[];let i=-1;for(const s of n)s.start<i||(r.push(s),i=s.end);return r}function JF(e,t,n=r=>r){const r=hk(e,t);if(r.length===0)return n(e);const i=[];let s=0;return r.forEach((o,a)=>{o.start>s&&i.push(p.jsx(b.Fragment,{children:n(e.slice(s,o.start))},`t-${a}`)),i.push(p.jsx("mark",{"data-annotation-ref":o.annotationId,role:"button",tabIndex:0,"aria-haspopup":"dialog",className:dk,children:n(e.slice(o.start,o.end))},`m-${a}`),p.jsx("span",{"data-annotation-ref":o.annotationId,"data-annotation-bubble":"","data-source-ignore":"true","aria-hidden":"true",className:fk,children:p.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:p.jsx("path",{d:ZF})})},`b-${a}`)),s=o.end}),s<e.length&&i.push(p.jsx(b.Fragment,{children:n(e.slice(s))},"t-tail")),p.jsx(p.Fragment,{children:i})}const _h="data-kiki-dom-mark",pk="data-kiki-dom-bubble",_g="http://www.w3.org/2000/svg",ej="M3 3.5h10c.6 0 1 .4 1 1v6c0 .6-.4 1-1 1H8.2L5 13.8v-2.3H3c-.6 0-1-.4-1-1v-6c0-.6.4-1 1-1z",mn=new Set,br=new Map,Xt=new WeakSet,po=new WeakMap;function tj(e){if(e instanceof HTMLElement&&mn.has(e))return e;for(const t of mn)if(t.contains(e))return t;return null}function nj(e){const n=e.ownerDocument?.activeElement;if(!(n instanceof HTMLElement)||!e.contains(n))return;const r=n.closest("[data-annotation-ref]")?.getAttribute("data-annotation-ref");if(r==null)return;const i=tj(e);i!==null&&po.set(i,r)}function fc(e){return e.querySelector("code span[style]")!==null}function rj(e){if(e===void 0||e.length===0)return"";let t="";for(let n=0;n<e.length;n+=1){const r=e[n];n>0&&(t+="");const i=r.source;i===void 0?t+=`${r.id}\0${r.quote}\0u`:i===null?t+=`${r.id}\0${r.quote}\0n`:t+=`${r.id}\0${r.quote}\0${i.blockId}:${i.version}:${i.start}:${i.end}:${i.text}`}return t}function Mi(e){const t=e.querySelectorAll(`[${pk}]`),n=e.querySelectorAll(`mark[${_h}]`);if(t.length===0&&n.length===0)return!1;nj(e);for(let i=0;i<t.length;i+=1)t[i].remove();const r=new Set;for(let i=n.length-1;i>=0;i-=1){const s=n[i],o=s.parentNode;if(o!==null){for(r.add(o);s.firstChild!==null;)o.insertBefore(s.firstChild,s);s.remove()}}for(const i of r)i.normalize();return!0}function ij(e,t){Xt.delete(t);let n=br.get(e);return n===void 0&&(n=new Set,br.set(e,n)),n.add(t),()=>{Xt.delete(t);const r=br.get(e);r!==void 0&&(r.delete(t),r.size===0&&br.delete(e))}}function sj(e,t){if(t!==null){if(t!==void 0){if(!t.isConnected)return;if(e!==void 0){const r=br.get(e);if(r!==void 0&&r.size>0){let i=!1;for(const s of r){if(!s.isConnected){r.delete(s),Xt.delete(s);continue}if(t.contains(s)){if(i=!0,Xt.has(s)||fc(s)){Xt.add(s);continue}Xt.add(s),Mi(s)}}if(r.size===0&&br.delete(e),i)return}}const n=t.querySelectorAll(".kiki-cb-body");for(let r=0;r<n.length;r+=1){const i=n[r];if(Xt.has(i)||fc(i)){Xt.add(i);continue}(e===void 0||(i.textContent??"").replace(/\n$/,"")===e)&&(Xt.add(i),Mi(i))}return}if(e!==void 0){const n=br.get(e);if(n===void 0||n.size===0)return;for(const r of n){if(!r.isConnected){n.delete(r),Xt.delete(r);continue}if(Xt.has(r)||fc(r)){Xt.add(r);continue}Xt.add(r),Mi(r)}n.size===0&&br.delete(e);return}if(mn.size!==0)for(const n of mn){if(!n.isConnected){mn.delete(n);continue}const r=n.querySelectorAll(".kiki-cb-body");for(let i=0;i<r.length;i+=1)Mi(r[i])}}}function oj(e){mn.delete(e),po.delete(e)}function aj(e,t,n,r){const i=e.createElement("mark");return i.className=dk,i.setAttribute("data-annotation-ref",t),i.setAttribute(_h,""),r&&(i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-haspopup","dialog")),i.textContent=n,i}function uj(e,t){const n=e.createElement("span");n.className=fk,n.setAttribute("data-annotation-ref",t),n.setAttribute("data-annotation-bubble",""),n.setAttribute("data-source-ignore","true"),n.setAttribute(pk,""),n.setAttribute("aria-hidden","true");const r=e.createElementNS(_g,"svg");r.setAttribute("aria-hidden","true"),r.setAttribute("viewBox","0 0 16 16"),r.setAttribute("fill","none"),r.setAttribute("stroke","currentColor"),r.setAttribute("stroke-width","1.5"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("class","h-3 w-3");const i=e.createElementNS(_g,"path");return i.setAttribute("d",ej),r.appendChild(i),n.appendChild(r),n}function lj(e){const t=e.tagName;return t==="A"||t==="KBD"?!0:t==="CODE"?e.parentElement?.tagName!=="PRE":!1}function cj(e,t){let n=null,r=e.parentElement;for(;r!==null&&r!==t;){if(lj(r))n=r;else if(n!==null)break;r=r.parentElement}return n}function dj(e){const t=e.tagName;return!!(t==="SCRIPT"||t==="STYLE"||t==="BUTTON"||e.hasAttribute("data-source-ignore")||e.classList.contains("kiki-cb-tools")||e.getAttribute("data-streamdown")==="code-block-header")}function fj(e){const t=[],n=[];let r=0;const i=s=>{for(let o=s.firstChild;o!==null;o=o.nextSibling){const a=o.nodeType;if(a===3){const u=o,l=u.nodeValue;l!==null&&l.length>0&&(t.push({node:u,value:l,offset:r,end:r+l.length}),n.push(l),r+=l.length);continue}if(a===1){const u=o;if(dj(u))continue;i(u);const l=u.getAttribute("data-source-omitted-canonical-chars");if(l!==null){const c=Number(l);Number.isSafeInteger(c)&&c>0&&(n.push("\0".repeat(c)),r+=c)}}}};return i(e),{texts:t,fullText:n.join("")}}function hj(e,t){const n=e.ownerDocument,r=n.activeElement,i=r instanceof HTMLElement&&e.contains(r)?r.closest("[data-annotation-ref]")?.getAttribute("data-annotation-ref")??null:null,s=i===null&&(r===null||r===n.body)?po.get(e)??null:null,o=i??s;if(po.delete(e),Mi(e),po.delete(e),t===void 0||t.length===0)return mn.delete(e),!1;const{texts:a,fullText:u}=fj(e);if(a.length===0)return mn.delete(e),!1;const l=hk(u,t);if(l.length===0)return mn.delete(e),!1;const c=new Map,d=new Map,f=new Map;let h=0;for(let E=0;E<a.length;E+=1){const y=a[E];for(;h<l.length&&l[h].end<=y.offset;)h+=1;if(h>=l.length)break;if(y.value.trim()==="")continue;let v=h,k;for(;v<l.length&&l[v].start<y.end;){const S=l[v];if(k===void 0&&(k=[],c.set(E,k)),k.push(S),d.has(S.annotationId)||d.set(S.annotationId,E),f.set(S.annotationId,E),S.end<=y.end)v+=1;else break}}if(c.size===0)return mn.delete(e),!1;const m=[],x=[...c.keys()];for(let E=x.length-1;E>=0;E-=1){const y=x[E],v=a[y],k=v.node.parentNode;if(k===null)continue;const S=c.get(y),T=n.createDocumentFragment();let w=0;for(let I=0;I<S.length;I+=1){const A=S[I],O=Math.max(0,A.start-v.offset),_=Math.min(v.value.length,A.end-v.offset);O>w&&T.appendChild(n.createTextNode(v.value.slice(w,O)));const D=d.get(A.annotationId)===y;if(T.appendChild(aj(n,A.annotationId,v.value.slice(O,_),D)),f.get(A.annotationId)===y){const U=uj(n,A.annotationId),F=cj(v.node,e);F!==null?m.push({target:F,bubble:U}):T.appendChild(U)}w=_}w<v.value.length&&T.appendChild(n.createTextNode(v.value.slice(w))),k.replaceChild(T,v.node)}for(let E=m.length-1;E>=0;E-=1){const{target:y,bubble:v}=m[E],k=y.parentNode;k!==null&&k.insertBefore(v,y.nextSibling)}return mn.add(e),o!==null&&[...e.querySelectorAll(`mark[${_h}][tabindex="0"]`)].find(y=>y.getAttribute("data-annotation-ref")===o)?.focus({preventScroll:!0}),!0}const nt={eof:null,asterisk:42,underscore:95,tilde:126},os={attentionSideAfter:2,characterGroupPunctuation:2,characterGroupWhitespace:1},Nn={data:"data",characterEscape:"characterEscape",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",strong:"strong",strongSequence:"strongSequence",strongText:"strongText"},pj=161,mj=1114109,gj=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],bj=12288,xj=65510,yj=[12288,12288,65281,65376,65504,65510],Ej=8361,vj=65518,kj=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Tj=32,wj=10630,Sj=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_j=4352,Cj=262141,mk=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Jo=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){const i=Math.floor((n+r)/2),s=i*2;if(t<e[s])r=i-1;else if(t>e[s+1])n=i+1;else return!0}return!1},Cg=19968,[Aj,Ij]=Nj(mk);function Nj(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){const i=e[r],s=e[r+1];if(Cg>=i&&Cg<=s)return[i,s];s-i>n-t&&(t=i,n=s)}return[t,n]}const Rj=e=>e<pj||e>mj?!1:Jo(gj,e),Oj=e=>e<bj||e>xj?!1:Jo(yj,e),Lj=e=>e<Ej||e>vj?!1:Jo(kj,e),Pj=e=>e<Tj||e>wj?!1:Jo(Sj,e),Mj=e=>e>=Aj&&e<=Ij?!0:e<_j||e>Cj?!1:Jo(mk,e);function Dj(e){return Rj(e)?"ambiguous":Oj(e)?"fullwidth":Lj(e)?"halfwidth":Pj(e)?"narrow":Mj(e)?"wide":"neutral"}function Fj(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function jj(e){return Fj(e),Dj(e)}function Bj(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function Hj(e){if(!e||e<4352)return!1;switch(jj(e)){case"fullwidth":case"halfwidth":return!0;case"wide":return!Bj(e);case"narrow":return!1;case"ambiguous":return 917760<=e&&e<=917999?null:!1;case"neutral":return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function Uj(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function $j(e){return e!==null&&e>=65024&&e<=65038}const zj=gk(/\p{P}|\p{S}/u),qj=gk(/\s/);function gk(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCodePoint(n))}}function xt(e){return!!(e&os.characterGroupWhitespace)}function Hn(e){return(e&Jt.cjkPunctuation)===os.characterGroupPunctuation}function Ao(e){return!!(e&Jt.cjk)}function Wj(e){return e===Jt.ivs}function ui(e){return!!(e&Jt.cjkOrIvs)}function ea(e){return e===Jt.nonEmojiGeneralUseVS}function gu(e){return!!(e&Jt.spaceOrPunctuation)}let Jt;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(Jt||(Jt={}));function Ot(e){if(e===nt.eof||st(e)||qj(e))return os.characterGroupWhitespace;let t=0;if(e>=4352){if($j(e))return Jt.nonEmojiGeneralUseVS;switch(Hj(e)){case null:return Jt.ivs;case!0:t|=Jt.cjk;break}}return zj(e)&&(t|=os.characterGroupPunctuation),t}function cl(e,t,n){if(!ea(e))return e;const r=t(),i=Ot(r);return!r||xt(i)?e:Uj(r,n)?Jt.cjkPunctuation:Vj(i)}function Vj(e){return e&~Jt.ivs}function bk(e){return!!(e&&e>=55296&&e<=56319)}function xk(e){return!!(e&&e>=56320&&e<=57343)}function yk(e,t,n){if(t._bufferIndex<2)return e;const r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Kj(e,t,n){const r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;const i=t._bufferIndex-r-2,s=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=s.charCodeAt(s.length-1);if(Number.isNaN(o))return null;if(s.length<2||o<56320||57343<o)return o;const a=s.codePointAt(0);return a&&a>=65536?a:o}var Ek=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Kj(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function vk(e,t,n){const r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}const hc={name:"attention",resolveAll:Yj,tokenize:Gj};function Yj(e,t){let n=-1,r,i,s,o,a,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};Ag(d,-u),Ag(f,u),o={type:u>1?Nn.strongSequence:Nn.emphasisSequence,start:d,end:{...e[r][1].end}},a={type:u>1?Nn.strongSequence:Nn.emphasisSequence,start:{...e[n][1].start},end:f},s={type:u>1?Nn.strongText:Nn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?Nn.strong:Nn.emphasis,start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=St(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=St(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),t.parser.constructs.insideSpan.null,l=St(l,bs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=St(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=St(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Ct(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Gj(e,t){const n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:s}=this,o=xk(s)?yk(s,r(),i):s,a=Ot(o),u=new Ek(o,r(),i),l=cl(a,u.value.bind(u),o);let c;return d;function d(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const m=e.exit("attentionSequence"),x=Ot(bk(h)?vk(h,r(),i):h),E=Hn(l),y=E||xt(l),v=Hn(x),k=v||xt(x),S=ui(l),T=!k||v&&(y||S)||n.includes(h),w=!y||E&&(k||Ao(x))||n.includes(o);return m._open=!!(c===nt.asterisk?T:T&&(gu(l)||!w)),m._close=!!(c===nt.asterisk?w:w&&(gu(x)||!T)),t(h)}}function Ag(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Xj(){return{text:{[nt.asterisk]:hc,[nt.underscore]:hc},insideSpan:{null:[hc]}}}function Qj(){const e=this.data();(e.micromarkExtensions||(e.micromarkExtensions=[])).push(Xj())}const Zj=";".codePointAt(0)??nt.eof,Jj="&".codePointAt(0)??nt.eof;function e7(){return{handlers:{emphasis:kk,strong:Tk,text:t7}}}kk.peek=wk;Tk.peek=Sk;function kk(e,t,n,r){return _k(e,t,n,r,wk(e,t,n),1)}function Tk(e,t,n,r){return _k(e,t,n,r,Sk(e,t,n),2)}function wk(e,t,n){return n.options.emphasis||"*"}function Sk(e,t,n){return n.options.strong||"*"}function _k(e,t,n,r,i,s){const o=i.repeat(s),a=n.enter(s===1?"emphasis":"strong"),u=n.createTracker(r),l=u.move(o);let c=u.move(n.containerPhrasing(e,{after:i,before:l,...u.current()}));const d=i7(e,t,n,r.before),f=s7(e,t,n,r.after),h=Ig(d,bu(c),i,"open");h.inside&&c&&(c=c7(c));const m=Ig({current:Id(c),previous:Ad(c)},f,i,"close");m.inside&&c&&(c=d7(c));const x=u.move(o);a();const E=m.outside&&l7(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!E,before:h.outside},n.cjkFriendlyEncodeAfterSupplementaryText=E,l+c+x}function t7(e,t,n,r){const i=n;if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;const[s=""]=[...e.value],o=e.value.slice(s.length);return`${Ah(s.codePointAt(0)??nt.eof)}${n.safe(o,{...r,before:";"})}`}function Ig(e,t,n,r){const i=Ch(e),s=Ot(t);if(!ui(i)&&!ui(s))return r==="open"?Ng(i,s,n):Ng(s,i,n);const o={inside:!1,outside:!1},a={inside:!0,outside:!1},u={inside:!1,outside:!0},l={inside:!0,outside:!0};for(const c of[o,a,u,l]){const d=r==="open"?c.outside?Rg:e:c.inside?Rg:e,f=r==="open"?c.inside?Og:t:c.outside?Og:t;if(r==="open"?n7(n,d,f):r7(n,d,f))return c}return l}function Ng(e,t,n){return pc(e)?pc(t)?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xt(e)?pc(t)?{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function n7(e,t,n){const r=Ch(t),{close:i,open:s}=Ck(r,Ot(n));return e==="_"?s&&(gu(r)||!i):s}function r7(e,t,n){const r=Ot(n),{close:i,open:s}=Ck(Ch(t),r);return e==="_"?i&&(gu(r)||!s):i}function Ck(e,t){const n=Hn(e),r=n||xt(e),i=Hn(t),s=i||xt(t);return{open:!s||i&&(r||ui(e)),close:!r||n&&(s||Ao(t))}}function pc(e){return!xt(e)&&!Hn(e)}function Ch(e){const t=Ot(e.current);return e.current===null||!ea(t)?t:cl(t,()=>e.previous,e.current)}function i7(e,t,n,r){let i=Id(r),s=Ad(r);if(o7(i)||u7(i,s)){const o=Ak(e,t,n,-1);o&&(i=Id(o),s=Ad(o))}return{current:i,previous:s}}function s7(e,t,n,r){const i=bu(r);if(!a7(i))return i;const s=Ak(e,t,n,1);return s?bu(s):i}function o7(e){return e!==null&&56320<=e&&e<=57343}function a7(e){return e!==null&&55296<=e&&e<=56319}function u7(e,t){return ea(Ot(e))&&(t===null||t===nt.eof)}function Ak(e,t,n,r){if(!t)return;const i=n.indexStack.at(-1),s=t.children,o=typeof i=="number"?i:s.indexOf(e);if(o<0)return;const a=s[o+r];return Ik(a)||void 0}function l7(e,t){if(!e)return!1;const n=t.indexStack.at(-1);if(typeof n!="number")return!1;const r=e.children[n+1];return r?.type==="text"&&(bu(r.value)??0)>65535}function Ik(e){return!e||typeof e!="object"?"":"value"in e&&typeof e.value=="string"?e.value:"alt"in e&&typeof e.alt=="string"?e.alt:"children"in e&&Array.isArray(e.children)?e.children.map(Ik).join(""):""}function Ah(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function c7(e){const[t=""]=[...e];return Ah(t.codePointAt(0)??nt.eof)+e.slice(t.length)}function d7(e){const t=[...e],n=t.pop();return`${t.join("")}${Ah(n?.codePointAt(0)??nt.eof)}`}function Ad(e){const t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??nt.eof}function bu(e){return e.codePointAt(0)??nt.eof}function Id(e){return[...e].at(-1)?.codePointAt(0)??nt.eof}const Rg={current:Zj,previous:nt.eof},Og=Jj;function f7(){const e=this.data();(e.toMarkdownExtensions||(e.toMarkdownExtensions=[])).push(e7())}function h7(){Qj.call(this),f7.call(this)}var p7=h7;function m7(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:i,resolveAll:r};return t==null&&(t=!0),{text:{[nt.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[nt.tilde]}};function r(s,o){let a=-1;for(;++a<s.length;)if(s[a][0]==="enter"&&s[a][1].type==="strikethroughSequenceTemporary"&&s[a][1]._close){let u=a;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[a][1].end.offset-s[a][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[a][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const l={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[a][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[a][1].start)},d=[["enter",l,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",c,o]],f=o.parser.constructs.insideSpan.null;f&&Ct(d,d.length,0,bs(f,s.slice(u+1,a),o)),Ct(d,d.length,0,[["exit",c,o],["enter",s[a][1],o],["exit",s[a][1],o],["exit",l,o]]),Ct(s,u-1,a-u+3,d),a=u+d.length-2;break}}for(a=-1;++a<s.length;)s[a][1].type==="strikethroughSequenceTemporary"&&(s[a][1].type=Nn.data);return s}function i(s,o,a){const{now:u,sliceSerialize:l,previous:c}=this,d=xk(c)?yk(c,u(),l):c,f=Ot(d),h=new Ek(d,u(),l),m=cl(f,h.value.bind(h),d),x=this.events;let E=0;return y;function y(k){return d===nt.tilde&&x[x.length-1][1].type!==Nn.characterEscape?a(k):(s.enter("strikethroughSequenceTemporary"),v(k))}function v(k){const S=Ot(d);if(k===nt.tilde)return E>1?a(k):(s.consume(k),E++,v);if(E<2&&!t)return a(k);const T=s.exit("strikethroughSequenceTemporary"),w=Ot(bk(k)?vk(k,u(),l):k),I=Hn(m)||xt(m),A=Hn(w)||xt(w),O=Ao(m)||Wj(S);return T._open=!A||w===os.attentionSideAfter&&(I||O),T._close=!I||S===os.attentionSideAfter&&(A||Ao(w)),o(k)}}}function g7(e){const t=this.data();(t.micromarkExtensions||(t.micromarkExtensions=[])).push(m7(e))}const b7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],x7=";".codePointAt(0)??nt.eof,y7="&".codePointAt(0)??nt.eof;function E7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:b7}],handlers:{delete:Nk,text:v7}}}Nk.peek=k7;function Nk(e,t,n,r){const s=n.enter("strikethrough"),o=n.createTracker(r),a=o.move("~~");let u=o.move(n.containerPhrasing(e,{after:"~",before:a,...o.current()}));const l=S7(e,t,n,r.before),c=_7(e,t,n,r.after),d=Lg(l,xu(u),"open");d.inside&&u&&(u=R7(u));const f=Lg({current:Rd(u),previous:Nd(u)},c,"close");f.inside&&u&&(u=O7(u));const h=o.move("~~");s();const m=f.outside&&N7(t,n);return n.attentionEncodeSurroundingInfo={after:f.outside&&!m,before:d.outside},n.cjkFriendlyEncodeAfterSupplementaryText=m,a+u+h}function v7(e,t,n,r){const i=n;if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;const[s=""]=[...e.value],o=e.value.slice(s.length);return`${Nh(s.codePointAt(0)??nt.eof)}${n.safe(o,{...r,before:";"})}`}function k7(){return"~"}function Lg(e,t,n){const r=Ih(e),i=Ot(t);if(!ui(r)&&!ui(i))return n==="open"?Pg(r,i):Pg(i,r);const s={inside:!1,outside:!1},o={inside:!0,outside:!1},a={inside:!1,outside:!0},u={inside:!0,outside:!0};for(const l of[s,o,a,u]){const c=n==="open"?l.outside?Mg:e:l.inside?Mg:e,d=n==="open"?l.inside?Dg:t:l.outside?Dg:t;if(n==="open"?T7(c,d):w7(c,d))return l}return u}function Pg(e,t){return mc(e)?mc(t)?{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xt(e)?mc(t)?{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xt(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function T7(e,t){const{open:n}=Rk(Ih(e),Ot(t));return n}function w7(e,t){const n=Ot(t),{close:r}=Rk(Ih(e),n);return r}function Rk(e,t){const n=Hn(e),r=n||xt(e),i=Hn(t),s=i||xt(t);return{open:!s||i&&(r||ui(e)),close:!r||n&&(s||Ao(t))}}function mc(e){return!xt(e)&&!Hn(e)}function Ih(e){const t=Ot(e.current);return e.current===null||!ea(t)?t:cl(t,()=>e.previous,e.current)}function S7(e,t,n,r){let i=Rd(r),s=Nd(r);if(C7(i)||I7(i,s)){const o=Ok(e,t,n,-1);o&&(i=Rd(o),s=Nd(o))}return{current:i,previous:s}}function _7(e,t,n,r){const i=xu(r);if(!A7(i))return i;const s=Ok(e,t,n,1);return s?xu(s):i}function C7(e){return e!==null&&56320<=e&&e<=57343}function A7(e){return e!==null&&55296<=e&&e<=56319}function I7(e,t){return ea(Ot(e))&&(t===null||t===nt.eof)}function Ok(e,t,n,r){if(!t)return;const i=n.indexStack.at(-1),s=t.children,o=typeof i=="number"?i:s.indexOf(e);if(o<0)return;const a=s[o+r];return Lk(a)||void 0}function N7(e,t){if(!e)return!1;const n=t.indexStack.at(-1);if(typeof n!="number")return!1;const r=e.children[n+1];return r?.type==="text"&&(xu(r.value)??0)>65535}function Lk(e){return!e||typeof e!="object"?"":"value"in e&&typeof e.value=="string"?e.value:"alt"in e&&typeof e.alt=="string"?e.alt:"children"in e&&Array.isArray(e.children)?e.children.map(Lk).join(""):""}function Nh(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function R7(e){const[t=""]=[...e];return Nh(t.codePointAt(0)??nt.eof)+e.slice(t.length)}function O7(e){const t=[...e],n=t.pop();return`${t.join("")}${Nh(n?.codePointAt(0)??nt.eof)}`}function Nd(e){const t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??nt.eof}function xu(e){return e.codePointAt(0)??nt.eof}function Rd(e){return[...e].at(-1)?.codePointAt(0)??nt.eof}const Mg={current:x7,previous:nt.eof},Dg=y7;function L7(){const e=this.data();(e.toMarkdownExtensions||(e.toMarkdownExtensions=[])).push(E7())}function P7(e){g7.call(this,e),L7.call(this)}var M7=P7,D7=new Set(["。",".",",","、","?","!",":",";","(",")","【","】","「","」","『","』","〈","〉","《","》"]),F7=/^(https?:\/\/|mailto:|www\.)/i,j7=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type==="text"&&t.value===e.url},B7=e=>{let t=0;for(let n of e){if(D7.has(n))return t;t+=n.length}return null},H7=(e,t)=>({...t,url:e,children:[{type:"text",value:e}]}),U7=e=>({type:"text",value:e}),$7=()=>e=>{vn(e,"link",(t,n,r)=>{if(!r||typeof n!="number"||!j7(t)||!F7.test(t.url))return;let i=B7(t.url);if(i===null||i===0)return;let s=t.url.slice(0,i),o=t.url.slice(i),a=H7(s,t),u=U7(o);return r.children.splice(n,1,a,u),n+1})};function z7(){let e=[p7],t=[$7,M7],n=[...e,...t];return{name:"cjk",type:"cjk",remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:n}}var yu=z7();const an={},gc=new Set;let Pk;const Od=new Set;let Mk=0;function q7(){Mk+=1;for(const e of Od)e()}function Dk(e){return Od.add(e),()=>{Od.delete(e)}}function Eu(){return Mk}function W7(e){return{...e,highlight(t,n){const r=e.supportsLanguage(t.language)?t.language:"text";return e.highlight({...t,language:r},n)}}}function Rh(e){if(an[e]!==void 0||gc.has(e))return;gc.add(e);const t=()=>{gc.delete(e),e!=="code"&&q7()};e==="code"?Pk=Qs(()=>import("./index-ChTpz7dO.js"),__vite__mapDeps([12,2,1,3,4,5,6,7,8,9,10,11])).then(n=>(an.code=W7(n.createCodePlugin({themes:["github-light","github-dark"]})),an.code)).catch(()=>{}).finally(t):e==="math"?Qs(()=>import("./index-DyZAPivK.js"),__vite__mapDeps([13,14,2,1,3,4,5,6,7,8,9,10,11])).then(n=>{an.math=n.createMathPlugin({singleDollarTextMath:!1})}).catch(()=>{}).finally(t):Qs(()=>import("./mermaid-engine-AE7SfXFQ.js"),__vite__mapDeps([15,2,1,3,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])).then(n=>{an.mermaid=n.mermaid}).catch(()=>{}).finally(t)}function V7(e){return e.includes("```")||e.includes("~~~")||/ {4}|\t/.test(e)}function Fk(e){return{name:"shiki",type:"code-highlighter",getThemes:()=>["github-light","github-dark"],getSupportedLanguages:()=>an.code?.getSupportedLanguages()??[],supportsLanguage:t=>an.code?.supportsLanguage(t)??!0,highlight(t,n){const r=n===void 0?void 0:i=>{sj(t.code,e!==void 0?e.current:void 0),n(i)};return an.code!==void 0?an.code.highlight(t,r):(Rh("code"),Pk?.then(i=>{const s=i?.highlight(t,r);s!=null&&r?.(s)}),null)}}}const jk=Fk(),K7={cjk:yu},Y7={cjk:yu,code:jk};function G7(){return b.useSyncExternalStore(Dk,Eu,Eu),b.useEffect(()=>{Rh("mermaid")},[]),an.mermaid??null}function X7(e,t){const n=b.useMemo(()=>({code:typeof e=="string"&&V7(e),math:typeof e=="string"&&(e.includes("$$")||e.includes("\\(")||e.includes("\\[")||/(?:```|~~~)[^\S\r\n]*math\b/i.test(e))}),[e]),{code:r,math:i}=n,s=b.useSyncExternalStore(Dk,Eu,Eu),o=b.useMemo(()=>t===void 0?jk:Fk(t),[t]),a=b.useMemo(()=>t===void 0?Y7:{cjk:yu,code:o},[t,o]);return b.useEffect(()=>{i&&Rh("math")},[i]),b.useMemo(()=>{if(!i)return r?a:K7;const u={cjk:yu};return r&&(u.code=o),i&&an.math!==void 0&&(u.math=an.math),u},[r,i,s,o,a])}const Q7=40,bc=12,Z7=1.55,J7=20;function Ld(e){if(Array.isArray(e))return e.map(Ld).join("");if(e!==null&&typeof e=="object"&&"props"in e){const t=e.props;return t["data-annotation-bubble"]!==void 0||t["data-source-ignore"]==="true"?"":Ld(t.children)}return typeof e=="string"||typeof e=="number"?String(e):""}function Pd(e){if(Array.isArray(e))return e.some(Pd);if(e===null||typeof e!="object"||!("props"in e))return!1;const t=e.props;return t["data-annotation-ref"]!==void 0||Pd(t.children)}function Oh(e){const t=e,n=/language-([\w-]+)/.exec(t?.props?.className??"");return{code:Ld(e).replace(/\n$/,""),language:n?.[1]??"text"}}let eB=0;function tB({children:e,isIncomplete:t}){const{code:n}=Oh(e),r=G7(),[i,s]=b.useState(null);return b.useEffect(()=>{if(r===null||t===!0||n==="")return;let o=!0,a;const u=`kiki-mermaid-${++eB}`;return r.getMermaid().render(u,n).then(({svg:l})=>{o&&(a=URL.createObjectURL(new Blob([l],{type:"image/svg+xml"})),s({source:n,url:a}))}).catch(()=>{o&&s(null)}),()=>{o=!1,a!==void 0&&URL.revokeObjectURL(a)}},[n,r,t]),i?.source!==n||t===!0?p.jsx(Bk,{isIncomplete:t,children:e}):p.jsx("div",{className:"kiki-md-mermaid my-3 overflow-x-auto rounded-[10px] border border-hairline bg-panel p-3",children:p.jsx("img",{src:i.url,alt:n,className:"mx-auto h-auto max-w-full"})})}function nB(e){const{language:t}=Oh(e.children);return t==="mermaid"?p.jsx(tB,{...e}):p.jsx(Bk,{...e})}function Bk({children:e,isIncomplete:t}){const{t:n}=je(),r=Hb(),[i,s]=b.useState(t===!0),[o,a]=b.useState(!1),u=b.useRef(null),l=b.useRef(null),{code:c,language:d}=Oh(e),f=c===""?[]:c.split(`
184
+ `),h=f.length,m=t!==!0&&h>Q7,x=m&&!i,E=x&&r,y=E?f.slice(0,bc).join(`
185
+ `):c,v=E?Ui(c.slice(y.length)).length:0,[k,S]=b.useState(!1),T=Pd(e),w=!E&&!T&&d!=="text"&&d!=="mermaid",I=!T&&!E&&k&&w;b.useEffect(()=>{if(!(!w||k))return QF(()=>{S(!0)})},[w,k]),b.useLayoutEffect(()=>{if(!(!I||u.current===null))return ij(c,u.current)},[I,c,d]),b.useEffect(()=>()=>{l.current!==null&&clearTimeout(l.current)},[]);const A=()=>{nr(c).then(()=>{a(!0),l.current!==null&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a(!1)},1500)}).catch(()=>{kr({tone:"error",text:n("transcript.copyFailed")})})};return p.jsxs("div",{"data-collapsed":x||void 0,className:"kiki-cb my-3 overflow-hidden rounded-[10px] border border-hairline bg-panel",children:[p.jsxs("div",{"data-copied":o||void 0,className:"kiki-cb-tools select-none absolute top-1.5 right-1.5 z-[1] flex items-center gap-0.5 rounded-md bg-panel/90 pl-2",children:[d!=="text"?p.jsx("span",{className:"pr-1 font-sans text-[12px] text-ink-faint",children:d}):null,p.jsxs("button",{type:"button",onClick:A,title:n("cb.copyTitle"),"aria-label":n("cb.copyTitle"),className:`kiki-cb-copy inline-flex min-h-7 items-center gap-1 rounded-md px-2 font-sans text-[12px] font-medium transition-colors ${o?"text-success":"text-ink-soft hover:bg-paper hover:text-ink"}`,children:[o?p.jsx(Je,{name:"check",size:12}):null,n(o?"cb.copied":"cb.copy")]})]}),p.jsx("div",{ref:u,className:"kiki-cb-body overflow-x-auto",style:{maxHeight:x?`calc(${bc*Z7} * var(--kiki-code-font-size, 12.5px) + ${J7}px)`:void 0,overflowY:x?"hidden":void 0},children:T?p.jsx("div",{"data-streamdown":"code-block-body",children:p.jsx("pre",{className:"font-mono whitespace-pre",children:e})}):E||!k||!w?p.jsx("div",{"data-streamdown":"code-block-body","data-plain-preview":E||void 0,"data-source-omitted-canonical-chars":v>0?String(v):void 0,children:p.jsx("pre",{className:"font-mono whitespace-pre",children:p.jsx("code",{children:y})})}):p.jsx(Cv,{code:c,language:d,isIncomplete:t??!1})}),m?p.jsxs("button",{type:"button",onClick:()=>{u.current!==null&&Mi(u.current),s(O=>!O)},"aria-expanded":i,className:"kiki-cb-toggle flex min-h-7 w-full items-center justify-center gap-1 border-t border-hairline font-sans text-[12px] text-ink-faint transition-colors hover:bg-paper/60 hover:text-ink",children:[i?n("cb.showLess"):n("cb.viewMore",{count:h-bc}),p.jsx(Je,{name:"chevron",size:12,className:i?"-rotate-90":"rotate-90"})]}):null]})}const rB={hasOverflow:!1,canScrollLeft:!1,canScrollRight:!1},xc=2;function iB({children:e,className:t,node:n,...r}){const i=b.useRef(null),s=b.useRef(null),[o,a]=b.useState(rB),u=b.useCallback(()=>{const l=i.current;if(l===null)return;const{scrollLeft:c,scrollWidth:d,clientWidth:f}=l,h=d>f+xc,m=h&&c>xc,x=h&&c+f<d-xc;a(E=>E.hasOverflow===h&&E.canScrollLeft===m&&E.canScrollRight===x?E:{hasOverflow:h,canScrollLeft:m,canScrollRight:x})},[]);return b.useLayoutEffect(()=>{u();const l=i.current;if(l===null||typeof ResizeObserver>"u")return;const c=new ResizeObserver(u);return c.observe(l),s.current!==null&&c.observe(s.current),()=>{c.disconnect()}},[u,e]),p.jsx("div",{"data-streamdown":"table-wrapper","data-overflow-x":o.hasOverflow||void 0,"data-can-scroll-left":o.canScrollLeft||void 0,"data-can-scroll-right":o.canScrollRight||void 0,className:"kiki-md-table-wrap",children:p.jsx("div",{ref:i,tabIndex:o.hasOverflow?0:void 0,onScroll:u,className:"kiki-md-table-scroll",children:p.jsx("table",{...r,ref:s,"data-streamdown":"table",className:["w-full",t].filter(Boolean).join(" "),children:e})})})}const sB="media.copyImage",oB=/^(?:https?|data|blob|kimi-file|blobref):/i;function ys(e){const t=typeof window<"u"?window.location.href:void 0;return oS(e,{pageUrl:t})}function cV(e){return e==null?!1:e.scopeId?.startsWith("ssh:")||e.scopeId==="direct:peer"||e.connectionSource==="remote"||e.connectionSource==="app-shell"?!0:!!e.spaceKey?.startsWith("remote:")}function Hk(e){if(e===void 0)return;const t=e.trim();if(!(t===""||oB.test(t)))return t}function Uk(e,t){return Bn(e,t)}function aB(e){if(!(e===void 0||!/^https?:\/\//i.test(e)))return e}function Lh(e){if(e.fileId!==void 0&&e.fileId!=="")return`file:${e.sessionId??""}:${e.fileId}`;if(Hk(e.path)!==void 0)return`path:${e.sessionId??""}:${e.path}`;if(e.url!==void 0&&e.url!=="")return`url:${e.url}`}const Md=new Map,Dd=new Set;function dV(e){if(e!==void 0){Md.set(e,(Md.get(e)??0)+1);for(const t of Dd)t()}}function uB(e){return Dd.add(e),()=>{Dd.delete(e)}}function Ph(e,t){const n=b.useSyncExternalStore(uB,()=>e===void 0?0:Md.get(e)??0,()=>0),r=b.useRef(null),i=b.useRef(t);i.current=t,b.useEffect(()=>{const s=r.current;if(s===null||s.key!==e){r.current={key:e,generation:n};return}s.generation!==n&&(r.current={key:e,generation:n},i.current())},[e,n])}class Io extends Error{constructor(t,n){super(n instanceof Error?`${n.name}: ${n.message}`:String(n),{cause:n}),this.stage=t}}async function Di(e,t){try{return await t()}catch(n){throw n instanceof Io?n:new Io(e,n)}}function lB(e){return{streaming:e.streaming,write:t=>Di("write",()=>e.write(t)),close:()=>Di("write",()=>e.close()),abort:()=>e.abort()}}function $k(e,t){const n=e instanceof Io?e.cause:e;return(n instanceof Error||n instanceof DOMException)&&(n.name==="NotAllowedError"||n.name==="SecurityError")?t("media.downloadDenied"):e instanceof Io?t(e.stage==="read"?"media.downloadReadFailed":"media.downloadWriteFailed"):t("media.downloadFailed")}async function zk(e,t,n,r,i,s){if((e.path!==void 0||e.fileId!==void 0&&i!==void 0)&&r!==void 0){const a=await Di("write",()=>n.openSaveSink!==void 0?n.openSaveSink(t):n.saveBlob!==void 0?Promise.resolve(Sb(l=>n.saveBlob(l,t))):_b(t));if(a===null)return!1;const u=lB(a);try{return await Di("read",()=>e.path!==void 0?r.downloadHostFile(e.path,async l=>{await u.write(l)},{signal:s}):r.downloadSessionMedia(i,e.fileId,async l=>{await u.write(l)},{signal:s})),await u.close()}catch(l){throw await u.abort().catch(()=>{}),l}}if(e.url===void 0)throw new Io("read",new Error("This image has no readable source"));if(n.saveBlob!==void 0){const a=e.url,u=await Di("read",async()=>{const l=await fetch(a,{signal:s});if(!l.ok)throw new Error(`Image could not be read (${l.status})`);return l.blob()});return Di("write",()=>n.saveBlob(u,t))}const o=document.createElement("a");return o.href=e.url,o.download=t,document.body.append(o),o.click(),o.remove(),!0}const cB=/^image\/[a-z0-9.+-]+$/i;function Cn(e,t,n){return e.length<t+n.length?!1:n.every((r,i)=>e[t+i]===r)}const $r=e=>Array.from(new TextEncoder().encode(e));function dB(e){const t=e.subarray(0,64);if(Cn(t,0,[137,80,78,71,13,10,26,10]))return"image/png";if(Cn(t,0,[255,216,255]))return"image/jpeg";if(Cn(t,0,$r("GIF87a"))||Cn(t,0,$r("GIF89a")))return"image/gif";if(Cn(t,0,$r("RIFF"))&&Cn(t,8,$r("WEBP")))return"image/webp";if(Cn(t,4,$r("ftyp"))&&(Cn(t,8,$r("avif"))||Cn(t,8,$r("avis"))))return"image/avif";if(Cn(t,0,[66,77]))return"image/bmp";const n=new TextDecoder().decode(t).trimStart().toLowerCase();if(n.startsWith("<svg")||n.startsWith("<?xml")&&n.includes("<svg"))return"image/svg+xml"}function qk(e,t){const n=dB(e);if(n!==void 0)return n;const r=t?.split(";")[0]?.trim().toLowerCase();if(!(r===void 0||r==="image/*"||!cB.test(r)))return r}async function fB(e){const t=await Mx(e),n=qk(t,e.type);return n===void 0||e.type===n?e:new Blob([t],{type:n})}class Fd extends Error{constructor(t,n){super(n instanceof Error?`${n.name}: ${n.message}`:String(n),{cause:n}),this.stage=t}}function hB(e,t,n){return e instanceof Fd?t(e.stage==="read"?"media.copyReadFailed":"media.copyDecodeFailed"):(e instanceof Error||e instanceof DOMException)&&e.name==="NotAllowedError"?t(n==="tauri"?"media.copyDeniedDesktop":"media.copyDeniedWeb"):e instanceof Error&&e.message==="Clipboard image write is unavailable"?t(n==="tauri"?"media.copyUnavailableDesktop":"media.copyUnavailableWeb"):t("media.copyFailed")}function pB(e){return EI(mB(e))}async function mB(e){let t;try{const n=await fetch(e);if(!n.ok)throw new Error(`Image could not be read (${n.status})`);if(t=await fB(await n.blob()),t.size===0)throw new Error("Image could not be read")}catch(n){throw new Fd("read",n)}try{return t.type!=="image/png"||!await Dx(t)?await gB(e,t):t}catch(n){throw new Fd("decode",n)}}async function gB(e,t){if(t!==void 0&&typeof createImageBitmap=="function")try{const u=await createImageBitmap(t);try{const l=document.createElement("canvas");l.width=u.width,l.height=u.height;const c=l.getContext("2d");if(c===null)throw new Error("Canvas is unavailable");c.drawImage(u,0,0);const d=await new Promise(f=>{l.toBlob(f,"image/png")});if(d!==null)return d}finally{u.close()}}catch{}const n=t!==void 0&&typeof URL.createObjectURL=="function"?URL.createObjectURL(t):e,r=n.startsWith("blob:")||n.startsWith("data:"),i=new Image;r||(i.crossOrigin="anonymous"),i.src=n;try{await i.decode()}finally{n!==e&&URL.revokeObjectURL(n)}const s=document.createElement("canvas");s.width=i.naturalWidth,s.height=i.naturalHeight;const o=s.getContext("2d");if(o===null)throw new Error("Canvas is unavailable");o.drawImage(i,0,0);const a=await new Promise(u=>{s.toBlob(u,"image/png")});if(a===null)throw new Error("Image could not be copied");return a}function bB({t:e,src:t,path:n,cwd:r,link:i,localKikiComputer:s,remote:o,revealPath:a,openPath:u,canCopyImage:l,canSave:c,annotated:d,onCopyImage:f,onSave:h,onSaveAnnotated:m}){const x=[],E=Hk(n),y=s??(o===void 0?!1:!o),v=E===void 0?void 0:Uk(E,r),k=v!==void 0?{source:{kind:"host-file",path:v},origin:{path:v,trusted:!0},type:aS({name:v,mime:"image/*"})}:{source:{kind:"url",url:i??t??""},type:"image"},S=Db(k,{isKikiComputer:y,capabilities:{reveal:a!==void 0,open:u!==void 0}},{status:"ready",readableFromDevice:c,originalReadable:!0}),T=A=>S.some(O=>O.id===A);l&&t!==void 0&&x.push({key:"copy-image",label:e(sB),run:f}),i!==void 0&&x.push({key:"copy-link",label:e("link.copyLink"),run:()=>nr(i)}),T("copy-path")&&E!==void 0&&v!==void 0&&(x.push({key:"copy-path",label:e("file.copyPath"),run:()=>nr(E)}),y&&v!==E&&x.push({key:"copy-absolute",label:e("file.copyAbsolutePath"),run:()=>nr(v)}));const w=T("show-on-this-computer")&&a!==void 0&&v!==void 0,I=T("open-with-default-app")&&u!==void 0&&v!==void 0;return(w||I)&&(x.length>0&&x.push({separator:!0}),w&&x.push({key:"show-in-folder",label:e("file.showInFolder"),run:()=>a(v)}),I&&x.push({key:"open-default-app",label:e("file.openDefaultApp"),run:()=>u(v)})),T("download")&&(x.length>0&&x.push({separator:!0}),x.push({key:"save-image",label:e("media.download"),run:h}),d&&m!==void 0&&x.push({key:"save-annotated-image",label:e("media.downloadAnnotated"),run:m})),x}const Wk=/^[A-Za-z]:[\\/]/u,Mh=/^[A-Za-z][A-Za-z\d+.-]*:/u,xB=/^(?:data|blob|blobref|opaque|base64|kimi-file):/iu,yB=/^(?:data|blob|opaque|base64|unknown|undefined|null)$/iu,EB=/[\u0000-\u001f\u007f]/u,vB=/%[0-9a-f]{2}/iu,kB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}(?:==)?|[A-Za-z0-9+/]{3}=?)?$/u,TB=/^(?:iVBORw0KGgo|\/9j\/|R0lGOD|UklGR|Qk0|SUkq|TU0A|PHN2Zy|JVBER|UEsDB)/u;function wB(e){return kB.test(e)&&TB.test(e)}function Dh(e){if(typeof e!="string")return;const t=e.trim();if(!(t===""||EB.test(t)||xB.test(t)||yB.test(t)||wB(t)||Mh.test(t)&&!Wk.test(t)||t.includes("://")||t.startsWith("//")||vB.test(t)))return t}function Vk(e){return e.includes("?")||e.includes("#")||e.startsWith("//")?!1:!Mh.test(e)||Wk.test(e)}function Kk(e){const t=e.replace(/[\\/]+$/u,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),r=n===-1?t:t.slice(n+1),i=Dh(r);if(!(i===void 0||i==="."||i===".."||Mh.test(i)))return i}function Fg(e){const t=Dh(e);return t!==void 0&&Vk(t)?Kk(t):void 0}function SB(e){const t=Dh(e);return t!==void 0&&Vk(t)?Kk(t):void 0}function Sr(e){return Fg(e.name)??Fg(e.metadataName)??SB(e.path)}function Yk(e,t){return Sr(e)??t}function _B(e,t="image"){return Sr(e)??t}const CB={png:"image",jpg:"image",jpeg:"image",webp:"image",gif:"image",avif:"image",svg:"image",mp4:"video",webm:"video",mov:"video",mkv:"video",mp3:"audio",wav:"audio",ogg:"audio",oga:"audio",m4a:"audio",opus:"audio",flac:"audio",aac:"audio"},jg={html:"html",htm:"html",xhtml:"html",pdf:"pdf",docx:"docx",doc:"doc",xlsx:"xlsx",xls:"xls",pptx:"pptx",ppt:"ppt",csv:"csv",tsv:"csv",md:"markdown",markdown:"markdown",mdx:"markdown",ts:"code",tsx:"code",js:"code",jsx:"code",mjs:"code",cjs:"code",py:"code",rs:"code",go:"code",java:"code",c:"code",cc:"code",cpp:"code",h:"code",hpp:"code",json:"code",jsonl:"code",yaml:"code",yml:"code",toml:"code",xml:"code",css:"code",scss:"code",sh:"code",bash:"code",zsh:"code",ps1:"code",sql:"code",txt:"code",log:"code",ini:"code",zip:"archive",tar:"archive",gz:"archive",tgz:"archive","7z":"archive",rar:"archive"};function fV(e){const t=e.kind?.trim().toLowerCase();if(t==="image"||t==="video"||t==="audio"||t==="voice")return t==="voice"?"audio":t;if(t==="file")return"file";const n=e.mimeType?.toLowerCase()??"",r=n.indexOf("/");if(r>0){const o=n.slice(0,r);if(o==="image"||o==="video"||o==="audio")return o}const i=e.title??e.path,s=/\.([A-Za-z0-9]+)$/u.exec(i)?.[1]?.toLowerCase();return s===void 0?"file":CB[s]??"file"}function hV(e){const t=e.title??e.path,n=/\.([A-Za-z0-9]+)$/u.exec(t)?.[1]?.toLowerCase();if(n!==void 0&&jg[n]!==void 0)return jg[n];const r=e.mimeType?.split(";")[0]?.trim().toLowerCase()??"";return r==="text/html"||r==="application/xhtml+xml"?"html":r==="application/pdf"?"pdf":r==="text/csv"||r==="text/tab-separated-values"?"csv":r==="text/markdown"||r==="text/x-markdown"?"markdown":r==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"docx":r==="application/msword"?"doc":r==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"xlsx":r==="application/vnd.ms-excel"?"xls":r==="application/vnd.openxmlformats-officedocument.presentationml.presentation"?"pptx":r==="application/vnd.ms-powerpoint"?"ppt":r==="application/zip"||r==="application/gzip"||r==="application/x-tar"||r==="application/x-7z-compressed"?"archive":r.startsWith("text/")||r==="application/json"||r==="application/xml"||r.endsWith("+json")?"code":"file"}function pV(e){return e.kind?.trim().toLowerCase()==="voice"}function mV(e){const t=e.kind?.trim();return t===void 0||t===""?"file":t}function AB(e){if(e.title!==void 0&&e.title.trim()!=="")return e.title;const t=e.path.split(/[\\/]/u).at(-1);return t===void 0||t===""?e.path:t}function IB(e,t){if(t?.readable===!1||e.sourceId===void 0||e.sourceId.trim()==="")return;const n=e.path.trim();if(!(n===""||n===e.blobId||/^(?:blobref|kimi-file|https?|data|blob):/iu.test(n)))return{path:n,trusted:!0}}function gV(e,t,n,r){return{kind:t,fileId:e.blobId,sourceId:e.sourceId,origin:r,path:n,name:AB(e),mime:e.mimeType,size:e.size}}const NB=/(!?)\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)/giu,RB=/(?<![(["'])\b(https?:\/\/[^\s<>)\]"']+)/giu,OB=/\.(?:png|jpe?g|gif|webp|avif|svg)(?:[?#].*)?$/iu;function LB(e){return e.replace(/[.,;:!?]+$/u,"")}function PB(e){if(!e||e==="/")return"";try{return decodeURIComponent(e).replace(/^\/+/u,"")}catch{return e.replace(/^\/+/u,"")}}function bV(e){if(!e.includes("http://")&&!e.includes("https://"))return[];const t=e.replace(/```[\s\S]*?```/gu," ").replace(/`[^`\n]+`/gu," "),n=new Set,r=[],i=(s,o)=>{const a=LB(s.trim());if(n.has(a)||OB.test(a))return;let u;try{u=new URL(a)}catch{return}if(u.protocol!=="http:"&&u.protocol!=="https:")return;n.add(a);const l=u.hostname.replace(/^www\./iu,"")||u.hostname,c=PB(u.pathname),d=o!==void 0&&o.trim()!==""&&o.trim()!==a?o.trim():c!==""?`${l} / ${c}`:l;r.push({url:a,hostname:l,title:d})};for(const s of t.matchAll(NB))s[1]!=="!"&&i(s[3]??"",s[2]);for(const s of t.matchAll(RB))i(s[1]??"");return r.slice(0,4)}function xV(e,t){const n=IB(e,{readable:t.readable});return!t.readable||t.remote||t.localKikiComputer===!1||n===void 0?{origin:n}:{origin:n,localPath:Bn(n.path,t.cwd)}}function MB(e,t){if(t.localKikiComputer&&!(e.kind==="image"||e.kind==="video")&&e.origin?.trusted===!0&&e.origin.path.trim()!=="")return Bn(e.origin.path,t.cwd)}function DB(e){const{localPath:t,preview:n,client:r,openCopy:i}=e;if(n===null)return;if(t===void 0){i();return}const s=r!==void 0&&typeof r.previewHostFile=="function"?r.previewHostFile.bind(r):void 0;if(s===void 0){n.openFile(t);return}s(t,1).then(()=>{n.openFile(t)}).catch(()=>{i()})}const Gk=b.createContext(void 0);function dl(e){const t=b.useContext(Gk);if(t===void 0&&!e)throw new Error(fi(47));return t}const FB={...zs,disabled:e=>e.disabled,instantType:e=>e.instantType==="trigger-change"&&!zs.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===mo&&zs.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod==="touch"&&e.openChangeReason===mo,hasTriggerFocusGuards:(e,t)=>zs.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class jB extends $u{constructor(t,n,r){const i=new Tx;super(BB(t,i,n,r),HB(i),FB)}setOpen=(t,n)=>{const r=n.reason===Jr,i=n.reason===mo&&n.event.detail===0,s=!t&&(n.reason===ef||n.reason==null),o=xx(n),a=this.select("activeTriggerId");if(!t&&n.reason===uS&&n.trigger==null&&a!=null&&(n.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const c=If(this.state,t,n.trigger,o());c.openChangeReason=n.reason,this.update(c)};r?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(xC,()=>{this.context.stickIfOpen=!1}),Kt.flushSync(u)):u();let l;i?l="click":s?l="dismiss":n.reason===za&&(l="focus"),this.set("instantType",l)}}function BB(e,t,n,r=!1){const i={...wx(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HB(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new En,stickIfOpen:!0,triggerElements:e}}const Bg=bf(function({props:t}){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,modal:a=!1,handle:u,triggerId:l,defaultTriggerId:c=null}=t,d=UB(u,{modal:a,open:i,openProp:r,activeTriggerId:c,triggerIdProp:l});d.useControlledProp("openProp",r),d.useControlledProp("triggerIdProp",l);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",s),d.useContextCallback("onOpenChangeComplete",o),kx(d,f),yx(d);const{forceUnmount:x}=Ex(f,d,()=>{d.context.stickIfOpen=!0,d.set("openChangeReason",null)});d.useSyncedValues({modal:a}),b.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),b.useImperativeHandle(t.actionsRef,()=>({unmount:x,close:()=>d.setOpen(!1,Mn(Fb))}),[x,d]);const E=f||h||u!=null;return p.jsxs(Gk.Provider,{value:d,children:[u&&p.jsx(bx,{handle:u,store:d}),E&&p.jsx($B,{store:d,modal:a}),typeof n=="function"?n({payload:m}):n]})});function Xk(e){return dl(!0)?p.jsx(Bg,{props:e}):p.jsx(nA,{children:p.jsx(Bg,{props:e})})}function UB(e,t){const n=gx((r,i)=>new jB(t,r,i));return b.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function $B({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=hx(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),i=r.reference,s=r.floating;return vx(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s}),null}const Qk=b.createContext(void 0);function zB(){const e=b.useContext(Qk);if(e===void 0)throw new Error(fi(45));return e}const Zk=b.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return dl().useState("mounted")||r?p.jsx(Qk.Provider,{value:r,children:p.jsx(ax,{ref:n,...i})}):null}),Jk=b.createContext(void 0);function qB(){const e=b.useContext(Jk);if(!e)throw new Error(fi(46));return e}const eT=b.forwardRef(function(t,n){const{cutout:r,...i}=t;let s;if(r){const o=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return p.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function WB(e){const{store:t,domReference:n,positionerElement:r,open:i}=e,s=b.useRef(null),o=b.useRef(null),a=nx(r);He(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[i,t]),He(()=>{const u=n,l=s.current;if(u&&(s.current=u),!l||!u||u===l||!t.select("open"))return;t.set("instantType",void 0);const c=new AbortController;return o.current=c,a(()=>{t.select("open")&&t.set("instantType","trigger-change")},c.signal),()=>{c.abort()}},[n,a,t])}let Hg={},Ug={},$g="";function fl(e,t){return nf(e)?e:t}function zg(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fl(t,n)).overflowY)}function VB(e){if(typeof document>"u")return!1;const t=tt(e);return Ht(t).innerWidth-t.documentElement.clientWidth>0}function KB(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=tt(e),r=n.documentElement,i=n.body,s=fl(r,i),o=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=o,r.style.scrollbarGutter=a,u===l}function YB(e){const t=tt(e),n=t.documentElement,r=t.body,i=fl(n,r),s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function GB(e){const t=tt(e),n=t.documentElement,r=t.body,i=Ht(n);let s=0,o=0,a=!1;const u=Rn.create();if(ds&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){const h=i.getComputedStyle(n),m=i.getComputedStyle(r),y=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,Hg={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$g=n.style.scrollBehavior,Ug={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const v=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,S=h.overflowY==="scroll"||m.overflowY==="scroll",T=h.overflowX==="scroll"||m.overflowX==="scroll",w=Math.max(0,i.innerWidth-r.clientWidth),I=Math.max(0,i.innerHeight-r.clientHeight),A=parseFloat(m.marginTop)+parseFloat(m.marginBottom),O=parseFloat(m.marginLeft)+parseFloat(m.marginRight),_=fl(n,r);if(a=KB(e),a){n.style.scrollbarGutter=y,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(v||S)&&(n.style.overflowY="scroll"),(k||T)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:A||I?`calc(100dvh - ${A+I}px)`:"100dvh",width:O||w?`calc(100vw - ${O+w}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,Hg),Object.assign(r.style,Ug),a||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$g)}function d(){c(),u.request(l)}l();const f=Ge(i,"resize",d);return()=>{u.cancel(),c(),typeof i.removeEventListener=="function"&&f()}}class XB{lockCount=0;restore=null;timeoutLock=En.create();timeoutUnlock=En.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=tt(t),r=n.documentElement,i=n.body,s=Ht(r);if(zg(s,r,i)){const a=new s.MutationObserver(()=>{zg(s,r,i)||(a.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};a.observe(r,u),a.observe(i,u),this.restore=()=>a.disconnect();return}const o=xf||!VB(t);this.restore=o?YB(t):GB(t)}}const QB=new XB;function tT(e=!0,t=null){He(()=>{if(e)return QB.acquire(t)},[e,t])}const ZB=20;function JB(e,t,n,r){const[i,s]=b.useState(!1);He(()=>{if(!e||!t||n==null){s(!1);return}const o=tt(n).documentElement.clientWidth,a=n.offsetWidth;s(o>0&&a>0&&a>=o-ZB)},[e,t,n]),tT(e&&(!t||i),r)}const nT=b.forwardRef(function(t,n){const{render:r,className:i,style:s,anchor:o,positionMethod:a,side:u,align:l,sideOffset:c,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:h,arrowPadding:m,sticky:x,disableAnchorTracking:E=!1,collisionAvoidance:y=SC,...v}=t,k=dl(),S=zB(),T=eA(),w=k.useState("floatingRootContext"),I=k.useState("mounted"),A=k.useState("open"),O=k.useState("openChangeReason"),_=k.useState("activeTriggerElement"),D=k.useState("modal"),U=k.useState("openMethod"),F=k.useState("positionerElement"),R=k.useState("instantType"),j=k.useState("transitionStatus"),B=k.useState("adaptiveOrigin"),q=pI({anchor:o,floatingRootContext:w,positionMethod:a,mounted:I,side:u,sideOffset:c,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:h,sticky:x,disableAnchorTracking:E,keepMounted:S,nodeId:T,collisionAvoidance:y,adaptiveOrigin:B}),$=w.useState("domReferenceElement");WB({store:k,domReference:$,positionerElement:F,open:A});const X=D===!0&&O!==Jr;JB(A&&X,U==="touch",F,_);const C=k.useStateSetter("positionerElement"),se={open:A,side:q.side,align:q.align,anchorHidden:q.anchorHidden,instant:R},xe=gI(t,se,{styles:q.positionerStyles,transitionStatus:j,props:v,refs:[n,C],hidden:!I,inert:!A});return p.jsxs(Jk.Provider,{value:q,children:[I&&X&&p.jsx(eT,{inert:Cf(!A),cutout:_}),p.jsx(tA,{id:T,children:xe})]})}),eH="ArrowUp",tH="ArrowDown",nH="ArrowLeft",rH="ArrowRight",iH="Home",sH="End",rT=new Set([eH,tH,nH,rH,iH,sH]),oH=b.createContext(void 0);function aH(e){return b.useContext(oH)}const uH=b.createContext(void 0);function lH(){const[e,t]=b.useState(0),n=et(()=>(t(i=>i+1),()=>{t(i=>Math.max(0,i-1))}));return{context:b.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const iT=b.forwardRef(function(t,n){const{render:r,className:i,style:s,initialFocus:o,finalFocus:a,...u}=t,l=dl(),c=qB(),d=aH()!=null,{context:f,hasClosePart:h}=lH(),m=l.useState("open"),x=l.useState("openMethod"),E=l.useState("instantType"),y=l.useState("transitionStatus"),v=l.useState("popupProps"),k=l.useState("titleElementId"),S=l.useState("descriptionElementId"),T=l.useState("modal"),w=l.useState("mounted"),I=l.useState("openChangeReason"),A=l.useState("activeTriggerElement"),O=l.useState("floatingRootContext"),_=O.useState("floatingId"),D=l.useState("disabled"),U=l.useState("openOnHover"),F=l.useState("closeDelay");Vu({open:m,ref:l.context.popupRef,onComplete(){m&&l.context.onOpenChangeComplete?.(!0)}}),gA(O,{enabled:U&&!D,closeDelay:F});const R=o===void 0?mx(l.context.popupRef):o,j=T!==!1&&h;l.useSyncedValue("focusManagerModal",j);const B=l.useStateSetter("popupElement"),q={open:m,side:c.side,align:c.align,instant:E,transitionStatus:y},$=Un("div",t,{state:q,ref:[n,l.context.popupRef,B],props:[v,{id:_,role:"dialog",...px,"aria-labelledby":k,"aria-describedby":S,onKeyDown(X){d&&rT.has(X.key)&&X.stopPropagation()}},Px(y),u],stateAttributesMapping:U1});return p.jsx(fx,{context:O,openInteractionType:x,modal:j,disabled:!w||I===Jr,initialFocus:R,returnFocus:a,restoreFocus:"popup",getInsideElements:()=>[l.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:bt(A)?A:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:p.jsx(uH.Provider,{value:f,children:$})})}),sT=b.createContext(void 0);function ta(e){const t=b.useContext(sT);if(!e&&t===void 0)throw new Error(fi(27));return t}const oT=b.forwardRef(function(t,n){const{render:r,className:i,style:s,forceRender:o=!1,...a}=t,u=ta(),l=u.useState("open"),c=u.useState("nested"),d=u.useState("mounted"),f=u.useState("transitionStatus");return Un("div",t,{state:{open:l,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:U1,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:o||!c})}),aT=b.createContext(void 0);function uT(){const e=b.useContext(aT);if(e===void 0)throw new Error(fi(26));return e}const cH="--nested-dialogs",dH="data-nested-dialog-open",lT={...Ef,...yf,nestedDialogOpen(e){return e?{[dH]:""}:null}},cT=b.forwardRef(function(t,n){const{render:r,className:i,style:s,finalFocus:o,initialFocus:a,...u}=t,l=ta(),c=l.useState("descriptionElementId"),d=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),h=l.useState("popupProps"),m=l.useState("modal"),x=l.useState("mounted"),E=l.useState("nested"),y=l.useState("nestedOpenDialogCount"),v=l.useState("open"),k=l.useState("openMethod"),S=l.useState("titleElementId"),T=l.useState("transitionStatus"),w=l.useState("role"),I=f.useState("floatingId");uT(),Vu({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}});const A=a===void 0?mx(l.context.popupRef):a,O=y>0,_=l.useStateSetter("popupElement"),U=Un("div",t,{state:{open:v,nested:E,transitionStatus:T,nestedDialogOpen:O},props:[h,{id:I,"aria-labelledby":S,"aria-describedby":c,role:w,...px,hidden:!x,onKeyDown(F){rT.has(F.key)&&F.stopPropagation()},style:{[cH]:y}},u],ref:[n,l.context.popupRef,_],stateAttributesMapping:lT});return p.jsx(fx,{context:f,openInteractionType:k,disabled:!x,closeOnFocusOut:!d,initialFocus:A,returnFocus:o,modal:m!==!1,restoreFocus:"popup",children:U})}),dT=b.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,s=ta(),o=s.useState("mounted"),a=s.useState("modal"),u=s.useState("open");return o||r?p.jsx(aT.Provider,{value:r,children:p.jsxs(ax,{ref:n,...i,children:[o&&a===!0&&p.jsx(eT,{ref:s.context.internalBackdropRef,inert:Cf(!u)}),t.children]})}):null});function fH({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),i=e.useState("mounted"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),a=e.useState("popupElement"),u=e.useState("floatingRootContext"),[l,c]=b.useState(0),[d,f]=b.useState(0),h=l===0,m=hx(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(x){if(!e.context.outsidePressEnabledRef.current||"button"in x&&x.button!==0)return!1;if("touches"in x){if(x.type==="touchend"){if(x.changedTouches.length!==1||x.touches.length!==0)return!1}else if(x.touches.length!==1)return!1}const E=Nt(x);if(h&&!s){if(o){const y=e.context.internalBackdropRef.current,v=e.context.backdropRef.current;return y||v?y===E||v===E||Ke(E,a)&&!E?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:h});return tT(r&&o===!0,a),e.useContextCallback("onNestedDialogOpen",(x,E)=>{!e.select("open")&&!e.select("mounted")||(c(x),f(E))}),He(()=>{!r&&!i&&(c(0),f(0))},[r,i]),He(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+(n?1:0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),vx(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}const hH={...zs,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class pH extends $u{constructor(t,n,r){const i=new Tx,s=mH(t,i,n,r);super(s,gH(i),hH)}setOpen=(t,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,n),this.update(If(this.state,t,n.trigger)))}}function mH(e,t,n,r=!1){return{...wx(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function gH(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function bH(e,t){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:u=!0,actionsRef:l,handle:c,triggerId:d,defaultTriggerId:f=null}=t,h=e==="drawer",m=u,x=a,E="dialog",y=ta(!0),v=y!=null,k={modal:m,disablePointerDismissal:x,nested:v,role:E},S=gx((_,D)=>new pH({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...k},_,D),!0);S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",d),S.useSyncedValues(k),S.useContextCallback("onOpenChange",s),S.useContextCallback("onOpenChangeComplete",o);const T=S.useState("open"),w=S.useState("mounted"),I=S.useState("payload");kx(S,T),yx(S);const{forceUnmount:A}=Ex(T,S);b.useImperativeHandle(l,()=>({unmount:A,close:()=>S.setOpen(!1,Mn(Fb))}),[A,S]);const O=T||w||c!=null;return p.jsxs(sT.Provider,{value:S,children:[c&&p.jsx(bx,{handle:c,store:S}),O&&p.jsx(fH,{store:S,parentContext:y?.context,isDrawer:h}),typeof n=="function"?n({payload:I}):n]})}const fT=bf(function(t){return bH("dialog",t)}),xH=b.forwardRef(function(t,n){const{render:r,className:i,style:s,children:o,...a}=t,u=uT(),l=ta(),c=l.useState("open"),d=l.useState("nested"),f=l.useState("transitionStatus"),h=l.useState("nestedOpenDialogCount"),m=l.useState("mounted"),x=l.useStateSetter("viewportElement"),E=h>0;return Un("div",t,{enabled:u||m,state:{open:c,nested:d,transitionStatus:f,nestedDialogOpen:E},ref:[n,x],stateAttributesMapping:lT,props:[{role:"presentation",hidden:!m,style:{pointerEvents:c?void 0:"none"},children:o},a]})});function yH(e){return typeof e=="object"?e.key:e}function EH(e,t){const n=e.length;return new Proxy(e,{get(r,i,s){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const a=+i;if(Number.isInteger(a)&&a>=0&&a<n){let u=r[a];if(typeof u!="object"){const l=t[a*2];u=r[a]={index:a,key:u,start:l,size:t[a*2+1],end:l+t[a*2+1],lane:0}}return u}}if(i==="length")return n}return Reflect.get(r,i,s)}})}function Ti(e,t,n){let r=n.initialDeps??[],i,s=!0;function o(){const a=e();return(a.length!==r.length||a.some((l,c)=>r[c]!==l))&&(r=a,i=t(...a),n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1),i}return o.updateDeps=a=>{r=a},o}function qg(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Kr=(e,t)=>Math.abs(e-t)<1.01,vH=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function kH({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:s,clampedMaxAtWrite:o}){var a;return t&&s===null&&e===i?"spurious":s!==null&&Math.abs(e-s.target)<1.5?"readBack":s!==null&&!s.smooth&&n!==null&&s.target>n+r+.5&&Math.abs(e-(n+r))<1.5||s!==null&&!s.smooth&&((a=s.lowMaxes)!=null&&a.some(u=>Math.abs(e-u)<1.5))?"clampedReadBack":o!==null&&Math.abs(e-o)<1.5?"clampedEcho":"external"}const TH=e=>e==="smooth"||e==="smoothFinishing";function wH({kind:e,offset:t,command:n,target:r}){return e!=="spurious"&&e!=="readBack"&&e!=="clampedReadBack"&&n?.index!=null&&n.phase!=="queued"&&!TH(n.phase)&&!Kr(t,n.lastTargetOffset)&&!Kr(t,r())&&e!=="clampedEcho"}const jd=40;function SH(e){const t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<jd;)n--;if(n<0)return!1;const r=e[n];let i=n-1;for(;i>=0&&r.t-e[i].t<jd;)i--;if(i<0)return!1;const s=e[i],o=(t.offset-r.offset)/(t.t-r.t),a=(r.offset-s.offset)/(r.t-s.t);return o*a>=0&&Math.abs(o)>=2*Math.abs(a)&&Math.abs(o)-Math.abs(a)>=.8}function _H(e){const t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<jd;)n--;if(n<0)return!1;const r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}let Ms;const vu=()=>{if(Ms!==void 0)return Ms;if(typeof navigator>"u")return Ms=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ms=!0;const e=navigator.maxTouchPoints;return Ms=navigator.platform==="MacIntel"&&e!==void 0&&e>0};let yc;const CH=()=>yc!==void 0?yc:yc=vu()&&typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-anchor: auto"),AH=()=>!vu()||CH(),wi={capture:!0,passive:!0};class IH{constructor(t){this.host=t,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!=="lateFling",this.dragging=()=>{var n;return((n=this._touch)==null?void 0:n.phase)==="down"&&this._touch.moved},this.tail=()=>{var n;return((n=this._touch)==null?void 0:n.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:n,ownReadBack:r,moved:i,external:s})=>{var o,a,u;return n&&((o=this._touch)==null?void 0:o.phase)==="tail"?this._openTail(this._touch.moved||!r,!1):((a=this._touch)==null?void 0:a.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:s&&n&&i&&this._openTail(!0,!1)),!r&&n&&i&&((u=this._touch)==null?void 0:u.phase)==="down"?(this._touch.moved=!0,!0):!1},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var n;const r=((n=this._touch)==null?void 0:n.phase)==="down"&&this._touch.moved;this.end(),this._openTail(r,r)},this.end=()=>{var n;const r=this.host.getWindow();((n=this._touch)==null?void 0:n.phase)==="tail"&&r!=null&&r.clearTimeout(this._touch.timerId),this._touch=null},this.listen=n=>{const r=()=>this.touchStart(),i=()=>this.touchEnd();return n.addEventListener("touchstart",r,wi),n.addEventListener("touchend",i,wi),n.addEventListener("touchcancel",i,wi),()=>{n.removeEventListener("touchstart",r,wi),n.removeEventListener("touchend",i,wi),n.removeEventListener("touchcancel",i,wi),this.end()}},this._openTail=(n,r)=>{const i=this.host.getWindow();if(i==null)return;this.end();const s={phase:"tail",moved:n,awaitingFling:r,timerId:i.setTimeout(()=>{if(this.host.tailStillMoving()){this._openTail(s.moved,s.awaitingFling);return}this._touch=s.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed()},150)};this._touch=s}}get touch(){return this._touch}}const Wg=e=>{const{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},hT=e=>{const t=new Set;return{schedule:n=>{const r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(n=>e.cancelAnimationFrame(n)),t.clear()}}},NH=e=>e,RH=e=>{const t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),i=Math.min(e.endIndex+t,e.count-1)-n+1,s=new Array(i);for(let o=0;o<i;o++)s[o]=n+o;return s},Fh=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:u,height:l}=a;t({width:Math.round(u),height:Math.round(l)})};if(i(Wg(n)),!r.ResizeObserver)return()=>{};const s=hT(r),o=new r.ResizeObserver(()=>{const a=()=>{i(Wg(n))};e.options.useAnimationFrameWithResizeObserver?s.schedule(a):a()});return o.observe(n,{box:"content-box"}),()=>{o.unobserve(n),s.cancel()}},Vg={passive:!0},OH=typeof window>"u"?!0:"onscrollend"in window,LH=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const s=e.options.useScrollendEvent&&OH;let o=0;const a=s?null:vH(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),u=d=>()=>{o=n(r),a?.(),t(o,d)},l=u(!0),c=u(!1);return r.addEventListener("scroll",l,Vg),s&&r.addEventListener("scrollend",c,Vg),()=>{r.removeEventListener("scroll",l),s&&r.removeEventListener("scrollend",c),a?.cancel()}},PH=(e,t)=>LH(e,t,n=>{const{horizontal:r,isRtl:i}=e.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),MH=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),i=n.options.getItemKey(r),s=n.itemSizeCache.get(i);if(s!==void 0)return s}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},DH=(e,{adjustments:t=0,behavior:n},r)=>{var i;const{scrollElement:s,options:o}=r,a=e+t,u=o.horizontal&&o.isRtl&&s!==null&&"ownerDocument"in s;(i=s?.scrollTo)==null||i.call(s,{[o.horizontal?"left":"top"]:u?-a:a,behavior:n})},FH=DH,Kg=(e,t)=>e==="smooth"?t?"smoothLanded":"smooth":"instant",Ds=e=>e?.phase==="smooth"||e?.phase==="smoothLanded";function jH(e,t,n,r){if(t===0)return!1;const i=r(0),s=new Set;let o=0;for(;o<e;){const u=n(o);if(u===i)break;s.add(u),o++}const a=e-o;if(a===0||a>=t)return!1;for(let u=0;u<a;u++)if(r(u)!==n(o+u))return!1;for(let u=a;u<t;u++)if(s.has(r(u)))return!1;return!0}class BH{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new IH({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{const n=this.scrollState;if(n?.phase!=="queued"||this.pendingWrite!==null)return!1;const r=this._readElementOffset();return r===null||this._lastElementOffset===null||Math.abs(r-this._lastElementOffset)<1?!1:(this._lastElementOffset=r,n.samples=[...n.samples??[],{t:this.now(),offset:r}],!0)},onTailClosed:()=>{const n=this.scrollState;n?.phase==="queued"&&_H(n.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null,r=null,i=!1,s=!1;const o=new Set,a=()=>{if(n)return n;const l=this.targetWindow;if(!l||!l.ResizeObserver)return null;const c=r=hT(l);return n=new l.ResizeObserver(d=>{const f=()=>{const h={sync:!1};this._resizeBatch=h;try{d.forEach(u)}finally{this._resizeBatch=null,h.notify&&(this.notify(h.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)c.schedule(f);else{i=!0;try{f()}finally{i=!1}}})},u=l=>{const c=l.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[f,h]of this.elementsCache)if(h===c){this.elementsCache.delete(f);break}return}this.isIndexInRange(d)&&this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,l,this))};return{disconnect:()=>{var l;(l=a())==null||l.disconnect(),r?.cancel(),o.clear(),s=!1,n=null,r=null},observe:l=>{const c=a();if(c){if(!i){c.observe(l,{box:"border-box"});return}o.add(l),s||(s=!0,r?.schedule(()=>{s=!1,o.forEach(d=>{d.isConnected&&n?.observe(d,{box:"border-box"})}),o.clear()}))}},unobserve:l=>{var c;o.delete(l),(c=a())==null||c.unobserve(l)}}})(),this.range=null,this.setOptions=n=>{var r;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:NH,rangeExtractor:RH,onChange:()=>{},measureElement:MH,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const c in n){const d=n[c];d!==void 0&&(i[c]=d)}const s=this.options;let o=null,a=null,u=!1;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const c=s.count,d=i.count,f=this.getMeasurements(),h=((r=this._singleLaneMeasurements)==null?void 0:r.items)??f,m=k=>yH(h[k]),x=c>0?m(0):null,E=c>0?m(c-1):null;if(d!==c||c>0&&d>0&&(i.getItemKey(0)!==x||i.getItemKey(d-1)!==E)){u=!0;const k=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;k&&(o=[k.key,this.getScrollOffset()-k.start]);const S=i.followOnAppend===!0?"auto":i.followOnAppend||null;S&&d>0&&this.isAtEnd(s.scrollEndThreshold)&&(c===0||i.getItemKey(d-1)!==E)&&(d>c||jH(c,d,m,i.getItemKey))&&(a=S)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let l=null;if(o&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){const[c,d]=o,f=this.getMeasurements(),{count:h,getItemKey:m}=this.options;let x=0;for(;x<h&&m(x)!==c;)x++;if(x<h){const E=f[x];if(E){const y=Math.max(0,E.start+d);!a&&y!==this.scrollOffset&&(l=y-this.scrollOffset,this.scrollOffset=y)}}}a?this.pendingScrollAnchor={kind:"follow",behavior:a}:l!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:l}:(this._holdOffset+=l,this._followOffsetTarget(l)))},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Ti(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var n;this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(n=this._momentumStop)==null||n.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{var a,u,l,c;const d=o?this._elementMaxScrollOffset():null,f=this._reportedOverscroll;this._reportedOverscroll=s<0||d!==null&&s>d+1;const h=s;this._lastElementOffset=h,s=this._toLayoutOffset(s);const m=this._classifyScrollEvent(s,o,d);if(m==="spurious")return;m==="readBack"?s=this.pendingWrite.target:m==="clampedReadBack"&&((a=this.scrollState)==null?void 0:a.index)!=null&&s<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=s:wH({kind:m,offset:s,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(s-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);const x=this.getScrollOffset(),E=this.scrollDirection;this.scrollDirection=o?x===s?this.scrollDirection:x<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o;const y=this.scrollState;if(y?.phase==="queued"&&m==="external"&&o)if(f||this._reportedOverscroll)y.samples=[];else{const v=this.now();y.samples=[...(y.samples??[]).filter(k=>v-k.t<=200),{t:v,offset:h}],(E!==null&&this.scrollDirection!==E||SH(y.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:o,ownReadBack:m==="readBack",moved:s!==x,external:m==="external"&&((u=this.scrollState)==null?void 0:u.phase)!=="smooth"&&((l=this.scrollState)==null?void 0:l.phase)!=="smoothFinishing"})&&((c=this.scrollState)==null?void 0:c.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();const i=this.pendingScrollAnchor;this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled&&(i.kind==="anchor"?this._canWriteScroll()?Ds(this.scrollState)&&!Kr(this.getScrollOffset()-i.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(i.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=i.delta,this._followOffsetTarget(i.delta),this.notify(!1)):this.scrollToEnd({behavior:i.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(n,r,i)=>{var s;return kH({offset:n,isScrolling:r,elementMax:i,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:((s=this._clampedAdjustment)==null?void 0:s.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;const{target:n,maxAtWrite:r}=this._clampedAdjustment,i=this.getMaxScrollOffset();i>r+.5&&(this._clampedAdjustment=n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(n))},this._writeAwaitingCommand=()=>{const n=this.scrollState;if(n===null||n.phase!=="queued")return;const{behavior:r}=n;this.getMeasurements();const i=this.getScrollStateTarget(n);n.lastTargetOffset=i,this._clampedAdjustment=null,n.phase=Kg(r,n.index!=null&&Kr(i,this.getScrollOffset())),this._scrollToOffset(i,{behavior:r}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{const n=this.scrollElement;if(n==null)return null;const{horizontal:r,isRtl:i}=this.options;return typeof n.scrollTop=="number"?r?n.scrollLeft*(i&&-1||1):n.scrollTop:typeof n.scrollY=="number"?r?n.scrollX:n.scrollY:null},this._canWriteScroll=()=>!(vu()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=n=>{var r;if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||((r=this.scrollState)==null?void 0:r.phase)==="smooth")return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(n);const i=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(i),this._scrollToOffset(i)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ti(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,i,s,o,a,u,l)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:a,laneAssignmentMode:u,gap:l}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=Ti(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:o,lanes:a,laneAssignmentMode:u,gap:l},c)=>{var d;const f=this.itemSizeCache;if(!o)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const v=n*2;let k=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!k||k.length<v){const I=new Float64Array(v);k&&h>0&&I.set(k.subarray(0,h*2)),k=I}const S=h===0?new Array(n):this._singleLaneMeasurements.items.slice();let T;if(h===0)T=r+i;else{const I=h-1;T=k[I*2]+k[I*2+1]+l}for(let I=h;I<n;I++){const A=s(I);S[I]=A;const O=f.get(A),_=typeof O=="number"?O:this.options.estimateSize(I);k[I*2]=T,k[I*2+1]=_,T+=_+l}this._singleLaneMeasurements={flat:k,items:S};const w=EH(S,k);return this.measurementsCache=w,w}const m=this.measurementsCache.slice(0,h),x=new Array(a).fill(void 0),E=new Float64Array(a);let y=0;for(let v=0;v<h;v++){const k=m[v];k&&(x[k.lane]===void 0&&y++,x[k.lane]=v,E[k.lane]=k.end)}for(let v=h;v<n;v++){const k=s(v),S=this.laneAssignments.get(v);let T,w;const I=u==="estimate"||f.has(k);if(S!==void 0&&this.options.lanes>1){T=S;const D=x[T],U=D!==void 0?m[D]:void 0;w=U?U.end+l:r+i}else if(y===a){let D=0,U=E[0],F=x[0];for(let R=1;R<a;R++){const j=E[R];(j<U||j===U&&x[R]<F)&&(D=R,U=j,F=x[R])}T=D,w=U+l,I&&this.laneAssignments.set(v,T)}else T=v%this.options.lanes,w=r+i,I&&this.laneAssignments.set(v,T);const A=f.get(k),O=typeof A=="number"?A:this.options.estimateSize(v),_=w+O;m[v]={index:v,start:w,size:O,end:_,key:k,lane:T},x[T]===void 0&&y++,x[T]=v,E[T]=_}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ti(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(n,r,i,s,o)=>{if(n.length===0||r===0)return this.range=null,null;const a=Math.max(o-r,0);return this.range=UH(n,r,Math.min(i,a),s,s===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ti(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r,this.options.lanes]},(n,r,i,s,o,a)=>s===null||o===null?[]:n({startIndex:s,endIndex:o,overscan:r,count:i,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!Ds(this.scrollState))return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,i-s),a=Math.min(this.options.count-1,i+s);return n>=o&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;const i=this.options.getItemKey(r),s=this.elementsCache.get(i);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,s,o;if(!this.isIndexInRange(n))return;(i=this._resizeBatch)!=null&&i.sync&&this.getMeasurements();let a,u,l;const c=(s=this._singleLaneMeasurements)==null?void 0:s.flat;if(this.options.lanes===1&&c!=null)l=this.options.getItemKey(n),u=c[n*2],a=c[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,u=h.start,a=h.size}const d=this.itemSizeCache.get(l)??a,f=r-d;if(f!==0){const h=this.options.anchorTo==="end"&&!Ds(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=h?this._getLayoutTotalSize():0,x=this.getScrollOffset(),y=!this.itemSizeCache.has(l)?u<x:u+d<=x&&this.scrollDirection!=="backward",v=!Ds(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:u,size:a,end:u+a,lane:0},f,this):y);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++;let k=!1;if(this._awaitingCommandReadBack()||(h?k=this.applyScrollAdjustment(this._getLayoutTotalSize()-m):v&&(k=this.applyScrollAdjustment(f))),this._resizeBatch){this._resizeBatch.notify=!0,(o=this._resizeBatch).sync||(o.sync=k);return}this.notify(k),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=Ti(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(n,r,i)=>{const s=[];for(let o=0,a=n.length;o<a;o++){const u=n[o],l=r[u];s.push(i===0?l:{...l,start:l.start-i,end:l.end-i})}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{var r;const i=this.getMeasurements();if(i.length===0)return;const s=(r=this._singleLaneMeasurements)==null?void 0:r.flat,o=this.options.lanes===1&&s!=null,a=pT(0,i.length-1,o?u=>s[u*2]:u=>qg(i[u]).start,n);return qg(i[a])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;const n=this._elementMaxScrollOffset();if(n===null)return;const r=this.pendingWrite,i=Math.max(n,0)+this._holdOffset;if(i>=r.target)return;const s=r.lowMaxes??(r.lowMaxes=[]);s[s.length-1]!==i&&s.push(i)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=n=>{var r;let i=n+this._holdOffset;return((r=this.pendingScrollAnchor)==null?void 0:r.kind)==="anchor"&&(i+=this.pendingScrollAnchor.delta),i},this._elementMaxScrollOffset=()=>{const n=this.scrollElement;if(n===null)return null;if("scrollHeight"in n)return this.options.horizontal?n.scrollWidth-n.clientWidth:n.scrollHeight-n.clientHeight;if("document"in n){const r=n.document.documentElement;return this.options.horizontal?r.scrollWidth-n.innerWidth:r.scrollHeight-n.innerHeight}return null},this._momentumStop=null,this._stopMomentum=n=>{const r=this.scrollElement,i=this.targetWindow;if(r===null||i===null)return;const s="document"in r?r.document.scrollingElement:r;if(!s?.style)return;if(this._momentumStop){this._momentumStop.done=n;return}const{style:o}=s,a=this.options.horizontal?"overflow-x":"overflow-y",u=o.getPropertyValue(a),l=o.getPropertyPriority(a),c=()=>this.options.horizontal?s.clientHeight:s.clientWidth,d=c();if(o.setProperty(a,"hidden","important"),c()!==d){o.setProperty(a,u,l);return}const f={restore:()=>o.getPropertyValue(a)!=="hidden"||o.getPropertyPriority(a)!=="important"?!1:(o.setProperty(a,u,l),!0),done:n};this._momentumStop=f,i.requestAnimationFrame(()=>i.requestAnimationFrame(()=>{this._momentumStop===f&&(this._momentumStop=null,f.restore()&&f.done())}))},this._clampedBy=n=>{const r=this._elementMaxScrollOffset();if(r===null)return null;const i=r+this._holdOffset;return n>i+.5?{target:n,maxAtWrite:i}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),o=this.getMeasurements()[n];if(!o)return;if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1){const u=this.getMaxScrollOffset(),l=u-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(l,u),0),r]}const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{this._startScroll({index:null,align:r},this.getOffsetForAlignment(n,r),i,"absolute")},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getOffsetForIndex(n,r);if(!s)return;const[o,a]=s;this._startScroll({index:n,align:a},o,i,"absolute")},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+n,"start");this._startScroll({index:null,align:"start"},i,r,"relative")},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),n,"absolute");return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var n,r;const i=this.getMeasurements();let s;if(i.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,a=(n=this._singleLaneMeasurements)==null?void 0:n.flat;a!=null?s=a[o*2]+a[o*2+1]:s=((r=i[o])==null?void 0:r.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&o.some(u=>u===null);){const u=i[a];o[u.lane]===null&&(o[u.lane]=u.end),a--}s=Math.max(...o.filter(u=>u!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i}={})=>{const s={target:n+(r??0),smooth:i==="smooth"};return this.pendingWrite=s,this.options.scrollToFn(n-this._holdOffset,{behavior:i,adjustments:r},this),s},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{const n=this.getCommandWrittenOffset();return!(vu()&&this._iosGesture.dragging())&&n!==null&&!Kr(n,this.getScrollOffset())},this._followOffsetTarget=n=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=n)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}get scrollAdjustments(){return 0}applyScrollAdjustment(t,n){if(t===0)return!1;if(this._followOffsetTarget(t),this._canWriteScroll()){const r=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(r+t);const i=this._scrollToOffset(r,{adjustments:t,behavior:n});return this.scrollOffset!==null&&(this.pendingWrite===i&&(this.scrollOffset+=t),this.scrollOffset<0&&(this.scrollOffset=0)),!0}else return this._holdOffset+=t,this.scrollOffset!==null&&(this.scrollOffset+=t),!0}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(t){const n=t.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:t.index!=null?this.getOffsetForIndex(t.index,t.align):void 0;return n?n[0]:t.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase==="queued"){this.scheduleScrollReconcile();return}this.getMeasurements();const r=this.getScrollStateTarget(this.scrollState),i=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=r!==this.scrollState.lastTargetOffset;if(!s&&Kr(r,this.getScrollOffset())){if(this.scrollState.phase==="smooth"?this.scrollState.phase="smoothLanded":this.scrollState.phase==="smoothFinishing"&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==r&&this._scrollToOffset(r,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const o=this.getSize()||600,a=Math.abs(r-this.getScrollOffset()),u=Ds(this.scrollState)&&a>o;this.scrollState.lastTargetOffset=r,u?this.scrollState.phase="smooth":this.scrollState.phase==="smooth"?this.scrollState.phase="smoothFinishing":this.scrollState.phase==="smoothLanded"&&(this.scrollState.phase="instant"),this._scrollToOffset(r,{behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(t,n,r,i){this.pendingScrollAnchor=null,this._clampedAdjustment=null;const s=this._iosGesture.tail();if(i==="absolute"&&s!==null){if(s==="fling"&&AH()){this._stopMomentum(()=>{const o=this.scrollState;o?.phase!=="queued"||this._iosGesture.tail()!=="fling"||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0,phase:"queued",behavior:r,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0,behavior:r,phase:Kg(r,t.index!=null&&Kr(n,this.getScrollOffset()))},this._scrollToOffset(n,{behavior:r}),this.scheduleScrollReconcile()}}const pT=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function HH(e,t,n){let r=0;for(;r<=t;){const i=(r+t)/2|0,s=e[i*2];if(s<n)r=i+1;else if(s>n)t=i-1;else return i}return r>0?r-1:0}function UH(e,t,n,r,i){const s=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:s};if(r===1&&i!==null){const l=HH(i,s,n);let c=l;const d=n+t;for(;c<s&&i[c*2]+i[c*2+1]<d;)c++;return{startIndex:l,endIndex:c}}let a=pT(0,s,l=>e[l].start,n),u=a;if(r===1)for(;u<s&&e[u].end<n+t;)u++;else if(r>1){const l=Array(r).fill(0);for(;u<s&&l.some(d=>d<n+t);){const d=e[u];l[d.lane]=d.end,u++}const c=Array(r).fill(n+t);for(;a>=0&&c.some(d=>d>=n);){const d=e[a];c[d.lane]=d.start,a--}a=Math.max(0,a-a%r),u=Math.min(s,u+(r-1-u%r))}return{startIndex:a,endIndex:u}}const Ec=typeof document<"u"?b.useLayoutEffect:b.useEffect;function $H({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const i=b.useReducer(f=>f+1,0)[1],s=b.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=t,s.current.mode=n;const o=b.useRef(!1),a=f=>{const h=s.current;if(!h.enabled||!h.container)return;const m=f.getTotalSize();if(m!==h.lastSize){h.lastSize=m;const x=f.options.horizontal?"width":"height";h.container.style[x]=`${m}px`}},u=(f,h,m)=>{const x=s.current,E=!!f.options.horizontal,y=h.start-f.options.scrollMargin;x.lastPositions.get(m)!==y&&(x.lastPositions.set(m,y),x.mode==="transform"?m.style.transform=E?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:m.style[E?"left":"top"]=`${y}px`)},l=f=>{const h=s.current;if(!(!h.enabled||!h.container)){a(f);for(const m of f.getVirtualItems()){const x=f.elementsCache.get(m.key);x&&u(f,m,x)}}},c={...r,onChange:(f,h)=>{var m;const x=s.current;let E=!0;if(x.enabled){l(f);const y=f.range,v=x.prevRange;E=!v||v.isScrolling!==f.isScrolling||v.startIndex!==y?.startIndex||v.endIndex!==y?.endIndex,E&&(x.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:f.isScrolling}:null)}E&&(e&&h&&!o.current?Kt.flushSync(i):i()),(m=r.onChange)==null||m.call(r,f,h)}},[d]=b.useState(()=>{const f=new BH(c),h=f.measureElement;return f.measureElement=m=>{o.current=!0;try{h(m)}finally{o.current=!1}const x=s.current;if(m!==null&&x.enabled&&x.container){const E=f.measurementsCache[f.indexFromElement(m)];E&&u(f,E,m)}},Object.assign(f,{containerRef:m=>{const x=s.current;x.container=m,x.lastSize=null,m!==null&&l(f)}})});return d.setOptions(c),Ec(()=>d._didMount(),[]),Ec(()=>(a(d),d._willUpdate())),Ec(()=>{l(d)}),d}function jh(e){return $H({observeElementRect:Fh,observeElementOffset:PH,scrollToFn:FH,...e})}function mT(){if(typeof navigator>"u")return"windows";const t=`${navigator.userAgentData?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad/i.test(t)?"macos":/win/i.test(t)?"windows":"linux"}function Bh(e,t){return{platform:e,preferences:t,bindings:Aw(t,e)}}let li=Bh(mT(),Cb);const ku=new Set;let Yi=0;function Yg(){return li}function zH(e){return ku.add(e),()=>{ku.delete(e)}}function yV(e){li=Bh(li.platform,e);for(const t of ku)t()}function EV(e=mT()){li=Bh(e,Cb),Yi=0;for(const t of ku)t()}function vV(){return b.useSyncExternalStore(zH,Yg,Yg)}function kV(){Yi+=1;let e=!1;return()=>{e||(e=!0,Yi=Math.max(0,Yi-1))}}function TV(){return Yi>0}function qH(e){return typeof HTMLInputElement>"u"?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function Qn(e){const t=e.nativeEvent??e;return t.isComposing===!0||t.keyCode===229}function wV(e){return e.key==="Tab"&&e.ctrlKey&&!e.altKey}function SV(e){return e.key==="Tab"&&["ctrl","mod","ctrl-meta"].includes(e.modifier)&&!e.alt}function WH(e){return e.modifier==="none"&&!e.alt&&Array.from(e.key).length===1}function _V(e,t){if(Yi>0)return!1;const n=e.target!==void 0&&qH(e.target),r=n&&li.platform==="macos"&&e.ctrlKey&&!e.metaKey;return li.bindings[t].some(i=>Cw(e,i)&&!(n&&WH(i))&&!(r&&i.modifier==="mod"))}function CV(e){return Iw.find(t=>t.id===e)}const VH={ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Escape:"Esc",Delete:"Del",Backspace:"⌫",PageUp:"PgUp",PageDown:"PgDn"," ":"Space"};function KH(e,t){const n=t==="macos",r=[];e.modifier==="mod"?r.push(n?"⌘":"Ctrl"):e.modifier==="ctrl"?r.push(n?"⌃":"Ctrl"):e.modifier==="meta"?r.push(n?"⌘":t==="windows"?"Win":"Super"):e.modifier==="ctrl-meta"&&r.push(n?"⌃":"Ctrl",n?"⌘":t==="windows"?"Win":"Super"),e.alt&&r.push(n?"⌥":"Alt");const i=e.shift&&Array.from(e.key).length===1&&e.key.toLowerCase()===e.key.toUpperCase()&&!/[0-9]/.test(e.key);return e.shift&&!i&&r.push(n?"⇧":"Shift"),r.push(VH[e.key]??(Array.from(e.key).length===1?e.key.toUpperCase():e.key)),r}function YH(e,t){return KH(e,t).join(t==="macos"?"":"+")}function AV(e,t=li){const n=t.bindings[e][0];return n===void 0?void 0:YH(n,t.platform)}const GH=new Set(["Control","Shift","Alt","Meta","OS","AltGraph","CapsLock","Fn","Hyper","Super"]);function IV(e,t){if(GH.has(e.key))return{kind:"pending"};if(!(Array.from(e.key).length===1&&!/[\u0000-\u001F\u007F]/u.test(e.key)||/^(?:Enter|Escape|Tab|Backspace|Delete|Home|End|PageUp|PageDown|ArrowUp|ArrowDown|ArrowLeft|ArrowRight|F(?:[1-9]|1[0-9]|2[0-4]))$/u.test(e.key)))return{kind:"unsupported",key:e.key};const r=t==="macos"?e.metaKey:e.ctrlKey,i=t==="macos"?e.ctrlKey:e.metaKey,s=e.ctrlKey&&e.metaKey?"ctrl-meta":r?"mod":i?t==="macos"?"ctrl":"meta":"none";return{kind:"chord",chord:{key:Array.from(e.key).length===1&&e.shiftKey?e.key.toLowerCase():e.key,modifier:s,shift:e.shiftKey,alt:e.altKey}}}function NV(e,t){return e.key.toLowerCase()===t.key.toLowerCase()&&e.modifier===t.modifier&&e.shift===t.shift&&e.alt===t.alt}const XH={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"0.6.0",VITE_BUILD_SHA:"",VITE_UPDATE_CHANNEL:"stable"},Fs={settledRosterWindow:64,searchResultLimit:32,inlineBatchPreviewLimit:24,virtualizeThreshold:24,searchDebounceMs:120};function Ln(e,t,n=1,r=1e4){const s=XH?.[e];if(typeof s!="string"||s.trim()==="")return t;const o=Number.parseInt(s,10);return!Number.isFinite(o)||o<n?t:Math.min(r,o)}function QH(){return{settledRosterWindow:Ln("VITE_KIKI_SUBAGENT_SETTLED_ROSTER_WINDOW",Fs.settledRosterWindow),searchResultLimit:Ln("VITE_KIKI_SUBAGENT_SEARCH_RESULT_LIMIT",Fs.searchResultLimit),inlineBatchPreviewLimit:Ln("VITE_KIKI_SUBAGENT_INLINE_BATCH_PREVIEW_LIMIT",Fs.inlineBatchPreviewLimit),virtualizeThreshold:Ln("VITE_KIKI_SUBAGENT_VIRTUALIZE_THRESHOLD",Fs.virtualizeThreshold),searchDebounceMs:Ln("VITE_KIKI_SUBAGENT_SEARCH_DEBOUNCE_MS",Fs.searchDebounceMs,0,5e3)}}let js={};function RV(){const e=QH();return{settledRosterWindow:js.settledRosterWindow??e.settledRosterWindow,searchResultLimit:js.searchResultLimit??e.searchResultLimit,inlineBatchPreviewLimit:js.inlineBatchPreviewLimit??e.inlineBatchPreviewLimit,virtualizeThreshold:js.virtualizeThreshold??e.virtualizeThreshold,searchDebounceMs:js.searchDebounceMs??e.searchDebounceMs}}const Bs={selectVirtualizeThreshold:40,catalogVirtualizeThreshold:40,virtualOverscan:6,suggestionTopK:40,fastFilterThreshold:120};function ZH(){return{selectVirtualizeThreshold:Ln("VITE_KIKI_SELECT_VIRTUALIZE_THRESHOLD",Bs.selectVirtualizeThreshold),catalogVirtualizeThreshold:Ln("VITE_KIKI_CATALOG_VIRTUALIZE_THRESHOLD",Bs.catalogVirtualizeThreshold),virtualOverscan:Ln("VITE_KIKI_PICKER_VIRTUAL_OVERSCAN",Bs.virtualOverscan,1,64),suggestionTopK:Ln("VITE_KIKI_PICKER_SUGGESTION_TOP_K",Bs.suggestionTopK),fastFilterThreshold:Ln("VITE_KIKI_PICKER_FAST_FILTER_THRESHOLD",Bs.fastFilterThreshold)}}let Hs={};function JH(){const e=ZH();return{selectVirtualizeThreshold:Hs.selectVirtualizeThreshold??e.selectVirtualizeThreshold,catalogVirtualizeThreshold:Hs.catalogVirtualizeThreshold??e.catalogVirtualizeThreshold,virtualOverscan:Hs.virtualOverscan??e.virtualOverscan,suggestionTopK:Hs.suggestionTopK??e.suggestionTopK,fastFilterThreshold:Hs.fastFilterThreshold??e.fastFilterThreshold}}const Bd=b.createContext(void 0);function OV(){return b.useContext(Bd)!==void 0}const as="data-modal-escape",Gg='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',eU="anim-enter w-full rounded-2xl border border-hairline bg-panel p-6 shadow-[0_16px_48px_-16px_rgb(var(--kiki-shadow-ink)/0.35)] outline-none",tU={sm:"max-w-[520px]",md:"max-w-[640px]",lg:"max-w-[880px]",xl:"max-w-[1080px]"},gT="fixed inset-0 z-50 flex items-center justify-center bg-shell/20 p-4 pt-[max(1rem,var(--kiki-safe-top-inset))]",nU=`${gT} pointer-coarse:h-[var(--kiki-visual-height,100dvh)] max-md:items-end max-md:p-0 max-md:pt-[var(--kiki-safe-top-inset)]`,rU=`${eU} ${tU.sm} max-h-[calc(var(--kiki-visual-height,100dvh)-2rem-var(--kiki-safe-top-inset))] overflow-y-auto overscroll-y-contain max-md:max-w-none max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[calc(1.5rem+var(--kiki-safe-bottom-inset))]`;function Xg(e,t){return e instanceof Element&&e.closest(`[${as}]`)?.getAttribute(as)===t}function iU(e){if(typeof document>"u")return!1;for(const t of document.querySelectorAll(`[${as}]`))if(t.getAttribute(as)===e)return!0;return!1}function LV({onClose:e,ariaLabel:t,overlayId:n,panelClassName:r,overlayClassName:i,children:s,stacked:o,role:a="dialog",overlayData:u,dismissible:l=!0}){const c=b.useContext(Bd),[d]=b.useState(DI),f=o??c!==void 0?c===void 0?d:c+1:void 0,h=f??0,m=b.useRef(null),[x,E]=b.useState(null),y=b.useRef(null),v=b.useRef(e);v.current=e;const k=b.useRef(l);k.current=l;const[S]=b.useState(()=>typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null),T=b.useRef(S),w=Ub();Pf(n,w&&l,e);const I=b.useCallback(_=>{m.current=_,E(D=>D===_?D:_)},[]),A=b.useCallback(()=>{const _=m.current;return _===null?!1:f===void 0?Nm(_):y.current?.isTop()===!0},[f]);b.useLayoutEffect(()=>Gu(n),[n]),b.useLayoutEffect(()=>{if(x===null)return;const _=FI(n,h,x);return y.current=_,()=>{_.unregister(),y.current===_&&(y.current=null)}},[n,h,x]),b.useEffect(()=>()=>{const _=T.current;_!==null&&(f===void 0?_.isConnected&&_.focus():queueMicrotask(()=>{_.isConnected&&Nm(_)&&_.focus()}))},[f]),b.useEffect(()=>{if(x===null)return;const _=R=>R instanceof Element?x.contains(R)?!0:Xg(R,n)&&A():!1,D=()=>[...x.querySelectorAll(Gg)].filter(R=>(R.offsetParent!==null||R.getClientRects().length>0)&&(f===void 0||!R.closest("[inert]"))),U=R=>{if(R.key!=="Tab"||!A()||(f!==void 0&&R.stopPropagation(),R.target instanceof Element&&_(R.target)&&!x.contains(R.target)))return;const j=D();if(j.length===0){R.preventDefault(),f!==void 0&&x.focus();return}const B=j[0],q=j.at(-1),$=document.activeElement;R.shiftKey&&($===B||!x.contains($))?(R.preventDefault(),q.focus()):!R.shiftKey&&($===q||!x.contains($))&&(R.preventDefault(),B.focus())},F=R=>{f!==void 0&&y.current?.isTop()===!0&&!_(R.target)&&(D()[0]??x).focus()};return f===void 0?x.addEventListener("keydown",U):(window.addEventListener("keydown",U,!0),document.addEventListener("focusin",F)),()=>{x.removeEventListener("keydown",U),window.removeEventListener("keydown",U,!0),document.removeEventListener("focusin",F)}},[f,n,x,A]),b.useEffect(()=>{if(x===null||!A())return;(x.querySelector("[data-autofocus]:not([disabled])")??(x.querySelector("[data-autofocus]")===null?x.querySelector(Gg):null)??x).focus()},[x]);const O=b.useCallback((_,D)=>{if(_)return;const U=()=>{D.cancel(),D.allowPropagation()};if(!k.current){U();return}const F=m.current;if(D.reason==="escape-key"){const R=D.event;if(R?.defaultPrevented){U();return}if(R instanceof KeyboardEvent&&Qn(R)){U();return}if(!A()){U();return}if(F!==null&&F.querySelector('[aria-modal="true"]')!==null){U();return}if(Xg(R?.target??null,n)||iU(n)||To(n)){U();return}v.current();return}if(D.reason==="outside-press"||D.reason==="focus-out"){D.cancel();return}v.current()},[A,n]);return p.jsx(Bd.Provider,{value:f,children:p.jsx(fT,{open:!0,modal:!1,disablePointerDismissal:!l,onOpenChange:O,children:p.jsxs(dT,{children:[p.jsx(oT,{className:"sr-only"}),p.jsx(xH,{...u,className:i??(r===void 0?nU:gT),style:f===void 0?void 0:{zIndex:Jn+f},onPointerDown:_=>{k.current&&_.target===_.currentTarget&&A()&&v.current()},children:p.jsx(cT,{ref:I,role:a,"aria-modal":"true","aria-label":t,initialFocus:!1,finalFocus:!1,[Vx]:n,[Kx]:h,className:r??rU,children:s})})]})})})}const sU="min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain";function PV({on:e}){return p.jsx("span",{"aria-hidden":!0,className:`flex h-[19px] w-3 shrink-0 items-center ${e?"text-ink":"text-transparent"}`,children:p.jsx(Je,{name:"check",size:12})})}function oU(e,t,n){if(e)return;const{surfaceOwnerId:r,triggerEl:i,panelEl:s,rootEl:o,onDismiss:a}=n;if(t.reason==="escape-key"){const u=t.event;if(u instanceof KeyboardEvent&&Qn(u)||To(r)){t.cancel();return}a(!0);return}if(t.reason==="outside-press"){const u=t.event?.target??null;if(t.event?.type==="click"||u instanceof Node&&(i?.contains(u)===!0||o?.contains(u)===!0)||Ff(s,u,r)||To(r)){t.cancel();return}a(!1);return}if(t.reason==="focus-out"){t.cancel();return}a(!1)}function aU(e,t){const{enabled:n=!0,surfaceOwnerId:r,rootRef:i,triggerRef:s,panelRef:o,onDismiss:a}=t;b.useEffect(()=>{if(!e||!n)return;const u=l=>{const c=l.target;c instanceof Node&&(i?.current?.contains(c)===!0||s?.current?.contains(c)===!0)||Ff(o.current,c,r)||To(r)||a()};return document.addEventListener("pointerdown",u),()=>{document.removeEventListener("pointerdown",u)}},[e,n,r,i,s,o,a])}function MV(e,t){if(Qn(e)||t===null)return!1;const n=[...t.querySelectorAll("[data-menu-row]:not(:disabled)")];if(n.length===0)return!1;const r=e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement;if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(e.preventDefault(),r)return(e.key==="ArrowDown"?n[0]:n.at(-1))?.focus(),!0;const i=n.findIndex(o=>o===document.activeElement),s=e.key==="ArrowDown"?1:-1;return n[(i+s+n.length)%n.length]?.focus(),!0}return e.key==="Enter"&&r?(e.preventDefault(),n[0]?.click(),!0):!1}const bT=8;function uU(e,t,n,r){const i=e.length>=bT,s=i?t.filter(o=>{let a=!1,u=!1;for(let l=0;l<e.length;l+=1)if(o.test(e[l])?a=!0:u=!0,a&&u)return!0;return!1}).map(o=>o.id):[];return{search:i,filters:s.length>0,filterIds:s,sort:r&&n.length>1}}function DV(e,t,n,r=[]){const i=new Map,s=(a,u)=>{let l=i.get(a);return l===void 0&&(l={key:a,label:u,items:[],total:0},i.set(a,l)),l};for(const a of e)for(const{key:u,label:l}of n(a))s(u,l).total+=1;for(const a of t)for(const{key:u,label:l}of n(a))s(u,l).items.push(a);const o=a=>{const u=r.indexOf(a);return u===-1?r.length:u};return[...i.values()].map((a,u)=>({group:a,index:u})).toSorted((a,u)=>o(a.group.key)-o(u.group.key)||a.index-u.index).map(({group:a})=>a)}const xT="kiki.settingsLists",Hd=new Set;let Ii=null;function Ud(){if(Ii!==null)return Ii;try{const e=typeof localStorage>"u"?null:localStorage.getItem(xT),t=e===null?{}:JSON.parse(e);Ii=t!==null&&typeof t=="object"?t:{}}catch{Ii={}}return Ii}function vc(e,t){const n={...Ud(),[e]:{...Ud()[e],...t}};Ii=n;try{localStorage.setItem(xT,JSON.stringify(n))}catch{}for(const r of Hd)r()}function lU(e){return Hd.add(e),()=>{Hd.delete(e)}}function FV({listId:e,items:t,keyOf:n,textOf:r,filters:i=[],sorts:s=[],orderMatters:o=!1,defaultDensity:a="comfortable"}){const u=b.useSyncExternalStore(lU,()=>Ud()[e],()=>{}),[l,c]=b.useState(""),[d,f]=b.useState("all"),[h,m]=b.useState(()=>new Set),[x,E]=b.useState(!1),y=b.useMemo(()=>uU(t,i,s,o),[t,i,s,o]),v=y.search?l:"",k=y.filterIds.includes(d)?d:"all",S=y.sort&&s.some(R=>R.id===u?.sort)?u.sort:s[0]?.id??"",T=y.search?u?.density??a:a,w=b.useMemo(()=>new Set(u?.folded??[]),[u?.folded]),I=b.useDeferredValue(v),A=b.useRef(null),O=b.useMemo(()=>{const R=I.trim().toLowerCase().split(/\s+/).filter($=>$!=="");if(R.length===0)return t;let j=A.current;if(j===null||j.items!==t||j.textOf!==r){const $=new Array(t.length);for(let X=0;X<t.length;X+=1){const C=r(t[X]);let se="";for(let xe=0;xe<C.length;xe+=1){const L=C[xe];L!==void 0&&L!==""&&(se=se===""?L:`${se}
186
+ ${L}`)}$[X]=se.toLowerCase()}j={items:t,textOf:r,haystacks:$},A.current=j}const{haystacks:B}=j,q=[];for(let $=0;$<t.length;$+=1){const X=B[$];let C=!0;for(let se=0;se<R.length;se+=1)if(!X.includes(R[se])){C=!1;break}C&&q.push(t[$])}return q},[t,r,I]),_=b.useMemo(()=>{const R={all:O.length};for(const j of i){let B=0;for(let q=0;q<O.length;q+=1)j.test(O[q])&&(B+=1);R[j.id]=B}return R},[O,i]),D=b.useMemo(()=>{const R=i.find(q=>q.id===k),j=R===void 0?O:O.filter(R.test),B=s.find(q=>q.id===S)?.compare;return B===void 0?j:j.toSorted(B)},[O,i,k,s,S]),U=b.useMemo(()=>{if(h.size===0)return h;const R=new Set(D.map(n));return new Set([...h].filter(j=>R.has(j)))},[h,D,n]),F=b.useCallback(R=>{const j=new Set(w);j.has(R)?j.delete(R):j.add(R),vc(e,{folded:[...j]})},[w,e]);return{tools:y,query:v,setQuery:c,filter:k,setFilter:f,sort:S,setSort:R=>{vc(e,{sort:R})},density:T,setDensity:R=>{vc(e,{density:R})},visible:D,counts:_,narrowed:v.trim()!==""||k!=="all",clear:()=>{c(""),f("all")},isFolded:R=>v.trim()===""&&w.has(R),toggleFold:F,selected:U,toggleSelected:R=>{m(j=>{const B=new Set(j);return B.has(R)?B.delete(R):B.add(R),B})},setSelected:m,selecting:x,setSelecting:R=>{E(R),R||m(new Set)}}}const $d="rounded-[10px] border border-hairline bg-panel shadow-[0_1px_2px_rgb(var(--kiki-shadow-ink)/0.06),0_8px_24px_-12px_rgb(var(--kiki-shadow-ink)/0.18)]",cU=4,Qg=8,Zg=224,_a=340,dU=[],Jg=new WeakMap;function fU(e){const t=Jg.get(e);if(t!==void 0)return t;const n=[];for(let r=0;r<e.length;r+=1){const i=e[r];n[r]=`${i.label}\0${i.hint??""}\0${i.description??""}\0${i.keywords??""}`.toLowerCase()}return Jg.set(e,n),n}function hU(e,t){const n=t.trim().toLowerCase();if(n==="")return e;const r=fU(e),i=[];for(let s=0;s<e.length;s+=1)r[s].includes(n)&&i.push(e[s]);return i}function pU(e){const{id:t,options:n,ariaLabel:r,ariaLabelledBy:i,ariaInvalid:s,ariaDescribedBy:o,title:a,disabled:u=!1,emptyText:l,searchPlaceholder:c,noMatchText:d,rootClassName:f,buttonClassName:h,labelClassName:m,triggerData:x,panelData:E,panelClassName:y,placement:v="below",align:k="start",triggerLabel:S,triggerIcon:T,triggerSuffix:w,hideChevron:I=!1,panelHeader:A,panelFooter:O,hideFilter:_,allowCustomValue:D=!1,customValueLabel:U,openSignal:F,closeSignal:R,density:j="comfortable"}=e,B=e.multiple===!0,q=B?"":e.value,$=B?e.values:[],{t:X}=je(),C=Hb(),se=JH(),xe=b.useId().replace(/:/g,""),L=`select:${t??xe}`,[G,re]=b.useState(!1),[ne,pe]=b.useState(""),Ae=b.useDeferredValue(ne),[ee,he]=b.useState(0),Ie=b.useRef(!1),Me=b.useRef("auto"),Be=b.useRef(null),fe=b.useRef(null),Le=b.useRef(null),Re=b.useRef(null),[De,ke]=b.useState(null),le=b.useCallback(V=>{Re.current=V,ke(V)},[]),Ce=b.useRef(!1);G||(Ce.current=!1);const ge=C,Fe=!0,K=t?.startsWith("composer-")===!0,be=G?Mf(fe.current):void 0,J=G?Gx(fe.current):void 0;b.useEffect(()=>{if(K)return jI(Rm,L,()=>{re(!1),pe("")})},[K,L]),b.useEffect(()=>{!G||!K||BI(Rm,L,fe.current)},[G,K,L]);const H=b.useMemo(()=>{const V=new Map,Ee=new Map;for(let Ue=0;Ue<n.length;Ue+=1){const Ze=n[Ue];V.has(Ze.value)||V.set(Ze.value,Ze),Ze.disabled!==!0&&!Ee.has(Ze.value)&&Ee.set(Ze.value,Ue)}return{byValue:V,enabledIndexByValue:Ee}},[n]),Q=()=>{let V=0;if(!B&&q!==""){const Ee=H.enabledIndexByValue.get(q);Ee!==void 0&&(V=Ee)}Ie.current=!0,Me.current="center",he(V),re(!0)},W=b.useRef(F);b.useEffect(()=>{F===void 0||F===W.current||(W.current=F,!u&&Q())},[F,u]);const Z=b.useRef(R);b.useEffect(()=>{R===void 0||R===Z.current||(Z.current=R,re(!1),pe(""))},[R]);const ae=G&&Fe?Df(fe.current):void 0,ue=_!==void 0?!_:n.length>=bT||D,Se=b.useMemo(()=>new Set(B?$:q!==""?[q]:[]),[B,$,q]),me=V=>B?Se.has(V):V===q,de=b.useMemo(()=>B?void 0:H.byValue.get(q),[B,H,q]),ve=b.useMemo(()=>{if(!(!B||$.length===0))return $.map(V=>H.byValue.get(V)?.label??V)},[B,$,H]),_e=b.useMemo(()=>{if(ve===void 0||ve.length===0)return;const V=ve[0];return ve.length===1?V:X("select.summaryMore",{first:V,count:ve.length-1})},[ve,X]),Pe=b.useMemo(()=>ve===void 0||ve.length===0?void 0:ve.join(", "),[ve]),ye=b.useMemo(()=>G?!ue||Ae.trim()===""?n:hU(n,Ae):dU,[G,n,Ae,ue]),Ne=G?Ae.trim():"",ce=b.useMemo(()=>G&&ue&&D&&Ne!==""&&!H.byValue.has(Ne)?Ne:void 0,[G,ue,D,Ne,H]),ut=ye.length+(ce===void 0?0:1),rt=V=>V>=0&&(ye[V]!==void 0?ye[V].disabled!==!0:ce!==void 0&&V===ye.length),qn=(V,Ee)=>{for(let Ue=1;Ue<=ut;Ue++){const Ze=(V+Ee*Ue+ut)%ut;if(rt(Ze))return Ze}return-1};b.useEffect(()=>{G&&he(V=>{if(rt(V))return V;const Ee=qn(-1,1);return Ee>=0&&(Me.current="auto",Ie.current=!0),Ee})},[G,ye,ce]);const Wn=b.useMemo(()=>{if(!G||n.length<=1)return!1;const V=n[0].group;for(let Ee=1;Ee<n.length;Ee++)if(n[Ee].group!==V)return!0;return!1},[G,n]),pt=()=>{re(!1),pe("")};Pf(L,G&&ge,()=>{pt(),fe.current?.focus()}),b.useLayoutEffect(()=>{!G||ue||oa()&&!ge||Re.current?.focus()},[G,ue,ge]),aU(G,{enabled:!ge,surfaceOwnerId:L,rootRef:Be,triggerRef:fe,panelRef:Le,onDismiss:pt}),b.useEffect(()=>G?Gu(L):void 0,[G,L,Fe]);const ze=ge?52:j==="compact"?40:52,ot=G&&ye.length>se.selectVirtualizeThreshold,Mt=b.useCallback(V=>{if(!Wn)return ze;const Ee=ye[V],Ue=V>0?ye[V-1]?.group:void 0;return Ee?.group!==void 0&&Ee.group!==Ue?ze+24:ze},[ze,Wn,ye]),ct=jh({count:ot?ye.length:0,getScrollElement:()=>De,estimateSize:Mt,getItemKey:V=>`${ye[V]?.value??""}-${V}`,indexAttribute:"data-virtual-index",overscan:se.virtualOverscan,initialRect:{width:320,height:_a},observeElementRect:(V,Ee)=>{const Ue=V.scrollElement;if(Ue===null)return;const Ze=()=>{const Sn=Ue.getBoundingClientRect(),tn=Math.round(Sn.height||Ue.clientHeight),sa=Math.round(Sn.width||Ue.clientWidth);tn>0&&Ee({width:sa,height:tn})};if(Ze(),typeof ResizeObserver>"u")return;const xi=new ResizeObserver(Ze);return xi.observe(Ue),()=>{xi.disconnect()}},scrollToFn:(V,Ee,Ue)=>{const Ze=Ue.scrollElement;Ze!==null&&(typeof Ze.scrollTo=="function"&&Ee.behavior==="smooth"?Ze.scrollTo({top:V,behavior:"smooth"}):Ze.scrollTop=V,Ze.clientHeight===0&&Ze.dispatchEvent(new Event("scroll")))},measureElement:V=>{const Ee=Math.round(V.getBoundingClientRect().height);if(Ee>0)return Ee;const Ue=Number(V.getAttribute("data-virtual-index"));return Number.isInteger(Ue)?Mt(Ue):ze},useFlushSync:!1});b.useLayoutEffect(()=>{if(!G||De===null||!Ie.current)return;Ie.current=!1;const V=Me.current;if(Me.current="auto",ot&&ee>=0&&ee<ye.length){if(De.scrollHeight>De.clientHeight)ct.scrollToIndex(ee,{align:V});else{const Ue=ct.measurementsCache[ee];if(Ue!==void 0){const Ze=De.clientHeight>0?De.clientHeight:_a,xi=Math.max(0,ct.getTotalSize()-Ze),Sn=De.scrollTop;let tn=Sn;V==="center"?tn=Ue.start+(Ue.size-Ze)/2:Ue.end>Sn+Ze?tn=Ue.end-Ze:Ue.start<Sn&&(tn=Ue.start);const sa=Math.max(0,Math.min(xi,Math.round(tn)));sa!==Sn&&(De.scrollTop=sa,De.dispatchEvent(new Event("scroll")))}}return}const Ee=De.querySelector(`[data-index="${ee}"]`);Ee!==null&&Ee.scrollIntoView?.({block:"nearest"})},[G,De,ee,ye.length,ot,ct]);const dn=V=>{if(!e.multiple)return;const Ee=e.values.includes(V)?e.values.filter(Ue=>Ue!==V):[...e.values,V];e.onChange(Ee)},Dt=V=>{if(!(V===void 0||V.disabled===!0)){if(e.multiple){dn(V.value);return}e.onChange(V.value),pt()}},Lr=V=>{if(e.multiple){dn(V),pe("");return}e.onChange(V),pt()},Vn=V=>{const Ee=ye[V];if(Ee!==void 0){Dt(Ee);return}ce!==void 0&&V===ye.length&&Lr(ce)},Pr=V=>{if(!Qn(V))if(V.key==="ArrowDown"||V.key==="ArrowUp"){V.preventDefault();const Ee=V.key==="ArrowDown"?1:-1,Ue=qn(ee,Ee);Ie.current=!0,Me.current="auto",he(Ue)}else if(V.key==="Enter"){if(!ue&&V.target instanceof HTMLElement&&V.target.getAttribute("role")==="option"){const Ee=Number(V.target.getAttribute("data-index"));if(Number.isInteger(Ee)){V.preventDefault(),Vn(Ee);return}}V.preventDefault(),Vn(ee)}else V.key==="Escape"&&(V.preventDefault(),V.stopPropagation(),pt(),fe.current?.focus())},At=`${t??"searchable-select"}-list`,Mr=ge?"min-h-11 py-2.5 text-[14px]":"py-1.5 text-[13px]",or=(V,Ee)=>{const Ue=Ee===ee,Ze=me(V.value),xi=Ee>0?ye[Ee-1]?.group:void 0,Sn=Wn&&V.group!==void 0&&V.group!==xi?V.group:void 0;return p.jsxs(p.Fragment,{children:[Sn!==void 0?p.jsx("p",{className:`px-3 pb-0.5 text-[12px] font-medium text-ink-faint ${Ee===0?"pt-1":"pt-3"}`,children:Sn}):null,j==="compact"&&!ge?p.jsx(mU,{id:`${At}-option-${Ee}`,index:Ee,option:V,active:Ue,selected:Ze,multiple:B,ariaSetSize:ot?ut:void 0,ariaPosInSet:ot?Ee+1:void 0,onCommit:()=>{Dt(V)},onHover:()=>{!Ue&&!V.disabled&&he(Ee)}}):p.jsxs("button",{type:"button",id:`${At}-option-${Ee}`,"data-index":Ee,role:"option","data-option-value":V.value,...V.dataAttrs,"aria-selected":Ze,"aria-disabled":V.disabled?!0:void 0,"aria-setsize":ot?ut:void 0,"aria-posinset":ot?Ee+1:void 0,disabled:V.disabled,title:V.title??V.label,onClick:()=>{Dt(V)},onMouseMove:()=>{!Ue&&!V.disabled&&he(Ee)},className:`flex w-full flex-col justify-center gap-0.5 rounded-md px-3 text-left transition-colors duration-[var(--kiki-motion-quick)] pointer-coarse:min-h-11 disabled:cursor-not-allowed ${Mr} ${Ze&&!B?"bg-paper shadow-[var(--kiki-sheet-shadow)]":Ze&&B?"bg-ink/[0.05]":Ue?"bg-ink/[0.04]":""}`,children:[p.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[B?p.jsx("span",{"aria-hidden":!0,className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${Ze?"border-ink bg-ink text-paper":"border-hairline-strong bg-paper text-transparent"}`,children:p.jsx(Je,{name:"check",size:12})}):null,p.jsx("span",{className:`min-w-0 flex-1 truncate ${V.disabled?"text-ink-faint":"text-ink"} ${Ze?"font-medium":""}`,children:V.label}),!B&&Ze?p.jsx(Je,{name:"check",size:12,className:"ml-auto shrink-0 text-ink-soft"}):null]}),V.description!==void 0?p.jsx("span",{className:`line-clamp-2 text-[12px] leading-snug text-ink-faint ${B?"pl-6":""}`,children:V.description}):null,V.hint!==void 0?p.jsx("span",{className:`truncate font-mono text-[11px] text-ink-faint ${B?"pl-6":""}`,children:V.hint}):null,V.badges!==void 0&&V.badges.length>0?p.jsx("span",{className:`mt-0.5 flex flex-wrap items-center gap-1 ${B?"pl-6":""}`,children:V.badges.map(tn=>p.jsx("span",{className:`rounded-[4px] py-px text-[11px] leading-4 ${tn.accent===!0?"font-medium text-accent-ink":tn.tone==="caution"?"bg-amber-ink/10 px-1.5 text-amber-ink":"bg-ink/[0.05] px-1.5 text-ink-faint"}`,children:tn.label},tn.label))}):null]})]})},Dr=()=>p.jsxs(p.Fragment,{children:[A,ue?p.jsx("div",{className:"border-b border-hairline px-3 py-2",children:p.jsx("input",{type:"text","data-autofocus":!0,ref:V=>{V!==null&&!Ce.current&&!oa()&&(Ce.current=!0,V.focus())},value:ne,onChange:V=>{pe(V.target.value),he(0),Re.current!==null&&(Re.current.scrollTop=0)},onKeyDown:Pr,placeholder:c??X("select.search"),"aria-label":r,"aria-labelledby":r===void 0?i:void 0,role:"combobox","aria-expanded":"true","aria-controls":At,"aria-activedescendant":rt(ee)?`${At}-option-${ee}`:void 0,className:`w-full bg-transparent text-ink outline-none placeholder:text-ink-faint ${ge?"min-h-8 text-[15px]":"text-[13px]"}`})}):null,_===!0&&n.length===0&&(A!==void 0||O!==void 0)?null:p.jsx("div",{ref:le,id:At,role:"listbox",tabIndex:ue?void 0:-1,"aria-label":r,"aria-labelledby":r===void 0?i:void 0,"aria-multiselectable":B?!0:void 0,"aria-activedescendant":!ue&&rt(ee)?`${At}-option-${ee}`:void 0,onKeyDown:ue?void 0:Pr,className:`${sU} p-1.5 outline-none `,children:ut===0?p.jsx("p",{className:"px-2 py-4 text-center text-[12px] text-ink-faint",children:n.length===0?l??X("select.empty"):(d??(V=>X("select.noMatches",{query:V})))(ne.trim())}):p.jsxs(p.Fragment,{children:[ot?p.jsx("div",{role:"presentation","data-virtual-list":!0,style:{height:ct.getTotalSize(),position:"relative"},children:ct.getVirtualItems().map(V=>{const Ee=ye[V.index];return Ee===void 0?null:p.jsx("div",{role:"presentation","data-virtual-index":V.index,ref:ct.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${V.start}px)`},children:or(Ee,V.index)},V.key)})}):ye.map((V,Ee)=>p.jsx("div",{role:"presentation",children:or(V,Ee)},`${V.value}-${Ee}`)),ce!==void 0?p.jsxs("button",{type:"button",id:`${At}-option-${ye.length}`,"data-index":ye.length,role:"option","aria-selected":me(ce),"aria-setsize":ot?ut:void 0,"aria-posinset":ot?ye.length+1:void 0,title:ce,onClick:()=>{Lr(ce)},onMouseMove:()=>{he(ye.length)},className:`flex w-full items-center gap-2 rounded-md px-3 py-2 text-left font-mono text-[12px] text-ink transition-colors duration-[var(--kiki-motion-quick)] pointer-coarse:min-h-11 ${ee===ye.length?"bg-ink/[0.04]":"hover:bg-ink/[0.04]"}`,children:[p.jsx(Je,{name:"plus",size:12,className:"text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate",children:(U??(V=>V))(ce)})]}):null]})}),O]}),vs=S??(B?_e??l??X("select.empty"):de?.label??(q!==""?q:l??X("select.empty")));return p.jsxs("div",{ref:Be,className:f??"relative","data-searchable-select":!0,onKeyDown:V=>{!G||V.key!=="Escape"||Qn(V)||(V.preventDefault(),V.stopPropagation(),pt(),fe.current?.focus())},children:[p.jsxs("button",{ref:fe,type:"button",id:t,disabled:u,"aria-haspopup":"listbox","aria-expanded":G,"aria-label":r,"aria-labelledby":i,"aria-invalid":s,"aria-describedby":o,...x,title:a??(B?Pe:de?.title??de?.label),onClick:()=>{G?pt():Q()},className:h??"flex max-w-full items-center gap-1.5 rounded-md border border-hairline bg-paper px-2 py-1 text-[12px] text-ink outline-none transition-colors hover:border-hairline-strong focus:border-accent disabled:cursor-not-allowed disabled:bg-hairline/20 disabled:text-ink-faint",children:[T,p.jsx("span",{className:`min-w-0 truncate ${B&&$.length===0&&S===void 0?"text-ink-faint font-sans":""} ${m??""}`.trim(),children:vs}),w,I?null:p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":!0,className:`shrink-0 text-ink-faint transition-transform ${G?"rotate-180":""}`,children:p.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),G?ge?p.jsx(fT,{open:!0,modal:!1,disablePointerDismissal:!1,onOpenChange:(V,Ee)=>{if(!V){if(Ee.reason==="escape-key"){if(Ee.event instanceof KeyboardEvent&&Qn(Ee.event)||To(L)){Ee.cancel();return}pt(),fe.current?.focus();return}if(Ee.reason==="outside-press"){const Ue=Ee.event?.target??null;if(Ff(Le.current,Ue,L)){Ee.cancel();return}pt(),fe.current?.focus();return}pt(),fe.current?.focus()}},children:p.jsx(dT,{children:p.jsxs("div",{"data-select-sheet":!0,className:"kiki-action-sheet-layer",style:{zIndex:ae??Jn},onClick:V=>{V.stopPropagation()},children:[p.jsx(oT,{forceRender:!0,"aria-hidden":!0,"data-select-scrim":!0,className:"kiki-action-sheet-scrim",onClick:()=>{pt(),fe.current?.focus()}}),p.jsx(cT,{ref:Le,role:"presentation",initialFocus:!1,finalFocus:!1,"data-select-panel":!0,...E,[ko]:L,[ns]:J,[as]:be,onKeyDown:V=>{V.key!=="Escape"||V.defaultPrevented||Qn(V)||(V.preventDefault(),V.stopPropagation(),pt(),fe.current?.focus())},className:"kiki-action-sheet flex flex-col overflow-hidden",children:Dr()})]})})}):p.jsx(Xk,{open:!0,modal:!1,onOpenChange:(V,Ee)=>{oU(V,Ee,{surfaceOwnerId:L,triggerEl:fe.current,panelEl:Le.current,rootEl:Be.current,onDismiss:Ue=>{pt(),Ue&&fe.current?.focus()}})},children:p.jsx(Zk,{children:p.jsx(nT,{anchor:fe,side:v==="above"?"top":"bottom",align:k,sideOffset:cU,collisionPadding:Qg,positionMethod:"fixed",style:{zIndex:ae??Jn},children:p.jsx(iT,{ref:V=>{if(Le.current=V,V!==null&&!ue&&!Ce.current&&(!oa()||ge)){const Ee=Re.current??V.querySelector('[role="listbox"]');Ee!==null&&(Ce.current=!0,document.activeElement!==Ee&&Ee.focus())}},role:"presentation",initialFocus:()=>!ue&&(!oa()||ge)?Re.current??!1:!1,finalFocus:!1,"data-select-panel":!0,...E,[ko]:L,[ns]:J,[as]:be,onKeyDown:V=>{V.key!=="Escape"||V.defaultPrevented||Qn(V)||(V.preventDefault(),V.stopPropagation(),pt(),fe.current?.focus())},className:y!==void 0?`anim-enter flex flex-col overflow-hidden outline-none ${$d} ${y}`:`anim-enter flex flex-col overflow-hidden outline-none ${$d}`,style:y!==void 0?{zIndex:ae??Jn}:{width:`min(max(var(--anchor-width, ${Zg}px), ${Zg}px), calc(100vw - ${Qg*2}px))`,maxHeight:`min(var(--available-height, ${_a}px), ${_a}px)`,zIndex:ae??Jn},children:Dr()})})})}):null]})}function mU({id:e,index:t,option:n,active:r,selected:i,multiple:s,ariaSetSize:o,ariaPosInSet:a,onCommit:u,onHover:l}){const c=(n.badges??[]).filter(m=>m.accent===!0),d=(n.badges??[]).filter(m=>m.accent!==!0),f=n.hint!==void 0||d.length>0,h=[n.title??n.label,n.description].filter(m=>m!==void 0&&m!=="").join(`
187
+ `);return p.jsxs("button",{type:"button",id:e,"data-index":t,"data-option-density":"compact","data-option-value":n.value,...n.dataAttrs,role:"option","aria-selected":i,"aria-disabled":n.disabled?!0:void 0,"aria-setsize":o,"aria-posinset":a,disabled:n.disabled,title:h,onClick:u,onMouseMove:l,className:`flex w-full min-w-0 flex-col justify-center gap-px rounded-md px-3 text-left transition-colors duration-[var(--kiki-motion-quick)] disabled:cursor-not-allowed ${f?"min-h-10 py-1 pointer-coarse:min-h-12":"h-8 pointer-coarse:h-10"} ${i&&!s?"bg-paper shadow-[var(--kiki-sheet-shadow)]":i&&s?"bg-ink/[0.05]":r?"bg-ink/[0.04]":""}`,children:[p.jsxs("span",{className:"flex w-full min-w-0 items-center gap-2",children:[s?p.jsx("span",{"aria-hidden":!0,className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border ${i?"border-ink bg-ink text-paper":"border-hairline-strong bg-paper text-transparent"}`,children:p.jsx(Je,{name:"check",size:12})}):null,p.jsx("span",{"data-option-label":!0,className:`min-w-0 flex-1 truncate text-[13px] leading-[18px] ${n.disabled?"text-ink-faint":"text-ink"} ${i?"font-medium":""}`,children:n.label}),c.map(m=>p.jsx("span",{className:"shrink-0 text-[11.5px] font-medium text-accent-ink",children:m.label},m.label)),s?null:p.jsx(Je,{name:"check",size:12,className:`shrink-0 ${i?"text-ink-soft":"text-transparent"}`})]}),f?p.jsxs("span",{"data-option-meta":!0,className:`flex w-full min-w-0 items-center gap-2 text-[11.5px] leading-4 text-ink-faint ${s?"pl-6":""}`,children:[n.hint!==void 0?p.jsx("span",{className:"min-w-0 truncate font-mono text-[11px]",children:n.hint}):null,d.length>0?p.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1.5 whitespace-nowrap tabular-nums",children:d.map((m,x)=>p.jsxs("span",{className:"flex items-center gap-1.5",children:[x>0?p.jsx("span",{"aria-hidden":!0,children:"·"}):null,p.jsx("span",{"data-option-fact":m.tone??"plain",className:m.tone==="caution"?"text-amber-ink":void 0,children:m.label})]},m.label))}):null]}):null]})}function No(e){if(!Ub())return p.jsx(gU,{...e});const{entries:n,onClose:r,ariaLabel:i,overlayId:s,dataAttribute:o,itemDataAttribute:a="data-menu-item",modalOwnerId:u,autofocus:l=!0}=e;return p.jsx(HI,{ariaLabel:i,overlayId:s,onClose:r,dataAttribute:o,modalOwnerId:u,autofocus:l,children:yT(n,r,a)})}function yT(e,t,n){return e.map((r,i)=>"separator"in r?p.jsx("div",{className:"mx-1 my-1 border-t border-hairline"},`sep-${i}`):p.jsx("button",{type:"button",role:"menuitem",[n]:r.key,disabled:r.disabled,className:`w-full rounded-md px-3 py-1.5 text-left text-[12px] transition-colors hover:bg-paper focus-visible:bg-paper disabled:pointer-events-none disabled:opacity-45 ${r.danger===!0?"text-ink hover:text-danger":"text-ink"}`,onClick:()=>{t(),Lf(r.label,r.run)},children:r.label},r.key))}function gU({x:e,y:t,entries:n,onClose:r,ariaLabel:i,overlayId:s,dataAttribute:o,itemDataAttribute:a="data-menu-item",modalOwnerId:u,autofocus:l=!0}){const c=b.useRef(null),d=b.useRef(!1),f=b.useRef(null),[h]=b.useState(()=>u??Mf(typeof document<"u"?document.activeElement:null)??Yx()),m=u??h,x=yS(e,t),E=b.useMemo(()=>({getBoundingClientRect:()=>({x:x.x,y:x.y,top:x.y,left:x.x,bottom:x.y,right:x.x,width:0,height:0,toJSON:()=>({})})}),[x.x,x.y]);b.useLayoutEffect(()=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null},[]);const y=()=>{const T=f.current;T===null||T===document.body||!T.isConnected||T.focus()},v=b.useRef(r);v.current=r,b.useEffect(()=>{const T=Gu(s),w=A=>{if(A.key!=="Escape"||A.defaultPrevented)return;A.preventDefault();const O=c.current?.contains(document.activeElement)===!0;v.current(),O&&y()},I=A=>{(!(A.target instanceof HTMLElement)||A.target.closest(`[${o}]`)===null)&&v.current()};return window.addEventListener("keydown",w),window.addEventListener("pointerdown",I,!0),()=>{T(),window.removeEventListener("keydown",w),window.removeEventListener("pointerdown",I,!0)}},[s,o]);const k={[o]:!0},S=Df(null);return p.jsx(Xk,{open:!0,modal:!1,onOpenChange:(T,w)=>{if(!T){if(w.reason==="escape-key"){const I=c.current?.contains(document.activeElement)===!0;v.current(),I&&y();return}w.cancel()}},children:p.jsx(Zk,{children:p.jsx(nT,{anchor:E,side:"bottom",align:"start",sideOffset:0,collisionPadding:8,positionMethod:"fixed",style:{zIndex:S},children:p.jsx(iT,{ref:T=>{c.current=T,l&&T!==null&&!d.current&&!T.contains(document.activeElement)&&(d.current=!0,T.querySelector("button:not([disabled])")?.focus())},initialFocus:l,finalFocus:!1,style:{zIndex:S},...k,"data-modal-escape":m,role:"menu","aria-label":i,onKeyDown:T=>{if(T.key!=="ArrowDown"&&T.key!=="ArrowUp"&&T.key!=="Home"&&T.key!=="End")return;const w=[...c.current?.querySelectorAll("button:not([disabled])")??[]];if(w.length===0)return;T.preventDefault();const I=w.indexOf(document.activeElement),A=T.key==="Home"?0:T.key==="End"?w.length-1:T.key==="ArrowDown"?(I+1)%w.length:(I-1+w.length)%w.length;w[A]?.focus()},onClick:T=>{if(!(T.target instanceof HTMLElement)||T.target.closest('[role="menuitem"]')===null)return;const w=c.current;queueMicrotask(()=>{if(w===null||w.isConnected)return;const I=document.activeElement;I!==null&&I!==document.body&&I instanceof HTMLElement&&I.isConnected||y()})},className:`anim-enter max-h-[min(var(--available-height,calc(100dvh-16px)),calc(100dvh-16px))] w-52 overflow-y-auto overscroll-contain p-1 outline-none ${$d}`,children:yT(n,r,a)})})})})}const ET=b.createContext(null);function jV({children:e,...t}){return b.createElement(ET.Provider,{value:t},e)}function vT(){return b.useContext(ET)}const bU=b.createContext(null);function wn(){return b.useContext(bU)}function kT(e,t,n=1){return e===void 0?void 0:JSON.stringify([e,n,t])}function TT(e,t){if(e.blobHash!==void 0)return`${t}:blob:${e.blobHash}`;if(e.fileId!==void 0)return`${t}:file:${e.fileId}`;if(e.path!==void 0)return`${t}:path:${e.path}`;if(e.url!==void 0)return`${t}:url:${e.url}`}function Tu(e,t){const r=(e.kind==="image"||e.mime?.startsWith("image/")===!0)&&e.kind!=="image"?{...e,kind:"image"}:e;return r.blobHash===void 0?r:{...r,path:void 0,fileId:r.fileId??`blobref:${t}:${r.blobHash}`}}function BV(e,t){return e.flatMap((n,r)=>!("media"in n)||n.media===void 0?[]:n.media.flatMap((i,s)=>{if(!(i.kind==="image"||i.mime?.startsWith("image/")===!0)||i.detail!==void 0)return[];const a=TT(i,t);return a===void 0?[]:[{id:a,agentId:t,order:[r,1,s],occurrenceId:kT(n.id,s),blockId:n.id,item:Tu(i,t)}]}))}function HV(e,t){const n=e.filter(i=>i.agentId===t).sort((i,s)=>{for(let o=0;o<Math.max(i.order.length,s.order.length);o+=1){const a=(i.order[o]??0)-(s.order[o]??0);if(a!==0)return a}return i.id.localeCompare(s.id)}),r=new Set;return n.filter(({id:i,occurrenceId:s})=>{const o=s??i;return r.has(o)?!1:(r.add(o),!0)})}function eb(e){if(e!==void 0)try{return new URL(e,document.baseURI)}catch{return}}function xU(e,t){const n=eb(e);return n===void 0||n.protocol!=="http:"&&n.protocol!=="https:"||n.origin===window.location.origin||n.origin===eb(t)?.origin&&!n.pathname.includes("..")&&/^\/(?:api\/sessions\/[A-Za-z0-9._~%-]+\/media\/[A-Za-z0-9._~%-]+(?:\/preview)?|api\/fs:content|media-preview\/[A-Za-z0-9._~%-]+|html-preview\/[A-Za-z0-9._~%-]+\/[^?#]+)$/u.test(n.pathname)?void 0:n}function wT({source:e,alt:t,children:n}){const r=Vt()?.client,{t:i}=je(),[s,o]=b.useState(),a=xU(e,r?.baseUrl);if(a===void 0||s===e)return n;const u=t?.trim();return p.jsxs("button",{type:"button","data-markdown-remote-image":"",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(e)},className:"inline-flex max-w-full items-center gap-2 rounded-lg border border-hairline bg-panel px-2.5 py-1 align-middle font-sans text-[12px] text-ink-faint transition-colors hover:border-hairline-strong hover:text-ink focus-visible:outline-2 focus-visible:outline-selected-ink",children:[p.jsxs("span",{className:"min-w-0 truncate",children:[u?`${u} · `:"",a.host]}),p.jsx("span",{className:"shrink-0 font-medium text-ink",children:i("media.showImage")})]})}const yU={};function EU(){const t=yU?.VITE_KIKI_REMOTE_MEDIA_PLAYBACK;if(typeof t!="string")return!0;const n=t.trim().toLowerCase();return!(n==="false"||n==="0")}function vU(e){if(typeof e!="object"||e===null)return!1;const{code:t,reason:n,message:r}=e;return t===404||t===405||t===501||n==="media_preview_requires_local_connection"||t===40301&&r==="media_preview_requires_local_connection"}let zd=new WeakMap;function kU(e){let t=zd.get(e);return t===void 0&&(t=new Map,zd.set(e,t)),t}function ST(e,t){return`${e}\0${t}`}function Gs(e){for(const t of Array.from(e.listeners))t()}function qd(e){if(e.expiryTimer!==void 0&&(clearTimeout(e.expiryTimer),e.expiryTimer=void 0),e.previewId===void 0||e.released)return;e.released=!0;const t=e.previewId,n=e.client.klient.rest?.sessions;n!==void 0&&typeof n.closeMediaPlayback=="function"&&n.closeMediaPlayback(t,{timeoutMs:1e4}).catch(()=>{})}function Wd(e,t){qd(e),e.status="failed",e.url=void 0,e.mime=void 0,e.expiresAt=void 0,e.failedAtAttempt=t,Gs(e)}function _T(e){return e!==void 0&&e.status==="ready"&&e.url!==void 0&&e.mime!==void 0&&(e.expiresAt===void 0||e.expiresAt>Date.now())}function TU(e,t,n,r){const i=kU(e),s=ST(t,n),o=i.get(s);if(o!==void 0){if(_T(o)||o.status==="loading"||o.status==="fallback"||o.status==="failed"&&o.failedAtAttempt===r)return o;qd(o)}const a=e.klient.rest?.sessions,u={key:s,client:e,sessionId:t,fileId:n,status:"loading",released:!1,listeners:o?.listeners??new Set};if(i.set(s,u),a===void 0||typeof a.openMediaPlayback!="function")return u.status="fallback",Gs(u),u;const l=new AbortController,c=a.openMediaPlayback(t,n,{signal:l.signal,timeoutMs:15e3});return c===void 0||typeof c.then!="function"?(u.status="fallback",Gs(u),u):(c.then(d=>{if(i.get(s)!==u){typeof a.closeMediaPlayback=="function"&&a.closeMediaPlayback(d.preview_id,{timeoutMs:1e4}).catch(()=>{});return}u.previewId=d.preview_id;const f=d.expires_at-Date.now();if(f<=0){Wd(u,r);return}const h=e.baseUrl||globalThis.location.origin;u.url=new URL(d.url,`${h.replace(/\/+$/u,"")}/`).toString(),u.mime=d.mime,u.expiresAt=d.expires_at,u.status="ready",u.expiryTimer=setTimeout(()=>{i.get(s)===u&&(i.delete(s),Wd(u,r))},f),Gs(u)}).catch(d=>{i.get(s)===u&&(qd(u),u.status=vU(d)?"fallback":"failed",u.status==="failed"&&(u.failedAtAttempt=r),Gs(u))}),u)}function wU(e,t){return e===void 0?{status:"loading"}:_T(e)?{status:"ready",url:e.url,mime:e.mime,fail:()=>{Wd(e,t)}}:e.status==="fallback"?{status:"fallback"}:e.status==="failed"&&e.failedAtAttempt===t?{status:"failed"}:{status:"loading"}}function SU(e,t,n,r,i){const s=r&&!EU(),o=e.path===void 0&&e.fileId!==void 0&&t!==void 0&&(e.kind==="video"||e.kind==="audio"||/^(?:video|audio)\//i.test(e.mime??"")),a=e.fileId,u=b.useRef(void 0),[,l]=b.useState(0);if(b.useEffect(()=>{if(!o||s||n===void 0||t===void 0||a===void 0){u.current=void 0;return}const f=TU(n,t,a,i);u.current=f;const h=()=>{l(m=>m+1)};return f.listeners.add(h),h(),()=>{f.listeners.delete(h)}},[o,s,n,t,a,i]),!o||s||t===void 0||a===void 0)return{status:"fallback"};if(n===void 0)return{status:"loading"};const c=ST(t,a),d=zd.get(n)?.get(c)??(u.current?.key===c&&u.current.client===n?u.current:void 0);return wU(d,i)}let Vd=new WeakMap;function _U(e){let t=Vd.get(e);return t===void 0&&(t=new Map,Vd.set(e,t)),t}function tb(e){e.expiryTimer!==void 0&&(clearTimeout(e.expiryTimer),e.expiryTimer=void 0),!(e.previewId===void 0||e.released)&&(e.released=!0,typeof e.client.closeHostMediaPreview=="function"&&e.client.closeHostMediaPreview(e.previewId).catch(()=>{}))}function nb(e){return e!==void 0&&e.status==="ready"&&e.url!==void 0&&(e.expiresAt===void 0||e.expiresAt>Date.now())}function CU(e,t,n,r){const[,i]=b.useState(0),s=n&&e!==void 0&&t!==void 0&&typeof e.openHostMediaPreview=="function";if(b.useEffect(()=>{if(!s||e===void 0||t===void 0)return;const a=_U(e);let u=a.get(t);const l=()=>{i(c=>c+1)};if(u===void 0||!nb(u)&&u.status!=="loading"&&u.failedAtAttempt!==r){u!==void 0&&tb(u);const c={path:t,client:e,status:"loading",released:!1,listeners:u?.listeners??new Set};a.set(t,c),u=c;const d=new AbortController;e.openHostMediaPreview({path:t},{signal:d.signal}).then(f=>{if(a.get(t)!==c){e.closeHostMediaPreview(f.preview_id).catch(()=>{});return}c.previewId=f.preview_id,c.url=f.url,c.expiresAt=f.expires_at,c.status="ready";const h=f.expires_at-Date.now();h>0&&(c.expiryTimer=setTimeout(()=>{if(a.get(t)===c){tb(c),a.delete(t);for(const m of Array.from(c.listeners))m()}},h));for(const m of Array.from(c.listeners))m()}).catch(()=>{if(a.get(t)===c){c.status="fallback",c.failedAtAttempt=r;for(const f of Array.from(c.listeners))f()}})}return u.listeners.add(l),l(),()=>{u?.listeners.delete(l)}},[s,e,t,r]),!n)return{status:"idle"};if(!s||e===void 0||t===void 0)return{status:"fallback"};const o=Vd.get(e)?.get(t);return nb(o)?{status:"ready",url:o.url}:o?.status==="fallback"&&o.failedAtAttempt===r?{status:"fallback"}:{status:"loading"}}const Or=b.createContext(null),Hh=[],AU=()=>()=>{},IU=()=>0;function UV({controller:e,load:t,loads:n,contentRefs:r,sessionId:i,agentId:s,loadContent:o,loadEntities:a,children:u}){const l=b.useMemo(()=>i===void 0||s===void 0?void 0:{sessionId:i,agentId:s},[i,s]),c=b.useSyncExternalStore(e?.subscribeContent??AU,e?.getContentRevision??IU),d=b.useMemo(()=>({controller:e,load:t,loads:n,contentRefs:r??Hh,contentRevision:c,session:l,loadContent:o,loadEntities:a}),[e,t,n,r,c,l,o,a]);return p.jsx(Or.Provider,{value:d,children:u})}function Uh(){return b.useContext(Or)?.session}function NU(e){const t=b.useContext(Or),n=e?.agentId,r=e?.kind,i=e?.id,s=b.useCallback(()=>{t===null||n===void 0||r===void 0||i===void 0||t.load(n,r,i)},[t,n,r,i]);if(t===null||r===void 0||i===void 0)return{request:void 0,status:void 0};const o=zw(r,i),a=t.controller!==void 0&&n!==void 0&&n!==t.session?.agentId?t.controller.getAgentState(n).detailLoads:t.loads;return{request:s,status:a[o]}}function CT(e){return`content:${JSON.stringify(e)}`}function AT(e){const t=b.useContext(Or),n=t?.controller!==void 0||t?.loadContent!==void 0,r=b.useCallback(s=>t?.loads[CT(s)],[t]),i=b.useCallback(s=>{t?.loadContent?.(s)},[t]);return{canRequest:n,pending:e,statusOf:r,request:i}}function IT(e,t,n,r){const i=b.useContext(Or),s=e?.kind,o=e?.id,a=e?.turnId,u=e?.stepId,l=b.useMemo(()=>{if(i===null||s===void 0||o===void 0)return Hh;const f=n??i.session?.agentId;return(i.controller!==void 0&&f!==void 0?i.controller.contentRefsFor(f,{kind:s,id:o,turnId:a,stepId:u}):i.contentRefs).filter(m=>m.source.kind===s&&m.source.id===o&&m.source.turnId===a&&m.source.stepId===u&&m.path.length>0&&t.includes(String(m.path[0]))&&(r===void 0||r.some(x=>x.length===1&&s==="turn"&&x[0]==="steps"?m.path.length===1&&m.path[0]==="steps":x.every((E,y)=>m.path[y]===E)))&&(m.path[0]!=="steps"||m.path.length===1||m.path.length===3&&m.path[2]==="frames"))},[i,s,o,a,u,t,n,r]),c=AT(l),d=b.useCallback(f=>{const h=n??i?.session?.agentId;return i?.controller!==void 0&&h!==void 0&&h!==i.session?.agentId?i.controller.getAgentState(h).detailLoads[CT(f)]:c.statusOf(f)},[i,n,c]);return{...c,statusOf:d}}const NT=[["session","title"],["session","cwd"],["session","metadata","cwd"],["session","worktree"],["session","agent_config"],["session","delivery"]];function RT(e){return e.path.length===1&&e.path[0]==="subagents"?e.kind==="array":NT.some(t=>t.every((n,r)=>String(e.path[r])===n))}function $V(e){return e.source.kind==="roster"||e.source.kind==="snapshot"&&RT(e)}function zV(){const e=b.useContext(Or),t=b.useMemo(()=>e===null?Hh:e.contentRefs.filter(n=>n.source.kind==="roster"||n.source.kind==="snapshot"&&RT(n)),[e]);return AT(t)}function qV(e,t){const n=b.useRef(void 0);return b.useEffect(()=>{if(e===void 0||!t)return;const r=e.beginContentRead("main",{kind:"snapshot",id:""},["session"],!0,NT);return n.current=r,()=>{r.release(),n.current=void 0}},[e,t]),b.useCallback(()=>{n.current?.retry()},[])}function $h(){return b.useContext(Or)?.controller}function RU(e,t,n,r){const i=b.useContext(Or),s=b.useRef(void 0),o=JSON.stringify(e),a=JSON.stringify(t),u=r===void 0?void 0:JSON.stringify(r),l=i?.controller,c=n??i?.session?.agentId;return b.useEffect(()=>{if(l===void 0||o===void 0||c===void 0)return;const d=u===void 0?void 0:JSON.parse(u),f=d===void 0?l.beginContentRead(c,JSON.parse(o),JSON.parse(a)):l.beginContentRead(c,JSON.parse(o),JSON.parse(a),!0,d);return s.current=f,()=>{f.release(),s.current=void 0}},[l,o,a,u,c]),b.useCallback(()=>{s.current?.retry()},[])}const OU=2,Si=new Map,Ba=new Set;function LU(e,t){for(Si.delete(e),Si.set(e,t);Si.size>OU;){const n=Si.entries().next().value;if(n===void 0)break;const[r,i]=n;if(r===e)break;Si.delete(r),i()}return()=>{Si.delete(e)}}function OT(e){for(const t of Array.from(Ba))if(t!==e&&(Ba.delete(t),!!t.isConnected))try{!t.paused&&!t.ended&&t.pause()}catch{}Ba.add(e)}function Ro(e){e!=null&&Ba.delete(e)}function LT(e){if(e!==null)return()=>{Ro(e)}}const PU={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"0.6.0",VITE_BUILD_SHA:"",VITE_UPDATE_CHANNEL:"stable"},PT=b.createContext(null);function WV({sessionId:e,draftKey:t,children:n}){const r=b.useMemo(()=>({sessionId:e,draftKey:t}),[e,t]);return p.jsx(PT.Provider,{value:r,children:n})}function zh(e,t){const n=b.useContext(PT),r=Vt(),i=e??n?.sessionId;if(t!==void 0&&i!==void 0&&i!=="")return d1(r?.scopeId,i,t);if(n?.draftKey!==void 0&&n.sessionId===i)return n.draftKey;const s=typeof window<"u"?window.location.pathname:void 0;return g_(r?.scopeId,i,s)}function MT(e,t=0,n,r){const i=wn(),s=vT(),o=s?.agentId??n??"main",a=TT(e,o),u=kT(s?.blockId,r??t,r===void 0?1:0),l=i?.registerGalleryImage;return b.useEffect(()=>{e.kind!=="image"||a===void 0||e.detail!==void 0||l===void 0||l({id:a,agentId:o,order:[s?.order??0,r===void 0?1:0,r??t],occurrenceId:u,blockId:s?.blockId,item:Tu(e,o)})},[l,a,o,s?.order,t,r,u,e]),c=>{const d=Tu(e,o);i?.openGalleryImage!==void 0?i.openGalleryImage(d,o,c,u):c!==void 0||e.url!==void 0?i?.openImage(c??e.url,Sr({name:e.name,path:e.path})):i?.openAttachment(e,o)}}const _i={loopbackConcurrency:4,remoteConcurrency:3,inlineFallbackMaxBytes:4*1024*1024,cacheMaxEntries:256,cacheMaxBytes:32*1024*1024,cacheMaxItemBytes:16*1024*1024};let zr={};function Us(e,t=1,n=Number.MAX_SAFE_INTEGER){const i=PU?.[e];if(typeof i!="string"||i.trim()==="")return;const s=Number.parseInt(i,10);if(!(!Number.isFinite(s)||s<t))return Math.min(n,s)}function qh(){const e=Us("VITE_KIKI_MEDIA_FETCH_CONCURRENCY",1,16);return{loopbackConcurrency:zr.loopbackConcurrency??_i.loopbackConcurrency,remoteConcurrency:zr.remoteConcurrency??_i.remoteConcurrency,concurrencyOverride:zr.concurrencyOverride??e,inlineFallbackMaxBytes:zr.inlineFallbackMaxBytes??Us("VITE_KIKI_MEDIA_INLINE_FALLBACK_MAX_BYTES",0,256*1024*1024)??_i.inlineFallbackMaxBytes,cacheMaxEntries:zr.cacheMaxEntries??Us("VITE_KIKI_MEDIA_CACHE_MAX_ENTRIES",1,4096)??_i.cacheMaxEntries,cacheMaxBytes:zr.cacheMaxBytes??Us("VITE_KIKI_MEDIA_CACHE_MAX_BYTES",64*1024,512*1024*1024)??_i.cacheMaxBytes,cacheMaxItemBytes:zr.cacheMaxItemBytes??Us("VITE_KIKI_MEDIA_CACHE_MAX_ITEM_BYTES",64*1024,256*1024*1024)??_i.cacheMaxItemBytes}}class MU{active=0;interactiveWaiters=[];previewWaiters=[];resolveLimit;constructor(t){this.resolveLimit=typeof t=="function"?t:()=>t}limit(){return Math.max(1,this.resolveLimit())}pump(){const t=this.limit();for(;this.active<t;){const n=this.interactiveWaiters.pop()??this.previewWaiters.pop();if(n===void 0)break;n.enter()}}schedule(t,n,r){if(t.aborted)return Promise.reject(t.reason??new DOMException("Media fetch cancelled","AbortError"));const i=async()=>{this.active+=1;try{return t.throwIfAborted(),await r()}finally{this.active-=1,this.pump()}};if(this.active<this.limit())return i();const s=n==="interactive"?this.interactiveWaiters:this.previewWaiters;return new Promise((o,a)=>{let u=!1;const l={enter:()=>{u||(u=!0,t.removeEventListener("abort",l.cancel),o(i()))},cancel:()=>{if(u)return;u=!0;const c=s.indexOf(l);c>=0&&s.splice(c,1),t.removeEventListener("abort",l.cancel),a(t.reason??new DOMException("Media fetch cancelled","AbortError"))}};s.push(l),t.addEventListener("abort",l.cancel,{once:!0})})}}const rb=new WeakMap;function DU(e){return e==null?!1:ys(e)?!0:e.connectionSource===void 0&&e.scopeId==="local"}function FU(e,t){let n=rb.get(e);return n===void 0&&(n=new MU(()=>{const r=qh();return r.concurrencyOverride??(t?r.loopbackConcurrency:r.remoteConcurrency)}),rb.set(e,n)),n}function jU(e){return typeof e=="object"&&e!==null&&e.ownsMediaFetchLane===!0}class BU{entries=new Map;totalBytes=0;get(t){const n=this.entries.get(t);if(n!==void 0)return this.entries.delete(t),this.entries.set(t,n),n}set(t,n){const r=qh();if(n.bytes.byteLength===0||n.bytes.byteLength>r.cacheMaxItemBytes)return;const i=this.entries.get(t);for(i!==void 0&&(this.entries.delete(t),this.totalBytes-=i.bytes.byteLength),this.entries.set(t,n),this.totalBytes+=n.bytes.byteLength;this.entries.size>r.cacheMaxEntries||this.totalBytes>r.cacheMaxBytes;){const s=this.entries.keys().next().value;if(s===void 0)break;this.totalBytes-=this.entries.get(s).bytes.byteLength,this.entries.delete(s)}}}const Kd=new WeakMap;function DT(e,t,n,r,i,s){if(t!==void 0&&n!==void 0)return`${e}\0session\0${t}\0${n}\0${i?"preview":"full"}\0${i?s??"":""}`;if(r!==void 0)return`${e}\0host\0${r}\0${i?"preview":"full"}\0${i?s??"":""}`}function FT(e){if(e==null||typeof e!="object")return!1;const t=e;return typeof t.peekSessionMediaPreviewBytes=="function"&&typeof t.peekHostMediaPreviewBytes=="function"}function jT(e,t,n,r){if(e===void 0)return;if(r.previewOnly&&FT(e)){const s=r.sessionId!==void 0&&r.fileId!==void 0?e.peekSessionMediaPreviewBytes(r.sessionId,r.fileId,r.mime):r.hostPath!==void 0?e.peekHostMediaPreviewBytes(r.hostPath,r.mime):void 0;if(s!==void 0)return s}if(n===void 0)return;const i=e;if(typeof i.peekUiMediaCache=="function")return i.peekUiMediaCache(n);if(t!==void 0)return Kd.get(t)?.get(n)}function HU(e,t,n,r,i){if(n===void 0||e===void 0||i)return;const s=e;if(typeof s.storeUiMediaCache=="function"){s.storeUiMediaCache(n,r);return}if(t===void 0)return;let o=Kd.get(t);o===void 0&&(o=new BU,Kd.set(t,o)),o.set(n,r)}function UU(e,t,n,r,i,s,o){const a=DT(n,r,i,s,!0,o);return jT(e,t,a,{previewOnly:!0,sessionId:r,fileId:i,hostPath:s,mime:o})}function kc(e,t,n,r){const i=t==="application/octet-stream"?n??t:t;return r==="image"||i.startsWith("image/")?qk(e,i)??i:i}function $U(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}const ib=[250,750,1750];function zU(e){return e instanceof rf?e.code===Ni.SESSION_BUSY||e.code===503||e.code===40923:e instanceof Error&&/\b(?:SESSION_BUSY|HTTP 503|history_canonical_preparing)\b/i.test(e.message)}function Tc(e){return e instanceof rf&&(e.code===Ni.REQUEST_INVALID||e.code===413||e.code===415||e.reason==="preview_budget_exceeded")||e instanceof Error&&/exceeds its byte budget|preview_budget_exceeded|HTTP 413|HTTP 415/i.test(e.message)}function BT(e,t=!1,n){if(e instanceof rf){const i=e.code,s=e.reason;if(i===Ni.SESSION_NOT_FOUND||i===404||i===410||i===40404||i===40407||i===40409||i===40402||s==="media_preview_not_found"||s==="file_not_found")return"missing";if(i===415)return"decode";if(i===413||s==="preview_budget_exceeded"||t&&i===Ni.REQUEST_INVALID)return"preview_unavailable";if(i===Ni.SESSION_BUSY||i===503||i===40923||i===Ni.TIMEOUT||i===-1||i>=500&&i<600)return"transient"}if(typeof e=="object"&&e!==null&&!(e instanceof Error)){const i=e,s=typeof i.code=="number"?i.code:typeof i.status=="number"?i.status:void 0;if(s===404||s===410||s===40407||s===40409||s===40402||i.reason==="media_preview_not_found")return"missing";if(s===415)return"decode";if(s===413||i.reason==="preview_budget_exceeded")return"preview_unavailable";if(s===503||s===40923||s!==void 0&&s>=500&&s<600)return"transient"}const r=e instanceof Error?e.message:typeof e=="string"?e:typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:"";return/\b(?:ENOENT|ENOTDIR|FILE_NOT_FOUND|SESSION_NOT_FOUND|HTTP 404|HTTP 410|40407|40409|40402|not found|no longer available)\b/i.test(r)?"missing":/\b(?:MEDIA_ERR_DECODE|HTTP 415|unsupported media|decode)\b/i.test(r)?"decode":/\b(?:HTTP 413|preview_budget_exceeded|exceeds its byte budget|preview unavailable|preview_unavailable)\b/i.test(r)?"preview_unavailable":"transient"}function Wh(e,t,n=!0,r=!0,i=0){const s=Vt(),o=s?.client,a=DU(s),u=s?.scopeId??"",l=o?.baseUrl??"",c=`${u}\0${l}`,d=wn(),f=d?.registerGalleryImage,h=e.path===void 0?void 0:Bn(e.path,d?.cwd),m=b.useMemo(()=>({client:o,scopeKey:c,sessionId:t,fileId:e.fileId,path:h,attempt:i}),[o,c,t,e.fileId,h,e.mime,e.kind,e.blobHash,r,i]),[x,E]=b.useState({source:m,load:{status:"loading"}}),y=b.useCallback(k=>{E({source:m,load:k})},[m]),v=x.source===m?x.load:{status:"loading"};return b.useLayoutEffect(()=>{if(!n){y({status:"loading"});return}const k=t!==void 0&&e.fileId!==void 0;if(o===void 0||!k&&h===void 0||r&&e.kind!=="image"&&e.kind!=="video"){y({status:"failed",failureKind:!k&&h===void 0?"missing":"transient"});return}const S=DT(c,t,e.fileId,h,r,e.mime);let T,w;const I=()=>{w!==void 0&&(URL.revokeObjectURL(w),w=void 0)},A=()=>{T!==void 0&&(URL.revokeObjectURL(T),T=void 0)},O=i===0?jT(o,f,S,{previewOnly:r,sessionId:t,fileId:e.fileId,hostPath:h,mime:e.mime}):void 0;if(O!==void 0){const se=kc(O.bytes,O.mime,e.mime,e.kind);if(T=URL.createObjectURL(new Blob([O.bytes],{type:se})),y({status:"ready",bytes:O.bytes,mime:se,name:O.name,url:T}),k)return()=>{A()}}else if(i===0&&!r&&e.kind==="image"){const se=UU(o,f,c,t,e.fileId,h,e.mime);if(se!==void 0&&se.bytes.byteLength>0){const xe=kc(se.bytes,se.mime==="application/octet-stream"?e.mime??"image/jpeg":se.mime,e.mime,e.kind);w=URL.createObjectURL(new Blob([se.bytes],{type:xe}))}}const _=new AbortController;O===void 0&&y(w===void 0?{status:"loading"}:{status:"loading",thumbnailUrl:w});const D={...o.readingOptions(),signal:_.signal,mediaType:e.mime},U=qh(),F=r&&e.kind==="image"&&a&&(e.size===void 0||e.size<=U.inlineFallbackMaxBytes);let R=r&&FT(o);const j=()=>(r?o.readSessionMediaPreviewBytes(t,e.fileId,D):o.readSessionMediaBytes(t,e.fileId,D)).catch(xe=>{if(!F||_.signal.aborted||!Tc(xe))throw xe;return R=!1,o.readSessionMediaBytes(t,e.fileId,D)}),B=()=>(r?o.readHostMediaPreviewBytes(h,D):o.readHostFileBytes(h,O?.etag===void 0?D:{...D,ifNoneMatch:O.etag})).catch(xe=>{if(!F||_.signal.aborted||!Tc(xe))throw xe;return R=!1,o.readHostFileBytes(h,O?.etag===void 0?D:{...D,ifNoneMatch:O.etag})}),q=se=>!r||jU(o)?se():FU(o,a).schedule(_.signal,"preview",se);let $,X=0;const C=()=>{q(()=>k?j():B()).then(xe=>{if(_.signal.aborted)return;if(xe.notModified===!0&&O!==void 0&&T!==void 0){I();return}const{bytes:L,mime:G,name:re,etag:ne}=xe;if(L.byteLength===0){A(),y(w===void 0?{status:"failed",failureKind:"decode"}:{status:"failed",thumbnailUrl:w,failureKind:"decode"});return}const pe=kc(L,G,e.mime,e.kind);if(HU(o,f,S,{bytes:L,mime:pe,name:re,etag:ne},R&&ne!==void 0),O!==void 0&&T!==void 0&&(O.etag!==void 0&&ne===O.etag||ne===void 0&&pe===O.mime&&$U(L,O.bytes))){I();return}A(),T=URL.createObjectURL(new Blob([L],{type:pe})),I(),y({status:"ready",bytes:L,mime:pe,name:re,url:T})},xe=>{if(_.signal.aborted)return;if(zU(xe)&&X<ib.length){const re=ib[X];X+=1,$=setTimeout(()=>{$=void 0,_.signal.aborted||C()},re);return}A();const L=r&&e.kind==="video"&&Tc(xe),G=BT(xe,r,e.kind);y(w===void 0?{status:"failed",previewUnavailable:L,failureKind:G}:{status:"failed",thumbnailUrl:w,previewUnavailable:L,failureKind:G})})};return C(),()=>{$!==void 0&&clearTimeout($),_.abort(),I(),A()}},[i,o,n,a,r,f,c,e.blobHash,e.fileId,h,e.mime,e.kind,e.size,t,y]),v}function hl(){const[e,t]=b.useState(null),[n,r]=b.useState(()=>typeof IntersectionObserver>"u");return b.useEffect(()=>{if(n||e===null||typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{s.some(o=>o.isIntersecting)&&(r(!0),i.disconnect())},{rootMargin:"400px 0px"});return i.observe(e),()=>{i.disconnect()}},[e,n]),[t,n]}function na(e,t,n="attachment"){return Yk({name:e.name,metadataName:t,path:e.path},n)}function Vh(e,t,n){const{t:r}=je(),i=ci(),s=Vt(),o=s?.client,a=wn(),u=ys(s),[l,c]=b.useState(null),d=b.useCallback(k=>{k.preventDefault(),k.stopPropagation(),c({x:k.clientX,y:k.clientY})},[]),f=e.path??(e.origin?.trusted?e.origin.path:void 0),h=_B({name:e.name,path:f}),m=f===void 0?void 0:Uk(f,a?.cwd),x=b.useCallback(async()=>{try{await zk({url:e.url??t,path:m,fileId:e.fileId},h,i,o,a?.sessionId)}catch(k){kr({tone:"error",text:$k(k,r),detail:Ua(k)})}},[e.url,m,e.fileId,t,h,i,o,a?.sessionId,r]),E=b.useCallback(async()=>{if(t!==void 0)try{await pB(t)}catch(k){kr({tone:"error",text:hB(k,r,i.kind),detail:Ua(k)})}},[t,r,i.kind]),y=bB({t:r,src:t,path:f,cwd:a?.cwd,link:aB(e.url),localKikiComputer:u,revealPath:i.revealPath,openPath:i.openPath,canCopyImage:t!==void 0,canSave:!0,annotated:!1,onCopyImage:E,onSave:x}),v=l===null?null:p.jsx(No,{x:l.x,y:l.y,entries:y,onClose:()=>{c(null)},ariaLabel:n,overlayId:"message-image-menu",dataAttribute:"data-message-image-menu"});return{openMenu:d,menuElement:v}}function Ha({item:e,size:t="default",onOpen:n,onStripFailure:r}){const{t:i}=je(),s=wn(),[o,a]=hl(),[u,l]=b.useState(0),c=Wh(e,s?.sessionId,a,!0,u),[d,f]=b.useState(),h=b.useRef(!1),m=c.status==="ready"&&d===c.url,x=c.status==="failed"&&!(e.kind==="video"&&c.previewUnavailable===!0)||m,E=m?"decode":c.status==="failed"?c.failureKind??"transient":void 0;h.current=c.status==="failed"||m,Ph(Lh({sessionId:s?.sessionId,url:e.url,fileId:e.fileId,path:e.path}),()=>{h.current&&(f(void 0),l(O=>O+1))}),b.useEffect(()=>{t==="strip"&&x&&E!==void 0&&r?.(E)},[t,x,E,r]);const y=e.kind==="image"?i("media.image"):i("media.attachment"),v=na(e,c.status==="ready"?c.name:void 0,y),k=c.status==="ready"&&d!==c.url?c.url:void 0,S=Vh(e,k,v),T=e.path??e.origin?.path,w=()=>{n!==void 0?n():s?.openAttachment(e)},I=()=>{f(void 0),l(O=>O+1)};let A;if(e.kind==="video"&&c.status==="failed"&&c.previewUnavailable===!0)A=p.jsxs("button",{type:"button","data-media-video-placeholder":!0,title:v,"aria-label":v,onClick:w,onContextMenu:S.openMenu,className:`flex ${It[t].slot} flex-col items-center justify-center gap-1.5 ${It[t].frame} border border-hairline bg-panel px-2 text-[11px] text-ink-soft transition-colors hover:border-accent hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink`,children:[p.jsx("span",{"aria-hidden":!0,className:`flex items-center justify-center rounded-full bg-ink/10 ${t==="strip"?"h-5 w-5":"h-8 w-8"}`,children:p.jsx("span",{className:`ml-0.5 h-0 w-0 border-y-transparent border-l-ink ${t==="strip"?"border-y-[3.5px] border-l-[6px]":"border-y-[5px] border-l-[8px]"}`})}),t==="strip"?null:p.jsx("span",{className:"max-w-full truncate font-mono text-[11px]",children:v})]});else if(x){if(t==="strip")return null;A=p.jsx(ra,{name:v,decode:m,failureKind:E,size:t,title:T??v,onRetry:I,onOpen:w,onContextMenu:S.openMenu})}else c.status==="loading"?A=p.jsx("span",{"aria-busy":"true",className:`flex ${It[t].slot} items-center justify-center ${It[t].frame} ${t==="strip"?"animate-pulse bg-ink/[0.06] motion-reduce:animate-none":"text-[11px] text-ink-faint"}`,children:t==="strip"?null:i("preview.loading")}):c.status==="ready"?A=p.jsx("button",{type:"button",title:v,onClick:w,onContextMenu:S.openMenu,className:`block overflow-hidden ${It[t].frame} transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink`,children:p.jsx("img",{src:c.url,alt:v,referrerPolicy:"no-referrer",decoding:"async",onError:()=>{f(c.url)},className:`${It[t].img} object-cover`})}):A=null;return p.jsxs("span",{ref:o,className:"inline-flex",children:[A,S.menuElement]})}function ra({name:e,decode:t,failureKind:n,size:r="default",title:i,onRetry:s,onOpen:o,onContextMenu:a,retryDataAttr:u}){const{t:l,locale:c}=je();if(r==="strip")return null;const d=n??(t?"decode":"transient"),f=Yk({name:e},l("media.attachment")),h=d==="missing"?c==="zh"?"原文件已不在":"Original file unavailable":d==="decode"?c==="zh"?"无法预览":"Cannot preview":d==="preview_unavailable"?c==="zh"?"文件过大":"File too large":c==="zh"?"暂时无法加载":"Temporarily unavailable",m=i!==void 0&&i!==""?i:f,x="inline-flex h-7 max-w-full items-center gap-1.5 rounded-md border border-hairline bg-ink/[0.03] px-2.5 text-[12px] text-ink-soft",E=d==="decode"?"decode":"read";if(d==="missing")return p.jsxs("span",{"data-media-broken":E,"data-media-failure-kind":"missing",title:m,onContextMenu:a,className:x,children:[p.jsx(Je,{name:"file",size:12,className:"shrink-0 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono",children:f}),p.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-ink-faint",children:"·"}),p.jsx("span",{className:"shrink-0 text-ink-faint",children:h})]});const y=`${x} cursor-pointer transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink pointer-coarse:h-auto pointer-coarse:min-h-11`;if(d==="transient")return s===void 0?p.jsxs("span",{"data-media-broken":E,"data-media-failure-kind":"transient",title:m,onContextMenu:a,className:x,children:[p.jsx(Je,{name:"file",size:12,className:"shrink-0 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono",children:f}),p.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-ink-faint",children:"·"}),p.jsx("span",{className:"shrink-0 text-ink-faint",children:h})]}):p.jsxs("button",{type:"button","data-media-broken":E,"data-media-failure-kind":"transient","data-media-retry":!0,...u,title:m,"aria-label":`${f} · ${h} · ${l("transcript.detail.retry")}`,onClick:s,onContextMenu:a,className:y,children:[p.jsx(Je,{name:"file",size:12,className:"shrink-0 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono",children:f}),p.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-ink-faint",children:"·"}),p.jsx("span",{className:"shrink-0 text-ink-faint",children:h}),p.jsx(Je,{name:"refresh",size:12,className:"ml-0.5 shrink-0 text-ink-soft"})]});const v=o??s,k=d==="preview_unavailable"?c==="zh"?"打开原文件":"Open original":c==="zh"?"打开":"Open";return v===void 0?p.jsxs("span",{"data-media-broken":E,"data-media-failure-kind":d,title:m,onContextMenu:a,className:x,children:[p.jsx(Je,{name:"file",size:12,className:"shrink-0 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono",children:f}),p.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-ink-faint",children:"·"}),p.jsx("span",{className:"shrink-0 text-ink-faint",children:h})]}):p.jsxs("button",{type:"button","data-media-broken":E,"data-media-failure-kind":d,"data-media-open":!0,...u,title:m,onClick:v,onContextMenu:a,className:y,children:[p.jsx(Je,{name:"file",size:12,className:"shrink-0 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono",children:f}),p.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-ink-faint",children:"·"}),p.jsx("span",{className:"shrink-0 text-ink-faint",children:h}),p.jsx("span",{className:"ml-0.5 shrink-0 text-[11.5px] font-medium text-ink",children:k})]})}function sb({item:e}){const{t}=je(),n=wn(),r=Vt(),i=r?.client,s=ys(r),[o,a]=hl(),[u,l]=b.useState(0),c=e.path===void 0?void 0:Bn(e.path,n?.cwd),d=a&&e.url===void 0&&e.fileId===void 0&&c!==void 0&&s&&i!==void 0&&typeof i.openHostMediaPreview=="function",f=CU(i,c,d,u),h=a&&e.url===void 0?n?.sessionId:void 0,x=SU(e,h,i,i===void 0||!s,u),E=a&&e.url===void 0&&x.status==="fallback"&&(!d||f.status==="fallback"),y=Wh(e,n?.sessionId,E,!1,u),v=e.url??(x.status==="ready"?x.url:f.status==="ready"?f.url:y.status==="ready"?y.url:void 0),[k,S]=b.useState(null),T=`${n?.sessionId??""}\0${e.fileId??e.path??e.url??""}\0${u}`;v!==void 0&&(k?.key!==T||k.url!==v)&&S({key:T,url:v});const[w,I]=b.useState(null),A=w?.key===T?w.kind:void 0,O=A==="decode",_=A!==void 0?void 0:v??(x.status!=="failed"&&k?.key===T?k.url:void 0),D=_===void 0&&(A!==void 0||x.status==="failed"||E&&y.status==="failed"),U=A??(E&&y.status==="failed"?y.failureKind??"transient":"transient"),F=na(e,void 0,t("media.attachment")),R=HT(e,F),j=e.path??e.origin?.path;return p.jsxs("span",{ref:o,className:"inline-flex max-w-full",onContextMenu:R.openMenu,children:[_!==void 0?p.jsx("audio",{ref:LT,controls:!0,src:_,preload:"none",onPlay:B=>{OT(B.currentTarget)},onEnded:B=>{Ro(B.currentTarget)},onError:B=>{Ro(B.currentTarget);const q=B.currentTarget.error?.code;I({key:T,kind:q===1||q===2?"transient":"decode"}),x.status==="ready"&&x.fail()},className:"h-10 max-w-full"}):D?p.jsx(ra,{name:F,decode:O,failureKind:U,title:j??F,onRetry:()=>{I(null),l(B=>B+1)},onOpen:U==="decode"&&n!==null?()=>{n.openAttachment(e)}:void 0,onContextMenu:R.openMenu}):!a||x.status==="loading"||f.status==="loading"||E&&y.status==="loading"?p.jsx("span",{"aria-busy":"true",className:"block h-10 w-[220px] max-w-full animate-pulse rounded-lg bg-ink/[0.06] motion-reduce:animate-none"}):p.jsx(Gi,{item:e}),R.menuElement]})}function ob(e,t){if(t===void 0)return e;const n=Bn(e).replaceAll("\\","/"),i=`${Bn(t).replaceAll("\\","/").replace(/\/+$/,"")}/`;return n.toLowerCase().startsWith(i.toLowerCase())?n.slice(i.length):e}function Kh({resource:e,rawPath:t,cwd:n,sessionId:r,draftKey:i,localKikiComputer:s,host:o,client:a,t:u,onOpenPreview:l,onOpenCurrentFile:c}){const d={isKikiComputer:s,hasSession:r!==void 0,capabilities:{reveal:o.revealPath!==void 0,open:o.openPath!==void 0}},f=Db(e,d,{status:"ready",readableFromDevice:e.source.kind==="session-copy"?r!==void 0&&a!==void 0:e.source.kind==="url"?e.source.url!=="":a!==void 0&&(s||r!==void 0),originalReadable:!0}),h=lS(e)==="copy",m=e.origin!==void 0&&e.origin.trusted?Bn(e.origin.path,n):e.source.kind==="host-file"?Bn(e.source.path,n):void 0,x=[];l!==void 0&&x.push({key:"open-preview",label:u("file.openPreview"),run:l});const E=[];for(const y of f)if(y.id==="open-current-file"&&m!==void 0&&c!==void 0)x.push({key:"open-current-file",label:u("preview.openCurrentFile"),run:()=>{c(m)}});else if(y.id==="download"&&e.source.kind!=="host-file"){const v=Sr({name:e.name,path:m})??e.name??u("media.attachment"),k=e.source;x.push({key:"download",label:u("media.download"),run:async()=>{try{await zk({url:k.kind==="url"?k.url:void 0,fileId:k.kind==="session-copy"?k.fileId:void 0},v,o,a,k.kind==="session-copy"&&k.sessionId||r)}catch(S){kr({tone:"error",text:$k(S,u),detail:Ua(S)})}}})}else if(y.id==="add-to-chat"&&(i??r)!==void 0&&m!==void 0){const v=i??r;x.push({key:"add-to-chat",label:u("preview.addToChat"),run:()=>{b_(v,Nw({path:ob(m,n),name:qw(m),isDir:!1}))}})}else if(y.id==="copy-path"&&m!==void 0){const v=t??m;if(x.push({key:"copy-path",label:u("file.copyPath"),run:()=>nr(v)}),!h&&t!==void 0&&m!==t)x.push({key:"copy-absolute",label:u("file.copyAbsolutePath"),run:()=>nr(m)});else{const k=ob(m,n);k!==m&&k!==v&&x.push({key:"copy-relative",label:u("file.copyRelativePath"),run:()=>nr(k)})}}else if(y.id==="show-on-this-computer"&&m!==void 0&&o.revealPath!==void 0)E.push({key:"show-in-folder",label:u(h?"preview.showOnThisComputer":"file.showInFolder"),run:()=>o.revealPath(m)});else if(y.id==="open-with-default-app"&&m!==void 0&&o.openPath!==void 0)E.push({key:"open-default-app",label:u(h?"preview.openOriginalFile":"file.openDefaultApp"),run:()=>o.openPath(m)});else if(y.id==="open-in-browser"&&e.source.kind==="url"){const v=e.source.url;x.push({key:"open-link",label:u("link.open"),run:()=>mf(o,v,u("common.popupBlocked"))})}return E.length>0&&(x.length>0&&x.push({separator:!0}),x.push(...E)),x}function HT(e,t,n){const r=ci(),{t:i}=je(),s=wn(),o=Vt(),a=ys(o),[u,l]=b.useState(null),c=n??s?.sessionId,d=zh(c),f=b.useMemo(()=>cS(e,{sessionId:c,origin:e.origin,cwd:s?.cwd,name:t}),[e,c,s?.cwd,t]),h=b.useMemo(()=>MB(e,{localKikiComputer:a,cwd:s?.cwd}),[e,a,s?.cwd]),m=b.useCallback(()=>{if(s!==null){if((e.kind==="image"||e.kind==="video")&&e.path!==void 0){s.openAttachment(e);return}if(e.fileId!==void 0){DB({localPath:h,preview:s,client:o?.client,openCopy:()=>{s.openAttachment(e)}});return}if(e.path!==void 0){s.openFile(e.path);return}e.url!==void 0&&s.openAttachment(e)}},[o?.client,h,e,s]),x=(e.path!==void 0||e.fileId!==void 0||e.url!==void 0)&&s!==null,E=b.useMemo(()=>Kh({resource:f,rawPath:e.path,cwd:s?.cwd,sessionId:c,draftKey:d,localKikiComputer:a,host:r,client:o?.client,t:i,onOpenPreview:x?m:void 0,onOpenCurrentFile:s===null?void 0:k=>{s.openFile(k)}}),[f,e.path,s,c,d,a,r,o?.client,i,x,m]),y=b.useCallback(k=>{E.length!==0&&(k.preventDefault(),k.stopPropagation(),l({x:k.clientX,y:k.clientY}))},[E.length]),v=u===null||E.length===0?null:p.jsx(No,{x:u.x,y:u.y,entries:E,onClose:()=>{l(null)},ariaLabel:t,overlayId:"media-chip-menu",dataAttribute:"data-file-link-menu"});return{openItem:m,canOpen:x,openMenu:y,menuElement:v}}function Gi({item:e}){const{t}=je(),n=e.kind==="image"?t("media.image"):t("media.attachment"),r=na(e,void 0,n),i=e.size!==void 0?Qd(e.size):e.mime,s=HT(e,r),o=(e.path!==void 0||e.fileId!==void 0)&&s.canOpen,a=`inline-flex max-w-full items-center gap-2 rounded-lg border px-3 py-1.5 text-left ${o?"border-hairline bg-paper transition-colors hover:border-accent":"border-hairline bg-paper/60"}`,u=p.jsxs(p.Fragment,{children:[p.jsx(Je,{name:"file",className:"h-3.5 w-3.5 text-ink-faint"}),p.jsx("span",{className:"min-w-0 truncate font-mono text-[12px] text-ink",children:r}),i!==void 0&&i!==""?p.jsx("span",{className:"shrink-0 font-mono text-[11px] text-ink-faint",children:i}):null]});return o?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:a,title:r,onClick:s.openItem,onContextMenu:s.openMenu,children:u}),s.menuElement]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:a,title:r,onContextMenu:s.openMenu,children:u}),s.menuElement]})}function ab({item:e,size:t="default",onOpen:n,onStripFailure:r}){return p.jsx(Ha,{item:e,size:t,onOpen:n,onStripFailure:r})}const It={default:{img:"h-28 w-auto",slot:"h-28 w-40",frame:"rounded-lg"},strip:{img:"h-9 w-auto max-w-[96px]",slot:"h-9 w-12",frame:"rounded-[5px]"},preview:{img:"h-[120px] w-auto max-w-[240px]",slot:"h-[120px] w-40",frame:"rounded-lg"}},UT=/^(?:data:|blob:|https?:\/\/)/i;function qU({url:e,name:t,byteSize:n,size:r,attempt:i,onError:s}){const[o,a]=b.useState(!1),u=b.useRef(null),l=b.useRef(null),c=b.useCallback(()=>{u.current=null;const f=l.current;l.current=null,f?.()},[]);b.useEffect(()=>{c(),a(!1)},[e,i,c]),b.useEffect(()=>()=>{c()},[c]);const d=b.useCallback(()=>{const f=Symbol("inline-video");l.current?.(),u.current=f,l.current=LU(f,()=>{u.current===f&&(u.current=null,l.current=null,Kt.flushSync(()=>{a(!1)}))}),a(!0)},[]);if(!o){const f=n!==void 0&&n>0?Qd(n):void 0;return p.jsxs("button",{type:"button","data-inline-video-facade":"","data-inline-video-url":e,title:t,"aria-label":t,onClick:d,className:`flex ${It[r].slot} flex-col items-center justify-center gap-1.5 ${It[r].frame} border border-hairline bg-panel px-2.5 text-[11px] text-ink-soft transition-colors hover:border-accent hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink`,children:[p.jsx("span",{"aria-hidden":!0,className:`flex items-center justify-center rounded-full bg-ink/10 ${r==="strip"?"h-5 w-5":"h-8 w-8"}`,children:p.jsx("span",{className:`ml-0.5 h-0 w-0 border-y-transparent border-l-ink ${r==="strip"?"border-y-[3.5px] border-l-[6px]":"border-y-[5px] border-l-[8px]"}`})}),r==="strip"?null:p.jsxs("span",{className:"max-w-full text-center",children:[p.jsx("span",{className:"block max-w-full truncate font-mono text-[11px] text-ink",children:t}),f!==void 0?p.jsx("span",{className:"block font-mono text-[10px] text-ink-faint",children:f}):null]})]})}return p.jsx("video",{ref:LT,src:e,controls:!0,autoPlay:!0,playsInline:!0,preload:"none",onPlay:f=>{OT(f.currentTarget)},onEnded:f=>{Ro(f.currentTarget)},onError:f=>{Ro(f.currentTarget),c(),s()},className:"max-h-52 rounded-lg border border-hairline"},i)}function ub({item:e,size:t,onOpen:n,onStripFailure:r}){const{t:i}=je(),s=wn(),o=Vt()?.client,a=b.useMemo(()=>({client:o,sessionId:s?.sessionId,url:e.url}),[o,s?.sessionId,e.url]),[u,l]=b.useState(null),[c,d]=b.useState(0),[f,h]=hl(),m=b.useRef(u),x=b.useRef(a);m.current=u,x.current=a,Ph(Lh({sessionId:s?.sessionId,url:e.url,fileId:e.fileId,path:e.path}),()=>{m.current===x.current&&(l(null),d(w=>w+1))});const E=e.kind==="image"?i("media.image"):i("media.attachment"),y=na(e,void 0,E),v=Sr({name:e.name,path:e.path}),k=u===a;b.useEffect(()=>{t==="strip"&&k&&r?.("decode")},[t,k,r]);const S=Vh(e,e.kind==="image"&&!k?e.url:void 0,y);if(!UT.test(e.url))return p.jsx(Gi,{item:e});if(k&&t==="strip")return null;const T=k?p.jsx(ra,{name:y,decode:!0,failureKind:"decode",size:t,title:e.path??e.origin?.path??y,onRetry:()=>{l(null),d(w=>w+1)},onContextMenu:S.openMenu}):h?e.kind==="video"?p.jsx(qU,{url:e.url,name:y,byteSize:e.size,size:t,attempt:c,onError:()=>{l(a)}}):p.jsx("button",{type:"button",onClick:()=>{n!==void 0?n():s?.openImage(e.url,v)},onContextMenu:S.openMenu,title:y,className:`block overflow-hidden ${It[t].frame} transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-selected-ink`,children:p.jsx("img",{src:e.url,alt:y,referrerPolicy:"no-referrer",decoding:"async",onError:()=>{l(a)},className:`${It[t].img} object-cover`},c)}):p.jsx("span",{"aria-busy":"true",className:`${It[t].slot} ${It[t].frame}`});return p.jsxs("span",{ref:f,className:"inline-flex",children:[T,S.menuElement]})}function WU({item:e,size:t,onStripFailure:n}){const{t:r}=je(),i=NU({agentId:e.detail.agentId,kind:"attachment",id:e.detail.attachmentId}),s=na(e,void 0,e.kind==="image"?r("media.image"):r("media.attachment")),o=Vt()?.client,a=wn(),[u,l]=hl(),c=b.useMemo(()=>({client:o,sessionId:a?.sessionId,agentId:e.detail.agentId,id:e.detail.attachmentId}),[o,a?.sessionId,e.detail.agentId,e.detail.attachmentId]),d=b.useRef(void 0),f=i.status?.status,h=f==="error"?BT(i.status?.message,!1,e.kind):void 0,m=e.kind==="file"&&e.mime===void 0&&e.size===void 0&&(e.name===void 0||e.origin!==void 0),x=e.kind==="image"||e.kind==="video"||e.kind==="audio"||m;if(b.useEffect(()=>{!l||!x||i.request===void 0||d.current===c||f==="error"||(d.current=c,i.request())},[l,x,i.request,c,f]),b.useEffect(()=>{t==="strip"&&f==="error"&&h!==void 0&&n?.(h)},[t,f,h,n]),i.request===void 0)return p.jsx(Gi,{item:e});const E=f==="loading"?r("media.detail.loading",{name:s}):f==="error"?r("media.detail.failed",{name:s}):r("media.detail.open",{name:s}),y=e.size!==void 0?Qd(e.size):e.mime;if(f==="error")return t==="strip"?null:p.jsx("span",{ref:u,className:"inline-flex","data-media-deferred":"error",children:p.jsx(ra,{name:s,decode:h==="decode",failureKind:h,size:t,title:e.path??e.origin?.path??s,onRetry:i.request})});if(t==="strip"){const v=f==="loading"||f===void 0&&x;return p.jsx("button",{type:"button",ref:u,"data-media-deferred":f??"idle","aria-busy":v||void 0,onClick:i.request,disabled:f==="loading","aria-label":E,title:E,className:`flex ${It[t].slot} items-center justify-center ${It[t].frame} ${v?"animate-pulse bg-ink/[0.06] text-ink-faint motion-reduce:animate-none":"border border-hairline bg-ink/[0.03] text-ink-faint"} transition-colors hover:border-hairline-strong hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink`,children:v?null:p.jsx(Je,{name:"file",size:12})})}return p.jsxs("button",{ref:u,type:"button","data-media-deferred":f??"idle",onClick:i.request,disabled:f==="loading","aria-busy":f==="loading","aria-label":E,title:E,className:`flex ${It[t].slot} flex-col items-start justify-between gap-1 ${It[t].frame} border border-hairline bg-panel p-2 text-left transition-colors hover:border-hairline-strong focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink disabled:cursor-default motion-reduce:transition-none`,children:[p.jsxs("span",{className:"flex w-full min-w-0 items-center gap-1.5 text-ink-faint",children:[p.jsx(Je,{name:"file",size:14}),y!==void 0&&y!==""?p.jsx("span",{className:"truncate font-mono text-[11px]",children:y}):null]}),p.jsxs("span",{className:"w-full min-w-0",children:[p.jsx("span",{className:"block truncate font-mono text-[12px] text-ink",title:s,children:s}),p.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 text-[12px] font-medium text-accent-ink",children:[f==="loading"?p.jsx("span",{"aria-hidden":!0,className:"status-dot-busy h-1.5 w-1.5 rounded-full bg-ink-soft"}):null,r(f==="loading"?"preview.loading":"media.detail.action")]})]})]})}function $T(e){const{item:t}=e;return t.kind==="image"&&t.url!==void 0&&t.detail===void 0&&t.blobHash===void 0&&t.fileId===void 0?p.jsx(wT,{source:t.url,alt:t.name,children:p.jsx(lb,{...e})}):p.jsx(lb,{...e})}function lb({item:e,agentId:t,size:n="default",galleryIndex:r=0,onStripFailure:i}){const s=vT(),o=MT(e,r,t),a=e.blobHash!==void 0||e.fileId!==void 0||e.url!==void 0&&UT.test(e.url);if(e.detail!==void 0&&!a)return p.jsx(WU,{item:{...e,detail:e.detail},size:n,onStripFailure:i});if(e.blobHash!==void 0){const u=Tu({...e,name:e.name??Sr({path:e.path})},s?.agentId??t??"main");return u.kind==="audio"?p.jsx(sb,{item:u}):p.jsx(Ha,{item:u,size:n,onOpen:e.kind==="image"?o:void 0,onStripFailure:i})}return e.kind==="image"?e.fileId!==void 0?p.jsx(Ha,{item:e,size:n,onOpen:o,onStripFailure:i}):e.url!==void 0?p.jsx(ub,{item:{...e,url:e.url},size:n,onOpen:o,onStripFailure:i}):e.path!==void 0?p.jsx(ab,{item:{...e,kind:"image",path:e.path},size:n,onOpen:o,onStripFailure:i}):p.jsx(Gi,{item:e}):e.kind==="audio"?p.jsx(sb,{item:e}):e.kind==="video"?e.fileId!==void 0?p.jsx(Ha,{item:e,size:n,onStripFailure:i}):e.url!==void 0?p.jsx(ub,{item:{...e,url:e.url},size:n,onStripFailure:i}):e.path!==void 0?p.jsx(ab,{item:{...e,kind:"video",path:e.path},size:n,onStripFailure:i}):p.jsx(Gi,{item:e}):p.jsx(Gi,{item:e})}function VV({media:e,align:t="start",agentId:n}){return e.length===0?null:p.jsx("div",{className:`mt-1.5 flex flex-wrap gap-2 ${t==="end"?"justify-end":""}`,children:e.map((r,i)=>p.jsx($T,{item:r,agentId:n,galleryIndex:i},i))})}function KV({path:e,line:t,column:n,heading:r,className:i,children:s}){const o=ci(),{t:a}=je(),u=wn(),l=Vt(),c=ys(l),d=zh(u?.sessionId),[f,h]=b.useState(null);if(u===null)return p.jsx("span",{className:i,children:s??e});const m=Bn(e,u.cwd),x=t!==void 0||n!==void 0||r!==void 0?{path:m,line:t,column:n,heading:r}:m,E=()=>{u.openFile(x)},y=jb(m,u.cwd),v=Kh({resource:y,rawPath:e,cwd:u.cwd,sessionId:u.sessionId,draftKey:d,localKikiComputer:c,host:o,client:l?.client,t:a,onOpenPreview:E});return p.jsxs(p.Fragment,{children:[p.jsx("span",{role:"link",tabIndex:0,title:m,onClick:k=>{k.stopPropagation(),E()},onContextMenu:k=>{k.preventDefault(),k.stopPropagation(),h({x:k.clientX,y:k.clientY})},onKeyDown:k=>{k.key==="Enter"&&(k.stopPropagation(),E())},className:`cursor-pointer rounded-[2px] underline-offset-2 decoration-ink-faint hover:text-ink hover:underline focus-visible:text-ink focus-visible:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink ${i??""}`,children:s??e}),f!==null?p.jsx(No,{x:f.x,y:f.y,entries:v,onClose:()=>{h(null)},ariaLabel:a("file.menuAria"),overlayId:"file-path-link",dataAttribute:"data-file-link-menu"}):null]})}const wu=[],Yh=b.createContext(null);function VU(){return()=>{}}function KU(){return wu}function YV({children:e}){const t=b.useMemo(()=>{const n=new Map,r=new Set;let i=wu;const s=()=>{const a=[];for(const u of n.values())for(const l of u)a.push(l);return a.length===i.length&&a.every((u,l)=>u===i[l])?!1:(i=a.length===0?wu:a,!0)},o=()=>{for(const a of r)a()};return{replace(a,u){const l=n.get(a);l!==void 0&&l.length===u.length&&l.every((c,d)=>c===u[d])||(n.set(a,u),s()&&o())},remove(a){n.delete(a)&&s()&&o()},read:()=>i,subscribe(a){return r.add(a),()=>{r.delete(a)}}}},[]);return p.jsx(Yh.Provider,{value:t,children:e})}function GV(){const e=b.useContext(Yh),t=e===null?VU:r=>e.subscribe(r),n=e===null?KU:()=>e.read();return b.useSyncExternalStore(t,n,n)}function YU(e){const t=b.useContext(Yh),n=b.useId();b.useLayoutEffect(()=>{if(t!==null)return t.replace(n,e!==void 0&&e!==""?[e]:wu),()=>{t.remove(n)}},[t,n,e])}function zT(e){const t=e.src;return YU(t),p.jsx(wT,{source:t,alt:e.alt,children:p.jsx(GU,{...e})})}function GU({src:e,srcSet:t,alt:n,title:r,node:i,documentDirectory:s,...o}){const a=Vt()?.client,u=wn(),{t:l}=je(),c=typeof e=="string"?Cc(e)??e:void 0,d=s??u?.cwd,f=b.useMemo(()=>c===void 0?void 0:Ab(c.split(/[?#]/,1)[0],d)?.path,[c,d]),[h,m]=b.useState(0),[x,E]=b.useState(null),y=c===void 0?void 0:Ww(c),v=y===void 0?f:void 0,k=b.useMemo(()=>({kind:"image",path:v}),[v]),S=Wh(k,u?.sessionId,v!==void 0&&a!==void 0,!0,h),T=x!==null&&x.client===a&&x.path===f,w=b.useRef(!1);w.current=T||S.status==="failed",Ph(Lh({sessionId:u?.sessionId,fileId:y,path:v,url:v===void 0&&typeof e=="string"?e:void 0}),()=>{y!==void 0||!w.current||(E(null),m(B=>B+1))});const I=Sr({metadataName:S.status==="ready"?S.name:void 0,path:f}),A=b.useMemo(()=>({kind:"image",fileId:y,path:v,url:v===void 0&&typeof e=="string"?e:void 0,name:I}),[y,v,e,I]),O=i?.position?.start?.offset??0,_=MT(A,0,void 0,O),D=I??l("media.image"),U=Sr({name:n})??D,F=f===void 0?e:S.status==="ready"?S.url:void 0,R=Vh(A,typeof F=="string"?F:void 0,U);if(y!==void 0)return p.jsx($T,{item:{kind:"image",fileId:y}});if(f!==void 0&&(S.status==="failed"||T)){const B=T?"decode":S.status==="failed"?S.failureKind??"transient":"transient";return p.jsxs(p.Fragment,{children:[p.jsx(ra,{name:D,decode:T,failureKind:B,title:v??c??D,onRetry:()=>{E(null),m(q=>q+1)},onOpen:u!==null&&v!==void 0?()=>{u.openFile(v)}:void 0,onContextMenu:R.openMenu}),R.menuElement]})}const j=p.jsx("img",{...o,"data-markdown-image":"",src:F,alt:U,referrerPolicy:"no-referrer",decoding:"async",onContextMenu:R.openMenu,onError:()=>{E({client:a,path:f})},className:"kiki-md-img max-w-full h-auto"});return u===null?p.jsxs(p.Fragment,{children:[j,R.menuElement]}):p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",title:D,"aria-label":D,className:"kiki-md-img-trigger inline-block max-w-full bg-transparent p-0 align-middle focus-visible:outline-2 focus-visible:outline-selected-ink",onClick:()=>{typeof F=="string"&&_(F)},children:j}),R.menuElement]})}function Gh(e){return e.toLowerCase().replaceAll(/[\p{P}\p{S}]/gu,t=>t==="-"||t==="_"?t:"").replaceAll(" ","-")}function qT(e){const t=new Map;for(const n of e.querySelectorAll("h1,h2,h3,h4,h5,h6")){const r=Gh(n.textContent??"");let i=r,s=0;for(;t.has(i);)i=`${r}-${++s}`;n.dataset.markdownHeading=i,t.set(i,n)}return t}function XU(e,t){const n=qT(e);let r=t;try{r=decodeURIComponent(t)}catch{}return n.get(r)??n.get(Gh(r))}const QU=2e3,ZU=16e3,JU=/\]:/;function e$(e){if(e.length<ZU||JU.test(e)||e.includes("$$")||e.includes("\\[")||e.includes("\\("))return[e];const t=sk(e),n=[];let r="";for(const i of t)r!==""&&r.length+i.length>QU&&(n.push(r),r=""),r+=i;return r!==""&&n.push(r),n}function t$({children:e="",...t}){const n=b.useMemo(()=>e$(e),[e]),[r,i]=b.useState({segments:n,count:1}),s=r.segments===n?r.count:1;return r.segments!==n&&i({segments:n,count:s}),b.useEffect(()=>{if(s>=n.length)return;const o=window.setTimeout(()=>{i({segments:n,count:s+1})},0);return()=>{window.clearTimeout(o)}},[n,s]),n.length===1?p.jsx(mu,{...t,children:e}):p.jsx("div",{"aria-busy":s<n.length,children:n.slice(0,s).map((o,a)=>p.jsx(mu,{...t,children:o},a))})}const n$=/[\n\r`*_~#[\]|<>&\\]|^\s*(?:[-+>]|\d+[.)]\s)|https?:\/\/|www\.|[\w.+-]+@[\w-]+\.\w|\s{2}|^\s|\s$/i;function r$(e){return e!==""&&!n$.test(e)}const i$=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i;function s$(e){return e!==void 0&&!i$.test(e)}const o$=[{pattern:/^\/s\/[^/]+(?:\/.*)?$/,name:"thread"},{pattern:/^\/(?:r|rooms)\/[^/]+(?:\/.*)?$/,name:"room"},{pattern:/^\/cron(?:\/|$)/,name:"clock"},{pattern:/^\/memory(?:\/|$)/,name:"memory"},{pattern:/^\/usage(?:\/|$)/,name:"usage"},{pattern:/^\/activity(?:\/|$)/,name:"clock"},{pattern:/^\/capabilities(?:\/|$)/,name:"persona"},{pattern:/^\/personas(?:\/|$)/,name:"persona"},{pattern:/^\/settings(?:\/|$)/,name:"settings"},{pattern:/^\/new(?:\/|$)/,name:"plus"}];function a$(e){const[t]=e.split(/[?#]/,1);return t===void 0?void 0:o$.find(n=>n.pattern.test(t))}function u$({to:e,children:t}){const n=a$(e);return n===void 0?p.jsx($a,{to:e,children:t}):p.jsxs($a,{to:e,"data-internal-link":n.name,className:"inline rounded-[3px] text-ink no-underline transition-colors hover:bg-ink/[0.05] hover:text-ink focus-visible:ring-2 focus-visible:ring-selected-ink/40 focus-visible:outline-none",children:[p.jsx(Je,{name:n.name,size:12,className:"mr-1 inline align-[-0.12em] text-ink-faint"}),p.jsx("span",{children:t})]})}function l$(e=!0){return(t,n)=>{const r=typeof n.value=="string"?n.value:void 0,i=s=>{if((s.type==="link"||e&&s.type==="image")&&typeof s.url=="string"){const o=s.type==="image"?s.url.split(/[?#]/,1)[0]:s.url,a=ml(o);if(a!==void 0)s.url=a;else if(s.type==="link"&&s.url.startsWith("#")&&s.url.length>1)try{const u=new URL(s.url,"http://example.com").hash;u.startsWith("#")&&(s.url=u)}catch{}else s.type==="link"&&/^\.\.?\//.test(s.url)&&(s.url=`${Yw}${encodeURIComponent(s.url)}`)}s.type==="link"||s.type==="code"||s.type==="html"||s.children!==void 0&&(s.children=s.children.flatMap(o=>{if(o.type==="inlineCode"&&o.value!==void 0){const h=o.value,m=Aa(h).some(y=>y.start===0&&y.end===h.length),x=/^(?:[A-Za-z]:[\\/]|\.?\.?[\\/]|~[\\/])/.test(h)&&!/[\n\r]|\s(?:--?|&&|\|)/.test(h)&&(!/\s/.test(h)||/\.[A-Za-z0-9]{1,10}(?::\d+(?::\d+)?|#.*)?$/.test(h)),E=m||x?ml(h,!0):void 0;if(E!==void 0)return[{type:"link",url:E,children:[o]}]}if(o.type!=="text"||o.value===void 0)return i(o),[o];const a=o.value;let u=[...Aa(a)];const l=o.position?.start?.offset,c=o.position?.end?.offset;if(r!==void 0&&l!==void 0&&c!==void 0){let h=0;for(const m of Aa(r.slice(l,c))){if(!/^(?:[A-Za-z]:\\|~\\)/.test(m.target))continue;const x=m.target.replaceAll(/\\([!-/:-@[-`{-~])/g,"$1"),E=a.indexOf(x,h);if(E<0)continue;const y=E+x.length;h=y,u=u.filter(v=>v.end<=E||v.start>=y),u.push({start:E,end:y,target:m.target})}u.sort((m,x)=>m.start-x.start)}const d=[];let f=0;for(const h of u)h.start>f&&d.push({type:"text",value:a.slice(f,h.start)}),d.push({type:"link",url:ml(h.target,!0)??h.target,children:[{type:"text",value:h.target}]}),f=h.end;return f<a.length&&d.push({type:"text",value:a.slice(f)}),d}))};i(t)}}function WT(){return(e,t)=>{const n=typeof t.value=="string"?t.value:void 0,r=i=>{const s=i.children;if(s!==void 0)for(let o=0;o<s.length;o+=1){const a=s[o];if(a.type==="link"&&typeof a.url=="string"&&!VT(a.url)&&c$(a,n)){const u=h$(a.url);if(u>0){const l=a.url.slice(0,u);let c=a.url.slice(u);a.url=l,a.children=[{type:"text",value:l}];const d=o>0?s[o-1]:void 0,f=d?.type==="text"?d$(d.value):void 0,h=f===void 0?0:f$(c,f),m=f==="**"||f==="__";if(f!==void 0&&h>0&&d!==void 0&&d.value!==void 0&&d.value.trim()!==""){d.value=d.value.slice(0,d.value.length-f.length),c=c.slice(h),s.splice(o,1,{type:m?"strong":"emphasis",children:[a]},{type:"text",value:c}),o+=2;continue}s.splice(o+1,0,{type:"text",value:c})}}r(a)}};r(e)}}function c$(e,t){if(t===void 0)return!1;const n=e.position?.start?.offset,r=e.position?.end?.offset;return n===void 0||r===void 0||n<0||r>t.length?!1:t.slice(n,r)===e.url}function d$(e){if(typeof e=="string")return/(\*\*|__|\*|_)$/u.exec(e)?.[1]}function f$(e,t){return e.startsWith(t)?t.length:0}function VT(e){try{return new URL(e),!0}catch{return!1}}function h$(e){for(let t=e.length;t>0;t-=1){const n=e.slice(0,t);if(!/[*_]$/u.test(n)&&VT(n))return t}return 0}function KT(){return l$(!0)}const p$=[KT,WT],m$=[KT,WT];function YT({href:e,children:t,documentDirectory:n,documentPath:r,rootRef:i}){const s=ci(),{t:o}=je(),a=wn(),u=Vt(),l=ys(u),c=zh(a?.sessionId),[d,f]=b.useState(null),h=e===void 0?void 0:Cc(e)??e,m=h?.startsWith("#")===!0&&r!==void 0,x=n??a?.cwd;let E=a!==null&&h!==void 0?Ab(m?`document.md${h}`:h,x,e?.startsWith(Vw)):void 0;if(E===void 0&&a!==null&&h!==void 0&&/^\.\.?\//.test(h)&&x!==void 0&&x.trim()!==""){const A=h.split(/[?#]/,1)[0];if(A!==""&&!A.endsWith("/")){let O=A;try{O=decodeURIComponent(A)}catch{}const _=/^\/[A-Za-z]:[\\/]/.test(x)?x.slice(1):x;E={path:Kw(_,O)}}}const y=m&&E!==void 0?{...E,path:r}:E,v=y?.path,k=A=>{A.preventDefault(),f({x:A.clientX,y:A.clientY})},S=()=>{f(null)};if(v!==void 0&&a!==null&&h!==void 0){const A=jb(v,n??a.cwd),O=Kh({resource:A,rawPath:h,cwd:n??a.cwd,sessionId:a.sessionId,draftKey:c,localKikiComputer:l,host:s,client:u?.client,t:o,onOpenPreview:()=>{a.openFile(y??v)}});return p.jsxs(p.Fragment,{children:[p.jsx("a",{href:e,title:v,onClick:_=>{_.preventDefault(),a.openFile(y??v)},onContextMenu:k,children:t}),d!==null?p.jsx(No,{x:d.x,y:d.y,entries:O,onClose:S,ariaLabel:o("file.menuAria"),overlayId:"markdown-file-link",dataAttribute:"data-file-link-menu"}):null]})}if(e!==void 0&&Cc(e)!==void 0)return p.jsx("span",{children:t});if(h?.startsWith("#")===!0)return p.jsx("a",{href:h,onClick:A=>{if(A.metaKey||A.ctrlKey||A.shiftKey||A.altKey||A.button!==0)return;A.preventDefault();const O=i?.current;O!=null&&XU(O,h.slice(1))?.scrollIntoView({block:"start"})},children:t});if(s$(e)&&e.startsWith("/"))return p.jsx(u$,{to:e,children:t});const T=e??"",I=[...a?.openWeb!==void 0&&/^https?:\/\//iu.test(T)?[{key:"open-preview",label:o("file.openPreview"),run:()=>{a?.openWeb?.(T)}}]:[],{key:"open-link",label:o("link.open"),run:()=>mf(s,T,o("common.popupBlocked"))},{key:"copy-link",label:o("link.copyLink"),run:()=>nr(T)}];return p.jsxs(p.Fragment,{children:[p.jsx(XF,{href:e??"",onContextMenu:k,children:t}),d!==null?p.jsx(No,{x:d.x,y:d.y,entries:I,onClose:S,ariaLabel:o("link.menuAria"),overlayId:"markdown-link",dataAttribute:"data-link-menu"}):null]})}const g$=Object.entries(pu).map(([e,t])=>{if(e!=="sanitize"||!Array.isArray(t))return t;const n=t[1];return[t[0],{...n,protocols:{...n.protocols,src:[...n.protocols?.src??[],"data","blob","kimi-file"]}}]}),b$=[],x$=()=>b$,y$={enabled:!1},E$={table:!1,code:!1,mermaid:!1},v$=[...Object.values(Sh),...p$],k$=[...Object.values(Sh),...m$],T$={pre:nB,table:iB,a:YT,img:zT},Xh=b.memo(function({text:t,mode:n="streaming",documentDirectory:r,documentPath:i,headingNavigation:s,onHeadingResult:o,preserveEdgeMargins:a=!1,annotationTargets:u,sourceBlockId:l}){const c=b.useRef(null),d=b.useRef(o);d.current=o,b.useEffect(()=>{const _=c.current;if(_===null||i===void 0&&n!=="static")return;let D=!1,U=0;const F=()=>{const j=qT(_);if(s?.heading===void 0||D)return;const B=j.get(s.heading)??j.get(Gh(s.heading));B===void 0&&_.querySelector('[aria-busy="true"]')!==null||(d.current?.(B!==void 0),B!==void 0&&(D=!0,U=requestAnimationFrame(()=>{B.scrollIntoView({block:"start"})})))};F();const R=new MutationObserver(F);return R.observe(_,{childList:!0,subtree:!0}),()=>{R.disconnect(),cancelAnimationFrame(U)}},[i,s,n,t]);const f=r$(t)&&Aa(t).length===0,h=X7(f?null:t,c),m=a?"kiki-md kiki-md--edges":"kiki-md",x=b.useMemo(()=>l===void 0?void 0:f1(t),[l,t]),E=rj(u),y=b.useRef(u);y.current=u;const v=b.useRef(!1),k=b.useRef(0),S=b.useRef(null),T=S.current;T!==null&&v.current&&(T.text!==t||T.mode!==n||T.documentDirectory!==r||T.documentPath!==i||T.plugins!==h)&&(k.current+=1,v.current=!1),S.current={text:t,mode:n,documentDirectory:r,documentPath:i,plugins:h};const w=k.current;b.useLayoutEffect(()=>{const _=c.current;if(f||_===null)return;let D=null;const U=()=>{D?.disconnect(),v.current=hj(_,y.current),D!==null&&(D.takeRecords(),D.observe(_,{childList:!0,subtree:!0}))};return E!==""&&(D=new MutationObserver(F=>{F.some(j=>{const B=j.target.nodeType===1?j.target:j.target.parentElement;return B===null||B.closest('button, [data-source-ignore], .kiki-cb-tools, [data-streamdown="code-block-header"]')===null})&&U()})),U(),()=>{D?.disconnect(),oj(_)}},[E,f,w,t,n,r,i,h]);const I=`${w}:${r??""}:${i??""}`,A=b.useMemo(()=>{const _={...T$,a:D=>p.jsx(YT,{...D,documentDirectory:r,documentPath:i,rootRef:c})};return r!==void 0&&(_.img=D=>p.jsx(zT,{...D,documentDirectory:r})),_},[r,i]);if(f)return p.jsx("div",{ref:c,className:m,"data-source-block-id":l,"data-source-version":x,children:p.jsx("p",{children:u===void 0||u.length===0?t:JF(t,u)})});const O=n==="static"?t$:mu;return p.jsx("div",{ref:c,className:m,"data-source-block-id":l,"data-source-version":x,children:p.jsx(O,{mode:n,parseIncompleteMarkdown:n==="streaming",parseMarkdownIntoBlocksFn:n==="static"?x$:void 0,plugins:h,remarkPlugins:r===void 0?v$:k$,rehypePlugins:g$,components:A,linkSafety:y$,controls:E$,children:t},I)})}),GT="/settings/permissions";async function w$(e,t){const n=await e.getConfig(),r=[...n.permission?.rules??[]];return r.some(i=>i.decision==="allow"&&i.scope==="user"&&i.pattern===t)?n:(r.push({decision:"allow",scope:"user",pattern:t}),e.patchConfig({permission:{rules:r}}))}function XT(e,t,n,r){const i=e==="approved"?n("ia.reviewer.approved"):e==="rejected"?n("ia.reviewer.rejected"):r,s=t.reason.trim();return s===""?i:`${i} · ${s}`}function QT(e,t){const n=t(e.backend==="jev"?"ia.reviewer.backend.jev":"ia.reviewer.backend.model"),r=Number.isFinite(e.confidence)?e.confidence:0,i=Math.round(r<=1?r*100:r);return t("ia.reviewer.tooltip",{backend:n,confidence:String(i)})}const cb={estimateSize:180,overscan:2,initialWidth:640,initialHeight:240};function S$({contentRef:e,callerAgentId:t,label:n,headingPresent:r=!1,presentation:i,renderText:s,fallbackPrefixText:o,virtualizeConfig:a}){const u=$h(),l=Uh(),c=b.useRef(null),d=a===void 0?cb:{...cb,...a},f=Math.ceil(e.total/gl),h=jh({count:f,getScrollElement:()=>c.current,estimateSize:()=>d.estimateSize,overscan:d.overscan,initialRect:{width:d.initialWidth,height:d.initialHeight},observeElementRect:(E,y)=>Fh(E,v=>{y(v.height>0?v:{width:v.width>0?v.width:d.initialWidth,height:d.initialHeight})}),measureElement:(E,y,v)=>{const k=Math.round(y?.borderBoxSize?.[0]?.blockSize??E.getBoundingClientRect().height);if(k>0)return k;const S=v.indexFromElement(E);return v.options.estimateSize(S>=0?S:0)}}),m=t??l?.agentId,x=JSON.stringify([e.source,e.path,e.revision]);return b.useEffect(()=>{const E=c.current;if(E===null)return;const y=v=>{const k=v.detail;k.key===x&&h.scrollToIndex(Math.floor(k.offset/gl),{align:"center"})};return E.addEventListener("kiki:reveal-content-match",y),()=>{E.removeEventListener("kiki:reveal-content-match",y)}},[x,h]),u===void 0||m===void 0?null:p.jsxs("div",{"data-content-range-text":!0,"data-content-range-key":x,children:[r?null:p.jsx("p",{className:"mb-1 text-[12px] text-ink-faint",children:n}),p.jsx("div",{ref:c,className:"h-60 overflow-auto rounded-md bg-panel px-3 py-2 font-mono text-[12px] leading-relaxed text-ink select-text","aria-label":n,children:p.jsx("div",{style:{height:h.getTotalSize(),position:"relative"},children:h.getVirtualItems().map(E=>p.jsx("div",{"data-index":E.index,ref:h.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${E.start}px)`},children:p.jsx(_$,{controller:u,agentId:m,contentRef:e,offset:E.index*gl,presentation:i,renderText:s,fallbackPrefixText:E.index===0?o:void 0})},`${e.revision}/${E.key}`))})})]})}function _$({controller:e,agentId:t,contentRef:n,offset:r,presentation:i,renderText:s,fallbackPrefixText:o}){const{t:a}=je(),u=JSON.stringify([n.source,n.path,n.revision]),l=`${u}@${r}`,c=e.peekContentRange?.(t,n,r),d=r===0?o!==void 0&&o!==""?o:e.peekContentPrefix?.(t,n):void 0,[f,h]=b.useState(()=>c!==void 0?{key:l,text:c}:void 0),[m,x]=b.useState(),[E,y]=b.useState(0),v=c!==void 0,k=c??(f?.key===l?f.text:void 0);b.useEffect(()=>{if(c!==void 0&&E===0){h(A=>A?.key===l&&A.text===c?A:{key:l,text:c}),x(void 0);return}const I=new AbortController;return x(void 0),e.readContentRange(t,n,r,I.signal).then(A=>{I.signal.aborted||(h({key:l,text:A}),x(void 0))},()=>{I.signal.aborted||x(l)}),()=>{I.abort()}},[e,t,u,l,r,E,v]);const S=m===l,T=k??(S?void 0:d);if(T===void 0)return p.jsxs("div",{className:"min-h-20 text-ink-faint",role:"status",children:[a(S?"transcript.content.failed":"transcript.content.loading"),S?p.jsx("button",{type:"button",className:"ml-2 underline",onClick:()=>{y(I=>I+1)},children:a("common.retry")}):null]});const w=Ca(T,i,r);return s===void 0?p.jsx("pre",{className:"m-0 whitespace-pre-wrap break-words",children:w}):p.jsx("div",{className:"whitespace-pre-wrap break-words",children:s(w)})}const XV=["text","prompt"],QV=["output","error"],ZV=["input"],JV=["inputText"],eK=["display"],tK=["outputTail"],nK=["resultSummary","outputTail"],rK=["command"],iK=["input","inputText"],sK=["display","input","inputText"],oK=["steps"],aK=[["steps"]];function uK(e){if(e.frameId!==void 0)return{kind:"frame",id:e.frameId,turnId:e.turnId,stepId:e.stepId}}function C$(e,t){if(e.kind==="text"){const n=e.total===0?0:Math.floor(e.offset/e.total*100);return t("transcript.content.percent",{percent:n<1?"<1":String(n)})}return t("transcript.content.items",{shown:e.direction==="backward"?e.total-e.offset:e.offset,total:e.total})}const A$="flex flex-wrap items-center gap-x-2 gap-y-1 text-[12px] leading-5",I$="inline-flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 font-medium text-ink-soft underline-offset-2 transition-colors hover:text-ink hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink disabled:cursor-default disabled:opacity-80 disabled:hover:no-underline motion-reduce:transition-none";function N$({kind:e,state:t,progress:n,error:r,label:i,onRequest:s,original:o,className:a=""}){const{t:u}=je(),l=t==="loading";return p.jsxs("div",{"data-content-continuation":t,"data-continuation-kind":e,className:`${A$} ${a}`.trimEnd(),children:[p.jsx("span",{"data-content-continuation-progress":!0,className:"min-w-0 truncate text-ink-faint",children:n}),t==="error"?p.jsx("span",{role:"alert",className:"text-danger",children:r}):null,t==="error"&&o!==void 0?o:null,p.jsx("button",{type:"button","data-content-continuation-action":!0,onClick:s,disabled:l,"aria-busy":l,"aria-label":u("transcript.content.actionAria",{field:i}),className:I$,children:l?p.jsxs(p.Fragment,{children:[p.jsx("span",{"aria-hidden":!0,className:"status-dot-busy h-1.5 w-1.5 rounded-full bg-ink-soft"}),u("transcript.content.loading")]}):u(t==="error"?"transcript.detail.retry":"transcript.content.more")})]})}function db({ref:e,label:t,callerAgentId:n}){const{t:r}=je(),i=ci(),s=Vt(),o=s?.client,a=Uh(),u=b.useMemo(()=>a===void 0||n===void 0?a:{...a,agentId:n},[a,n]),[l,c]=b.useState("idle"),d=b.useRef(null),f=b.useRef(!1),m=`${e.path[0]==="outputTail"?"output":String(e.path[0]??"content")}.${e.kind==="text"?"txt":"json"}`,x=JSON.stringify([u?.sessionId??"",u?.agentId??"",e.source.kind,e.source.id,e.source.turnId??"",e.source.stepId??"",e.path,e.revision])+` ${s?.connectionId??""} ${s?.spaceKey??""} ${s?.scopeId??""}`;if(b.useEffect(()=>()=>{f.current=!1;const k=d.current;d.current=null,k?.abort(),c(S=>S==="downloading"||S==="saving"?"idle":S)},[x,o]),o===void 0||u===void 0||hS(u.agentId,e)===void 0)return null;const E=async()=>{d.current?.abort();const k=new AbortController;d.current=k,f.current=!0;let S=null,T=!1;c("downloading");const w=()=>f.current&&d.current===k&&!k.signal.aborted;try{if(S=i.openSaveSink!==void 0?await i.openSaveSink(m):i.saveBlob!==void 0?Sb(D=>i.saveBlob(D,m)):await _b(m),S===null){w()&&c("idle");return}k.signal.throwIfAborted();const I=S,A=async D=>{await I.write(D)},O={signal:k.signal,timeoutMs:0};await o.downloadTranscriptContent(u.sessionId,u.agentId,e,A,O),k.signal.throwIfAborted(),w()&&c("saving"),T=!0;const _=await S.close();w()&&c(_?"saved":"idle")}catch{T||await S?.abort().catch(()=>{}),w()&&c("failed")}finally{d.current===k&&(d.current=null,f.current&&c(I=>I==="downloading"||I==="saving"?"idle":I))}},y=l==="downloading"||l==="saving",v=()=>{const k=d.current;d.current=null,k?.abort(),c(S=>S==="downloading"||S==="saving"?"idle":S)};return p.jsxs("span",{"data-content-original":l,className:"flex items-center gap-1.5",children:[p.jsxs("button",{type:"button","data-content-original-action":!0,onClick:()=>{E()},disabled:y,"aria-busy":y,"aria-label":r("transcript.content.originalAria",{field:t}),className:"inline-flex min-h-7 items-center gap-1.5 rounded-md px-2 font-medium text-ink-soft underline-offset-2 transition-colors hover:text-ink hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink disabled:cursor-default disabled:opacity-80 disabled:hover:no-underline motion-reduce:transition-none",children:[y?p.jsx("span",{"aria-hidden":!0,className:"status-dot-busy h-1.5 w-1.5 rounded-full bg-ink-soft"}):null,r(l==="failed"?"transcript.content.originalRetry":l==="saved"?"transcript.content.originalSaved":y?"transcript.content.originalSaving":"transcript.content.original")]}),y?p.jsx("button",{type:"button","data-content-original-cancel":!0,onClick:v,className:"inline-flex min-h-7 items-center rounded-md px-2 font-medium text-ink-soft transition-colors hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink motion-reduce:transition-none",children:r("transcript.content.originalCancel")}):null]})}function R$({source:e,roots:t,paths:n,label:r,callerAgentId:i,headingPresent:s=!1,autoRead:o=!0,className:a="",excludeRanges:u=!1,presentation:l,renderText:c,fallbackPrefixText:d}){const{t:f,tp:h}=je(),{pending:m,statusOf:x,request:E}=IT(e,t,i,n),y=$h(),v=Uh(),k=i??v?.agentId,S=JSON.stringify([e,t,n,i]),[T,w]=b.useState(),I=y!==void 0&&(o||T===S),A=RU(I?e:void 0,t,i,n),O=y!==void 0&&k!==void 0?m.filter(F=>y.isContentRange(k,F)):[],_=u?[]:O,D=m.find(F=>!O.includes(F));if(D===void 0&&_.length===0)return null;const U=D===void 0?"":C$(D,f);return p.jsxs(p.Fragment,{children:[_.map(F=>p.jsxs("div",{className:a,children:[p.jsx(S$,{contentRef:F,callerAgentId:i,headingPresent:s&&F.path.length===1,label:F.path.length===1?r:`${r} · ${F.path.slice(1).join(".")}`,presentation:l,renderText:c,fallbackPrefixText:F.path.length===1?d:void 0}),p.jsx(db,{ref:F,label:r,callerAgentId:i})]},JSON.stringify([F.source,F.path,F.revision]))),D===void 0?null:p.jsx(N$,{kind:"content",state:x(D)?.status==="error"?"error":I?"loading":x(D)?.status??"idle",progress:m.length>1?`${r} · ${U} · ${h("transcript.content.morePending",m.length-1)}`:`${r} · ${U}`,error:f("transcript.content.failed"),label:r,onRequest:()=>{I?A():y!==void 0?w(S):E(D)},original:p.jsx(db,{ref:D,label:r,callerAgentId:i}),className:a})]})}const fb={lineThreshold:160,estimatedRowHeight:20,overscan:16,initialWidth:640,initialHeight:360,maxViewportHeight:448};function ZT({line:e,gutterWidth:t}){const n=t===void 0?void 0:e.tag==="delete"?String(e.lo):e.ln>0?String(e.ln):"",r=e.tag==="insert"?"bg-success/[0.09]":e.tag==="delete"?"bg-danger/[0.08]":void 0,i=e.tag==="insert"?"+":e.tag==="delete"?"−":" ",s=e.tag==="insert"?"text-success":e.tag==="delete"?"text-danger":"text-ink-faint";return p.jsxs("div",{"data-diff-tag":e.tag,className:"flex",children:[t===void 0?null:p.jsx("span",{className:"shrink-0 pr-2 text-right text-ink-faint select-none",style:{width:`${t+2}ch`},children:n}),p.jsx("span",{className:`w-3 shrink-0 text-center select-none ${s}`,children:i}),p.jsx("span",{className:`min-w-0 flex-1 px-1.5 whitespace-pre-wrap break-all ${r??""}`,children:e.text===""?" ":e.text})]})}function O$({hunks:e,numbered:t,gutterWidth:n,surface:r,config:i}){const{tp:s,t:o}=je(),a=b.useRef(null),u=b.useMemo(()=>{const d=[];for(let f=0;f<e.length;f+=1){const h=e[f];if(f>0){const m=e[f-1],x=t?zb(m,h):void 0;d.push({kind:"gap",key:`gap:${f}`,gap:x})}for(let m=0;m<h.length;m+=1)d.push({kind:"line",key:`line:${f}:${m}`,line:h[m]})}return d},[e,t]),l=Math.min(i.maxViewportHeight,Math.max(i.initialHeight,i.estimatedRowHeight*8)),c=jh({count:u.length,getScrollElement:()=>a.current,estimateSize:()=>i.estimatedRowHeight,overscan:i.overscan,initialRect:{width:i.initialWidth,height:l},observeElementRect:(d,f)=>Fh(d,h=>{f(h.height>0?h:{width:h.width>0?h.width:i.initialWidth,height:l})}),measureElement:(d,f,h)=>{const m=Math.round(f?.borderBoxSize?.[0]?.blockSize??d.getBoundingClientRect().height);if(m>0)return m;const x=h.indexFromElement(d);return h.options.estimateSize(x>=0?x:0)}});return p.jsx("div",{ref:a,"data-virtual-diff-card":!0,style:{height:l},className:`overflow-auto rounded-md py-1 font-mono text-[length:calc(var(--kiki-code-font-size,12.5px)-0.5px)] leading-[1.6] ${r}`,children:p.jsx("div",{style:{height:c.getTotalSize(),position:"relative"},children:c.getVirtualItems().map(d=>{const f=u[d.index];return p.jsx("div",{"data-index":d.index,ref:c.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${d.start}px)`},children:f.kind==="gap"?p.jsx("div",{className:"my-1 px-3 py-0.5 font-sans text-[12px] text-ink-faint italic select-none",children:f.gap!==void 0?s("diff.unchanged",f.gap):o("diff.unchangedSome")}):p.jsx(ZT,{line:f.line,gutterWidth:n})},f.key)})})})}function L$({hunks:e,numbered:t=!0,surface:n="bg-panel",virtualizeConfig:r}){const{tp:i,t:s}=je(),o=r===void 0?fb:{...fb,...r};let a=1,u=0;for(const c of e){u+=c.length;for(const d of c)a=Math.max(a,d.lo,d.ln)}const l=t?String(a).length:void 0;return u>o.lineThreshold?p.jsx(O$,{hunks:e,numbered:t,gutterWidth:l,surface:n,config:o}):p.jsx("div",{className:`overflow-x-auto rounded-md py-1 font-mono text-[length:calc(var(--kiki-code-font-size,12.5px)-0.5px)] leading-[1.6] ${n}`,children:e.map((c,d)=>{const f=d>0?e[d-1]:void 0,h=f!==void 0&&t?zb(f,c):void 0;return p.jsxs("div",{children:[d>0?p.jsx("div",{className:"my-1 px-3 py-0.5 font-sans text-[12px] text-ink-faint italic select-none",children:h!==void 0?i("diff.unchanged",h):s("diff.unchangedSome")}):null,p.jsx("div",{children:c.map((m,x)=>p.jsx(ZT,{line:m,gutterWidth:l},x))})]},d)})})}function lK(){let e=new Set;const t=new Set;return{subscribe:n=>(t.add(n),()=>{t.delete(n)}),has:n=>e.has(n),set:n=>{e=new Set(n);for(const r of t)r()}}}const P$={subscribe:()=>()=>{},has:()=>!1,set:()=>{}},M$=b.createContext(P$);function D$(e){const t=b.useContext(M$);return b.useSyncExternalStore(t.subscribe,()=>typeof e=="string"?t.has(e):e?.some(n=>t.has(n))===!0,()=>!1)}function F$(e,t,n){const r=D$(e);b.useEffect(()=>{r&&!t&&n(!0)},[r,t,n])}function JT(e){let t=Date.now(),n,r=!1;const i=new Set,s=()=>{n!==void 0&&(clearInterval(n),n=void 0)},o=()=>{t=Date.now();for(const l of i)l()},a=()=>{if(n!==void 0||i.size===0||typeof document<"u"&&document.visibilityState==="hidden")return;const l=Date.now();(l-t>=e||l<t)&&(t=l),n=setInterval(o,e)},u=()=>{i.size!==0&&(document.visibilityState==="hidden"?s():(o(),a()))};return{subscribe(l){return i.add(l),!r&&typeof document<"u"&&(r=!0,document.addEventListener("visibilitychange",u)),a(),()=>{i.delete(l),i.size===0&&s()}},getSnapshot:()=>t}}const j$=10080*60*1e3,ew=JT(1e3),tw=JT(6e4),Qh=e=>ew.subscribe(e),us=()=>ew.getSnapshot(),B$=e=>tw.subscribe(e),hb=()=>tw.getSnapshot();function cK(){return b.useSyncExternalStore(Qh,us,us)}const nw=()=>()=>{},Su=()=>0;function dK(e){const t=e!==void 0,n=b.useSyncExternalStore(t?Qh:nw,t?us:Su,t?us:Su);return e===void 0?void 0:Math.max(0,n-e)}function H$({at:e,className:t}){const{time:n}=je(),r=Date.now()-Date.parse(e),i=r<6e4,s=Number.isNaN(r)||r>=j$;return b.useSyncExternalStore(s?nw:i?Qh:B$,s?Su:i?us:hb,s?Su:i?us:hb),p.jsx("span",{className:t,children:n.relativeTime(e)})}const fK="pl-6",U$={plain:"text-ink-soft",danger:"text-ink",warn:"text-ink",accent:"text-ink"},$$={plain:"text-ink-faint",danger:"text-danger",warn:"text-amber-ink",accent:"text-accent-ink"},z$={plain:"text-ink-faint",danger:"text-danger",warn:"text-amber-rule",accent:"text-accent"},q$={plain:"hover:bg-ink/[0.04]",danger:"bg-danger/[0.05] hover:bg-danger/[0.09]",warn:"hover:bg-amber-card/60",accent:"hover:bg-ink/[0.04]"},W$="min-w-[52px] shrink-0 text-right font-mono text-[12px] tabular-nums text-ink-faint",V$="min-w-[46px] shrink-0 text-right text-[12px] tabular-nums whitespace-nowrap text-ink-faint",K$="shrink-0 text-right text-[12px] whitespace-nowrap text-ink-faint",pb="w-[76px] shrink-0 overflow-hidden text-right text-[12px] tabular-nums whitespace-nowrap text-ink-faint",Y$="flex h-3.5 w-3.5 shrink-0 items-center justify-center";function G$({glyph:e,label:t,detail:n,tone:r="plain",stats:i,meta:s,metaTitle:o,metaWidth:a="fixed",status:u,expanded:l,onToggle:c,chevronInGlyph:d=!1,onOpen:f,title:h,ariaLabel:m,buttonAttrs:x,children:E,aside:y,attrs:v,className:k="",layout:S,nested:T=!1,shrinkLabel:w=!1}){const I=c??f,A=p.jsx("span",{"data-activity-label":!0,className:`${w?"min-w-0 shrink truncate":"shrink-0"} font-sans text-[13px] font-medium ${U$[r]}`,children:t}),O=p.jsx("span",{"data-activity-detail":!0,className:`min-w-0 flex-1 truncate font-sans text-[12px] ${$$[r]}`,children:n}),_=p.jsxs(p.Fragment,{children:[p.jsx("span",{"aria-hidden":!0,className:`flex h-4 w-[18px] shrink-0 items-center justify-center ${z$[r]}`,children:e}),S==="question"?p.jsxs("span",{className:"grid min-w-0 flex-1 gap-x-2 md:grid-cols-[8rem_minmax(0,1fr)] md:[&:lang(zh)]:grid-cols-[4.5rem_minmax(0,1fr)]",children:[A,O]}):p.jsxs(p.Fragment,{children:[A,n===void 0?p.jsx("span",{className:"min-w-0 flex-1"}):O]}),i===void 0?null:p.jsx("span",{className:W$,children:i}),s===void 0&&S!=="question"?null:p.jsx("span",{"data-activity-meta":!0,title:o,className:S==="question"?pb:a==="auto"?K$:a==="wide"?pb:V$,children:s}),u===void 0?null:p.jsx("span",{className:Y$,children:u}),c===void 0||d?null:p.jsx(Ib,{open:l===!0,className:`text-ink-faint ${l===!0||S==="question"?"":"opacity-0 group-hover/act:opacity-100 group-focus-visible/act:opacity-100"}`})]}),D=w&&y!==void 0?`${T?"-ml-[17px] pl-[17px]":"-ml-[34px] pl-[34px]"} flex-1`:`${T?"-ml-[17px] w-[calc(100%+25px)] pl-[17px]":"-ml-[34px] w-[calc(100%+42px)] pl-[34px]"}${y===void 0?" -mr-2":""}`,U=`group/act flex min-h-[26px] pointer-coarse:min-h-10 min-w-0 items-center gap-2 rounded-md py-0.5 text-left transition-colors duration-[var(--kiki-motion-quick)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-selected-ink ${q$[r]} ${D} pr-2`;return p.jsxs("div",{"data-activity-row":!0,"data-activity-layout":S,title:h,className:`anim-enter ${k}`,...v,children:[p.jsxs("div",{className:"flex items-center gap-1",children:[I===void 0?p.jsx("div",{className:U,children:_}):p.jsx("button",{type:"button",onClick:I,"aria-expanded":c===void 0?void 0:l===!0,"aria-label":m,"data-activity-toggle":!0,className:U,...x,children:_}),y]}),E===void 0?null:p.jsx("div",{className:"pt-1 pb-1.5",children:E})]})}function hK({insertions:e,deletions:t}){return p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"text-success",children:["+",e]})," ",p.jsxs("span",{className:"text-danger",children:["−",t]})]})}function pK({children:e,tone:t="plain",attrs:n,title:r}){const i=t==="warn"?"bg-amber-rule/40":"bg-hairline",s=t==="warn"?"text-amber-ink":"text-ink-faint";return p.jsxs("div",{"data-timeline-divider":!0,className:"anim-enter flex min-w-0 items-center gap-3 py-1",title:r,...n,children:[p.jsx("span",{className:`h-px min-w-4 flex-1 ${i}`}),p.jsx("span",{className:`min-w-0 max-w-[min(82%,44rem)] truncate text-[12px] ${s}`,children:e}),p.jsx("span",{className:`h-px min-w-4 flex-1 ${i}`})]})}function mK(e){return e.id.includes("interruption")||e.i18n?.key==="transcript.marker.interruption"}function gK(e){return e.tone==="neutral"&&e.id.startsWith("notice-aborted-")}const X$={approved:"ia.resolution.approved",rejected:"ia.resolution.rejected",cancelled:"ia.resolution.cancelled",expired:"ia.resolution.expired",resolved_elsewhere:"ia.resolution.resolvedElsewhere"},Q$=b.memo(function({node:t,originName:n}){const{t:r}=je(),[i,s]=b.useState(!1);F$(t.id,i,s);let o,a,u,l,c,d;if(t.kind==="approval"){const f=t.resolution;if(f===void 0)return null;const h=f.decision==="rejected"||f.decision==="cancelled";o="gate",a=h?"danger":"plain",u=`${t.request.tool_name} · ${t.request.action}`,l=r(X$[f.decision]),f.reviewer!==void 0&&(l=XT(f.decision,f.reviewer,r,l),c=QT(f.reviewer,r)),d=f.resolvedAt}else{const f=t.outcome;if(f===void 0)return null;o="ask",a="plain";const m=t.request.questions[0]?.question??"",x=f.kind==="answered"&&f.answers!==void 0?t.request.questions.map(y=>f.answers?.[y.id]).filter(y=>y!==void 0&&y.trim()!==""):[],E=x.length>0?x.join(", "):f.kind==="answered"&&f.answers!==void 0?Object.values(f.answers).filter(y=>y.trim()!=="").join(", "):"";u=E!==""?`${m} · ${E}`:m,l=r(`ia.question.${f.kind}`),f.kind==="cancelled"&&["no_consumer","turn_ended","agent_closed","aborted"].includes(f.reason??"")&&(c=r(`ia.question.cancelled.${f.reason}`)),d=f.kind==="expired"?void 0:f.at}return p.jsx(G$,{attrs:{"data-history-line":!0,"data-question-history":t.kind==="question"?t.outcome?.kind:void 0},glyph:p.jsx(Je,{name:o}),tone:a,label:l,title:c,detail:p.jsx("span",{title:u,children:n===void 0?u:`${n} · ${u}`}),meta:d===void 0?void 0:p.jsx(H$,{at:d}),layout:t.kind==="question"?"question":void 0,expanded:t.kind==="question"?i:void 0,onToggle:t.kind==="question"?()=>{s(f=>!f)}:void 0,children:t.kind==="question"&&i?p.jsxs("div",{"data-question-details":!0,className:"space-y-4 py-2 pl-[26px] pr-2 text-[13px]",children:[c===void 0?null:p.jsx("p",{className:"text-ink-soft",children:c}),t.request.questions.map(f=>{const h=t.outcome?.kind==="answered"?t.outcome.answers?.[f.id]:void 0;return p.jsxs("div",{className:"min-w-0 space-y-1",children:[f.header===void 0?null:p.jsx("p",{className:"text-[12px] text-ink-faint",children:f.header}),p.jsx("p",{className:"break-words font-medium text-ink-soft",children:f.question}),f.body===void 0?null:p.jsx("div",{className:"text-ink-soft",children:p.jsx(Xh,{text:f.body})}),t.outcome?.kind==="answered"?p.jsx("p",{"data-question-answer":!0,className:`whitespace-pre-wrap break-words ${h===void 0?"text-ink-faint":"text-ink"}`,children:h??r("ia.question.answerUnavailable")}):p.jsx("ul",{className:"space-y-1 text-ink-faint",children:f.options.map(m=>p.jsx("li",{className:"break-words",children:m.label},m.id))})]},f.id)})]}):void 0})});function rw(e){const t=e.replace(/[\\/]+$/,"").length;if(t===0)return{dir:"",name:e};const n=Math.max(e.lastIndexOf("/",t-1),e.lastIndexOf("\\",t-1));return n<0?{dir:"",name:e}:{dir:e.slice(0,n+1),name:e.slice(n+1)}}function Z$(e){return Math.min(Math.floor(e.length/2),12)}function J$({path:e,className:t}){const{dir:n,name:r}=rw(e),i=Z$(r);return p.jsxs("span",{"data-path-text":!0,title:e,className:`inline-flex max-w-full min-w-0 align-bottom ${t??""}`,children:[n===""?null:p.jsx("span",{"data-path-dir":!0,className:"min-w-0 truncate [direction:rtl]",children:p.jsx("bdi",{dir:"ltr",children:n})}),p.jsxs("span",{"data-path-name":!0,className:"flex max-w-full min-w-0 shrink-0",children:[p.jsx("span",{className:"min-w-0 truncate",children:r.slice(0,r.length-i)}),p.jsx("span",{className:"shrink-0 whitespace-pre",children:r.slice(r.length-i)})]})]})}const ez="native_ssh",bK=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,xK=/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,253}$/,ia={all:["ssh"],hosts:()=>["ssh","hosts"],hostsWithStatus:()=>["ssh","hosts","with-status"],discovered:()=>["ssh","discovered"],approval:()=>["ssh","connection-approval"],configSync:()=>["ssh","config-sync"],hostKeys:e=>["ssh","host-keys",e],status:e=>["ssh","status",e],session:e=>["ssh","session-hosts",e]};function Es(e){const t=e.klient.rest;if(t===void 0)throw new Error("SSH host management needs an HTTP connection to the server.");return t.ssh}function yK(e){if(e.hostname===void 0)return;const t=e.user===void 0?"":`${e.user}@`,n=e.port===void 0||e.port===22?"":`:${e.port}`;return`${t}${e.hostname}${n}`}function EK(e){return e.source==="kiki"&&e.hostname!==void 0&&e.user!==void 0}function vK(e){return di({queryKey:ia.configSync(),queryFn:()=>Es(e).configSync(),staleTime:3e4})}function kK(e,t,n){return di({queryKey:ia.hostKeys(t),queryFn:()=>Es(e).hostKeys(t),enabled:n,staleTime:3e4})}function TK(e){if(!(e===void 0||e.state==="idle"))return e.state}function wK(e,t){const r=di({queryKey:t===void 0?["meta"]:["meta",t],queryFn:()=>e.meta(),enabled:e!==null,staleTime:15e3,placeholderData:Rw});return{enabled:r.data===void 0?void 0:r.data.experimental_flags?.[ez]===!0,loading:e!==null&&r.isLoading}}function SK(e,t=!0){return di({queryKey:ia.hosts(),queryFn:async()=>(await Es(e).list()).hosts,enabled:t,retry:(n,r)=>!Zd(r)&&n<2,staleTime:1e4})}function _K(e,t=!0){return di({queryKey:ia.hostsWithStatus(),queryFn:async()=>{const n=await Es(e).list();return{hosts:n.hosts,statuses:n.statuses??{}}},enabled:t,retry:(n,r)=>!Zd(r)&&n<2,staleTime:1e4})}function CK(e,t,n=!0){return di({queryKey:ia.session(t??""),queryFn:async()=>(await Es(e).sessionHosts(t)).hosts,enabled:n&&t!==void 0,retry:(r,i)=>!Zd(i)&&r<2,staleTime:5e3,refetchOnWindowFocus:!0})}function AK(e){const t=e.roots.split(/\r?\n/).map(r=>r.trim()).filter(r=>r!==""),n=e.port.trim();return{name:e.name.trim(),...e.hostname.trim()!==""?{hostname:e.hostname.trim()}:{},...e.user.trim()!==""?{user:e.user.trim()}:{},...n!==""?{port:Number(n)}:{},...e.identityFile.trim()!==""?{identityFile:e.identityFile.trim()}:{},...t.length>0?{roots:t}:{},...e.description.trim()!==""?{description:e.description.trim()}:{},agentAccess:e.offered?"offered":"hidden"}}const tz="rounded-lg border border-hairline bg-paper px-3 py-2 text-[12px] text-ink outline-none transition-colors placeholder:text-ink-faint focus:border-accent disabled:cursor-not-allowed disabled:bg-hairline/20 disabled:text-ink-faint",Xs=`w-full ${tz}`,IK="rounded-md border border-hairline bg-paper px-2 py-1.5 text-[12px] text-ink outline-none focus:border-accent disabled:cursor-not-allowed disabled:bg-hairline/20 disabled:text-ink-faint",nz="rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-on-accent transition-colors hover:bg-accent-deep disabled:cursor-not-allowed disabled:bg-hairline disabled:text-ink-faint",rz="rounded-md border border-hairline bg-paper px-3 py-1.5 text-[12px] text-ink-soft transition-colors hover:border-hairline-strong hover:text-ink disabled:cursor-not-allowed disabled:opacity-50",NK="rounded-md bg-danger px-3 py-1.5 text-[12px] font-semibold text-on-danger transition-colors hover:bg-danger/90 disabled:cursor-not-allowed disabled:opacity-50",RK="rounded-md border border-danger/40 bg-paper px-3 py-1.5 text-[12px] text-danger transition-colors hover:bg-danger/5 disabled:cursor-not-allowed disabled:opacity-50";function OK({id:e,dirty:t,saving:n=!1,saveDisabled:r=!1,saveLabel:i,onSave:s,onDiscard:o,restartRequired:a=!1,extra:u,persistent:l=!1,saved:c=!1}){const{t:d}=je();fS(e,t);const f=l||t||n||a,h=c&&!t&&!n;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{"data-settings-draft":e,"data-dirty":t?"true":void 0,hidden:!f,className:`flex flex-wrap items-center gap-2 pt-3 ${f?"anim-enter":""}`,children:[p.jsx("button",{type:"button",className:nz,disabled:!t||n||r,onClick:s,children:n?d("common.saving"):i??d("common.save")}),p.jsx("button",{type:"button","data-settings-discard":e,className:rz,disabled:!t||n,onClick:o,children:d("st.advanced.discard")}),t?p.jsx("span",{role:"status",className:"text-[12px] text-ink-faint",children:d("st.draft.unsaved")}):null,h&&f?p.jsx(ap,{show:!0}):null,a?p.jsx("span",{className:"text-[12px] text-ink-soft",children:d("st.badge.restartRequired")}):null,u!==void 0?p.jsx("span",{className:"ml-auto flex items-center gap-2",children:u}):null]}),h&&!f?p.jsx("div",{"data-settings-draft-saved":e,className:"pt-3",children:p.jsx(ap,{show:!0})}):null]})}function LK({id:e,value:t,onCommit:n,validate:r,disabled:i=!1,className:s="",inputMode:o,placeholder:a,ariaLabel:u,ariaDescribedBy:l,dataAttr:c}){const[d,f]=b.useState(t),[h,m]=b.useState(null),x=b.useId();b.useEffect(()=>{f(t),m(null)},[t]);const E=()=>{const v=d.trim(),k=r?.(v)??null;m(k),k===null&&v!==t&&n(v)},y=[l,h!==null?x:void 0].filter(Boolean).join(" ")||void 0;return p.jsxs("div",{className:"min-w-0",children:[p.jsx("input",{id:e,value:d,disabled:i,inputMode:o,placeholder:a,"aria-label":u,"aria-invalid":h!==null,"aria-describedby":y,...c!==void 0?{[c]:""}:{},autoComplete:"off",spellCheck:!1,className:`h-8 rounded-md border bg-paper px-3 text-[13px] tabular-nums text-ink outline-none transition-colors placeholder:text-ink-faint focus:border-selected-ink disabled:cursor-not-allowed disabled:bg-hairline/20 disabled:text-ink-faint ${h!==null?"border-danger":"border-hairline hover:border-hairline-strong"} ${s}`,onChange:v=>{f(v.target.value),h!==null&&m(null)},onBlur:E,onKeyDown:v=>{Qn(v)||(v.key==="Enter"?(v.preventDefault(),E()):v.key==="Escape"&&(f(t),m(null)))}}),p.jsx(sz,{id:x,text:h})]})}function PK({label:e,value:t}){return p.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1 text-[13px]",children:[p.jsx("dt",{className:"text-ink-soft",children:e}),p.jsx("dd",{className:"min-w-0 break-all text-right text-ink",children:typeof t=="boolean"?String(t):t})]})}function MK({list:e,detail:t,narrowPane:n="list",columns:r}){return p.jsxs("div",{className:`grid min-w-0 gap-6 ${r??"md:grid-cols-[minmax(168px,0.75fr)_minmax(0,1.7fr)]"}`,"data-settings-list-detail":!0,"data-narrow-pane":n,children:[p.jsx("div",{className:`min-w-0 ${n==="detail"?"max-md:hidden":""}`,children:e}),p.jsx("div",{className:`min-w-0 md:border-l md:border-hairline md:pl-6 ${n==="list"?"max-md:hidden":""}`,children:t})]})}const DK="block text-[12px] font-medium text-ink-soft",iz="flex w-full min-w-0 items-center justify-between gap-1.5 rounded-lg border border-hairline bg-paper px-3 py-2 text-left text-[12px] text-ink outline-none transition-colors hover:border-hairline-strong focus-visible:border-selected-ink disabled:cursor-not-allowed disabled:bg-hairline/20 disabled:text-ink-faint";function sz({id:e,text:t}){return t===null?null:p.jsx("p",{id:e,role:"alert","data-field-issue":!0,className:"mt-1 text-[12px] leading-4 text-danger",children:t})}const oz="flex h-8 max-w-full items-center gap-1.5 rounded-md bg-ink/[0.04] px-3 text-[13px] text-ink outline-none transition-colors hover:bg-ink/[0.07] disabled:cursor-not-allowed disabled:text-ink-faint";function mb({choices:e,value:t,onChange:n,disabled:r=!1,ariaLabel:i,ariaLabelledBy:s,dataAttr:o}){return p.jsx("div",{role:"group","aria-label":i,"aria-labelledby":s,className:"inline-flex max-w-full flex-wrap items-center gap-0.5 rounded-md bg-ink/[0.04] p-0.5",children:e.map(a=>{const u=a.value===t;return p.jsx("button",{type:"button","aria-pressed":u,disabled:r||a.disabled===!0,...o!==void 0?{[o]:a.value}:{},onClick:()=>{u||n(a.value)},className:`h-7 rounded-[5px] px-3 text-[13px] transition-colors disabled:cursor-not-allowed disabled:text-ink-faint pointer-coarse:min-h-11 ${u?a.caution===!0?"bg-amber-card font-medium text-amber-ink shadow-[var(--kiki-sheet-shadow)]":"bg-panel font-medium text-ink shadow-[var(--kiki-sheet-shadow)]":"text-ink-soft hover:text-ink"}`,children:a.label},a.value)})})}function FK({id:e,choices:t,value:n,onChange:r,ariaLabel:i,ariaLabelledBy:s,ariaInvalid:o,disabled:a,className:u,variant:l="row",emptyText:c,dataAttr:d,triggerData:f,mono:h=!1}){const m=l==="form"?iz:oz,x=p.jsx(pU,{id:e,options:t,value:n,ariaLabel:i,ariaLabelledBy:s,ariaInvalid:o,disabled:a,emptyText:c,triggerData:f,onChange:E=>{r(E)},align:l==="row"?"end":"start",placement:"auto",buttonClassName:`${m} ${h?"font-mono":""} ${u??""}`});return d===void 0?x:p.jsx("div",{className:"contents",[d]:n,children:x})}const az="rounded text-[12px] font-medium text-ink underline-offset-2 transition-colors hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-selected-ink disabled:cursor-not-allowed disabled:text-ink-faint disabled:no-underline";function jK({tabs:e,current:t,ariaLabel:n,labelOf:r,onSelect:i,dataAttr:s="data-settings-tab"}){return p.jsx("div",{role:"tablist","aria-label":n,className:"flex flex-wrap gap-1 border-b border-hairline",children:e.map(o=>{const a=o===t;return p.jsx("button",{type:"button",role:"tab","aria-selected":a,[s]:o,onClick:()=>{a||i(o)},className:`-mb-px min-h-9 border-b-2 px-3 py-1.5 text-[13px] transition-colors ${a?"border-ink font-medium text-ink":"border-transparent text-ink-soft hover:text-ink"}`,children:r(o)},o)})})}const uz=300;function BK({label:e,rows:t,rowHeight:n=56}){const[r,i]=b.useState(!1);return b.useEffect(()=>{const s=setTimeout(()=>{i(!0)},uz);return()=>{clearTimeout(s)}},[]),r?t===void 0?p.jsx("p",{role:"status","data-settings-loading":!0,className:"text-[12px] text-ink-faint",children:e}):p.jsx("div",{role:"status","aria-label":e,"data-settings-loading":!0,className:"border-t border-hairline",children:Array.from({length:t},(s,o)=>p.jsx("div",{style:{height:n},className:"border-b border-hairline",children:p.jsx("div",{className:"mx-2 mt-4 h-3 w-1/3 rounded bg-ink/[0.05]"})},o))}):null}function HK({message:e,onRetry:t,retrying:n=!1}){const{t:r}=je();return p.jsxs("div",{"data-settings-load-failure":!0,className:"flex flex-wrap items-start gap-x-3 gap-y-1",children:[p.jsx(dS,{feedback:{tone:"error",text:e}}),t!==void 0?p.jsx("button",{type:"button","data-settings-retry":!0,disabled:n,onClick:t,className:`leading-[18px] ${az}`,children:r("common.retry")}):null]})}const lz="inline-flex min-h-8 items-center rounded-md bg-accent px-3 text-[13px] font-medium text-primary-foreground transition-colors duration-[var(--kiki-motion-quick)] hover:bg-accent-deep disabled:cursor-not-allowed disabled:bg-hairline disabled:text-ink-faint",cz="inline-flex min-h-8 items-center rounded-md px-3 text-[13px] font-medium text-ink-soft transition-colors duration-[var(--kiki-motion-quick)] hover:bg-ink/[0.05] hover:text-ink disabled:opacity-60",Ci="block text-[12px] font-medium text-ink-soft";function dz(e){const t=/^Connect SSH host (.+) \(([^()]+)\)$/.exec(e);if(t!==null)return{name:t[1],id:t[2]};const n=/^(?:Trust SSH host key|SSH authentication for) (.+)$/.exec(e);if(n!==null)return{name:n[1],id:n[1]}}function iw(e){return e.kind==="host_key"?"host_key":e.prompts!==void 0&&e.prompts.length>0?"prompts":"connect"}function fz(e){const t=iw(e);return t==="host_key"?"ia.ssh.hostKeyTitle":t==="prompts"?"ia.ssh.promptsTitle":"ia.ssh.title"}function hz({ssh:e}){const{t}=je(),n=[{label:t("ia.ssh.user"),value:e.user},{label:t("ia.ssh.target"),value:`${e.hostname}:${e.port}`}];return e.proxyJump!==void 0&&e.proxyJump!==""&&n.push({label:t("ia.ssh.via"),value:e.proxyJump}),e.proxyCommand!==void 0&&e.proxyCommand!==""&&n.push({label:t("ia.ssh.proxyCommand"),value:e.proxyCommand}),p.jsx("dl",{className:"mt-2 grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-1 rounded-md bg-ink/[0.04] px-3 py-2 text-[12px] leading-[18px]",children:n.map(r=>p.jsxs("div",{className:"contents",children:[p.jsx("dt",{className:"text-ink-faint",children:r.label}),p.jsx("dd",{className:"min-w-0 break-all font-mono text-ink",children:r.value})]},r.label))})}function pz({ssh:e,action:t,toolName:n,busy:r,failed:i,onSubmit:s}){const{t:o}=je(),a=dz(t),u=iw(e);return p.jsxs("div",{"data-ssh-approval":u,"data-ssh-host":a?.id,children:[p.jsxs("p",{className:"mt-1 min-w-0 text-[14px] leading-snug text-ink",children:[o(u==="host_key"?"ia.ssh.hostKeyFor":u==="prompts"?"ia.ssh.promptsFor":"ia.ssh.connectTo")," ",p.jsx("span",{className:"font-medium",children:a?.name??e.hostname}),a!==void 0&&a.name!==a.id?p.jsxs("span",{className:"font-mono text-[13px] text-ink-faint",children:[" ",a.id]}):null]}),p.jsx(hz,{ssh:e}),u==="host_key"?p.jsx(bz,{ssh:e,busy:r,failed:i,onSubmit:s}):u==="prompts"?p.jsx(gz,{ssh:e,busy:r,failed:i,onSubmit:s}):p.jsx(mz,{ssh:e,toolName:n,busy:r,failed:i,onSubmit:s})]})}function Zh({busy:e,failed:t,primaryLabel:n,primaryDisabled:r=!1,onReject:i,rejectLabel:s}){const{t:o}=je();return p.jsxs("div",{"data-ssh-actions":!0,className:"mt-3 [[data-tray-current]_&]:sticky [[data-tray-current]_&]:-bottom-3 [[data-tray-current]_&]:z-[1] [[data-tray-current]_&]:-mx-1 [[data-tray-current]_&]:-mb-3 [[data-tray-current]_&]:px-1 [[data-tray-current]_&]:border-t [[data-tray-current]_&]:border-hairline [[data-tray-current]_&]:bg-panel [[data-tray-current]_&]:pt-2 [[data-tray-current]_&]:pb-3","aria-busy":e!==null,children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-2",children:[p.jsx("button",{type:"submit","data-ssh-submit":!0,className:lz,disabled:e!==null||r,children:e==="approved"?o("ia.approving"):n}),p.jsx("button",{type:"button","data-ssh-reject":!0,className:cz,disabled:e!==null,onClick:i,children:e==="rejected"?o("ia.rejecting"):s})]}),t?p.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:o("ia.sendFailed")}):null]})}function mz({ssh:e,toolName:t,busy:n,failed:r,onSubmit:i}){const{t:s}=je(),o=b.useId(),[a,u]=b.useState("agent"),[l,c]=b.useState(""),[d,f]=b.useState(""),[h,m]=b.useState(""),[x,E]=b.useState(""),[y,v]=b.useState("workspace"),k=()=>{c(""),m(""),E("")};b.useEffect(()=>k,[]);const S=a==="password"?l==="":a==="keyFile"?d.trim()==="":a==="keyText"?h.trim()==="":!1,T=()=>{if(a==="agent")return;const I=x===""?{}:{passphrase:x};return a==="password"?{password:l,save:y}:a==="keyFile"?{privateKeyPath:d.trim(),...I,save:y}:{privateKeyContents:h,...I,save:y}},w=()=>{if(S)return;const I={decision:"approved",...T()===void 0?{}:{credential:T()}};k(),i(I)};return p.jsxs("form",{className:"mt-3 space-y-3",autoComplete:"off",onSubmit:I=>{I.preventDefault(),w()},children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("p",{id:`${o}-method`,className:Ci,children:s("ia.ssh.signInWith")}),p.jsx(mb,{ariaLabelledBy:`${o}-method`,value:a,onChange:u,dataAttr:"data-ssh-method",choices:[{value:"agent",label:s("ia.ssh.method.agent")},{value:"password",label:s("ia.ssh.method.password")},{value:"keyFile",label:s("ia.ssh.method.keyFile")},{value:"keyText",label:s("ia.ssh.method.keyText")}]}),a==="agent"?p.jsx("p",{className:"text-[12px] leading-4 text-ink-faint",children:s("ia.ssh.method.agentHint")}):null]}),a==="password"?p.jsxs("div",{children:[p.jsx("label",{htmlFor:`${o}-password`,className:Ci,children:s("ia.ssh.passwordFor",{target:`${e.user}@${e.hostname}`})}),p.jsx("input",{id:`${o}-password`,"data-ssh-password":!0,type:"password",autoComplete:"off","data-autofocus":!0,className:`${Xs} mt-1.5 max-w-sm`,value:l,onChange:I=>{c(I.target.value)}})]}):null,a==="keyFile"?p.jsxs("div",{children:[p.jsx("label",{htmlFor:`${o}-keypath`,className:Ci,children:s("ia.ssh.keyPath")}),p.jsx("input",{id:`${o}-keypath`,"data-ssh-key-path":!0,spellCheck:!1,className:`${Xs} mt-1.5 max-w-md font-mono`,placeholder:"~/.ssh/id_ed25519",value:d,onChange:I=>{f(I.target.value)}})]}):null,a==="keyText"?p.jsxs("div",{children:[p.jsx("label",{htmlFor:`${o}-keytext`,className:Ci,children:s("ia.ssh.keyText")}),p.jsx("textarea",{id:`${o}-keytext`,"data-ssh-key-text":!0,rows:3,spellCheck:!1,autoComplete:"off",className:`${Xs} mt-1.5 resize-y font-mono leading-5`,placeholder:s("ia.ssh.keyTextPlaceholder"),value:h,onChange:I=>{m(I.target.value)}})]}):null,a==="keyFile"||a==="keyText"?p.jsxs("div",{children:[p.jsx("label",{htmlFor:`${o}-pass`,className:Ci,children:s("ia.ssh.passphrase")}),p.jsx("input",{id:`${o}-pass`,"data-ssh-passphrase":!0,type:"password",autoComplete:"off",className:`${Xs} mt-1.5 max-w-sm`,value:x,onChange:I=>{E(I.target.value)}})]}):null,a!=="agent"?p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("p",{id:`${o}-save`,className:Ci,children:s("ia.ssh.saveTo")}),p.jsx(mb,{ariaLabelledBy:`${o}-save`,value:y,onChange:v,dataAttr:"data-ssh-save",choices:[{value:"workspace",label:s("ia.ssh.save.workspace")},{value:"global",label:s("ia.ssh.save.global")},{value:"session",label:s("ia.ssh.save.session")}]}),p.jsx("p",{className:"text-[12px] leading-4 text-ink-faint",children:s(y==="session"?"ia.ssh.save.sessionHint":"ia.ssh.save.storedHint")})]}):null,p.jsx("p",{className:"text-[12px] leading-4 text-ink-faint",children:s("ia.ssh.afterApprove",{tool:t})}),p.jsx(Zh,{busy:n,failed:r,primaryLabel:s(a==="agent"?"ia.ssh.approve":"ia.ssh.signInConnect"),primaryDisabled:S,rejectLabel:s("ia.reject"),onReject:()=>{k(),i({decision:"rejected"})}})]})}function gz({ssh:e,busy:t,failed:n,onSubmit:r}){const{t:i}=je(),s=b.useId(),o=e.prompts??[],[a,u]=b.useState(()=>o.map(()=>"")),l=b.useRef(null),c=o.some((d,f)=>(a[f]??"")==="");return p.jsxs("form",{className:"mt-3 space-y-3",autoComplete:"off",onSubmit:d=>{if(d.preventDefault(),c)return;const f={decision:"approved",credential:{answers:o.map((h,m)=>a[m]??"")}};u(o.map(()=>"")),r(f)},children:[p.jsx("p",{className:"text-[12px] leading-4 text-ink-faint",children:i("ia.ssh.promptsHint")}),o.map((d,f)=>p.jsxs("div",{children:[p.jsx("label",{htmlFor:`${s}-${f}`,className:"block font-mono text-[12px] text-ink",children:d.prompt.trim()}),p.jsx("input",{ref:f===0?l:void 0,id:`${s}-${f}`,"data-ssh-prompt":f,"data-autofocus":f===0?"":void 0,type:d.echo?"text":"password",autoComplete:d.echo?"one-time-code":"off",inputMode:d.echo?"numeric":void 0,spellCheck:!1,className:`${Xs} mt-1.5 max-w-xs font-mono ${d.echo?"tabular-nums tracking-[0.12em]":""}`,value:a[f]??"",onChange:h=>{const m=h.target.value;u(x=>x.map((E,y)=>y===f?m:E))}})]},`${f}-${d.prompt}`)),p.jsx(Zh,{busy:t,failed:n,primaryLabel:i("ia.ssh.sendAnswer"),primaryDisabled:c,rejectLabel:i("ia.ssh.cancelSignIn"),onReject:()=>{r({decision:"rejected"})}})]})}function bz({ssh:e,busy:t,failed:n,onSubmit:r}){const{t:i}=je(),s=e.fingerprint??"",o=s.startsWith("SHA256:")?s:`SHA256:${s}`;return p.jsxs("form",{className:"mt-2",onSubmit:a=>{a.preventDefault(),r({decision:"approved"})},children:[p.jsxs("div",{"data-ssh-fingerprint":!0,className:"rounded-md border border-hairline px-3 py-2",children:[p.jsx("p",{className:"text-[12px] text-ink-faint",children:i("ia.ssh.keyFirstSeen",{algorithm:e.algorithm??""})}),p.jsx("p",{className:"mt-0.5 break-all font-mono text-[13px] leading-5 text-ink",children:o})]}),p.jsx("p",{className:"mt-1.5 max-w-[62ch] text-[12px] leading-4 text-ink-faint",children:i("ia.ssh.keyCheckHint")}),p.jsx(Zh,{busy:t,failed:n,primaryLabel:i("ia.ssh.trustKey"),rejectLabel:i("ia.ssh.dontTrust"),onReject:()=>{r({decision:"rejected"})}})]})}function xz({block:e,ssh:t,originAgentName:n}){const{client:r}=Au(),{t:i,time:s}=je(),o=Xw("/s/:id/*")?.params.id,[a,u]=b.useState(null),[l,c]=b.useState(!1),[d,f]=b.useState(null),h=b.useRef(0),m=e.request.approval_id;b.useEffect(()=>{h.current+=1,u(null),c(!1),f(null)},[m]),b.useEffect(()=>()=>{h.current+=1},[]);const x=E=>{if(a!==null||d!==null)return;const y=h.current;u(E.decision),c(!1);const v=e.request.session_id!==""?e.request.session_id:o;if(v===void 0){u(null),c(!0);return}r.runSessionMutation(v,()=>Es(r).submitApproval(v,m,E)).then(()=>{h.current===y&&f(E.decision)}).catch(()=>{h.current===y&&c(!0)}).finally(()=>{h.current===y&&u(null)})};return p.jsxs("div",{"data-ssh-approval-id":m,className:"anim-enter border-l-2 border-accent py-2 pr-3 pl-3",children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[12px]",children:[p.jsx("span",{className:"font-medium text-accent-ink",children:i(fz(t))}),n!==void 0?p.jsxs("span",{className:"text-ink-faint",children:["· ",i("ia.fromSubagent",{name:n})]}):null,yz(e.request.expires_at)?p.jsx("span",{className:"ml-auto text-ink-faint tabular-nums",children:s.timeUntil(e.request.expires_at)}):null]}),d===null?p.jsx(pz,{ssh:t,action:e.request.action,toolName:e.request.tool_name,busy:a,failed:l,onSubmit:x}):p.jsx("p",{role:"status","data-ssh-answered":d,className:`mt-2 text-[13px] font-medium ${d==="approved"?"text-ink-soft":"text-danger"}`,children:i(d==="approved"?"ia.ssh.sent":"ia.resolution.rejected")})]})}function yz(e){const t=new Date(e).getTime()-Date.now();return Number.isFinite(t)&&t>0&&t<10*6e4}function Ez(e){if(typeof e!="object"||e===null)return;const t=e;if(t.kind!=="plan_review"||typeof t.plan!="string")return;const n=Array.isArray(t.options)?t.options.filter(r=>typeof r=="object"&&r!==null&&typeof r.label=="string").map(r=>({label:r.label,description:typeof r.description=="string"?r.description:""})):void 0;return{plan:t.plan,path:typeof t.path=="string"?t.path:void 0,options:n}}const Jh="anim-enter border-l-2 border-accent py-2 pr-3 pl-3",gb="mt-2 max-h-64 overflow-auto rounded-md bg-ink/[0.04] px-3 py-2 font-mono text-[12px] leading-relaxed whitespace-pre-wrap break-words text-ink",ep="inline-flex min-h-8 pointer-coarse:min-h-11 items-center rounded-md bg-accent px-3 text-[13px] font-medium text-primary-foreground transition-colors duration-[var(--kiki-motion-quick)] hover:bg-accent-deep disabled:opacity-60",hr="inline-flex min-h-8 pointer-coarse:min-h-11 items-center rounded-md px-3 text-[13px] font-medium text-ink-soft transition-colors duration-[var(--kiki-motion-quick)] hover:bg-ink/[0.05] hover:text-ink disabled:opacity-60",wc="inline-flex min-h-6 items-center rounded-sm font-medium text-ink underline underline-offset-2 decoration-ink-faint hover:decoration-ink focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-selected-ink pointer-coarse:min-h-10";function Sc(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;for(const n of["agy.security.warning","security_warning","securityWarning","warning"]){const r=t[n];if(typeof r=="string"&&r.trim()!=="")return r.trim()}if(t.kind==="security_warning"||t.type==="security_warning"){const n=t.message??t.text;if(typeof n=="string"&&n.trim()!=="")return n.trim()}}function vz(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return;const n=e;for(const r of["optionWarnings","securityWarnings","option_warnings","security_warnings"]){const i=n[r];if(typeof i=="object"&&i!==null&&!Array.isArray(i)){const s=i[t];if(typeof s=="string"&&s.trim()!=="")return s.trim()}}}function kz(e){if(typeof e!="object"||e===null)return;const t=e;if(t.kind!=="external_permission")return;const n=t.summary,r=t.options;if(typeof n!="string"||n===""||!Array.isArray(r))return{ok:!1};const i=[];for(const s of r){if(typeof s!="object"||s===null)return{ok:!1};const o=s,a=o.id,u=o.label,l=o.kind;if(typeof a!="string"||a==="")return{ok:!1};if(typeof u!="string"||u==="")return{ok:!1};if(typeof l!="string"||l==="")return{ok:!1};const c=o.changes;if(c!==void 0&&!Array.isArray(c))return{ok:!1};const d=typeof o._meta=="object"&&o._meta!==null&&!Array.isArray(o._meta)?o._meta:void 0;let f=Sc(o)??Sc(d)??vz(t.detail,a);const h=[];if(c!==void 0)for(const m of c){const x=Sc(m);x!==void 0&&f===void 0?f=x:x===void 0&&h.push(m)}i.push({id:a,label:u,kind:l,changes:c===void 0?void 0:h,...f!==void 0?{securityWarning:f}:{}})}return i.length===0?{ok:!1}:{ok:!0,display:{kind:"external_permission",summary:n,detail:t.detail,options:i}}}function Tz(e){return e.toLowerCase().includes("reject")?"rejected":"approved"}function wz(e,t){switch(e){case"allow_once":return t("ia.external.kind.allowOnce");case"allow_always":return t("ia.external.kind.allowAlways");case"reject_once":return t("ia.external.kind.rejectOnce");case"reject_always":return t("ia.external.kind.rejectAlways");default:return e}}function sw(e){try{return JSON.stringify(e,null,2)??""}catch{return String(e)}}function Sz(e,t){return e==="approved"?t==="session"?"allow-always":"allow-once":"reject-once"}function _z(e,t){const n=e.request.tool_input_display;if(typeof n!="object"||n===null)return;const r=n.kind;if(r!=="plan_enter"){if(r==="command"){const i=n.command;return i!==void 0&&i!==""?{label:t("ia.detail.command"),text:i}:void 0}if(tp(n)===void 0){if(r==="file_io"){const i=n,s=`${i.operation??""} ${i.path??""}`.trim();return s!==""?{label:t("ia.detail.file"),text:s}:void 0}if(r==="diff"){const i=n.path;return i!==void 0?{label:t("ia.detail.file"),text:i}:void 0}if(r==="url_fetch"){const i=n.url;return i!==void 0?{label:t("ia.detail.url"),text:i}:void 0}if(r==="search"){const i=n,s=i.scope!==void 0?`${i.query??""} — ${i.scope}`:i.query;return s!==void 0&&s!==""?{label:t("ia.detail.search"),text:s}:void 0}if(r==="agent_call"){const i=n,s=`${i.agent_name??""}${i.prompt!==void 0?` — ${i.prompt}`:""}`.trim();return s!==""?{label:t("ia.detail.subagent"),text:s}:void 0}if(r==="skill_call"){const i=n,s=`${i.skill_name??""}${i.args!==void 0?` ${i.args}`:""}`.trim();return s!==""?{label:t("ia.detail.skill"),text:s}:void 0}if(r==="generic"){const i=n.summary;return i!==void 0&&i!==""?{label:t("ia.detail.details"),text:i}:void 0}try{const i=JSON.stringify(n,null,2);return i===void 0||i==="{}"?void 0:{label:t("ia.detail.details"),text:i}}catch{return}}}}function tp(e){if(typeof e!="object"||e===null)return;const t=e;if(!(typeof t.path!="string"||t.path==="")){if(t.kind==="diff")return{operation:"edit",path:t.path};if(t.kind==="file_io")return{operation:t.operation==="edit"||t.operation==="write"?t.operation:void 0,path:t.path}}}function ow(e,t,n){return e.operation==="edit"?n("ia.op.edit"):e.operation==="write"?n("ia.op.write"):t}function Cz({request:e}){const{t}=je(),n=tp(e.tool_input_display);return n===void 0?p.jsxs("span",{className:"min-w-0 truncate",children:[e.tool_name," · ",e.action]}):p.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[p.jsx("span",{className:"shrink-0",children:ow(n,e.tool_name,t)}),p.jsx(J$,{path:n.path})]})}function Az(e){if(typeof e!="object"||e===null)return;const t=e,n=(i,s)=>{const o=$b(i,s);return o.length===0?void 0:{kind:"diff",hunks:o}};if(t.kind==="diff"||t.kind==="file_io"&&t.operation==="edit")return typeof t.before=="string"&&typeof t.after=="string"?n(t.before,t.after):void 0;if(t.kind!=="file_io"||t.operation!=="write"||typeof t.content!="string")return;if(typeof t.before=="string")return n(t.before,t.content);const r=t.content.split(`
188
+ `);return r.at(-1)===""&&r.pop(),r.length===0?void 0:{kind:"content",lines:r}}const Iz=12,Nz=8;function Rz(e,t){const n=[];let r=t;for(const i of e){if(r<=0)break;n.push(i.slice(0,r)),r-=i.length}return n}function Oz({change:e}){const{t}=je(),[n,r]=b.useState(!1),i=e.kind==="diff"?e.hunks.reduce((a,u)=>a+u.length,0):e.lines.length,s=e.kind==="diff"?Iz:Nz,o=!n&&i>s;return p.jsxs("div",{"data-approval-change":e.kind,className:"mt-2",children:[e.kind==="diff"?p.jsx(L$,{hunks:o?Rz(e.hunks,s):e.hunks,numbered:!1,surface:"bg-ink/[0.04]"}):p.jsxs(p.Fragment,{children:[p.jsx("p",{"data-approval-new-file":!0,className:"text-[12px] font-medium text-ink-faint",children:t("ia.write.newFile",{count:i})}),p.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-ink/[0.04] px-3 py-2 font-mono text-[12px] leading-relaxed whitespace-pre-wrap break-words text-ink",children:(o?e.lines.slice(0,s):e.lines).join(`
189
+ `)})]}),o?p.jsx("button",{type:"button","data-approval-change-expand":!0,onClick:()=>{r(!0)},className:"mt-1 inline-flex min-h-7 items-center rounded-md px-1.5 -mx-1.5 text-[12px] font-medium text-ink-soft underline-offset-2 transition-colors hover:text-ink hover:underline focus-visible:outline-2 focus-visible:outline-selected-ink pointer-coarse:min-h-10",children:t("ia.diff.expand",{count:i})}):null]})}const bb=["request"],aw="kiki.firstRun.autoExplained";function Lz(){try{return localStorage.getItem(aw)!==null}catch{return!1}}function Pz(){try{localStorage.setItem(aw,"1")}catch{}}const Mz=10*6e4;function uw(e,t=Date.now()){const n=new Date(e).getTime();if(Number.isNaN(n))return!1;const r=n-t;return r>0&&r<Mz}function _c({pinned:e,children:t}){const n=b.useRef(null),[r,i]=b.useState(!1),s=b.useCallback(()=>{const a=n.current?.closest("[data-tray-current]")??null;if(a===null){i(!1);return}const u=a.scrollHeight-a.clientHeight-a.scrollTop;i(a.scrollHeight-a.clientHeight>1&&u>1)},[]);return b.useEffect(()=>{if(!e)return;const a=n.current?.closest("[data-tray-current]")??null;if(a===null)return;s(),a.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s);const u=typeof ResizeObserver=="function"?new ResizeObserver(s):void 0;return u?.observe(a),a.firstElementChild!==null&&u?.observe(a.firstElementChild),()=>{a.removeEventListener("scroll",s),window.removeEventListener("resize",s),u?.disconnect()}},[e,s]),e?p.jsx("div",{ref:n,"data-approval-decision-bar":!0,"data-scrolled-under":r||void 0,className:`sticky bottom-0 z-10 mt-2 bg-panel pt-2 pb-2 ${r?"border-t border-hairline":""}`,children:t}):p.jsx(p.Fragment,{children:t})}function UK({block:e,onResolve:t,originAgentName:n,showShortcutHints:r=!1,permissionMode:i,onAskEveryStep:s,stickyDecisions:o=!1}){const{t:a,time:u}=je(),l=Vt(),c=b.useContext(Ow),d=Qw(),[f,h]=b.useState(!1),[m,x]=b.useState(null),[E,y]=b.useState(!1),[v,k]=b.useState(null),[S,T]=b.useState(null),[w,I]=b.useState(null),[A,O]=b.useState(!1),[_,D]=b.useState(!1),[U,F]=b.useState(""),[R,j]=b.useState(Lz),[B,q]=b.useState(!1),$=b.useRef(!1),X=b.useRef(0),C=e.request.approval_id;b.useEffect(()=>{X.current+=1,$.current=!1,k(null),T(null),I(null),O(!1),x(null),y(!1),D(!1),F(""),q(!1)},[C]);const se=e.request.tool_input_display,xe=e.resolution===void 0,L=b.useMemo(()=>xe?Az(se):void 0,[xe,se]),G=b.useMemo(()=>L===void 0?void 0:{kind:"interaction",id:C},[L,C]),re=e.originUnknown===!0?void 0:e.originAgentId,{pending:ne}=IT(G,bb,re),pe=$h(),Ae=pe!==void 0&&ne.length===0;if(b.useEffect(()=>()=>{X.current+=1},[]),e.resolution!==void 0){const{decision:K,reviewer:be}=e.resolution,J=a(K==="approved"?"ia.resolution.approved":K==="rejected"?"ia.resolution.rejected":K==="cancelled"?"ia.resolution.cancelled":K==="expired"?"ia.resolution.expired":"ia.resolution.resolvedElsewhere"),H=K==="approved"||K==="resolved_elsewhere"?"text-ink-soft":"text-danger";return p.jsxs("div",{"data-approval-resolution":K,className:`anim-enter flex min-h-7 items-center gap-2 text-[13px] ${H}`,children:[K==="approved"||K==="resolved_elsewhere"?null:p.jsx(Je,{name:"cross"}),p.jsx("span",{className:"font-medium",title:be===void 0?void 0:QT(be,a),children:be===void 0?J:XT(K,be,a,J)}),p.jsxs("span",{className:"truncate font-mono text-[12px] text-ink-faint",children:[e.request.tool_name," — ",e.request.action]})]})}if(e.request.ssh!==void 0)return p.jsx(xz,{block:e,ssh:e.request.ssh,originAgentName:n});const ee=Ez(e.request.tool_input_display);if(ee!==void 0)return p.jsx(Dz,{block:e,plan:ee,originAgentName:n,showShortcutHints:r,onResolve:t},C);const he=kz(e.request.tool_input_display),Ie=he===void 0&&typeof e.request.tool_input_display=="object"&&e.request.tool_input_display!==null&&e.request.tool_input_display.kind==="plan_enter",Me=he===void 0?_z(e,a):void 0,Be=he===void 0?tp(se):void 0,fe=Be===void 0?void 0:rw(Be.path),Le=i==="auto"&&!R&&he===void 0&&!Ie,Re=()=>{Pz(),j(!0)},De=(K,be,J)=>{if($.current||w!==null)return;Le&&Re();const H=f?"session":void 0,Q=Sz(K,H),W=X.current;$.current=!0,k(Q),T(be??(K==="cancelled"?"__cancel":null)),O(!1),(J===void 0?t(K,H,be):t(K,H,be,{feedback:J})).then(()=>{X.current===W&&I(K)}).catch(()=>{X.current===W&&O(!0)}).finally(()=>{X.current===W&&($.current=!1,k(null),T(null))})},ke=he===void 0&&!Ie&&l!==null?e.request.approval_rule:void 0,le=()=>{if(ke===void 0||l===null||$.current||w!==null)return;Le&&Re();const K=X.current;$.current=!0,k("allow-rule"),O(!1),y(!1),w$(l.client,ke).then(be=>{if(c?.setQueryData(["config"],be),X.current===K)return x(ke),kr({tone:"success",text:a("ia.alwaysAllow.saved",{rule:ke}),retry:{label:a("ia.alwaysAllow.manage"),run:()=>{d(GT)}}}),t("approved").then(()=>{X.current===K&&I("approved")},()=>{X.current===K&&O(!0)})},()=>{X.current===K&&y(!0)}).finally(()=>{X.current===K&&($.current=!1,k(null))})},Ce=()=>{const K=U.trim();De("rejected",void 0,K===""?void 0:K)},ge=p.jsx("button",{type:"button",disabled:S!==null,onClick:()=>{De("cancelled")},className:hr,children:a(S==="__cancel"?"ia.external.cancelling":"ia.external.cancel")}),Fe=A?p.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:a("ia.sendFailed")}):null;return p.jsxs("div",{"data-approval-id":C,className:o?"anim-enter border-l-2 border-accent pt-2 pr-3 pl-3":Jh,children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[12px]",children:[p.jsx("span",{className:"font-medium text-accent-ink",children:a(he===void 0?Ie?"ia.planEnter.title":"ia.approvalNeeded":"ia.external.title")}),he!==void 0?p.jsxs("span",{className:"text-ink-faint",children:["· ",a("ia.external.badge")]}):null,n!==void 0?p.jsxs("span",{className:"text-ink-faint",children:["· ",a("ia.fromSubagent",{name:n})]}):null,uw(e.request.expires_at)?p.jsx("span",{className:"ml-auto text-ink-faint tabular-nums",children:u.timeUntil(e.request.expires_at)}):null]}),Le&&w===null?p.jsxs("div",{"data-auto-explain":!0,className:"mt-1.5 flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1 rounded-md bg-ink/[0.03] px-2 py-1.5 text-[11px] leading-snug text-ink-soft",children:[p.jsx("span",{className:"min-w-0 flex-1",children:a("firstRun.auto.explain")}),p.jsxs("span",{className:"flex shrink-0 items-center gap-2 whitespace-nowrap",children:[s!==void 0?p.jsx("button",{type:"button","data-auto-explain-manual":!0,onClick:()=>{Re(),q(!0),s()},className:wc,children:a("firstRun.auto.manual")}):null,p.jsx("button",{type:"button","data-auto-explain-ok":!0,onClick:Re,className:wc,children:a("firstRun.auto.ok")})]})]}):B&&w===null?p.jsxs("div",{"data-auto-explain-future":!0,className:"mt-1.5 flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1 rounded-md bg-ink/[0.03] px-2 py-1.5 text-[11px] leading-snug text-ink-soft",children:[p.jsx("span",{className:"min-w-0 flex-1",children:a("firstRun.auto.future")}),p.jsx($a,{to:$_("permissions","st-card-permission-defaults"),className:`${wc} shrink-0 whitespace-nowrap`,children:a("st.title")})]}):null,Be!==void 0?p.jsxs("p",{className:"mt-1 min-w-0 text-[14px] leading-snug text-ink",children:[p.jsx("span",{className:Be.operation===void 0?"font-mono text-[13px] font-semibold":"font-medium",children:ow(Be,e.request.tool_name,a)})," ",p.jsxs("span",{"data-approval-path":!0,className:"font-mono text-[13px] break-all",children:[p.jsx("span",{className:"text-ink-soft",children:fe?.dir}),p.jsx("span",{className:"font-medium",children:fe?.name})]})]}):p.jsxs("p",{className:"mt-1 min-w-0 text-[14px] leading-snug text-ink",children:[p.jsx("span",{className:"font-mono text-[13px] font-semibold",children:e.request.tool_name}),p.jsxs("span",{className:"text-ink-soft",children:[" · ",e.request.action]})]}),L!==void 0&&Ae?p.jsx(Oz,{change:L},C):null,L!==void 0&&!Ae&&pe!==void 0?p.jsx(R$,{source:G,roots:bb,label:a("tc.changes"),callerAgentId:re,className:"mt-2"}):null,Ie?p.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-soft",children:a("ia.planEnter.body")}):null,Me!==void 0?p.jsxs("pre",{"aria-label":Me.label,title:Me.label,className:gb,children:[Me.label===a("ia.detail.command")?p.jsx("span",{className:"text-ink-faint select-none",children:"$ "}):null,Me.text]}):null,he?.ok===!0?p.jsxs("div",{className:"mt-1.5",children:[p.jsx("p",{className:"text-[13px] text-ink",children:he.display.summary}),he.display.detail!==void 0?p.jsx("pre",{className:gb,children:typeof he.display.detail=="string"?he.display.detail:sw(he.display.detail)}):null]}):null,w===null?he===void 0?p.jsxs(_c,{pinned:o,children:[p.jsxs("div",{className:`${o?"":"mt-2 "}flex flex-wrap items-center gap-x-2 ${_?"gap-y-1.5":"gap-y-2"}`,"aria-busy":v!==null,children:[p.jsxs("button",{type:"button",disabled:v!==null,onClick:()=>{De("approved")},className:ep,children:[a(v==="allow-once"||v==="allow-always"?"ia.approving":"ia.approve")," ",r?p.jsx("kbd",{className:"ml-1 rounded-[4px] bg-primary-foreground/20 px-1 font-mono text-[11px] font-medium pointer-coarse:hidden",children:"y"}):null]}),ke!==void 0?p.jsx("button",{type:"button","data-approval-always-allow":!0,disabled:v!==null,onClick:le,title:a("ia.alwaysAllow.title",{rule:ke}),className:`${hr} max-sm:order-1 ${_?"max-sm:hidden":""}`,children:a(v==="allow-rule"?m===null?"ia.alwaysAllow.saving":"ia.approving":"ia.alwaysAllow")}):null,p.jsxs("button",{type:"button",disabled:v!==null,onClick:()=>{De("rejected")},className:hr,children:[a(v==="reject-once"&&!_?"ia.rejecting":"ia.reject")," ",r?p.jsx("kbd",{className:"ml-1 rounded-[4px] bg-ink/[0.07] px-1 font-mono text-[11px] text-ink-soft pointer-coarse:hidden",children:"n"}):null]}),p.jsx("button",{type:"button","data-approval-reject-note":!0,"aria-expanded":_,disabled:v!==null,onClick:()=>{D(K=>!K)},className:hr,children:a("ia.rejectWithNote")}),p.jsxs("label",{className:`ml-1 flex min-h-8 pointer-coarse:min-h-10 cursor-pointer items-center gap-1.5 text-[12px] text-ink-soft max-sm:order-2 max-sm:ml-0 max-sm:basis-full ${_?"max-sm:hidden":""}`,children:[p.jsx("input",{type:"checkbox",checked:f,disabled:v!==null,onChange:K=>{h(K.target.checked)},className:"h-3.5 w-3.5 pointer-coarse:h-4 pointer-coarse:w-4 accent-[var(--color-selected-ink)]"}),a("ia.remember",{tool:e.request.tool_name})]})]}),_?p.jsxs("div",{"data-approval-note-row":!0,className:"mt-2 flex items-center gap-2",children:[p.jsx("input",{"data-approval-note":!0,autoFocus:!0,value:U,disabled:v!==null,"aria-label":a("ia.rejectNote.placeholder"),placeholder:a("ia.rejectNote.placeholder"),onChange:K=>{F(K.target.value)},onKeyDown:K=>{K.key!=="Enter"||K.nativeEvent.isComposing||K.keyCode===229||(K.preventDefault(),Ce())},className:"min-h-8 w-full min-w-0 flex-1 rounded-md border border-hairline bg-paper px-3 text-[13px] text-ink outline-none placeholder:text-ink-faint focus:border-selected-ink disabled:opacity-60 pointer-coarse:min-h-10"}),p.jsx("button",{type:"button","data-approval-reject-send":!0,disabled:v!==null,onClick:Ce,className:`${hr} shrink-0 hover:text-danger`,children:a(v==="reject-once"?"ia.rejecting":"ia.rejectNote.send")})]}):null,E?p.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:a("ia.alwaysAllow.failed")}):null,m!==null?p.jsx(xb,{rule:m}):null,Fe]}):he.ok?p.jsxs(_c,{pinned:o,children:[p.jsx("div",{className:`${o?"":"mt-2 "}space-y-1`,role:"radiogroup","aria-busy":S!==null,children:he.display.options.map(K=>p.jsx(Fz,{option:K,busy:S!==null,submitting:S===K.id,onPick:()=>{De(Tz(K.kind),K.id)}},K.id))}),p.jsx("div",{className:"mt-2",children:ge}),Fe]}):p.jsxs(_c,{pinned:o,children:[p.jsx("p",{role:"alert",className:`${o?"":"mt-2 "}text-[13px] text-danger`,children:a("ia.external.unknownShape")}),p.jsx("div",{className:"mt-2",children:ge}),Fe]}):p.jsxs("p",{role:"status",className:`mt-2 flex items-center gap-1.5 text-[13px] font-medium ${o?"pb-2 ":""}${w==="approved"||w==="cancelled"?"text-ink-soft":"text-danger"}`,children:[w==="approved"||w==="cancelled"?null:p.jsx(Je,{name:"cross"}),a(w==="approved"?"ia.resolution.approved":w==="cancelled"?"ia.resolution.cancelled":"ia.resolution.rejected")]}),w!==null&&m!==null?p.jsx(xb,{rule:m}):null]})}function Dz({block:e,plan:t,originAgentName:n,showShortcutHints:r,onResolve:i}){const{t:s,time:o}=je(),a=t.options!==void 0&&t.options.length>=2?t.options:void 0,[u,l]=b.useState(a?.[0]?.label),[c,d]=b.useState(""),[f,h]=b.useState(null),[m,x]=b.useState(null),[E,y]=b.useState(!1),v=`plan-note-${e.request.approval_id}`,k=c.trim(),S=T=>{if(f!==null||m!==null)return;h(T),y(!1);const w=T==="approve"?{selectedLabel:u}:{selectedLabel:T==="revise"?"Revise":"Reject and Exit",...k===""?{}:{feedback:k}};i(T==="approve"?"approved":"rejected",void 0,void 0,w).then(()=>{x(T)},()=>{y(!0)}).finally(()=>{h(null)})};return p.jsxs("div",{"data-approval-id":e.request.approval_id,"data-plan-review":!0,className:Jh,children:[p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[12px]",children:[p.jsx("span",{className:"font-medium text-accent-ink",children:s("ia.plan.title")}),n!==void 0?p.jsxs("span",{className:"text-ink-faint",children:["· ",s("ia.fromSubagent",{name:n})]}):null,t.path!==void 0?p.jsxs("span",{className:"min-w-0 truncate font-mono text-[11.5px] text-ink-faint",title:t.path,children:["· ",t.path]}):null,uw(e.request.expires_at)?p.jsx("span",{className:"ml-auto text-ink-faint tabular-nums",children:o.timeUntil(e.request.expires_at)}):null]}),p.jsx("div",{"data-plan-body":!0,tabIndex:0,"aria-label":s("ia.plan.bodyLabel"),className:"mt-2 max-h-64 overflow-y-auto rounded-md bg-ink/[0.03] px-3 py-2 text-[13.5px] leading-relaxed text-ink outline-none focus-visible:ring-2 focus-visible:ring-selected-ink/40",children:p.jsx(Xh,{text:t.plan,mode:"static"})}),m===null?p.jsxs(p.Fragment,{children:[a!==void 0?p.jsxs("fieldset",{className:"mt-2 space-y-1",disabled:f!==null,children:[p.jsx("legend",{className:"mb-1 text-[12px] font-medium text-ink-soft",children:s("ia.plan.choose")}),a.map(T=>p.jsxs("label",{"data-plan-option":T.label,className:`flex min-h-9 cursor-pointer items-start gap-2 rounded-md px-3 py-1.5 transition-colors ${u===T.label?"bg-selected-ink/[0.07]":"hover:bg-ink/[0.04]"}`,children:[p.jsx("input",{type:"radio",name:`plan-choice-${e.request.approval_id}`,checked:u===T.label,onChange:()=>{l(T.label)},className:"mt-1 h-3.5 w-3.5 accent-[var(--color-selected-ink)]"}),p.jsxs("span",{className:"min-w-0",children:[p.jsx("span",{className:"block text-[13px] font-medium text-ink",children:T.label}),T.description!==""?p.jsx("span",{className:"block text-[12px] leading-snug text-ink-soft",children:T.description}):null]})]},T.label))]}):null,p.jsx("label",{htmlFor:v,className:"mt-2 block text-[12px] font-medium text-ink-soft",children:s("ia.plan.note")}),p.jsx("textarea",{id:v,"data-plan-note":!0,rows:2,value:c,disabled:f!==null,onChange:T=>{d(T.target.value)},placeholder:s("ia.plan.notePlaceholder"),className:"mt-1 w-full resize-y rounded-md border border-hairline bg-paper px-3 py-1.5 text-[13px] leading-snug text-ink outline-none placeholder:text-ink-faint focus:border-selected-ink disabled:opacity-60"}),p.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 gap-y-2","aria-busy":f!==null,children:[p.jsxs("button",{type:"button","data-plan-approve":!0,disabled:f!==null,onClick:()=>{S("approve")},className:ep,children:[f==="approve"?s("ia.approving"):a!==void 0&&u!==void 0?s("ia.plan.approveChoice",{option:u}):s("ia.plan.approve"),r?p.jsx("kbd",{className:"ml-1.5 rounded-[4px] bg-primary-foreground/20 px-1 font-mono text-[11px] font-medium pointer-coarse:hidden",children:"y"}):null]}),p.jsx("button",{type:"button","data-plan-revise":!0,disabled:f!==null||k==="",title:k===""?s("ia.plan.reviseNeedsNote"):void 0,onClick:()=>{S("revise")},className:hr,children:s(f==="revise"?"ia.sending":"ia.plan.revise")}),p.jsx("button",{type:"button","data-plan-exit":!0,disabled:f!==null,onClick:()=>{S("exit")},className:`${hr} hover:text-danger`,children:s(f==="exit"?"ia.rejecting":"ia.plan.rejectExit")})]}),E?p.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:s("ia.sendFailed")}):null]}):p.jsxs("p",{role:"status","data-plan-answered":m,className:`mt-2 flex items-center gap-1.5 text-[13px] font-medium ${m==="exit"?"text-danger":"text-ink-soft"}`,children:[m==="exit"?p.jsx(Je,{name:"cross"}):null,s(m==="approve"?"ia.plan.sentApproved":m==="revise"?"ia.plan.sentRevise":"ia.plan.sentExit")]})]})}function xb({rule:e}){const{t}=je();return p.jsxs("p",{"data-approval-rule-saved":!0,className:"mt-1.5 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[12px] text-ink-soft",children:[p.jsx("span",{children:t("ia.alwaysAllow.savedShort")}),p.jsx("code",{className:"min-w-0 truncate font-mono text-[11.5px] text-ink",children:e}),p.jsx("span",{"aria-hidden":!0,className:"text-ink-faint",children:"·"}),p.jsx($a,{to:GT,className:"rounded-sm text-accent-ink underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-selected-ink",children:t("ia.alwaysAllow.undoHint")})]})}function Fz({option:e,busy:t,submitting:n,onPick:r}){const{t:i,tp:s}=je(),[o,a]=b.useState(!1),u=e.kind.toLowerCase(),l=u.startsWith("allow")?{icon:"check",marker:"text-success",chip:"text-success"}:u.startsWith("reject")?{icon:"cross",marker:"text-danger",chip:"text-danger"}:{icon:"dash",marker:"text-ink-faint",chip:"text-ink-faint"},c=e.changes??[],d=wz(e.kind,i);return p.jsxs("div",{className:`rounded-md transition-colors duration-[var(--kiki-motion-quick)] ${n?"bg-paper shadow-[var(--kiki-sheet-shadow)]":"hover:bg-ink/[0.04]"}`,children:[p.jsxs("button",{type:"button",role:"radio","aria-checked":n,disabled:t,onClick:r,className:"flex min-h-9 w-full items-center gap-2 px-3 py-1.5 text-left disabled:opacity-60",children:[p.jsx(Je,{name:l.icon,className:`h-3.5 w-3.5 ${l.marker}`}),p.jsx("span",{className:"min-w-0 flex-1",children:p.jsx("span",{className:"block text-[13px] font-medium text-ink",children:n?i("ia.sending"):e.label})}),d.toLowerCase()===e.label.toLowerCase()?null:p.jsx("span",{className:`shrink-0 text-[12px] ${l.chip}`,children:d})]}),e.securityWarning!==void 0?p.jsxs("p",{role:"note","data-external-option-warning":e.id,className:"flex items-start gap-1.5 px-3 pb-1.5 pl-[34px] text-[12px] leading-snug text-amber-ink",children:[p.jsx(Je,{name:"warning",size:12,className:"mt-0.5 shrink-0 text-amber-rule"}),p.jsxs("span",{className:"min-w-0 break-words",children:[p.jsxs("span",{className:"sr-only",children:[i("ia.external.securityWarning"),": "]}),e.securityWarning]})]}):null,c.length>0?p.jsxs("div",{className:"px-3 pb-1.5 pl-[34px]",children:[p.jsxs("button",{type:"button","aria-expanded":o,onClick:()=>{a(f=>!f)},className:"inline-flex min-h-6 items-center gap-1 text-[12px] font-medium text-ink-faint transition-colors hover:text-ink",children:[s("ia.external.changes",c.length),p.jsx(Ib,{open:o})]}),o?p.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-paper px-3 py-1.5 font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-ink-soft",children:c.map(f=>sw(f)).join(`
190
+ `)}):null]}):null]})}function np(e){return e.allow_other!==!1}function jz(e,t){return t.optionIds.length>0||np(e)&&t.otherText.trim()!==""}function Bz(e,t){const n={};for(const r of e){const i=t[r.id]??{optionIds:[],otherText:""},s=i.optionIds,o=np(r)?i.otherText.trim():"";if(s.length===0&&o==="")return;s.length>0&&o!==""?n[r.id]={kind:"multi_with_other",option_ids:[...s],other_text:o}:o!==""?n[r.id]={kind:"other",text:o}:s.length===1?n[r.id]={kind:"single",option_id:s[0]}:n[r.id]={kind:"multi",option_ids:[...s]}}return Object.keys(n).length===e.length?n:void 0}function Hz({item:e,answer:t,onChange:n}){const{t:r}=je(),i=o=>{const a=t.optionIds.includes(o)?t.optionIds.filter(u=>u!==o):[...t.optionIds,o];n({...t,optionIds:a})},s=e.other_label??r("ia.other");return p.jsxs("div",{children:[e.header!==void 0?p.jsx("p",{className:"text-[12px] font-medium text-ink-faint",children:e.header}):null,p.jsx("p",{className:"mt-0.5 text-[14px] font-medium text-ink",children:e.question}),e.body!==void 0?p.jsx("div",{className:"mt-1 text-[13px] text-ink-soft",children:p.jsx(Xh,{text:e.body})}):null,p.jsxs("div",{className:"mt-2 space-y-0.5",children:[e.options.map(o=>{const a=t.optionIds.includes(o.id);return p.jsxs("button",{type:"button","aria-pressed":a,onClick:()=>{i(o.id)},className:`flex min-h-9 w-full items-start gap-2 rounded-md px-3 py-1.5 text-left transition-colors duration-[var(--kiki-motion-quick)] ${a?"bg-paper shadow-[var(--kiki-sheet-shadow)]":"hover:bg-ink/[0.04]"}`,children:[p.jsx("span",{"aria-hidden":!0,className:`mt-[3px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-[4px] border ${a?"border-ink bg-ink text-paper":"border-hairline-strong bg-paper"}`,children:a?p.jsx(Je,{name:"check",size:12}):null}),p.jsxs("span",{className:"min-w-0",children:[p.jsx("span",{className:"block text-[13px] font-medium text-ink",children:o.label}),o.description!==void 0?p.jsx("span",{className:"block text-[12px] text-ink-soft",children:o.description}):null]})]},o.id)}),np(e)?p.jsxs("label",{className:"flex items-center gap-2 rounded-md px-3 pt-1.5",children:[p.jsx("span",{className:"shrink-0 text-[13px] font-medium text-ink-soft",children:s}),p.jsx("input",{"aria-label":s,className:"min-h-8 w-full min-w-0 rounded-md border border-hairline bg-panel px-3 text-[13px] text-ink outline-none placeholder:text-ink-faint focus:border-accent",placeholder:e.other_description??r("ia.otherPlaceholder"),value:t.otherText,onChange:o=>{n({...t,otherText:o.target.value})}})]}):null]})]})}function $K(e){return p.jsx(Uz,{...e},`${e.block.request.session_id}:${e.block.request.question_id}`)}function Uz({block:e,onAnswer:t,onDismiss:n,originAgentName:r}){const{t:i,tp:s}=je(),[o,a]=b.useState({}),[u,l]=b.useState(!1),[c,d]=b.useState(null),[f,h]=b.useState(null),m=b.useRef(!1),x=b.useRef(!0);if(b.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]),e.outcome!==void 0)return p.jsx(Q$,{node:e,originName:r});const E=T=>o[T]??{optionIds:[],otherText:""},y=T=>jz(T,E(T.id)),v=e.request.questions.filter(T=>!y(T)).length,k=()=>{if(m.current||e.outcome!==void 0||v>0)return;const T=Bz(e.request.questions,o);T!==void 0&&(m.current=!0,l(!0),d(null),t(T).then(()=>{x.current&&h("answered")}).catch(w=>{x.current&&(m.current=!1,l(!1),d(w instanceof Error?i("ia.answerFailed",{detail:w.message}):i("ia.answerFailedGeneric")))}))},S=()=>{m.current||e.outcome!==void 0||(m.current=!0,l(!0),d(null),n().then(()=>{x.current&&h("dismissed")}).catch(T=>{x.current&&(m.current=!1,l(!1),d(T instanceof Error?i("ia.dismissFailed",{detail:T.message}):i("ia.dismissFailedGeneric")))}))};return p.jsx("div",{"data-question-card":!0,className:Jh,children:p.jsxs("div",{className:"space-y-4",children:[p.jsx("div",{children:p.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 text-[12px]",children:[p.jsx("span",{className:"font-medium text-accent-ink",children:i("ia.kikiAsks")}),r!==void 0?p.jsxs("span",{className:"text-ink-faint",children:["· ",i("ia.fromSubagent",{name:r})]}):null]})}),e.request.questions.map(T=>p.jsx(Hz,{item:T,answer:E(T.id),onChange:w=>{a(I=>({...I,[T.id]:w}))}},T.id)),f===null?p.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[p.jsx("button",{type:"button",disabled:u||v>0,title:v>0?s("ia.unanswered",v):void 0,onClick:k,className:ep,children:i(u?"ia.sending":"ia.submit")}),p.jsx("button",{type:"button",disabled:u,onClick:S,className:hr,children:i("ia.dismiss")}),v>0?p.jsx("span",{className:"text-[12px] text-ink-faint",children:s("ia.unanswered",v)}):null,c!==null?p.jsx("span",{role:"alert",className:"text-[12px] text-danger",children:c}):null]}):p.jsx("p",{role:"status",className:"pt-1 text-[13px] font-medium text-ink-soft",children:i(f==="answered"?"ia.sentToKiki":"ia.dismissed")})]})})}const $z=b.createContext({inTray:!1});function zK(){return b.useContext($z)}function qK({block:e,originName:t,onReview:n}){const{t:r}=je(),i=e.kind==="approval"?e.request.approval_id:e.request.question_id,s=e.kind==="approval"?p.jsx(Cz,{request:e.request}):p.jsx("span",{className:"min-w-0 truncate",children:e.request.questions[0]?.question??r("ia.kikiAsks")});return p.jsxs("div",{"data-interaction-record":i,"data-interaction-kind":e.kind,className:"anim-enter flex min-h-7 items-center gap-2 text-[12px]",children:[p.jsx("span",{"aria-hidden":!0,className:"flex w-[18px] shrink-0 justify-center",children:p.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"})}),p.jsx("span",{className:"shrink-0 font-medium text-ink",children:r(e.kind==="approval"?"ia.record.awaitingApproval":"ia.record.awaitingAnswer")}),p.jsxs("span",{className:"flex min-w-0 items-baseline text-ink-faint",children:[t===void 0?null:p.jsx("span",{className:"shrink-0 whitespace-pre",children:`${t} · `}),s]}),n!==void 0?p.jsxs("button",{type:"button",onClick:n,"aria-label":r("ia.record.reviewAria"),className:"ml-auto inline-flex min-h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[12px] font-medium text-ink-soft transition-colors duration-[var(--kiki-motion-quick)] hover:bg-ink/[0.04] hover:text-ink pointer-coarse:min-h-10",children:[r("ia.record.review"),p.jsx(Je,{name:"arrowDown",size:12})]}):null]})}function WK({id:e,count:t,onReview:n}){const{t:r,tp:i}=je();return p.jsxs("div",{"data-interaction-record":e,"data-interaction-merged":t,className:"anim-enter flex min-h-7 items-center gap-2 text-[12px]",children:[p.jsx("span",{"aria-hidden":!0,className:"flex w-[18px] shrink-0 justify-center",children:p.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"})}),p.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:i("transcript.needsYouCount",t)}),n!==void 0?p.jsxs("button",{type:"button",onClick:n,"aria-label":r("ia.record.reviewAria"),className:"ml-auto inline-flex min-h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[12px] font-medium text-ink-soft transition-colors duration-[var(--kiki-motion-quick)] hover:bg-ink/[0.04] hover:text-ink pointer-coarse:min-h-10",children:[r("ia.record.review"),p.jsx(Je,{name:"arrowDown",size:12})]}):null]})}const lw=["bg-ink/[0.06] text-ink-soft","bg-selected text-selected-ink","bg-amber-card text-amber-ink","bg-bubble-user text-section-ink"];function zz(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%lw.length}function qz(e){const t=e.trim();if(t==="")return"?";const n=Intl.Segmenter;return((n===void 0?Array.from(t)[0]:new n(void 0,{granularity:"grapheme"}).segment(t)[Symbol.iterator]().next().value?.segment)??"?").toLocaleUpperCase()}function VK(e){const t=e.avatarMime!==void 0;return{id:e.id,name:e.name,avatarUrl:t?`/api/personas/${encodeURIComponent(e.id)}/avatar`:void 0,avatarShape:t?e.avatarShape:void 0}}function Wz(e){return Math.max(4,Math.round(e*.28))}const Vz=e=>["persona-avatar",e];function yb(e){return/\/api\/personas\/[^/]+\/avatar$/u.test(e)}function _u(e){return typeof e.avatarMime=="string"&&e.avatarMime!==""}function Eb(e,t){if("avatarMime"in t)return _u(t);for(const[,n]of e.getQueriesData({queryKey:["personas"]})){if(!Array.isArray(n))continue;const r=n.find(i=>i.id===t.id);if(r!==void 0)return _u(r)}}function KK({persona:e,size:t=32,decorative:n=!1,className:r=""}){const i=Vt(),s=Lw(),o=e.avatarUrl,a=Eb(s,e),u=o!==void 0&&yb(o)&&i!==null&&a!==!1,l=di({queryKey:Vz(e.id),queryFn:async({signal:v})=>{const k=i.client;let S=Eb(s,e);if(S===void 0&&typeof k.listPersonas=="function")try{const T=await s.fetchQuery({queryKey:["personas",{includeArchived:!1}],queryFn:()=>k.listPersonas({includeArchived:!1}),staleTime:15e3}),w=Array.isArray(T)?T.find(I=>I.id===e.id):void 0;if(w!==void 0)S=_u(w);else{const I=await s.fetchQuery({queryKey:["personas",{includeArchived:!0}],queryFn:()=>k.listPersonas({includeArchived:!0}),staleTime:15e3}),A=Array.isArray(I)?I.find(O=>O.id===e.id):void 0;S=A!==void 0&&_u(A)}}catch{}return S===!1?null:k.getPersonaAvatar(e.id,v)},enabled:u,staleTime:5*6e4,retry:!1}),c=u?l.data??null:null,[d,f]=b.useState(null);b.useEffect(()=>{if(c===null){f(null);return}const v=URL.createObjectURL(c);return f(v),()=>{URL.revokeObjectURL(v)}},[c]);const h=d??(o!==void 0&&!yb(o)?o:null),m=h!==null&&e.avatarShape==="circle",x=m?t/2:Wz(t),E={width:t,height:t,borderRadius:x,fontSize:Math.max(9,Math.round(t*.46))},y=n?{"aria-hidden":!0}:{role:"img","aria-label":e.name};return p.jsx("span",{"data-persona-avatar":e.id,"data-persona-avatar-kind":h===null?"initial":"image","data-persona-avatar-shape":m?"circle":"square",title:n?void 0:e.name,style:E,...y,className:`relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-display leading-none font-semibold ring-1 ring-inset ring-ink/[0.07] ${h===null?lw[zz(e.id)]:"bg-panel"} ${r}`,children:h===null?qz(e.name):p.jsx("img",{src:h,alt:"",draggable:!1,className:"h-full w-full object-cover"})})}const Kz=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:ck},Symbol.toStringTag,{value:"Module"}));export{UW as $,M9 as A,DK as B,mb as C,RK as D,VK as E,iz as F,KK as G,IK as H,Xs as I,Gu as J,Xk as K,lV as L,No as M,Zk as N,nT as O,nz as P,iT as Q,en as R,rz as S,az as T,$d as U,Df as V,Xh as W,$K as X,eU as Y,tU as Z,FK as _,jh as a,hy as a$,Wz as a0,cs as a1,Vz as a2,sz as a3,OK as a4,gW as a5,_V as a6,Qn as a7,Gr as a8,wN as a9,nV as aA,YW as aB,V_ as aC,zW as aD,Pf as aE,qi as aF,JW as aG,WW as aH,$W as aI,eV as aJ,Cm as aK,xW as aL,RI as aM,VW as aN,BS as aO,qW as aP,yt as aQ,zo as aR,Ap as aS,K_ as aT,D_ as aU,k5 as aV,Ir as aW,Ju as aX,uy as aY,ly as aZ,u0 as a_,TN as aa,Xu as ab,jf as ac,Li as ad,sV as ae,C6 as af,Xe as ag,Oe as ah,wn as ai,zh as aj,Sr as ak,b_ as al,SU as am,Wh as an,ra as ao,Vh as ap,HI as aq,tV as ar,FV as as,DV as at,XF as au,HK as av,tz as aw,Bo as ax,Bz as ay,np as az,H$ as b,Pl as b$,Vo as b0,HN as b1,ns as b2,Gx as b3,as as b4,Mf as b5,oz as b6,BK as b7,MK as b8,uz as b9,I_ as bA,Xr as bB,GC as bC,En as bD,M1 as bE,X2 as bF,Nt as bG,$1 as bH,G2 as bI,Ge as bJ,Ke as bK,L1 as bL,Ku as bM,fA as bN,Tx as bO,qo as bP,mA as bQ,Gn as bR,XC as bS,tt as bT,Xc as bU,yr as bV,pA as bW,jW as bX,W2 as bY,Kp as bZ,Vp as b_,LK as ba,nu as bb,jK as bc,PK as bd,NK as be,Iq as bf,mT as bg,SV as bh,KH as bi,NV as bj,kV as bk,IV as bl,yV as bm,vI as bn,nU as bo,wK as bp,ez as bq,_K as br,Es as bs,vK as bt,ia as bu,TK as bv,yK as bw,EK as bx,kK as by,Vq as bz,nr as c,oU as c$,Kc as c0,LW as c1,PW as c2,qt as c3,La as c4,MW as c5,ds as c6,Ya as c7,Cl as c8,Al as c9,Bu as cA,Xq as cB,rW as cC,S_ as cD,Du as cE,C_ as cF,aW as cG,sW as cH,oW as cI,aq as cJ,oq as cK,vq as cL,yW as cM,tW as cN,R$ as cO,bK as cP,xK as cQ,AK as cR,SK as cS,CK as cT,dK as cU,PV as cV,aU as cW,kq as cX,Tq as cY,sU as cZ,MV as c_,R2 as ca,O2 as cb,ri as cc,to as cd,FW as ce,xf as cf,IW as cg,dl as ch,HW as ci,EC as cj,Eo as ck,OW as cl,RW as cm,OV as cn,rU as co,t1 as cp,Kh as cq,cV as cr,jI as cs,Rm as ct,BI as cu,ko as cv,To as cw,Ff as cx,eW as cy,ju as cz,bT as d,wx as d$,zV as d0,$h as d1,qV as d2,C$ as d3,N$ as d4,Uq as d5,Hq as d6,aa as d7,_q as d8,Rq as d9,$_ as dA,cW as dB,j_ as dC,B_ as dD,g_ as dE,TT as dF,BV as dG,xU as dH,Tu as dI,HV as dJ,d1 as dK,$q as dL,na as dM,WV as dN,bU as dO,Lh as dP,qk as dQ,pK as dR,G$ as dS,iq as dT,L$ as dU,hK as dV,RV as dW,qq as dX,KV as dY,zs as dZ,BW as d_,wq as da,Oq as db,Sq as dc,kz as dd,Ez as de,Cr as df,vW as dg,hW as dh,pW as di,cq as dj,lq as dk,mW as dl,Uo as dm,Kq as dn,DW as dp,iI as dq,$u as dr,Zi as ds,lA as dt,hx as du,px as dv,xx as dw,NW as dx,zc as dy,gf as dz,pU as e,FH as e$,bf as e0,gx as e1,yx as e2,Ex as e3,bx as e4,vx as e5,WC as e6,SC as e7,pI as e8,gI as e9,Qq as eA,Zq as eB,Yq as eC,uW as eD,nW as eE,iW as eF,fK as eG,nK as eH,XV as eI,jV as eJ,mV as eK,fV as eL,bV as eM,pV as eN,AB as eO,hV as eP,xV as eQ,gV as eR,IB as eS,hl as eT,DB as eU,gK as eV,mK as eW,zK as eX,$I as eY,iV as eZ,RH as e_,Vu as ea,gA as eb,U1 as ec,Px as ed,Fh as ee,uK as ef,QV as eg,JV as eh,ZV as ei,F$ as ej,IT as ek,HT as el,$T as em,BT as en,LT as eo,Ro as ep,OT as eq,Uh as er,sq as es,J$ as et,sK as eu,eK as ev,VV as ew,II as ex,Cz as ey,Jq as ez,cK as f,bq as f$,aK as f0,lK as f1,M$ as f2,qI as f3,rV as f4,oK as f5,iK as f6,rK as f7,tK as f8,RU as f9,Yg as fA,fq as fB,Y_ as fC,qb as fD,KW as fE,t_ as fF,Nq as fG,i_ as fH,Cq as fI,Tc as fJ,$V as fK,CT as fL,n_ as fM,Gq as fN,AV as fO,vV as fP,YH as fQ,CV as fR,mq as fS,pq as fT,hq as fU,XW as fV,kW as fW,Eq as fX,bW as fY,yq as fZ,gq as f_,NU as fa,Q$ as fb,qK as fc,UK as fd,WK as fe,YV as ff,f1 as fg,h1 as fh,S$ as fi,db as fj,JF as fk,sk as fl,GV as fm,Pq as fn,Lq as fo,Mq as fp,hf as fq,Wq as fr,Aq as fs,jq as ft,UV as fu,$z as fv,Dq as fw,Bq as fx,Fq as fy,zq as fz,JH as g,xq as g0,GW as g1,dq as g2,uq as g3,VS as g4,dW as g5,qH as g6,Ux as g7,fW as g8,CW as g9,gn as ga,t2 as gb,n2 as gc,N1 as gd,r2 as ge,e2 as gf,SW as gg,wW as gh,EV as gi,QW as gj,QF as gk,Z_ as gl,_W as gm,eo as gn,TW as go,EW as gp,AW as gq,TV as gr,wV as gs,ZW as gt,Yk as h,ys as i,bB as j,aB as k,LV as l,EI as m,dV as n,mf as o,kr as p,pB as q,Lf as r,hB as s,_B as t,lW as u,Di as v,Fu as w,lB as x,$k as y,zk as z};