@waq666/pneuma 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/README.md +242 -206
  2. package/bin/dsc.js +9 -3
  3. package/bin/headless.cjs +1 -1
  4. package/lib/adapter/transcript.d.ts +19 -2
  5. package/lib/adapter/transcript.js +71 -14
  6. package/lib/app/AgentsOverlay.js +7 -6
  7. package/lib/app/App.js +1 -1
  8. package/lib/app/ApprovalCard.js +15 -9
  9. package/lib/app/ChatView.d.ts +3 -1
  10. package/lib/app/ChatView.js +21 -17
  11. package/lib/app/Composer.js +22 -4
  12. package/lib/app/MarkdownView.js +2 -1
  13. package/lib/app/ModelPicker.js +7 -6
  14. package/lib/app/PickerFrame.d.ts +4 -0
  15. package/lib/app/PickerFrame.js +18 -0
  16. package/lib/app/PlanReviewCard.js +2 -1
  17. package/lib/app/PresetPicker.js +8 -7
  18. package/lib/app/SessionPicker.js +21 -20
  19. package/lib/app/SettingsOverlay.js +1 -1
  20. package/lib/app/SkillsPicker.js +7 -6
  21. package/lib/app/StatusBar.js +3 -15
  22. package/lib/app/TaskStrips.js +1 -4
  23. package/lib/app/TimelineRail.js +2 -1
  24. package/lib/app/ToolCard.js +2 -6
  25. package/lib/app/Welcome.d.ts +1 -0
  26. package/lib/app/Welcome.js +1 -4
  27. package/lib/app/click.d.ts +0 -2
  28. package/lib/app/click.js +2 -21
  29. package/lib/app/display-width.d.ts +16 -0
  30. package/lib/app/display-width.js +33 -0
  31. package/lib/app/markdown.d.ts +1 -3
  32. package/lib/app/markdown.js +2 -19
  33. package/lib/app/scroll-model.js +1 -1
  34. package/lib/contract/approval.d.ts +91 -0
  35. package/lib/contract/approval.js +1 -0
  36. package/lib/contract/mode.d.ts +69 -0
  37. package/lib/contract/mode.js +1 -0
  38. package/lib/contract/plugin.d.ts +240 -0
  39. package/lib/contract/plugin.js +1 -0
  40. package/lib/contract/runtime.d.ts +282 -0
  41. package/lib/contract/runtime.js +1 -0
  42. package/lib/contract/session.d.ts +208 -0
  43. package/lib/contract/session.js +36 -0
  44. package/lib/contract/settings.d.ts +242 -0
  45. package/lib/contract/settings.js +1 -0
  46. package/lib/contract/snapshot.d.ts +453 -0
  47. package/lib/contract/snapshot.js +1 -0
  48. package/lib/contract/task.d.ts +189 -0
  49. package/lib/contract/task.js +10 -0
  50. package/lib/contract/transcript.d.ts +358 -0
  51. package/lib/contract/transcript.js +1 -0
  52. package/lib/contract/usage.d.ts +132 -0
  53. package/lib/contract/usage.js +10 -0
  54. package/lib/contract.d.ts +20 -1968
  55. package/lib/contract.js +19 -30
  56. package/lib/core/agent-roles.d.ts +1 -1
  57. package/lib/core/agent-roles.js +6 -5
  58. package/lib/core/approval-floor.d.ts +9 -0
  59. package/lib/core/approval-floor.js +152 -25
  60. package/lib/core/attachments.d.ts +185 -0
  61. package/lib/core/attachments.js +425 -0
  62. package/lib/core/bytes.d.ts +14 -0
  63. package/lib/core/bytes.js +28 -0
  64. package/lib/core/call-meaning.d.ts +20 -0
  65. package/lib/core/call-meaning.js +347 -0
  66. package/lib/core/cdp/actions.js +6 -0
  67. package/lib/core/cdp/launch.js +2 -2
  68. package/lib/core/cdp/report.d.ts +27 -0
  69. package/lib/core/cdp/report.js +50 -0
  70. package/lib/core/cdp/ring-buffer.d.ts +25 -0
  71. package/lib/core/cdp/ring-buffer.js +44 -0
  72. package/lib/core/cdp/snapshot.js +5 -9
  73. package/lib/core/cdp/transport.js +1 -1
  74. package/lib/core/clamp.d.ts +20 -0
  75. package/lib/core/clamp.js +24 -0
  76. package/lib/core/clock.d.ts +16 -0
  77. package/lib/core/clock.js +20 -0
  78. package/lib/core/command-policy.js +33 -1
  79. package/lib/core/commands-completion.d.ts +28 -0
  80. package/lib/core/commands-completion.js +108 -30
  81. package/lib/core/compact.d.ts +36 -6
  82. package/lib/core/compact.js +89 -17
  83. package/lib/core/desktop-control.js +1 -3
  84. package/lib/core/dsh-compat/llm-usage-event.d.ts +78 -0
  85. package/lib/core/dsh-compat/llm-usage-event.js +91 -0
  86. package/lib/core/dsh-compat/presentation.d.ts +84 -0
  87. package/lib/core/dsh-compat/presentation.js +105 -0
  88. package/lib/core/dsh-compat/resolve-hook.d.ts +3 -3
  89. package/lib/core/dsh-compat/resolve-hook.js +41 -13
  90. package/lib/core/dsh-compat/service-map.d.ts +52 -0
  91. package/lib/core/dsh-compat/service-map.js +87 -0
  92. package/lib/core/dsh-compat/session-bridge.d.ts +107 -0
  93. package/lib/core/dsh-compat/session-bridge.js +376 -0
  94. package/lib/core/dsh-compat/session-events.d.ts +54 -0
  95. package/lib/core/dsh-compat/session-events.js +297 -0
  96. package/lib/core/dsh-compat/shims/credentials.d.ts +62 -0
  97. package/lib/core/dsh-compat/shims/credentials.js +86 -0
  98. package/lib/core/dsh-compat/shims/home-paths.d.ts +77 -0
  99. package/lib/core/dsh-compat/shims/home-paths.js +143 -0
  100. package/lib/core/dsh-compat/tools-facade.d.ts +31 -1
  101. package/lib/core/dsh-compat/tools-facade.js +207 -3
  102. package/lib/core/err-text.d.ts +5 -0
  103. package/lib/core/err-text.js +5 -0
  104. package/lib/core/events.d.ts +31 -2
  105. package/lib/core/git-info.d.ts +127 -15
  106. package/lib/core/git-info.js +315 -34
  107. package/lib/core/git-surface.d.ts +17 -0
  108. package/lib/core/git-surface.js +7 -0
  109. package/lib/core/hooks.d.ts +19 -2
  110. package/lib/core/hooks.js +57 -13
  111. package/lib/core/host-methods.d.ts +1 -1
  112. package/lib/core/host-methods.js +4 -0
  113. package/lib/core/image-diet.js +1 -4
  114. package/lib/core/json-text.d.ts +11 -0
  115. package/lib/core/json-text.js +18 -0
  116. package/lib/core/learnings/skill-write.d.ts +1 -7
  117. package/lib/core/learnings/skill-write.js +3 -37
  118. package/lib/core/lifecycle-hooks.d.ts +11 -3
  119. package/lib/core/lifecycle-hooks.js +33 -42
  120. package/lib/core/llm.d.ts +42 -0
  121. package/lib/core/llm.js +40 -25
  122. package/lib/core/loop.d.ts +11 -1
  123. package/lib/core/loop.js +95 -28
  124. package/lib/core/lsp/client.js +30 -17
  125. package/lib/core/lsp/normalize.d.ts +0 -2
  126. package/lib/core/lsp/normalize.js +1 -6
  127. package/lib/core/lsp/servers.js +1 -4
  128. package/lib/core/mcp.d.ts +18 -0
  129. package/lib/core/mcp.js +60 -16
  130. package/lib/core/microcompact.d.ts +45 -0
  131. package/lib/core/microcompact.js +128 -0
  132. package/lib/core/native-bridge.js +2 -10
  133. package/lib/core/path-policy.d.ts +13 -1
  134. package/lib/core/path-policy.js +87 -18
  135. package/lib/core/permission-presets.d.ts +9 -5
  136. package/lib/core/permission-presets.js +14 -7
  137. package/lib/core/permission-scope.d.ts +65 -0
  138. package/lib/core/permission-scope.js +109 -0
  139. package/lib/core/plugin-bundle.d.ts +95 -0
  140. package/lib/core/plugin-bundle.js +137 -0
  141. package/lib/core/plugin-loader.d.ts +36 -1
  142. package/lib/core/plugin-loader.js +336 -12
  143. package/lib/core/plugin-patch.d.ts +64 -0
  144. package/lib/core/plugin-patch.js +146 -0
  145. package/lib/core/plugin-registry.d.ts +14 -0
  146. package/lib/core/plugin-registry.js +2 -0
  147. package/lib/core/prefs.js +40 -2
  148. package/lib/core/presets.d.ts +11 -0
  149. package/lib/core/presets.js +61 -22
  150. package/lib/core/profile-dir.d.ts +5 -0
  151. package/lib/core/profile-dir.js +40 -0
  152. package/lib/core/prompt.js +55 -19
  153. package/lib/core/ptc.d.ts +8 -2
  154. package/lib/core/ptc.js +18 -4
  155. package/lib/core/records.d.ts +16 -0
  156. package/lib/core/records.js +22 -0
  157. package/lib/core/remote/notify.js +1 -3
  158. package/lib/core/remote/push.js +2 -6
  159. package/lib/core/sandbox/execpolicy.js +27 -3
  160. package/lib/core/sandbox/net-proxy.js +2 -2
  161. package/lib/core/sandbox/policy.d.ts +1 -1
  162. package/lib/core/sandbox/policy.js +21 -15
  163. package/lib/core/sandbox/win/account.js +1 -4
  164. package/lib/core/sandbox/win/acl.js +1 -6
  165. package/lib/core/sandbox/win/backend.d.ts +24 -3
  166. package/lib/core/sandbox/win/backend.js +73 -23
  167. package/lib/core/sandbox/win/doctor.js +1 -4
  168. package/lib/core/sandbox/win/runner-entry.js +1 -6
  169. package/lib/core/sandbox/win/setup.js +1 -4
  170. package/lib/core/sandbox/win/utf16.d.ts +11 -0
  171. package/lib/core/sandbox/win/utf16.js +15 -0
  172. package/lib/core/sandbox/win/wfp.js +1 -4
  173. package/lib/core/schedule/rule.d.ts +0 -17
  174. package/lib/core/schedule/rule.js +1 -3
  175. package/lib/core/schedule/runner.d.ts +5 -2
  176. package/lib/core/schedule/runner.js +32 -9
  177. package/lib/core/schedule/store.d.ts +0 -2
  178. package/lib/core/schedule/store.js +2 -9
  179. package/lib/core/session-index.d.ts +50 -0
  180. package/lib/core/session-index.js +169 -3
  181. package/lib/core/session.d.ts +89 -13
  182. package/lib/core/session.js +385 -32
  183. package/lib/core/shell-quote.d.ts +21 -0
  184. package/lib/core/shell-quote.js +24 -0
  185. package/lib/core/side-ask.d.ts +52 -0
  186. package/lib/core/side-ask.js +89 -0
  187. package/lib/core/skills.d.ts +16 -0
  188. package/lib/core/skills.js +45 -8
  189. package/lib/core/snapshot-throttle.d.ts +8 -0
  190. package/lib/core/snapshot-throttle.js +24 -0
  191. package/lib/core/spill.d.ts +11 -5
  192. package/lib/core/spill.js +35 -36
  193. package/lib/core/strings.d.ts +21 -0
  194. package/lib/core/strings.js +33 -0
  195. package/lib/core/terminal-env.d.ts +61 -0
  196. package/lib/core/terminal-env.js +327 -0
  197. package/lib/core/text-format.d.ts +17 -0
  198. package/lib/core/text-format.js +26 -0
  199. package/lib/core/todo-reminder.d.ts +19 -14
  200. package/lib/core/todo-reminder.js +14 -23
  201. package/lib/core/token-estimate.d.ts +18 -2
  202. package/lib/core/token-estimate.js +10 -2
  203. package/lib/core/tool-result-prune.d.ts +42 -0
  204. package/lib/core/tool-result-prune.js +47 -0
  205. package/lib/core/tool-search.d.ts +3 -2
  206. package/lib/core/tool-search.js +3 -2
  207. package/lib/core/tools/bash.d.ts +35 -3
  208. package/lib/core/tools/bash.js +168 -41
  209. package/lib/core/tools/fs-tools.js +18 -17
  210. package/lib/core/tools/image-tool.d.ts +2 -0
  211. package/lib/core/tools/image-tool.js +59 -0
  212. package/lib/core/tools/path-args.d.ts +4 -0
  213. package/lib/core/tools/path-args.js +22 -0
  214. package/lib/core/tools/search-tools.d.ts +30 -0
  215. package/lib/core/tools/search-tools.js +321 -34
  216. package/lib/core/tools.d.ts +82 -0
  217. package/lib/core/tools.js +21 -0
  218. package/lib/core/transcript-text.d.ts +19 -0
  219. package/lib/core/transcript-text.js +44 -0
  220. package/lib/core/ui-boot-source.d.ts +5 -0
  221. package/lib/core/ui-boot-source.js +10 -3
  222. package/lib/core/ui-bundles.d.ts +80 -6
  223. package/lib/core/ui-bundles.js +700 -76
  224. package/lib/core/ui-events.d.ts +10 -0
  225. package/lib/core/ui-events.js +25 -0
  226. package/lib/core/ui-methods.d.ts +1 -1
  227. package/lib/core/ui-methods.js +42 -13
  228. package/lib/core/ui-route.js +11 -7
  229. package/lib/core/ui-server.d.ts +6 -0
  230. package/lib/core/ui-server.js +106 -1
  231. package/lib/core/unified-diff.d.ts +35 -0
  232. package/lib/core/unified-diff.js +86 -0
  233. package/lib/core/usage-log.js +39 -0
  234. package/lib/core/web-http.d.ts +1 -1
  235. package/lib/core/web-http.js +1 -3
  236. package/lib/host/kernel.js +57 -41
  237. package/lib/plugins/agent.js +101 -20
  238. package/lib/plugins/approval-floor.js +12 -8
  239. package/lib/plugins/approval.js +252 -80
  240. package/lib/plugins/ask.js +60 -8
  241. package/lib/plugins/browser.js +32 -84
  242. package/lib/plugins/commands.js +167 -57
  243. package/lib/plugins/compact.d.ts +2 -2
  244. package/lib/plugins/compact.js +200 -30
  245. package/lib/plugins/computer-use.js +34 -18
  246. package/lib/plugins/dock-browser.js +24 -65
  247. package/lib/plugins/dsh-compat.js +7 -0
  248. package/lib/plugins/file-review.js +59 -15
  249. package/lib/plugins/git.js +16 -8
  250. package/lib/plugins/goal.js +9 -8
  251. package/lib/plugins/hooks.js +4 -2
  252. package/lib/plugins/host-stdio.js +14 -16
  253. package/lib/plugins/lifecycle-hooks.d.ts +5 -4
  254. package/lib/plugins/lifecycle-hooks.js +12 -10
  255. package/lib/plugins/llm.js +74 -33
  256. package/lib/plugins/lsp.js +22 -27
  257. package/lib/plugins/mcp.js +16 -17
  258. package/lib/plugins/memory.js +3 -24
  259. package/lib/plugins/microcompact.d.ts +4 -1
  260. package/lib/plugins/microcompact.js +117 -19
  261. package/lib/plugins/mode.js +30 -11
  262. package/lib/plugins/permission-presets.d.ts +2 -1
  263. package/lib/plugins/permission-presets.js +55 -35
  264. package/lib/plugins/plugin-manager.js +4 -6
  265. package/lib/plugins/presets.js +56 -27
  266. package/lib/plugins/prompt.js +54 -11
  267. package/lib/plugins/ptc.d.ts +13 -0
  268. package/lib/plugins/ptc.js +121 -24
  269. package/lib/plugins/remote/types.d.ts +1 -1
  270. package/lib/plugins/remote/types.js +11 -0
  271. package/lib/plugins/remote.js +14 -15
  272. package/lib/plugins/runtime.js +91 -14
  273. package/lib/plugins/sandbox.js +181 -60
  274. package/lib/plugins/schedule.js +12 -11
  275. package/lib/plugins/self-improve.js +28 -18
  276. package/lib/plugins/session-search.js +18 -13
  277. package/lib/plugins/session-title.js +1 -1
  278. package/lib/plugins/session.js +103 -25
  279. package/lib/plugins/settings.js +16 -40
  280. package/lib/plugins/skills.js +18 -1
  281. package/lib/plugins/spill.js +18 -11
  282. package/lib/plugins/subagent.js +208 -42
  283. package/lib/plugins/team.js +11 -5
  284. package/lib/plugins/todo.d.ts +1 -1
  285. package/lib/plugins/todo.js +25 -19
  286. package/lib/plugins/tool-search.js +47 -28
  287. package/lib/plugins/tools-default.js +89 -5
  288. package/lib/plugins/tools.js +3 -3
  289. package/lib/plugins/transcript.js +116 -9
  290. package/lib/plugins/web-search.d.ts +1 -1
  291. package/lib/plugins/web-search.js +25 -16
  292. package/lib/plugins/webserver.js +40 -7
  293. package/lib/remote/assets/app-B3Id1EBq.js +14 -0
  294. package/lib/remote/assets/index.html +2 -2
  295. package/lib/remote/assets/{style-DIB6729x.css → style-NtlpbKOI.css} +1 -1
  296. package/lib/services/types.d.ts +247 -29
  297. package/lib/tools/plugin-cli.d.ts +1 -0
  298. package/lib/tools/plugin-cli.js +209 -0
  299. package/lib/ui/assets/app-B-Jx5dnh.js +90 -0
  300. package/lib/ui/assets/{chunk-BajyYBss.js → chunk-Bfdlo8Me.js} +1 -1
  301. package/lib/ui/assets/chunk-DGX-i4eb.js +12 -0
  302. package/lib/ui/assets/index.html +62 -14
  303. package/lib/ui/assets/style-WzxwEPaE.css +1 -0
  304. package/lib/ui/frames.js +1 -3
  305. package/lib/ui/index.d.ts +30 -1
  306. package/lib/ui/index.js +29 -0
  307. package/lib/ui/manifest.d.ts +24 -6
  308. package/lib/ui/manifest.js +3 -2
  309. package/lib/ui/plugins/actions/bundle.json +8 -0
  310. package/lib/ui/plugins/actions/client.js +43 -0
  311. package/lib/ui/plugins/ask/bundle.json +8 -0
  312. package/lib/ui/plugins/ask/client.js +415 -0
  313. package/lib/ui/plugins/browser/bundle.json +8 -0
  314. package/lib/ui/plugins/composer/bundle.json +9 -0
  315. package/lib/ui/plugins/composer/client.js +1806 -1087
  316. package/lib/ui/plugins/files/bundle.json +8 -0
  317. package/lib/ui/plugins/files/client.js +13 -98
  318. package/lib/ui/plugins/manifest.json +1 -104
  319. package/lib/ui/plugins/palette/bundle.json +8 -0
  320. package/lib/ui/plugins/palette/client.js +360 -0
  321. package/lib/ui/plugins/plugins/bundle.json +8 -0
  322. package/lib/ui/plugins/plugins/client.js +116 -38
  323. package/lib/ui/plugins/preview/bundle.json +8 -0
  324. package/lib/ui/plugins/preview/client.js +6 -16
  325. package/lib/ui/plugins/prompt/bundle.json +8 -0
  326. package/lib/ui/plugins/prompt/client.js +81 -47
  327. package/lib/ui/plugins/sessions/bundle.json +8 -0
  328. package/lib/ui/plugins/sessions/client.js +157 -111
  329. package/lib/ui/plugins/settings/bundle.json +8 -0
  330. package/lib/ui/plugins/settings/client.js +184 -170
  331. package/lib/ui/plugins/skills/bundle.json +8 -0
  332. package/lib/ui/plugins/skills/client.js +161 -79
  333. package/lib/ui/plugins/status/bundle.json +8 -0
  334. package/lib/ui/plugins/status/client.js +165 -26
  335. package/lib/ui/plugins/statusbar/bundle.json +9 -0
  336. package/lib/ui/plugins/statusbar/client.js +100 -144
  337. package/lib/ui/plugins/tasks/bundle.json +8 -0
  338. package/lib/ui/plugins/team/bundle.json +8 -0
  339. package/lib/ui/plugins/team/client.js +60 -58
  340. package/lib/ui/plugins/terminal/bundle.json +8 -0
  341. package/lib/ui/plugins/terminal/client.js +1 -7
  342. package/lib/ui/plugins/trace/bundle.json +11 -0
  343. package/lib/ui/plugins/trace/client.js +86 -179
  344. package/lib/ui/plugins/transcript/bundle.json +8 -0
  345. package/lib/ui/plugins/transcript/client.js +1608 -1243
  346. package/lib/ui/sdk/@dsc/ui/index.d.ts +54 -16
  347. package/lib/ui/sdk/@dsc/ui/package.json +1 -1
  348. package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +20 -1968
  349. package/lib/ui/sdk/@dsc/ui-core/core/attachments.d.ts +185 -0
  350. package/lib/ui/sdk/@dsc/ui-core/core/bytes.d.ts +14 -0
  351. package/lib/ui/sdk/@dsc/ui-core/core/err-text.d.ts +18 -0
  352. package/lib/ui/sdk/@dsc/ui-core/core/git-surface.d.ts +17 -0
  353. package/lib/ui/sdk/@dsc/ui-core/core/json-text.d.ts +11 -0
  354. package/lib/ui/sdk/@dsc/ui-core/core/path-policy.d.ts +44 -0
  355. package/lib/ui/sdk/@dsc/ui-core/core/records.d.ts +16 -0
  356. package/lib/ui/sdk/@dsc/ui-core/core/throughput.d.ts +46 -0
  357. package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +18 -2
  358. package/lib/ui/sdk/@dsc/ui-core/core/unified-diff.d.ts +35 -0
  359. package/lib/ui/sdk/@dsc/ui-core/package.json +1 -1
  360. package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +30 -1
  361. package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +24 -6
  362. package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +19 -8
  363. package/lib/ui/sdk/@dsc/ui-core/ui/signal.d.ts +49 -0
  364. package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +17 -3
  365. package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +1 -1
  366. package/lib/ui/sdk/@dsc/ui-dockkit/package.json +1 -1
  367. package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +4 -0
  368. package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +6 -1
  369. package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +21 -0
  370. package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +1 -0
  371. package/lib/ui/sdk/@dsc/ui-layout/package.json +1 -1
  372. package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +1 -1
  373. package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +10 -1
  374. package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +1 -1
  375. package/lib/ui/sdk/@dsc/ui-layout/usage-today.d.ts +11 -0
  376. package/lib/ui/sdk/@dsc/ui-primitives/dialog-focus.d.ts +30 -0
  377. package/lib/ui/sdk/@dsc/ui-primitives/error-text.d.ts +12 -0
  378. package/lib/ui/sdk/@dsc/ui-primitives/git-surface.d.ts +9 -0
  379. package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +23 -0
  380. package/lib/ui/sdk/@dsc/ui-primitives/humanize-error.d.ts +35 -0
  381. package/lib/ui/sdk/@dsc/ui-primitives/icons-workspace.d.ts +33 -0
  382. package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +21 -3
  383. package/lib/ui/sdk/@dsc/ui-primitives/image-lightbox.d.ts +21 -0
  384. package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +16 -0
  385. package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +10 -14
  386. package/lib/ui/sdk/@dsc/ui-primitives/package.json +1 -1
  387. package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +31 -8
  388. package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +2 -0
  389. package/lib/ui/sdk/@dsc/ui-primitives/review-findings-card.d.ts +25 -0
  390. package/lib/ui/sdk/@dsc/ui-primitives/review-findings.d.ts +64 -0
  391. package/lib/ui/sdk/@dsc/ui-primitives/review-notice-card.d.ts +27 -0
  392. package/lib/ui/sdk/@dsc/ui-primitives/review-notice.d.ts +80 -0
  393. package/lib/ui/sdk/@dsc/ui-primitives/signal.d.ts +9 -0
  394. package/lib/ui/sdk/@dsc/ui-primitives/sizes.d.ts +15 -0
  395. package/lib/ui/sdk/@dsc/ui-primitives/skeleton.d.ts +39 -0
  396. package/lib/ui/sdk/@dsc/ui-primitives/snapshot.d.ts +46 -0
  397. package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +3 -3
  398. package/lib/ui/sdk/@dsc/ui-primitives/throughput.d.ts +13 -0
  399. package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +9 -0
  400. package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +1 -1
  401. package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +30 -6
  402. package/lib/ui/sdk/@dsc/ui-primitives/unified-diff.d.ts +10 -0
  403. package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +10 -1
  404. package/lib/ui/sdk/@dsc/ui-renderer/cordis-host.d.ts +113 -0
  405. package/lib/ui/sdk/@dsc/ui-renderer/package.json +1 -1
  406. package/lib/ui/sdk/@dsc/ui-slots/package.json +1 -1
  407. package/lib/ui/services.d.ts +19 -8
  408. package/lib/ui/services.js +20 -12
  409. package/lib/ui/signal.d.ts +49 -0
  410. package/lib/ui/signal.js +57 -0
  411. package/lib/ui/tui-plugins.js +36 -16
  412. package/package.json +71 -58
  413. package/lib/remote/assets/app-DAcUCOEn.js +0 -14
  414. package/lib/ui/assets/app-B70nVIKd.js +0 -69
  415. package/lib/ui/assets/chunk-BGcgwlCI.js +0 -12
  416. package/lib/ui/assets/style-Bq01xH_b.css +0 -1
@@ -0,0 +1,90 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./chunk-DlC-OlHO.js","./chunk-BIGW1oBm.js","./chunk-D38fbIBN.js","./chunk-C0m74zRD.js","./chunk-wDzz0qaB.js","./chunk-Z72CF80r.js","./chunk-B_vNuMnf.js","./chunk-CylS5w8V.js","./chunk-DkvoVjww.js","./chunk-Cp-IABpG.js","./chunk-ySF7HWmS.js","./chunk-GwR3hkPK.js","./chunk-BPQ3VLAy.js","./chunk-g9-lgVsj.js","./chunk-COt5Ahok.js","./chunk-Yzrsuije.js","./chunk-CPTIWCL2.js","./chunk-Buea-lGh.js","./chunk-DNasK_ZG.js","./chunk-C9GSunVT.js","./chunk-DNRxmY5a.js","./chunk-DJeabLx-.js","./chunk-DnzrXTVv.js","./chunk-CQLl-L-p.js","./chunk-C0PvZCCE.js","./chunk-B6aJPvgy.js","./chunk-Cf5RLm7j.js","./chunk-BX6H_ySx.js","./chunk-CWanVSXC.js","./chunk-Cvjx9yec.js","./chunk-B_P3UbPa.js","./chunk-DNSN1z5r.js","./chunk-DHK4yRfg.js","./chunk-EXT84bkm.js"])))=>i.map(i=>d[i]);
2
+ function Zh(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(s,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X1={exports:{}},_o={};var _y;function Q9(){if(_y)return _o;_y=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var h in l)h!=="key"&&(o[h]=l[h])}else o=l;return l=o.ref,{$$typeof:e,type:s,key:u,ref:l!==void 0?l:null,props:o}}return _o.Fragment=t,_o.jsx=n,_o.jsxs=n,_o}var vy;function J9(){return vy||(vy=1,X1.exports=Q9()),X1.exports}var y=J9();const eC=pa(y),tC=Zh({__proto__:null,default:eC},[y]);var Z1={exports:{}},De={};var yy;function iC(){if(yy)return De;yy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),v=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,M={};function P(D,ne,ae){this.props=D,this.context=ne,this.refs=M,this.updater=ae||x}P.prototype.isReactComponent={},P.prototype.setState=function(D,ne){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,ne,"setState")},P.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function N(){}N.prototype=P.prototype;function X(D,ne,ae){this.props=D,this.context=ne,this.refs=M,this.updater=ae||x}var Q=X.prototype=new N;Q.constructor=X,E(Q,P.prototype),Q.isPureReactComponent=!0;var R=Array.isArray;function V(){}var se={H:null,A:null,T:null,S:null},me=Object.prototype.hasOwnProperty;function k(D,ne,ae){var de=ae.ref;return{$$typeof:e,type:D,key:ne,ref:de!==void 0?de:null,props:ae}}function K(D,ne){return k(D.type,ne,D.props)}function W(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function q(D){var ne={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ae){return ne[ae]})}var Z=/\/+/g;function F(D,ne){return typeof D=="object"&&D!==null&&D.key!=null?q(""+D.key):ne.toString(36)}function H(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(V,V):(D.status="pending",D.then(function(ne){D.status==="pending"&&(D.status="fulfilled",D.value=ne)},function(ne){D.status==="pending"&&(D.status="rejected",D.reason=ne)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function ie(D,ne,ae,de,Ee){var ve=typeof D;(ve==="undefined"||ve==="boolean")&&(D=null);var Me=!1;if(D===null)Me=!0;else switch(ve){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(D.$$typeof){case e:case t:Me=!0;break;case _:return Me=D._init,ie(Me(D._payload),ne,ae,de,Ee)}}if(Me)return Ee=Ee(D),Me=de===""?"."+F(D,0):de,R(Ee)?(ae="",Me!=null&&(ae=Me.replace(Z,"$&/")+"/"),ie(Ee,ne,ae,"",function(Be){return Be})):Ee!=null&&(W(Ee)&&(Ee=K(Ee,ae+(Ee.key==null||D&&D.key===Ee.key?"":(""+Ee.key).replace(Z,"$&/")+"/")+Me)),ne.push(Ee)),1;Me=0;var fe=de===""?".":de+":";if(R(D))for(var Se=0;Se<D.length;Se++)de=D[Se],ve=fe+F(de,Se),Me+=ie(de,ne,ae,ve,Ee);else if(Se=w(D),typeof Se=="function")for(D=Se.call(D),Se=0;!(de=D.next()).done;)de=de.value,ve=fe+F(de,Se++),Me+=ie(de,ne,ae,ve,Ee);else if(ve==="object"){if(typeof D.then=="function")return ie(H(D),ne,ae,de,Ee);throw ne=String(D),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Me}function $(D,ne,ae){if(D==null)return D;var de=[],Ee=0;return ie(D,de,"","",function(ve){return ne.call(ae,ve,Ee++)}),de}function oe(D){if(D._status===-1){var ne=D._result,ae=ne();ae.then(function(de){(D._status===0||D._status===-1)&&(D._status=1,D._result=de,ae.status===void 0&&(ae.status="fulfilled",ae.value=de))},function(de){(D._status===0||D._status===-1)&&(D._status=2,D._result=de,ae.status===void 0&&(ae.status="rejected",ae.reason=de))}),D._status===-1&&(D._status=0,D._result=ae)}if(D._status===1)return D._result.default;throw D._result}var T=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)};function ze(D){var ne=se.T,ae={};ae.types=ne!==null?ne.types:null,se.T=ae;try{var de=D(),Ee=se.S;Ee!==null&&Ee(ae,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(V,T)}catch(ve){T(ve)}finally{ne!==null&&ae.types!==null&&(ne.types=ae.types),se.T=ne}}function We(D){var ne=se.T;if(ne!==null){var ae=ne.types;ae===null?ne.types=[D]:ae.indexOf(D)===-1&&ae.push(D)}else ze(We.bind(null,D))}var O={map:$,forEach:function(D,ne,ae){$(D,function(){ne.apply(this,arguments)},ae)},count:function(D){var ne=0;return $(D,function(){ne++}),ne},toArray:function(D){return $(D,function(ne){return ne})||[]},only:function(D){if(!W(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return De.Activity=g,De.Children=O,De.Component=P,De.Fragment=n,De.Profiler=l,De.PureComponent=X,De.StrictMode=s,De.Suspense=d,De.ViewTransition=S,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=se,De.__COMPILER_RUNTIME={__proto__:null,c:function(D){return se.H.useMemoCache(D)}},De.addTransitionType=We,De.cache=function(D){return function(){return D.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(D,ne,ae){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var de=E({},D.props),Ee=D.key;if(ne!=null)for(ve in ne.key!==void 0&&(Ee=""+ne.key),ne)!me.call(ne,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&ne.ref===void 0||(de[ve]=ne[ve]);var ve=arguments.length-2;if(ve===1)de.children=ae;else if(1<ve){for(var Me=Array(ve),fe=0;fe<ve;fe++)Me[fe]=arguments[fe+2];de.children=Me}return k(D.type,Ee,de)},De.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:o,_context:D},D},De.createElement=function(D,ne,ae){var de,Ee={},ve=null;if(ne!=null)for(de in ne.key!==void 0&&(ve=""+ne.key),ne)me.call(ne,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(Ee[de]=ne[de]);var Me=arguments.length-2;if(Me===1)Ee.children=ae;else if(1<Me){for(var fe=Array(Me),Se=0;Se<Me;Se++)fe[Se]=arguments[Se+2];Ee.children=fe}if(D&&D.defaultProps)for(de in Me=D.defaultProps,Me)Ee[de]===void 0&&(Ee[de]=Me[de]);return k(D,ve,Ee)},De.createRef=function(){return{current:null}},De.forwardRef=function(D){return{$$typeof:h,render:D}},De.isValidElement=W,De.lazy=function(D){return{$$typeof:_,_payload:{_status:-1,_result:D},_init:oe}},De.memo=function(D,ne){return{$$typeof:p,type:D,compare:ne===void 0?null:ne}},De.startTransition=ze,De.unstable_useCacheRefresh=function(){return se.H.useCacheRefresh()},De.use=function(D){return se.H.use(D)},De.useActionState=function(D,ne,ae){return se.H.useActionState(D,ne,ae)},De.useCallback=function(D,ne){return se.H.useCallback(D,ne)},De.useContext=function(D){return se.H.useContext(D)},De.useDebugValue=function(){},De.useDeferredValue=function(D,ne){return se.H.useDeferredValue(D,ne)},De.useEffect=function(D,ne){return se.H.useEffect(D,ne)},De.useEffectEvent=function(D){return se.H.useEffectEvent(D)},De.useId=function(){return se.H.useId()},De.useImperativeHandle=function(D,ne,ae){return se.H.useImperativeHandle(D,ne,ae)},De.useInsertionEffect=function(D,ne){return se.H.useInsertionEffect(D,ne)},De.useLayoutEffect=function(D,ne){return se.H.useLayoutEffect(D,ne)},De.useMemo=function(D,ne){return se.H.useMemo(D,ne)},De.useOptimistic=function(D,ne){return se.H.useOptimistic(D,ne)},De.useReducer=function(D,ne,ae){return se.H.useReducer(D,ne,ae)},De.useRef=function(D){return se.H.useRef(D)},De.useState=function(D){return se.H.useState(D)},De.useSyncExternalStore=function(D,ne,ae){return se.H.useSyncExternalStore(D,ne,ae)},De.useTransition=function(){return se.H.useTransition()},De.version="19.3.1",De}var Sy;function lm(){return Sy||(Sy=1,Z1.exports=iC()),Z1.exports}var I=lm();const nC=pa(I),rC=Zh({__proto__:null,default:nC},[I]);var Q1={exports:{}},vo={},J1={exports:{}},e0={};var by;function sC(){return by||(by=1,(function(e){function t(H,ie){var $=H.length;H.push(ie);e:for(;0<$;){var oe=$-1>>>1,T=H[oe];if(0<l(T,ie))H[oe]=ie,H[$]=T,$=oe;else break e}}function n(H){return H.length===0?null:H[0]}function s(H){if(H.length===0)return null;var ie=H[0],$=H.pop();if($!==ie){H[0]=$;e:for(var oe=0,T=H.length,ze=T>>>1;oe<ze;){var We=2*(oe+1)-1,O=H[We],D=We+1,ne=H[D];if(0>l(O,$))D<T&&0>l(ne,O)?(H[oe]=ne,H[D]=$,oe=D):(H[oe]=O,H[We]=$,oe=We);else if(D<T&&0>l(ne,$))H[oe]=ne,H[D]=$,oe=D;else break e}}return ie}function l(H,ie){var $=H.sortIndex-ie.sortIndex;return $!==0?$:H.id-ie.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var d=[],p=[],_=1,g=null,S=3,v=!1,w=!1,x=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function X(H){for(var ie=n(p);ie!==null;){if(ie.callback===null)s(p);else if(ie.startTime<=H)s(p),ie.sortIndex=ie.expirationTime,t(d,ie);else break;ie=n(p)}}function Q(H){if(x=!1,X(H),!w)if(n(d)!==null)w=!0,R||(R=!0,W());else{var ie=n(p);ie!==null&&F(Q,ie.startTime-H)}}var R=!1,V=-1,se=5,me=-1;function k(){return E?!0:!(e.unstable_now()-me<se)}function K(){if(E=!1,R){var H=e.unstable_now();me=H;var ie=!0;try{e:{w=!1,x&&(x=!1,P(V),V=-1),v=!0;var $=S;try{t:{for(X(H),g=n(d);g!==null&&!(g.expirationTime>H&&k());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,S=g.priorityLevel;var T=oe(g.expirationTime<=H);if(H=e.unstable_now(),typeof T=="function"){g.callback=T,X(H),ie=!0;break t}g===n(d)&&s(d),X(H)}else s(d);g=n(d)}if(g!==null)ie=!0;else{var ze=n(p);ze!==null&&F(Q,ze.startTime-H),ie=!1}}break e}finally{g=null,S=$,v=!1}ie=void 0}}finally{ie?W():R=!1}}}var W;if(typeof N=="function")W=function(){N(K)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Z=q.port2;q.port1.onmessage=K,W=function(){Z.postMessage(null)}}else W=function(){M(K,0)};function F(H,ie){V=M(function(){H(e.unstable_now())},ie)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(H){switch(S){case 1:case 2:case 3:var ie=3;break;default:ie=S}var $=S;S=ie;try{return H()}finally{S=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(H,ie){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var $=S;S=H;try{return ie()}finally{S=$}},e.unstable_scheduleCallback=function(H,ie,$){var oe=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?oe+$:oe):$=oe,H){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=$+T,H={id:_++,callback:ie,priorityLevel:H,startTime:$,expirationTime:T,sortIndex:-1},$>oe?(H.sortIndex=$,t(p,H),n(d)===null&&H===n(p)&&(x?(P(V),V=-1):x=!0,F(Q,$-oe))):(H.sortIndex=T,t(d,H),w||v||(w=!0,R||(R=!0,W()))),H},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(H){var ie=S;return function(){var $=S;S=ie;try{return H.apply(this,arguments)}finally{S=$}}}})(e0)),e0}var wy;function lC(){return wy||(wy=1,J1.exports=sC()),J1.exports}var t0={exports:{}},ei={};var xy;function aC(){if(xy)return ei;xy=1;var e=lm();function t(_){var g="https://react.dev/errors/"+_;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+_+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function h(_,g,S){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:v===u?u:""+v,children:_,containerInfo:g,implementation:S}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(_,g){if(_==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ei.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ei.browser=function(_){return{$$typeof:o,_reason:_}},ei.createPortal=function(_,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return h(_,g,null,S)},ei.flushSync=function(_){var g=d.T,S=s.p;try{if(d.T=null,s.p=2,_)return _()}finally{d.T=g,s.p=S,s.d.f()}},ei.preconnect=function(_,g){typeof _=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(_,g))},ei.prefetchDNS=function(_){typeof _=="string"&&s.d.D(_)},ei.preinit=function(_,g){if(typeof _=="string"&&g&&typeof g.as=="string"){var S=g.as,v=p(S,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,x=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?s.d.S(_,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:x}):S==="script"&&s.d.X(_,{crossOrigin:v,integrity:w,fetchPriority:x,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ei.preinitModule=function(_,g){if(typeof _=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=p(g.as,g.crossOrigin);s.d.M(_,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&s.d.M(_)},ei.preload=function(_,g){if(typeof _=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,v=p(S,g.crossOrigin);s.d.L(_,S,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ei.preloadModule=function(_,g){if(typeof _=="string")if(g){var S=p(g.as,g.crossOrigin);s.d.m(_,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else s.d.m(_)},ei.requestFormReset=function(_){s.d.r(_)},ei.unstable_batchedUpdates=function(_,g){return _(g)},ei.useFormState=function(_,g,S){return d.H.useFormState(_,g,S)},ei.useFormStatus=function(){return d.H.useHostTransitionStatus()},ei.version="19.3.1",ei}var Cy;function W5(){if(Cy)return t0.exports;Cy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),t0.exports=aC(),t0.exports}var Ey;function oC(){if(Ey)return vo;Ey=1;var e=lC(),t=lm(),n=W5();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){for(var r=i,a=r;a&&!a.alternate;)r=a,(r.flags&4098)!==0&&(i=r.return),a=r.return;for(;r.return;)r=r.return;return r.tag===3?i:null}function u(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function d(i){if(o(i)!==i)throw Error(s(188))}function p(i){var r=i.alternate;if(!r){if(r=o(i),r===null)throw Error(s(188));return r!==i?null:i}for(var a=i,c=r;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(c=f.return,c!==null){a=c;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return d(f),i;if(m===c)return d(f),r;m=m.sibling}throw Error(s(188))}if(a.return!==c.return)a=f,c=m;else{for(var b=!1,C=f.child;C;){if(C===a){b=!0,a=f,c=m;break}if(C===c){b=!0,c=f,a=m;break}C=C.sibling}if(!b){for(C=m.child;C;){if(C===a){b=!0,a=m,c=f;break}if(C===c){b=!0,c=m,a=f;break}C=C.sibling}if(!b)throw Error(s(189))}}if(a.alternate!==c)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?i:r}function _(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=_(i),r!==null)return r;i=i.sibling}return null}function g(i,r,a,c,f,m){for(;i!==null;){if((i.tag===5||i.tag===27||i.tag===6)&&a(i,c,f,m)||(i.tag!==22||i.memoizedState===null)&&(r||i.tag!==5&&i.tag!==27)&&g(i.child,r,a,c,f,m))return!0;i=i.sibling}return!1}function S(i){for(i=i.return;i!==null;){if(i.tag===3||i.tag===5||i.tag===27)return i;i=i.return}return null}function v(i){var r=!1;for(i=i.return;i!==null&&(i.tag===4&&(r=!0),!(i.tag===3||i.tag===5||i.tag===27));)i=i.return;return r}function w(i){var r=[null,null],a=S(i);return a===null||x(r,i,a.child,{foundSelf:!1}),r}function x(i,r,a,c){for(;a!==null;){if(a===r)c.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(c.foundSelf)return i[1]=a,!0;i[0]=a}else if((a.tag!==22||a.memoizedState===null)&&x(i,r,a.child,c))return!0;a=a.sibling}return!1}function E(i){switch(i.tag){case 5:case 27:case 6:return i.stateNode;case 3:return i.stateNode.containerInfo;default:throw Error(s(559))}}var M=null,P=null;function N(i,r,a){return i===a?!0:i===r?(M=i,!0):!1}function X(i,r,a){return i===a?(P=i,!1):i===r?(P!==null&&(M=i),!0):!1}function Q(i){if(i===null)return null;do i=i===null?null:i.return;while(i&&i.tag!==5&&i.tag!==27&&i.tag!==3);return i||null}function R(i,r,a){for(var c=0,f=i;f;f=a(f))c++;f=0;for(var m=r;m;m=a(m))f++;for(;0<c-f;)i=a(i),c--;for(;0<f-c;)r=a(r),f--;for(;c--;){if(i===r||r!==null&&i===r.alternate)return i;i=a(i),r=a(r)}return null}var V=Object.assign,se=Symbol.for("react.element"),me=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),F=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ze=Symbol.for("react.activity"),We=Symbol.for("react.legacy_hidden"),O=Symbol.for("react.memo_cache_sentinel"),D=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),ae=Symbol.iterator;function de(i){return i===null||typeof i!="object"?null:(i=ae&&i[ae]||i["@@iterator"],typeof i=="function"?i:null)}var Ee=Symbol.for("react.client.reference");function ve(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ee?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case K:return"Fragment";case q:return"Profiler";case W:return"StrictMode";case ie:return"Suspense";case $:return"SuspenseList";case ze:return"Activity";case D:return"ViewTransition"}if(typeof i=="object")switch(i.$$typeof){case k:return"Portal";case F:return i.displayName||"Context";case Z:return(i._context.displayName||"Context")+".Consumer";case H:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case oe:return r=i.displayName||null,r!==null?r:ve(i.type)||"Memo";case T:r=i._payload,i=i._init;try{return ve(i(r))}catch{}}return null}var Me=Array.isArray,fe=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Be={pending:!1,data:null,method:null,action:null},Fn=[],_r=-1;function Ti(i){return{current:i}}function wt(i){0>_r||(i.current=Fn[_r],Fn[_r]=null,_r--)}function Ze(i,r){_r++,Fn[_r]=i.current,i.current=r}var Vi=Ti(null),vr=Ti(null),an=Ti(null),nl=Ti(null);function rl(i,r){switch(Ze(an,r),Ze(vr,i),Ze(Vi,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?k3(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=k3(r),i=T3(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}wt(Vi),Ze(Vi,i)}function yr(){wt(Vi),wt(vr),wt(an)}function wa(i){var r=i.memoizedState;r!==null&&(Yl._currentValue=r.memoizedState,Ze(nl,i)),r=Vi.current;var a=T3(r,i.type);r!==a&&(Ze(vr,i),Ze(Vi,a))}function sl(i){vr.current===i&&(wt(Vi),wt(vr)),nl.current===i&&(wt(nl),Yl._currentValue=Be)}var J,ce;function xe(i){if(J===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);J=r&&r[1]||"",ce=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+J+i+ce}var Re=!1;function zt(i,r){if(!i||Re)return"";Re=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(he){var z=he}Reflect.construct(i,[],te)}else{try{te.call()}catch(he){z=he}te=!1;try{var Y=Object.getOwnPropertyDescriptor(i.prototype,"props");Object.defineProperty(i.prototype,"props",{configurable:!0,set:function(){throw Error()}}),te=!0,new i}finally{te&&(Y!==void 0?Object.defineProperty(i.prototype,"props",Y):delete i.prototype.props)}}}else{try{throw Error()}catch(he){z=he}(te=i())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(he){if(he&&z&&typeof he.stack=="string")return[he.stack,z.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=c.DetermineComponentFrameRoot(),b=m[0],C=m[1];if(b&&C){var A=b.split(`
5
+ `),j=C.split(`
6
+ `);for(f=c=0;c<A.length&&!A[c].includes("DetermineComponentFrameRoot");)c++;for(;f<j.length&&!j[f].includes("DetermineComponentFrameRoot");)f++;if(c===A.length||f===j.length)for(c=A.length-1,f=j.length-1;1<=c&&0<=f&&A[c]!==j[f];)f--;for(;1<=c&&0<=f;c--,f--)if(A[c]!==j[f]){if(c!==1||f!==1)do if(c--,f--,0>f||A[c]!==j[f]){var G=`
7
+ `+A[c].replace(" at new "," at ");return i.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",i.displayName)),G}while(1<=c&&0<=f);break}}}finally{Re=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?xe(a):""}function nt(i,r){switch(i.tag){case 26:case 27:case 5:return xe(i.type);case 16:return xe("Lazy");case 13:return i.child!==r&&r!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return zt(i.type,!1);case 11:return zt(i.type.render,!1);case 1:return zt(i.type,!0);case 31:return xe("Activity");case 30:return xe("ViewTransition");default:return""}}function Yt(i){try{var r="",a=null;do r+=nt(i,a),a=i,i=i.return;while(i);return r}catch(c){return`
8
+ Error generating stack: `+c.message+`
9
+ `+c.stack}}var _i=Object.prototype.hasOwnProperty,Un=e.unstable_scheduleCallback,Vn=e.unstable_cancelCallback,fs=e.unstable_shouldYield,vc=e.unstable_requestPaint,Kt=e.unstable_now,oi=e.unstable_getCurrentPriorityLevel,qn=e.unstable_ImmediatePriority,qi=e.unstable_UserBlockingPriority,yc=e.unstable_NormalPriority,lw=e.unstable_LowPriority,Zg=e.unstable_IdlePriority,aw=e.log,ow=e.unstable_setDisableYieldValue,xa=null,Mi=null;function Sr(i){if(typeof aw=="function"&&ow(i),Mi&&typeof Mi.setStrictMode=="function")try{Mi.setStrictMode(xa,i)}catch{}}var Ai=Math.clz32?Math.clz32:hw,cw=Math.log,uw=Math.LN2;function hw(i){return i>>>=0,i===0?32:31-(cw(i)/uw|0)|0}var Sc=256,bc=262144,wc=4194304;function ds(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&-i;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function xc(i,r,a){var c=i.pendingLanes;if(c===0)return 0;var f=0,m=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var C=c&134217727;return C!==0?(c=C&~m,c!==0?f=ds(c):(b&=C,b!==0?f=ds(b):a||(a=C&~i,a!==0&&(f=ds(a))))):(C=c&~m,C!==0?f=ds(C):b!==0?f=ds(b):a||(a=c&~i,a!==0&&(f=ds(a)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,a=r&-r,m>=a||m===32&&(a&4194048)!==0)?r:f}function Ca(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Qg(i,r){(r&8)!==0&&(r|=r&32);var a=i.entangledLanes;if(a!==0)for(i=i.entanglements,a&=r;0<a;){var c=31-Ai(a),f=1<<c;r|=i[c],a&=~f}return r}function fw(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jg(){var i=wc;return wc<<=1,(wc&62914560)===0&&(wc=4194304),i}function xf(i){for(var r=[],a=0;31>a;a++)r.push(i);return r}function Ea(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function dw(i,r,a,c,f,m){var b=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var C=i.entanglements,A=i.expirationTimes,j=i.hiddenUpdates;for(a=b&~a;0<a;){var G=31-Ai(a),te=1<<G;C[G]=0,A[G]=-1;var z=j[G];if(z!==null)for(j[G]=null,G=0;G<z.length;G++){var Y=z[G];Y!==null&&(Y.lane&=-536870913)}a&=~te}c!==0&&e_(i,c,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~r))}function e_(i,r,a){i.pendingLanes|=r,i.suspendedLanes&=~r;var c=31-Ai(r);i.entangledLanes|=r,i.entanglements[c]=i.entanglements[c]|1073741824|a&261930}function t_(i,r){var a=i.entangledLanes|=r;for(i=i.entanglements;a;){var c=31-Ai(a),f=1<<c;f&r|i[c]&r&&(i[c]|=r),a&=~f}}function i_(i,r){var a=r&-r;return a=(a&42)!==0?1:Cf(a),(a&(i.suspendedLanes|r))!==0?0:a}function Cf(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ef(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function n_(){var i=Se.p;return i!==0?i:(i=window.event,i===void 0?32:uy(i.type))}function r_(i,r){var a=Se.p;try{return Se.p=i,r()}finally{Se.p=a}}var $n=Math.random().toString(36).slice(2),Wt="__reactFiber$"+$n,vi="__reactProps$"+$n,ll="__reactContainer$"+$n,s_="__reactEvents$"+$n,pw="__reactListeners$"+$n,mw="__reactHandles$"+$n,l_="__reactResources$"+$n,ka="__reactMarker$"+$n,Cc="__reactLoad$"+$n;function Ec(i){delete i[Wt],delete i[vi],delete i[pw],delete i[mw]}function ps(i){var r;if(r=i[Wt])return r;for(var a=i.parentNode;a;){if(r=a[ll]||a[Wt]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(i=q3(i);i!==null;){if(a=i[Wt])return a;i=q3(i)}return r}i=a,a=i.parentNode}return null}function al(i){if(i=i[Wt]||i[ll]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function Ta(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function ol(i){var r=i[l_];return r||(r=i[l_]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Bt(i){i[ka]=!0}function a_(i){i[Cc]=void 0}var o_=new Set,c_={};function ms(i,r){cl(i,r),cl(i+"Capture",r)}function cl(i,r){for(c_[i]=r,i=0;i<r.length;i++)o_.add(r[i])}var gw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),u_={},h_={};function _w(i){return _i.call(h_,i)?!0:_i.call(u_,i)?!1:gw.test(i)?h_[i]=!0:(u_[i]=!0,!1)}var Ye=!1;function f_(){var i=Ye;return Ye=!1,i}function kc(i,r,a){if(_w(r))if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,a)}}function Tc(i,r,a){if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,a)}}function Yn(i,r,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(r,a,c)}}function Di(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function d_(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function vw(i,r,a){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var f=c.get,m=c.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return f.call(this)},set:function(b){a=""+b,m.call(this,b)}}),Object.defineProperty(i,r,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function kf(i){if(!i._valueTracker){var r=d_(i)?"checked":"value";i._valueTracker=vw(i,r,""+i[r])}}function p_(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var a=r.getValue(),c="";return i&&(c=d_(i)?i.checked?"true":"false":i.value),i=c,i!==a?(r.setValue(i),!0):!1}var yw=/[\n"\\]/g;function $i(i){return i.replace(yw,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Tf(i,r,a,c,f,m,b,C){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),r!=null?b==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Di(r)):i.value!==""+Di(r)&&(i.value=""+Di(r)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),r!=null?b==="number"&&i.value==r?Mf(i,Di(i.value)):Mf(i,Di(r)):a!=null?Mf(i,Di(a)):c!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.name=""+Di(C):i.removeAttribute("name")}function m_(i,r,a,c,f,m,b,C){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),r!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){kf(i);return}a=a!=null?""+Di(a):"",r=r!=null?""+Di(r):a,C||r===i.value||(i.value=r),i.defaultValue=r}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=C?i.checked:!!c,i.defaultChecked=!!c,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b),kf(i)}function Mf(i,r){i.defaultValue!==""+r&&(i.defaultValue=""+r)}function ul(i,r,a,c){if(i=i.options,r){r={};for(var f=0;f<a.length;f++)r["$"+a[f]]=!0;for(a=0;a<i.length;a++)f=r.hasOwnProperty("$"+i[a].value),i[a].selected!==f&&(i[a].selected=f),f&&c&&(i[a].defaultSelected=!0)}else{for(a=""+Di(a),r=null,f=0;f<i.length;f++){if(i[f].value===a){i[f].selected=!0,c&&(i[f].defaultSelected=!0);return}r!==null||i[f].disabled||(r=i[f])}r!==null&&(r.selected=!0)}}function g_(i,r,a){if(r!=null&&(r=""+Di(r),r!==i.value&&(i.value=r),a==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=a!=null?""+Di(a):""}function __(i,r,a,c){if(r==null){if(c!=null){if(a!=null)throw Error(s(92));if(Me(c)){if(1<c.length)throw Error(s(93));c=c[0]}a=c}a==null&&(a=""),r=a}a=Di(r),i.defaultValue=a,c=i.textContent,c===a&&c!==""&&c!==null&&(i.value=c),kf(i)}function hl(i,r){if(r){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=r;return}}i.textContent=r}var Sw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function v_(i,r,a){var c=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":c?i.setProperty(r,a):typeof a!="number"||a===0||Sw.has(r)?r==="float"?i.cssFloat=a:i[r]=(""+a).trim():i[r]=a+"px"}function y_(i,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="",Ye=!0);for(var f in r)c=r[f],r.hasOwnProperty(f)&&a[f]!==c&&(v_(i,f,c),Ye=!0)}else for(var m in r)r.hasOwnProperty(m)&&v_(i,m,r[m])}function Af(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ww=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Mc(i){return ww.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function _n(){}var Df=null;function Of(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var fl=null,dl=null;function S_(i){var r=al(i);if(r&&(i=r.stateNode)){var a=i[vi]||null;e:switch(i=r.stateNode,r.type){case"input":if(Tf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$i(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var c=a[r];if(c!==i&&c.form===i.form){var f=c[vi]||null;if(!f)throw Error(s(90));Tf(c,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<a.length;r++)c=a[r],c.form===i.form&&p_(c)}break e;case"textarea":g_(i,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&ul(i,!!a.multiple,r,!1)}}}var Rf=!1;function b_(i,r,a){if(Rf)return i(r,a);Rf=!0;try{var c=i(r);return c}finally{if(Rf=!1,(fl!==null||dl!==null)&&(Mu(),fl&&(r=fl,i=dl,dl=fl=null,S_(r),i)))for(r=0;r<i.length;r++)S_(i[r])}}function Ma(i,r){var a=i.stateNode;if(a===null)return null;var c=a[vi]||null;if(c===null)return null;a=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lf=!1;if(Kn)try{var Aa={};Object.defineProperty(Aa,"passive",{get:function(){Lf=!0}}),window.addEventListener("test",Aa,Aa),window.removeEventListener("test",Aa,Aa)}catch{Lf=!1}var br=null,Nf=null,Ac=null;function w_(){if(Ac)return Ac;var i,r=Nf,a=r.length,c,f="value"in br?br.value:br.textContent,m=f.length;for(i=0;i<a&&r[i]===f[i];i++);var b=a-i;for(c=1;c<=b&&r[a-c]===f[m-c];c++);return Ac=f.slice(i,1<c?1-c:void 0)}function Dc(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Oc(){return!0}function x_(){return!1}function ci(i){function r(a,c,f,m,b){this._reactName=a,this._targetInst=f,this.type=c,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var C in i)i.hasOwnProperty(C)&&(a=i[C],this[C]=a?a(m):m[C]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Oc:x_,this.isPropagationStopped=x_,this}return V(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Oc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Oc)},persist:function(){},isPersistent:Oc}),r}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rc=ci(wr),Da=V({},wr,{view:0,detail:0}),xw=ci(Da),zf,Bf,Oa,Lc=V({},Da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Oa&&(Oa&&i.type==="mousemove"?(zf=i.screenX-Oa.screenX,Bf=i.screenY-Oa.screenY):Bf=zf=0,Oa=i),zf)},movementY:function(i){return"movementY"in i?i.movementY:Bf}}),C_=ci(Lc),Cw=V({},Lc,{dataTransfer:0}),Ew=ci(Cw),kw=V({},Da,{relatedTarget:0}),jf=ci(kw),Tw=V({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Mw=ci(Tw),Aw=V({},wr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Dw=ci(Aw),Ow=V({},wr,{data:0}),E_=ci(Ow),Rw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Nw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zw(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Nw[i])?!!r[i]:!1}function Hf(){return zw}var Bw=V({},Da,{key:function(i){if(i.key){var r=Rw[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Dc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Lw[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hf,charCode:function(i){return i.type==="keypress"?Dc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Dc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),jw=ci(Bw),Hw=V({},Lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k_=ci(Hw),Iw=V({},wr,{submitter:0}),Pw=ci(Iw),Fw=V({},Da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hf}),Uw=ci(Fw),Vw=V({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),qw=ci(Vw),$w=V({},Lc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Yw=ci($w),Kw=V({},wr,{newState:0,oldState:0,source:0}),Ww=ci(Kw),Gw=[9,13,27,32],If=Kn&&"CompositionEvent"in window,Ra=null;Kn&&"documentMode"in document&&(Ra=document.documentMode);var Xw=Kn&&"TextEvent"in window&&!Ra,T_=Kn&&(!If||Ra&&8<Ra&&11>=Ra),M_=" ",A_=!1;function D_(i,r){switch(i){case"keyup":return Gw.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var pl=!1;function Zw(i,r){switch(i){case"compositionend":return O_(r);case"keypress":return r.which!==32?null:(A_=!0,M_);case"textInput":return i=r.data,i===M_&&A_?null:i;default:return null}}function Qw(i,r){if(pl)return i==="compositionend"||!If&&D_(i,r)?(i=w_(),Ac=Nf=br=null,pl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return T_&&r.locale!=="ko"?null:r.data;default:return null}}var Jw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function R_(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!Jw[i.type]:r==="textarea"}function L_(i,r,a,c){fl?dl?dl.push(c):dl=[c]:fl=c,r=Nu(r,"onChange"),0<r.length&&(a=new Rc("onChange","change",null,a,c),i.push({event:a,listeners:r}))}var La=null,Na=null;function ex(i){S3(i,0)}function Nc(i){var r=Ta(i);if(p_(r))return i}function N_(i,r){if(i==="change")return r}var z_=!1;if(Kn){var Pf;if(Kn){var Ff="oninput"in document;if(!Ff){var B_=document.createElement("div");B_.setAttribute("oninput","return;"),Ff=typeof B_.oninput=="function"}Pf=Ff}else Pf=!1;z_=Pf&&(!document.documentMode||9<document.documentMode)}function j_(){La&&(La.detachEvent("onpropertychange",H_),Na=La=null)}function H_(i){if(i.propertyName==="value"&&Nc(Na)){var r=[];L_(r,Na,i,Of(i)),b_(ex,r)}}function tx(i,r,a){i==="focusin"?(j_(),La=r,Na=a,La.attachEvent("onpropertychange",H_)):i==="focusout"&&j_()}function ix(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Nc(Na)}function nx(i,r){if(i==="click")return Nc(r)}function rx(i,r){if(i==="input"||i==="change")return Nc(r)}function sx(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var Oi=typeof Object.is=="function"?Object.is:sx;function za(i,r){if(Oi(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var a=Object.keys(i),c=Object.keys(r);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var f=a[c];if(!_i.call(r,f)||!Oi(i[f],r[f]))return!1}return!0}function Uf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function I_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function P_(i,r){var a=I_(i);i=0;for(var c;a;){if(a.nodeType===3){if(c=i+a.textContent.length,i<=r&&c>=r)return{node:a,offset:r-i};i=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=I_(a)}}function F_(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?F_(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function U_(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Uf(i.document);r instanceof i.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)i=r.contentWindow;else break;r=Uf(i.document)}return r}function Vf(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var lx=Kn&&"documentMode"in document&&11>=document.documentMode,ml=null,qf=null,Ba=null,$f=!1;function V_(i,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;$f||ml==null||ml!==Uf(c)||(c=ml,"selectionStart"in c&&Vf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ba&&za(Ba,c)||(Ba=c,c=Nu(qf,"onSelect"),0<c.length&&(r=new Rc("onSelect","select",null,r,a),i.push({event:r,listeners:c}),r.target=ml)))}function gs(i,r){var a={};return a[i.toLowerCase()]=r.toLowerCase(),a["Webkit"+i]="webkit"+r,a["Moz"+i]="moz"+r,a}var gl={animationend:gs("Animation","AnimationEnd"),animationiteration:gs("Animation","AnimationIteration"),animationstart:gs("Animation","AnimationStart"),transitionrun:gs("Transition","TransitionRun"),transitionstart:gs("Transition","TransitionStart"),transitioncancel:gs("Transition","TransitionCancel"),transitionend:gs("Transition","TransitionEnd")},Yf={},q_={};Kn&&(q_=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function _s(i){if(Yf[i])return Yf[i];if(!gl[i])return i;var r=gl[i],a;for(a in r)if(r.hasOwnProperty(a)&&a in q_)return Yf[i]=r[a];return i}var $_=_s("animationend"),Y_=_s("animationiteration"),K_=_s("animationstart"),ax=_s("transitionrun"),ox=_s("transitionstart"),cx=_s("transitioncancel"),W_=_s("transitionend"),G_=new Map,Kf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Kf.push("scrollEnd");function on(i,r){G_.set(i,r),ms(r,[i])}var ux=0;function Wn(i,r){if(i.name!=null&&i.name!=="auto")return i.name;if(r.autoName!==null)return r.autoName;i=fn.identifierPrefix;var a=ux++;return i="_"+i+"t_"+a.toString(32)+"_",r.autoName=i}function X_(i){if(i==null||typeof i=="string")return i;var r=null,a=Bl;if(a!==null)for(var c=0;c<a.length;c++){var f=i[a[c]];if(f!=null){if(f==="none")return"none";r=r==null?f:r+(" "+f)}}return r??i.default}function Gn(i,r){return i=X_(i),r=X_(r),r==null?i==="auto"?null:i:r==="auto"?null:r}var zc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Yi=[],_l=0,Wf=0;function Bc(){for(var i=_l,r=Wf=_l=0;r<i;){var a=Yi[r];Yi[r++]=null;var c=Yi[r];Yi[r++]=null;var f=Yi[r];Yi[r++]=null;var m=Yi[r];if(Yi[r++]=null,c!==null&&f!==null){var b=c.pending;b===null?f.next=f:(f.next=b.next,b.next=f),c.pending=f}m!==0&&Z_(a,f,m)}}function jc(i,r,a,c){Yi[_l++]=i,Yi[_l++]=r,Yi[_l++]=a,Yi[_l++]=c,Wf|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function Gf(i,r,a,c){return jc(i,r,a,c),Hc(i)}function vs(i,r){return jc(i,null,null,r),Hc(i)}function Z_(i,r,a){i.lanes|=a;var c=i.alternate;c!==null&&(c.lanes|=a);for(var f=!1,m=i.return;m!==null;)m.childLanes|=a,c=m.alternate,c!==null&&(c.childLanes|=a),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(f=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,f&&r!==null&&(f=31-Ai(a),i=m.hiddenUpdates,c=i[f],c===null?i[f]=[r]:c.push(r),r.lane=a|536870912),m):null}function Hc(i){if(50<ro)throw ro=0,Tu=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var vl={};function hx(i,r,a,c){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(i,r,a,c){return new hx(i,r,a,c)}function Xf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Xn(i,r){var a=i.alternate;return a===null?(a=yi(i.tag,r,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=r,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&1206910976,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,r=i.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function Q_(i,r){i.flags&=1206910978;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,r=a.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Ic(i,r,a,c,f,m){var b=0;if(c=i,typeof c=="function")Xf(c)&&(b=1);else if(typeof c=="string")b=I9(i,a,Vi.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(c){case ze:return i=yi(31,a,r,f),i.elementType=ze,i.lanes=m,i;case K:return ys(a.children,f,m,r);case W:b=8,f|=24;break;case q:return i=yi(12,a,r,f|2),i.elementType=q,i.lanes=m,i;case ie:return i=yi(13,a,r,f),i.elementType=ie,i.lanes=m,i;case $:return i=yi(19,a,r,f),i.elementType=$,i.lanes=m,i;case We:case D:return i=f|32,i=yi(30,a,r,i),i.elementType=D,i.lanes=m,i.stateNode={autoName:null,paired:null,clones:null,ref:null},i;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case F:b=10;break e;case Z:b=9;break e;case H:b=11;break e;case oe:b=14;break e;case T:b=16,c=null;break e}b=29,a=Error(s(130,i===null?"null":typeof i,"")),c=null}return r=yi(b,a,r,f),r.elementType=i,r.type=c,r.lanes=m,r}function ys(i,r,a,c){return i=yi(7,i,c,r),i.lanes=a,i}function Zf(i,r,a){return i=yi(6,i,null,r),i.lanes=a,i}function J_(i){var r=yi(18,null,null,0);return r.stateNode=i,r}function Qf(i,r,a){return r=yi(4,i.children!==null?i.children:[],i.key,r),r.lanes=a,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var e2=new WeakMap;function Ki(i,r){if(typeof i=="object"&&i!==null){var a=e2.get(i);return a!==void 0?a:(r={value:i,source:r,stack:Yt(r)},e2.set(i,r),r)}return{value:i,source:r,stack:Yt(r)}}var yl=[],Sl=0,Pc=null,ja=0,Wi=[],Gi=0,xr=null,vn=1,yn="";function Zn(i,r){yl[Sl++]=ja,yl[Sl++]=Pc,Pc=i,ja=r}function t2(i,r,a){Wi[Gi++]=vn,Wi[Gi++]=yn,Wi[Gi++]=xr,xr=i;var c=vn;i=yn;var f=32-Ai(c)-1;c&=~(1<<f),a+=1;var m=32-Ai(r)+f;if(30<m){var b=f-f%5;m=(c&(1<<b)-1).toString(32),c>>=b,f-=b,vn=1<<32-Ai(r)+f|a<<f|c,yn=m+i}else vn=1<<m|a<<f|c,yn=i}function Fc(i){i.return!==null&&(Zn(i,1),t2(i,1,0))}function Jf(i){for(;i===Pc;)Pc=yl[--Sl],yl[Sl]=null,ja=yl[--Sl],yl[Sl]=null;for(;i===xr;)xr=Wi[--Gi],Wi[Gi]=null,yn=Wi[--Gi],Wi[Gi]=null,vn=Wi[--Gi],Wi[Gi]=null}function i2(i,r){Wi[Gi++]=vn,Wi[Gi++]=yn,Wi[Gi++]=xr,vn=r.id,yn=r.overflow,xr=i}var jt=null,at=null,je=!1,Cr=null,Xi=!1,ed=Error(s(519));function Er(i){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ha(Ki(r,i)),ed}function n2(i){var r=i.stateNode,a=i.type,c=i.memoizedProps;switch(r[Wt]=i,r[vi]=c,a){case"dialog":Ue("cancel",r),Ue("close",r);break;case"iframe":case"object":case"embed":Ue("load",r);break;case"video":case"audio":for(a=0;a<lo.length;a++)Ue(lo[a],r);break;case"source":Ue("error",r);break;case"img":case"image":case"link":Ue("error",r),Ue("load",r);break;case"details":Ue("toggle",r);break;case"input":Ue("invalid",r),m_(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ue("invalid",r);break;case"textarea":Ue("invalid",r),__(r,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||c.suppressHydrationWarning===!0||C3(r.textContent,a)?(c.popover!=null&&(Ue("beforetoggle",r),Ue("toggle",r)),c.onScroll!=null&&Ue("scroll",r),c.onScrollEnd!=null&&Ue("scrollend",r),c.onClick!=null&&(r.onclick=_n),r=!0):r=!1,r||Er(i,!0)}function Uc(i){for(jt=i.return;jt;)switch(jt.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:jt=jt.return}}function bl(i){if(i!==jt)return!1;if(!je)return Uc(i),je=!0,!1;var r=i.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||D1(i.type,i.memoizedProps)),a=!a),a&&at&&Er(i),Uc(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));at=V3(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));at=V3(i)}else r===27?(r=at,Fr(i.type)?(i=I1,I1=null,at=i):at=r):at=jt?Qi(i.stateNode.nextSibling):null;return!0}function Ss(){at=jt=null,je=!1}function td(){var i=Cr;return i!==null&&(wi===null?wi=i:wi.push.apply(wi,i),Cr=null),i}function Ha(i){Cr===null?Cr=[i]:Cr.push(i)}var id=Ti(null),bs=null,Qn=null;function kr(i,r,a){Ze(id,r._currentValue),r._currentValue=a}function Jn(i){i._currentValue=id.current,wt(id)}function Vc(i,r,a){for(;i!==null;){var c=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),i===a)break;i=i.return}}function nd(i,r,a,c){var f=i.child;for(f!==null&&(f.return=i);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var C=m;m=f;for(var A=0;A<r.length;A++)if(C.context===r[A]){m.lanes|=a,C=m.alternate,C!==null&&(C.lanes|=a),Vc(m.return,a,i),c||(b=null);break e}m=C.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(s(341));b.lanes|=a,m=b.alternate,m!==null&&(m.lanes|=a),Vc(b,a,i),b=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=a,b=f.alternate,b!==null&&(b.lanes|=a),Vc(f.return,a,i),b=f.child,b=b!==null?b.sibling:null):b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===i){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function ws(i,r,a,c){i=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var C=f.type;Oi(f.pendingProps.value,b.value)||(i!==null?i.push(C):i=[C])}}else if(f===nl.current){if(b=f.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Yl):i=[Yl])}f=f.return}return i!==null&&nd(r,i,a,c),r.flags|=262144,i!==null}function qc(i){for(i=i.firstContext;i!==null;){if(!Oi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function xs(i){bs=i,Qn=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Gt(i){return r2(bs,i)}function $c(i,r){return bs===null&&xs(i),r2(i,r)}function r2(i,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Qn===null){if(i===null)throw Error(s(308));Qn=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else Qn=Qn.next=r;return a}var fx=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(a,c){i.push(c)}};this.abort=function(){r.aborted=!0,i.forEach(function(a){return a()})}},dx=e.unstable_scheduleCallback,px=e.unstable_NormalPriority,xt={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rd(){return{controller:new fx,data:new Map,refCount:0}}function Ia(i){i.refCount--,i.refCount===0&&dx(px,function(){i.controller.abort()})}function s2(i,r){if((i.pendingLanes&4194048)!==0){var a=i.transitionTypes;for(a===null&&(a=i.transitionTypes=[]),i=0;i<r.length;i++){var c=r[i];a.indexOf(c)===-1&&a.push(c)}}}var Pa=null;function mx(i){var r=i.transitionTypes;return i.transitionTypes=null,r}var Fa=null,sd=0,Cs=0,wl=null;function gx(i,r){if(Fa===null){var a=Fa=[];sd=0,Cs=b1(),wl={status:"pending",value:void 0,then:function(c){a.push(c)}}}return sd++,r.then(l2,l2),r}function l2(){if(--sd===0&&(Pa=null,Fa!==null)){wl!==null&&(wl.status="fulfilled");var i=Fa;Fa=null,Cs=0,wl=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function _x(i,r){var a=[],c={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return i.then(function(){c.status="fulfilled",c.value=r;for(var f=0;f<a.length;f++)(0,a[f])(r)},function(f){for(c.status="rejected",c.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),c}var a2=fe.S;fe.S=function(i,r){if(Jv=Kt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&gx(i,r),Pa!==null)for(var a=Pl;a!==null;)s2(a,Pa),a=a.next;if(a=i.types,a!==null){for(var c=Pl;c!==null;)s2(c,a),c=c.next;if(Cs!==0){c=Pa,c===null&&(c=Pa=[]);for(var f=0;f<a.length;f++){var m=a[f];c.indexOf(m)===-1&&c.push(m)}}}a2!==null&&a2(i,r)};var Es=Ti(null);function ld(){var i=Es.current;return i!==null?i:rt.pooledCache}function Yc(i,r){r===null?Ze(Es,Es.current):Ze(Es,r.pool)}function o2(){var i=ld();return i===null?null:{parent:xt._currentValue,pool:i}}var xl=Error(s(460)),ad=Error(s(474)),Kc=Error(s(542)),Wc={then:function(){}};function c2(i){return i=i.status,i==="fulfilled"||i==="rejected"}function u2(i,r,a){switch(a=i[a],a===void 0?i.push(r):a!==r&&(r.then(_n,_n),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,f2(i),i===void 0&&!("reason"in r)?Error(s(600)):i;default:if(typeof r.status=="string")r.then(_n,_n);else{if(i=rt,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(c){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=c}},function(c){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,f2(i),i}throw Ts=r,xl}}function ks(i){try{var r=i._init;return r(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ts=a,xl):a}}var Ts=null;function h2(){if(Ts===null)throw Error(s(459));var i=Ts;return Ts=null,i}function f2(i){if(i===xl||i===Kc)throw Error(s(483))}var Cl=null,Ua=0;function Gc(i){var r=Ua;return Ua+=1,Cl===null&&(Cl=[]),u2(Cl,i,r)}function Tr(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Xc(i,r){throw r.$$typeof===se?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function d2(i){function r(B,L){if(i){var U=B.deletions;U===null?(B.deletions=[L],B.flags|=16):U.push(L)}}function a(B,L){if(!i)return null;for(;L!==null;)r(B,L),L=L.sibling;return null}function c(B){for(var L=new Map;B!==null;)B.key===null?L.set(B.index,B):L.set(B.key,B),B=B.sibling;return L}function f(B,L){return B=Xn(B,L),B.index=0,B.sibling=null,B}function m(B,L,U){return B.index=U,i?(U=B.alternate,U!==null?(U=U.index,U<L?(B.flags|=2,L):U):(B.flags|=134217730,L)):(B.flags|=1048576,L)}function b(B){return i&&B.alternate===null&&(B.flags|=134217730),B}function C(B,L,U,ee){return L===null||L.tag!==6?(L=Zf(U,B.mode,ee),L.return=B,L):(L=f(L,U),L.return=B,L)}function A(B,L,U,ee){var ge=U.type;return ge===K?(B=G(B,L,U.props.children,ee,U.key),Tr(B,U),B):L!==null&&(L.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===T&&ks(ge)===L.type)?(L=f(L,U.props),Tr(L,U),L.return=B,L):(L=Ic(U.type,U.key,U.props,null,B.mode,ee),Tr(L,U),L.return=B,L)}function j(B,L,U,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==U.containerInfo||L.stateNode.implementation!==U.implementation?(L=Qf(U,B.mode,ee),L.return=B,L):(L=f(L,U.children||[]),L.return=B,L)}function G(B,L,U,ee,ge){return L===null||L.tag!==7?(L=ys(U,B.mode,ee,ge),L.return=B,L):(L=f(L,U),L.return=B,L)}function te(B,L,U){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Zf(""+L,B.mode,U),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case me:return U=Ic(L.type,L.key,L.props,null,B.mode,U),Tr(U,L),U.return=B,U;case k:return L=Qf(L,B.mode,U),L.return=B,L;case T:return L=ks(L),te(B,L,U)}if(Me(L)||de(L))return L=ys(L,B.mode,U,null),L.return=B,L;if(typeof L.then=="function")return te(B,Gc(L),U);if(L.$$typeof===F)return te(B,$c(B,L),U);Xc(B,L)}return null}function z(B,L,U,ee){var ge=L!==null?L.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ge!==null?null:C(B,L,""+U,ee);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case me:return U.key===ge?A(B,L,U,ee):null;case k:return U.key===ge?j(B,L,U,ee):null;case T:return U=ks(U),z(B,L,U,ee)}if(Me(U)||de(U))return ge!==null?null:G(B,L,U,ee,null);if(typeof U.then=="function")return z(B,L,Gc(U),ee);if(U.$$typeof===F)return z(B,L,$c(B,U),ee);Xc(B,U)}return null}function Y(B,L,U,ee,ge){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return B=B.get(U)||null,C(L,B,""+ee,ge);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case me:return B=B.get(ee.key===null?U:ee.key)||null,A(L,B,ee,ge);case k:return B=B.get(ee.key===null?U:ee.key)||null,j(L,B,ee,ge);case T:return ee=ks(ee),Y(B,L,U,ee,ge)}if(Me(ee)||de(ee))return B=B.get(U)||null,G(L,B,ee,ge,null);if(typeof ee.then=="function")return Y(B,L,U,Gc(ee),ge);if(ee.$$typeof===F)return Y(B,L,U,$c(L,ee),ge);Xc(L,ee)}return null}function he(B,L,U,ee){for(var ge=null,qe=null,be=L,Te=L=0,kt=null;be!==null&&Te<U.length;Te++){be.index>Te?(kt=be,be=null):kt=be.sibling;var $e=z(B,be,U[Te],ee);if($e===null){be===null&&(be=kt);break}i&&be&&$e.alternate===null&&r(B,be),L=m($e,L,Te),qe===null?ge=$e:qe.sibling=$e,qe=$e,be=kt}if(Te===U.length)return a(B,be),je&&Zn(B,Te),ge;if(be===null){for(;Te<U.length;Te++)be=te(B,U[Te],ee),be!==null&&(L=m(be,L,Te),qe===null?ge=be:qe.sibling=be,qe=be);return je&&Zn(B,Te),ge}for(be=c(be);Te<U.length;Te++)kt=Y(be,B,Te,U[Te],ee),kt!==null&&(i&&($e=kt.alternate,$e!==null&&be.delete($e.key===null?Te:$e.key)),L=m(kt,L,Te),qe===null?ge=kt:qe.sibling=kt,qe=kt);return i&&be.forEach(function(Yr){return r(B,Yr)}),je&&Zn(B,Te),ge}function ye(B,L,U,ee){if(U==null)throw Error(s(151));for(var ge=null,qe=null,be=L,Te=L=0,kt=null,$e=U.next();be!==null&&!$e.done;Te++,$e=U.next()){be.index>Te?(kt=be,be=null):kt=be.sibling;var Yr=z(B,be,$e.value,ee);if(Yr===null){be===null&&(be=kt);break}i&&be&&Yr.alternate===null&&r(B,be),L=m(Yr,L,Te),qe===null?ge=Yr:qe.sibling=Yr,qe=Yr,be=kt}if($e.done)return a(B,be),je&&Zn(B,Te),ge;if(be===null){for(;!$e.done;Te++,$e=U.next())$e=te(B,$e.value,ee),$e!==null&&(L=m($e,L,Te),qe===null?ge=$e:qe.sibling=$e,qe=$e);return je&&Zn(B,Te),ge}for(be=c(be);!$e.done;Te++,$e=U.next())$e=Y(be,B,Te,$e.value,ee),$e!==null&&(i&&(kt=$e.alternate,kt!==null&&be.delete(kt.key===null?Te:kt.key)),L=m($e,L,Te),qe===null?ge=$e:qe.sibling=$e,qe=$e);return i&&be.forEach(function(Z9){return r(B,Z9)}),je&&Zn(B,Te),ge}function Ne(B,L,U,ee){if(typeof U=="object"&&U!==null&&U.type===K&&U.key===null&&U.props.ref===void 0&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case me:e:{for(var ge=U.key;L!==null;){if(L.key===ge){if(ge=U.type,ge===K){if(L.tag===7){a(B,L.sibling),ee=f(L,U.props.children),Tr(ee,U),ee.return=B,B=ee;break e}}else if(L.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===T&&ks(ge)===L.type){a(B,L.sibling),ee=f(L,U.props),Tr(ee,U),ee.return=B,B=ee;break e}a(B,L);break}else r(B,L);L=L.sibling}U.type===K?(ee=ys(U.props.children,B.mode,ee,U.key),Tr(ee,U),ee.return=B,B=ee):(ee=Ic(U.type,U.key,U.props,null,B.mode,ee),Tr(ee,U),ee.return=B,B=ee)}return b(B);case k:e:{for(ge=U.key;L!==null;){if(L.key===ge)if(L.tag===4&&L.stateNode.containerInfo===U.containerInfo&&L.stateNode.implementation===U.implementation){a(B,L.sibling),ee=f(L,U.children||[]),ee.return=B,B=ee;break e}else{a(B,L);break}else r(B,L);L=L.sibling}ee=Qf(U,B.mode,ee),ee.return=B,B=ee}return b(B);case T:return U=ks(U),Ne(B,L,U,ee)}if(Me(U))return he(B,L,U,ee);if(de(U)){if(ge=de(U),typeof ge!="function")throw Error(s(150));return U=ge.call(U),ye(B,L,U,ee)}if(typeof U.then=="function")return Ne(B,L,Gc(U),ee);if(U.$$typeof===F)return Ne(B,L,$c(B,U),ee);Xc(B,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,L!==null&&L.tag===6?(a(B,L.sibling),ee=f(L,U),ee.return=B,B=ee):(a(B,L),ee=Zf(U,B.mode,ee),ee.return=B,B=ee),b(B)):a(B,L)}return function(B,L,U,ee){try{Ua=0;var ge=Ne(B,L,U,ee);return Cl=null,ge}catch(be){if(be===xl||be===Kc)throw be;var qe=yi(29,be,null,B.mode);return qe.lanes=ee,qe.return=B,qe}}}var Ms=d2(!0),p2=d2(!1),Mr=!1;function od(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cd(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ar(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Dr(i,r,a){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ge&2)!==0){var f=c.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),c.pending=r,r=Hc(i),Z_(i,null,a),r}return jc(i,c,r,a),Hc(i)}function Va(i,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=i.pendingLanes,a|=c,r.lanes=a,t_(i,a)}}function ud(i,r){var a=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,a=a.next}while(a!==null);m===null?f=m=r:m=m.next=r}else f=m=r;a={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:c.shared,callbacks:c.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=r:i.next=r,a.lastBaseUpdate=r}var hd=!1;function qa(){if(hd){var i=wl;if(i!==null)throw i}}function $a(i,r,a,c){hd=!1;var f=i.updateQueue;Mr=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var A=C,j=A.next;A.next=null,b===null?m=j:b.next=j,b=A;var G=i.alternate;G!==null&&(G=G.updateQueue,C=G.lastBaseUpdate,C!==b&&(C===null?G.firstBaseUpdate=j:C.next=j,G.lastBaseUpdate=A))}if(m!==null){var te=f.baseState;b=0,G=j=A=null,C=m;do{var z=C.lane&-536870913,Y=z!==C.lane;if(Y?(Ve&z)===z:(c&z)===z){z!==0&&z===Cs&&(hd=!0),G!==null&&(G=G.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var he=i,ye=C;z=r;var Ne=a;switch(ye.tag){case 1:if(he=ye.payload,typeof he=="function"){te=he.call(Ne,te,z);break e}te=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,z=typeof he=="function"?he.call(Ne,te,z):he,z==null)break e;te=V({},te,z);break e;case 2:Mr=!0}}z=C.callback,z!==null&&(i.flags|=64,Y&&(i.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[z]:Y.push(z))}else Y={lane:z,tag:C.tag,payload:C.payload,callback:C.callback,next:null},G===null?(j=G=Y,A=te):G=G.next=Y,b|=z;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;Y=C,C=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);G===null&&(A=te),f.baseState=A,f.firstBaseUpdate=j,f.lastBaseUpdate=G,m===null&&(f.shared.lanes=0),jr|=b,i.lanes=b,i.memoizedState=te}}function m2(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function g2(i,r){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)m2(a[i],r)}var Or=Ti(null),Zc=Ti(0);function _2(i,r){i=rr,Ze(Zc,i),Ze(Or,r),rr=i|r.baseLanes}function fd(){Ze(Zc,rr),Ze(Or,Or.current)}function dd(){rr=Zc.current,wt(Or),wt(Zc)}var Xt=Ti(null),si=null;function Rr(i){var r=i.alternate;Ze(Zt,Zt.current&1),Ze(Xt,i),si===null&&(r===null||Or.current!==null||r.memoizedState!==null)&&(si=i)}function pd(i){Ze(Zt,Zt.current),Ze(Xt,i),si===null&&(si=i)}function v2(i){i.tag===22?(Ze(Zt,Zt.current),Ze(Xt,i),si===null&&(si=i)):Lr()}function Lr(){Ze(Zt,Zt.current),Ze(Xt,Xt.current)}function Ri(i){wt(Xt),si===i&&(si=null),wt(Zt)}var Zt=Ti(0);function Ya(i,r){Ze(Xt,Xt.current),Ze(Zt,r)}function md(i){wt(Zt),wt(Xt),si===i&&(si=null)}function Qc(i){for(var r=i;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||j1(a)||H1(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!=="independent"){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var er=0,Le=null,tt=null,Ct=null,Jc=!1,El=!1,As=!1,eu=0,Ka=0,kl=null,vx=0;function mt(){throw Error(s(321))}function gd(i,r){if(r===null)return!1;for(var a=0;a<r.length&&a<i.length;a++)if(!Oi(i[a],r[a]))return!1;return!0}function _d(i,r,a,c,f,m){return er=m,Le=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,fe.H=i===null||i.memoizedState===null?tv:iv,As=!1,m=a(c,f),As=!1,El&&(m=S2(r,a,c,f)),y2(i),m}function y2(i){fe.H=au;var r=tt!==null&&tt.next!==null;if(er=0,Ct=tt=Le=null,Jc=!1,Ka=0,kl=null,r)throw Error(s(300));i===null||Et||(i=i.dependencies,i!==null&&qc(i)&&(Et=!0))}function S2(i,r,a,c){Le=i;var f=0;do{if(El&&(kl=null),Ka=0,El=!1,25<=f)throw Error(s(301));if(f+=1,Ct=tt=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}fe.H=kx,m=r(a,c)}while(El);return m}function yx(){var i=fe.H,r=i.useState()[0];return r=typeof r.then=="function"?Wa(r):r,i=i.useState()[0],(tt!==null?tt.memoizedState:null)!==i&&(Le.flags|=1024),r}function vd(){var i=eu!==0;return eu=0,i}function yd(i,r,a){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~a}function Sd(i){if(Jc){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Jc=!1}er=0,Ct=tt=Le=null,El=!1,Ka=eu=0,kl=null}function ui(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Le.memoizedState=Ct=i:Ct=Ct.next=i,Ct}function yt(){if(tt===null){var i=Le.alternate;i=i!==null?i.memoizedState:null}else i=tt.next;var r=Ct===null?Le.memoizedState:Ct.next;if(r!==null)Ct=r,tt=i;else{if(i===null)throw Le.alternate===null?Error(s(467)):Error(s(310));tt=i,i={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Ct===null?Le.memoizedState=Ct=i:Ct=Ct.next=i}return Ct}function tu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wa(i){var r=Ka;return Ka+=1,kl===null&&(kl=[]),i=u2(kl,i,r),r=Le,(Ct===null?r.memoizedState:Ct.next)===null&&(r=r.alternate,fe.H=r===null||r.memoizedState===null?tv:iv),i}function iu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Wa(i);if(i.$$typeof===ne)return;if(i.$$typeof===F)return Gt(i)}throw Error(s(438,String(i)))}function bd(i){var r=null,a=Le.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var c=Le.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=tu(),Le.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(i),c=0;c<i;c++)a[c]=O;return r.index++,a}function tr(i,r){return typeof r=="function"?r(i):r}function nu(i){var r=yt();return wd(r,tt,i)}function wd(i,r,a){var c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=a;var f=i.baseQueue,m=c.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}r.baseQueue=f=m,c.pending=null}if(m=i.baseState,f===null)i.memoizedState=m;else{r=f.next;var C=b=null,A=null,j=r,G=!1;do{var te=j.lane&-536870913;if(te!==j.lane?(Ve&te)===te:(er&te)===te){var z=j.revertLane;if(z===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),te===Cs&&(G=!0);else if((er&z)===z){j=j.next,z===Cs&&(G=!0);continue}else te={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},A===null?(C=A=te,b=m):A=A.next=te,Le.lanes|=z,jr|=z;te=j.action,As&&a(m,te),m=j.hasEagerState?j.eagerState:a(m,te)}else z={lane:te,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},A===null?(C=A=z,b=m):A=A.next=z,Le.lanes|=te,jr|=te;j=j.next}while(j!==null&&j!==r);if(A===null?b=m:A.next=C,!Oi(m,i.memoizedState)&&(Et=!0,G&&(a=wl,a!==null)))throw a;i.memoizedState=m,i.baseState=b,i.baseQueue=A,c.lastRenderedState=m}return f===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function xd(i){var r=yt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=i;var c=a.dispatch,f=a.pending,m=r.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do m=i(m,b.action),b=b.next;while(b!==f);Oi(m,r.memoizedState)||(Et=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),a.lastRenderedState=m}return[m,c]}function b2(i,r,a){var c=Le,f=yt(),m=je;if(m){if(a===void 0)throw Error(s(407));a=a()}else a=r();var b=!Oi((tt||f).memoizedState,a);if(b&&(f.memoizedState=a,Et=!0),f=f.queue,kd(C2.bind(null,c,f,i),[i]),i=f.getSnapshot!==r||b||Ct!==null&&(Ct.memoizedState.tag&1)!==0,Tl(i?9:8,{destroy:void 0},x2.bind(null,c,f,a,r),null),i){if(c.flags|=2048,rt===null)throw Error(s(349));m||(er&127)!==0||w2(c,r,a)}return a}function w2(i,r,a){i.flags|=16384,i={getSnapshot:r,value:a},r=Le.updateQueue,r===null?(r=tu(),Le.updateQueue=r,r.stores=[i]):(a=r.stores,a===null?r.stores=[i]:a.push(i))}function x2(i,r,a,c){r.value=a,r.getSnapshot=c,E2(r)&&k2(i)}function C2(i,r,a){return a(function(){E2(r)&&k2(i)})}function E2(i){var r=i.getSnapshot;i=i.value;try{var a=r();return!Oi(i,a)}catch{return!0}}function k2(i){var r=vs(i,2);r!==null&&xi(r,i,2)}function Cd(i){var r=ui();if(typeof i=="function"){var a=i;if(i=a(),As){Sr(!0);try{a()}finally{Sr(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:i},r}function T2(i,r,a,c){return i.baseState=a,wd(i,tt,typeof c=="function"?c:tr)}function Sx(i,r,a,c,f){if(lu(i))throw Error(s(485));if(i=r.action,i!==null){var m={payload:f,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};fe.T!==null?a(!0):m.isTransition=!1,c(m),a=r.pending,a===null?(m.next=r.pending=m,M2(r,m)):(m.next=a.next,r.pending=a.next=m)}}function M2(i,r){var a=r.action,c=r.payload,f=i.state;if(r.isTransition){var m=fe.T,b={};b.types=m!==null?m.types:null,fe.T=b;try{var C=a(f,c),A=fe.S;A!==null&&A(b,C),A2(i,r,C)}catch(j){Ed(i,r,j)}finally{m!==null&&b.types!==null&&(m.types=b.types),fe.T=m}}else try{m=a(f,c),A2(i,r,m)}catch(j){Ed(i,r,j)}}function A2(i,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){D2(i,r,c)},function(c){return Ed(i,r,c)}):D2(i,r,a)}function D2(i,r,a){r.status="fulfilled",r.value=a,O2(r),i.state=a,r=i.pending,r!==null&&(a=r.next,a===r?i.pending=null:(a=a.next,r.next=a,M2(i,a)))}function Ed(i,r,a){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=a,O2(r),r=r.next;while(r!==c)}i.action=null}function O2(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function R2(i,r){return r}function L2(i,r){if(je){var a=rt.formState;if(a!==null){e:{var c=Le;if(je){if(at){t:{for(var f=at,m=Xi;f.nodeType!==8;){if(!m){f=null;break t}if(f=Qi(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){at=Qi(f.nextSibling),c=f.data==="F!";break e}}Er(c)}c=!1}c&&(r=a[0])}}return a=ui(),a.memoizedState=a.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:R2,lastRenderedState:r},a.queue=c,a=Q2.bind(null,Le,c),c.dispatch=a,c=Cd(!1),m=Od.bind(null,Le,!1,c.queue),c=ui(),f={state:r,dispatch:null,action:i,pending:null},c.queue=f,a=Sx.bind(null,Le,f,m,a),f.dispatch=a,c.memoizedState=i,[r,a,!1]}function N2(i){var r=yt();return z2(r,tt,i)}function z2(i,r,a){if(r=wd(i,r,R2)[0],i=nu(tr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Wa(r)}catch(b){throw b===xl?Kc:b}else c=r;r=yt();var f=r.queue,m=f.dispatch;return a!==r.memoizedState&&(Le.flags|=2048,Tl(9,{destroy:void 0},bx.bind(null,f,a),null)),[c,m,i]}function bx(i,r){i.action=r}function B2(i){var r=yt(),a=tt;if(a!==null)return z2(r,a,i);yt(),r=r.memoizedState,a=yt();var c=a.queue.dispatch;return a.memoizedState=i,[r,c,!1]}function Tl(i,r,a,c){return i={tag:i,create:a,deps:c,inst:r,next:null},r=Le.updateQueue,r===null&&(r=tu(),Le.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=i.next=i:(c=a.next,a.next=i,i.next=c,r.lastEffect=i),i}function j2(){return yt().memoizedState}function ru(i,r,a,c){var f=ui();Le.flags|=i,f.memoizedState=Tl(1|r,{destroy:void 0},a,c===void 0?null:c)}function su(i,r,a,c){var f=yt();c=c===void 0?null:c;var m=f.memoizedState.inst;tt!==null&&c!==null&&gd(c,tt.memoizedState.deps)?f.memoizedState=Tl(r,m,a,c):(Le.flags|=i,f.memoizedState=Tl(1|r,m,a,c))}function H2(i,r){ru(8390656,8,i,r)}function kd(i,r){su(2048,8,i,r)}function wx(i){Le.flags|=4;var r=Le.updateQueue;if(r===null)r=tu(),Le.updateQueue=r,r.events=[i];else{var a=r.events;a===null?r.events=[i]:a.push(i)}}function I2(i){var r=yt().memoizedState;return wx({ref:r,nextImpl:i}),function(){if((Ge&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function P2(i,r){return su(4,2,i,r)}function F2(i,r){return su(4,4,i,r)}function U2(i,r){if(typeof r=="function"){i=i();var a=r(i);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function V2(i,r,a){a=a!=null?a.concat([i]):null,su(4,4,U2.bind(null,r,i),a)}function Td(){}function q2(i,r){var a=yt();r=r===void 0?null:r;var c=a.memoizedState;return r!==null&&gd(r,c[1])?c[0]:(a.memoizedState=[i,r],i)}function $2(i,r){var a=yt();r=r===void 0?null:r;var c=a.memoizedState;if(r!==null&&gd(r,c[1]))return c[0];if(c=i(),As){Sr(!0);try{i()}finally{Sr(!1)}}return a.memoizedState=[c,r],c}function Md(i,r,a){return a===void 0||(er&1073741824)!==0&&(Ve&261930)===0?i.memoizedState=r:(i.memoizedState=a,i=t3(),Le.lanes|=i,jr|=i,a)}function Y2(i,r,a,c){return Oi(a,r)?a:Or.current!==null?(i=Md(i,a,c),Oi(i,r)||(Et=!0),i):(er&106)===0||(er&1073741824)!==0&&(Ve&261930)===0?(Et=!0,i.memoizedState=a):(i=t3(),Le.lanes|=i,jr|=i,r)}function K2(i,r,a,c,f){var m=Se.p;Se.p=m!==0&&8>m?m:8;var b=fe.T,C={};C.types=b!==null?b.types:null,fe.T=C,Od(i,!1,r,a);try{var A=f(),j=fe.S;if(j!==null&&j(C,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var G=_x(A,c);Ga(i,r,G,Bi(i))}else Ga(i,r,c,Bi(i))}catch(te){Ga(i,r,{then:function(){},status:"rejected",reason:te},Bi())}finally{Se.p=m,b!==null&&C.types!==null&&(b.types=C.types),fe.T=b}}function xx(){}function Ad(i,r,a,c){if(i.tag!==5)throw Error(s(476));var f=W2(i).queue;K2(i,f,r,Be,a===null?xx:function(){return G2(i),a(c)})}function W2(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:Be,baseState:Be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:Be},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:a},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function G2(i){var r=W2(i);r.next===null&&(r=i.alternate.memoizedState),Ga(i,r.next.queue,{},Bi())}function Dd(){return Gt(Yl)}function X2(){return yt().memoizedState}function Z2(){return yt().memoizedState}function Cx(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var a=Bi();i=Ar(a);var c=Dr(r,i,a);c!==null&&(xi(c,r,a),Va(c,r,a)),r={cache:rd()},i.payload=r;return}r=r.return}}function Ex(i,r,a){var c=Bi();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lu(i)?J2(r,a):(a=Gf(i,r,a,c),a!==null&&(xi(a,i,c),ev(a,r,c)))}function Q2(i,r,a){var c=Bi();Ga(i,r,a,c)}function Ga(i,r,a,c){var f={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(lu(i))J2(r,f);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var b=r.lastRenderedState,C=m(b,a);if(f.hasEagerState=!0,f.eagerState=C,Oi(C,b))return jc(i,r,f,0),rt===null&&Bc(),!1}catch{}if(a=Gf(i,r,f,c),a!==null)return xi(a,i,c),ev(a,r,c),!0}return!1}function Od(i,r,a,c){if(c={lane:2,revertLane:b1(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lu(i)){if(r)throw Error(s(479))}else r=Gf(i,a,c,2),r!==null&&xi(r,i,2)}function lu(i){var r=i.alternate;return i===Le||r!==null&&r===Le}function J2(i,r){El=Jc=!0;var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}function ev(i,r,a){if((a&4194048)!==0){var c=r.lanes;c&=i.pendingLanes,a|=c,r.lanes=a,t_(i,a)}}var au={readContext:Gt,use:iu,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt,useEffectEvent:mt},tv={readContext:Gt,use:iu,useCallback:function(i,r){return ui().memoizedState=[i,r===void 0?null:r],i},useContext:Gt,useEffect:H2,useImperativeHandle:function(i,r,a){a=a!=null?a.concat([i]):null,ru(4194308,4,U2.bind(null,r,i),a)},useLayoutEffect:function(i,r){return ru(4194308,4,i,r)},useInsertionEffect:function(i,r){ru(4,2,i,r)},useMemo:function(i,r){var a=ui();r=r===void 0?null:r;var c=i();if(As){Sr(!0);try{i()}finally{Sr(!1)}}return a.memoizedState=[c,r],c},useReducer:function(i,r,a){var c=ui();if(a!==void 0){var f=a(r);if(As){Sr(!0);try{a(r)}finally{Sr(!1)}}}else f=r;return c.memoizedState=c.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},c.queue=i,i=i.dispatch=Ex.bind(null,Le,i),[c.memoizedState,i]},useRef:function(i){var r=ui();return i={current:i},r.memoizedState=i},useState:function(i){i=Cd(i);var r=i.queue,a=Q2.bind(null,Le,r);return r.dispatch=a,[i.memoizedState,a]},useDebugValue:Td,useDeferredValue:function(i,r){var a=ui();return Md(a,i,r)},useTransition:function(){var i=Cd(!1);return i=K2.bind(null,Le,i.queue,!0,!1),ui().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,a){var c=Le,f=ui();if(je){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),rt===null)throw Error(s(349));(Ve&127)!==0||w2(c,r,a)}f.memoizedState=a;var m={value:a,getSnapshot:r};return f.queue=m,H2(C2.bind(null,c,m,i),[i]),c.flags|=2048,Tl(9,{destroy:void 0},x2.bind(null,c,m,a,r),null),a},useId:function(){var i=ui(),r=rt.identifierPrefix;if(je){var a=yn,c=vn;a=(c&~(1<<32-Ai(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=eu++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=vx++,r="_"+r+"r_"+a.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Dd,useFormState:L2,useActionState:L2,useOptimistic:function(i){var r=ui();r.memoizedState=r.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Od.bind(null,Le,!0,a),a.dispatch=r,[i,r]},useMemoCache:bd,useCacheRefresh:function(){return ui().memoizedState=Cx.bind(null,Le)},useEffectEvent:function(i){var r=ui(),a={impl:i};return r.memoizedState=a,function(){if((Ge&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},iv={readContext:Gt,use:iu,useCallback:q2,useContext:Gt,useEffect:kd,useImperativeHandle:V2,useInsertionEffect:P2,useLayoutEffect:F2,useMemo:$2,useReducer:nu,useRef:j2,useState:function(){return nu(tr)},useDebugValue:Td,useDeferredValue:function(i,r){var a=yt();return Y2(a,tt.memoizedState,i,r)},useTransition:function(){var i=nu(tr)[0],r=yt().memoizedState;return[typeof i=="boolean"?i:Wa(i),r]},useSyncExternalStore:b2,useId:X2,useHostTransitionStatus:Dd,useFormState:N2,useActionState:N2,useOptimistic:function(i,r){var a=yt();return T2(a,tt,i,r)},useMemoCache:bd,useCacheRefresh:Z2,useEffectEvent:I2},kx={readContext:Gt,use:iu,useCallback:q2,useContext:Gt,useEffect:kd,useImperativeHandle:V2,useInsertionEffect:P2,useLayoutEffect:F2,useMemo:$2,useReducer:xd,useRef:j2,useState:function(){return xd(tr)},useDebugValue:Td,useDeferredValue:function(i,r){var a=yt();return tt===null?Md(a,i,r):Y2(a,tt.memoizedState,i,r)},useTransition:function(){var i=xd(tr)[0],r=yt().memoizedState;return[typeof i=="boolean"?i:Wa(i),r]},useSyncExternalStore:b2,useId:X2,useHostTransitionStatus:Dd,useFormState:B2,useActionState:B2,useOptimistic:function(i,r){var a=yt();return tt!==null?T2(a,tt,i,r):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:bd,useCacheRefresh:Z2,useEffectEvent:I2};function Rd(i,r,a,c){r=i.memoizedState,a=a(c,r),a=a==null?r:V({},r,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Ld={enqueueSetState:function(i,r,a){i=i._reactInternals;var c=Bi(),f=Ar(c);f.payload=r,a!=null&&(f.callback=a),r=Dr(i,f,c),r!==null&&(xi(r,i,c),Va(r,i,c))},enqueueReplaceState:function(i,r,a){i=i._reactInternals;var c=Bi(),f=Ar(c);f.tag=1,f.payload=r,a!=null&&(f.callback=a),r=Dr(i,f,c),r!==null&&(xi(r,i,c),Va(r,i,c))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var a=Bi(),c=Ar(a);c.tag=2,r!=null&&(c.callback=r),r=Dr(i,c,a),r!==null&&(xi(r,i,a),Va(r,i,a))}};function nv(i,r,a,c,f,m,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,m,b):r.prototype&&r.prototype.isPureReactComponent?!za(a,c)||!za(f,m):!0}function rv(i,r,a,c){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,c),r.state!==i&&Ld.enqueueReplaceState(r,r.state,null)}function Ds(i,r){var a=r;if("ref"in r){a={};for(var c in r)c!=="ref"&&(a[c]=r[c])}if(i=i.defaultProps){a===r&&(a=V({},a));for(var f in i)a[f]===void 0&&(a[f]=i[f])}return a}function sv(i){zc(i)}function lv(i){console.error(i)}function av(i){zc(i)}function ou(i,r){try{var a=i.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function ov(i,r,a){try{var c=i.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Nd(i,r,a){return a=Ar(a),a.tag=3,a.payload={element:null},a.callback=function(){ou(i,r)},a}function cv(i){return i=Ar(i),i.tag=3,i}function uv(i,r,a,c){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=c.value;i.payload=function(){return f(m)},i.callback=function(){ov(r,a,c)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){ov(r,a,c),typeof f!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function Tx(i,r,a,c,f){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=a.alternate,r!==null&&ws(r,a,f,!0),a=Xt.current,a!==null){switch(a.tag){case 31:case 13:case 19:return si===null?Au():a.alternate===null&&gt===0&&(gt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,c===Wc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([c]):r.add(c),v1(i,c,f)),!1;case 22:return a.flags|=65536,c===Wc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([c]):a.add(c)),v1(i,c,f)),!1}throw Error(s(435,a.tag))}return v1(i,c,f),Au(),!1}if(je)return r=Xt.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,c!==ed&&(i=Error(s(422),{cause:c}),Ha(Ki(i,a)))):(c!==ed&&(r=Error(s(423),{cause:c}),Ha(Ki(r,a))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,c=Ki(c,a),f=Nd(i.stateNode,c,f),ud(i,f),gt!==4&&(gt=2)),!1;var m=Error(s(520),{cause:c});if(m=Ki(m,a),no===null?no=[m]:no.push(m),gt!==4&&(gt=2),r===null)return!0;c=Ki(c,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,i=f&-f,a.lanes|=i,i=Nd(a.stateNode,c,i),ud(a,i),!1;case 1:if(r=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Hr===null||!Hr.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=cv(f),uv(f,i,a,c),ud(a,f),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var zd=Error(s(461)),Et=!1;function Dt(i,r,a,c){r.child=i===null?p2(r,null,a,c):Ms(r,i.child,a,c)}function hv(i,r,a,c,f){a=a.render;var m=r.ref;if("ref"in c){var b={};for(var C in c)C!=="ref"&&(b[C]=c[C])}else b=c;return xs(r),c=_d(i,r,a,b,m,f),C=vd(),i!==null&&!Et?(yd(i,r,f),ir(i,r,f)):(je&&C&&Fc(r),r.flags|=1,Dt(i,r,c,f),r.child)}function fv(i,r,a,c,f){if(i===null){var m=a.type;return typeof m=="function"&&!Xf(m)&&m.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=m,dv(i,r,m,c,f)):(i=Ic(a.type,null,c,r,r.mode,f),i.ref=r.ref,i.return=r,r.child=i)}if(m=i.child,!Vd(i,f)){var b=m.memoizedProps;if(a=a.compare,a=a!==null?a:za,a(b,c)&&i.ref===r.ref)return ir(i,r,f)}return r.flags|=1,i=Xn(m,c),i.ref=r.ref,i.return=r,r.child=i}function dv(i,r,a,c,f){if(i!==null){var m=i.memoizedProps;if(za(m,c)&&i.ref===r.ref)if(Et=!1,r.pendingProps=c=m,Vd(i,f))(i.flags&131072)!==0&&(Et=!0);else return r.lanes=i.lanes,ir(i,r,f)}return Bd(i,r,a,c,f)}function pv(i,r,a,c){var f=c.children,m=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|a:a,i!==null){for(c=r.child=i.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;c=f&~m}else c=0,r.child=null;return mv(i,r,m,a,c)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Yc(r,m!==null?m.cachePool:null),m!==null?_2(r,m):fd(),v2(r);else return c=r.lanes=536870912,mv(i,r,m!==null?m.baseLanes|a:a,a,c)}else m!==null?(Yc(r,m.cachePool),_2(r,m),Lr(),r.memoizedState=null):(i!==null&&Yc(r,null),fd(),Lr());return Dt(i,r,f,a),r.child}function Xa(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function mv(i,r,a,c,f){var m=ld();return m=m===null?null:{parent:xt._currentValue,pool:m},r.memoizedState={baseLanes:a,cachePool:m},i!==null&&Yc(r,null),fd(),v2(r),i!==null&&ws(i,r,c,!0),r.childLanes=f,null}function cu(i,r){return r=uu({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function gv(i,r,a){return Ms(r,i.child,null,a),i=cu(r,r.pendingProps),i.flags|=2,Ri(r),r.memoizedState=null,i}function Mx(i,r,a){var c=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(je){if(c.mode==="hidden")return i=cu(r,c),r.lanes=536870912,i.memoizedState={baseLanes:0,cachePool:null},Xa(null,i);if(pd(r),(i=at)?(i=U3(i,Xi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:xr!==null?{id:vn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},a=J_(i),a.return=r,r.child=a,jt=r,at=null)):i=null,i===null)throw Er(r);return r.lanes=536870912,null}return cu(r,c)}var m=i.memoizedState;if(m!==null){var b=m.dehydrated;if(pd(r),f)if(r.flags&256)r.flags&=-257,r=gv(i,r,a);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(s(558));else if(Et||ws(i,r,a,!1),f=(a&i.childLanes)!==0,Et||f){if(Or.current===null){if(c=rt,c!==null&&(b=i_(c,a),b!==0&&b!==m.retryLane))throw m.retryLane=b,vs(i,b),xi(c,i,b),zd;Au()}r=gv(i,r,a)}else i=m.treeContext,at=Qi(b.nextSibling),jt=r,je=!0,Cr=null,Xi=!1,i!==null&&i2(r,i),r=cu(r,c),r.flags|=134221824;return r}return i=Xn(i.child,{mode:c.mode,children:c.children}),i.ref=r.ref,r.child=i,i.return=r,i}function Ml(i,r){var a=r.ref;if(a===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(i===null||i.ref!==a)&&(r.flags|=4194816)}}function Bd(i,r,a,c,f){return xs(r),a=_d(i,r,a,c,void 0,f),c=vd(),i!==null&&!Et?(yd(i,r,f),ir(i,r,f)):(je&&c&&Fc(r),r.flags|=1,Dt(i,r,a,f),r.child)}function _v(i,r,a,c,f,m){return xs(r),r.updateQueue=null,a=S2(r,c,a,f),y2(i),c=vd(),i!==null&&!Et?(yd(i,r,m),ir(i,r,m)):(je&&c&&Fc(r),r.flags|=1,Dt(i,r,a,m),r.child)}function vv(i,r,a,c,f){if(xs(r),r.stateNode===null){var m=vl,b=a.contextType;typeof b=="object"&&b!==null&&(m=Gt(b)),m=new a(c,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Ld,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=c,m.state=r.memoizedState,m.refs={},od(r),b=a.contextType,m.context=typeof b=="object"&&b!==null?Gt(b):vl,m.state=r.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Rd(r,a,b,c),m.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Ld.enqueueReplaceState(m,m.state,null),$a(r,c,m,f),qa(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(i===null){m=r.stateNode;var C=r.memoizedProps,A=Ds(a,C);m.props=A;var j=m.context,G=a.contextType;b=vl,typeof G=="object"&&G!==null&&(b=Gt(G));var te=a.getDerivedStateFromProps;G=typeof te=="function"||typeof m.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,G||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C||j!==b)&&rv(r,m,c,b),Mr=!1;var z=r.memoizedState;m.state=z,$a(r,c,m,f),qa(),j=r.memoizedState,C||z!==j||Mr?(typeof te=="function"&&(Rd(r,a,te,c),j=r.memoizedState),(A=Mr||nv(r,a,A,c,z,j,b))?(G||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=j),m.props=c,m.state=j,m.context=b,c=A):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{m=r.stateNode,cd(i,r),b=r.memoizedProps,G=Ds(a,b),m.props=G,te=r.pendingProps,z=m.context,j=a.contextType,A=vl,typeof j=="object"&&j!==null&&(A=Gt(j)),C=a.getDerivedStateFromProps,(j=typeof C=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==te||z!==A)&&rv(r,m,c,A),Mr=!1,z=r.memoizedState,m.state=z,$a(r,c,m,f),qa();var Y=r.memoizedState;b!==te||z!==Y||Mr||i!==null&&i.dependencies!==null&&qc(i.dependencies)?(typeof C=="function"&&(Rd(r,a,C,c),Y=r.memoizedState),(G=Mr||nv(r,a,G,c,z,Y,A)||i!==null&&i.dependencies!==null&&qc(i.dependencies))?(j||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(c,Y,A),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(c,Y,A)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&z===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&z===i.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=Y),m.props=c,m.state=Y,m.context=A,c=G):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&z===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&z===i.memoizedState||(r.flags|=1024),c=!1)}return m=c,Ml(i,r),c=(r.flags&128)!==0,m||c?(m=r.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,i!==null&&c?(r.child=Ms(r,i.child,null,f),r.child=Ms(r,null,a,f)):Dt(i,r,a,f),r.memoizedState=m.state,i=r.child):i=ir(i,r,f),i}function yv(i,r,a,c){return Ss(),r.flags|=256,Dt(i,r,a,c),r.child}var jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(i){return{baseLanes:i,cachePool:o2()}}function Id(i,r,a){return i=i!==null?i.childLanes&~a:0,r&&(i|=zi),i}function Sv(i,r,a){var c=r.pendingProps,f=!1,m=(r.flags&128)!==0,b;if((b=m)||(b=i!==null&&i.memoizedState===null?!1:(Zt.current&2)!==0),b&&(f=!0,r.flags&=-129),b=(r.flags&32)!==0,r.flags&=-33,i===null){if(je){if(f?Rr(r):Lr(),(i=at)?(i=U3(i,Xi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:xr!==null?{id:vn,overflow:yn}:null,retryLane:536870912,hydrationErrors:null},a=J_(i),a.return=r,r.child=a,jt=r,at=null)):i=null,i===null)throw Er(r);return H1(i)?r.lanes=32:r.lanes=536870912,null}return m=c.children,c=c.fallback,f?(Lr(),f=r.mode,m=uu({mode:"hidden",children:m},f),c=ys(c,f,a,null),m.return=r,c.return=r,m.sibling=c,r.child=m,c=r.child,c.memoizedState=Hd(a),c.childLanes=Id(i,b,a),r.memoizedState=jd,Xa(null,c)):(Rr(r),Pd(r,m))}var C=i.memoizedState;if(C!==null){var A=C.dehydrated;if(A!==null)return Ax(i,r,m,b,c,A,C,a)}return f?(Lr(),f=c.fallback,m=r.mode,C=i.child,A=C.sibling,c=Xn(C,{mode:"hidden",children:c.children}),c.subtreeFlags=C.subtreeFlags&1206910976,A!==null?f=Xn(A,f):(f=ys(f,m,a,null),f.flags|=2),f.return=r,c.return=r,c.sibling=f,r.child=c,Xa(null,c),c=r.child,f=i.child.memoizedState,f===null?f=Hd(a):(m=f.cachePool,m!==null?(C=xt._currentValue,m=m.parent!==C?{parent:C,pool:C}:m):m=o2(),f={baseLanes:f.baseLanes|a,cachePool:m}),c.memoizedState=f,c.childLanes=Id(i,b,a),r.memoizedState=jd,Xa(i.child,c)):(Rr(r),a=i.child,i=a.sibling,a=Xn(a,{mode:"visible",children:c.children}),a.return=r,a.sibling=null,i!==null&&(b=r.deletions,b===null?(r.deletions=[i],r.flags|=16):b.push(i)),r.child=a,r.memoizedState=null,a)}function Pd(i,r){return r=uu({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function uu(i,r){return i=yi(22,i,null,r),i.lanes=0,i}function hu(i,r,a){return Ms(r,i.child,null,a),i=Pd(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Ax(i,r,a,c,f,m,b,C){if(a)return r.flags&256?(Rr(r),r.flags&=-257,hu(i,r,C)):r.memoizedState!==null?(Lr(),r.child=i.child,r.flags|=128,null):(Lr(),m=f.fallback,b=r.mode,f=uu({mode:"visible",children:f.children},b),m=ys(m,b,C,null),m.flags|=2,f.return=r,m.return=r,f.sibling=m,r.child=f,Ms(r,i.child,null,C),f=r.child,f.memoizedState=Hd(C),f.childLanes=Id(i,c,C),r.memoizedState=jd,Xa(null,f));if(Rr(r),H1(m)){if(c=m.nextSibling&&m.nextSibling.dataset,c)var A=c.dgst;return c=A,c!==""&&(f=Error(s(419)),f.stack="",f.digest=c,Ha({value:f,source:null,stack:null})),hu(i,r,C)}if(Et||ws(i,r,C,!1),c=(C&i.childLanes)!==0,Et||c){if(Or.current!==null)return hu(i,r,C);if(c=rt,c!==null&&(f=i_(c,C),f!==0&&f!==b.retryLane))throw b.retryLane=f,vs(i,f),xi(c,i,f),zd;return j1(m)||Au(),hu(i,r,C)}return j1(m)?(r.flags|=192,r.child=i.child,null):(i=b.treeContext,at=Qi(m.nextSibling),jt=r,je=!0,Cr=null,Xi=!1,i!==null&&i2(r,i),r=Pd(r,f.children),r.flags|=134221824,r)}function bv(i,r,a){i.lanes|=r;var c=i.alternate;c!==null&&(c.lanes|=r),Vc(i.return,r,a)}function wv(i){for(var r=null;i!==null;){var a=i.alternate;a!==null&&Qc(a)===null&&(r=i),i=i.sibling}return r}function fu(i,r,a,c,f,m){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:f,treeForkCount:m}:(b.isBackwards=r,b.rendering=null,b.renderingStartTime=0,b.last=c,b.tail=a,b.tailMode=f,b.treeForkCount=m)}function Fd(i){var r=i.child;for(i.child=null;r!==null;){var a=r.sibling;r.sibling=i.child,i.child=r,r=a}}function Ud(i,r,a){var c=r.pendingProps,f=c.revealOrder,m=c.tail;c=c.children;var b=Zt.current;if(r.flags&128)return Ya(r,b),null;var C=(b&2)!==0;if(C?(b=b&1|2,r.flags|=128):b&=1,Ya(r,b),f==="backwards"&&i!==null?(Fd(i),Dt(i,r,c,a),Fd(i)):Dt(i,r,c,a),c=je?ja:0,!C&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&bv(i,a,r);else if(i.tag===19)bv(i,a,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(f){case"backwards":a=wv(r.child),a===null?(f=r.child,r.child=null):(f=a.sibling,a.sibling=null,Fd(r)),fu(r,!0,f,null,m,c);break;case"unstable_legacy-backwards":for(a=null,f=r.child,r.child=null;f!==null;){if(i=f.alternate,i!==null&&Qc(i)===null){r.child=f;break}i=f.sibling,f.sibling=a,a=f,f=i}fu(r,!0,a,null,m,c);break;case"together":fu(r,!1,null,null,void 0,c);break;case"independent":r.memoizedState=null;break;default:a=wv(r.child),a===null?(f=r.child,r.child=null):(f=a.sibling,a.sibling=null),fu(r,!1,f,a,m,c)}return r.child}function xv(i,r,a){var c=r.pendingProps;return kr(r,r.type,c.value),Dt(i,r,c.children,a),r.child}function ir(i,r,a){if(i!==null&&(r.dependencies=i.dependencies),jr|=r.lanes,(a&r.childLanes)===0)if(i!==null){if(ws(i,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,a=Xn(i,i.pendingProps),r.child=a,a.return=r;i.sibling!==null;)i=i.sibling,a=a.sibling=Xn(i,i.pendingProps),a.return=r;a.sibling=null}return r.child}function Vd(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&qc(i)))}function Dx(i,r,a){switch(r.tag){case 3:rl(r,r.stateNode.containerInfo),kr(r,xt,i.memoizedState.cache),Ss();break;case 27:case 5:wa(r);break;case 4:rl(r,r.stateNode.containerInfo);break;case 10:kr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,pd(r),null;break;case 13:var c=r.memoizedState;if(c!==null){if(c.dehydrated!==null)return Rr(r),r.flags|=128,null;c=ws(i,r,a,!1);var f=r.child.childLanes;return c||(a&f)!==0?Sv(i,r,a):(Rr(r),i=ir(i,r,a),i!==null?i.sibling:null)}Rr(r);break;case 19:if(r.flags&128)return Ud(i,r,a);if(f=(i.flags&128)!==0,c=(a&r.childLanes)!==0,c||(ws(i,r,a,!1),c=(a&r.childLanes)!==0),f){if(c)return Ud(i,r,a);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ya(r,Zt.current),c)break;return null;case 22:return r.lanes=0,pv(i,r,a,r.pendingProps);case 24:kr(r,xt,i.memoizedState.cache)}return ir(i,r,a)}function Cv(i,r,a){if(i!==null)if(i.memoizedProps!==r.pendingProps)Et=!0;else{if(!Vd(i,a)&&(r.flags&128)===0)return Et=!1,Dx(i,r,a);Et=(i.flags&131072)!==0}else Et=!1,je&&(r.flags&1048576)!==0&&t2(r,ja,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(i=ks(r.elementType),r.type=i,typeof i=="function")Xf(i)?(c=Ds(i,c),r.tag=1,r=vv(null,r,i,c,a)):(r.tag=0,r=Bd(null,r,i,c,a));else{if(i!=null){var f=i.$$typeof;if(f===H){r.tag=11,r=hv(null,r,i,c,a);break e}else if(f===oe){r.tag=14,r=fv(null,r,i,c,a);break e}else if(f===F){r.tag=10,r.type=i,r=xv(null,r,a);break e}}throw r=ve(i)||i,Error(s(306,r,""))}}return r;case 0:return Bd(i,r,r.type,r.pendingProps,a);case 1:return c=r.type,f=Ds(c,r.pendingProps),vv(i,r,c,f,a);case 3:e:{if(rl(r,r.stateNode.containerInfo),i===null)throw Error(s(387));c=r.pendingProps;var m=r.memoizedState;f=m.element,cd(i,r),$a(r,c,null,a);var b=r.memoizedState;if(c=b.cache,kr(r,xt,c),c!==m.cache&&nd(r,[xt],a,!0),qa(),c=b.element,m.isDehydrated)if(m={element:c,isDehydrated:!1,cache:b.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=yv(i,r,c,a);break e}else if(c!==f){f=Ki(Error(s(424)),r),Ha(f),r=yv(i,r,c,a);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,at=Qi(i.firstChild),jt=r,je=!0,Cr=null,Xi=!0,a=p2(r,null,c,a),r.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(Ss(),c===f){r=ir(i,r,a);break e}Dt(i,r,c,a)}r=r.child}return r;case 26:return Ml(i,r),i===null?(a=G3(r.type,null,r.pendingProps,null))?r.memoizedState=a:je||(r.stateNode=M3(r.type,r.pendingProps,an.current,r)):r.memoizedState=G3(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return wa(r),i===null&&je&&(c=r.stateNode=$3(r.type,r.pendingProps,an.current),jt=r,Xi=!0,f=at,Fr(r.type)?(I1=f,at=Qi(c.firstChild)):at=f),Dt(i,r,r.pendingProps.children,a),Ml(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&je&&((f=c=at)&&(c=C9(c,r.type,r.pendingProps,Xi),c!==null?(r.stateNode=c,jt=r,at=Qi(c.firstChild),Xi=!1,f=!0):f=!1),f||Er(r)),wa(r),f=r.type,m=r.pendingProps,b=i!==null?i.memoizedProps:null,c=m.children,D1(f,m)?c=null:b!==null&&D1(f,b)&&(r.flags|=32),r.memoizedState!==null&&(f=_d(i,r,yx,null,null,a),Yl._currentValue=f),Ml(i,r),Dt(i,r,c,a),r.child;case 6:return i===null&&je&&((i=a=at)&&(a=E9(a,r.pendingProps,Xi),a!==null?(r.stateNode=a,jt=r,at=null,i=!0):i=!1),i||Er(r)),null;case 13:return Sv(i,r,a);case 4:return rl(r,r.stateNode.containerInfo),c=r.pendingProps,i===null?r.child=Ms(r,null,c,a):Dt(i,r,c,a),r.child;case 11:return hv(i,r,r.type,r.pendingProps,a);case 7:return c=r.pendingProps,Ml(i,r),Dt(i,r,c,a),r.child;case 8:return Dt(i,r,r.pendingProps.children,a),r.child;case 12:return Dt(i,r,r.pendingProps.children,a),r.child;case 10:return xv(i,r,a);case 9:return f=r.type._context,c=r.pendingProps.children,xs(r),f=Gt(f),c=c(f),r.flags|=1,Dt(i,r,c,a),r.child;case 14:return fv(i,r,r.type,r.pendingProps,a);case 15:return dv(i,r,r.type,r.pendingProps,a);case 19:return Ud(i,r,a);case 31:return Mx(i,r,a);case 22:return pv(i,r,a,r.pendingProps);case 24:return xs(r),c=Gt(xt),i===null?(f=ld(),f===null&&(f=rt,m=rd(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),r.memoizedState={parent:c,cache:f},od(r),kr(r,xt,f)):((i.lanes&a)!==0&&(cd(i,r),$a(r,null,null,a),qa()),f=i.memoizedState,m=r.memoizedState,f.parent!==c?(f={parent:c,cache:c},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),kr(r,xt,c)):(c=m.cache,kr(r,xt,c),c!==f.cache&&nd(r,[xt],a,!0))),Dt(i,r,r.pendingProps.children,a),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),c=r.pendingProps,c.name!=null&&c.name!=="auto"?r.flags|=i===null?18882560:18874368:je&&Fc(r),i!==null&&i.memoizedProps.name!==c.name?r.flags|=4194816:Ml(i,r),Dt(i,r,c.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function nr(i){i.flags|=4}function qd(i,r,a,c,f){var m;if((m=(i.mode&32)!==0)&&(m=a===null?J3(r,c):J3(r,c)&&(c.src!==a.src||c.srcSet!==a.srcSet)),m){if(i.flags|=16777216,(f&335544128)===f)if(i.stateNode.complete)i.flags|=8192;else if(s3())i.flags|=8192;else throw Ts=Wc,ad}else i.flags&=-16777217}function Ev(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ey(r))if(s3())i.flags|=8192;else throw Ts=Wc,ad}function du(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Jg():536870912,i.lanes|=r,Ll|=r)}function Za(i,r){if(!je)switch(i.tailMode){case"visible":break;case"collapsed":for(var a=i.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null;break;default:for(r=i.tail,a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?i.tail=null:a.sibling=null}}function ot(i){var r=i.alternate!==null&&i.alternate.child===i.child,a=0,c=0;if(r)for(var f=i.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags&1206910976,c|=f.flags&1206910976,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)a|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=c,i.childLanes=a,r}function Ox(i,r,a){var c=r.pendingProps;switch(Jf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(r),null;case 1:return ot(r),null;case 3:return a=r.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Jn(xt),yr(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(bl(r)?nr(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,td())),ot(r),null;case 26:var f=r.type,m=r.memoizedState;return i===null?(nr(r),m!==null?(ot(r),Ev(r,m)):(ot(r),qd(r,f,null,c,a))):m?m!==i.memoizedState?(nr(r),ot(r),Ev(r,m)):(ot(r),r.flags&=-16777217):(i=i.memoizedProps,i!==c&&nr(r),ot(r),qd(r,f,i,c,a)),null;case 27:if(sl(r),a=an.current,f=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==c&&nr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return ot(r),r.subtreeFlags&=-33554433,null}i=Vi.current,bl(r)?n2(r):(i=$3(f,c,a),r.stateNode=i,nr(r))}return ot(r),r.subtreeFlags&=-33554433,null;case 5:if(sl(r),f=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==c&&nr(r);else{if(!c){if(r.stateNode===null)throw Error(s(166));return ot(r),r.subtreeFlags&=-33554433,null}if(m=Vi.current,bl(r))n2(r);else{var b=oo(an.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof c.is=="string"?b.createElement("select",{is:c.is}):b.createElement("select"),c.multiple?m.multiple=!0:c.size&&(m.size=c.size);break;default:m=typeof c.is=="string"?b.createElement(f,{is:c.is}):b.createElement(f)}}m[Wt]=r,m[vi]=c;e:for(b=r.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===r)break e;for(;b.sibling===null;){if(b.return===null||b.return===r)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}r.stateNode=m;e:switch(Jt(m,f,c),f){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&nr(r)}}return ot(r),r.subtreeFlags&=-33554433,qd(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,a),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==c&&nr(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(s(166));if(i=an.current,bl(r)){if(i=r.stateNode,a=r.memoizedProps,c=null,f=jt,f!==null)switch(f.tag){case 27:case 5:c=f.memoizedProps}i[Wt]=r,i=!!(i.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||C3(i.nodeValue,a)),i||Er(r,!0)}else i=oo(i).createTextNode(c),i[Wt]=r,r.stateNode=i}return ot(r),null;case 31:if(a=r.memoizedState,i===null||i.memoizedState!==null){if(c=bl(r),a!==null){if(i===null){if(!c)throw Error(s(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(557));i[Wt]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),i=!1}else a=td(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return r.flags&256?(Ri(r),r):(Ri(r),null);if((r.flags&128)!==0)throw Error(s(558))}return ot(r),null;case 13:if(c=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=bl(r),c!==null&&c.dehydrated!==null){if(i===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[Wt]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ot(r),f=!1}else f=td(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Ri(r),r):(Ri(r),null)}return Ri(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,i=i!==null&&i.memoizedState!==null,a&&(c=r.child,f=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(f=c.alternate.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==f&&(c.flags|=2048)),a!==i&&a&&(r.child.flags|=8192),du(r,r.updateQueue),ot(r),null);case 4:return yr(),i===null&&E1(r.stateNode.containerInfo),r.flags|=67108864,ot(r),null;case 10:return Jn(r.type),ot(r),null;case 19:if(md(r),c=r.memoizedState,c===null)return ot(r),null;if(f=(r.flags&128)!==0,m=c.rendering,m===null)if(f)Za(c,!1);else{if(gt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(m=Qc(i),m!==null){for(r.flags|=128,Za(c,!1),i=m.updateQueue,r.updateQueue=i,du(r,i),r.subtreeFlags=0,i=a,a=r.child;a!==null;)Q_(a,i),a=a.sibling;return Ya(r,Zt.current&1|2),je&&Zn(r,c.treeForkCount),r.child}i=i.sibling}c.tail!==null&&Kt()>Eu&&(r.flags|=128,f=!0,Za(c,!1),r.lanes=4194304)}else{if(!f)if(i=Qc(m),i!==null){if(r.flags|=128,f=!0,i=i.updateQueue,r.updateQueue=i,du(r,i),Za(c,!0),c.tail===null&&c.tailMode!=="collapsed"&&c.tailMode!=="visible"&&!m.alternate&&!je)return ot(r),null}else 2*Kt()-c.renderingStartTime>Eu&&a!==536870912&&(r.flags|=128,f=!0,Za(c,!1),r.lanes=4194304);c.isBackwards?(m.sibling=r.child,r.child=m):(i=c.last,i!==null?i.sibling=m:r.child=m,c.last=m)}if(c.tail!==null){i=c.tail;e:{for(a=i;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Kt(),i.sibling=null,m=Zt.current,m=f?m&1|2:m&1,c.tailMode==="visible"||c.tailMode==="collapsed"||!a||je?Ya(r,m):(a=m,Ze(Xt,r),Ze(Zt,a),si===null&&(si=r)),je&&Zn(r,c.treeForkCount),i}return ot(r),null;case 22:case 23:return Ri(r),dd(),c=r.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(ot(r),r.subtreeFlags&6&&(r.flags|=8192)):ot(r),a=r.updateQueue,a!==null&&du(r,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),i!==null&&wt(Es),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Jn(xt),ot(r),null;case 25:return null;case 30:return r.flags|=33554432,ot(r),null}throw Error(s(156,r.tag))}function Rx(i,r){switch(Jf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Jn(xt),yr(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return sl(r),null;case 31:if(r.memoizedState!==null){if(Ri(r),r.alternate===null)throw Error(s(340));Ss()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Ri(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ss()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return md(r),i=r.flags,i&65536?(r.flags=i&-65537|128,i=r.memoizedState,i!==null&&(i.rendering=null,i.tail=null),r.flags|=4,r):null;case 4:return yr(),null;case 10:return Jn(r.type),null;case 22:case 23:return Ri(r),dd(),i!==null&&wt(Es),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Jn(xt),null;case 25:return null;default:return null}}function kv(i,r){switch(Jf(r),r.tag){case 3:Jn(xt),yr();break;case 26:case 27:case 5:sl(r);break;case 4:yr();break;case 31:r.memoizedState!==null&&Ri(r);break;case 13:Ri(r);break;case 19:md(r);break;case 10:Jn(r.type);break;case 22:case 23:Ri(r),dd(),i!==null&&wt(Es);break;case 24:Jn(xt)}}function Qa(i,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var f=c.next;a=f;do{if((a.tag&i)===i){c=void 0;var m=a.create,b=a.inst;c=m(),b.destroy=c}a=a.next}while(a!==f)}}catch(C){Je(r,r.return,C)}}function Nr(i,r,a){try{var c=r.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var m=f.next;c=m;do{if((c.tag&i)===i){var b=c.inst,C=b.destroy;if(C!==void 0){b.destroy=void 0,f=r;var A=a,j=C;try{j()}catch(G){Je(f,A,G)}}}c=c.next}while(c!==m)}}catch(G){Je(r,r.return,G)}}function Tv(i){var r=i.updateQueue;if(r!==null){var a=i.stateNode;try{g2(r,a)}catch(c){Je(i,i.return,c)}}}function Mv(i,r,a){a.props=Ds(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(c){Je(i,r,c)}}function Sn(i,r){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:var f=i.stateNode,m=Wn(i.memoizedProps,f);(f.ref===null||f.ref.name!==m)&&(f.ref=z3(m)),c=f.ref;break;case 7:if(i.stateNode===null){var b=new ji(i);g(i.child,!1,w9,b,void 0,void 0),i.stateNode=b}c=i.stateNode;break;default:c=i.stateNode}typeof a=="function"?i.refCleanup=a(c):a.current=c}}catch(C){Je(i,r,C)}}function Qt(i,r){var a=i.ref,c=i.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(f){Je(i,r,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Je(i,r,f)}else a.current=null}function pu(i,r){if((i.tag===5||i.tag===27||i.tag===6)&&i.alternate===null&&r!==null)for(var a=0;a<r.length;a++)F3(i.stateNode,r[a])}function Av(i){for(var r=i.return;r!==null&&(Yd(r)&&F3(i.stateNode,r.stateNode),!$d(r));)r=r.return}function Ja(i){for(var r=i.return;r!==null&&(Yd(r)&&x9(i.stateNode,r.stateNode),!$d(r));)r=r.return}function $d(i){return i.tag===5||i.tag===3||i.tag===27}function Yd(i){return i&&i.tag===7&&i.stateNode!==null}function Kd(i){var r=i.type,a=i.memoizedProps,c=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(f){Je(i,i.return,f)}}function Wd(i,r,a){try{var c=i.stateNode;r9(c,i.type,a,r),c[vi]=r}catch(f){Je(i,i.return,f)}}function Dv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Fr(i.type)||i.tag===4}function Gd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Dv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Fr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Xd(i,r,a,c){var f=i.tag;if(f===5||f===6)f=i.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(f,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(f),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=_n)),pu(i,c),Ye=!0;else if(f!==4&&(f===27&&(pu(i,c),c=null,Fr(i.type)&&(a=i.stateNode,r=null)),i=i.child,i!==null))for(Xd(i,r,a,c),i=i.sibling;i!==null;)Xd(i,r,a,c),i=i.sibling}function mu(i,r,a,c){var f=i.tag;if(f===5||f===6)f=i.stateNode,r?a.insertBefore(f,r):a.appendChild(f),pu(i,c),Ye=!0;else if(f!==4&&(f===27&&(pu(i,c),c=null,Fr(i.type)&&(a=i.stateNode)),i=i.child,i!==null))for(mu(i,r,a,c),i=i.sibling;i!==null;)mu(i,r,a,c),i=i.sibling}function Ov(i){var r=i.stateNode,a=i.memoizedProps;try{for(var c=i.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);Jt(r,c,a),r[Wt]=i,r[vi]=a}catch(m){Je(i,i.return,m)}}var gu=!1,Li=null;function Rv(i){(i.tag===30||(i.subtreeFlags&33554432)!==0)&&(gu=!0)}var bn=null;function Lv(){var i=bn;return bn=null,i}var Si=0;function Al(i,r,a,c,f){return Si=0,Nv(i.child,r,a,c,f)}function Nv(i,r,a,c,f){for(var m=!1;i!==null;){if(i.tag===5){var b=i.stateNode;if(c!==null){var C=L1(b);c.push(C),C.view&&(m=!0)}else m||L1(b).view&&(m=!0);gu=!0,L3(b,Si===0?r:r+"_"+Si,a),Si++}else(i.tag!==22||i.memoizedState===null)&&(i.tag===30&&f||Nv(i.child,r,a,c,f)&&(m=!0));i=i.sibling}return m}function wn(i,r){for(;i!==null;)i.tag===5?N3(i.stateNode,i.memoizedProps):(i.tag!==22||i.memoizedState===null)&&(i.tag===30&&r||wn(i.child,r)),i=i.sibling}function _u(i){if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if((i.tag!==22||i.memoizedState===null)&&(_u(i),i.tag===30&&(i.flags&18874368)!==0&&i.stateNode.paired)){var r=i.memoizedProps;if(r.name==null||r.name==="auto")throw Error(s(544));var a=r.name;r=Gn(r.default,r.share),r!=="none"&&(Al(i,a,r,null,!1)||wn(i.child,!1))}i=i.sibling}}function Zd(i,r){if(i.tag===30){var a=i.stateNode,c=i.memoizedProps,f=Wn(c,a),m=Gn(c.default,a.paired?c.share:c.enter);m!=="none"?Al(i,f,m,null,!1)?(_u(i),a.paired||r||jl(i,c.onEnter)):wn(i.child,!1):_u(i)}else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)Zd(i,r),i=i.sibling;else _u(i)}function Qd(i){if(Li!==null&&Li.size!==0){var r=Li;if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if(i.tag!==22||i.memoizedState===null){if(i.tag===30&&(i.flags&18874368)!==0){var a=i.memoizedProps,c=a.name;if(c!=null&&c!=="auto"){var f=r.get(c);if(f!==void 0){var m=Gn(a.default,a.share);if(m!=="none"&&(Al(i,c,m,null,!1)?(m=i.stateNode,f.paired=m,m.paired=f,jl(i,a.onShare)):wn(i.child,!1)),r.delete(c),r.size===0)break}}}Qd(i)}i=i.sibling}}}function Jd(i){if(i.tag===30){var r=i.memoizedProps,a=Wn(r,i.stateNode),c=Li!==null?Li.get(a):void 0,f=Gn(r.default,c!==void 0?r.share:r.exit);f!=="none"&&(Al(i,a,f,null,!1)?c!==void 0?(f=i.stateNode,c.paired=f,f.paired=c,Li.delete(a),jl(i,r.onShare)):jl(i,r.onExit):wn(i.child,!1)),Li!==null&&Qd(i)}else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)Jd(i),i=i.sibling;else Li!==null&&Qd(i)}function zv(i){for(i=i.child;i!==null;){if(i.tag===30){var r=i.memoizedProps,a=Wn(r,i.stateNode);r=Gn(r.default,r.update),i.flags&=-5,r!=="none"&&Al(i,a,r,i.memoizedState=[],!1)}else(i.subtreeFlags&33554432)!==0&&zv(i);i=i.sibling}}function e1(i){if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if(i.tag!==22||i.memoizedState===null){if(i.tag===30&&(i.flags&18874368)!==0){var r=i.stateNode;r.paired!==null&&(r.paired=null,wn(i.child,!1))}e1(i)}i=i.sibling}}function vu(i){if(i.tag===30)i.stateNode.paired=null,wn(i.child,!1),e1(i);else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)vu(i),i=i.sibling;else e1(i)}function Bv(i){for(i=i.child;i!==null;)i.tag===30?wn(i.child,!1):(i.subtreeFlags&33554432)!==0&&Bv(i),i=i.sibling}function t1(i,r,a,c,f,m,b){for(var C=!1;r!==null;){if(r.tag===5){var A=r.stateNode;if(m!==null&&Si<m.length){var j=m[Si],G=L1(A);(j.view||G.view)&&(C=!0);var te;if(te=(i.flags&4)===0)if(G.clip)te=!0;else{te=j.rect;var z=G.rect;te=te.y!==z.y||te.x!==z.x||te.height!==z.height||te.width!==z.width}te&&(i.flags|=4),G.abs?G=!j.abs:(j=j.rect,G=G.rect,G=j.height!==G.height||j.width!==G.width),G&&(i.flags|=32)}else i.flags|=32;(i.flags&4)!==0&&L3(A,Si===0?a:a+"_"+Si,f),C&&(i.flags&4)!==0||(bn===null&&(bn=[]),bn.push(A,Si===0?c:c+"_"+Si,r.memoizedProps)),Si++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&b?i.flags|=r.flags&32:t1(i,r.child,a,c,f,m,b)&&(C=!0));r=r.sibling}return C}function jv(i,r){for(i=i.child;i!==null;){if(i.tag===30){var a=i.memoizedProps,c=i.stateNode,f=Wn(a,c),m=Gn(a.default,a.update),b;b=i.memoizedState,i.memoizedState=null,c=i;var C=i.child;Si=0,f=t1(c,C,f,f,m,b,!1),(i.flags&4)!==0&&f&&jl(i,a.onUpdate)}else(i.subtreeFlags&33554432)!==0&&jv(i);i=i.sibling}}var Ht=!1,Xe=!1,xn=!1,i1=!1,Hv=typeof WeakSet=="function"?WeakSet:Set,It=null,Cn=!1,eo=!1,yu=!1,n1=!1;function Lx(i,r,a){if(i=i.containerInfo,M1=Kl,i=U_(i),Vf(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var m=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var C=0,A=-1,j=-1,G=0,te=0,z=i,Y=null;t:for(;;){for(var he;z!==c||m!==0&&z.nodeType!==3||(A=C+m),z!==b||f!==0&&z.nodeType!==3||(j=C+f),z.nodeType===3&&(C+=z.nodeValue.length),(he=z.firstChild)!==null;)Y=z,z=he;for(;;){if(z===i)break t;if(Y===c&&++G===m&&(A=C),Y===b&&++te===f&&(j=C),(he=z.nextSibling)!==null)break;z=Y,Y=z.parentNode}z=he}c=A===-1||j===-1?null:{start:A,end:j}}else c=null}c=c||{start:0,end:0}}else c=null;for(A1={focusedElem:i,selectionRange:c},Kl=!1,a=(a&335544064)===a,It=r,r=a?9270:1024;It!==null;){if(i=It,a&&(c=i.deletions,c!==null))for(m=0;m<c.length;m++)a&&Jd(c[m]);if(i.alternate===null&&(i.flags&2)!==0)a&&Rv(i),Su(a);else{if(i.tag===22){if(c=i.alternate,i.memoizedState!==null){c!==null&&c.memoizedState===null&&a&&Jd(c),Su(a);continue}else if(c!==null&&c.memoizedState!==null){a&&Rv(i),Su(a);continue}}c=i.child,(i.subtreeFlags&r)!==0&&c!==null?(c.return=i,It=c):(a&&zv(i),Su(a))}}Li=null}function Su(i){for(;It!==null;){var r=It,a=i,c=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&c!==null){a=void 0,f=c.memoizedProps,c=c.memoizedState;var m=r.stateNode;try{var b=Ds(r.type,f);a=m.getSnapshotBeforeUpdate(b,c),m.__reactInternalSnapshotBeforeUpdate=a}catch(C){Je(r,r.return,C)}}break;case 3:if((f&1024)!==0){if(c=r.stateNode.containerInfo,a=c.nodeType,a===9)B1(c);else if(a===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":B1(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&c!==null&&(a=Wn(c.memoizedProps,c.stateNode),f=r.memoizedProps,f=Gn(f.default,f.update),f!=="none"&&Al(c,a,f,c.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(s(163))}if(c=r.sibling,c!==null){c.return=r.return,It=c;break}It=r.return}}function Iv(i,r,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:En(i,a),c&4&&Qa(5,a);break;case 1:if(En(i,a),c&4)if(i=a.stateNode,r===null)try{i.componentDidMount()}catch(b){Je(a,a.return,b)}else{var f=Ds(a.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(f,r,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Je(a,a.return,b)}}c&64&&Tv(a),c&512&&Sn(a,a.return);break;case 3:if(En(i,a),c&64&&(i=a.updateQueue,i!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{g2(i,r)}catch(b){Je(a,a.return,b)}}break;case 27:r===null&&c&4&&Ov(a);case 26:case 5:En(i,a),r===null&&c&4&&Kd(a),c&512&&Sn(a,a.return);break;case 12:En(i,a);break;case 31:En(i,a),c&4&&Vv(i,a);break;case 13:En(i,a),c&4&&qv(i,a),c&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=$x.bind(null,a),k9(i,a))));break;case 22:if(c=a.memoizedState!==null||Ht,!c){var m=r!==null&&r.memoizedState!==null||Xe;r=Ht,f=Xe,Ht=c,(Xe=m)&&!f?(c=2,(a.subtreeFlags&8772)!==0&&(c|=1),hn(i,a,c)):En(i,a),Ht=r,Xe=f}break;case 30:En(i,a),c&512&&Sn(a,a.return);break;case 7:c&512&&Sn(a,a.return);default:En(i,a)}}function r1(i,r){for(i=i.child;i!==null;)Pv(i,r),i=i.sibling}function Pv(i,r){switch(i.tag){case 5:case 26:try{var a=i.stateNode;if(r){var c=a.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}else{var f=i.stateNode,m=i.memoizedProps.style,b=m!=null&&m.hasOwnProperty("display")?m.display:null;f.style.display=b==null||typeof b=="boolean"?"":(""+b).trim()}}catch(A){Je(i,i.return,A)}s1(i,r);break;case 6:try{i.stateNode.nodeValue=r?"":i.memoizedProps,Ye=!0}catch(A){Je(i,i.return,A)}break;case 18:try{var C=i.stateNode;r?R3(C,!0):R3(i.stateNode,!1)}catch(A){Je(i,i.return,A)}break;case 22:case 23:i.memoizedState===null&&r1(i,r);break;default:r1(i,r)}}function s1(i,r){if(i.subtreeFlags&67108864)for(i=i.child;i!==null;){e:{var a=i,c=r;switch(a.tag){case 4:Pv(a,c);break e;case 22:a.memoizedState===null&&s1(a,c);break e;default:s1(a,c)}}i=i.sibling}}function Fv(i){var r=i.alternate;r!==null&&(i.alternate=null,Fv(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Ec(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ut=null,bi=!1;function cn(i,r,a){for(a=a.child;a!==null;)Uv(i,r,a),a=a.sibling}function Uv(i,r,a){if(Mi&&typeof Mi.onCommitFiberUnmount=="function")try{Mi.onCommitFiberUnmount(xa,a)}catch{}switch(a.tag){case 26:Xe||Qt(a,r),cn(i,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Xe&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Xe||Qt(a,r),Ja(a);var c=ut,f=bi;Fr(a.type)&&(ut=a.stateNode,bi=!1),cn(i,r,a),Y3(a.stateNode,a.type,a.memoizedProps),ut=c,bi=f;break;case 5:Xe||Qt(a,r),Ja(a);case 6:if(a.tag===6&&Ja(a),c=ut,f=bi,ut=null,cn(i,r,a),ut=c,bi=f,ut!==null)if(bi)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(a.stateNode),Ye=!0}catch(m){Je(a,r,m)}else try{ut.removeChild(a.stateNode),Ye=!0}catch(m){Je(a,r,m)}break;case 18:ut!==null&&(bi?(i=ut,O3(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),Wl(i)):O3(ut,a.stateNode));break;case 4:c=ut,f=bi,ut=a.stateNode.containerInfo,bi=!0,cn(i,r,a),ut=c,bi=f;break;case 0:case 11:case 14:case 15:Nr(2,a,r),Xe||Nr(4,a,r),cn(i,r,a);break;case 1:Xe||(Qt(a,r),c=a.stateNode,typeof c.componentWillUnmount=="function"&&Mv(a,r,c)),cn(i,r,a);break;case 21:cn(i,r,a);break;case 22:Xe=(c=Xe)||a.memoizedState!==null,cn(i,r,a),Xe=c;break;case 30:Qt(a,r),cn(i,r,a);break;case 7:Xe||Qt(a,r),cn(i,r,a);break;default:cn(i,r,a)}}function Vv(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Wl(i)}catch(a){Je(r,r.return,a)}}}function qv(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Wl(i)}catch(a){Je(r,r.return,a)}}function Nx(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new Hv),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new Hv),r;default:throw Error(s(435,i.tag))}}function bu(i,r){var a=Nx(i);r.forEach(function(c){if(!a.has(c)){a.add(c);var f=Yx.bind(null,i,c);c.then(f,f)}})}function hi(i,r,a){var c=r.deletions;if(c!==null)for(var f=0;f<c.length;f++){var m=c[f],b=i,C=r,A=C;e:for(;A!==null;){switch(A.tag){case 27:if(Fr(A.type)){ut=A.stateNode,bi=!1;break e}break;case 5:ut=A.stateNode,bi=!1;break e;case 3:case 4:ut=A.stateNode.containerInfo,bi=!0;break e}A=A.return}if(ut===null)throw Error(s(160));Uv(b,C,m),ut=null,bi=!1,b=m.alternate,b!==null&&(b.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)$v(r,i,a),r=r.sibling}var un=null;function $v(i,r,a){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(f&4&&(c=i.updateQueue,c=c!==null?c.events:null,c!==null))for(var m=0;m<c.length;m++){var b=c[m];b.ref.impl=b.nextImpl}hi(r,i,a),fi(i),f&4&&(Nr(3,i,i.return),Qa(3,i),Nr(5,i,i.return));break;case 1:hi(r,i,a),fi(i),f&512&&(Xe||c===null||Qt(c,c.return)),f&64&&Ht&&(i=i.updateQueue,i!==null&&(r=i.callbacks,r!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:if(m=un,hi(r,i,a),fi(i),f&512&&(Xe||c===null||Qt(c,c.return)),f&4)if(f=c!==null?c.memoizedState:null,a=i.memoizedState,c===null)if(a===null)if(i.stateNode===null)if(Ht)i.stateNode=M3(i.type,i.memoizedProps,r.containerInfo,i);else{e:{r=i.type,a=i.memoizedProps,f=m.ownerDocument||m;t:switch(r){case"title":c=f.getElementsByTagName("title")[0],(!c||c[ka]||c[Wt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=f.createElement(r),f.head.insertBefore(c,f.querySelector("head > title"))),Jt(c,r,a),c[Wt]=i,Bt(c),r=c;break e;case"link":if(m=Q3("link","href",f).get(r+(a.href||""))){for(b=0;b<m.length;b++)if(c=m[b],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){m.splice(b,1);break t}}c=f.createElement(r),Jt(c,r,a),f.head.appendChild(c);break;case"meta":if(m=Q3("meta","content",f).get(r+(a.content||""))){for(b=0;b<m.length;b++)if(c=m[b],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){m.splice(b,1);break t}}c=f.createElement(r),Jt(c,r,a),f.head.appendChild(c);break;default:throw Error(s(468,r))}c[Wt]=i,Bt(c),r=c}i.stateNode=r}else Ht||V1(m,i.type,i.stateNode);else i.stateNode=Z3(m,a,i.memoizedProps);else f!==a?(f===null?(r=c.stateNode,r===null||Xe||r.parentNode.removeChild(r)):f.count--,a===null?Ht||V1(m,i.type,i.stateNode):Z3(m,a,i.memoizedProps)):a===null&&i.stateNode!==null&&Wd(i,i.memoizedProps,c.memoizedProps);break;case 27:hi(r,i,a),fi(i),f&512&&(Xe||c===null||Qt(c,c.return)),c!==null&&f&4&&Wd(i,i.memoizedProps,c.memoizedProps);break;case 5:if(m=xn,xn=!1,hi(r,i,a),xn=m,fi(i),f&512&&(Xe||c===null||Qt(c,c.return)),i.flags&32){r=i.stateNode;try{hl(r,""),Ye=!0}catch(G){Je(i,i.return,G)}}f&4&&i.stateNode!=null&&(r=i.memoizedProps,Wd(i,r,c!==null?c.memoizedProps:r)),f&1024&&(i1=!0);break;case 6:if(hi(r,i,a),fi(i),f&4){if(i.stateNode===null)throw Error(s(162));r=i.memoizedProps,a=i.stateNode;try{a.nodeValue=r,Ye=!0}catch(G){Je(i,i.return,G)}}break;case 3:if(Ye=!1,Bu=null,m=un,un=co(r.containerInfo),hi(r,i,a),un=m,fi(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Wl(r.containerInfo)}catch(G){Je(i,i.return,G)}i1&&(i1=!1,Yv(i)),Ye=!1;break;case 4:f=xn,xn=Ht,c=f_(),m=un,un=co(i.stateNode.containerInfo),hi(r,i,a),fi(i),un=m,Ye&&eo&&(yu=!0),Ye=c,xn=f;break;case 12:hi(r,i,a),fi(i);break;case 31:hi(r,i,a),fi(i),f&4&&(r=i.updateQueue,r!==null&&(i.updateQueue=null,bu(i,r)));break;case 13:hi(r,i,a),fi(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Cu=Kt()),f&4&&(r=i.updateQueue,r!==null&&(i.updateQueue=null,bu(i,r)));break;case 22:m=i.memoizedState!==null,b=c!==null&&c.memoizedState!==null;var C=Ht,A=Xe,j=xn;Ht=C||m,xn=j||m,Xe=A||b,hi(r,i,a),Xe=A,xn=j,Ht=C,fi(i),f&8192&&(r=i.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,!m||c===null||b||Ht||Xe||(r=b||Xe,a=Ht,c=Xe,Ht=m||Ht,Xe=r,zr(i,2),Ht=a,Xe=c),!m&&xn||r1(i,m)),f&4&&(r=i.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,bu(i,a))));break;case 19:hi(r,i,a),fi(i),f&4&&(r=i.updateQueue,r!==null&&(i.updateQueue=null,bu(i,r)));break;case 30:f&512&&(Xe||c===null||Qt(c,c.return)),f=f_(),m=eo,b=(a&335544064)===a,C=i.memoizedProps,eo=b&&Gn(C.default,C.update)!=="none",hi(r,i,a),fi(i),b&&c!==null&&Ye&&(i.flags|=4),eo=m,Ye=f;break;case 21:break;case 7:f&512&&(Xe||c===null||Qt(c,c.return)),c&&c.stateNode!==null&&(c.stateNode._fragmentFiber=i);default:hi(r,i,a),fi(i)}}function fi(i){var r=i.flags;if(r&2){try{for(var a,c=i.return;c!==null;){if(Dv(c)){a=c;break}c=c.return}c=null;for(var f=i.return;f!==null;){if(Yd(f)){var m=f.stateNode;c===null?c=[m]:c.push(m)}if($d(f))break;f=f.return}var b=c;if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,A=Gd(i);mu(i,A,C,b);break;case 5:var j=a.stateNode;a.flags&32&&(hl(j,""),a.flags&=-33);var G=Gd(i);mu(i,G,j,b);break;case 3:case 4:var te=a.stateNode.containerInfo,z=Gd(i);Xd(i,z,te,b);break;default:throw Error(s(161))}}catch(Y){Je(i,i.return,Y)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function Yv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;Yv(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,Kl=!0,r.reset(),Kl=!1),i=i.sibling}}function Dl(i,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)Kv(r,i),r=r.sibling;else jv(r)}function Kv(i,r){var a=i.alternate;if(a===null)Zd(i,!1);else switch(i.tag){case 3:if(n1=Cn=!1,Lv(),Dl(r,i),!Cn&&!yu){if(i=bn,i!==null)for(var c=0;c<i.length;c+=3){a=i[c];var f=i[c+1];N3(a,i[c+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}i=r.containerInfo,i=i.nodeType===9?i.documentElement:i.ownerDocument.documentElement,i!==null&&i.style.viewTransitionName===""&&(i.style.viewTransitionName="none",i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),i.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),n1=!0}bn=null;break;case 5:Dl(r,i);break;case 4:c=Cn,Cn=!1,Dl(r,i),Cn&&(yu=!0),Cn=c;break;case 22:i.memoizedState===null&&(a.memoizedState!==null?Zd(i,!1):Dl(r,i));break;case 30:c=Cn,f=Lv(),Cn=!1,Dl(r,i),Cn&&(i.flags|=4);var m=i.memoizedProps,b=i.stateNode;r=Wn(m,b),b=Wn(a.memoizedProps,b);var C=Gn(m.default,m.update);C==="none"?r=!1:(m=a.memoizedState,a.memoizedState=null,a=i.child,Si=0,r=t1(i,a,r,b,C,m,!0),Si!==(m===null?0:m.length)&&(i.flags|=32)),(i.flags&4)!==0&&r?(jl(i,i.memoizedProps.onUpdate),bn=f):f!==null&&(f.push.apply(f,bn),bn=f),Cn=(i.flags&32)!==0?!0:c;break;default:Dl(r,i)}}function En(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Iv(i,r.alternate,r),r=r.sibling}function zr(i,r){for(i=i.child;i!==null;){var a=i,c=r;switch(a.tag){case 0:case 11:case 14:case 15:Nr(4,a,a.return),zr(a,c);break;case 1:Qt(a,a.return);var f=a.stateNode;typeof f.componentWillUnmount=="function"&&Mv(a,a.return,f),zr(a,c);break;case 27:(c&2)!==0&&Y3(a.stateNode,a.type,a.memoizedProps);case 5:Qt(a,a.return),a.tag!==5&&a.tag!==27||Ja(a),zr(a,c);break;case 6:Ja(a);break;case 26:Qt(a,a.return),f=a.stateNode,a.memoizedState!==null||f===null||Xe||f.parentNode.removeChild(f),zr(a,c);break;case 22:a.memoizedState===null&&zr(a,c);break;case 30:Qt(a,a.return),zr(a,c);break;case 7:Qt(a,a.return);default:zr(a,c)}i=i.sibling}}function hn(i,r,a){for(a=(r.subtreeFlags&8772)!==0?a:a&-2,r=r.child;r!==null;){var c=r.alternate,f=i,m=r,b=m.flags,C=(a&1)!==0;switch(m.tag){case 0:case 11:case 15:hn(f,m,a),Qa(4,m);break;case 1:if(hn(f,m,a),c=m,f=c.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(G){Je(c,c.return,G)}if(c=m,f=c.updateQueue,f!==null){var A=c.stateNode;try{var j=f.shared.hiddenCallbacks;if(j!==null)for(f.shared.hiddenCallbacks=null,f=0;f<j.length;f++)m2(j[f],A)}catch(G){Je(c,c.return,G)}}C&&b&64&&Tv(m),Sn(m,m.return);break;case 27:(a&2)!==0&&Ov(m);case 5:m.tag!==5&&m.tag!==27||Av(m),hn(f,m,a),C&&c===null&&b&4&&Kd(m),Sn(m,m.return);break;case 6:Av(m);break;case 26:A=m.stateNode,m.memoizedState!==null||A===null||Ht||V1(co(A.ownerDocument),m.type,A),hn(f,m,a),C&&c===null&&b&4&&Kd(m),Sn(m,m.return);break;case 12:hn(f,m,a);break;case 31:hn(f,m,a),C&&b&4&&Vv(f,m);break;case 13:hn(f,m,a),C&&b&4&&qv(f,m);break;case 22:m.memoizedState===null&&hn(f,m,a),Sn(m,m.return);break;case 30:hn(f,m,a),Sn(m,m.return);break;case 7:Sn(m,m.return);default:hn(f,m,a)}r=r.sibling}}function l1(i,r){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&Ia(a))}function a1(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ia(i))}function Zi(i,r,a,c){var f=(a&335544064)===a;if(r.subtreeFlags&(f?10262:10256))for(r=r.child;r!==null;)Wv(i,r,a,c),r=r.sibling;else f&&Bv(r)}function Wv(i,r,a,c){var f=(a&335544064)===a;f&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&vu(r);var m=r.flags;switch(r.tag){case 0:case 11:case 15:Zi(i,r,a,c),m&2048&&Qa(9,r);break;case 1:Zi(i,r,a,c);break;case 3:Zi(i,r,a,c),f&&n1&&(i=i.containerInfo,i=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,i.style.viewTransitionName==="root"&&(i.style.viewTransitionName=""),i=i.ownerDocument.documentElement,i!==null&&i.style.viewTransitionName==="none"&&(i.style.viewTransitionName="")),m&2048&&(m=null,r.alternate!==null&&(m=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==m&&(r.refCount++,m!=null&&Ia(m)));break;case 12:if(m&2048){Zi(i,r,a,c),m=r.stateNode;try{var b=r.memoizedProps,C=b.id,A=b.onPostCommit;typeof A=="function"&&A(C,r.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(j){Je(r,r.return,j)}}else Zi(i,r,a,c);break;case 31:Zi(i,r,a,c);break;case 13:Zi(i,r,a,c);break;case 23:break;case 22:b=r.stateNode,C=r.alternate,r.memoizedState!==null?(f&&C!==null&&C.memoizedState===null&&vu(C),b._visibility&2?Zi(i,r,a,c):to(i,r)):(f&&C!==null&&C.memoizedState!==null&&vu(r),b._visibility&2?Zi(i,r,a,c):(b._visibility|=2,Ol(i,r,a,c,(r.subtreeFlags&10256)!==0||!1))),m&2048&&l1(C,r);break;case 24:Zi(i,r,a,c),m&2048&&a1(r.alternate,r);break;case 30:f&&(m=r.alternate,m!==null&&(wn(m.child,!0),wn(r.child,!0))),Zi(i,r,a,c);break;default:Zi(i,r,a,c)}}function Ol(i,r,a,c,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=i,b=r,C=a,A=c,j=b.flags;switch(b.tag){case 0:case 11:case 15:Ol(m,b,C,A,f),Qa(8,b);break;case 23:break;case 22:var G=b.stateNode;b.memoizedState!==null?G._visibility&2?Ol(m,b,C,A,f):to(m,b):(G._visibility|=2,Ol(m,b,C,A,f)),f&&j&2048&&l1(b.alternate,b);break;case 24:Ol(m,b,C,A,f),f&&j&2048&&a1(b.alternate,b);break;default:Ol(m,b,C,A,f)}r=r.sibling}}function to(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=i,c=r,f=c.flags;switch(c.tag){case 22:to(a,c),f&2048&&l1(c.alternate,c);break;case 24:to(a,c),f&2048&&a1(c.alternate,c);break;default:to(a,c)}r=r.sibling}}var Os=8192;function Rs(i,r,a){if(i.subtreeFlags&Os)for(i=i.child;i!==null;)Gv(i,r,a),i=i.sibling}function Gv(i,r,a){switch(i.tag){case 26:Rs(i,r,a),i.flags&Os&&(i.memoizedState!==null?P9(a,un,i.memoizedState,i.memoizedProps):(i=i.stateNode,(r&335544128)===r&&iy(a,i)));break;case 5:Rs(i,r,a),i.flags&Os&&(i=i.stateNode,(r&335544128)===r&&iy(a,i));break;case 3:case 4:var c=un;un=co(i.stateNode.containerInfo),Rs(i,r,a),un=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=Os,Os=16777216,Rs(i,r,a),Os=c):Rs(i,r,a));break;case 30:if((i.flags&Os)!==0&&(c=i.memoizedProps.name,c!=null&&c!=="auto")){var f=i.stateNode;f.paired=null,Li===null&&(Li=new Map),Li.set(c,f)}Rs(i,r,a);break;default:Rs(i,r,a)}}function Xv(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function io(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];It=c,Qv(c,i)}Xv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Zv(i),i=i.sibling}function Zv(i){switch(i.tag){case 0:case 11:case 15:io(i),i.flags&2048&&Nr(9,i,i.return);break;case 3:io(i);break;case 12:io(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,wu(i)):io(i);break;default:io(i)}}function wu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];It=c,Qv(c,i)}Xv(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Nr(8,r,r.return),wu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,wu(r));break;default:wu(r)}i=i.sibling}}function Qv(i,r){for(;It!==null;){var a=It;switch(a.tag){case 0:case 11:case 15:Nr(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ia(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,It=c;else e:for(a=i;It!==null;){c=It;var f=c.sibling,m=c.return;if(Fv(c),c===a){It=null;break e}if(f!==null){f.return=m,It=f;break e}It=m}}}var zx={getCacheForType:function(i){var r=Gt(xt),a=r.data.get(i);return a===void 0&&(a=i(),r.data.set(i,a)),a},cacheSignal:function(){return Gt(xt).controller.signal}},Bx=typeof WeakMap=="function"?WeakMap:Map,Ge=0,rt=null,Fe=null,Ve=0,Qe=0,Ni=null,Br=!1,Rl=!1,o1=!1,rr=0,gt=0,jr=0,Ls=0,xu=0,zi=0,Ll=0,no=null,wi=null,c1=!1,Cu=0,Jv=0,Eu=1/0,ku=null,Hr=null,ft=0,fn=null,Ns=null,kn=0,u1=0,h1=null,e3=null,Nl=null,zl=null,Bl=null,ro=0,Tu=null;function Bi(){return(Ge&2)!==0&&Ve!==0?Ve&-Ve:fe.T!==null?b1():n_()}function t3(){if(zi===0)if((Ve&536870912)===0||je){var i=bc;bc<<=1,(bc&3932160)===0&&(bc=262144),zi=i}else zi=536870912;return i=Xt.current,i!==null&&(i.flags|=32),zi}function jl(i,r){if(r!=null){var a=i.stateNode,c=a.ref;c===null&&(c=a.ref=z3(Wn(i.memoizedProps,a))),zl===null&&(zl=[]),zl.push(r.bind(null,c))}}function xi(i,r,a){(i===rt&&(Qe===2||Qe===9)||i.cancelPendingCommit!==null)&&(Hl(i,0),Ir(i,Ve,zi,!1)),Ea(i,a),((Ge&2)===0||i!==rt)&&(i===rt&&((Ge&2)===0&&(Ls|=a),gt===4&&Ir(i,Ve,zi,!1)),Tn(i))}function i3(i,r,a){if((Ge&6)!==0)throw Error(s(327));var c=!a&&(r&127)===0&&(r&i.expiredLanes)===0||Ca(i,r),f=c?Ix(i,r):d1(i,r,!0),m=c;do{if(f===0){Rl&&!c&&Ir(i,r,0,!1);break}else{if(a=i.current.alternate,m&&!jx(a)){f=d1(i,r,!1),m=!1;continue}if(f===2){if(m=r,i.errorRecoveryDisabledLanes&m)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){r=b;e:{var C=i;f=no;var A=C.current.memoizedState.isDehydrated;if(A&&(Hl(C,b).flags|=256),b=d1(C,b,!1),b!==2&&b!==6){if(o1&&!A){C.errorRecoveryDisabledLanes|=m,Ls|=m,f=4;break e}m=wi,wi=f,m!==null&&(wi===null?wi=m:wi.push.apply(wi,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Hl(i,0),Ir(i,r,0,!0);break}e:{switch(c=i,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Ir(c,r,zi,!Br);break e;case 2:wi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=Cu+300-Kt(),10<f)){if(Ir(c,r,zi,!Br),xc(c,0,!0)!==0)break e;kn=r,c.timeoutHandle=R1(n3.bind(null,c,a,wi,ku,c1,r,zi,Ls,Ll,Br,m,"Throttled",-0,0),f);break e}n3(c,a,wi,ku,c1,r,zi,Ls,Ll,Br,m,null,-0,0)}}break}while(!0);Tn(i)}function n3(i,r,a,c,f,m,b,C,A,j,G,te,z,Y){i.timeoutHandle=-1;var he=r.subtreeFlags,ye=(m&335544064)===m;if(te=null,(ye||he&8192||(he&16785408)===16785408)&&(te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_n},Li=null,Gv(r,m,te),ye&&(he=te,ye=i.containerInfo,ye=(ye.nodeType===9?ye:ye.ownerDocument).__reactViewTransition,ye!=null&&(he.count++,he.waitingForViewTransition=!0,he=fo.bind(he),ye.finished.then(he,he))),he=(m&62914560)===m?Cu-Kt():(m&4194048)===m?Jv-Kt():0,he=F9(te,he),he!==null)){kn=m,i.cancelPendingCommit=he(h3.bind(null,i,r,m,a,c,f,b,C,A,j,G,te,null,z,Y)),Ir(i,m,b,!j);return}h3(i,r,m,a,c,f,b,C,A,j,G,te)}function jx(i){for(var r=i;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var f=a[c],m=f.getSnapshot;f=f.value;try{if(!Oi(m(),f))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ir(i,r,a,c){r=Qg(i,r),r&=~xu,r&=~Ls,i.suspendedLanes|=r,i.pingedLanes&=~r,c&&(i.warmLanes|=r),c=i.expirationTimes;for(var f=r;0<f;){var m=31-Ai(f),b=1<<m;c[m]=-1,f&=~b}a!==0&&e_(i,a,r)}function Mu(){return(Ge&6)===0?(so(0),!1):!0}function f1(){if(Fe!==null){if(Qe===0)var i=Fe.return;else i=Fe,Qn=bs=null,Sd(i),Cl=null,Ua=0,i=Fe;for(;i!==null;)kv(i.alternate,i),i=i.return;Fe=null}}function Hl(i,r){var a=i.timeoutHandle;return a!==-1&&(i.timeoutHandle=-1,a9(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),kn=0,f1(),rt=i,Fe=a=Xn(i.current,null),Ve=r,Qe=0,Ni=null,Br=!1,Rl=Ca(i,r),o1=!1,Ll=zi=xu=Ls=jr=gt=0,wi=no=null,c1=!1,rr=Qg(i,r),Bc(),a}function r3(i,r){Le=null,fe.H=au,r===xl||r===Kc?(r=h2(),Qe=3):r===ad?(r=h2(),Qe=4):Qe=r===zd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ni=r,Fe===null&&(gt=1,ou(i,Ki(r,i.current)))}function s3(){var i=Xt.current;return i===null?!0:(Ve&4194048)===Ve?si===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?i===si:!1}function l3(){var i=fe.H;return fe.H=au,i===null?au:i}function a3(){var i=fe.A;return fe.A=zx,i}function Au(){gt=4,Br||(Ve&4194048)!==Ve&&Xt.current!==null||(Rl=!0),(jr&134217727)===0&&(Ls&134217727)===0||rt===null||Ir(rt,Ve,zi,!1)}function d1(i,r,a){var c=Ge;Ge|=2;var f=l3(),m=a3();(rt!==i||Ve!==r)&&(ku=null,Hl(i,r)),r=!1;var b=gt;e:do try{if(Qe!==0&&Fe!==null){var C=Fe,A=Ni;switch(Qe){case 8:f1(),b=6;break e;case 3:case 2:case 9:case 6:Xt.current===null&&(r=!0);var j=Qe;if(Qe=0,Ni=null,Il(i,C,A,j),a&&Rl){b=0;break e}break;default:j=Qe,Qe=0,Ni=null,Il(i,C,A,j)}}Hx(),b=gt;break}catch(G){r3(i,G)}while(!0);return r&&i.shellSuspendCounter++,Qn=bs=null,Ge=c,fe.H=f,fe.A=m,Fe===null&&(rt=null,Ve=0,Bc()),b}function Hx(){for(;Fe!==null;)o3(Fe)}function Ix(i,r){var a=Ge;Ge|=2;var c=l3(),f=a3();rt!==i||Ve!==r?(ku=null,Eu=Kt()+500,Hl(i,r)):Rl=Ca(i,r);e:do try{if(Qe!==0&&Fe!==null){r=Fe;var m=Ni;t:switch(Qe){case 1:Qe=0,Ni=null,Il(i,r,m,1);break;case 2:case 9:if(c2(m)){Qe=0,Ni=null,c3(r);break}r=function(){Qe!==2&&Qe!==9||rt!==i||(Qe=7),Tn(i)},m.then(r,r);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:c2(m)?(Qe=0,Ni=null,c3(r)):(Qe=0,Ni=null,Il(i,r,m,7));break;case 5:var b=null;switch(Fe.tag){case 26:b=Fe.memoizedState;case 5:case 27:var C=Fe;if(b?ey(b):C.stateNode.complete){Qe=0,Ni=null;var A=C.sibling;if(A!==null)Fe=A;else{var j=C.return;j!==null?(Fe=j,Du(j)):Fe=null}break t}}Qe=0,Ni=null,Il(i,r,m,5);break;case 6:Qe=0,Ni=null,Il(i,r,m,6);break;case 8:f1(),gt=6;break e;default:throw Error(s(462))}}Px();break}catch(G){r3(i,G)}while(!0);return Qn=bs=null,fe.H=c,fe.A=f,Ge=a,Fe!==null?0:(rt=null,Ve=0,Bc(),gt)}function Px(){for(;Fe!==null&&!fs();)o3(Fe)}function o3(i){var r=Cv(i.alternate,i,rr);i.memoizedProps=i.pendingProps,r===null?Du(i):Fe=r}function c3(i){var r=i,a=r.alternate;switch(r.tag){case 15:case 0:r=_v(a,r,r.pendingProps,r.type,void 0,Ve);break;case 11:r=_v(a,r,r.pendingProps,r.type.render,r.ref,Ve);break;case 5:Sd(r);var c=r;c===jt&&(je?(Uc(c),c.tag===5&&c.stateNode!=null&&(at=c.stateNode)):(Uc(c),je=!0));default:kv(a,r),r=Fe=Q_(r,rr),r=Cv(a,r,rr)}i.memoizedProps=i.pendingProps,r===null?Du(i):Fe=r}function Il(i,r,a,c){Qn=bs=null,Sd(r),Cl=null,Ua=0;var f=r.return;try{if(Tx(i,f,r,a,Ve)){gt=1,ou(i,Ki(a,i.current)),Fe=null;return}}catch(m){if(f!==null)throw Fe=f,m;gt=1,ou(i,Ki(a,i.current)),Fe=null;return}r.flags&32768?(je||c===1?i=!0:Rl||(Ve&536870912)!==0?i=!1:(Br=i=!0,(c===2||c===9||c===3||c===6)&&(c=Xt.current,c!==null&&c.tag===13&&(c.flags|=16384))),u3(r,i)):Du(r)}function Du(i){var r=i;do{if((r.flags&32768)!==0){u3(r,Br);return}i=r.return;var a=Ox(r.alternate,r,rr);if(a!==null){Fe=a;return}if(r=r.sibling,r!==null){Fe=r;return}Fe=r=i}while(r!==null);gt===0&&(gt=5)}function u3(i,r){do{var a=Rx(i.alternate,i);if(a!==null){a.flags&=32767,Fe=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(i=i.sibling,i!==null)){Fe=i;return}Fe=i=a}while(i!==null);gt=6,Fe=null}function h3(i,r,a,c,f,m,b,C,A,j,G,te){i.cancelPendingCommit=null;do Ou();while(ft!==0);if((Ge&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));i===rt&&(Fe=rt=null,Ve=0),Ns=r,fn=i,kn=a,h1=f,e3=c,Fx(i,r,a,b,C,A,te)}}function Fx(i,r,a,c,f,m,b){var C=r.lanes|r.childLanes;if(u1=C,C|=Wf,dw(i,a,C,c,f,m),zl=null,(a&335544064)===a?(Bl=mx(i),c=10262):(Bl=null,c=10256),(r.subtreeFlags&c)!==0||(r.flags&c)!==0?(i.callbackNode=null,i.callbackPriority=0,Kx(yc,function(){return _1(),null})):(i.callbackNode=null,i.callbackPriority=0),gu=!1,c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=fe.T,fe.T=null,f=Se.p,Se.p=2,m=Ge,Ge|=4;try{Lx(i,r,a)}finally{Ge=m,Se.p=f,fe.T=c}}ft=1,gu?Nl=d9(b,i.containerInfo,Bl,p1,m1,Vx,g1,_1,Ux):(p1(),m1(),g1())}function Ux(i){if(ft!==0){var r=fn.onRecoverableError;r(i,{componentStack:null})}}function Vx(){ft===3&&(ft=0,Kv(Ns,fn),ft=4)}function p1(){if(ft===1){ft=0;var i=fn,r=Ns,a=kn,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=fe.T,fe.T=null;var f=Se.p;Se.p=2;var m=Ge;Ge|=4;try{eo=yu=!1,$v(r,i,a),a=A1;var b=U_(i.containerInfo),C=a.focusedElem,A=a.selectionRange;if(b!==C&&C&&C.ownerDocument&&F_(C.ownerDocument.documentElement,C)){if(A!==null&&Vf(C)){var j=A.start,G=A.end;if(G===void 0&&(G=j),"selectionStart"in C)C.selectionStart=j,C.selectionEnd=Math.min(G,C.value.length);else{var te=C.ownerDocument||document,z=te&&te.defaultView||window;if(z.getSelection){var Y=z.getSelection(),he=C.textContent.length,ye=Math.min(A.start,he),Ne=A.end===void 0?ye:Math.min(A.end,he);!Y.extend&&ye>Ne&&(b=Ne,Ne=ye,ye=b);var B=P_(C,ye),L=P_(C,Ne);if(B&&L&&(Y.rangeCount!==1||Y.anchorNode!==B.node||Y.anchorOffset!==B.offset||Y.focusNode!==L.node||Y.focusOffset!==L.offset)){var U=te.createRange();U.setStart(B.node,B.offset),Y.removeAllRanges(),ye>Ne?(Y.addRange(U),Y.extend(L.node,L.offset)):(U.setEnd(L.node,L.offset),Y.addRange(U))}}}}for(te=[],Y=C;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<te.length;C++){var ee=te[C];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Kl=!!M1,A1=M1=null}finally{Ge=m,Se.p=f,fe.T=c}}i.current=r,ft=2}}function m1(){if(ft===2){ft=0;var i=fn,r=Ns,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=fe.T,fe.T=null;var c=Se.p;Se.p=2;var f=Ge;Ge|=4;try{Iv(i,r.alternate,r)}finally{Ge=f,Se.p=c,fe.T=a}}ft=3}}function g1(){if(ft===4||ft===3){ft=0;var i=Nl;Nl=null,vc();var r=fn,a=Ns,c=kn,f=e3,m=(c&335544064)===c?10262:10256;if((a.subtreeFlags&m)!==0||(a.flags&m)!==0?ft=5:(ft=0,Ns=fn=null,f3(r,r.pendingLanes)),m=r.pendingLanes,m===0&&(Hr=null),Ef(c),a=a.stateNode,Mi&&typeof Mi.onCommitFiberRoot=="function")try{Mi.onCommitFiberRoot(xa,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=fe.T,m=Se.p,Se.p=2,fe.T=null;try{for(var b=r.onRecoverableError,C=0;C<f.length;C++){var A=f[C];b(A.value,{componentStack:A.stack})}}finally{fe.T=a,Se.p=m}}if(f=zl,b=Bl,Bl=null,f!==null&&(zl=null,b===null&&(b=[]),i!==null))for(A=0;A<f.length;A++)a=(0,f[A])(b),a!==void 0&&i.finished.finally(a);(kn&3)!==0&&Ou(),Tn(r),m=r.pendingLanes,(c&261930)!==0&&(m&42)!==0?r===Tu?ro++:(ro=0,Tu=r):(ro=0,Tu=null),so(0)}}function f3(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Ia(r)))}function Ou(){return Nl!==null&&(Nl.skipTransition(),Nl=null),p1(),m1(),g1(),_1()}function _1(){if(ft!==5)return!1;var i=fn,r=u1;u1=0;var a=Ef(kn),c=fe.T,f=Se.p;try{Se.p=32>a?32:a,fe.T=null,a=h1,h1=null;var m=fn,b=kn;if(ft=0,Ns=fn=null,kn=0,(Ge&6)!==0)throw Error(s(331));var C=Ge;if(Ge|=4,Zv(m.current),Wv(m,m.current,b,a),Ge=C,so(0,!1),Mi&&typeof Mi.onPostCommitFiberRoot=="function")try{Mi.onPostCommitFiberRoot(xa,m)}catch{}return!0}finally{Se.p=f,fe.T=c,f3(i,r)}}function d3(i,r,a){r=Ki(a,r),r=Nd(i.stateNode,r,2),i=Dr(i,r,2),i!==null&&(Ea(i,2),Tn(i))}function Je(i,r,a){if(i.tag===3)d3(i,i,a);else for(;r!==null;){if(r.tag===3){d3(r,i,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Hr===null||!Hr.has(c))){i=Ki(a,i),a=cv(2),c=Dr(r,a,2),c!==null&&(uv(a,c,r,i),Ea(c,2),Tn(c));break}}r=r.return}}function v1(i,r,a){var c=i.pingCache;if(c===null){c=i.pingCache=new Bx;var f=new Set;c.set(r,f)}else f=c.get(r),f===void 0&&(f=new Set,c.set(r,f));f.has(a)||(o1=!0,f.add(a),i=qx.bind(null,i,r,a),r.then(i,i))}function qx(i,r,a){var c=i.pingCache;c!==null&&c.delete(r),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,rt===i&&(Ve&a)===a&&((gt===4||gt===3&&(Ve&62914560)===Ve&&300>Kt()-Cu)&&(Ge&2)===0?Hl(i,0):xu|=a,Ll===Ve&&(Ll=0)),Tn(i)}function p3(i,r){r===0&&(r=Jg()),i=vs(i,r),i!==null&&(Ea(i,r),Tn(i))}function $x(i){var r=i.memoizedState,a=0;r!==null&&(a=r.retryLane),p3(i,a)}function Yx(i,r){var a=0;switch(i.tag){case 31:case 13:var c=i.stateNode,f=i.memoizedState;f!==null&&(a=f.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(s(314))}c!==null&&c.delete(r),p3(i,a)}function Kx(i,r){return Un(i,r)}var Pl=null,Fl=null,y1=!1,Ru=!1,S1=!1,Pr=0;function Tn(i){i!==Fl&&i.next===null&&(Fl===null?Pl=Fl=i:Fl=Fl.next=i),Ru=!0,y1||(y1=!0,Gx())}function so(i,r){if(!S1&&Ru){S1=!0;do for(var a=!1,c=Pl;c!==null;){if(i!==0){var f=c.pendingLanes;if(f===0)var m=0;else{var b=c.suspendedLanes,C=c.pingedLanes;m=(1<<31-Ai(42|i)+1)-1,m&=f&~(b&~C),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,v3(c,m))}else m=Ve,m=xc(c,c===rt?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(m&3)===0||Ca(c,m)||(a=!0,v3(c,m));c=c.next}while(a);S1=!1}}function Wx(){m3()}function m3(){Ru=y1=!1;var i=0;Pr!==0&&l9()&&(i=Pr);for(var r=Kt(),a=null,c=Pl;c!==null;){var f=c.next,m=g3(c,r);m===0?(c.next=null,a===null?Pl=f:a.next=f,f===null&&(Fl=a)):(a=c,(i!==0||(m&3)!==0)&&(Ru=!0)),c=f}ft!==0&&ft!==5||so(i),Pr!==0&&(Pr=0)}function g3(i,r){for(var a=i.suspendedLanes,c=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-Ai(m),C=1<<b,A=f[b];A===-1?((C&a)===0||(C&c)!==0)&&(f[b]=fw(C,r)):A<=r&&(i.expiredLanes|=C),m&=~C}if(r=rt,a=Ve,a=xc(i,i===r?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,a===0||i===r&&(Qe===2||Qe===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&Vn(c),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||Ca(i,a)){if(r=a&-a,r===i.callbackPriority)return r;switch(c!==null&&Vn(c),Ef(a)){case 2:case 8:a=qi;break;case 32:a=yc;break;case 268435456:a=Zg;break;default:a=yc}return c=_3.bind(null,i),a=Un(a,c),i.callbackPriority=r,i.callbackNode=a,r}return c!==null&&c!==null&&Vn(c),i.callbackPriority=2,i.callbackNode=null,2}function _3(i,r){if(ft!==0&&ft!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Ou()&&i.callbackNode!==a)return null;var c=Ve;return c=xc(i,i===rt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(i3(i,c,r),g3(i,Kt()),i.callbackNode!=null&&i.callbackNode===a?_3.bind(null,i):null)}function v3(i,r){if(Ou())return null;i3(i,r,!0)}function Gx(){o9(function(){(Ge&6)!==0?Un(qn,Wx):m3()})}function b1(){if(Pr===0){var i=Cs;i===0&&(i=Sc,Sc<<=1,(Sc&261888)===0&&(Sc=256)),Pr=i}return Pr}function y3(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Mc(i)}function Xx(i,r,a,c,f){if(r==="submit"&&a&&a.stateNode===f){var m=y3((f[vi]||null).action),b=c.submitter;b&&(r=(r=b[vi]||null)?y3(r.formAction):b.getAttribute("formAction"),r!==null&&(m=r,b=null));var C=new Rc("action","action",null,c,f);i.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Pr!==0){var A=new FormData(f,b);Ad(a,{pending:!0,data:A,method:f.method,action:m},null,A)}}else typeof m=="function"&&(C.preventDefault(),A=new FormData(f,b),Ad(a,{pending:!0,data:A,method:f.method,action:m},m,A))},currentTarget:f}]})}}for(var w1=0;w1<Kf.length;w1++){var x1=Kf[w1],Zx=x1.toLowerCase(),Qx=x1[0].toUpperCase()+x1.slice(1);on(Zx,"on"+Qx)}on($_,"onAnimationEnd"),on(Y_,"onAnimationIteration"),on(K_,"onAnimationStart"),on("dblclick","onDoubleClick"),on("focusin","onFocus"),on("focusout","onBlur"),on(ax,"onTransitionRun"),on(ox,"onTransitionStart"),on(cx,"onTransitionCancel"),on(W_,"onTransitionEnd"),cl("onMouseEnter",["mouseout","mouseover"]),cl("onMouseLeave",["mouseout","mouseover"]),cl("onPointerEnter",["pointerout","pointerover"]),cl("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Jx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lo));function S3(i,r){r=(r&4)!==0;for(var a=0;a<i.length;a++){var c=i[a],f=c.event;c=c.listeners;e:{var m=void 0;if(r)for(var b=c.length-1;0<=b;b--){var C=c[b],A=C.instance,j=C.currentTarget;if(C=C.listener,A!==m&&f.isPropagationStopped())break e;m=C,f.currentTarget=j;try{m(f)}catch(G){zc(G)}f.currentTarget=null,m=A}else for(b=0;b<c.length;b++){if(C=c[b],A=C.instance,j=C.currentTarget,C=C.listener,A!==m&&f.isPropagationStopped())break e;m=C,f.currentTarget=j;try{m(f)}catch(G){zc(G)}f.currentTarget=null,m=A}}}}function Ue(i,r){var a=r[s_];a===void 0&&(a=r[s_]=new Set);var c=i+"__bubble";a.has(c)||(b3(r,i,2,!1),a.add(c))}function C1(i,r,a){var c=0;r&&(c|=4),b3(a,i,c,r)}var Lu="_reactListening"+Math.random().toString(36).slice(2);function E1(i){if(!i[Lu]){i[Lu]=!0,o_.forEach(function(a){a!=="selectionchange"&&(Jx.has(a)||C1(a,!1,i),C1(a,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Lu]||(r[Lu]=!0,C1("selectionchange",!1,r))}}function b3(i,r,a,c){switch(uy(r)){case 2:var f=$9;break;case 8:f=Y9;break;default:f=$1}a=f.bind(null,r,a,i),f=void 0,!Lf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),c?f!==void 0?i.addEventListener(r,a,{capture:!0,passive:f}):i.addEventListener(r,a,!0):f!==void 0?i.addEventListener(r,a,{passive:f}):i.addEventListener(r,a,!1)}function k1(i,r,a,c,f){var m=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var b=c.tag;if(b===3||b===4){var C=c.stateNode.containerInfo;if(C===f)break;if(b===4)for(b=c.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;C!==null;){if(b=ps(C),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){c=m=b;continue e}C=C.parentNode}}c=c.return}b_(function(){var j=m,G=Of(a),te=[];e:{var z=G_.get(i);if(z!==void 0){var Y=Rc,he=i;switch(i){case"keypress":if(Dc(a)===0)break e;case"keydown":case"keyup":Y=jw;break;case"focusin":he="focus",Y=jf;break;case"focusout":he="blur",Y=jf;break;case"beforeblur":case"afterblur":Y=jf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=C_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ew;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Uw;break;case $_:case Y_:case K_:Y=Mw;break;case W_:Y=qw;break;case"scroll":case"scrollend":Y=xw;break;case"wheel":Y=Yw;break;case"copy":case"cut":case"paste":Y=Dw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=k_;break;case"submit":Y=Pw;break;case"toggle":case"beforetoggle":Y=Ww}var ye=(r&4)!==0,Ne=!ye&&(i==="scroll"||i==="scrollend"),B=ye?z!==null?z+"Capture":null:z;ye=[];for(var L=j,U;L!==null;){var ee=L;if(U=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||U===null||B===null||(ee=Ma(L,B),ee!=null&&ye.push(ao(L,ee,U))),Ne)break;L=L.return}0<ye.length&&(z=new Y(z,he,null,a,G),te.push({event:z,listeners:ye}))}}if((r&7)===0){e:{if(Y=i==="mouseover"||i==="pointerover",z=i==="mouseout"||i==="pointerout",Y&&a!==Df&&(he=a.relatedTarget||a.fromElement)&&(ps(he)||he[ll]))break e;(z||Y)&&(he=G.window===G?G:(Y=G.ownerDocument)?Y.defaultView||Y.parentWindow:window,z?(Y=a.relatedTarget||a.toElement,z=j,Y=Y?ps(Y):null,Y!==null&&(Ne=o(Y),ye=Y.tag,Y!==Ne||ye!==5&&ye!==27&&ye!==6)&&(Y=null)):(z=null,Y=j),z!==Y&&(ye=C_,ee="onMouseLeave",B="onMouseEnter",L="mouse",(i==="pointerout"||i==="pointerover")&&(ye=k_,ee="onPointerLeave",B="onPointerEnter",L="pointer"),Ne=z==null?he:Ta(z),U=Y==null?he:Ta(Y),he=new ye(ee,L+"leave",z,a,G),he.target=Ne,he.relatedTarget=U,ee=null,ps(G)===j&&(ye=new ye(B,L+"enter",Y,a,G),ye.target=U,ye.relatedTarget=Ne,ee=ye),Ne=ee,ye=z&&Y?R(z,Y,e9):null,z!==null&&w3(te,he,z,ye,!1),Y!==null&&Ne!==null&&w3(te,Ne,Y,ye,!0)))}e:{if(z=j?Ta(j):window,Y=z.nodeName&&z.nodeName.toLowerCase(),Y==="select"||Y==="input"&&z.type==="file")var ge=N_;else if(R_(z))if(z_)ge=rx;else{ge=ix;var qe=tx}else Y=z.nodeName,!Y||Y.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?j&&Af(j.elementType)&&(ge=N_):ge=nx;if(ge&&(ge=ge(i,j))){L_(te,ge,a,G);break e}qe&&qe(i,z,j)}switch(qe=j?Ta(j):window,i){case"focusin":(R_(qe)||qe.contentEditable==="true")&&(ml=qe,qf=j,Ba=null);break;case"focusout":Ba=qf=ml=null;break;case"mousedown":$f=!0;break;case"contextmenu":case"mouseup":case"dragend":$f=!1,V_(te,a,G);break;case"selectionchange":if(lx)break;case"keydown":case"keyup":V_(te,a,G)}var be;if(If)e:{switch(i){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else pl?D_(i,a)&&(Te="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Te="onCompositionStart");Te&&(T_&&a.locale!=="ko"&&(pl||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&pl&&(be=w_()):(br=G,Nf="value"in br?br.value:br.textContent,pl=!0)),qe=Nu(j,Te),0<qe.length&&(Te=new E_(Te,i,null,a,G),te.push({event:Te,listeners:qe}),be?Te.data=be:(be=O_(a),be!==null&&(Te.data=be)))),(be=Xw?Zw(i,a):Qw(i,a))&&(Te=Nu(j,"onBeforeInput"),0<Te.length&&(qe=new E_("onBeforeInput","beforeinput",null,a,G),te.push({event:qe,listeners:Te}),qe.data=be)),Xx(te,i,j,a,G)}S3(te,r)})}function ao(i,r,a){return{instance:i,listener:r,currentTarget:a}}function Nu(i,r){for(var a=r+"Capture",c=[];i!==null;){var f=i,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Ma(i,a),f!=null&&c.unshift(ao(i,f,m)),f=Ma(i,r),f!=null&&c.push(ao(i,f,m))),i.tag===3)return c;i=i.return}return[]}function e9(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function w3(i,r,a,c,f){for(var m=r._reactName,b=[];a!==null&&a!==c;){var C=a,A=C.alternate,j=C.stateNode;if(C=C.tag,A!==null&&A===c)break;C!==5&&C!==26&&C!==27||j===null||(A=j,f?(j=Ma(a,m),j!=null&&b.unshift(ao(a,j,A))):f||(j=Ma(a,m),j!=null&&b.push(ao(a,j,A)))),a=a.return}b.length!==0&&i.push({event:r,listeners:b})}var t9=/\r\n?/g,i9=/\u0000|\uFFFD/g;function x3(i){return(typeof i=="string"?i:""+i).replace(t9,`
10
+ `).replace(i9,"")}function C3(i,r){return r=x3(r),x3(i)===r}function et(i,r,a,c,f,m){switch(a){case"children":if(typeof c=="string")r==="body"||r==="textarea"&&c===""||hl(i,c);else if(typeof c=="number"||typeof c=="bigint")r!=="body"&&hl(i,""+c);else return;break;case"className":Tc(i,"class",c);break;case"tabIndex":Tc(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Tc(i,a,c);break;case"style":y_(i,c,m);return;case"data":if(r!=="object"){Tc(i,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){i.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Mc(c),i.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(a==="formAction"?(r!=="input"&&et(i,r,"name",f.name,f,null),et(i,r,"formEncType",f.formEncType,f,null),et(i,r,"formMethod",f.formMethod,f,null),et(i,r,"formTarget",f.formTarget,f,null)):(et(i,r,"encType",f.encType,f,null),et(i,r,"method",f.method,f,null),et(i,r,"target",f.target,f,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Mc(c),i.setAttribute(a,c);break;case"onClick":c!=null&&(i.onclick=_n);return;case"onScroll":c!=null&&Ue("scroll",i);return;case"onScrollEnd":c!=null&&Ue("scrollend",i);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(a=c.__html,a!=null){if(f.children!=null)throw Error(s(60));m?.__html!==a&&(i.innerHTML=a)}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}a=Mc(c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,c):i.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":c===!0?i.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,c):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(a,c):i.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(a):i.setAttribute(a,c);break;case"popover":Ue("beforetoggle",i),Ue("toggle",i),kc(i,"popover",c);break;case"xlinkActuate":Yn(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Yn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Yn(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Yn(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Yn(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Yn(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Yn(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Yn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Yn(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":kc(i,"is",c);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=bw.get(a)||a,kc(i,a,c);else return}Ye=!0}function T1(i,r,a,c,f,m){switch(a){case"style":y_(i,c,m);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(a=c.__html,a!=null){if(f.children!=null)throw Error(s(60));m?.__html!==a&&(i.innerHTML=a)}}break;case"children":if(typeof c=="string")hl(i,c);else if(typeof c=="number"||typeof c=="bigint")hl(i,""+c);else return;break;case"onScroll":c!=null&&Ue("scroll",i);return;case"onScrollEnd":c!=null&&Ue("scrollend",i);return;case"onClick":c!=null&&(i.onclick=_n);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!c_.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),m=a.slice(2,f?a.length-7:void 0),r=i[vi]||null,r=r!=null?r[a]:null,typeof r=="function"&&i.removeEventListener(m,r,f),typeof c=="function")){typeof r!="function"&&r!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(m,c,f);break e}Ye=!0,a in i?i[a]=c:c===!0?i.setAttribute(a,""):kc(i,a,c)}return}Ye=!0}function Jt(i,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",i),Ue("load",i);var c=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var b=a[m];if(b!=null)switch(m){case"src":c=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:et(i,r,m,b,a,null)}}f&&et(i,r,"srcSet",a.srcSet,a,null),c&&et(i,r,"src",a.src,a,null);return;case"input":Ue("invalid",i);var C=m=b=f=null,A=null,j=null;for(c in a)if(a.hasOwnProperty(c)){var G=a[c];if(G!=null)switch(c){case"name":f=G;break;case"type":b=G;break;case"checked":A=G;break;case"defaultChecked":j=G;break;case"value":m=G;break;case"defaultValue":C=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,r));break;default:et(i,r,c,G,a,null)}}m_(i,m,C,A,j,b,f,!1);return;case"select":Ue("invalid",i),c=b=m=null;for(f in a)if(a.hasOwnProperty(f)&&(C=a[f],C!=null))switch(f){case"value":m=C;break;case"defaultValue":b=C;break;case"multiple":c=C;default:et(i,r,f,C,a,null)}r=m,a=b,i.multiple=!!c,r!=null?ul(i,!!c,r,!1):a!=null&&ul(i,!!c,a,!0);return;case"textarea":Ue("invalid",i),m=f=c=null;for(b in a)if(a.hasOwnProperty(b)&&(C=a[b],C!=null))switch(b){case"value":c=C;break;case"defaultValue":f=C;break;case"children":m=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:et(i,r,b,C,a,null)}__(i,c,f,m);return;case"option":for(A in a)a.hasOwnProperty(A)&&(c=a[A],c!=null)&&(A==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":et(i,r,A,c,a,null));return;case"dialog":Ue("beforetoggle",i),Ue("toggle",i),Ue("cancel",i),Ue("close",i);break;case"iframe":case"object":Ue("load",i);break;case"video":case"audio":for(c=0;c<lo.length;c++)Ue(lo[c],i);break;case"image":Ue("error",i),Ue("load",i);break;case"details":Ue("toggle",i);break;case"embed":case"source":case"link":Ue("error",i),Ue("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in a)if(a.hasOwnProperty(j)&&(c=a[j],c!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:et(i,r,j,c,a,null)}return;default:if(Af(r)){for(G in a)a.hasOwnProperty(G)&&(c=a[G],c!==void 0&&T1(i,r,G,c,a,void 0));return}}for(C in a)a.hasOwnProperty(C)&&(c=a[C],c!=null&&et(i,r,C,c,a,null))}var n9={};function r9(i,r,a,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,C=null,A=null,j=null,G=null;for(Y in a){var te=a[Y];if(a.hasOwnProperty(Y)&&te!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":A=te;default:c.hasOwnProperty(Y)||et(i,r,Y,null,c,te)}}for(var z in c){var Y=c[z];if(te=a[z],c.hasOwnProperty(z)&&(Y!=null||te!=null))switch(z){case"type":Y!==te&&(Ye=!0),m=Y;break;case"name":Y!==te&&(Ye=!0),f=Y;break;case"checked":Y!==te&&(Ye=!0),j=Y;break;case"defaultChecked":Y!==te&&(Ye=!0),G=Y;break;case"value":Y!==te&&(Ye=!0),b=Y;break;case"defaultValue":Y!==te&&(Ye=!0),C=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,r));break;default:Y!==te&&et(i,r,z,Y,c,te)}}Tf(i,b,C,A,j,G,m,f);return;case"select":Y=b=C=z=null;for(m in a)if(A=a[m],a.hasOwnProperty(m)&&A!=null)switch(m){case"value":break;case"multiple":Y=A;default:c.hasOwnProperty(m)||et(i,r,m,null,c,A)}for(f in c)if(m=c[f],A=a[f],c.hasOwnProperty(f)&&(m!=null||A!=null))switch(f){case"value":m!==A&&(Ye=!0),z=m;break;case"defaultValue":m!==A&&(Ye=!0),C=m;break;case"multiple":m!==A&&(Ye=!0),b=m;default:m!==A&&et(i,r,f,m,c,A)}r=C,a=b,c=Y,z!=null?ul(i,!!a,z,!1):!!c!=!!a&&(r!=null?ul(i,!!a,r,!0):ul(i,!!a,a?[]:"",!1));return;case"textarea":Y=z=null;for(C in a)if(f=a[C],a.hasOwnProperty(C)&&f!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:et(i,r,C,null,c,f)}for(b in c)if(f=c[b],m=a[b],c.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":f!==m&&(Ye=!0),z=f;break;case"defaultValue":f!==m&&(Ye=!0),Y=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&et(i,r,b,f,c,m)}g_(i,z,Y);return;case"option":for(var he in a)z=a[he],a.hasOwnProperty(he)&&z!=null&&!c.hasOwnProperty(he)&&(he==="selected"?i.selected=!1:et(i,r,he,null,c,z));for(A in c)z=c[A],Y=a[A],c.hasOwnProperty(A)&&z!==Y&&(z!=null||Y!=null)&&(A==="selected"?(z!==Y&&(Ye=!0),i.selected=z&&typeof z!="function"&&typeof z!="symbol"):et(i,r,A,z,c,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in a)z=a[ye],a.hasOwnProperty(ye)&&z!=null&&!c.hasOwnProperty(ye)&&et(i,r,ye,null,c,z);for(j in c)if(z=c[j],Y=a[j],c.hasOwnProperty(j)&&z!==Y&&(z!=null||Y!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(s(137,r));break;default:et(i,r,j,z,c,Y)}return;default:if(Af(r)){for(var Ne in a)z=a[Ne],a.hasOwnProperty(Ne)&&z!==void 0&&!c.hasOwnProperty(Ne)&&T1(i,r,Ne,void 0,c,z);for(G in c)z=c[G],Y=a[G],!c.hasOwnProperty(G)||z===Y||z===void 0&&Y===void 0||T1(i,r,G,z,c,Y);return}}for(var B in a)z=a[B],a.hasOwnProperty(B)&&z!=null&&!c.hasOwnProperty(B)&&et(i,r,B,null,c,z);for(te in c)z=c[te],Y=a[te],!c.hasOwnProperty(te)||z===Y||z==null&&Y==null||et(i,r,te,z,c,Y)}function E3(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function s9(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var f=a[c],m=f.transferSize,b=f.initiatorType,C=f.duration;if(m&&C&&E3(b)){for(b=0,C=f.responseEnd,c+=1;c<a.length;c++){var A=a[c],j=A.startTime;if(j>C)break;var G=A.transferSize,te=A.initiatorType;G&&E3(te)&&(A=A.responseEnd,b+=G*(A<C?1:(C-j)/(A-j)))}if(--c,r+=8*(m+b)/(f.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var M1=null,A1=null;function oo(i){return i.nodeType===9?i:i.ownerDocument}function k3(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function T3(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function M3(i,r,a,c){return a=oo(a).createElement(i),a[Wt]=c,a[vi]=r,Jt(a,i,r),Bt(a),a}function D1(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var O1=null;function l9(){var i=window.event;return i&&i.type==="popstate"?i===O1?!1:(O1=i,!0):(O1=null,!1)}var R1=typeof setTimeout=="function"?setTimeout:void 0,a9=typeof clearTimeout=="function"?clearTimeout:void 0,A3=typeof Promise=="function"?Promise:void 0,D3=typeof requestAnimationFrame=="function"?requestAnimationFrame:R1,o9=typeof queueMicrotask=="function"?queueMicrotask:typeof A3<"u"?function(i){return A3.resolve(null).then(i).catch(c9)}:R1;function c9(i){setTimeout(function(){throw i})}function Fr(i){return i==="head"}function O3(i,r){var a=r,c=0;do{var f=a.nextSibling;if(i.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(c===0){i.removeChild(f),Wl(r);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")P1(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,P1(a);for(var m=a.firstChild;m;){var b=m.nextSibling,C=m.nodeName;m[ka]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=b}}else a==="body"&&P1(i.ownerDocument.body);a=f}while(a);Wl(r)}function R3(i,r){var a=i;i=0;do{var c=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=c}while(a)}function L3(i,r,a){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,i.style.viewTransitionName=r,a!=null&&(i.style.viewTransitionClass=a),a=getComputedStyle(i),a.display==="inline"){if(r=i.getClientRects(),r.length===1)var c=1;else for(var f=c=0;f<r.length;f++){var m=r[f];0<m.width&&0<m.height&&c++}c===1&&(i=i.style,i.display=r.length===1?"inline-block":"block",i.marginTop="-"+a.paddingTop,i.marginBottom="-"+a.paddingBottom)}}function N3(i,r){i=i.style,r=r.style;var a=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;i.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,i.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),i.display==="inline-block"&&(r==null?i.display=i.margin="":(a=r.display,i.display=a==null||typeof a=="boolean"?"":a,a=r.margin,a!=null?i.margin=a:(a=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],i.marginTop=a==null||typeof a=="boolean"?"":a,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],i.marginBottom=r==null||typeof r=="boolean"?"":r)))}function u9(i,r,a){return a=a.ownerDocument.defaultView,{rect:i,abs:r.position==="absolute"||r.position==="fixed",clip:r.clipPath!=="none"||r.overflow!=="visible"||r.filter!=="none"||r.mask!=="none"||r.mask!=="none"||r.borderRadius!=="0px",view:0<=i.bottom&&0<=i.right&&i.top<=a.innerHeight&&i.left<=a.innerWidth}}function L1(i){var r=i.getBoundingClientRect(),a=getComputedStyle(i);return u9(r,a,i)}function h9(i){return i.documentElement.clientHeight}function f9(i){this.addEventListener("load",i),this.addEventListener("error",i)}function d9(i,r,a,c,f,m,b,C,A){var j=r.nodeType===9?r:r.ownerDocument;try{var G=j.startViewTransition({update:function(){var z=j.defaultView,Y=z.navigation&&z.navigation.transition,he=j.fonts.status;c();var ye=[];if(he==="loaded"&&(h9(j),j.fonts.status==="loading"&&ye.push(j.fonts.ready)),he=ye.length,i!==null)for(var Ne=i.suspenseyImages,B=0,L=0;L<Ne.length;L++){var U=Ne[L];if(!U.complete){var ee=U.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<z.innerHeight&&ee.left<z.innerWidth){if(B+=ty(U),B>ju){ye.length=he;break}U=new Promise(f9.bind(U)),ye.push(U)}}}if(0<ye.length)return z=Promise.race([Promise.all(ye),new Promise(function(ge){return setTimeout(ge,500)})]).then(f,f),(Y?Promise.allSettled([Y.finished,z]):z).then(m,m);if(f(),Y)return Y.finished.then(m,m);m()},types:a});j.__reactViewTransition=G;var te=[];return G.ready.then(function(){for(var z=j.documentElement.getAnimations({subtree:!0}),Y=0;Y<z.length;Y++){var he=z[Y],ye=he.effect,Ne=ye.pseudoElement;if(Ne!=null&&Ne.startsWith("::view-transition")){te.push(he),he=ye.getKeyframes();for(var B=Ne=void 0,L=!0,U=0;U<he.length;U++){var ee=he[U],ge=ee.width;if(Ne===void 0)Ne=ge;else if(Ne!==ge){L=!1;break}if(ge=ee.height,B===void 0)B=ge;else if(B!==ge){L=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}L&&Ne!==void 0&&B!==void 0&&(ye.setKeyframes(he),L=getComputedStyle(ye.target,ye.pseudoElement),L.width!==Ne||L.height!==B)&&(L=he[0],L.width=Ne,L.height=B,L=he[he.length-1],L.width=Ne,L.height=B,ye.setKeyframes(he))}}b()},function(z){j.__reactViewTransition===G&&(j.__reactViewTransition=null);try{typeof z=="object"&&z!==null&&z.name==="InvalidStateError"&&(z.message==="View transition was skipped because document visibility state is hidden."||z.message==="Skipping view transition because document visibility state has become hidden."||z.message==="Skipping view transition because viewport size changed."||z.message==="Transition was aborted because of invalid state")&&(z=null),z!==null&&A(z)}finally{c(),f(),b()}}),G.finished.finally(function(){for(var z=0;z<te.length;z++)te[z].cancel();j.__reactViewTransition===G&&(j.__reactViewTransition=null),C()}),G}catch{return c(),f(),b(),null}}function zs(i,r){this._scope=document.documentElement,this._selector="::view-transition-"+i+"("+r+")"}zs.prototype.animate=function(i,r){return r=typeof r=="number"?{duration:r}:V({},r),r.pseudoElement=this._selector,this._scope.animate(i,r)},zs.prototype.getAnimations=function(){for(var i=this._scope,r=this._selector,a=i.getAnimations({subtree:!0}),c=[],f=0;f<a.length;f++){var m=a[f].effect;m!==null&&m.target===i&&m.pseudoElement===r&&c.push(a[f])}return c},zs.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function z3(i){return{name:i,group:new zs("group",i),imagePair:new zs("image-pair",i),old:new zs("old",i),new:new zs("new",i)}}function ji(i){this._fragmentFiber=i,this._observers=this._eventListeners=null}ji.prototype.addEventListener=function(i,r,a){var c=null,f=null;if(!(a!=null&&typeof a!="boolean"&&(c=a.signal||null,c!==null&&c.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(j3(m,i,r,a)===-1){var b=this,C=r;a!=null&&typeof a!="boolean"&&a.once===!0&&(C=function(A){b.removeEventListener(i,r,a),typeof r=="function"?r.call(this,A):r.handleEvent(A)}),c!==null&&(f=b.removeEventListener.bind(b,i,r,a),c.addEventListener("abort",f,{once:!0}),f=c.removeEventListener.bind(c,"abort",f)),c=Ul(a),m.push({type:i,listener:r,optionsOrUseCapture:a,attachedListener:C,cleanup:f}),g(this._fragmentFiber.child,!1,p9,i,C,c)}this._eventListeners=m}};function p9(i,r,a,c){return E(i).addEventListener(r,a,c),!1}ji.prototype.removeEventListener=function(i,r,a){var c=this._eventListeners;if(c!==null&&(r=j3(c,i,r,a),r!==-1)){var f=c[r];a=f.attachedListener;var m=f.cleanup;f=Ul(f.optionsOrUseCapture),g(this._fragmentFiber.child,!1,m9,i,a,f),c.splice(r,1),m!==null&&m()}};function m9(i,r,a,c){return E(i).removeEventListener(r,a,c),!1}function Ul(i){return i!=null&&typeof i!="boolean"&&(i.once===!0||i.signal instanceof AbortSignal)?{capture:i.capture,passive:i.passive}:i}function B3(i){return i==null?"c=0":typeof i=="boolean"?"c="+(i?"1":"0"):"c="+(i.capture?"1":"0")}function j3(i,r,a,c){if(i.length===0)return-1;c=B3(c);for(var f=0;f<i.length;f++){var m=i[f];if(m.type===r&&m.listener===a&&B3(m.optionsOrUseCapture)===c)return f}return-1}ji.prototype.dispatchEvent=function(i){var r=S(this._fragmentFiber);if(r===null)return!0;r=E(r);var a=this._eventListeners;if(a!==null&&0<a.length||!i.bubbles){var c=r.nodeType===9?r.createComment(""):document.createTextNode("");if(a)for(var f=0;f<a.length;f++){var m=a[f];c.addEventListener(m.type,m.attachedListener,Ul(m.optionsOrUseCapture))}if(r.appendChild(c),i=c.dispatchEvent(i),a)for(f=0;f<a.length;f++)m=a[f],c.removeEventListener(m.type,m.attachedListener,Ul(m.optionsOrUseCapture));return r.removeChild(c),i}return r.dispatchEvent(i)},ji.prototype.focus=function(i){g(this._fragmentFiber.child,!0,H3,i,void 0,void 0)};function H3(i,r){return i.tag===6?!1:(i=E(i),T9(i,r))}ji.prototype.focusLast=function(i){var r=[];g(this._fragmentFiber.child,!0,N1,r,void 0,void 0);for(var a=r.length-1;0<=a&&!H3(r[a],i);a--);};function N1(i,r){return r.push(i),!1}ji.prototype.blur=function(){var i=S(this._fragmentFiber);i!==null&&(i=E(i),i=oo(i).activeElement,i!==null&&g(this._fragmentFiber.child,!1,g9,i,void 0,void 0))};function g9(i,r){return i.tag===6?!1:(i=E(i),i===r||i.contains(r)?(r.blur(),!0):!1)}ji.prototype.observeUsing=function(i){this._observers===null&&(this._observers=new Set),this._observers.add(i),g(this._fragmentFiber.child,!1,_9,i,void 0,void 0)};function _9(i,r){return i.tag===6||(i=E(i),r.observe(i)),!1}ji.prototype.unobserveUsing=function(i){var r=this._observers;if(r!==null&&r.has(i)){r.delete(i),g(this._fragmentFiber.child,!1,v9,i,void 0,void 0);for(var a=r=0;a<dn.length;a++){var c=dn[a];c.fragmentInstance===this&&c.observer===i?i.unobserve(c.instance):dn[r++]=c}dn.length=r}};function v9(i,r){return i.tag===6||(i=E(i),r.unobserve(i)),!1}var dn=[],z1=!1;function y9(i,r,a){dn.push({fragmentInstance:i,observer:r,instance:a}),z1||(z1=!0,M9(function(){z1=!1;var c=dn;dn=[];for(var f=0;f<c.length;f++){var m=c[f];m.observer.unobserve(m.instance)}}))}ji.prototype.getClientRects=function(){var i=[];return g(this._fragmentFiber.child,!1,S9,i,void 0,void 0),i};function S9(i,r){if(i.tag===6){i=i.stateNode;var a=i.ownerDocument.createRange();a.selectNodeContents(i),r.push.apply(r,a.getClientRects())}else i=E(i),r.push.apply(r,i.getClientRects());return!1}ji.prototype.getRootNode=function(i){var r=S(this._fragmentFiber);return r===null?this:E(r).getRootNode(i)},ji.prototype.compareDocumentPosition=function(i){var r=S(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];g(this._fragmentFiber.child,!1,N1,a,void 0,void 0);var c=E(r);if(a.length===0){if(a=c,v(this._fragmentFiber)){e:{for(r=this._fragmentFiber.return;r!==null;){if(r.tag===4){r=r.stateNode.containerInfo;break e}if(r.tag===3||r.tag===5||r.tag===27)break;r=r.return}r=null}r!=null&&(a=r)}r=this._fragmentFiber;var f=c=a.compareDocumentPosition(i);return a===i?f=Node.DOCUMENT_POSITION_CONTAINS:c&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=w(r)[1],a===null?f=Node.DOCUMENT_POSITION_PRECEDING:(i=E(a).compareDocumentPosition(i),f=i===0||i&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=E(a[0]),f=E(a[a.length-1]);var m=v(this._fragmentFiber)?r.parentElement:c;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;c=m.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var b=r.compareDocumentPosition(i),C=f.compareDocumentPosition(i),A=b&Node.DOCUMENT_POSITION_CONTAINED_BY||C&Node.DOCUMENT_POSITION_CONTAINED_BY;return C=c&&m&&b&Node.DOCUMENT_POSITION_FOLLOWING&&C&Node.DOCUMENT_POSITION_PRECEDING,r=c&&r===i||m&&f===i||A||C?Node.DOCUMENT_POSITION_CONTAINED_BY:!c&&r===i||!m&&f===i?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:b,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||b9(r,this._fragmentFiber,a[0],a[a.length-1],i)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function b9(i,r,a,c,f){var m=ps(f);if(i&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!m)e:{for(;m!==null;){if(m.tag===7&&(m===r||m.alternate===r)){a=!0;break e}m=m.return}a=!1}return a}if(i&Node.DOCUMENT_POSITION_CONTAINS){if(m===null)return m=f.ownerDocument,f===m||f===m.documentElement||f===m.body;e:{for(m=r,r=S(r);m!==null;){if(!(m.tag!==5&&m.tag!==3&&m.tag!==27||m!==r&&m.alternate!==r)){m=!0;break e}m=m.return}m=!1}return m}return i&Node.DOCUMENT_POSITION_PRECEDING?((r=!!m)&&!(r=m===a)&&(r=R(a,m,Q),r===null?r=!1:(g(r,!0,N,m,a),m=M,M=null,r=m!==null)),r):i&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!m)&&!(r=m===c)&&(r=R(c,m,Q),r===null?r=!1:(g(r,!0,X,m,c),m=M,P=M=null,r=m!==null)),r):!1}function I3(i,r){var a=i.ownerDocument.createRange();a.selectNodeContents(i),i=a.getBoundingClientRect(),window.scrollTo(window.scrollX+i.left,r?window.scrollY+i.top:window.scrollY+i.bottom-window.innerHeight)}ji.prototype.scrollIntoView=function(i){if(typeof i=="object")throw Error(s(566));var r=[];g(this._fragmentFiber.child,!1,N1,r,void 0,void 0);var a=i!==!1;if(r.length===0){var c=w(this._fragmentFiber);if(c=a?c[1]||c[0]||S(this._fragmentFiber):c[0]||c[1],c===null)return;if(c.tag===6){i=E(c),I3(i,a);return}if(c=E(c),c.nodeType!==9){if(c.nodeType===11){a="host"in c?c.host:null,a!==null&&a.scrollIntoView(i);return}c.scrollIntoView(i)}}for(c=a?r.length-1:0;c!==(a?-1:r.length);){var f=r[c];f.tag===6?(f=E(f),I3(f,a)):E(f).scrollIntoView(i),c+=a?-1:1}};function w9(i,r){return i=E(i),P3(i,r),!1}function P3(i,r){i.reactFragments==null&&(i.reactFragments=new Set),i.reactFragments.add(r)}function F3(i,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];i.addEventListener(f.type,f.attachedListener,Ul(f.optionsOrUseCapture))}i.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(m){for(var b=0,C=0;C<dn.length;C++){var A=dn[C];(A.fragmentInstance!==r||A.observer!==m||A.instance!==i)&&(dn[b++]=A)}dn.length=b,m.observe(i)}),P3(i,r))}function x9(i,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];i.removeEventListener(f.type,f.attachedListener,Ul(f.optionsOrUseCapture))}i.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(m){typeof m.rootMargin=="string"?y9(r,m,i):m.unobserve(i)}),i.reactFragments!=null&&i.reactFragments.delete(r))}function B1(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":B1(a),Ec(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function C9(i,r,a,c){for(;i.nodeType===1;){var f=a;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[ka])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==f.rel||i.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||i.getAttribute("title")!==(f.title==null?null:f.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(f.src==null?null:f.src)||i.getAttribute("type")!==(f.type==null?null:f.type)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=Qi(i.nextSibling),i===null)break}return null}function E9(i,r,a){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=Qi(i.nextSibling),i===null))return null;return i}function U3(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Qi(i.nextSibling),i===null))return null;return i}function j1(i){return i.data==="$?"||i.data==="$~"}function H1(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function k9(i,r){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||a.readyState!=="loading")r();else{var c=function(){r(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function Qi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var I1=null;function V3(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(r===0)return Qi(i.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}i=i.nextSibling}return null}function q3(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return i;r--}else a!=="/$"&&a!=="/&"||r++}i=i.previousSibling}return null}function T9(i,r){function a(){c=!0}if(i.ownerDocument.activeElement===i)return!0;var c=!1;try{i.ownerDocument.addEventListener("focus",a,!0),(i.focus||HTMLElement.prototype.focus).call(i,r)}finally{i.ownerDocument.removeEventListener("focus",a,!0)}return c}function M9(i){D3(function(){D3(function(r){return i(r)})})}function $3(i,r,a){switch(r=oo(a),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Y3(i,r,a){for(var c in a){var f=a[c];a.hasOwnProperty(c)&&f!=null&&et(i,r,c,null,n9,f)}a.dangerouslySetInnerHTML!=null&&(i.textContent=""),i.onclick===_n&&(i.onclick=null),Ec(i)}function P1(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Ec(i)}var Ji=new Map,K3=new Set;function co(i){if(typeof i.getRootNode=="function"){var r=i.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return i.nodeType===9?i:i.ownerDocument}var sr=Se.d;Se.d={f:A9,r:D9,D:O9,C:R9,L:L9,m:N9,X:B9,S:z9,M:j9};function A9(){var i=sr.f(),r=Mu();return i||r}function D9(i){var r=al(i);r!==null&&r.tag===5&&r.type==="form"?G2(r):sr.r(i)}var Vl=typeof document>"u"?null:document;function W3(i,r,a){var c=Vl;if(c&&typeof r=="string"&&r){var f=$i(r);f='link[rel="'+i+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),K3.has(f)||(K3.add(f),i={rel:i,crossOrigin:a,href:r},c.querySelector(f)===null&&(r=c.createElement("link"),Jt(r,"link",i),Bt(r),c.head.appendChild(r)))}}function O9(i){sr.D(i),W3("dns-prefetch",i,null)}function R9(i,r){sr.C(i,r),W3("preconnect",i,r)}function L9(i,r,a){sr.L(i,r,a);var c=Vl;if(c&&i&&r){var f='link[rel="preload"][as="'+$i(r)+'"]';r==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+$i(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+$i(a.imageSizes)+'"]')):f+='[href="'+$i(i)+'"]';var m=f;switch(r){case"style":m=ql(i);break;case"script":m=$l(i)}if(!(Ji.has(m)||(i=V({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:i,as:r},a),Ji.set(m,i),c.querySelector(f)!==null||r==="style"&&c.querySelector(uo(m))||r==="script"&&c.querySelector(ho(m))))){var b=c.createElement("link");Jt(b,"link",i),r==="style"&&(b[Cc]=!0,b.onload=b.onerror=function(){a_(b)}),Bt(b),c.head.appendChild(b)}}}function N9(i,r){sr.m(i,r);var a=Vl;if(a&&i){var c=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+$i(c)+'"][href="'+$i(i)+'"]',m=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=$l(i)}if(!Ji.has(m)&&(i=V({rel:"modulepreload",href:i},r),Ji.set(m,i),a.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ho(m)))return}c=a.createElement("link"),Jt(c,"link",i),Bt(c),a.head.appendChild(c)}}}function z9(i,r,a){sr.S(i,r,a);var c=Vl;if(c&&i){var f=ol(c).hoistableStyles,m=ql(i);r=r||"default";var b=f.get(m);if(!b){var C={loading:0,preload:null};if(b=c.querySelector(uo(m)))C.loading=5;else{i=V({rel:"stylesheet",href:i,"data-precedence":r},a),(a=Ji.get(m))&&F1(i,a);var A=b=c.createElement("link");Bt(A),Jt(A,"link",i),A._p=new Promise(function(j,G){A.onload=j,A.onerror=G}),A.addEventListener("load",function(){C.loading|=1}),A.addEventListener("error",function(){C.loading|=2}),C.loading|=4,zu(b,r,c)}b={type:"stylesheet",instance:b,count:1,state:C},f.set(m,b)}}}function B9(i,r){sr.X(i,r);var a=Vl;if(a&&i){var c=ol(a).hoistableScripts,f=$l(i),m=c.get(f);m||(m=a.querySelector(ho(f)),m||(i=V({src:i,async:!0},r),(r=Ji.get(f))&&U1(i,r),m=a.createElement("script"),Bt(m),Jt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}function j9(i,r){sr.M(i,r);var a=Vl;if(a&&i){var c=ol(a).hoistableScripts,f=$l(i),m=c.get(f);m||(m=a.querySelector(ho(f)),m||(i=V({src:i,async:!0,type:"module"},r),(r=Ji.get(f))&&U1(i,r),m=a.createElement("script"),Bt(m),Jt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},c.set(f,m))}}function G3(i,r,a,c){var f=(f=an.current)?co(f):null;if(!f)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=ql(a.href),r=ol(f).hoistableStyles,c=r.get(a),c||(c={type:"style",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=ql(a.href);var m=ol(f).hoistableStyles,b=m.get(i);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,b),(m=f.querySelector(uo(i)))?m._p||(b.instance=m,b.state.loading=5):(m=Ji.get(i),m||(m={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ji.set(i,m)),H9(f,i,m,b.state))),r&&c===null)throw Error(s(528,""));return b}if(r&&c!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(a=$l(a),r=ol(f).hoistableScripts,c=r.get(a),c||(c={type:"script",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function ql(i){return'href="'+$i(i)+'"'}function uo(i){return'link[rel="stylesheet"]['+i+"]"}function X3(i){return V({},i,{"data-precedence":i.precedence,precedence:null})}function H9(i,r,a,c){if(r=i.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[Cc]!==!0){c.loading=1;return}}else r=i.createElement("link"),r[Cc]=!0,r.onload=r.onerror=a_.bind(null,r),Jt(r,"link",a),Bt(r),i.head.appendChild(r);c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2})}function $l(i){return'[src="'+$i(i)+'"]'}function ho(i){return"script[async]"+i}function Z3(i,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=i.querySelector('style[data-href~="'+$i(a.href)+'"]');if(c)return r.instance=c,Bt(c),c;var f=V({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),Bt(c),Jt(c,"style",f),zu(c,a.precedence,i),r.instance=c;case"stylesheet":f=ql(a.href);var m=i.querySelector(uo(f));if(m)return r.state.loading|=4,r.instance=m,Bt(m),m;c=X3(a),(f=Ji.get(f))&&F1(c,f),m=(i.ownerDocument||i).createElement("link"),Bt(m);var b=m;return b._p=new Promise(function(C,A){b.onload=C,b.onerror=A}),Jt(m,"link",c),r.state.loading|=4,zu(m,a.precedence,i),r.instance=m;case"script":return m=$l(a.src),(f=i.querySelector(ho(m)))?(r.instance=f,Bt(f),f):(c=a,(f=Ji.get(m))&&(c=V({},a),U1(c,f)),i=i.ownerDocument||i,f=i.createElement("script"),Bt(f),Jt(f,"link",c),i.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,zu(c,a.precedence,i));return r.instance}function zu(i,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,m=f,b=0;b<c.length;b++){var C=c[b];if(C.dataset.precedence===r)m=C;else if(m!==f)break}m?m.parentNode.insertBefore(i,m.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(i,r.firstChild))}function F1(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function U1(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Bu=null;function Q3(i,r,a){if(Bu===null){var c=new Map,f=Bu=new Map;f.set(a,c)}else f=Bu,c=f.get(a),c||(c=new Map,f.set(a,c));if(c.has(i))return c;for(c.set(i,null),a=a.getElementsByTagName(i),f=0;f<a.length;f++){var m=a[f];if(!(m[ka]||m[Wt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(r)||"";b=i+b;var C=c.get(b);C?C.push(m):c.set(b,[m])}}return c}function V1(i,r,a){i=i.ownerDocument||i,i.head.insertBefore(a,r==="title"?i.querySelector("head > title"):null)}function I9(i,r,a){if(a===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(i=r.disabled,typeof r.precedence=="string"&&i==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function J3(i,r){return i==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function ey(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function ty(i){return(i.width||100)*(i.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function iy(i,r){typeof r.decode=="function"&&(i.imgCount++,r.complete||(i.imgBytes+=ty(r),i.suspenseyImages.push(r)),i=U9.bind(i),r.decode().then(i,i))}function P9(i,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=ql(c.href),m=r.querySelector(uo(f));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=fo.bind(i),r.then(i,i)),a.state.loading|=4,a.instance=m,Bt(m);return}m=r.ownerDocument||r,c=X3(c),(f=Ji.get(f))&&F1(c,f),m=m.createElement("link"),Bt(m);var b=m;b._p=new Promise(function(C,A){b.onload=C,b.onerror=A}),Jt(m,"link",c),a.instance=m}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=fo.bind(i),r.addEventListener("load",a),r.addEventListener("error",a))}}var ju=0;function F9(i,r){return i.stylesheets&&i.count===0&&Iu(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var c=setTimeout(function(){if(i.stylesheets&&Iu(i,i.stylesheets),i.unsuspend){var m=i.unsuspend;i.unsuspend=null,m()}},6e4+r);0<i.imgBytes&&ju===0&&(ju=62500*s9());var f=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Iu(i,i.stylesheets),i.unsuspend)){var m=i.unsuspend;i.unsuspend=null,m()}},(i.imgBytes>ju?50:800)+r);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(f)}}:null}function ny(i){if(i.count===0&&(i.imgCount===0||!i.waitingForImages)){if(i.stylesheets)Iu(i,i.stylesheets);else if(i.unsuspend){var r=i.unsuspend;i.unsuspend=null,r()}}}function fo(){this.count--,ny(this)}function U9(){this.imgCount--,ny(this)}var Hu=null;function Iu(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Hu=new Map,r.forEach(V9,i),Hu=null,fo.call(i))}function V9(i,r){if(!(r.state.loading&4)){var a=Hu.get(i);if(a)var c=a.get(null);else{a=new Map,Hu.set(i,a);for(var f=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),c=b)}c&&a.set(null,c)}f=r.instance,b=f.getAttribute("data-precedence"),m=a.get(b)||c,m===c&&a.set(null,f),a.set(b,f),this.count++,c=fo.bind(this),f.addEventListener("load",c),f.addEventListener("error",c),m?m.parentNode.insertBefore(f,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),r.state.loading|=4}}var Yl={$$typeof:F,Provider:null,Consumer:null,_currentValue:Be,_currentValue2:Be,_threadCount:0};function q9(i,r,a,c,f,m,b,C,A){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xf(0),this.hiddenUpdates=xf(null),this.identifierPrefix=c,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.transitionTypes=null,this.incompleteTransitions=new Map}function ry(i,r,a,c,f,m,b,C,A,j,G,te){return i=new q9(i,r,a,b,A,j,G,te,C),r=1,m===!0&&(r|=24),m=yi(3,null,null,r),i.current=m,m.stateNode=i,r=rd(),r.refCount++,i.pooledCache=r,r.refCount++,m.memoizedState={element:c,isDehydrated:a,cache:r},od(m),i}function sy(i){return i?(i=vl,i):vl}function ly(i,r,a,c,f,m){f=sy(f),c.context===null?c.context=f:c.pendingContext=f,c=Ar(r),c.payload={element:a},m=m===void 0?null:m,m!==null&&(c.callback=m),a=Dr(i,c,r),a!==null&&(xi(a,i,r),Va(a,i,r))}function ay(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<r?a:r}}function q1(i,r){ay(i,r),(i=i.alternate)&&ay(i,r)}function oy(i){if(i.tag===13||i.tag===31){var r=vs(i,67108864);r!==null&&xi(r,i,67108864),q1(i,67108864)}}function cy(i){if(i.tag===13||i.tag===31){var r=Bi();r=Cf(r);var a=vs(i,r);a!==null&&xi(a,i,r),q1(i,r)}}var Kl=!0;function $9(i,r,a,c){var f=fe.T;fe.T=null;var m=Se.p;try{Se.p=2,$1(i,r,a,c)}finally{Se.p=m,fe.T=f}}function Y9(i,r,a,c){var f=fe.T;fe.T=null;var m=Se.p;try{Se.p=8,$1(i,r,a,c)}finally{Se.p=m,fe.T=f}}function $1(i,r,a,c){if(Kl){var f=Y1(c);if(f===null)k1(i,r,c,Pu,a),hy(i,c);else if(W9(f,i,r,a,c))c.stopPropagation();else if(hy(i,c),r&4&&-1<K9.indexOf(i)){for(;f!==null;){var m=al(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=ds(m.pendingLanes);if(b!==0){var C=m;for(C.pendingLanes|=2,C.entangledLanes|=2;b;){var A=1<<31-Ai(b);C.entanglements[1]|=A,b&=~A}Tn(m),(Ge&6)===0&&(Eu=Kt()+500,so(0))}}break;case 31:case 13:C=vs(m,2),C!==null&&xi(C,m,2),Mu(),q1(m,2)}if(m=Y1(c),m===null&&k1(i,r,c,Pu,a),m===f)break;f=m}f!==null&&c.stopPropagation()}else k1(i,r,c,null,a)}}function Y1(i){return i=Of(i),K1(i)}var Pu=null;function K1(i){if(Pu=null,i=ps(i),i!==null){var r=o(i);if(r===null)i=null;else{var a=r.tag;if(a===13){if(i=u(r),i!==null)return i;i=null}else if(a===31){if(i=h(r),i!==null)return i;i=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Pu=i,null}function uy(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(oi()){case qn:return 2;case qi:return 8;case yc:case lw:return 32;case Zg:return 268435456;default:return 32}default:return 32}}var W1=!1,Ur=null,Vr=null,qr=null,po=new Map,mo=new Map,$r=[],K9="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hy(i,r){switch(i){case"focusin":case"focusout":Ur=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":po.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(r.pointerId)}}function go(i,r,a,c,f,m){return i===null||i.nativeEvent!==m?(i={blockedOn:r,domEventName:a,eventSystemFlags:c,nativeEvent:m,targetContainers:[f]},r!==null&&(r=al(r),r!==null&&oy(r)),i):(i.eventSystemFlags|=c,r=i.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),i)}function W9(i,r,a,c,f){switch(r){case"focusin":return Ur=go(Ur,i,r,a,c,f),!0;case"dragenter":return Vr=go(Vr,i,r,a,c,f),!0;case"mouseover":return qr=go(qr,i,r,a,c,f),!0;case"pointerover":var m=f.pointerId;return po.set(m,go(po.get(m)||null,i,r,a,c,f)),!0;case"gotpointercapture":return m=f.pointerId,mo.set(m,go(mo.get(m)||null,i,r,a,c,f)),!0}return!1}function fy(i){var r=ps(i.target);if(r!==null){var a=o(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){i.blockedOn=r,r_(i.priority,function(){cy(a)});return}}else if(r===31){if(r=h(a),r!==null){i.blockedOn=r,r_(i.priority,function(){cy(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Fu(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var a=Y1(i.nativeEvent);if(a===null){a=i.nativeEvent;var c=new a.constructor(a.type,a);Df=c,a.target.dispatchEvent(c),Df=null}else return r=al(a),r!==null&&oy(r),i.blockedOn=a,!1;r.shift()}return!0}function dy(i,r,a){Fu(i)&&a.delete(r)}function G9(){W1=!1,Ur!==null&&Fu(Ur)&&(Ur=null),Vr!==null&&Fu(Vr)&&(Vr=null),qr!==null&&Fu(qr)&&(qr=null),po.forEach(dy),mo.forEach(dy)}function Uu(i,r){i.blockedOn===r&&(i.blockedOn=null,W1||(W1=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,G9)))}var Vu=null;function py(i){Vu!==i&&(Vu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vu===i&&(Vu=null);for(var r=0;r<i.length;r+=3){var a=i[r],c=i[r+1],f=i[r+2];if(typeof c!="function"){if(K1(c||a)===null)continue;break}var m=al(a);m!==null&&(i.splice(r,3),r-=3,Ad(m,{pending:!0,data:f,method:a.method,action:c},c,f))}}))}function Wl(i){function r(A){return Uu(A,i)}Ur!==null&&Uu(Ur,i),Vr!==null&&Uu(Vr,i),qr!==null&&Uu(qr,i),po.forEach(r),mo.forEach(r);for(var a=0;a<$r.length;a++){var c=$r[a];c.blockedOn===i&&(c.blockedOn=null)}for(;0<$r.length&&(a=$r[0],a.blockedOn===null);)fy(a),a.blockedOn===null&&$r.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var f=a[c],m=a[c+1],b=f[vi]||null;if(typeof m=="function")b||py(a);else if(b){var C=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[vi]||null)C=b.formAction;else if(K1(f)!==null)continue}else C=b.action;typeof C=="function"?a[c+1]=C:(a.splice(c,3),c-=3),py(a)}}}function my(){function i(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,f=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function G1(i){this._internalRoot=i}qu.prototype.render=G1.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,c=Bi();ly(a,c,i,r,null,null)},qu.prototype.unmount=G1.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;ly(i.current,2,null,i,null,null),Mu(),r[ll]=null}};function qu(i){this._internalRoot=i}qu.prototype.unstable_scheduleHydration=function(i){if(i){var r=n_();i={blockedOn:null,target:i,priority:r};for(var a=0;a<$r.length&&r!==0&&r<$r[a].priority;a++);$r.splice(a,0,i),a===0&&fy(i)}};var gy=t.version;if(gy!=="19.3.1")throw Error(s(527,gy,"19.3.1"));Se.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=p(r),i=i!==null?_(i):null,i=i===null?null:i.stateNode,i};var X9={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{xa=$u.inject(X9),Mi=$u}catch{}}return vo.createRoot=function(i,r){if(!l(i))throw Error(s(299));var a=!1,c="",f=sv,m=lv,b=av;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(b=r.onRecoverableError)),r=ry(i,1,!1,null,null,a,c,null,f,m,b,my),i[ll]=r.current,E1(i),new G1(r)},vo.hydrateRoot=function(i,r,a){if(!l(i))throw Error(s(299));var c=!1,f="",m=sv,b=lv,C=av,A=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError),a.formState!==void 0&&(A=a.formState)),r=ry(i,1,!0,r,a??null,c,f,A,m,b,C,my),r.context=sy(null),a=r.current,c=Bi(),c=Cf(c),f=Ar(c),f.callback=null,Dr(a,f,c),a=c,r.current.lanes=a,Ea(r,a),Tn(r),i[ll]=r.current,E1(i),new qu(r)},vo.version="19.3.1",vo}var ky;function cC(){if(ky)return Q1.exports;ky=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Q1.exports=oC(),Q1.exports}var am=cC();const uC=pa(am),hC=Zh({__proto__:null,default:uC},[am]);function Xo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class ts extends Error{}class G5 extends ts{}function fC(e){const t=Xo(e);return t===null?!1:t.full===!0?!0:t.full===!1?!1:t.type==="snapshot"}function dC(e){const t=Xo(e);if(t===null)return null;const n=t.seq;return typeof n=="number"&&Number.isFinite(n)?n:null}function yo(e){if(e===void 0)return[];if(!Array.isArray(e))throw new ts("条目字段不是数组");const t=[];for(const n of e){const s=Xo(n),l=s?.id;if(s===null||typeof l!="number"||!Number.isFinite(l))throw new ts("条目缺少数字 id");t.push(s)}return t}function pC(e){if(e===void 0)return[];if(!Array.isArray(e))throw new ts("removedIds 不是数组");const t=[];for(const n of e)typeof n=="number"&&Number.isFinite(n)&&t.push(n);return t}function mC(e,t){const n=Xo(t);if(n===null)throw new ts("帧不是对象");const s=dC(n);if(s===null)throw new ts("帧缺少 seq");const l=fC(n);if(e===null&&!l)throw new ts("第一帧必须是全量帧");if(e!==null){if(s<=e.seq)return e;if(!l&&s>e.seq+1)throw new G5(`帧号跳号:手上有 seq ${String(e.seq)},收到 seq ${String(s)}`)}if(l){const p={};for(const[_,g]of Object.entries(n))_==="entries"||_==="liveEntries"||_==="type"||_==="full"||(p[_]=g);return{...p,seq:s,entries:yo(n.entries),liveEntries:yo(n.liveEntries)}}const o=Xo(n.meta);if(o===null)throw new ts("增量帧缺少 meta");const u=new Map;for(const p of e?.entries??[])u.set(p.id,p);for(const p of pC(n.removedIds))u.delete(p);for(const p of yo(n.updated))u.set(p.id,p);for(const p of yo(n.added))u.set(p.id,p);const h=[...u.values()].sort((p,_)=>p.id-_.id),d="liveEntries"in n?yo(n.liveEntries):e?.liveEntries??[];return{...e??{},...o,seq:s,entries:h,liveEntries:d}}class gC{inFlight=new Map;executed=new Set;failed=new Set;loadShared(t,n){let s=this.inFlight.get(t);return s===void 0&&(s=n.load(t).then(()=>{this.executed.add(t)}).finally(()=>{this.inFlight.delete(t)}),this.inFlight.set(t,s)),s}async arrive(t,n){const s={requests:[],failures:[]};if(n.has(t.id))return s;const l=async u=>{s.requests.push(u);try{await this.loadShared(u,n)}catch(h){return s.failures.push(`${u}: ${h instanceof Error?h.message:String(h)}`),"transport-failed"}return n.has(t.id)?"registered":(s.failures.push(`${u}: 脚本执行了却没有注册「${t.id}」的工厂`),"not-registered")};let o="transport-failed";if(this.failed.has(t.preferred)?s.failures.push(`${t.preferred}: 这个地址上一次已经失败过,跳过`):t.fallback!==void 0&&this.executed.has(t.preferred)?(s.failures.push(`${t.preferred}: 批已经执行过却没注册「${t.id}」,不再重放`),o="not-registered",this.failed.add(t.preferred)):(o=await l(t.preferred),o==="transport-failed"&&(o=await l(t.preferred)),o!=="registered"&&t.fallback!==void 0&&this.failed.add(t.preferred)),o!=="registered"&&t.fallback!==void 0&&(o=await l(t.fallback)),o!=="registered")throw new Error(`插件「${t.id}」取不回来:${s.failures.join(";")}`);return s}}class _C extends Error{constructor(t,n){super(`槽位 ${t} 没有被声明(已声明:${n.length===0?"无":n.join("、")})`)}}class vC extends Error{constructor(t,n,s){super(`槽位 ${t} 已经声明成 ${n},不能再声明成 ${s}`)}}class yC extends Error{constructor(t,n,s,l,o){const u=n===""?"这个槽":`格子 ${n}`;super(`槽位 ${t} 的${u}里已经有 ${l}(priority ${String(s)})。想替换它就把 ${o} 的 priority 调小(例如 ${String(s-1)}),或者换个 id。`)}}class SC extends Error{constructor(t){super(`槽位 ${t} 是 keyed 形态,register 必须给 key(决定这条登记负责哪一格)`)}}class bC extends Error{constructor(t){super(`槽位 ${t} 是 chain 形态,register 必须给 select(这条登记靠它参与选举)`)}}class jn extends Error{}class wC{kinds=new Map;entries=new Map;broken=new Set;listeners=new Set;faultLog=[];faultListeners=new Set;waiters=new Map;seats=new Map;factories=new Map;factoryVersions=new Map;factoryListeners=new Map;winnersCache=new Map;versions=new Map;globalVersion=0;seq=0;declare(t,n){const s=this.kinds.get(t);if(s!==void 0){if(s.kind!==n)throw new vC(t,s.kind,n);s.refs+=1}else this.kinds.set(t,{kind:n,refs:1}),this.runWaiters(t);let l=!1;return()=>{if(l)return;l=!0;const o=this.kinds.get(t);o!==void 0&&(o.refs-=1,!(o.refs>0)&&(this.kinds.delete(t),this.entries.delete(t),this.suspendWaiters(t),this.bump(t)))}}injectSlot(t,n){const s={contribute:n,ran:!1,dispose:null},l=this.waiters.get(t)??new Set;return l.add(s),this.waiters.set(t,l),this.kinds.has(t)&&this.runWaiter(t,s),()=>{l.delete(s),l.size===0&&this.waiters.delete(t),this.suspendWaiter(t,s)}}register(t,n,s){const l=this.kinds.get(t);if(l===void 0)throw new _C(t,this.slots);const o=l.kind==="keyed"?n.key:null;if(l.kind==="keyed"&&(o===void 0||o===""))throw new SC(t);if(l.kind==="chain"&&n.select===void 0)throw new bC(t);const u=n.priority??0,h=l.kind==="chain"?"":l.kind==="list"?n.id:l.kind==="keyed"?o:"",d=this.entries.get(t)??[],p=l.kind==="chain"?void 0:d.find(v=>v.cell===h&&v.priority===u);if(p!==void 0)throw new yC(t,h,u,p.id,n.id);const _=this.declareChildren(n.children),g=n.store??null;g!==null&&this.holdSeat(g);const S={slot:t,id:n.id,order:n.order??0,priority:u,key:o??null,cell:h,children:Object.keys(n.children??{}),select:n.select??null,component:s,store:g,seq:this.seq};return this.seq+=1,this.entries.set(t,[...d,S].sort(om)),this.bump(t),()=>{const v=this.entries.get(t);if(v!==void 0){const w=v.filter(x=>x!==S);w.length!==v.length&&(this.entries.set(t,w),this.broken.delete(S),this.bump(t))}S.store!==null&&this.releaseSeat(S.store);for(const w of _)w()}}elect(t,n){if(this.kinds.get(t)?.kind!=="chain")throw new jn(`槽位 ${t} 不是 chain 形态(elect 只对 chain 有意义)`);const s=[...this.entries.get(t)??Us].sort(Ty);for(const l of s)if(!this.broken.has(l))try{const o=l.select,u=o===null?null:o(n);if(u!=null)return{entry:l,matched:u}}catch(o){this.broken.add(l),this.record({slot:t,id:l.id,phase:"render",error:So(o)}),this.bump(t)}return null}reportFault(t,n){this.broken.has(t)||(this.broken.add(t),this.record({slot:t.slot,id:t.id,phase:"render",error:So(n)}),this.bump(t.slot))}onFault(t){return this.faultListeners.add(t),()=>{this.faultListeners.delete(t)}}get faults(){return this.faultLog}get slots(){return[...this.kinds.keys()]}spec(t){return this.kinds.get(t)?.kind}entriesOf(t){return this.entries.get(t)??Us}winners(t){const n=this.versions.get(t)??0,s=this.winnersCache.get(t);if(s!==void 0&&s.version===n)return s.list;const l=this.kinds.get(t)?.kind,o=this.kinds.has(t)?l==="chain"?[...this.entries.get(t)??Us].filter(u=>!this.broken.has(u)).sort(Ty):xC(this.entries.get(t)??Us,this.broken):Us;return this.winnersCache.set(t,{version:n,list:o}),o}version(t){return this.versions.get(t)??0}getVersion(){return this.globalVersion}subscribe(t,n){const s={slot:n??null,fn:t};return this.listeners.add(s),()=>{this.listeners.delete(s)}}get size(){let t=0;for(const n of this.entries.values())t+=n.length;return t}brokenCount(t){let n=0;for(const s of this.entries.get(t)??[])this.broken.has(s)&&(n+=1);return n}seat(t){const n=this.seats.get(t);if(n!==void 0)return n.instance===void 0&&(n.instance=t.create()),n.instance}registerFactory(t,n){if(this.factories.get(t.name)!==void 0)throw new jn(`装配错误:Factory「${t.name}」已经定义(先注册者还在账上),一个名字只许一个定义`);const l=this.declareChildren(t.children),o=t.store??null;o!==null&&this.holdSeat(o);const u={name:t.name,component:n,children:Object.freeze(Object.keys(t.children??{})),slots:Object.freeze(Object.keys(t.slots??{})),store:o};this.factories.set(t.name,u),this.bumpFactory(t.name);let h=!1;return()=>{if(!h&&(h=!0,this.factories.get(t.name)===u)){this.factories.delete(t.name),this.bumpFactory(t.name),u.store!==null&&this.releaseSeat(u.store);for(const d of l)d()}}}factory(t){return this.factories.get(t)}factoryVersion(t){return this.factoryVersions.get(t)??0}subscribeFactory(t,n){const s=this.factoryListeners.get(t)??new Set;return s.add(n),this.factoryListeners.set(t,s),()=>{s.delete(n),s.size===0&&this.factoryListeners.delete(t)}}reportFactoryFault(t,n,s){this.record({slot:`factory:${t}`,id:n,phase:"render",error:So(s)})}holdSeat(t){const n=this.seats.get(t);n===void 0?this.seats.set(t,{refs:1,instance:void 0}):n.refs+=1}releaseSeat(t){const n=this.seats.get(t);n!==void 0&&(n.refs-=1,!(n.refs>0)&&this.seats.delete(t))}bumpFactory(t){this.factoryVersions.set(t,(this.factoryVersions.get(t)??0)+1);const n=this.factoryListeners.get(t);if(n!==void 0)for(const s of[...n])try{s()}catch(l){console.error(`Factory ${t} 的订阅者抛异常:`,l)}}declareChildren(t){if(t===void 0)return[];const n=[];for(const[s,l]of Object.entries(t))l!==void 0&&n.push(this.declare(s,l));return n}runWaiters(t){const n=this.waiters.get(t);if(n!==void 0)for(const s of[...n])this.runWaiter(t,s)}runWaiter(t,n){if(!n.ran){n.ran=!0;try{const s=n.contribute();n.dispose=typeof s=="function"?s:null}catch(s){this.record({slot:t,id:"",phase:"contribute",error:So(s)})}}}suspendWaiters(t){const n=this.waiters.get(t);if(n!==void 0)for(const s of[...n])this.suspendWaiter(t,s)}suspendWaiter(t,n){if(!n.ran)return;n.ran=!1;const s=n.dispose;if(n.dispose=null,s!==null)try{s()}catch(l){this.record({slot:t,id:"",phase:"dispose",error:So(l)})}}bump(t){this.versions.set(t,(this.versions.get(t)??0)+1),this.globalVersion+=1;for(const n of[...this.listeners])if(!(n.slot!==null&&n.slot!==t))try{n.fn()}catch(s){console.error(`槽位 ${t} 的订阅者抛异常:`,s)}}record(t){this.faultLog=[...this.faultLog,t].slice(-50);for(const n of[...this.faultListeners])try{n(t)}catch(s){console.error("槽位故障监听器抛异常:",s)}}}const Us=Object.freeze([]);function xC(e,t){if(e.length===0)return Us;const n=new Map;for(const s of e){if(t.has(s))continue;const l=n.get(s.cell);(l===void 0||CC(s,l)<0)&&n.set(s.cell,s)}return n.size===0?Us:[...n.values()].sort(om)}function om(e,t){return e.order===t.order?e.seq-t.seq:e.order-t.order}function CC(e,t){return e.priority!==t.priority?e.priority-t.priority:om(e,t)}function Ty(e,t){return e.priority===t.priority?e.seq-t.seq:e.priority-t.priority}function So(e){return e instanceof Error?e:new Error(String(e))}function EC(e){return{spec:e,create(){let t=e.init();const n=new Set,s=o=>{t=o;for(const u of[...n])u()},l={};for(const o of Object.keys(e.actions)){const u=e.actions[o];l[o]=(...h)=>{const d={...t};u(d,...h),s(d)}}return{getSnapshot:()=>t,subscribe:o=>(n.add(o),()=>{n.delete(o)}),actions:l,set:s}}}}function X5(e,t){return{get slots(){return e.slots},spec:n=>e.spec(n),declare:(n,s)=>t(e.declare(n,s)),register:(n,s,l)=>t(e.register(n,s,l)),registerFactory:(n,s)=>t(e.registerFactory(n,s)),seat:n=>e.seat(n),injectSlot:(n,s)=>t(e.injectSlot(n,s)),entriesOf:n=>e.entriesOf(n),winners:n=>e.winners(n)}}class kC extends Error{constructor(t,n,s){super(`服务「${t}」已经由插件 ${n} 提供,插件 ${s} 不能重复提供(一个名字只能有一个提供者)`)}}class TC extends Error{constructor(t){const n=typeof t=="string"?`「${t}」`:String(t);super(`服务名必须是非空字符串,收到的是 ${n}`)}}class Z5{records=new Map;listeners=new Set;provide(t,n,s){if(typeof t!="string"||t==="")throw new TC(t);const l=this.records.get(t);if(l!==void 0)throw new kC(t,l.provider,s);const o={name:t,value:n,provider:s};this.records.set(t,o),this.notify();let u=!1;return()=>{u||(u=!0,this.records.get(t)===o&&(this.records.delete(t),this.notify()))}}consume(t){return this.records.get(t)?.value}has(t){return this.records.has(t)}names(){return[...this.records.keys()]}providerOf(t){return this.records.get(t)?.provider}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(const t of[...this.listeners])try{t()}catch(n){console.error("服务表订阅者抛异常:",n)}}}function MC(e,t,n,s){const l=[];for(const o of e.plugins??[]){const u=t(o);u===void 0?l.push(s?.has(o)===!0?`插件 ${o} 被停用了(在插件中心或 ~/.dsc/plugins.json 里打开)`:`插件 ${o} 不在清单里`):u.ok!==!0&&l.push(`插件 ${o} 没装上:${u.error??"未知原因"}`)}for(const o of e.services??[])n.has(o)||l.push(`服务 ${o} 还没有提供者`);return l}const Q5=I.createContext(null);function AC({services:e,children:t}){return y.jsx(Q5.Provider,{value:e,children:t})}function J5(e){const t=I.useContext(Q5),n=I.useCallback(l=>t===null?()=>{}:t.subscribe(l),[t]),s=I.useCallback(()=>t===null?void 0:t.consume(e),[t,e]);return I.useSyncExternalStore(n,s,s)}function cm(e,t){const n=I.useCallback(l=>e.subscribe(l,t),[e,t]),s=I.useCallback(()=>e.winners(t),[e,t]);return I.useSyncExternalStore(n,s,s)}function eS(e){const t=I.useCallback(s=>e.subscribe(s),[e]),n=I.useCallback(()=>e.faults,[e]);return I.useSyncExternalStore(t,n,n)}function tS(e,t,n=Object.is){const s=I.useRef(t);s.current=t;const l=I.useRef(n);l.current=n;const[o,u]=I.useState(()=>e===void 0?void 0:t(e.getSnapshot())),h=I.useRef(o);return I.useEffect(()=>{if(e===void 0){h.current!==void 0&&(h.current=void 0,u(void 0));return}const d=()=>{const p=s.current(e.getSnapshot());h.current!==void 0&&l.current(h.current,p)||(h.current=p,u(p))};return d(),e.subscribe(d)},[e]),o}function iS(e,t){const n=I.useMemo(()=>t===null?void 0:e.seat(t),[e,t]),s=I.useCallback((l,o)=>tS(n,l,o),[n]);return I.useMemo(()=>{if(t===null)return DC;if(n===void 0)throw new jn("席位的实例不在账上:登记的持有者还在,实例却已释放(装配错误)");return{useStore:s,actions:n.actions}},[t,n,s])}const DC=Object.freeze({}),OC="browser-tab-open-request",RC="browser-tab-close-request",LC=["git-stage","git-unstage","git-commit","git-checkout","git-branch-create"],NC=["term-spawn","term-input","term-kill"];new Set(NC);new Set(LC);const Y0=3,K0=["setWindowChrome","setThemeSource","chooseDirectory","pickDirectory","rememberCwd","switchCwd","recentCwds","removeRecentCwd","openPath","openExternal","openWorkspace","installSkill","installPlugin","installMarketSkill","setMarketSources","setUiTrust","saveProvider","removeProvider","setProviderKey","setConfigFile","pickConfigFile","setPolicy","setReviewer","usePermissionPreset","setDefaultPermissionPreset","sessionUsage","notify","restartHost","quit","terminal","dockBrowser","browserNav","browserClose","checkUpdate","installUpdate"],zC=["dock-data","browser-state","browser-open-requested","update-status","update-progress",OC,RC];new Set(zC);new Set(K0);const BC=/[\u1100-\u11FF\u2E80-\u9FFF\uA000-\uA4CF\uAC00-\uD7FF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/;function jC(e){let t=0,n=0;for(const s of e)BC.test(s)?t+=1:n+=1;return t*.65+n*.33}const HC=["off","low","high","max"],IC=["thinking","reasoning-effort","none"],PC=["text","image","video"],FC="thinking",UC=["off","low","high","max"],VC={off:"关",low:"低",high:"高",max:"最大"},qC={off:"none",low:"low",high:"high",max:"max"},$C={text:"文本",image:"照片",video:"视频"},YC={thinking:{label:"thinking 开关",help:"DeepSeek / GLM 风格:只有开与关,低·高·最大都发 enabled"},"reasoning-effort":{label:"reasoning_effort",help:"OpenAI 与多数网关风格:按档位发线上值,可逐档改名字"},none:{label:"不发思考字段",help:"端点没有思考参数:选哪档都不发,只有「默认」有意义"}},KC={thinkingLevels:[...UC],thinkingParam:FC,effortMap:{},modalities:["text"]},WC=4e6;function My(e){const t=e.charCodeAt(0)===65279?e.slice(1):e;return t===""?[]:(t.endsWith(`
11
+ `)?t.slice(0,-1):t).split(`
12
+ `).map(s=>s.endsWith("\r")?s.slice(0,-1):s)}function GC(e,t){const n=o=>o===""?"none":o.includes(`\r
13
+ `)?"crlf":"lf",s=n(e),l=n(t);return s!=="none"&&l!=="none"&&s!==l}function XC(e,t,n){let s=0;const l=Math.min(e.length,t.length);for(;s<l&&e[s]===t[s];)s+=1;let o=0;for(;o<l-s&&e[e.length-1-o]===t[t.length-1-o];)o+=1;const u=e.length-s-o,h=t.length-s-o,d=s<l||u>0?`第 ${String(s+1)} 行起`:"文件末尾";return{ok:!1,hunks:[],added:Math.max(0,h),removed:Math.max(0,u),note:`${n};从${d}开始不一样:删 ${String(Math.max(0,u))} 行、加 ${String(Math.max(0,h))} 行`,identical:!1,oversize:!0}}function ZC(e,t,n){const s=My(e),l=My(t),o=Math.max(0,Math.min(Math.round(n),50));if(e===t)return{ok:!0,hunks:[],added:0,removed:0,identical:!0,oversize:!1};const u=GC(e,t)?"(顺带改了换行风格:CRLF ↔ LF)":"",h=Math.min(s.length,l.length);let d=0;for(;d<h&&s[d]===l[d];)d+=1;let p=0;for(;p<h-d&&s[s.length-1-p]===l[l.length-1-p];)p+=1;const _=s.slice(d,s.length-p),g=l.slice(d,l.length-p),S=(_.length+1)*(g.length+1);if(_.length>0&&g.length>0&&S>WC)return XC(s,l,`改动区间过大(约 ${String(_.length)} 行 vs ${String(g.length)} 行),只给摘要`);const v=QC(_,g),w=[];let x=d,E=d;for(const R of v)R==="context"?(w.push({kind:"context",text:_[x-d]??"",oldLine:x+1,newLine:E+1}),x+=1,E+=1):R==="remove"?(w.push({kind:"remove",text:_[x-d]??"",oldLine:x+1,newLine:null}),x+=1):(w.push({kind:"add",text:g[E-d]??"",oldLine:null,newLine:E+1}),E+=1);const M=[...s.slice(0,d).map((R,V)=>({kind:"context",text:R,oldLine:V+1,newLine:V+1})),...w,...s.slice(s.length-p).map((R,V)=>({kind:"context",text:R,oldLine:s.length-p+V+1,newLine:l.length-p+V+1}))],P=JC(M,o),N=w.reduce((R,V)=>R+(V.kind==="add"?1:0),0),X=w.reduce((R,V)=>R+(V.kind==="remove"?1:0),0),Q=u===""?void 0:`${u}(逐行差异已忽略行尾风格)`;return{ok:!0,hunks:P,added:N,removed:X,identical:!1,oversize:!1,...Q!==void 0?{note:Q}:{}}}function QC(e,t){const n=e.length,s=t.length;if(n===0)return new Array(s).fill("add");if(s===0)return new Array(n).fill("remove");const l=s+1,o=new Int32Array((n+1)*l);for(let p=n-1;p>=0;p-=1)for(let _=s-1;_>=0;_-=1)o[p*l+_]=e[p]===t[_]?(o[(p+1)*l+_+1]??0)+1:Math.max(o[(p+1)*l+_]??0,o[p*l+_+1]??0);const u=[];let h=0,d=0;for(;h<n&&d<s;)e[h]===t[d]?(u.push("context"),h+=1,d+=1):(o[(h+1)*l+d]??0)>=(o[h*l+d+1]??0)?(u.push("remove"),h+=1):(u.push("add"),d+=1);for(;h<n;)u.push("remove"),h+=1;for(;d<s;)u.push("add"),d+=1;return u}function JC(e,t){const n=e.map((l,o)=>l.kind==="context"?-1:o).filter(l=>l>=0);if(n.length===0)return[];const s=[];for(const l of n){const o=Math.max(0,l-t),u=Math.min(e.length-1,l+t),h=s[s.length-1];h!==void 0&&o<=h.to+1?h.to=Math.max(h.to,u):s.push({from:o,to:u})}return s.map(l=>{const o=e.slice(l.from,l.to+1),u=o[0];return{oldStart:u.oldLine??e[l.from-1]?.oldLine??0,oldCount:o.reduce((h,d)=>h+(d.kind==="add"?0:1),0),newStart:u.newLine??e[l.from-1]?.newLine??0,newCount:o.reduce((h,d)=>h+(d.kind==="remove"?0:1),0),lines:o}})}function nS(e){return e instanceof Error?e.message:String(e)}function rS(e){return e.decodeMs>0?e.decodeTokens/(e.decodeMs/1e3):null}function sS(e){return e.ttftSteps>0?e.ttftMs/e.ttftSteps:null}function lS(e){const t=Math.max(0,e);return t>=10?String(Math.round(t)):String(Math.round(t*10)/10)}function aS(e,t){return e.repo===t.repo&&e.branch===t.branch&&e.detached===t.detached&&e.dirtyFileCount===t.dirtyFileCount}const Ay=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function um(e){const t=[],n=e.split(/\r?\n/);let s=0;for(;s<n.length;){const l=(n[s]??"").match(Ay);if(l===null){s+=1;continue}s+=1;const o=[];let u=Number(l[1]),h=Number(l[3]);for(;s<n.length;){const d=n[s]??"";if(Ay.test(d))break;const p=d.charAt(0);if(p==="\\"){s+=1;continue}if(p===" ")o.push({kind:"context",text:d.slice(1),oldLine:u,newLine:h}),u+=1,h+=1;else if(p==="-")o.push({kind:"remove",text:d.slice(1),oldLine:u,newLine:null}),u+=1;else if(p==="+")o.push({kind:"add",text:d.slice(1),oldLine:null,newLine:h}),h+=1;else break;s+=1}o.length>0&&t.push({oldStart:Number(l[1]),oldCount:o.reduce((d,p)=>d+(p.kind==="add"?0:1),0),newStart:Number(l[3]),newCount:o.reduce((d,p)=>d+(p.kind==="remove"?0:1),0),lines:o})}return t}function oS(e){const t=[],n=e.split(/^diff --git /m).filter(s=>s.trim()!=="");for(const s of n){const l=s.indexOf(`
14
+ `),o=l<0?s:s.slice(0,l),u=o.match(/^a\/(.*) b\/(.*)$/),h=(u!==null?u[2]:o).trim();if(h==="")continue;const d=um(s);if(d.length===0)continue;let p=0,_=0;for(const g of d)for(const S of g.lines)S.kind==="add"?p+=1:S.kind==="remove"&&(_+=1);t.push({path:h,added:p,removed:_,hunks:d})}return t}function ma(e){let t=e;const n=new Set,s=()=>{for(const l of[...n])l()};return{get:()=>t,set:l=>{Object.is(l,t)||(t=l,s())},notify:s,subscribe:l=>(n.add(l),()=>{n.delete(l)})}}function Qh(e){return{"--dsc-icon-size":`${e}px`}}function hm(e){return Qh(e)}function we(e,{size:t=16,className:n},s="0 0 24 24"){return y.jsx("svg",{width:t,height:t,style:Qh(t),viewBox:s,fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:n,"aria-hidden":!0,children:e})}function fm(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 5v14"}),y.jsx("path",{d:"M5 12h14"})]}),e)}function rs(e){return we(y.jsx("path",{d:"M3.5 6.5A1.5 1.5 0 0 1 5 5h4.2c.4 0 .8.16 1.06.44L11.5 6.7h7A1.5 1.5 0 0 1 20 8.2v9.3a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 17.5Z"}),e)}function cS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 9V6.5A1.5 1.5 0 0 1 5.5 5h3.7c.4 0 .78.16 1.06.44L11.5 6.7h7A1.5 1.5 0 0 1 20 8.2V9"}),y.jsx("path",{d:"M2.8 12.6 4.4 8.4A1.2 1.2 0 0 1 5.5 7.6h13a1.2 1.2 0 0 1 1.13 1.55l-1.7 6.1a1.5 1.5 0 0 1-1.44 1.1H4.2a1.5 1.5 0 0 1-1.4-2.05Z"})]}),e)}function cr(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),y.jsx("path",{d:"m20 20-3.8-3.8"})]}),e)}function Jh(e){return we(y.jsx("path",{d:"m6 9.5 6 6 6-6"}),e)}function uS(e){return we(y.jsx("path",{d:"m9.5 6 6 6-6 6"}),e)}function bh(e){return we(y.jsx("path",{d:"m14.5 6-6 6 6 6"}),e)}function hS(e){return we(y.jsx("path",{d:"m6 14.5 6-6 6 6"}),e)}function fS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 19V5"}),y.jsx("path",{d:"m6 11 6-6 6 6"})]}),e)}function dS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4.5 12h14"}),y.jsx("path",{d:"m12.5 6 6 6-6 6"})]}),e)}function pS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M15 3.5h5.5V9"}),y.jsx("path",{d:"M20.5 3.5 14 10"}),y.jsx("path",{d:"M9 20.5H3.5V15"}),y.jsx("path",{d:"M3.5 20.5 10 14"})]}),e)}function mS(e){return we(y.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor",stroke:"none"}),e)}function gS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),y.jsx("path",{d:"M5 15H4.5A1.5 1.5 0 0 1 3 13.5v-9A1.5 1.5 0 0 1 4.5 3h9A1.5 1.5 0 0 1 15 4.5V5"})]}),e)}function _S(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M7 4v13"}),y.jsx("path",{d:"m3.5 7.5 3.5-3.5 3.5 3.5"}),y.jsx("path",{d:"M17 20V7"}),y.jsx("path",{d:"m13.5 16.5 3.5 3.5 3.5-3.5"})]}),e)}function Ys(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),y.jsx("path",{d:"M9.5 4.5v15"})]}),e)}function vS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),y.jsx("path",{d:"M12 7.5V12l3 2"})]}),e)}function yS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 3.5 5 6.2v5.1c0 4.4 3 7.6 7 9.2 4-1.6 7-4.8 7-9.2V6.2Z"}),y.jsx("path",{d:"m9 11.8 2.2 2.2L15.5 9.5"})]}),e)}function ef(e){return we(y.jsx("path",{d:"M10 3.5a2 2 0 0 1 4 0c0 .4-.12.8-.32 1.1h3.82c.55 0 1 .45 1 1v3.1a2 2 0 1 0 0 3.6v3.1c0 .55-.45 1-1 1h-3.32c.2.3.32.7.32 1.1a2 2 0 0 1-4 0c0-.4.12-.8.32-1.1H7a1 1 0 0 1-1-1v-3.1a2 2 0 1 1 0-3.6V5.6c0-.55.45-1 1-1h3.32A1.99 1.99 0 0 1 10 3.5Z"}),e)}function SS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M20.5 12a8.5 8.5 0 1 1-2.6-6.1"}),y.jsx("path",{d:"M20.5 3.5v4h-4"})]}),e)}function bS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 3v8"}),y.jsx("path",{d:"M6.4 6.9a8 8 0 1 0 11.2 0"})]}),e)}function dm(e){return we(y.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"}),e)}function wS(e){return we(y.jsx("circle",{cx:"12",cy:"12",r:"7.5"}),e)}function xS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"12",cy:"12",r:"8.2"}),y.jsx("circle",{cx:"12",cy:"12",r:"3.2"})]}),e)}function CS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("ellipse",{cx:"12",cy:"6.5",rx:"7",ry:"3"}),y.jsx("path",{d:"M5 6.5v5c0 1.66 3.13 3 7 3s7-1.34 7-3v-5"}),y.jsx("path",{d:"M5 11.5v5c0 1.66 3.13 3 7 3s7-1.34 7-3v-5"})]}),e)}function pm(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065z"}),y.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),e)}function ES(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"7",y:"3.5",width:"10",height:"17",rx:"2.2"}),y.jsx("path",{d:"M10.5 6h3"}),y.jsx("circle",{cx:"12",cy:"17.2",r:"0.9",fill:"currentColor",stroke:"none"})]}),e)}function aa(e){return we(y.jsx("path",{d:"M12 2.8 14.2 9l6.2 2.2-6.2 2.2L12 19.6 9.8 13.4 3.6 11.2 9.8 9Z"}),e)}function mm(e){return we(y.jsx("path",{d:"M13.2 2.8 5.4 13.4h5l-1.2 7.8 7.8-10.6h-5Z"}),e)}function kS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 3.2 3.4 8 12 12.8 20.6 8Z"}),y.jsx("path",{d:"M3.4 12.6 12 17.4l8.6-4.8"}),y.jsx("path",{d:"M3.4 16.9 12 21.7l8.6-4.8"})]}),e)}function TS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 3.2 3.4 8v7.6l8.6 4.8 8.6-4.8V8Z"}),y.jsx("path",{d:"M3.4 8 12 12.8 20.6 8"}),y.jsx("path",{d:"M12 12.8v7.6"})]}),e)}function MS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M12 4.9a3.3 3.3 0 0 0-5.3 2.6A3.1 3.1 0 0 0 5.3 12a3.2 3.2 0 0 0 1.4 5.3A3 3 0 0 0 12 19.1Z"}),y.jsx("path",{d:"M12 4.9a3.3 3.3 0 0 1 5.3 2.6 3.1 3.1 0 0 1 1.4 4.5 3.2 3.2 0 0 1-1.4 5.3A3 3 0 0 1 12 19.1Z"})]}),e)}function wh(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"12",cy:"12",r:"9"}),y.jsx("path",{d:"M12 11v5.5"}),y.jsx("circle",{cx:"12",cy:"7.9",r:"0.9",fill:"currentColor",stroke:"none"})]}),e)}function oa(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"12",cy:"12",r:"9"}),y.jsx("path",{d:"M3.2 12h17.6"}),y.jsx("path",{d:"M12 3c2.5 2.4 3.9 5.6 3.9 9s-1.4 6.6-3.9 9c-2.5-2.4-3.9-5.6-3.9-9S9.5 5.4 12 3Z"})]}),e)}function AS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 9.5V19a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V9.5"}),y.jsx("path",{d:"M3.2 9.5 5 4.2h14l1.8 5.3a3 3 0 0 1-5.6 1.6 3 3 0 0 1-5.4 0 3 3 0 0 1-5.6-1.6Z"}),y.jsx("path",{d:"M9.6 20v-4.6h4.8V20"})]}),e)}function DS(e){return we(y.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),e)}function OS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4.5 6.8h15"}),y.jsx("path",{d:"M9.5 6.8V4.6h5v2.2"}),y.jsx("path",{d:"M6.6 6.8 7.5 20a1 1 0 0 0 1 .9h7a1 1 0 0 0 1-.9l.9-13.2"}),y.jsx("path",{d:"M10.4 10.5v6.4M13.6 10.5v6.4"})]}),e)}function xh(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4.5 19.5h4l10-10a2.1 2.1 0 0 0-3-3l-10 10Z"}),y.jsx("path",{d:"M13.5 6.5l3 3"})]}),e)}function tf(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"7",cy:"5.5",r:"2.1"}),y.jsx("circle",{cx:"7",cy:"18.5",r:"2.1"}),y.jsx("circle",{cx:"17",cy:"9.5",r:"2.1"}),y.jsx("path",{d:"M7 7.6v8.8"}),y.jsx("path",{d:"M7 12.2h3.6a4.3 4.3 0 0 0 4.3-4.3V9.5"})]}),e)}function RS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M6.4 3.9h7.2l4 4v12.2H6.4z"}),y.jsx("path",{d:"M13.6 3.9v4h4"}),y.jsx("path",{d:"M9.6 11.1h2.8M11 9.7v2.8"}),y.jsx("path",{d:"M9.6 15.2h2.8"})]}),e)}function LS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"8.2",cy:"12",r:"3.4"}),y.jsx("path",{d:"M11.6 12H20"}),y.jsx("path",{d:"M17 12v3M14.3 12v2.2"})]}),e)}function NS(e){return we(y.jsxs("g",{fill:"currentColor",stroke:"none",children:[y.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),y.jsx("circle",{cx:"12",cy:"12",r:"1.15"}),y.jsx("circle",{cx:"18.5",cy:"12",r:"1.15"})]}),e)}function zS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 7.5h8.5"}),y.jsx("circle",{cx:"16.2",cy:"7.5",r:"2"}),y.jsx("path",{d:"M20.5 7.5h-.3"}),y.jsx("path",{d:"M20 16.5h-8.5"}),y.jsx("circle",{cx:"12.2",cy:"16.5",r:"2"}),y.jsx("path",{d:"M4 16.5h4.3"})]}),e)}function BS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M3.8 4.8h16.4a.8.8 0 0 1 .8.8v2.4H3v-2.4a.8.8 0 0 1 .8-.8Z"}),y.jsx("path",{d:"M5 8v9.4a1.6 1.6 0 0 0 1.6 1.6h10.8A1.6 1.6 0 0 0 19 17.4V8"}),y.jsx("path",{d:"M9.8 11.6h4.4"})]}),e)}function jS({filled:e=!1,...t}){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M9 3h6"}),y.jsx("path",{d:"M10.2 3.4v5.1L7.8 11.9h8.4L13.8 8.5V3.4Z",fill:e?"currentColor":"none"}),y.jsx("path",{d:"M12 12.3v6.3"})]}),t)}function ss(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"3.5",y:"5",width:"17",height:"14",rx:"2"}),y.jsx("path",{d:"m7 9.5 3 2.5-3 2.5"}),y.jsx("path",{d:"M12.5 15H17"})]}),e)}function nf(e){return we(y.jsx("path",{d:"m9 8-4 4 4 4M15 8l4 4-4 4"}),e)}function HS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 20h16"}),y.jsx("path",{d:"M7.5 20v-6"}),y.jsx("path",{d:"M12 20V7.5"}),y.jsx("path",{d:"M16.5 20v-9"})]}),e)}function rf(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4.2 4.5v14"}),y.jsx("path",{d:"M4.2 8h4.3"}),y.jsx("path",{d:"M4.2 15h4.3"}),y.jsx("rect",{x:"8.5",y:"5.6",width:"11.3",height:"4.8",rx:"1.4"}),y.jsx("rect",{x:"8.5",y:"12.6",width:"11.3",height:"4.8",rx:"1.4"})]}),e)}function IS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 7h16"}),y.jsx("path",{d:"M4 12h16"}),y.jsx("path",{d:"M4 17h16"})]}),e)}function PS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"3.8",y:"5.4",width:"16.4",height:"14.2",rx:"2"}),y.jsx("path",{d:"M3.8 9.8h16.4"}),y.jsx("path",{d:"M8.4 3.6v3.4M15.6 3.6v3.4"})]}),e)}function FS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M3.8 4.8h16.4a.8.8 0 0 1 .8.8v2.4H3v-2.4a.8.8 0 0 1 .8-.8Z"}),y.jsx("path",{d:"M5 8v9.4a1.6 1.6 0 0 0 1.6 1.6h10.8A1.6 1.6 0 0 0 19 17.4V8"}),y.jsx("path",{d:"M4 3.6 20 19.6"})]}),e)}function Ch(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M4 6.5h9.5M4 12h9.5M4 17.5h6"}),y.jsx("path",{d:"M17.5 6.5v11"}),y.jsx("path",{d:"m14.6 14.8 2.9 2.9 2.9-2.9"})]}),e)}function US(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),y.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),e)}function VS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("ellipse",{cx:"12",cy:"6",rx:"7.5",ry:"3"}),y.jsx("path",{d:"M4.5 6v12c0 1.66 3.36 3 7.5 3s7.5-1.34 7.5-3V6"}),y.jsx("path",{d:"M4.5 12c0 1.66 3.36 3 7.5 3s7.5-1.34 7.5-3"})]}),e)}function qS(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M7 10.5 10.8 3.6a2 2 0 0 1 2.7 2.5L12.6 9.6h4.9a1.8 1.8 0 0 1 1.74 2.28l-1.3 5.2A2 2 0 0 1 16 18.6H7"}),y.jsx("rect",{x:"3.4",y:"10.5",width:"3.6",height:"8.1",rx:"1"})]}),e)}function $S(e){return we(y.jsxs(y.Fragment,{children:[y.jsx("path",{d:"M17 13.5 13.2 20.4a2 2 0 0 1-2.7-2.5l.9-3.5H6.5a1.8 1.8 0 0 1-1.74-2.28l1.3-5.2A2 2 0 0 1 8 5.4h9"}),y.jsx("rect",{x:"17",y:"5.4",width:"3.6",height:"8.1",rx:"1"})]}),e)}function YS(e){const t=e.size??14;return y.jsx("svg",{width:t,height:t,style:Qh(t),viewBox:"0 0 16 16",fill:"none",className:e.className,"aria-hidden":!0,children:y.jsx("path",{d:"M5.5 4.5C5.5 4.40714 5.52586 4.31612 5.57467 4.23713C5.62349 4.15815 5.69334 4.09431 5.77639 4.05279C5.85945 4.01126 5.95242 3.99368 6.0449 4.00202C6.13738 4.01036 6.22572 4.04429 6.3 4.1L10.967 7.6C11.0291 7.64657 11.0795 7.70697 11.1142 7.77639C11.1489 7.84582 11.167 7.92238 11.167 8C11.167 8.07762 11.1489 8.15418 11.1142 8.22361C11.0795 8.29303 11.0291 8.35343 10.967 8.4L6.3 11.9C6.22572 11.9557 6.13738 11.9896 6.0449 11.998C5.95242 12.0063 5.85945 11.9887 5.77639 11.9472C5.69334 11.9057 5.62349 11.8419 5.57467 11.7629C5.52586 11.6839 5.5 11.5929 5.5 11.5V4.5Z",fill:"currentColor"})})}function KS(e){const t=e.size??16;return y.jsxs("svg",{width:t,height:t,style:Qh(t),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:e.className,"aria-hidden":!0,children:[y.jsx("path",{d:"M2.37091 11.2501C1.58745 9.89288 1.32067 8.29835 1.61969 6.76006C1.91872 5.22177 2.76342 3.8433 3.99826 2.87846C5.2331 1.91362 6.77494 1.42737 8.33988 1.50925C9.90482 1.59113 11.3875 2.23562 12.5149 3.32406C13.6425 4.41269 14.3387 5.87206 14.4754 7.4334C14.612 8.99474 14.18 10.5529 13.2587 11.8209C12.3375 13.0888 10.9891 13.9813 9.46194 14.3337C8.18691 14.628 6.85895 14.5294 5.64989 14.0605C5.1712 13.8748 4.76962 13.4932 4.26534 13.3967C3.67413 13.2835 2.95257 13.5598 2.03794 14.3337"}),y.jsx("path",{d:"M8 5V11"}),y.jsx("path",{d:"M5 8H11"})]})}const W0="#C8801F",WS="#F3B44C",Yu="#34A46F",eE="#2C9CE6",i0="#7C8BA1";function lc(e,t,n,s){return y.jsx("svg",{width:e,height:e,style:hm(e),viewBox:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":!0,children:s})}function GS({size:e=16,className:t}){return lc(e,t,"0 0 24 24",y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"2.5",y:"5.4",width:"9",height:"6.4",rx:"2",fill:W0}),y.jsx("rect",{x:"2.5",y:"8.6",width:"19",height:"11",rx:"3.1",fill:WS})]}))}function XS({size:e=16,className:t}){return lc(e,t,"0 0 24 24",y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"2.5",y:"5.4",width:"9",height:"6.4",rx:"2",fill:W0}),y.jsx("rect",{x:"2.5",y:"8.6",width:"19",height:"11",rx:"3.1",fill:W0}),y.jsx("path",{d:"M3.6 11.8h17.4c.72 0 1.26.68 1.1 1.38l-1.46 5.6c-.23.9-1.04 1.52-1.97 1.52H5.6c-1.2 0-2.13-1.03-1.99-2.22z",fill:WS})]}))}function ZS({size:e=16,className:t}){return lc(e,t,"0 0 24 24",y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"2.9",y:"4.4",width:"18.2",height:"15.2",rx:"3.4",fill:Yu,fillOpacity:"0.16"}),y.jsx("rect",{x:"2.9",y:"4.4",width:"18.2",height:"15.2",rx:"3.4",stroke:Yu,strokeWidth:"1.5"}),y.jsx("path",{d:"m7.2 9.5 2.9 2.5-2.9 2.5",stroke:Yu,strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),y.jsx("path",{d:"M12.7 14.8h4",stroke:Yu,strokeWidth:"1.7",strokeLinecap:"round"})]}))}function QS({size:e=16,className:t}){return lc(e,t,"0 0 24 24",y.jsx("path",{d:"M23.15 2.587 18.21.162a1.494 1.494 0 0 0-1.643.196L3.82 10.02 1.24 7.966 0 8.66v6.68l1.24.694 2.58-2.054 12.747 9.662a1.494 1.494 0 0 0 1.643.196l4.94-2.425A1.5 1.5 0 0 0 24 19.957V4.043a1.5 1.5 0 0 0-.85-1.456ZM18 17.5l-7-5.5 7-5.5v11Z",fill:eE,fillRule:"evenodd",clipRule:"evenodd"}))}function JS({size:e=16,className:t}){return lc(e,t,"0 0 24 24",y.jsxs(y.Fragment,{children:[y.jsx("rect",{x:"8.4",y:"3.2",width:"11.4",height:"13.2",rx:"2.8",fill:i0,fillOpacity:"0.18"}),y.jsx("rect",{x:"8.4",y:"3.2",width:"11.4",height:"13.2",rx:"2.8",stroke:i0,strokeWidth:"1.5"}),y.jsx("path",{d:"M15.4 16.4v1.6a2.8 2.8 0 0 1-2.8 2.8H6.6a2.8 2.8 0 0 1-2.8-2.8V9.6a2.8 2.8 0 0 1 2.8-2.8h1.4",stroke:i0,strokeWidth:"1.5",strokeLinecap:"round"})]}))}const tE='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function e6(e,t){const n=I.useRef(null),s=I.useRef(t);return s.current=t,I.useEffect(()=>{if(!e)return;const l=n.current;if(l===null)return;const o=document.activeElement instanceof HTMLElement?document.activeElement:null,u=()=>Array.from(l.querySelectorAll(tE)).filter(_=>_.offsetParent!==null||_===l),d=l.querySelector("[data-autofocus]")??u()[0]??l;d===l&&l.tabIndex<0&&(l.tabIndex=-1),d.focus({preventScroll:!0});const p=_=>{if(_.key==="Escape"){if(s.current===void 0||_.defaultPrevented)return;_.preventDefault(),_.stopPropagation(),s.current();return}if(_.key!=="Tab")return;const g=u();if(g.length===0){_.preventDefault();return}const S=g[0],v=g[g.length-1],w=document.activeElement;_.shiftKey&&(w===S||w===l)?(_.preventDefault(),v.focus()):!_.shiftKey&&w===v&&(_.preventDefault(),S.focus())};return l.addEventListener("keydown",p),()=>{l.removeEventListener("keydown",p),o!==null&&o.isConnected&&o.focus({preventScroll:!0})}},[e]),{ref:n}}function gm({width:e="100%",height:t=12,radius:n=6,className:s}){const l={width:e,height:t,borderRadius:n};return y.jsx("span",{className:s===void 0?"dsc-skeleton":`dsc-skeleton ${s}`,style:l,"aria-hidden":"true"})}function t6({lines:e=3,gap:t=8,widths:n}){return y.jsx("span",{className:"dsc-skeleton-text",style:{gap:t},"aria-hidden":"true",children:Array.from({length:e},(s,l)=>y.jsx(gm,{width:n?.[l]??(l===e-1?"62%":"100%"),height:11},l))})}function i6({label:e}){return y.jsx("span",{className:"dsc-loading-status",role:"status","aria-live":"polite",children:e})}function n6(e){if(!Number.isFinite(e)||e<0)return"—";if(e<1024)return`${String(Math.round(e))} B`;const t=["KB","MB","GB"];let n=e/1024,s=0;for(;n>=1024&&s<t.length-1;)n/=1024,s+=1;return`${n>=10?String(Math.round(n)):n.toFixed(1).replace(/\.0$/,"")} ${t[s]}`}const _m=Object.freeze([]),sf=Object.freeze([]);function r6(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.cwd;return typeof n=="string"&&n!==""?n:null}function s6(e){const t=e?.sessions;return Array.isArray(t)?t:_m}function l6(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.sessionPath;return typeof n=="string"?n:null}function a6(e){const t=e?.status;if(typeof t!="object"||t===null)return"idle";const n=t.turnState;return typeof n=="string"?n:"idle"}function o6(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.compactingSince;return typeof n=="number"&&Number.isFinite(n)?n:null}function c6(e){const t=e?.entries;return Array.isArray(t)?t:sf}function u6(e){const t=e?.liveEntries;return Array.isArray(t)?t:sf}function h6(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.sessionPath;if(typeof n!="string"||n==="")return null;const s=n.replace(/\\/g,"/").split("/").pop()??"";return s.endsWith(".jsonl")?s.slice(0,-6):s}function iE(e){if(typeof e=="string")return e.trim();if(e instanceof Error)return`${e.name}: ${e.message}`.trim();if(e==null)return"";if(typeof e=="object")try{const t=JSON.stringify(e);if(typeof t=="string"&&t!=="{}")return t.slice(0,800)}catch{}try{return String(e).trim()}catch{return""}}const nE=[{match:/econnrefused|econnreset|failed to fetch|fetch failed|networkerror|network error|load failed/,title:"连不上宿主",hint:"确认 Pneuma 还开着;宿主重启过就刷新这个页面。"},{match:/etimedout|timed? ?out|abort(ed)?|timeout/,title:"等太久了,请求被掐断",hint:"再试一次;一直这样的话把模型服务换一个再试。"},{match:/enoent|no such file|not exist|cannot find the path|找不到/,title:"这个路径不存在了",hint:"确认目录还在,或者重新选一次工作区。"},{match:/eacces|eperm|permission denied|access is denied|没有权限/,title:"系统不允许这一步",hint:"换个有写权限的目录,或者用管理员身份重开一次。"},{match:/401|403|unauthorized|invalid api key|api key/,title:"凭据不对或过期",hint:'到设置 → 模型里重新填一次 key,再点"测试连接"。'},{match:/429|rate limit|too many requests|频繁/,title:"请求太频繁,被服务方限流了",hint:"等十几秒再发;连续撞就把并发降下来。"},{match:/404|not found|没有找到/,title:"对方没有这个东西",hint:"核对一下名字或地址;版本对不上时先在设置里刷新一次清单。"},{match:/413|too large|payload|超过(大小|上限)/,title:"这一份太大了",hint:"换小一点的文件,或者先压缩再试。"},{match:/500|502|503|504|internal server error|bad gateway/,title:"对方服务自己出错了",hint:"过一会儿再试;一直这样就是服务方的问题,不是你操作错了。"}];function lf(e,t="这一步没有完成"){const n=iE(e),s=n.toLowerCase();for(const o of nE)if(o.match.test(s))return{title:o.title,hint:o.hint,detail:n};const l=(n.split(/\r?\n/)[0]??"").replace(/^error:\s*/i,"").trim();return{title:l===""?t:l,hint:"再试一次;还不行就把这段原文发出来,好定位。",detail:n}}function f6(e,t){const{title:n,hint:s}=lf(e,t);return`${n}——${s}`}function d6(e,t){const{title:n,hint:s,detail:l}=lf(e,t);return{text:`${n}。${s}`,detail:l}}function p6(e){return y.jsx("span",{className:e.className,children:e.children})}const rE="modulepreload",sE=function(e,t){return new URL(e,t).href},Dy={},_e=function(t,n,s){let l=Promise.resolve();if(n&&n.length>0){let p=function(_){return Promise.all(_.map(g=>Promise.resolve(g).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const u=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),d=h?.nonce||h?.getAttribute("nonce");l=p(n.map(_=>{if(_=sE(_,s),_ in Dy)return;Dy[_]=!0;const g=_.endsWith(".css"),S=g?'[rel="stylesheet"]':"";if(s)for(let w=u.length-1;w>=0;w--){const x=u[w];if(x.href===_&&(!g||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${S}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":rE,g||(v.as="script"),v.crossOrigin="",v.href=_,d&&v.setAttribute("nonce",d),document.head.appendChild(v),g)return new Promise((w,x)=>{v.addEventListener("load",w),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${_}`)))})}))}function o(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return l.then(u=>{for(const h of u||[])h.status==="rejected"&&o(h.reason);return t().catch(o)})},vm={ts:"typescript",mts:"typescript",cts:"typescript",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",tsx:"tsx",json:"json",jsonc:"jsonc",json5:"json5",md:"markdown",mdx:"mdx",py:"python",pyi:"python",rs:"rust",go:"go",java:"java",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",hh:"cpp",cs:"csharp",kt:"kotlin",kts:"kotlin",swift:"swift",php:"php",rb:"ruby",lua:"lua",scala:"scala",sh:"shellscript",bash:"shellscript",zsh:"shellscript",ps1:"powershell",psm1:"powershell",bat:"bat",cmd:"bat",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",env:"dotenv",html:"html",htm:"html",xml:"xml",svg:"xml",xaml:"xml",csproj:"xml",props:"xml",css:"css",scss:"scss",sass:"sass",less:"less",vue:"vue",svelte:"svelte",astro:"astro",sql:"sql",graphql:"graphql",gql:"graphql",proto:"proto",m:"objective-c",mm:"objective-cpp",dart:"dart",r:"r",jl:"julia",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",clj:"clojure",cljs:"clojure",pl:"perl",pm:"perl",zig:"zig",sol:"solidity",fs:"fsharp",diff:"diff",patch:"diff",log:"log",rst:"rst",tex:"latex",makefile:"makefile",mk:"makefile"};function lE(e){return e.slice(Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"))+1)}function af(e){const t=lE(e).toLowerCase(),n=t.includes(".")?t.slice(t.lastIndexOf(".")+1):t;return vm[n]}const ym={typescript:()=>_e(()=>import("./chunk-BPQ3VLAy.js"),[],import.meta.url),tsx:()=>_e(()=>import("./chunk-COt5Ahok.js"),[],import.meta.url),javascript:()=>_e(()=>import("./chunk-wDzz0qaB.js"),[],import.meta.url),jsx:()=>_e(()=>import("./chunk-g9-lgVsj.js"),[],import.meta.url),json:()=>_e(()=>import("./chunk-Cp-IABpG.js"),[],import.meta.url),jsonc:()=>_e(()=>import("./chunk-Des-eS-w.js"),[],import.meta.url),json5:()=>_e(()=>import("./chunk-C9tS-k6U.js"),[],import.meta.url),markdown:()=>_e(()=>import("./chunk-Cvjx9yec.js"),[],import.meta.url),mdx:()=>_e(()=>import("./chunk-Cmh6b_Ma.js"),[],import.meta.url),python:()=>_e(()=>import("./chunk-B6aJPvgy.js"),[],import.meta.url),rust:()=>_e(()=>import("./chunk-DPvrY3IQ.js"),[],import.meta.url),go:()=>_e(()=>import("./chunk-C27-OAKa.js"),[],import.meta.url),java:()=>_e(()=>import("./chunk-CylS5w8V.js"),[],import.meta.url),c:()=>_e(()=>import("./chunk-BIGW1oBm.js"),[],import.meta.url),cpp:()=>_e(()=>import("./chunk-DlC-OlHO.js"),__vite__mapDeps([0,1]),import.meta.url),csharp:()=>_e(()=>import("./chunk-B_TYUkTI.js"),[],import.meta.url),kotlin:()=>_e(()=>import("./chunk-BdnUsdx6.js"),[],import.meta.url),swift:()=>_e(()=>import("./chunk-C2oV4EkX.js"),[],import.meta.url),php:()=>_e(()=>import("./chunk-D38fbIBN.js"),__vite__mapDeps([2,3,4,5,6,7,8,9]),import.meta.url),ruby:()=>_e(()=>import("./chunk-ySF7HWmS.js"),__vite__mapDeps([10,3,4,5,6,7,8,11,12,13,14,0,1,15,16,17]),import.meta.url),lua:()=>_e(()=>import("./chunk-CPTIWCL2.js"),__vite__mapDeps([16,1]),import.meta.url),scala:()=>_e(()=>import("./chunk-CqE71os6.js"),[],import.meta.url),shellscript:()=>_e(()=>import("./chunk-Yzrsuije.js"),[],import.meta.url),bat:()=>_e(()=>import("./chunk-CickPsom.js"),[],import.meta.url),powershell:()=>_e(()=>import("./chunk-Dd0kTxKP.js"),[],import.meta.url),yaml:()=>_e(()=>import("./chunk-Buea-lGh.js"),[],import.meta.url),toml:()=>_e(()=>import("./chunk-vGWfd6FD.js"),[],import.meta.url),ini:()=>_e(()=>import("./chunk-BEwlwnbL.js"),[],import.meta.url),dotenv:()=>_e(()=>import("./chunk-De0Btta0.js"),[],import.meta.url),html:()=>_e(()=>import("./chunk-C0m74zRD.js"),__vite__mapDeps([3,4,5]),import.meta.url),xml:()=>_e(()=>import("./chunk-B_vNuMnf.js"),__vite__mapDeps([6,7]),import.meta.url),css:()=>_e(()=>import("./chunk-Z72CF80r.js"),[],import.meta.url),scss:()=>_e(()=>import("./chunk-DNasK_ZG.js"),__vite__mapDeps([18,5]),import.meta.url),sass:()=>_e(()=>import("./chunk-Cj5Yp3dK.js"),[],import.meta.url),less:()=>_e(()=>import("./chunk-B1dDrJ26.js"),[],import.meta.url),vue:()=>_e(()=>import("./chunk-C9GSunVT.js"),__vite__mapDeps([19,5,4,12,9,3,20]),import.meta.url),svelte:()=>_e(()=>import("./chunk-DJeabLx-.js"),__vite__mapDeps([21,4,12,5,22]),import.meta.url),astro:()=>_e(()=>import("./chunk-CQLl-L-p.js"),__vite__mapDeps([23,9,4,12,5,22,14]),import.meta.url),sql:()=>_e(()=>import("./chunk-DkvoVjww.js"),[],import.meta.url),graphql:()=>_e(()=>import("./chunk-GwR3hkPK.js"),__vite__mapDeps([11,4,12,13,14]),import.meta.url),proto:()=>_e(()=>import("./chunk-C7zT0LnQ.js"),[],import.meta.url),"objective-c":()=>_e(()=>import("./chunk-DXmwc3jG.js"),[],import.meta.url),"objective-cpp":()=>_e(()=>import("./chunk-CLxacb5B.js"),[],import.meta.url),dart:()=>_e(()=>import("./chunk-CtKP3W-j.js"),[],import.meta.url),r:()=>_e(()=>import("./chunk-Cf5RLm7j.js"),[],import.meta.url),julia:()=>_e(()=>import("./chunk-C0PvZCCE.js"),__vite__mapDeps([24,0,1,25,4,26,8]),import.meta.url),elixir:()=>_e(()=>import("./chunk-BX6H_ySx.js"),__vite__mapDeps([27,3,4,5]),import.meta.url),erlang:()=>_e(()=>import("./chunk-CWanVSXC.js"),__vite__mapDeps([28,29]),import.meta.url),haskell:()=>_e(()=>import("./chunk-Df6bDoY_.js"),[],import.meta.url),clojure:()=>_e(()=>import("./chunk-P80f7IUj.js"),[],import.meta.url),perl:()=>_e(()=>import("./chunk-B_P3UbPa.js"),__vite__mapDeps([30,3,4,5,6,7,8]),import.meta.url),zig:()=>_e(()=>import("./chunk-VOosw3JB.js"),[],import.meta.url),solidity:()=>_e(()=>import("./chunk-DijEV5ha.js"),[],import.meta.url),fsharp:()=>_e(()=>import("./chunk-DNSN1z5r.js"),__vite__mapDeps([31,29]),import.meta.url),diff:()=>_e(()=>import("./chunk-D97Zzqfu.js"),[],import.meta.url),log:()=>_e(()=>import("./chunk-2UxHyX5q.js"),[],import.meta.url),rst:()=>_e(()=>import("./chunk-DHK4yRfg.js"),__vite__mapDeps([32,20,3,4,5,0,1,25,15,17,10,6,7,8,11,12,13,14,16]),import.meta.url),latex:()=>_e(()=>import("./chunk-EXT84bkm.js"),__vite__mapDeps([33,26]),import.meta.url),makefile:()=>_e(()=>import("./chunk-CHLpvVh8.js"),[],import.meta.url)};let Oy=null;const Zo=new Set,aE={ts:"typescript",js:"javascript",py:"python",rb:"ruby",sh:"shellscript",bash:"shellscript",zsh:"shellscript",yml:"yaml",ps1:"powershell",cs:"csharp","c++":"cpp",golang:"go"};function m6(e){return ym[e]!==void 0?e:aE[e]??e}function ga(){return Oy??=_e(()=>import("./chunk-DGX-i4eb.js"),[],import.meta.url).then(async e=>e.createHighlighterCore({themes:[_e(()=>import("./chunk-DAi9KRSo.js"),[],import.meta.url),_e(()=>import("./chunk-CxGP3dtY.js"),[],import.meta.url)],langs:[],engine:(await _e(async()=>{const{createJavaScriptRegexEngine:t}=await import("./chunk-BRH0KZbk.js");return{createJavaScriptRegexEngine:t}},[],import.meta.url)).createJavaScriptRegexEngine()})),Oy}async function ac(e){if(Zo.has(e))return;const t=ym[e];if(t===void 0)return;const n=await t();await(await ga()).loadLanguage(n.default),Zo.add(e)}async function Sm(e,t){const n=await ga(),s=t===void 0?void 0:m6(t),l=s!==void 0&&(Zo.has(s)||ym[s]!==void 0),o=l&&s!==void 0?s:"text";return l&&s!==void 0&&!Zo.has(s)&&await ac(s),n.codeToHtml(e,{lang:o,themes:{light:"github-light",dark:"one-dark-pro"},defaultColor:!1})}async function bm(e,t){if(t===void 0)return null;const n=m6(t);if(await ac(n),!Zo.has(n))return null;const s=await ga();try{return s.codeToTokens(e,{lang:n,themes:{light:"github-light",dark:"one-dark-pro"},defaultColor:!1}).tokens.map(o=>o.map(u=>({text:u.content,style:u.htmlStyle??(u.color===void 0?{}:{color:u.color})})))}catch{return null}}const oE=2e3,cE=512*1024;async function wm(e,t){const n=af(t);if(n===void 0||e.split(`
15
+ `).length>oE||e.length>cE)return null;try{return await ac(n),(await ga()).codeToTokens(e,{lang:n,themes:{light:"github-light",dark:"one-dark-pro"},defaultColor:!1}).tokens.map(u=>({segments:u.map(h=>{const d=h.htmlStyle??{color:h.color};return`<span style="${Object.entries(d).map(([_,g])=>`${_}:${g}`).join(";")}">${hE(h.content)}</span>`})}))}catch{return null}}const uE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function hE(e){return e.replace(/[&<>"']/g,t=>uE[t]??t)}const n0=5e3;function g6({text:e,path:t,targetLine:n}){const s=I.useMemo(()=>af(t),[t]),l=I.useMemo(()=>e.split(`
16
+ `),[e]),o=l.length>n0,u=I.useMemo(()=>o?l.slice(0,n0).join(`
17
+ `):e,[l,e,o]),[h,d]=I.useState(null),p=I.useRef(null);I.useEffect(()=>{let g=!0;return Sm(u,s).then(S=>{g&&d(S)}).catch(()=>{}),()=>{g=!1}},[u,s]),I.useEffect(()=>{if(n===void 0)return;const g=p.current;if(g===null)return;g.querySelectorAll(".file-code-line-target").forEach(x=>x.classList.remove("file-code-line-target"));const S=g.querySelectorAll(".line"),v=Math.min(Math.max(n,1),S.length),w=S[v-1];w!==void 0&&(w.classList.add("file-code-line-target"),w.scrollIntoView({block:"center"}))},[h,n,u]);const _=n!==void 0;return y.jsxs("div",{className:_?"file-code file-code--numbered":"file-code",children:[o&&y.jsxs("div",{className:"tree-note","data-tree-note":"truncated",children:["文件较大,仅高亮前 ",n0," 行"]}),h!==null?y.jsx("div",{ref:g=>{p.current=g},className:"file-code-body",dangerouslySetInnerHTML:{__html:h}}):y.jsx("pre",{ref:g=>{p.current=g},className:"file-code-plain",children:u.split(`
18
+ `).map((g,S)=>y.jsx("span",{className:"line",children:`${g}
19
+ `},S))})]})}function _6(e,t){for(let n=e.length-1;n>=0;n-=1){const s=e[n];if(t(s,n))return s}}function Pt(e,t,n,s){const l=e.createOscillator(),o=e.createGain(),u=n+(s.start??0),h=s.gain??.5,d=s.attack??.006,p=u+s.dur;l.type=s.type??"sine",l.frequency.setValueAtTime(s.freq,u),o.gain.setValueAtTime(1e-4,u),o.gain.exponentialRampToValueAtTime(Math.max(h,2e-4),u+d),o.gain.exponentialRampToValueAtTime(1e-4,p),l.connect(o),o.connect(t),l.start(u),l.stop(p+.02)}function Ry(e,t,n,s){const l=e.createOscillator(),o=e.createGain(),u=n+(s.start??0),h=s.attack??.004,d=s.glide??.16,p=u+s.decay;l.type="triangle",l.frequency.setValueAtTime(s.freqFrom,u),l.frequency.exponentialRampToValueAtTime(s.freqTo,u+d),o.gain.setValueAtTime(1e-4,u),o.gain.exponentialRampToValueAtTime(Math.max(s.gain,2e-4),u+h),o.gain.exponentialRampToValueAtTime(1e-4,p),l.connect(o),o.connect(t),l.start(u),l.stop(p+.02)}function Kr(e,t,n,s){const l=e.createOscillator(),o=e.createGain(),u=n+(s.start??0),h=s.hold??.08,d=u+s.attack+h+s.decay;l.type=s.type??"sine",l.frequency.setValueAtTime(s.freq,u),s.freqTo!==void 0&&l.frequency.exponentialRampToValueAtTime(s.freqTo,u+s.attack+h*.6),l.detune.setValueAtTime(s.detune??0,u),o.gain.setValueAtTime(1e-4,u),o.gain.exponentialRampToValueAtTime(Math.max(s.gain,2e-4),u+s.attack),o.gain.setValueAtTime(Math.max(s.gain,2e-4),u+s.attack+h),o.gain.exponentialRampToValueAtTime(1e-4,d),l.connect(o),o.connect(t),l.start(u),l.stop(d+.02)}function v6(e,t){const n=Math.floor(e.sampleRate*t),s=e.createBuffer(1,n,e.sampleRate),l=s.getChannelData(0);for(let u=0;u<n;u+=1)l[u]=Math.random()*2-1;const o=e.createBufferSource();return o.buffer=s,o}function Ly(e,t,n,s){const l=v6(e,.12),o=e.createBiquadFilter(),u=e.createGain(),h=n+(s.start??0),d=h+s.decay;o.type="bandpass",o.frequency.setValueAtTime(s.freq,h),o.Q.setValueAtTime(s.q??1.2,h),u.gain.setValueAtTime(1e-4,h),u.gain.exponentialRampToValueAtTime(Math.max(s.gain,2e-4),h+.018),u.gain.exponentialRampToValueAtTime(1e-4,d),l.connect(o),o.connect(u),u.connect(t),l.start(h),l.stop(d+.02)}function fE(e,t,n,s){const l=v6(e,.4),o=e.createBiquadFilter(),u=e.createGain(),h=n+(s.start??0),d=h+s.decay;o.type="bandpass",o.frequency.setValueAtTime(s.freqFrom,h),o.frequency.exponentialRampToValueAtTime(s.freqTo,d),o.Q.setValueAtTime(s.q??.8,h),u.gain.setValueAtTime(1e-4,h),u.gain.exponentialRampToValueAtTime(Math.max(s.gain,2e-4),h+.03),u.gain.exponentialRampToValueAtTime(1e-4,d),l.connect(o),o.connect(u),u.connect(t),l.start(h),l.stop(d+.02)}function Ny(e,t,n,s){const l=e.createOscillator(),o=e.createGain(),u=n+(s.start??0),h=s.attack??.003,d=u+s.decay;l.type=s.type??"triangle",l.frequency.setValueAtTime(s.freqFrom,u),l.frequency.exponentialRampToValueAtTime(s.freqTo,d-.02),o.gain.setValueAtTime(1e-4,u),o.gain.exponentialRampToValueAtTime(Math.max(s.gain,2e-4),u+h),o.gain.exponentialRampToValueAtTime(1e-4,d),l.connect(o),o.connect(t),l.start(u),l.stop(d+.02)}let Ku=null;function dE(e){if(Ku===null){const s=Math.floor(e.sampleRate*1.6);Ku=e.createBuffer(2,s,e.sampleRate);for(let l=0;l<2;l+=1){const o=Ku.getChannelData(l);for(let u=0;u<s;u+=1)o[u]=(Math.random()*2-1)*(1-u/s)**2.6}}const t=e.createConvolver();return t.buffer=Ku,t}const pE=110,r0=220,mE=440,s0=880,gE=987.77,_E=130.81,l0=261.63,a0=329.63,Gl=659.25,vE=1318.51,yE=392,Xl=783.99,o0=523.25,bo=1046.5,xm=[{id:1,name:"双音轻抚",play:(e,t,n)=>{Pt(e,t,n,{freq:a0,dur:.22,gain:.05,attack:.03,type:"sine"}),Pt(e,t,n+.08,{freq:l0,dur:.52,gain:.07,attack:.08,type:"sine"}),Pt(e,t,n+.08,{freq:_E,dur:.46,gain:.02,attack:.1,type:"sine"})}},{id:2,name:"玻璃清鸣",play:(e,t,n)=>{Pt(e,t,n,{freq:bo,dur:.55,gain:.032,attack:.002,type:"sine"}),Pt(e,t,n+.01,{freq:Gl,dur:.42,gain:.018,attack:.004,type:"sine"}),Ly(e,t,n,{freq:3200,gain:.004,decay:.1,q:1.4})}},{id:3,name:"柔木琴",play:(e,t,n)=>{Ry(e,t,n,{freqFrom:Gl,freqTo:Xl,gain:.03,decay:.14,glide:.08}),Kr(e,t,n+.04,{freq:o0,gain:.028,attack:.08,hold:.04,decay:.62}),Kr(e,t,n+.06,{freq:yE,gain:.014,attack:.12,hold:.06,decay:.55})}},{id:4,name:"三音讯号",play:(e,t,n)=>{Pt(e,t,n,{freq:bo,dur:.14,gain:.045,attack:.004,type:"sine"}),Pt(e,t,n+.1,{freq:s0,dur:.16,gain:.04,attack:.004,type:"sine"}),Pt(e,t,n+.2,{freq:Xl,dur:.22,gain:.035,attack:.006,type:"sine"})}},{id:5,name:"风声掠过",play:(e,t,n)=>{fE(e,t,n,{freqFrom:4200,freqTo:900,gain:.022,decay:.28,q:.7}),Pt(e,t,n+.12,{freq:s0,dur:.35,gain:.02,attack:.02,type:"sine"})}},{id:6,name:"发现之簇",play:(e,t,n)=>{[-14,-5,0,7,12].forEach((l,o)=>{Kr(e,t,n+o*.03,{freq:r0,gain:.012,attack:.38,hold:.12,decay:1.05,detune:l})}),Kr(e,t,n+.1,{freq:a0,gain:.008,attack:.45,hold:.08,decay:.9,detune:3})}},{id:7,name:"系统上线",play:(e,t,n)=>{Pt(e,t,n,{freq:o0,dur:.16,gain:.04,attack:.006,type:"sine"}),Pt(e,t,n+.09,{freq:Xl,dur:.28,gain:.042,attack:.008,type:"sine"}),Pt(e,t,n+.09,{freq:l0,dur:.24,gain:.012,attack:.01,type:"sine"})}},{id:8,name:"老式终端",play:(e,t,n)=>{Pt(e,t,n,{freq:gE,dur:.12,gain:.038,attack:.002,type:"square"}),Pt(e,t,n+.14,{freq:Gl,dur:.1,gain:.028,attack:.002,type:"square"})}},{id:9,name:"调制解调",play:(e,t,n)=>{Ny(e,t,n,{freqFrom:320,freqTo:2200,gain:.024,decay:.16,type:"triangle"}),Ny(e,t,n+.1,{freqFrom:480,freqTo:1400,gain:.014,decay:.12,type:"sine"})}},{id:10,name:"风铃",play:(e,t,n)=>{[Xl,bo,Gl,s0].forEach((l,o)=>{Pt(e,t,n+o*.13,{freq:l,dur:.72,gain:.028-o*.003,attack:.003,type:"sine"})})}},{id:11,name:"颂钵",play:(e,t,n)=>{Kr(e,t,n,{freq:r0,gain:.022,attack:.58,hold:.16,decay:1.35}),Kr(e,t,n+.08,{freq:a0,gain:.01,attack:.62,hold:.12,decay:1.2,detune:4}),Kr(e,t,n+.14,{freq:mE,gain:.006,attack:.68,hold:.08,decay:1.05,detune:-3})}},{id:12,name:"竖琴拾音",play:(e,t,n)=>{[o0,Gl,Xl,bo].forEach((l,o)=>{Pt(e,t,n+o*.075,{freq:l,dur:.38,gain:.034-o*.004,attack:.012,type:"sine"})}),Kr(e,t,n+.2,{freq:l0,gain:.01,attack:.18,hold:.06,decay:.7})}},{id:13,name:"声呐",play:(e,t,n)=>{Pt(e,t,n,{freq:pE,dur:.95,gain:.036,attack:.008,type:"sine"}),Pt(e,t,n+.42,{freq:r0,dur:.55,gain:.014,attack:.01,type:"sine"}),Ly(e,t,n,{freq:600,gain:.005,decay:.2,q:.5})}},{id:14,name:"八音盒",play:(e,t,n)=>{[vE,bo,Xl,Gl].forEach((l,o)=>{Ry(e,t,n+o*.09,{freqFrom:l,freqTo:l*.998,gain:.02-o*.002,decay:.2,glide:.06})})}}];let wo=null;function SE(){if(typeof window>"u")return null;try{if(wo===null){const e=window.AudioContext??window.webkitAudioContext;if(e===void 0)return null;wo=new e}return wo.state==="suspended"&&wo.resume().catch(()=>{}),wo}catch{return null}}function bE(e){const t=xm.find(d=>d.id===e);if(t===void 0)return;const n=SE();if(n===null)return;const s=n.createGain(),l=n.createBiquadFilter();l.type="lowpass",l.frequency.setValueAtTime(3800,n.currentTime),l.Q.setValueAtTime(.32,n.currentTime),s.gain.setValueAtTime(.48,n.currentTime),s.connect(l);const o=n.createGain();o.gain.setValueAtTime(.88,n.currentTime),l.connect(o),o.connect(n.destination);const u=dE(n),h=n.createGain();h.gain.setValueAtTime(.34,n.currentTime),l.connect(u),u.connect(h),h.connect(n.destination),t.play(n,s,n.currentTime+.01)}function y6(e){bE(e)}let Wu=null;function S6(e){return Wu?.settle(),new Promise(t=>{const n=document.activeElement instanceof HTMLElement?document.activeElement:null,s=document.createElement("div");s.className="dsc-overlay dsc-confirm",s.setAttribute("role","alertdialog"),s.setAttribute("aria-modal","true");const l=document.createElement("div");l.className="dsc-overlay__card",l.style.setProperty("--card-w","24rem");const o=document.createElement("div");o.className="dsc-confirm__body";const u=document.createElement("h3");u.className="dsc-confirm__title",u.id="dsc-confirm-title",u.textContent=e.title;const h=document.createElement("p");h.className="dsc-confirm__detail",h.id="dsc-confirm-detail",h.textContent=e.detail,o.append(u,h);const d=document.createElement("div");d.className="dsc-confirm__actions";const p=document.createElement("button");p.className="dsc-btn",p.type="button",p.dataset.variant="secondary",p.dataset.size="sm",p.textContent="取消";const _=document.createElement("button");_.className="dsc-btn",_.type="button",_.dataset.variant=e.danger===!0?"destructive":"primary",_.dataset.size="sm",_.textContent=e.confirmLabel,d.append(p,_),l.append(o,d),s.append(l),s.setAttribute("aria-labelledby","dsc-confirm-title"),s.setAttribute("aria-describedby","dsc-confirm-detail");const g=E=>{if(E.key==="Escape"){E.stopPropagation(),x(!1);return}E.key==="Tab"&&(E.preventDefault(),(document.activeElement===p?_:p).focus())},S=E=>{E.target===s&&x(!1)},v={settle:()=>x(!1)};let w=!1;const x=E=>{w||(w=!0,document.removeEventListener("keydown",g,!0),s.removeEventListener("pointerdown",S),s.remove(),Wu===v&&(Wu=null),n!==null&&n.isConnected&&n.focus(),t(E))};Wu=v,document.addEventListener("keydown",g,!0),s.addEventListener("pointerdown",S),p.addEventListener("click",()=>x(!1)),_.addEventListener("click",()=>x(!0)),document.body.appendChild(s),p.focus()})}let xo;function wE(){return xo===void 0&&(xo=document.createElement("div"),xo.style.cssText="position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;pointer-events:none",document.documentElement.append(xo)),xo}function Eh(e){return typeof document>"u"?null:Cm(Z0(e))}function b6(e,t){if(typeof document>"u")return t;const n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return n===""?t:n}function G0(e){const t=/^(rgb|color)\((.+)\)$/i.exec(e.trim());if(!t)return null;const n=t[1].toLowerCase()==="color",l=(n?t[2].replace(/^\s*srgb\s+/i,""):t[2]).split(/[,/\s]+/).filter(h=>h!=="").map(Number);if(l.length<3||l.slice(0,4).some(h=>!Number.isFinite(h)))return null;const o=n?255:1,u=h=>Math.min(255,Math.max(0,h*o));return{r:u(l[0]),g:u(l[1]),b:u(l[2]),a:l.length>3?Math.min(1,Math.max(0,l[3])):1}}function X0(e){const t=n=>Math.round(n).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function xE(e,t){const n=(s,l)=>s*e.a+l*(1-e.a);return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function Cm(e){const t=G0(e);return t===null||t.a<.999?null:X0(t)}function Z0(e){const t=wE();return t.style.backgroundColor=`var(${e})`,getComputedStyle(t).backgroundColor}function w6(e,t,n){if(typeof document>"u")return n;const s=G0(Z0(e));if(s===null)return n;if(s.a>=.999)return X0(s);const l=G0(Z0(t));return X0(l===null?s:xE(s,l))}function x6({text:e,highlight:t}){return t===void 0?y.jsx("span",{className:"diff-text",children:e}):y.jsx("span",{className:"diff-text",dangerouslySetInnerHTML:{__html:t.segments.join("")}})}function CE({line:e,highlight:t}){const n=e.kind==="add"?"add":e.kind==="remove"?"del":"ctx";return y.jsxs("div",{className:`diff-line diff-${n}`,children:[y.jsx("span",{className:"diff-no",children:e.oldLine===null?"":String(e.oldLine)}),y.jsx("span",{className:"diff-no",children:e.newLine===null?"":String(e.newLine)}),y.jsx("span",{className:"diff-sign",children:e.kind==="add"?"+":e.kind==="remove"?"-":""}),y.jsx(x6,{text:e.text,highlight:t})]})}function EE(e){const t=[];let n=0;for(;n<e.length;){const s=e[n];if(s.kind==="context"){t.push({left:s,right:s}),n+=1;continue}let l=0,o=n;for(;o<e.length&&e[o].kind==="remove";)l+=1,o+=1;let u=0;for(;o<e.length&&e[o].kind==="add";)u+=1,o+=1;const h=Math.max(l,u);for(let d=0;d<h;d+=1)t.push({left:d<l?e[n+d]:null,right:d<u?e[n+l+d]:null});n=o}return t}function zy({line:e,show:t,highlight:n}){if(e===null)return y.jsxs("span",{className:"diff-half diff-half-empty",children:[y.jsx("span",{className:"diff-no"}),y.jsx("span",{className:"diff-sign"}),y.jsx("span",{className:"diff-text"})]});const s=e.kind==="add"?"add":e.kind==="remove"?"del":"ctx";return y.jsxs("span",{className:`diff-half diff-half-${s}`,children:[y.jsx("span",{className:"diff-no",children:(t==="old"?e.oldLine:e.newLine)??""}),y.jsx("span",{className:"diff-sign",children:e.kind==="add"?"+":e.kind==="remove"?"-":""}),y.jsx(x6,{text:e.text,highlight:n})]})}function kE({hunk:e,split:t,highlights:n,head:s}){return y.jsxs("div",{className:"diff-hunk",children:[y.jsx("div",{className:"diff-hunk-head",children:`@@ -${String(e.oldStart)},${String(e.oldCount)} +${String(e.newStart)},${String(e.newCount)} @@`}),t?EE(e.lines).map((l,o)=>y.jsxs("span",{className:"diff-split-row",children:[y.jsx(zy,{line:l.left,show:"old",highlight:n?.[s+o]}),y.jsx(zy,{line:l.right,show:"new",highlight:n?.[s+o]})]},String(o))):e.lines.map((l,o)=>y.jsx(CE,{line:l,highlight:n?.[s+o]},String(o)))]})}function Em({hunks:e,path:t,split:n=!1,wrap:s=!1}){const[l,o]=I.useState(null),u=e.map(d=>d.lines.map(p=>p.text).join(`
20
+ `)).join(`
21
+ `);I.useEffect(()=>{let d=!0;return o(null),wm(u,t).then(p=>{d&&o(p)}),()=>{d=!1}},[u,t]);let h=0;return y.jsx("div",{className:"diff-body","data-split":n||void 0,"data-wrap":s||void 0,children:e.map((d,p)=>{const _=h;return h+=d.lines.length,y.jsx(kE,{hunk:d,split:n,highlights:l,head:_},String(p))})})}const km="__DSC_CODE_ICON_INSTANCE__",Tm=Object.freeze({angular:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F8ECEF" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#DD0031" d="M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"/></g>',c:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF4F8" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#659AD2" d="M16.5921 9.1962s-.354-3.298-3.627-3.39c-3.2741-.09-4.9552 2.474-4.9552 6.14 0 3.6651 1.858 6.5972 5.0451 6.5972 3.184 0 3.5381-3.665 3.5381-3.665l6.1041.365s.36 3.31-2.196 5.836c-2.552 2.5241-5.6901 2.9371-7.8762 2.9201-2.19-.017-5.2261.034-8.1602-2.97-2.938-3.0101-3.436-5.9302-3.436-8.8002 0-2.8701.556-6.6702 4.047-9.5502C7.444.72 9.849 0 12.254 0c10.0422 0 10.7172 9.2602 10.7172 9.2602z"/></g>',clojure:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F1F7EC" stroke="#DCEAD2" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><g fill="none"><path d="M64 0C28.712 0 0 28.6 0 63.751c0 35.155 28.712 63.753 64 63.753s64-28.598 64-63.753C128 28.6 99.288 0 64 0" fill="#FFF"/><path d="M61.659 64.898a265.825 265.825 0 00-1.867 4.12c-2.322 5.241-4.894 11.62-5.834 15.706-.337 1.455-.546 3.258-.542 5.258 0 .79.043 1.622.11 2.469a30.74 30.74 0 0010.533 1.87 30.796 30.796 0 009.642-1.566 18.09 18.09 0 01-2.011-2.12c-4.11-5.221-6.403-12.872-10.031-25.737M46.485 38.96c-7.85 5.51-12.986 14.6-13.005 24.9.019 10.145 5.001 19.116 12.653 24.65 1.877-7.789 6.582-14.92 13.637-29.214a114.691 114.691 0 00-1.43-3.72c-1.955-4.884-4.776-10.556-7.294-13.124-1.283-1.342-2.84-2.502-4.561-3.492" fill="#91DC47"/><path d="M90.697 98.798c-4.05-.506-7.392-1.116-10.317-2.144a36.708 36.708 0 01-16.32 3.807c-20.293 0-36.742-16.383-36.745-36.602 0-10.97 4.852-20.805 12.528-27.512-2.053-.495-4.194-.783-6.38-.779-10.782.101-22.162 6.044-26.9 22.095-.443 2.337-.337 4.103-.337 6.197 0 31.818 25.895 57.613 57.835 57.613 19.561 0 36.841-9.682 47.305-24.489-5.66 1.405-11.103 2.077-15.763 2.091-1.747 0-3.387-.093-4.906-.277" fill="#63B132"/><path d="M79.829 87.634c.357.176 1.167.464 2.293.783 7.579-5.542 12.504-14.469 12.523-24.558h-.003c-.028-16.82-13.693-30.43-30.582-30.462a30.765 30.765 0 00-9.602 1.554c6.21 7.05 9.196 17.127 12.084 28.148l.005.013c.005.009.924 3.06 2.501 7.11 1.566 4.042 3.797 9.048 6.23 12.696 1.597 2.444 3.354 4.2 4.551 4.716" fill="#90B4FE"/><path d="M17.057 30.311c5.463-3.408 11.04-4.637 15.908-4.593 6.722.02 12.008 2.096 14.544 3.516.612.352 1.194.73 1.764 1.12a36.714 36.714 0 0114.786-3.096c20.295.003 36.747 16.386 36.75 36.601-.003 10.192-4.188 19.408-10.934 26.044a45.3 45.3 0 005.225.29c6.406.004 13.329-1.404 18.52-5.753 3.384-2.84 6.22-6.998 7.792-13.233.307-2.408.484-4.856.484-7.347 0-31.817-25.892-57.614-57.835-57.614-19.372 0-36.508 9.5-47.004 24.065z" fill="#5881D8"/></g></svg>',cmake:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F2F5F7" stroke="#D9E1E7" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#064F8C" d="M62.8.4L.3 123.8l68.1-57.9z"/><path fill="#249847" d="M123.8 127.7l-84-33.9L0 127.7z"/><path fill="#BE2128" d="M128 126.6L65.6 2.5l9.2 102.6z"/><path fill="#CDCDCE" d="M71.9 104l-3.1-34.9L42 92z"/></svg>',cpp:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#E8F2F8" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#00599C" d="M22.394 6c-.167-.29-.398-.543-.652-.69L12.926.22c-.509-.294-1.34-.294-1.848 0L2.26 5.31c-.508.293-.923 1.013-.923 1.6v10.18c0 .294.104.62.271.91.167.29.398.543.652.69l8.816 5.09c.508.293 1.34.293 1.848 0l8.816-5.09c.254-.147.485-.4.652-.69.167-.29.27-.616.27-.91V6.91c.003-.294-.1-.62-.268-.91zM12 19.11c-3.92 0-7.109-3.19-7.109-7.11 0-3.92 3.19-7.11 7.11-7.11a7.133 7.133 0 016.156 3.553l-3.076 1.78a3.567 3.567 0 00-3.08-1.78A3.56 3.56 0 008.444 12 3.56 3.56 0 0012 15.555a3.57 3.57 0 003.08-1.778l3.078 1.78A7.135 7.135 0 0112 19.11zm7.11-6.715h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79zm2.962 0h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79z"/></g>',csharp:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3EEF7" stroke="#E2D7EA" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#9B4F96" d="M115.4 30.7L67.1 2.9c-.8-.5-1.9-.7-3.1-.7-1.2 0-2.3.3-3.1.7l-48 27.9c-1.7 1-2.9 3.5-2.9 5.4v55.7c0 1.1.2 2.4 1 3.5l106.8-62c-.6-1.2-1.5-2.1-2.4-2.7z"/><path fill="#68217A" d="M10.7 95.3c.5.8 1.2 1.5 1.9 1.9l48.2 27.9c.8.5 1.9.7 3.1.7 1.2 0 2.3-.3 3.1-.7l48-27.9c1.7-1 2.9-3.5 2.9-5.4V36.1c0-.9-.1-1.9-.6-2.8l-106.6 62z"/><path fill="#fff" d="M85.3 76.1C81.1 83.5 73.1 88.5 64 88.5c-13.5 0-24.5-11-24.5-24.5s11-24.5 24.5-24.5c9.1 0 17.1 5 21.3 12.5l13-7.5c-6.8-11.9-19.6-20-34.3-20-21.8 0-39.5 17.7-39.5 39.5s17.7 39.5 39.5 39.5c14.6 0 27.4-8 34.2-19.8l-12.9-7.6zM97 66.2l.9-4.3h-4.2v-4.7h5.1L100 51h4.9l-1.2 6.1h3.8l1.2-6.1h4.8l-1.2 6.1h2.4v4.7h-3.3l-.9 4.3h4.2v4.7h-5.1l-1.2 6h-4.9l1.2-6h-3.8l-1.2 6h-4.8l1.2-6h-2.4v-4.7H97zm4.8 0h3.8l.9-4.3h-3.8l-.9 4.3z"/></svg>',css:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#1572B6"/><text x="10" y="12.8" text-anchor="middle" font-family="Arial,sans-serif" font-size="6.2" font-weight="900" fill="#fff">CSS</text>',dart:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECF7FA" stroke="#D5EAF0" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#00c4b3" d="M35.2 34.9l-8.3-8.3v59.7l.1 2.8c0 1.3.2 2.8.7 4.3l65.6 23.1 16.3-7.2-74.4-74.4z"/><path d="M27.7 93.4zm81.9 15.9l-16.3 7.2-65.4-23.1c1.3 4.8 4 10.1 7 13.2l21.3 21.2 47.6.1 5.8-18.6z" fill="#22d3c5"/><path fill="#0075c9" d="M1.7 65.1C-.4 67.3.7 72 4 75.5l14.7 14.8 9.2 3.3c-.3-1.5-.7-3-.7-4.3l-.1-2.8-.2-59.8m82.7 82.6l7.2-16.4-23-65.6c-1.5-.3-3-.6-4.3-.7l-2.9-.1-59.6.1"/><path d="M93.6 27.3c.2 0 .2 0 0 0 .2 0 .2 0 0 0zm16 82l17.7-5.8V54.8l-20.4-20.5c-3-3-8.3-5.8-13.2-7l23.1 65.6" fill="#00a8e1"/><path fill="#00c4b3" d="M90.5 18.2L75.7 3.5c-3.4-3.4-8-4.4-10.4-2.3L26.9 26.6h59.5l2.9.1c1.3 0 2.8.2 4.3.7l-3.1-9.2z"/></svg>',docker:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#E8F4FC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#2496ED" d="M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"/></g>',elixir:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3EEF6" stroke="#E3D9E8" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-a" gradientUnits="userSpaceOnUse" x1="835.592" y1="-36.546" x2="821.211" y2="553.414" gradientTransform="matrix(.1297 0 0 .2 -46.03 17.198)"><stop offset="0" stop-color="#d9d8dc"/><stop offset="1" stop-color="#fff" stop-opacity=".385"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-a)" d="M64.4.5C36.7 13.9 1.9 83.4 30.9 113.9c26.8 33.5 85.4 1.3 68.4-40.5-21.5-36-35-37.9-34.9-72.9z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-b" gradientUnits="userSpaceOnUse" x1="942.357" y1="-40.593" x2="824.692" y2="472.243" gradientTransform="matrix(.1142 0 0 .2271 -47.053 17.229)"><stop offset="0" stop-color="#8d67af" stop-opacity=".672"/><stop offset="1" stop-color="#9f8daf"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-b)" d="M64.4.2C36.8 13.6 1.9 82.9 31 113.5c10.7 12.4 28 16.5 37.7 9.1 26.4-18.8 7.4-53.1 10.4-78.5C68.1 33.9 64.2 11.3 64.4.2z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-c" gradientUnits="userSpaceOnUse" x1="924.646" y1="120.513" x2="924.646" y2="505.851" gradientTransform="matrix(.1227 0 0 .2115 -46.493 17.206)"><stop offset="0" stop-color="#26053d" stop-opacity=".762"/><stop offset="1" stop-color="#b7b4b4" stop-opacity=".278"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-c)" d="M56.7 4.3c-22.3 15.9-28.2 75-24.1 94.2 8.2 48.1 75.2 28.3 69.6-16.5-6-29.2-48.8-39.2-45.5-77.7z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-d" gradientUnits="userSpaceOnUse" x1="428.034" y1="198.448" x2="607.325" y2="559.255" gradientTransform="matrix(.1848 0 0 .1404 -42.394 17.138)"><stop offset="0" stop-color="#91739f" stop-opacity=".46"/><stop offset="1" stop-color="#32054f" stop-opacity=".54"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-d)" d="M78.8 49.8c10.4 13.4 12.7 22.6 6.8 27.9-27.7 19.4-61.3 7.4-54-37.3C22.1 63 4.5 96.8 43.3 101.6c20.8 3.6 54 2 58.9-16.1-.2-15.9-10.8-22.9-23.4-35.7z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-e" gradientUnits="userSpaceOnUse" x1="907.895" y1="540.636" x2="590.242" y2="201.281" gradientTransform="matrix(.1418 0 0 .1829 -45.23 17.18)"><stop offset="0" stop-color="#463d49" stop-opacity=".331"/><stop offset="1" stop-color="#340a50" stop-opacity=".821"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-e)" d="M38.1 36.4c-2.9 21.2 35.1 77.9 58.3 71-17.7 35.6-56.9-21.2-64-41.7 1.5-11 2.2-16.4 5.7-29.3z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-f" gradientUnits="userSpaceOnUse" x1="1102.297" y1="100.542" x2="1008.071" y2="431.648" gradientTransform="matrix(.106 0 0 .2448 -47.595 17.242)"><stop offset="0" stop-color="#715383" stop-opacity=".145"/><stop offset="1" stop-color="#f4f4f4" stop-opacity=".234"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-f)" d="M60.4 49.7c.8 7.9 3.9 20.5 0 28.8S38.7 102 43.6 115.3c11.4 24.8 37.1-4.4 36.9-19 1.1-11.8-6.6-38.7-1.8-52.5L76.5 41l-13.6-4c-2.2 3.2-3 7.5-2.5 12.7z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__elixir-original-g" gradientUnits="userSpaceOnUse" x1="1354.664" y1="140.06" x2="1059.233" y2="84.466" gradientTransform="matrix(.09173 0 0 .2828 -48.536 17.28)"><stop offset="0" stop-color="#a5a1a8" stop-opacity=".356"/><stop offset="1" stop-color="#370c50" stop-opacity=".582"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSC_CODE_ICON_INSTANCE__elixir-original-g)" d="M65.3 10.8C36 27.4 48 53.4 49.3 81.6l19.1-55.4c-1.4-5.7-2.3-9.5-3.1-15.4z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#330A4C" fill-opacity=".316" d="M68.3 26.1c-14.8 11.7-14.1 31.3-18.6 54 8.1-21.3 4.1-38.2 18.6-54z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M45.8 119.7c8 1.1 12.1 2.2 12.5 3 .3 4.2-11.1 1.2-12.5-3z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#EDEDED" fill-opacity=".603" d="M49.8 10.8c-6.9 7.7-14.4 21.8-18.2 29.7-1 6.5-.5 15.7.6 23.5.9-18.2 7.5-39.2 17.6-53.2z"/></svg>',env:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECD53F"/><text x="10" y="12.9" text-anchor="middle" font-family="Arial,sans-serif" font-size="5.7" font-weight="900" fill="#24292F">.ENV</text>',erlang:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FAEDF1" stroke="#EED6DE" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path d="M20.7 103.9C11 93.5 5.2 79.2 5.3 62.1 5.2 47 10 34 18.2 24.1H1v79.7l19.7.1zm90.4 0c4.2-4.5 8-9.8 11.4-15.9l-19-9.5c-6.7 10.8-16.4 20.8-29.9 20.9-19.6-.1-27.3-16.9-27.3-38.5h73.3c.1-2.4.1-3.6 0-4.7.5-12.9-2.9-23.7-9.1-32.1H127v79.7l-15.9.1zM47.5 42.4c.8-9.8 8.5-16.3 17.6-16.4 9.1 0 15.7 6.6 15.9 16.4H47.5z" fill="#A90533"/></svg>',flutter:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF7FD" stroke="#D7EAF6" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><g fill="#3FB6D3"><path d="M12.3 64.2L76.3 0h39.4L32.1 83.6zM76.3 128h39.4L81.6 93.9l34.1-34.8H76.3L42.2 93.5z"/></g><path fill="#27AACD" d="M81.6 93.9l-20-20-19.4 19.6 19.4 19.6z"/><path fill="#19599A" d="M115.7 128L81.6 93.9l-20 19.2L76.3 128z"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__flutter-original-a" gradientUnits="userSpaceOnUse" x1="59.365" y1="116.36" x2="86.825" y2="99.399"><stop offset="0" stop-color="#1b4e94"/><stop offset=".63" stop-color="#1a5497"/><stop offset="1" stop-color="#195a9b"/></linearGradient><path fill="url(#__DSC_CODE_ICON_INSTANCE__flutter-original-a)" d="M61.6 113.1l30.8-8.4-10.8-10.8z"/></svg>',git:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF0EC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#F05032" d="M13.09 23.549a1.54 1.54 0 0 1-2.18 0L.451 13.089a1.54 1.54 0 0 1 0-2.179l7.191-7.19 2.733 2.733a1.85 1.85 0 0 0 .964 2.326v6.66a1.849 1.849 0 1 0 1.54 0V8.957l2.508 2.508a1.85 1.85 0 1 0 1.09-1.09l-2.634-2.634a1.85 1.85 0 0 0-2.378-2.377L8.73 2.63 10.91.451a1.54 1.54 0 0 1 2.179 0l10.459 10.46a1.54 1.54 0 0 1 0 2.179z"/></g>',go:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#E7F9FC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#00ADD8" d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></g>',graphql:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEAF6" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#E10098" d="M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z"/></g>',haskell:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3F0F7" stroke="#E1D9EA" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#463B63" d="M0 110.2L30.1 65 0 19.9h22.6L52.7 65l-30.1 45.1H0z"/><path fill="#5E5187" d="M30.1 110.2L60.2 65 30.1 19.9h22.6l60.2 90.3H90.4L71.5 81.9l-18.8 28.2H30.1z"/><path fill="#904F8C" d="M102.9 83.8l-10-15.1H128v15.1h-25.1zM87.8 61.3l-10-15.1H128v15.1H87.8z"/></svg>',ini:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#6E7781"/><text x="10" y="13.2" text-anchor="middle" font-family="Arial,sans-serif" font-size="7.2" font-weight="800" fill="#fff">INI</text>',java:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F4F7FA" stroke="#D9E2E8" stroke-width=".5"/><svg x="2.5" y="2.5" width="15" height="15" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#0074BD" d="M47.617 98.12s-4.767 2.774 3.397 3.71c9.892 1.13 14.947.968 25.845-1.092 0 0 2.871 1.795 6.873 3.351-24.439 10.47-55.308-.607-36.115-5.969zm-2.988-13.665s-5.348 3.959 2.823 4.805c10.567 1.091 18.91 1.18 33.354-1.6 0 0 1.993 2.025 5.132 3.131-29.542 8.64-62.446.68-41.309-6.336z"/><path fill="#EA2D2E" d="M69.802 61.271c6.025 6.935-1.58 13.17-1.58 13.17s15.289-7.891 8.269-17.777c-6.559-9.215-11.587-13.792 15.635-29.58 0 .001-42.731 10.67-22.324 34.187z"/><path fill="#0074BD" d="M102.123 108.229s3.529 2.91-3.888 5.159c-14.102 4.272-58.706 5.56-71.094.171-4.451-1.938 3.899-4.625 6.526-5.192 2.739-.593 4.303-.485 4.303-.485-4.953-3.487-32.013 6.85-13.743 9.815 49.821 8.076 90.817-3.637 77.896-9.468zM49.912 70.294s-22.686 5.389-8.033 7.348c6.188.828 18.518.638 30.011-.326 9.39-.789 18.813-2.474 18.813-2.474s-3.308 1.419-5.704 3.053c-23.042 6.061-67.544 3.238-54.731-2.958 10.832-5.239 19.644-4.643 19.644-4.643zm40.697 22.747c23.421-12.167 12.591-23.86 5.032-22.285-1.848.385-2.677.72-2.677.72s.688-1.079 2-1.543c14.953-5.255 26.451 15.503-4.823 23.725 0-.002.359-.327.468-.617z"/><path fill="#EA2D2E" d="M76.491 1.587S89.459 14.563 64.188 34.51c-20.266 16.006-4.621 25.13-.007 35.559-11.831-10.673-20.509-20.07-14.688-28.815C58.041 28.42 81.722 22.195 76.491 1.587z"/><path fill="#0074BD" d="M52.214 126.021c22.476 1.437 57-.8 57.817-11.436 0 0-1.571 4.032-18.577 7.231-19.186 3.612-42.854 3.191-56.887.874 0 .001 2.875 2.381 17.647 3.331z"/></svg>',javascript:'<defs><clipPath id="__DSC_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSC_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#F0DB4F" d="M1.408 1.408h125.184v125.185H1.408z"/><path fill="#323330" d="M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"/></svg></g>',json:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F4F4F4" stroke="#DDDDDD" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><linearGradient id="__DSC_CODE_ICON_INSTANCE__a" x1="-670.564" x2="-583.105" y1="-280.831" y2="-368.306" gradientTransform="matrix(.9988 0 0 -.9987 689.011 -259.008)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-color="#fff"/></linearGradient><path fill="url(#__DSC_CODE_ICON_INSTANCE__a)" fill-rule="evenodd" d="M63.895 94.303c27.433 37.398 54.281-10.438 54.241-39.205-.046-34.012-34.518-53.021-54.263-53.021C32.182 2.077 2 28.269 2 64.105 2 103.937 36.596 126 63.873 126c-6.172-.889-26.742-5.296-27.019-52.674-.186-32.044 10.453-44.846 26.974-39.214.37.137 18.223 7.18 18.223 30.187 0 22.908-18.156 30.004-18.156 30.004z" clip-rule="evenodd"/><linearGradient id="__DSC_CODE_ICON_INSTANCE__b" x1="-579.148" x2="-666.607" y1="-364.34" y2="-276.873" gradientTransform="matrix(.9988 0 0 -.9987 689.011 -259.008)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-color="#fff"/></linearGradient><path fill="url(#__DSC_CODE_ICON_INSTANCE__b)" fill-rule="evenodd" d="M63.863 34.086C45.736 27.838 23.53 42.778 23.53 72.703 23.53 121.565 59.739 126 64.128 126 95.818 126 126 99.808 126 63.972 126 24.14 91.404 2.077 64.127 2.077c7.555-1.046 40.719 8.176 40.719 53.504 0 29.559-24.764 45.651-40.87 38.776-.37-.137-18.223-7.18-18.223-30.187 0-22.91 18.11-30.085 18.11-30.084z" clip-rule="evenodd"/></svg>',kotlin:'<defs><linearGradient id="__DSC_CODE_ICON_INSTANCE__k" x1="1" y1="19" x2="19" y2="1"><stop stop-color="#0095D5"/><stop offset=".5" stop-color="#7F52FF"/><stop offset="1" stop-color="#F88909"/></linearGradient></defs><rect x="1" y="1" width="18" height="18" rx="4" fill="url(#__DSC_CODE_ICON_INSTANCE__k)"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#FFFFFF" d="M24 24H0V0h24L12 12Z"/></g>',lua:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECECF7" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#000080" d="M.38 10.377l-.272-.037c-.048.344-.082.695-.101 1.041l.275.016c.018-.34.051-.682.098-1.02zM4.136 3.289l-.184-.205c-.258.232-.509.48-.746.734l.202.188c.231-.248.476-.49.728-.717zM5.769 2.059l-.146-.235c-.296.186-.586.385-.863.594l.166.219c.27-.203.554-.399.843-.578zM1.824 18.369c.185.297.384.586.593.863l.22-.164c-.205-.271-.399-.555-.58-.844l-.233.145zM1.127 16.402l-.255.104c.129.318.274.635.431.943l.005.01.245-.125-.005-.01c-.153-.301-.295-.611-.421-.922zM.298 9.309l.269.063c.076-.332.168-.664.272-.986l-.261-.087c-.108.332-.202.672-.28 1.01zM.274 12.42l-.275.01c.012.348.04.699.083 1.043l.273-.033c-.042-.336-.069-.68-.081-1.02zM.256 14.506c.073.34.162.682.264 1.014l.263-.08c-.1-.326-.187-.658-.258-.99l-.269.056zM11.573.275L11.563 0c-.348.012-.699.039-1.044.082l.034.273c.338-.041.68-.068 1.02-.08zM23.221 8.566c.1.326.186.66.256.992l.27-.059c-.072-.34-.16-.682-.262-1.014l-.264.081zM17.621 1.389c-.309-.164-.627-.314-.947-.449l-.107.252c.314.133.625.281.926.439l.128-.242zM15.693.572c-.332-.105-.67-.199-1.01-.277l-.063.268c.332.076.664.168.988.273l.085-.264zM6.674 1.545c.298-.15.606-.291.916-.418L7.486.873c-.317.127-.632.272-.937.428l-.015.008.125.244.015-.008zM23.727 11.588l.275-.01a11.797 11.797 0 0 0-.082-1.045l-.273.033c.041.338.068.682.08 1.022zM13.654.105c-.346-.047-.696-.08-1.043-.098l-.014.273c.339.018.683.051 1.019.098l.038-.273zM9.544.527l-.058-.27c-.34.072-.681.16-1.014.264l.081.262c.325-.099.659-.185.991-.256zM1.921 5.469l.231.15c.185-.285.384-.566.592-.834l-.217-.17c-.213.276-.417.563-.606.854zM.943 7.318l.253.107c.132-.313.28-.625.439-.924l-.243-.128c-.163.307-.314.625-.449.945zM18.223 21.943l.145.234c.295-.186.586-.385.863-.594l-.164-.219c-.272.204-.557.4-.844.579zM21.248 19.219l.217.17c.215-.273.418-.561.607-.854l-.23-.148c-.186.285-.385.564-.594.832zM19.855 20.715l.184.203c.258-.23.51-.479.746-.732l-.201-.188c-.23.248-.477.488-.729.717zM22.359 17.504l.244.129c.162-.307.314-.625.449-.945l-.254-.107a11.27 11.27 0 0 1-.439.923zM23.617 13.629l.273.039c.049-.346.082-.695.102-1.043l-.275-.014c-.018.338-.051.682-.1 1.018zM23.156 15.621l.264.086c.107-.332.201-.67.279-1.01l-.268-.063c-.077.333-.169.665-.275.987zM22.453 6.672c.154.303.297.617.424.932l.256-.104c-.131-.322-.277-.643-.436-.953l-.244.125zM8.296 23.418c.331.107.67.201 1.009.279l.062-.268c-.331-.076-.663-.168-.986-.273l-.085.262zM10.335 23.889c.345.049.696.082 1.043.102l.014-.275c-.339-.018-.682-.051-1.019-.098l-.038.271zM17.326 22.449c-.303.154-.613.297-.926.424l.104.256c.318-.131.639-.275.947-.434l.004-.002-.123-.246-.006.002zM4.613 21.467c.274.213.562.418.854.605l.149-.23c-.285-.184-.565-.385-.833-.592l-.17.217zM12.417 23.725l.009.275c.348-.014.699-.041 1.045-.084l-.035-.271c-.336.041-.68.068-1.019.08zM6.37 22.604c.307.162.625.314.946.449l.107-.254c-.313-.133-.624-.279-.924-.439l-.129.244zM3.083 20.041c.233.258.48.51.734.746l.188-.201c-.249-.23-.49-.477-.717-.729l-.205.184zM14.445 23.475l.059.27c.34-.074.68-.162 1.014-.266l-.082-.262c-.325.099-.659.185-.991.258zM21.18.129A2.689 2.689 0 1 0 21.18 5.507 2.689 2.689 0 1 0 21.18.129zM15.324 15.447c0 .471.314.66.852.66.67 0 1.297-.396 1.297-1.016v-.645c-.23.107-.379.141-1.107.24-.735.109-1.042.306-1.042.761zM12 2.818c-5.07 0-9.18 4.109-9.18 9.18 0 5.068 4.11 9.18 9.18 9.18 5.07 0 9.18-4.111 9.18-9.18 0-5.07-4.11-9.18-9.18-9.18zm-2.487 13.77H5.771v-6.023h.769v5.346h2.974v.677zm4.13 0h-.619v-.67c-.405.57-.811.793-1.446.793-.843 0-1.38-.463-1.38-1.182v-3.271h.686v3c0 .52.347.85.893.85.719 0 1.181-.578 1.181-1.461v-2.389h.686v4.33zm-.53-8.393c0-1.484 1.205-2.689 2.689-2.689s2.688 1.205 2.688 2.689-1.203 2.688-2.688 2.688-2.689-1.203-2.689-2.688zm5.567 7.856v.52c-.223.059-.33.074-.471.074-.34 0-.637-.238-.711-.57-.381.406-.918.637-1.471.637-.877 0-1.422-.463-1.422-1.248 0-.527.256-.916.76-1.123.266-.107.414-.141 1.389-.264.545-.066.719-.191.719-.48v-.182c0-.412-.348-.645-.967-.645-.645 0-.957.24-1.016.77h-.693c.041-1 .686-1.404 1.734-1.404 1.066 0 1.627.412 1.627 1.182v2.412c0 .215.133.338.373.338.041-.002.074-.002.149-.017z"/></g>',makefile:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#427819"/><path fill="#fff" d="m5 4.5 2.3 2.3 2.3-2.3L11 5.9 8.7 8.2l2.4 2.4L9.7 12l-2.4-2.4L5 11.9 3.6 10.5l2.3-2.3-2.3-2.3zm7 6.5h4v1.5h-4zm0 2.8h4v1.5h-4z"/>',node:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EDF7EA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#539E43" d="M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"/></g>',"objective-c":'<rect x="1" y="1" width="18" height="18" rx="4" fill="#438EFF"/><text x="10" y="13.2" text-anchor="middle" font-family="Arial,sans-serif" font-size="7.2" font-weight="800" fill="#fff">OC</text>',perl:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EAF2F7" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#0073A1" d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0m.157 1.103a10.91 10.91 0 0 1 9.214 5.404c-1.962.152-3.156 1.698-5.132 3.553-2.81 2.637-4.562.582-5.288-.898-.447-1.004-.847-2.117-1.544-2.769A.4.4 0 0 1 9.3 6.02l.08-.37a.083.083 0 0 0-.074-.1c-.33-.022-.601.093-.84.368a2.5 2.5 0 0 0-.375-.064c-.863-.093-1.036.345-1.873.345H5.81c-.758 0-1.391.361-1.7.892-.248.424-.257.884.15.93-.126.445.292.62 1.224.192 0 0 .733.421 1.749.421.549 0 .712.087.914.967.486 2.138 2.404 5.655 6.282 5.655l.118.166c.659.934.86 2.113.48 3.184-.307.867-.697 1.531-.697 1.531q.01.178.01.349c0 .81-.175 1.553-.387 2.23a10.91 10.91 0 0 1-11.989-6.342A10.91 10.91 0 0 1 7.608 2.01a10.9 10.9 0 0 1 4.55-.907M7.524 6.47c.288 0 .575.231.477.272a.4.4 0 0 1-.1.02.38.38 0 0 1-.375.327.384.384 0 0 1-.378-.326.4.4 0 0 1-.101-.02c-.098-.042.19-.273.477-.273m10.193 10.49q.05 0 .101.007.326.054.694.096.135.01.269.026a13.4 13.4 0 0 0 2.846-.007 10.9 10.9 0 0 1-2.007 2.705c-.11-.23-.547-1.19-.573-2.196q-.156-.01-.313-.026-.13-.014-.256-.022a18 18 0 0 1-.735-.102h-.003c-.032 0-.06.01-.074.035l-.003.012q-.081.265-.182.544c.428 1.084.652 2.078.652 2.078.14.22.258.432.363.64a11 11 0 0 1-2.168 1.264 11 11 0 0 1-1.205.426 13.3 13.3 0 0 1 1.055-2.531s.678-1.445 1.027-2.564v-.004a.55.55 0 0 1 .512-.38"/></g>',php:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F0EFF8" stroke="#DDDCEB" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#777BB4" d="M7.01 10.207h-.944l-.515 2.648h.838c.556 0 .97-.105 1.242-.314.272-.21.455-.559.55-1.049.092-.47.05-.802-.124-.995-.175-.193-.523-.29-1.047-.29zM12 5.688C5.373 5.688 0 8.514 0 12s5.373 6.313 12 6.313S24 15.486 24 12c0-3.486-5.373-6.312-12-6.312zm-3.26 7.451c-.261.25-.575.438-.917.551-.336.108-.765.164-1.285.164H5.357l-.327 1.681H3.652l1.23-6.326h2.65c.797 0 1.378.209 1.744.628.366.418.476 1.002.33 1.752a2.836 2.836 0 0 1-.305.847c-.143.255-.33.49-.561.703zm4.024.715l.543-2.799c.063-.318.039-.536-.068-.651-.107-.116-.336-.174-.687-.174H11.46l-.704 3.625H9.388l1.23-6.327h1.367l-.327 1.682h1.218c.767 0 1.295.134 1.586.401s.378.7.263 1.299l-.572 2.944h-1.389zm7.597-2.265a2.782 2.782 0 0 1-.305.847c-.143.255-.33.49-.561.703a2.44 2.44 0 0 1-.917.551c-.336.108-.765.164-1.286.164h-1.18l-.327 1.682h-1.378l1.23-6.326h2.649c.797 0 1.378.209 1.744.628.366.417.477 1.001.331 1.751zM17.766 10.207h-.943l-.516 2.648h.838c.557 0 .971-.105 1.242-.314.272-.21.455-.559.551-1.049.092-.47.049-.802-.125-.995s-.524-.29-1.047-.29z"/></g>',powershell:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#2671BE"/><path fill="#fff" fill-opacity=".16" d="M5.5 4h11l-3.5 12H2z"/><path d="m6.5 6.5 3 3-4.2 3.2m4 1h4" fill="none" stroke="#fff" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>',protobuf:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#4285F4"/><path fill="none" stroke="#fff" stroke-width="1.2" stroke-linejoin="round" d="m10 3.5 6 3.3v6.4l-6 3.3-6-3.3V6.8z"/><path fill="#fff" d="M6.5 6.5h4.4c2.3 0 3.6 1.2 3.6 3.1s-1.3 3.1-3.6 3.1H9v2H6.5zM9 8.4v2.4h1.6c.8 0 1.2-.4 1.2-1.2s-.4-1.2-1.2-1.2z"/>',python:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F2F4F7" stroke="#D5DBE5" stroke-width=".5"/><g transform="matrix(.126 0 0 .126 2.30 2.24)"><path fill="#3776AB" d="M 60.510156,6.3979729 C 55.926503,6.4192712 51.549217,6.8101906 47.697656,7.4917229 C 36.35144,9.4962267 34.291407,13.691825 34.291406,21.429223 L 34.291406,31.647973 L 61.103906,31.647973 L 61.103906,35.054223 L 34.291406,35.054223 L 24.228906,35.054223 C 16.436447,35.054223 9.6131468,39.73794 7.4789058,48.647973 C 5.0170858,58.860939 4.9078907,65.233996 7.4789058,75.897973 C 9.3848341,83.835825 13.936449,89.491721 21.728906,89.491723 L 30.947656,89.491723 L 30.947656,77.241723 C 30.947656,68.391821 38.6048,60.585475 47.697656,60.585473 L 74.478906,60.585473 C 81.933857,60.585473 87.885159,54.447309 87.885156,46.960473 L 87.885156,21.429223 C 87.885156,14.162884 81.755176,8.7044455 74.478906,7.4917229 C 69.872919,6.7249976 65.093809,6.3766746 60.510156,6.3979729 z M 46.010156,14.616723 C 48.779703,14.616723 51.041406,16.915369 51.041406,19.741723 C 51.041404,22.558059 48.779703,24.835473 46.010156,24.835473 C 43.23068,24.835472 40.978906,22.558058 40.978906,19.741723 C 40.978905,16.91537 43.23068,14.616723 46.010156,14.616723 z "/><path fill="#FFD43B" d="M 91.228906,35.054223 L 91.228906,46.960473 C 91.228906,56.191228 83.403011,63.960472 74.478906,63.960473 L 47.697656,63.960473 C 40.361823,63.960473 34.291407,70.238956 34.291406,77.585473 L 34.291406,103.11672 C 34.291406,110.38306 40.609994,114.65704 47.697656,116.74172 C 56.184987,119.23733 64.323893,119.68835 74.478906,116.74172 C 81.229061,114.78733 87.885159,110.85411 87.885156,103.11672 L 87.885156,92.897973 L 61.103906,92.897973 L 61.103906,89.491723 L 87.885156,89.491723 L 101.29141,89.491723 C 109.08387,89.491723 111.98766,84.056315 114.69765,75.897973 C 117.49698,67.499087 117.37787,59.422197 114.69765,48.647973 C 112.77187,40.890532 109.09378,35.054223 101.29141,35.054223 L 91.228906,35.054223 z M 76.166406,99.710473 C 78.945884,99.710476 81.197656,101.98789 81.197656,104.80422 C 81.197654,107.63057 78.945881,109.92922 76.166406,109.92922 C 73.396856,109.92922 71.135156,107.63057 71.135156,104.80422 C 71.135158,101.98789 73.396853,99.710473 76.166406,99.710473 z "/></g>',r:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF2F6" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#276DC3" d="M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z"/></g>',react:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#20232A"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#61DAFB" d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"/></g>',ruby:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEDEC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#CC342D" d="M20.156.083c3.033.525 3.893 2.598 3.829 4.77L24 4.822 22.635 22.71 4.89 23.926h.016C3.433 23.864.15 23.729 0 19.139l1.645-3 2.819 6.586.503 1.172 2.805-9.144-.03.007.016-.03 9.255 2.956-1.396-5.431-.99-3.9 8.82-.569-.615-.51L16.5 2.114 20.159.073l-.003.01zM0 19.089zM5.13 5.073c3.561-3.533 8.157-5.621 9.922-3.84 1.762 1.777-.105 6.105-3.673 9.636-3.563 3.532-8.103 5.734-9.864 3.957-1.766-1.777.045-6.217 3.612-9.75l.003-.003z"/></g>',rust:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3E6DD" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#2B2B2B" d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></g>',scala:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCECEB" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#DC322F" d="M4.589 24c4.537 0 13.81-1.516 14.821-3v-5.729c-.957 1.408-10.284 2.912-14.821 2.912V24zM4.589 16.365c4.537 0 13.81-1.516 14.821-3V7.636c-.957 1.408-10.284 2.912-14.821 2.912v5.817zM4.589 8.729c4.537 0 13.81-1.516 14.821-3V0C18.453 1.408 9.126 2.912 4.589 2.912v5.817z"/></g>',shell:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#303642"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#7EE787" d="M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z"/></g>',solidity:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F0F0F0" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#363636" d="M4.409 6.608L7.981.255l3.572 6.353H4.409zM8.411 0l3.569 6.348L15.552 0H8.411zm4.036 17.392l3.572 6.354 3.575-6.354h-7.147zm-.608-10.284h-7.43l3.715 6.605 3.715-6.605zm.428-.25h7.428L15.982.255l-3.715 6.603zM15.589 24l-3.569-6.349L8.448 24h7.141zm-3.856-6.858H4.306l3.712 6.603 3.715-6.603zm.428-.25h7.433l-3.718-6.605-3.715 6.605z"/></g>',sql:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#336791"/><ellipse cx="10" cy="5.5" rx="5.8" ry="2.1" fill="#fff"/><path fill="#fff" fill-opacity=".88" d="M4.2 5.5v8.9c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1V5.5c0 1.2-2.6 2.1-5.8 2.1s-5.8-.9-5.8-2.1z"/><path d="M4.2 9.2c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1M4.2 12.9c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1" fill="none" stroke="#336791" stroke-opacity=".7" stroke-width=".7"/>',svelte:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF0EB" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#FF3E00" d="M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"/></g>',swift:'<defs><clipPath id="__DSC_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSC_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#f05138" d="M126.33 34.06a39.32 39.32 0 00-.79-7.83 28.78 28.78 0 00-2.65-7.58 28.84 28.84 0 00-4.76-6.32 23.42 23.42 0 00-6.62-4.55 27.27 27.27 0 00-7.68-2.53c-2.65-.51-5.56-.51-8.21-.76H30.25a45.46 45.46 0 00-6.09.51 21.82 21.82 0 00-5.82 1.52c-.53.25-1.32.51-1.85.76a33.82 33.82 0 00-5 3.28c-.53.51-1.06.76-1.59 1.26a22.41 22.41 0 00-4.76 6.32 23.61 23.61 0 00-2.65 7.58 78.5 78.5 0 00-.79 7.83v60.39a39.32 39.32 0 00.79 7.83 28.78 28.78 0 002.65 7.58 28.84 28.84 0 004.76 6.32 23.42 23.42 0 006.62 4.55 27.27 27.27 0 007.68 2.53c2.65.51 5.56.51 8.21.76h63.22a45.08 45.08 0 008.21-.76 27.27 27.27 0 007.68-2.53 30.13 30.13 0 006.62-4.55 22.41 22.41 0 004.76-6.32 23.61 23.61 0 002.65-7.58 78.49 78.49 0 00.79-7.83V34.06z"/><path fill="#fefefe" d="M85 96.5c-11.11 6.13-26.38 6.76-41.75.47A64.53 64.53 0 0113.84 73a50 50 0 0010.85 6.32c15.87 7.1 31.73 6.61 42.9 0-15.9-11.66-29.4-26.82-39.46-39.2a43.47 43.47 0 01-5.29-6.82c12.16 10.61 31.5 24 38.38 27.79a271.77 271.77 0 01-27-32.34 266.8 266.8 0 0044.47 34.87c.71.38 1.26.7 1.7 1a32.7 32.7 0 001.21-3.51c3.71-12.89-.53-27.54-9.79-39.67C93.25 33.81 106 57.05 100.66 76.51c-.14.53-.29 1-.45 1.55l.19.22c10.59 12.63 7.68 26 6.35 23.5C101 91 90.37 94.33 85 96.5z"/></svg></g>',toml:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#F6EEEA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#9C4121" d="M.014 0h5.34v2.652H2.888v18.681h2.468V24H.015V0Zm17.622 5.049v2.78h-4.274v12.935h-3.008V7.83H6.059V5.05h11.577ZM23.986 24h-5.34v-2.652h2.467V2.667h-2.468V0h5.34v24Z"/></g>',typescript:'<defs><clipPath id="__DSC_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSC_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#fff" d="M22.67 47h99.67v73.67H22.67z"/><path data-name="original" fill="#007acc" d="M1.5 63.91v62.5h125v-125H1.5zm100.73-5a15.56 15.56 0 017.82 4.5 20.58 20.58 0 013 4c0 .16-5.4 3.81-8.69 5.85-.12.08-.6-.44-1.13-1.23a7.09 7.09 0 00-5.87-3.53c-3.79-.26-6.23 1.73-6.21 5a4.58 4.58 0 00.54 2.34c.83 1.73 2.38 2.76 7.24 4.86 8.95 3.85 12.78 6.39 15.16 10 2.66 4 3.25 10.46 1.45 15.24-2 5.2-6.9 8.73-13.83 9.9a38.32 38.32 0 01-9.52-.1 23 23 0 01-12.72-6.63c-1.15-1.27-3.39-4.58-3.25-4.82a9.34 9.34 0 011.15-.73L82 101l3.59-2.08.75 1.11a16.78 16.78 0 004.74 4.54c4 2.1 9.46 1.81 12.16-.62a5.43 5.43 0 00.69-6.92c-1-1.39-3-2.56-8.59-5-6.45-2.78-9.23-4.5-11.77-7.24a16.48 16.48 0 01-3.43-6.25 25 25 0 01-.22-8c1.33-6.23 6-10.58 12.82-11.87a31.66 31.66 0 019.49.26zm-29.34 5.24v5.12H56.66v46.23H45.15V69.26H28.88v-5a49.19 49.19 0 01.12-5.17C29.08 59 39 59 51 59h21.83z"/></svg></g>',vue:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECF8F3" stroke="#D5EAE0" stroke-width=".5"/><path fill="#41B883" d="M3.5 5h3.2l3.3 5.7L13.3 5h3.2L10 16z"/><path fill="#35495E" d="M6.7 5H9l1 1.8L11 5h2.3L10 10.7z"/>',wasm:'<defs><clipPath id="__DSC_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSC_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#654ff0" d="M.223.222v127.555h127.555V.222H78.594c.014.227.036.455.036.686 0 8.08-6.55 14.626-14.63 14.626-8.078 0-14.625-6.546-14.625-14.626 0-.231.022-.459.031-.686zm29.595 68.746h8.445l5.782 30.738h.107l6.968-30.738h7.908l6.265 31.119h.106l6.597-31.119h8.284l-10.765 45.156H61.12l-6.213-30.738H54.8l-6.7 30.738h-8.557zm59.994 0h13.334l13.284 45.156h-8.77l-2.879-10.051H89.59l-2.212 10.05h-8.5ZM94.895 80.1l-3.684 16.57h11.473L98.448 80.1Z"/></svg></g>',xml:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#EAF3FA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#005FAD" d="M4.345 7.053c-.495.02-.44.725-.536 1.081-.157.583-.3 1.325-.347 1.926-.046.585-.008 1.127.066 1.719.058.46.191.767.07.89-.108.11-3.216 2.962-3.466 3.123-.26.169-.08.584.069.817.157.246.23.373.557.33.306-.042.405-.409.583-.606.228-.252 2.421-2.401 2.616-2.401.077.544.367 1.064.67 1.513.15.222.314.439.505.629.175.175.4.317.587.45.44.024.795-.301.35-.67-.17-.14-.735-.971-.927-1.43-.18-.43-.574-1.076-.146-1.428 1.494-1.23 3.72-2.262 4.247-2.313-.257 1.024-1.356 3.048-1.757 4.012-.14.333-.231.732-.185 1.094.055.434.383.774.587.806.417-.023.7-.387.946-.645.343-.357.634-.685.974-1.043.339-.356.672-.731.971-1.07.184-.207.674-.713.963-.713-.11.693-.716 1.552-.839 2.254-.125.716.531 1.596 1.217.956.623-.58 1.255-1.129 1.867-1.72.217-.208.175.037.224.242.05.208.176.91.275 1.1.18.346.496.592.897.598.362.006.727-.161.982-.414.19-.187.513-.699.154-.832-.23-.086-.217-.176-.495-.129-.172.029-.362.074-.507.179-.367-.003-.381-.89-.324-1.161.068-.327.207-.659.185-.998-.026-.418-.478-.69-.582-.72-.156-.076-.253.023-.458.212-.173.161-.363.332-.535.495-.34.322-.768.813-.942.813.305-.705.708-2.652-.643-2.48-.563.071-.95.377-1.394.71-.29.28-.683.641-.936.87-.236.216-.371.404-.496.404.132-.747 1.685-3.167.885-3.853-.158-.136-.313-.325-.515-.349a4.637 4.637 0 0 0-.833.19c-.565.18-2.78 1.28-4.19 2.289-.131.094-.214-.085-.231-.29-.087-1.058.199-2.19.496-3.188.208-.696-.557-1.225-.659-1.249zm18.177.874c-.166.364-.2.894-.248 1.319a24.307 24.307 0 0 0-1.246-.115c.238.296.691.588 1.056.724-.048.366-.434.67-.599 1.021.458-.127.676-.47.989-.821.362.22.791.627 1.26.636-.177-.376-.334-.695-.658-.966.269-.175.717-.362.924-.633-.345-.074-.718-.093-1.052-.015-.258-.284-.3-.772-.426-1.15zm-2.92.079c-.23.02-.613.49-.832.773-.807 1.039-1.542 3.15-1.661 3.542-.363 1.195-.502 2.672.28 3.722.456.612 1.258.66 2.041.434.405-.116.812-.406.95-.723.114-.263.174-.753-.404-.38-.224.145-.634.304-1.37.291-.247-.004-.651-.357-.76-.722-.192-.595-.11-1.393-.11-1.393.167-1.028.642-2.146 1.061-3.076.163-.36.658-1.259.842-1.546 0 0 .239-.373.131-.77-.031-.116-.091-.16-.168-.152zm3.072 2.976c-.12.264-.144.648-.18.956-.274-.031-.63-.066-.904-.083.172.215.501.426.766.525-.034.265-.314.486-.434.741.332-.092.49-.34.717-.596.263.16.575.456.914.462-.127-.273-.242-.504-.477-.701.195-.127.52-.262.67-.46a1.77 1.77 0 0 0-.763-.01c-.187-.206-.217-.56-.309-.834zm-1.123 2.422c-.083.183-.1.449-.125.662a12.6 12.6 0 0 0-.624-.058c.119.148.346.295.53.363-.025.184-.219.336-.301.513.23-.064.339-.236.496-.413.181.11.397.316.632.32-.088-.19-.168-.349-.33-.485.135-.087.36-.181.463-.317a1.22 1.22 0 0 0-.527-.008c-.13-.142-.151-.387-.214-.576z"/></g>',yaml:`<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEEEF" stroke="#F0D8DB" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet">
22
+ <polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="87.702 137.67 0 0 63.25 0 119.02 88.646 175.24 0 235.79 0 143.98 137.67 143.98 224.95 87.702 224.95"/>
23
+ <path d="m82.428 49.149h-25.266l-5.1388 12.408h-11.188l23.659-55.798h11.444l22.699 55.798h-11.956l-4.2525-12.408zm-4.197-11.14-7.7455-20.476-8.6412 20.476z" fill="#cb171e"/>
24
+ <polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="87.701 250.18 87.701 470.65 135 470.65 135 318.57 184.51 420.79 221.74 420.79 272.94 314.98 272.94 470.6 318.32 470.6 318.32 250.18 256.36 250.18 201.38 349.88 149.02 250.18"/>
25
+ <polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="512 422.74 512 422.74 395.64 422.74 395.64 250.12 347.44 250.12 347.44 469.65 512 469.65"/>
26
+ </svg>`,zig:'<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF4DF" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#E18A00" d="m23.53 1.02-7.686 3.45h-7.06l-2.98 3.452h7.173L.47 22.98l7.681-3.607h7.065v-.002l2.978-3.45-7.148-.001 12.482-14.9zM0 4.47v14.901h1.883l2.98-3.45H3.451v-8h.942l2.824-3.45H0zm22.117 0-2.98 3.608h1.412v7.844h-.942l-2.98 3.45H24V4.47h-1.883z"/></g>'}),Mm=["angular","c","clojure","cmake","cpp","csharp","css","dart","docker","elixir","env","erlang","flutter","git","go","graphql","haskell","ini","java","javascript","json","kotlin","lua","makefile","node","objective-c","perl","php","powershell","protobuf","python","r","react","ruby","rust","scala","shell","solidity","sql","svelte","swift","toml","typescript","vue","wasm","xml","yaml","zig"],TE=new Set(Mm),ME={".bash_profile":"shell",".bashrc":"shell",".env":"env",".gitattributes":"git",".gitconfig":"git",".gitignore":"git",".gitmodules":"git",".mailmap":"git",".profile":"shell",".zprofile":"shell",".zshrc":"shell",bsdmakefile:"makefile","cmakelists.txt":"cmake",commit_editmsg:"git","compose.yaml":"docker","compose.yml":"docker","docker-compose.yaml":"docker","docker-compose.yml":"docker",dockerfile:"docker",gemfile:"ruby",gnumakefile:"makefile",guardfile:"ruby",makefile:"makefile","npm-shrinkwrap.json":"node","package-lock.json":"node","package.json":"node",podfile:"ruby",rakefile:"ruby"},AE=[["dockerfile.","docker"],[".env.","env"]],DE=[[".component.ts","angular"],[".component.html","angular"],[".directive.ts","angular"],[".service.ts","angular"],[".module.ts","angular"],[".pipe.ts","angular"],[".guard.ts","angular"],[".interceptor.ts","angular"],[".dockerfile","docker"]],OE={bash:"shell",c:"c","c++":"cpp",cc:"cpp",cfg:"ini",cjs:"javascript",clj:"clojure",cljc:"clojure",cljs:"clojure",cmake:"cmake",cpp:"cpp",cs:"csharp",csh:"shell",css:"css",csx:"csharp",cts:"typescript",cxx:"cpp",dart:"dart",dtd:"xml",edn:"clojure",env:"env",erl:"erlang",es6:"javascript",escript:"erlang",ex:"elixir",exs:"elixir",fish:"shell",gemspec:"ruby",go:"go",gql:"graphql",graphql:"graphql",h:"c","h++":"cpp",hh:"cpp",hpp:"cpp",hrl:"erlang",hs:"haskell",hxx:"cpp",ini:"ini",ipp:"cpp",java:"java",js:"javascript",json:"json",json5:"json",jsonc:"json",jsx:"react",ksh:"shell",kt:"kotlin",kts:"kotlin",lhs:"haskell",lua:"lua",m:"objective-c",mak:"makefile",mjs:"javascript",mk:"makefile",mm:"objective-c",mts:"typescript",node:"node",pch:"objective-c",php:"php",php3:"php",php4:"php",php5:"php",phps:"php",phtml:"php",pl:"perl",plist:"xml",pm:"perl",pod:"perl",proto:"protobuf",ps1:"powershell",psd1:"powershell",psm1:"powershell",py:"python",pyi:"python",pyw:"python",pyx:"python",r:"r",rake:"ruby",rb:"ruby",rmd:"r",rs:"rust",sc:"scala",scala:"scala",sh:"shell",sol:"solidity",sql:"sql",svelte:"svelte",swift:"swift",t:"perl",tcsh:"shell",toml:"toml",tpp:"cpp",ts:"typescript",tsx:"react",vue:"vue",wasm:"wasm",wast:"wasm",wat:"wasm",xml:"xml",xsd:"xml",xsl:"xml",xslt:"xml",yaml:"yaml",yml:"yaml",zig:"zig",zsh:"shell"},RE={"7z":"archive",apk:"archive",avi:"video",avif:"image",bat:"code",bmp:"image",br:"archive",bz2:"archive",cab:"archive",cmd:"code",csv:"excel",doc:"word",docx:"word",fods:"excel",gif:"image",gz:"archive",heic:"image",heif:"image",htm:"html",html:"html",ico:"image",jar:"archive",jpeg:"image",jpg:"image",key:"ppt",less:"code",lz:"archive",lzma:"archive",markdown:"markdown",m4v:"video",md:"markdown",mdx:"markdown",mkv:"video",mov:"video",mp4:"video",mpeg:"video",mpg:"video",numbers:"excel",odp:"ppt",ods:"excel",odt:"word",ots:"excel",pages:"word",pdf:"pdf",png:"image",ppt:"ppt",pptx:"ppt",rar:"archive",rtf:"word",sass:"code",scss:"code",svg:"image",tar:"archive",taz:"archive",tbz:"archive",tbz2:"archive",tgz:"archive",tif:"image",tiff:"image",tsv:"excel",txz:"archive",webm:"video",webp:"image",xls:"excel",xlsb:"excel",xlsm:"excel",xlt:"excel",xltm:"excel",xltx:"excel",xlsx:"excel",xz:"archive",zip:"archive",zst:"archive"},LE={changelog:"markdown",contributing:"markdown",readme:"markdown"};function oc(e){return e.slice(Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"))+1)}function Am(e){const t=oc(e),n=t.lastIndexOf(".");return n<0?"":t.slice(n+1)}function Dm(e){return TE.has(e)}function Om(e,t,n){const s=ME[e];if(s!==void 0)return s;for(const[l,o]of AE)if(e.startsWith(l))return o;for(const[l,o]of DE)if(e.endsWith(l))return o;return t==="dart"&&n!==void 0&&Object.entries(n.files).find(([o])=>oc(o).toLowerCase()==="pubspec.yaml")?.[1]?.includes("flutter:")===!0?"flutter":OE[t]??null}function of(e,t){const n=oc(e).toLowerCase(),s=Am(n).toLowerCase();return Om(n,s,t)??LE[n]??RE[s]??"other"}const kh=28,NE="M8.48924 28H19.5108C21.6479 28 22.7165 28 23.5594 27.6509C24.6833 27.1853 25.5762 26.2924 26.0417 25.1685C26.3909 24.3256 26.3909 23.257 26.3909 21.1199V8.79443C26.3909 8.32877 26.3909 8.09593 26.3471 7.87507C26.2887 7.58058 26.173 7.30042 26.0067 7.05048C25.882 6.86303 25.7177 6.69799 25.3893 6.36792L20.0611 1.01354C19.7304 0.681235 19.5651 0.515081 19.3769 0.38885C19.126 0.220541 18.8443 0.103463 18.5481 0.0443412C18.3259 0 18.0915 0 17.6226 0H8.48924C6.35209 0 5.28351 0 4.4406 0.349145C3.31672 0.814671 2.4238 1.70759 1.95828 2.83147C1.60913 3.67438 1.60913 4.74296 1.60913 6.88011V21.1199C1.60913 23.257 1.60913 24.3256 1.95828 25.1685C2.4238 26.2924 3.31672 27.1853 4.4406 27.6509C5.28351 28 6.35209 28 8.48924 28Z",zE="M26.3909 7.37445L19.0525 0V3.77445C19.0525 4.89271 19.0525 5.45184 19.2352 5.89289C19.4788 6.48096 19.946 6.94818 20.5341 7.19176C20.9751 7.37445 21.5342 7.37445 22.6525 7.37445H26.3909Z",c0="translate(14 16) scale(1.12) translate(-14 -16)",zo="translate(14 16) scale(1.22) translate(-14 -16)",BE="translate(14 13.0693) scale(1.12) translate(-14 -13.0693)";function jE(e){return e?{fill:"#ffffff",fillOpacity:.36}:{fill:"#ffffff",fillOpacity:.72}}function pn({size:e,className:t,children:n,markTransform:s,muted:l=!1}){return y.jsxs("svg",{width:e,height:e,className:t,viewBox:`0 0 ${String(kh)} ${String(kh)}`,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[y.jsx("path",{d:NE,fill:"currentColor"}),y.jsx("path",{d:zE,...jE(l)}),n!==void 0&&y.jsx("g",{color:"#ffffff",transform:s,children:n})]})}function HE({size:e,className:t}){return y.jsxs("svg",{width:e,height:e,className:t,viewBox:`0 0 ${String(kh)} ${String(kh)}`,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[y.jsx("path",{d:"M2.80078 10.2112C2.80078 9.52802 2.80078 9.18642 2.85314 8.866C2.98648 8.05 3.36942 7.29538 3.94925 6.70595C4.17694 6.4745 4.45264 6.2728 5.00404 5.86939C5.29197 5.65874 5.43594 5.55342 5.58711 5.46632C5.97089 5.24521 6.39638 5.10618 6.83667 5.05803C7.01011 5.03906 7.18849 5.03906 7.54524 5.03906H11.6543C12.4669 5.03906 12.8732 5.03906 13.2599 5.13697C13.3882 5.16945 13.5143 5.20986 13.6375 5.25795C14.0091 5.40294 14.3398 5.63902 15.0012 6.1112L16.2632 7.01224C16.5526 7.21881 16.6972 7.3221 16.8598 7.38553C16.9137 7.40657 16.9689 7.42425 17.025 7.43846C17.1942 7.4813 17.372 7.4813 17.7275 7.4813H19.8008C22.0506 7.4813 23.1755 7.4813 23.9641 8.05425C24.2188 8.23928 24.4428 8.46326 24.6278 8.71794C25.2008 9.50654 25.2008 10.6315 25.2008 12.8813V18.7283C25.2008 20.9781 25.2008 22.1031 24.6278 22.8917C24.4428 23.1463 24.2188 23.3703 23.9641 23.5554C23.1755 24.1283 22.0506 24.1283 19.8008 24.1283H8.20077C5.95094 24.1283 4.82602 24.1283 4.03743 23.5554C3.78274 23.3703 3.55877 23.1463 3.37373 22.8917C2.80078 22.1031 2.80078 20.9781 2.80078 18.7283V10.2112Z",fill:"currentColor"}),y.jsx("g",{color:"#ffffff",transform:BE,children:y.jsx("path",{d:"M6.31445 13.0693H21.6893",stroke:"currentColor",strokeWidth:"2.38"})})]})}function IE({size:e,className:t}){return y.jsx(pn,{size:e,className:t,children:y.jsx("path",{d:"M14 11.5H11.4C10.5599 11.5 10.1399 11.5 9.81901 11.6635C9.53677 11.8073 9.3073 12.0368 9.16349 12.319C9 12.6399 9 13.0599 9 13.9V16.5M14 11.5H16.6C17.4401 11.5 17.8601 11.5 18.181 11.6635C18.4632 11.8073 18.6927 12.0368 18.8365 12.319C19 12.6399 19 13.0599 19 13.9V16.5M14 11.5V21.5M14 21.5H16.6C17.4401 21.5 17.8601 21.5 18.181 21.3365C18.4632 21.1927 18.6927 20.9632 18.8365 20.681C19 20.3601 19 19.9401 19 19.1V16.5M14 21.5H11.4C10.5599 21.5 10.1399 21.5 9.81901 21.3365C9.53677 21.1927 9.3073 20.9632 9.16349 20.681C9 20.3601 9 19.9401 9 19.1V16.5M19 16.5H9",stroke:"currentColor",strokeWidth:"1.2"})})}function PE({size:e,className:t}){return y.jsxs(pn,{size:e,className:t,markTransform:zo,children:[y.jsx("rect",{x:"9",y:"12.6",width:"10",height:"8",rx:"1.3",stroke:"currentColor",strokeWidth:"1.35"}),y.jsx("path",{d:"M9 15.6h10",stroke:"currentColor",strokeWidth:"1.35"}),y.jsx("rect",{x:"13.3",y:"15",width:"1.4",height:"1.6",fill:"currentColor"})]})}function FE(e,t,n){switch(e){case"archive":return y.jsx(PE,{size:t,className:n});case"code":return y.jsxs(pn,{size:t,className:n,children:[y.jsx("path",{d:"M10.0053 13.126L7.0236 16.3788C6.96052 16.4476 6.96052 16.5532 7.0236 16.622L10.0053 19.8748",stroke:"currentColor",strokeWidth:"1.35"}),y.jsx("path",{d:"M17.9941 13.126L20.9759 16.3788C21.039 16.4476 21.039 16.5532 20.9759 16.622L17.9941 19.8748",stroke:"currentColor",strokeWidth:"1.35"}),y.jsx("path",{d:"M15.2652 12.957L12.7344 20.0433",stroke:"currentColor",strokeWidth:"1.35"})]});case"excel":return y.jsx(IE,{size:t,className:n});case"folder":return y.jsx(HE,{size:t,className:n});case"html":return y.jsx(pn,{size:t,className:n,markTransform:c0,children:y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.9994 9.68298C17.212 9.68298 19.8167 12.2872 19.8168 15.4997C19.8168 18.7123 17.2121 21.3171 13.9994 21.3171C10.7869 21.3169 8.18274 18.7122 8.18274 15.4997C8.1829 12.2873 10.787 9.68315 13.9994 9.68298ZM9.26213 16.0247C9.47025 17.9241 10.7936 19.4876 12.5639 20.0463C12.42 19.7977 12.2952 19.5152 12.1879 19.2116C11.885 18.3541 11.693 17.2434 11.6424 16.0247H9.26213ZM16.3565 16.0247C16.3059 17.2434 16.1145 18.3542 15.8116 19.2116C15.7044 19.5151 15.5788 19.7971 15.435 20.0456C17.2054 19.487 18.5293 17.9242 18.7374 16.0247H16.3565ZM12.6938 16.0247C12.7439 17.1459 12.9212 18.1334 13.1784 18.8616C13.332 19.2962 13.503 19.61 13.6686 19.805C13.834 19.9996 13.9473 20.0256 13.9994 20.0258C14.0514 20.0258 14.1651 20.0002 14.331 19.805C14.4966 19.61 14.6676 19.2962 14.8211 18.8616C15.0784 18.1334 15.2557 17.1459 15.3058 16.0247H12.6938ZM13.9994 10.733C13.9473 10.7331 13.834 10.7598 13.6686 10.9545C13.503 11.1494 13.3319 11.4633 13.1784 11.8978C12.903 12.6777 12.7188 13.7545 12.6849 14.9747H15.3147C15.2808 13.7545 15.0966 12.6777 14.8211 11.8978C14.6676 11.4633 14.4965 11.1494 14.331 10.9545C14.1651 10.7593 14.0514 10.733 13.9994 10.733ZM15.5888 11.0051C15.6701 11.1756 15.7444 11.3576 15.8116 11.5478C16.1343 12.4613 16.3308 13.6619 16.3647 14.9747H18.7374C18.5352 13.1307 17.2817 11.6036 15.5888 11.0051ZM12.4101 11.0051C10.7174 11.6037 9.46428 13.1308 9.26213 14.9747H11.6349C11.6688 13.6619 11.8652 12.4613 12.1879 11.5478C12.2551 11.3577 12.3288 11.1756 12.4101 11.0051Z",fill:"currentColor"})});case"image":return y.jsxs(pn,{size:t,className:n,markTransform:c0,children:[y.jsx("path",{d:"M10.4212 15.9204C10.5756 15.6558 10.9579 15.6558 11.1123 15.9204L13.6493 20.2696C13.8048 20.5362 13.6125 20.8711 13.3037 20.8711H8.22974C7.92102 20.8711 7.72868 20.5362 7.88423 20.2696L10.4212 15.9204Z",fill:"currentColor"}),y.jsx("path",{d:"M15.4981 13.186C15.6505 12.9117 16.0451 12.9117 16.1975 13.186L20.1368 20.2769C20.2849 20.5435 20.0922 20.8711 19.7872 20.8711H11.9084C11.6034 20.8711 11.4107 20.5435 11.5588 20.2769L15.4981 13.186Z",fill:"currentColor"}),y.jsx("path",{d:"M11.8603 11.3997C11.8603 12.286 11.1418 13.0045 10.2555 13.0045C9.36924 13.0045 8.65076 12.286 8.65076 11.3997C8.65076 10.5134 9.36924 9.79492 10.2555 9.79492C11.1418 9.79492 11.8603 10.5134 11.8603 11.3997Z",fill:"currentColor"})]});case"markdown":return y.jsx(pn,{size:t,className:n,markTransform:zo,children:y.jsx("path",{d:"M8.7588 19.5V14.6H9.8998L11.9298 17.932H11.3278L13.3018 14.6H14.4428L14.4568 19.5H13.1828L13.1688 16.539H13.3858L11.9088 19.017H11.2928L9.7738 16.539H10.0398V19.5H8.7588ZM15.4375 19.5V14.6H17.7545C18.2958 14.6 18.7718 14.7003 19.1825 14.901C19.5932 15.1017 19.9128 15.384 20.1415 15.748C20.3748 16.112 20.4915 16.546 20.4915 17.05C20.4915 17.5493 20.3748 17.9833 20.1415 18.352C19.9128 18.716 19.5932 18.9983 19.1825 19.199C18.7718 19.3997 18.2958 19.5 17.7545 19.5H15.4375ZM16.8235 18.394H17.6985C17.9785 18.394 18.2212 18.3427 18.4265 18.24C18.6365 18.1327 18.7998 17.9787 18.9165 17.778C19.0332 17.5727 19.0915 17.33 19.0915 17.05C19.0915 16.7653 19.0332 16.5227 18.9165 16.322C18.7998 16.1213 18.6365 15.9697 18.4265 15.867C18.2212 15.7597 17.9785 15.706 17.6985 15.706H16.8235V18.394Z",fill:"currentColor"})});case"other":return y.jsx(pn,{size:t,className:n,muted:!0});case"pdf":return y.jsx(pn,{size:t,className:n,markTransform:zo,children:y.jsx("path",{d:"M6.80616 19.5V14.6H9.04616C9.49416 14.6 9.87916 14.6723 10.2012 14.817C10.5278 14.9617 10.7798 15.1717 10.9572 15.447C11.1345 15.7177 11.2232 16.0397 11.2232 16.413C11.2232 16.7817 11.1345 17.1013 10.9572 17.372C10.7798 17.6427 10.5278 17.8527 10.2012 18.002C9.87916 18.1467 9.49416 18.219 9.04616 18.219H7.57616L8.19216 17.617V19.5H6.80616ZM8.19216 17.764L7.57616 17.127H8.96216C9.2515 17.127 9.46616 17.064 9.60616 16.938C9.75083 16.812 9.82316 16.637 9.82316 16.413C9.82316 16.1843 9.75083 16.007 9.60616 15.881C9.46616 15.755 9.2515 15.692 8.96216 15.692H7.57616L8.19216 15.055V17.764ZM11.8989 19.5V14.6H14.2159C14.7573 14.6 15.2333 14.7003 15.6439 14.901C16.0546 15.1017 16.3743 15.384 16.6029 15.748C16.8363 16.112 16.9529 16.546 16.9529 17.05C16.9529 17.5493 16.8363 17.9833 16.6029 18.352C16.3743 18.716 16.0546 18.9983 15.6439 19.199C15.2333 19.3997 14.7573 19.5 14.2159 19.5H11.8989ZM13.2849 18.394H14.1599C14.4399 18.394 14.6826 18.3427 14.8879 18.24C15.0979 18.1327 15.2613 17.9787 15.3779 17.778C15.4946 17.5727 15.5529 17.33 15.5529 17.05C15.5529 16.7653 15.4946 16.5227 15.3779 16.322C15.2613 16.1213 15.0979 15.9697 14.8879 15.867C14.6826 15.7597 14.4399 15.706 14.1599 15.706H13.2849V18.394ZM17.6821 19.5V14.6H21.5251V15.671H19.0681V19.5H17.6821ZM18.9701 17.82V16.749H21.2311V17.82H18.9701Z",fill:"currentColor"})});case"ppt":return y.jsx(pn,{size:t,className:n,markTransform:zo,children:y.jsx("path",{d:"M11.0132 20.5V13.5H14.2132C14.8532 13.5 15.4032 13.6033 15.8632 13.81C16.3299 14.0167 16.6899 14.3167 16.9432 14.71C17.1966 15.0967 17.3232 15.5567 17.3232 16.09C17.3232 16.6167 17.1966 17.0733 16.9432 17.46C16.6899 17.8467 16.3299 18.1467 15.8632 18.36C15.4032 18.5667 14.8532 18.67 14.2132 18.67H12.1132L12.9932 17.81V20.5H11.0132ZM12.9932 18.02L12.1132 17.11H14.0932C14.5066 17.11 14.8132 17.02 15.0132 16.84C15.2199 16.66 15.3232 16.41 15.3232 16.09C15.3232 15.7633 15.2199 15.51 15.0132 15.33C14.8132 15.15 14.5066 15.06 14.0932 15.06H12.1132L12.9932 14.15V18.02Z",fill:"currentColor"})});case"video":return y.jsx(pn,{size:t,className:n,markTransform:c0,children:y.jsx("path",{d:"M17.5 14.634C18.1667 15.0189 18.1667 15.9811 17.5 16.366L11.5 19.8301C10.8333 20.215 10 19.7339 10 18.9641L10 12.0359C10 11.2661 10.8333 10.785 11.5 11.1699L17.5 14.634Z",fill:"currentColor"})});case"word":return y.jsx(pn,{size:t,className:n,markTransform:zo,children:y.jsx("path",{d:"M10.5118 20.5L8.24179 13.5H10.2818L12.1918 19.56H11.1618L13.1718 13.5H14.9918L16.8918 19.56H15.9018L17.8718 13.5H19.7618L17.4918 20.5H15.3718L13.7518 15.35H14.3218L12.6318 20.5H10.5118Z",fill:"currentColor"})});default:return UE(e)}}function UE(e){throw new Error(`没有字形的传统档:${String(e)}`)}function VE(e,t,n){const s=`${e} dsc-fti--${t}`;return n===void 0||n===""?s:`${s} ${n}`}function Rm(e){const{size:t=16,className:n}=e,s="path"in e?of(e.path,e.context):e.kind;return Dm(s)?y.jsx(Lm,{type:s,size:t,className:n}):FE(s,t,VE("dsc-fti",s,n))}function Lm({type:e,size:t=20,className:n}){const s=`dsc-code-icon-${I.useId().replace(/[^a-zA-Z0-9]/g,"")}`,l=Tm[e].replaceAll(km,s);return y.jsx("svg",{width:t,height:t,className:n,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,dangerouslySetInnerHTML:{__html:l}})}function C6(e){return of(e)}function cc({name:e,size:t=16,className:n}){return y.jsx(Rm,{path:e,size:t,className:n})}const qE=500,$E=1e3;function E6(){const[e,t]=I.useState(null),n=I.useRef(null),s=I.useRef(null),l=()=>{n.current!==null&&(window.clearTimeout(n.current),n.current=null)},o=()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)};return I.useEffect(()=>()=>{l(),o()},[]),{hover:e,arm:(d,p,_=520)=>{l(),o(),n.current=window.setTimeout(()=>t({item:d,anchor:p,cardWidth:_}),qE)},disarm:()=>{l(),o(),s.current=window.setTimeout(()=>t(null),$E)},keep:o,close:()=>{l(),o(),t(null)}}}var cf=W5();const YE=pa(cf),KE=Zh({__proto__:null,default:YE},[cf]);function k6(e){const{onClose:t}=e,n=I.useRef(null);return I.useEffect(()=>(n.current=document.activeElement,()=>{const s=n.current;s instanceof HTMLElement&&s.isConnected&&s.focus()}),[]),I.useEffect(()=>{const s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)}},[t]),cf.createPortal(y.jsx("div",{className:"img-lightbox",role:"dialog","aria-modal":"true","aria-label":"放大查看贴图",onClick:t,children:y.jsx("img",{src:e.src,alt:e.alt})}),document.body)}function WE(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const GE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZE={};function By(e,t){return(ZE.jsx?XE:GE).test(e)}const QE=/[ \t\n\f\r]/g;function JE(e){return typeof e=="object"?e.type==="text"?jy(e.value):!1:jy(e)}function jy(e){return e.replace(QE,"")===""}class uc{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}uc.prototype.normal={};uc.prototype.property={};uc.prototype.space=void 0;function T6(e,t){const n={},s={};for(const l of e)Object.assign(n,l.property),Object.assign(s,l.normal);return new uc(n,s,t)}function Q0(e){return e.toLowerCase()}class ki{constructor(t,n){this.attribute=n,this.property=t}}ki.prototype.attribute="";ki.prototype.booleanish=!1;ki.prototype.boolean=!1;ki.prototype.commaOrSpaceSeparated=!1;ki.prototype.commaSeparated=!1;ki.prototype.defined=!1;ki.prototype.mustUseProperty=!1;ki.prototype.number=!1;ki.prototype.overloadedBoolean=!1;ki.prototype.property="";ki.prototype.spaceSeparated=!1;ki.prototype.space=void 0;let ek=0;const Oe=Js(),Tt=Js(),J0=Js(),le=Js(),st=Js(),Ks=Js(),Pi=Js();function Js(){return 2**++ek}const ep=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Tt,commaOrSpaceSeparated:Pi,commaSeparated:Ks,number:le,overloadedBoolean:J0,spaceSeparated:st},Symbol.toStringTag,{value:"Module"})),u0=Object.keys(ep);class Nm extends ki{constructor(t,n,s,l){let o=-1;if(super(t,n),Hy(this,"space",l),typeof s=="number")for(;++o<u0.length;){const u=u0[o];Hy(this,u0[o],(s&ep[u])===ep[u])}}}Nm.prototype.defined=!0;function Hy(e,t,n){n&&(e[t]=n)}function _a(e){const t={},n={};for(const[s,l]of Object.entries(e.properties)){const o=new Nm(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),t[s]=o,n[Q0(s)]=s,n[Q0(o.attribute)]=s}return new uc(t,n,e.space)}const M6=_a({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:st,ariaCurrent:null,ariaDescribedBy:st,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:st,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:st,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:st,ariaLevel:le,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:st,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:st,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:Tt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A6(e,t){return t in e?e[t]:t}function D6(e,t){return A6(e,t.toLowerCase())}const tk=_a({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:st,accessKey:st,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alpha:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:st,autoFocus:Oe,autoPlay:Oe,blocking:st,capture:null,charSet:null,checked:Oe,cite:null,className:st,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:Tt,controls:Oe,controlsList:st,coords:le|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:J0,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:st,height:le,hidden:J0,high:le,href:null,hrefLang:null,htmlFor:st,httpEquiv:st,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:st,itemRef:st,itemScope:Oe,itemType:st,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,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:Oe,optimum:le,pattern:null,ping:st,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:st,required:Oe,reversed:Oe,rows:le,rowSpan:le,sandbox:st,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootCustomElementRegistry:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shadowRootSerializable:Oe,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:Tt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:st,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Oe,disablePictureInPicture:Oe,disableRemotePlayback:Oe,exportParts:Ks,part:st,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:D6}),ik=_a({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pi,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:st,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:Ks,g2:Ks,glyphName:Ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:st,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pi,rev:Pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pi,requiredFeatures:Pi,requiredFonts:Pi,requiredFormats:Pi,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pi,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A6}),O6=_a({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()}}),R6=_a({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D6}),L6=_a({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),nk={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"},rk=/[A-Z]/g,Iy=/-[a-z]/g,sk=/^data[-\w.:]+$/i;function lk(e,t){const n=Q0(t);let s=t,l=ki;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&sk.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Iy,ok);s="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Iy.test(o)){let u=o.replace(rk,ak);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Nm}return new l(s,t)}function ak(e){return"-"+e.toLowerCase()}function ok(e){return e.charAt(1).toUpperCase()}const ck=T6([M6,tk,O6,R6,L6],"html"),zm=T6([M6,ik,O6,R6,L6],"svg");function uk(e){return e.join(" ").trim()}var Zl={},h0,Py;function hk(){if(Py)return h0;Py=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,h=/^\s+|\s+$/g,d=`
27
+ `,p="/",_="*",g="",S="comment",v="declaration";function w(E,M){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];M=M||{};var P=1,N=1;function X(Z){var F=Z.match(t);F&&(P+=F.length);var H=Z.lastIndexOf(d);N=~H?Z.length-H:N+Z.length}function Q(){var Z={line:P,column:N};return function(F){return F.position=new R(Z),me(),F}}function R(Z){this.start=Z,this.end={line:P,column:N},this.source=M.source}R.prototype.content=E;function V(Z){var F=new Error(M.source+":"+P+":"+N+": "+Z);if(F.reason=Z,F.filename=M.source,F.line=P,F.column=N,F.source=E,!M.silent)throw F}function se(Z){var F=Z.exec(E);if(F){var H=F[0];return X(H),E=E.slice(H.length),F}}function me(){se(n)}function k(Z){var F;for(Z=Z||[];F=K();)F!==!1&&Z.push(F);return Z}function K(){var Z=Q();if(!(p!=E.charAt(0)||_!=E.charAt(1))){for(var F=2;g!=E.charAt(F)&&(_!=E.charAt(F)||p!=E.charAt(F+1));)++F;if(F+=2,g===E.charAt(F-1))return V("End of comment missing");var H=E.slice(2,F-2);return N+=2,X(H),E=E.slice(F),N+=2,Z({type:S,comment:H})}}function W(){var Z=Q(),F=se(s);if(F){if(K(),!se(l))return V("property missing ':'");var H=se(o),ie=Z({type:v,property:x(F[0].replace(e,g)),value:H?x(H[0].replace(e,g)):g});return se(u),ie}}function q(){var Z=[];k(Z);for(var F;F=W();)F!==!1&&(Z.push(F),k(Z));return Z}return me(),q()}function x(E){return E?E.replace(h,g):g}return h0=w,h0}var Fy;function fk(){if(Fy)return Zl;Fy=1;var e=Zl&&Zl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.default=n;const t=e(hk());function n(s,l){let o=null;if(!s||typeof s!="string")return o;const u=(0,t.default)(s),h=typeof l=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:_}=d;h?l(p,_,d):_&&(o=o||{},o[p]=_)}),o}return Zl}var Co={},Uy;function dk(){if(Uy)return Co;Uy=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(p){return!p||n.test(p)||e.test(p)},u=function(p,_){return _.toUpperCase()},h=function(p,_){return"".concat(_,"-")},d=function(p,_){return _===void 0&&(_={}),o(p)?p:(p=p.toLowerCase(),_.reactCompat?p=p.replace(l,h):p=p.replace(s,h),p.replace(t,u))};return Co.camelCase=d,Co}var Eo,Vy;function pk(){if(Vy)return Eo;Vy=1;var e=Eo&&Eo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(fk()),n=dk();function s(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(h,d){h&&d&&(u[(0,n.camelCase)(h,o)]=d)}),u}return s.default=s,Eo=s,Eo}var mk=pk();const gk=pa(mk),N6=z6("end"),Bm=z6("start");function z6(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function _k(e){const t=Bm(e),n=N6(e);if(t&&n)return{start:t,end:n}}function Uo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qy(e.position):"start"in e||"end"in e?qy(e):"line"in e||"column"in e?tp(e):""}function tp(e){return $y(e&&e.line)+":"+$y(e&&e.column)}function qy(e){return tp(e&&e.start)+"-"+tp(e&&e.end)}function $y(e){return e&&typeof e=="number"?e:1}class ai extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof s=="string"){const d=s.indexOf(":");d===-1?o.ruleId=s:(o.source=s.slice(0,d),o.ruleId=s.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const h=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=h?h.line:void 0,this.name=Uo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ai.prototype.file="";ai.prototype.name="";ai.prototype.reason="";ai.prototype.message="";ai.prototype.stack="";ai.prototype.column=void 0;ai.prototype.line=void 0;ai.prototype.ancestors=void 0;ai.prototype.cause=void 0;ai.prototype.fatal=void 0;ai.prototype.place=void 0;ai.prototype.ruleId=void 0;ai.prototype.source=void 0;const jm={}.hasOwnProperty,vk=new Map,yk=/[A-Z]/g,Sk=new Set(["table","tbody","thead","tfoot","tr"]),bk=new Set(["td","th"]),B6="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Dk(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");s=Ak(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?zm:ck,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=j6(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function j6(e,t,n){if(t.type==="element")return xk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ck(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kk(e,t,n);if(t.type==="mdxjsEsm")return Ek(e,t);if(t.type==="root")return Tk(e,t,n);if(t.type==="text")return Mk(e,t)}function xk(e,t,n){const s=e.schema;let l=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=zm,e.schema=l),e.ancestors.push(t);const o=I6(e,t.tagName,!1),u=Ok(e,t);let h=Im(e,t);return Sk.has(t.tagName)&&(h=h.filter(function(d){return typeof d=="string"?!JE(d):!0})),H6(e,u,o,t),Hm(u,h),e.ancestors.pop(),e.schema=s,e.create(t,o,u,n)}function Ck(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Qo(e,t.position)}function Ek(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qo(e,t.position)}function kk(e,t,n){const s=e.schema;let l=s;t.name==="svg"&&s.space==="html"&&(l=zm,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:I6(e,t.name,!0),u=Rk(e,t),h=Im(e,t);return H6(e,u,o,t),Hm(u,h),e.ancestors.pop(),e.schema=s,e.create(t,o,u,n)}function Tk(e,t,n){const s={};return Hm(s,Im(e,t)),e.create(t,e.Fragment,s,n)}function Mk(e,t){return t.value}function H6(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Hm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ak(e,t,n){return s;function s(l,o,u,h){const p=Array.isArray(u.children)?n:t;return h?p(o,u,h):p(o,u)}}function Dk(e,t){return n;function n(s,l,o,u){const h=Array.isArray(o.children),d=Bm(s);return t(l,o,u,h,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Ok(e,t){const n={};let s,l;for(l in t.properties)if(l!=="children"&&jm.call(t.properties,l)){const o=Lk(e,l,t.properties[l]);if(o){const[u,h]=o;e.tableCellAlignToStyle&&u==="align"&&typeof h=="string"&&bk.has(t.tagName)?s=h:n[u]=h}}if(s){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function Rk(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const o=s.data.estree.body[0];o.type;const u=o.expression;u.type;const h=u.properties[0];h.type,Object.assign(n,e.evaluater.evaluateExpression(h.argument))}else Qo(e,t.position);else{const l=s.name;let o;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const h=s.value.data.estree.body[0];h.type,o=e.evaluater.evaluateExpression(h.expression)}else Qo(e,t.position);else o=s.value===null?!0:s.value;n[l]=o}return n}function Im(e,t){const n=[];let s=-1;const l=e.passKeys?new Map:vk;for(;++s<t.children.length;){const o=t.children[s];let u;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const p=l.get(d)||0;u=d+"-"+p,l.set(d,p+1)}}const h=j6(e,o,u);h!==void 0&&n.push(h)}return n}function Lk(e,t,n){const s=lk(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?WE(n):uk(n)),s.property==="style"){let l=typeof n=="object"?n:Nk(e,String(n));return e.stylePropertyNameCase==="css"&&(l=zk(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?nk[s.property]||s.property:s.attribute,n]}}function Nk(e,t){try{return gk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,l=new ai("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=B6+"#cannot-parse-style-attribute",l}}function I6(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const h=By(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:h,computed:!!(o&&h.type==="Literal"),optional:!1}:h}s=u}else s=By(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const l=s.value;return jm.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Qo(e)}function Qo(e,t){const n=new ai("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=B6+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zk(e){const t={};let n;for(n in e)jm.call(e,n)&&(t[Bk(n)]=e[n]);return t}function Bk(e){let t=e.replace(yk,jk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jk(e){return"-"+e.toLowerCase()}const f0={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"]},Hk={};function Pm(e,t){const n=Hk,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return P6(e,s,l)}function P6(e,t,n){if(Ik(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 Yy(e.children,t,n)}return Array.isArray(e)?Yy(e,t,n):""}function Yy(e,t,n){const s=[];let l=-1;for(;++l<e.length;)s[l]=P6(e[l],t,n);return s.join("")}function Ik(e){return!!(e&&typeof e=="object")}const Ky=document.createElement("i");function Fm(e){const t="&"+e+";";Ky.innerHTML=t;const n=Ky.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mn(e,t,n,s){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,s.length<1e4)u=Array.from(s),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<s.length;)u=s.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function rn(e,t){return e.length>0?(mn(e,e.length,0,t),e):t}const Wy={}.hasOwnProperty;function F6(e){const t={};let n=-1;for(;++n<e.length;)Pk(t,e[n]);return t}function Pk(e,t){let n;for(n in t){const l=(Wy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){Wy.call(l,u)||(l[u]=[]);const h=o[u];Fk(l[u],Array.isArray(h)?h:h?[h]:[])}}}function Fk(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);mn(e,0,0,s)}function U6(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ii=us(/[A-Za-z]/),ri=us(/[\dA-Za-z]/),Uk=us(/[#-'*+\--9=?A-Z^-~]/);function Th(e){return e!==null&&(e<32||e===127)}const ip=us(/\d/),Vk=us(/[\dA-Fa-f]/),V6=us(/[!-/:-@[-`{-~]/);function ke(e){return e!==null&&e<-2}function lt(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const uf=us(/\p{P}|\p{S}/u),Gs=us(/\s/);function us(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function va(e){const t=[];let n=-1,s=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&ri(e.charCodeAt(n+1))&&ri(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const h=e.charCodeAt(n+1);o<56320&&h>56319&&h<57344?(u=String.fromCharCode(o,h),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(s,n),encodeURIComponent(u)),s=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(s)}function Ke(e,t,n,s){const l=s?s-1:1/0;let o=0;return u;function u(d){return Ie(d)?(e.enter(n),h(d)):t(d)}function h(d){return Ie(d)&&o++<l?(e.consume(d),h):(e.exit(n),t(d))}}function q6(e,t,n,s,l,o){let u=0;return h;function h(_){return Ie(_)?(e.enter(s),d(_)):p(_)}function d(_){return Ie(_)&&u<o?(e.consume(_),u++,d):(e.exit(s),p(_))}function p(_){return u>=l?t(_):n(_)}}const qk={tokenize:$k};function $k(e){const t=e.attempt(this.parser.constructs.contentInitial,s,l);let n;return t;function s(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ke(e,t,"linePrefix")}function l(h){return e.enter("paragraph"),o(h)}function o(h){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,u(h)}function u(h){if(h===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(h);return}return ke(h)?(e.consume(h),e.exit("chunkText"),o):(e.consume(h),u)}}let Mh=class{constructor(){this.index=new Map,this.map=[]}add(t,n,s){Gy(this,t,n,s,!1)}addBefore(t,n,s){Gy(this,t,n,s,!0)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let l=s.pop();for(;l;){for(const o of l)t.push(o);l=s.pop()}this.map.length=0,this.index.clear()}};function Gy(e,t,n,s,l){if(n===0&&s.length===0)return;const o=e.index.get(t);if(o){o[1]+=n,l?(s.push(...o[2]),o[2]=s):o[2].push(...s);return}const u=[t,n,s];e.map.push(u),e.index.set(t,u)}const Yk={tokenize:Kk},Xy={tokenize:Wk};function Kk(e){const t=this,n=[];let s=0,l,o,u;return h;function h(N){if(s<n.length){const X=n[s];return t.containerState=X[1],e.attempt(X[0].continuation,d,p)(N)}return p(N)}function d(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&P();const X=t.events.length;let Q=X,R;for(;Q--;)if(t.events[Q][0]==="exit"&&t.events[Q][1].type==="chunkFlow"){R=t.events[Q][1].end;break}M(s);let V=X;for(;V<t.events.length;)t.events[V][1].end={...R},V++;const se=new Mh;return se.add(Q+1,0,t.events.slice(X)),se.add(X,V-X,[]),se.consume(t.events),p(N)}return h(N)}function p(N){if(s===n.length){if(!l)return S(N);if(l.currentConstruct&&l.currentConstruct.concrete)return w(N);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xy,_,g)(N)}function _(N){return l&&P(),M(s),S(N)}function g(N){return t.parser.lazy[t.now().line]=s!==n.length,u=t.now().offset,w(N)}function S(N){return t.containerState={},e.attempt(Xy,v,w)(N)}function v(N){return s++,n.push([t.currentConstruct,t.containerState]),S(N)}function w(N){if(N===null){l&&P(),M(0),e.consume(N);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),x(N)}function x(N){if(N===null){E(e.exit("chunkFlow"),!0),M(0),e.consume(N);return}return ke(N)?(e.consume(N),E(e.exit("chunkFlow")),s=0,t.interrupt=void 0,h):(e.consume(N),x)}function E(N,X){const Q=t.sliceStream(N);if(X&&Q.push(null),N.previous=o,o&&(o.next=N),o=N,l.defineSkip(N.start),l.write(Q),t.parser.lazy[N.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const V=t.events.length;let se=V,me,k;for(;se--;)if(t.events[se][0]==="exit"&&t.events[se][1].type==="chunkFlow"){if(me){k=t.events[se][1].end;break}me=!0}for(M(s),R=V;R<t.events.length;)t.events[R][1].end={...k},R++;const K=new Mh;K.add(se+1,0,t.events.slice(V)),K.add(V,R-V,[]),K.consume(t.events)}}function M(N){let X=n.length;for(;X-- >N;){const Q=n[X];t.containerState=Q[1],Q[0].exit.call(t,e)}n.length=N}function P(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function Wk(e,t,n){return Ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function os(e){if(e===null||lt(e)||Gs(e))return 1;if(uf(e))return 2}function hf(e,t,n){const s=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!s.includes(o)&&(t=o(t,n),s.push(o))}return t}const np={name:"attention",resolveAll:Gk,tokenize:Xk};function Gk(e,t){let n=-1,s;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let l=n;for(;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&t.sliceSerialize(e[l][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[l][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const o=e[l][1].end.offset-e[l][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,u={...e[l][1].end},h={...e[n][1].start};Zy(u,-o),Zy(h,o);const d={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[l][1].end}},p={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},_={type:o>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[n][1].start}},g={type:o>1?"strong":"emphasis",start:{...d.start},end:{...p.end}};e[l][1].end={...d.start},e[n][1].start={...p.end},s=[],e[l][1].end.offset-e[l][1].start.offset&&(s=rn(s,[["enter",e[l][1],t],["exit",e[l][1],t]])),s=rn(s,[["enter",g,t],["enter",d,t],["exit",d,t],["enter",_,t]]),s=rn(s,hf(t.parser.constructs.insideSpan.null,e.slice(l+1,n),t)),s=rn(s,[["exit",_,t],["enter",p,t],["exit",p,t],["exit",g,t]]);let S=0;e[n][1].end.offset-e[n][1].start.offset&&(S=2,s=rn(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),mn(e,l-1,n-l+3,s),n=l+s.length-S-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Xk(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,l=os(s);let o;return u;function u(d){return o=d,e.enter("attentionSequence"),h(d)}function h(d){if(d===o)return e.consume(d),h;const p=e.exit("attentionSequence"),_=os(d),g=!_||_===2&&l||n.includes(d)&&d!==42&&d!==95,S=!l||l===2&&_||n.includes(s)&&s!==42&&s!==95;return p._open=!!(o===42?g:g&&(l||!S)),p._close=!!(o===42?S:S&&(_||!g)),t(d)}}function Zy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Zk={name:"autolink",tokenize:Qk};function Qk(e,t,n){let s=0;return l;function l(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return ii(v)?(e.consume(v),u):v===64?n(v):p(v)}function u(v){return v===43||v===45||v===46||ri(v)?(s=1,h(v)):p(v)}function h(v){return v===58?(e.consume(v),s=0,d):(v===43||v===45||v===46||ri(v))&&s++<32?(e.consume(v),h):(s=0,p(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Th(v)?n(v):(e.consume(v),d)}function p(v){return v===64?(e.consume(v),_):Uk(v)?(e.consume(v),p):n(v)}function _(v){return ri(v)?g(v):n(v)}function g(v){return v===46?(e.consume(v),s=0,_):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):S(v)}function S(v){if((v===45||ri(v))&&s++<63){const w=v===45?S:g;return e.consume(v),w}return n(v)}}const hc={partial:!0,tokenize:Jk};function Jk(e,t,n){return s;function s(o){return Ie(o)?Ke(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||ke(o)?t(o):n(o)}}const $6={continuation:{tokenize:tT},exit:iT,name:"blockQuote",tokenize:eT};function eT(e,t,n){const s=this;return l;function l(u){if(u===62){const h=s.containerState;return h.open||(e.enter("blockQuote",{_container:!0}),h.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Ie(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function tT(e,t,n){const s=this;return l;function l(u){return Ie(u)?Ke(e,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt($6,t,n)(u)}}function iT(e){e.exit("blockQuote")}const Y6={name:"characterEscape",tokenize:nT};function nT(e,t,n){return s;function s(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return V6(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const K6={name:"characterReference",tokenize:rT};function rT(e,t,n){const s=this;let l=0,o,u;return h;function h(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,u=ri,_(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=Vk,_):(e.enter("characterReferenceValue"),o=7,u=ip,_(g))}function _(g){if(g===59&&l){const S=e.exit("characterReferenceValue");return u===ri&&!Fm(s.sliceSerialize(S))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),_):n(g)}}const rp={partial:!0,tokenize:sT};function sT(e,t,n){const s=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return s.parser.lazy[s.now().line]?n(u):t(u)}}const Qy={concrete:!0,name:"codeFenced",tokenize:lT};function lT(e,t,n){const s=this,l={partial:!0,tokenize:Q};let o=0,u=0,h;return d;function d(R){return p(R)}function p(R){const V=s.events[s.events.length-1];return o=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,h=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),_(R)}function _(R){return R===h?(u++,e.consume(R),_):u<3?n(R):(e.exit("codeFencedFenceSequence"),Ie(R)?Ke(e,g,"whitespace")(R):g(R))}function g(R){return R===null||ke(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(rp,x,X)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||ke(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):Ie(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ke(e,v,"whitespace")(R)):R===96&&R===h?n(R):(e.consume(R),S)}function v(R){return R===null||ke(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(R))}function w(R){return R===null||ke(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===h?n(R):(e.consume(R),w)}function x(R){return e.attempt(l,X,E)(R)}function E(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),M}function M(R){return o>0&&Ie(R)?Ke(e,P,"linePrefix",o+1)(R):P(R)}function P(R){return R===null||ke(R)?e.check(rp,x,X)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||ke(R)?(e.exit("codeFlowValue"),P(R)):(e.consume(R),N)}function X(R){return e.exit("codeFenced"),t(R)}function Q(R,V,se){let me=0;return k;function k(F){return R.enter("lineEnding"),R.consume(F),R.exit("lineEnding"),K}function K(F){return R.enter("codeFencedFence"),Ie(F)?Ke(R,W,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):W(F)}function W(F){return F===h?(R.enter("codeFencedFenceSequence"),q(F)):se(F)}function q(F){return F===h?(me++,R.consume(F),q):me>=u?(R.exit("codeFencedFenceSequence"),Ie(F)?Ke(R,Z,"whitespace")(F):Z(F)):se(F)}function Z(F){return F===null||ke(F)?(R.exit("codeFencedFence"),V(F)):se(F)}}}const d0={name:"codeIndented",tokenize:oT},aT={partial:!0,tokenize:cT};function oT(e,t,n){return s;function s(h){return e.enter("codeIndented"),q6(e,l,n,"linePrefix",4,4)(h)}function l(h){return h===null?u(h):ke(h)?e.attempt(aT,l,u)(h):(e.enter("codeFlowValue"),o(h))}function o(h){return h===null||ke(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),o)}function u(h){return e.exit("codeIndented"),t(h)}}function cT(e,t,n){const s=this;return l;function l(u){return s.parser.lazy[s.now().line]?n(u):ke(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):q6(e,t,o,"linePrefix",4,4)(u)}function o(u){return ke(u)?l(u):n(u)}}const uT={name:"codeText",previous:fT,resolve:hT,tokenize:dT};function hT(e){let t=e.length-4,n=3,s,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)l===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(l=s):(s===t||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),t-=s-l-2,s=l+2),l=void 0);return e}function fT(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dT(e,t,n){let s=0,l,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),h(g)}function h(g){return g===96?(e.consume(g),s++,h):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),l=0,_(g)):ke(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||ke(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),p)}function _(g){return g===96?(e.consume(g),l++,_):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",p(g))}}class pT{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 s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&ko(this.left,s),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ko(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);ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ko(this.left,n.reverse())}}}function ko(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 W6(e){const t={};let n=-1,s,l,o,u,h,d,p;const _=new pT(e);for(;++n<_.length;){for(;n in t;)n=t[n];if(s=_.get(n),n&&s[1].type==="chunkFlow"&&_.get(n-1)[1].type==="listItemPrefix"&&(d=s[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,mT(_,n)),n=t[n],p=!0);else if(s[1]._container){for(o=n,l=void 0;o--;)if(u=_.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(_.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(s[1].end={..._.get(l)[1].start},h=_.slice(l,n),h.unshift(s),_.splice(l,n-l+1,h))}}return mn(e,0,Number.POSITIVE_INFINITY,_.slice(0)),!p}function mT(e,t){const n=e.get(t)[1],s=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const h=u.events,d=[],p={};let _,g,S=-1,v=n,w=0,x=0;const E=[x];for(;v;){for(;e.get(++l)[1]!==v;);o.push(l),v._tokenizer||(_=s.sliceStream(v),v.next||_.push(null),g&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(_),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(x=S+1,E.push(x),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),S=E.length;S--;){const M=h.slice(E[S],E[S+1]),P=o.pop();d.push([P,P+M.length-1]),e.splice(P,2,M)}for(d.reverse(),S=-1;++S<d.length;)p[w+d[S][0]]=w+d[S][1],w+=d[S][1]-d[S][0]-1;return p}const gT={resolve:vT,tokenize:yT},_T={partial:!0,tokenize:ST};function vT(e){return W6(e),e}function yT(e,t){let n;return s;function s(h){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(h)}function l(h){return h===null?o(h):ke(h)?e.check(_T,u,o)(h):(e.consume(h),l)}function o(h){return e.exit("chunkContent"),e.exit("content"),t(h)}function u(h){return e.consume(h),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function ST(e,t,n){const s=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ke(e,o,"linePrefix")}function o(u){if(u===null||ke(u))return n(u);const h=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?t(u):e.interrupt(s.parser.constructs.flow,n,t)(u)}}function G6(e,t,n,s,l,o,u,h,d){const p=d||Number.POSITIVE_INFINITY;let _=0;return g;function g(M){return M===60?(e.enter(s),e.enter(l),e.enter(o),e.consume(M),e.exit(o),S):M===null||M===32||M===41||Th(M)?n(M):(e.enter(s),e.enter(u),e.enter(h),e.enter("chunkString",{contentType:"string"}),x(M))}function S(M){return M===62?(e.enter(o),e.consume(M),e.exit(o),e.exit(l),e.exit(s),t):(e.enter(h),e.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===62?(e.exit("chunkString"),e.exit(h),S(M)):M===null||M===60||ke(M)?n(M):(e.consume(M),M===92?w:v)}function w(M){return M===60||M===62||M===92?(e.consume(M),v):v(M)}function x(M){return!_&&(M===null||M===41||lt(M))?(e.exit("chunkString"),e.exit(h),e.exit(u),e.exit(s),t(M)):_<p&&M===40?(e.consume(M),_++,x):M===41?(e.consume(M),_--,x):M===null||M===32||M===40||Th(M)?n(M):(e.consume(M),M===92?E:x)}function E(M){return M===40||M===41||M===92?(e.consume(M),x):x(M)}}function X6(e,t,n,s,l,o){const u=this;let h=0,d;return p;function p(v){return e.enter(s),e.enter(l),e.consume(v),e.exit(l),e.enter(o),_}function _(v){return h>999||v===null||v===91||v===93&&!d||v===94&&!h&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(o),e.enter(l),e.consume(v),e.exit(l),e.exit(s),t):ke(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||ke(v)||h++>999?(e.exit("chunkString"),_(v)):(e.consume(v),d||(d=!Ie(v)),v===92?S:g)}function S(v){return v===91||v===92||v===93?(e.consume(v),h++,g):g(v)}}function Z6(e,t,n,s,l,o){let u;return h;function h(S){return S===34||S===39||S===40?(e.enter(s),e.enter(l),e.consume(S),e.exit(l),u=S===40?41:S,d):n(S)}function d(S){return S===u?(e.enter(l),e.consume(S),e.exit(l),e.exit(s),t):(e.enter(o),p(S))}function p(S){return S===u?(e.exit(o),d(u)):S===null?n(S):ke(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),Ke(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(S))}function _(S){return S===u||S===null||ke(S)?(e.exit("chunkString"),p(S)):(e.consume(S),S===92?g:_)}function g(S){return S===u||S===92?(e.consume(S),_):_(S)}}function Vo(e,t){let n;return s;function s(l){return ke(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,s):Ie(l)?Ke(e,s,n?"linePrefix":"lineSuffix")(l):t(l)}}const bT={name:"definition",tokenize:xT},wT={partial:!0,tokenize:CT};function xT(e,t,n){const s=this;let l;return o;function o(v){return e.enter("definition"),u(v)}function u(v){return X6.call(s,e,h,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function h(v){return l=gn(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return lt(v)?Vo(e,p)(v):p(v)}function p(v){return G6(e,_,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function _(v){return e.attempt(wT,g,g)(v)}function g(v){return Ie(v)?Ke(e,S,"whitespace")(v):S(v)}function S(v){return v===null||ke(v)?(e.exit("definition"),s.parser.defined.push(l),t(v)):n(v)}}function CT(e,t,n){return s;function s(h){return lt(h)?Vo(e,l)(h):n(h)}function l(h){return Z6(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function o(h){return Ie(h)?Ke(e,u,"whitespace")(h):u(h)}function u(h){return h===null||ke(h)?t(h):n(h)}}const ET={name:"hardBreakEscape",tokenize:kT};function kT(e,t,n){return s;function s(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return ke(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const TT={name:"headingAtx",resolve:MT,tokenize:AT};function MT(e,t){let n=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s){const l={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},o={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"};mn(e,s,n-s+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])}return e}function AT(e,t,n){let s=0;return l;function l(_){return e.enter("atxHeading"),o(_)}function o(_){return e.enter("atxHeadingSequence"),u(_)}function u(_){return _===35&&s++<6?(e.consume(_),u):_===null||lt(_)?(e.exit("atxHeadingSequence"),h(_)):n(_)}function h(_){return _===35?(e.enter("atxHeadingSequence"),d(_)):_===null||ke(_)?(e.exit("atxHeading"),t(_)):Ie(_)?Ke(e,h,"whitespace")(_):(e.enter("atxHeadingText"),p(_))}function d(_){return _===35?(e.consume(_),d):(e.exit("atxHeadingSequence"),h(_))}function p(_){return _===null||_===35||lt(_)?(e.exit("atxHeadingText"),h(_)):(e.consume(_),p)}}const Q6=["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"],sp=["pre","script","style","textarea"],DT={concrete:!0,name:"htmlFlow",resolveTo:RT,tokenize:LT},OT={partial:!0,tokenize:NT};function RT(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 LT(e,t,n){const s=this;let l,o,u,h,d;return p;function p(O){return _(O)}function _(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),S):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),l=3,s.interrupt?t:T):ii(O)?(e.consume(O),u=String.fromCharCode(O),E):n(O)}function S(O){return O===45?(e.consume(O),l=2,v):O===91?(e.consume(O),l=5,h=0,w):ii(O)?(e.consume(O),l=4,s.interrupt?t:T):n(O)}function v(O){return O===45?(e.consume(O),s.interrupt?t:T):n(O)}function w(O){const D="CDATA[";return O===D.charCodeAt(h++)?(e.consume(O),h===D.length?s.interrupt?t:W:w):n(O)}function x(O){return ii(O)?(e.consume(O),u=String.fromCharCode(O),E):n(O)}function E(O){if(O===null||O===47||O===62||lt(O)){const D=O===47,ne=u.toLowerCase();return!D&&!o&&sp.includes(ne)?(l=1,s.interrupt?t(O):W(O)):Q6.includes(u.toLowerCase())?(l=6,D?(e.consume(O),M):s.interrupt?t(O):W(O)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(O):o?P(O):N(O))}return O===45||ri(O)?(e.consume(O),u+=String.fromCharCode(O),E):n(O)}function M(O){return O===62?(e.consume(O),s.interrupt?t:W):n(O)}function P(O){return Ie(O)?(e.consume(O),P):k(O)}function N(O){return O===47?(e.consume(O),k):O===58||O===95||ii(O)?(e.consume(O),X):Ie(O)?(e.consume(O),N):k(O)}function X(O){return O===45||O===46||O===58||O===95||ri(O)?(e.consume(O),X):Q(O)}function Q(O){return O===61?(e.consume(O),R):Ie(O)?(e.consume(O),Q):N(O)}function R(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,V):Ie(O)?(e.consume(O),R):se(O)}function V(O){return O===d?(e.consume(O),d=null,me):O===null||ke(O)?n(O):(e.consume(O),V)}function se(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||lt(O)?Q(O):(e.consume(O),se)}function me(O){return O===47||O===62||Ie(O)?N(O):n(O)}function k(O){return O===62?(e.consume(O),K):n(O)}function K(O){return O===null||ke(O)?W(O):Ie(O)?(e.consume(O),K):n(O)}function W(O){return O===45&&l===2?(e.consume(O),H):O===60&&l===1?(e.consume(O),ie):O===62&&l===4?(e.consume(O),ze):O===63&&l===3?(e.consume(O),T):O===93&&l===5?(e.consume(O),oe):ke(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(OT,We,q)(O)):O===null||ke(O)?(e.exit("htmlFlowData"),q(O)):(e.consume(O),W)}function q(O){return e.check(rp,Z,We)(O)}function Z(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),F}function F(O){return O===null||ke(O)?q(O):(e.enter("htmlFlowData"),W(O))}function H(O){return O===45?(e.consume(O),T):W(O)}function ie(O){return O===47?(e.consume(O),u="",$):W(O)}function $(O){if(O===62){const D=u.toLowerCase();return sp.includes(D)?(e.consume(O),ze):W(O)}return ii(O)&&u.length<8?(e.consume(O),u+=String.fromCharCode(O),$):W(O)}function oe(O){return O===93?(e.consume(O),T):W(O)}function T(O){return O===62?(e.consume(O),ze):O===45&&l===2?(e.consume(O),T):W(O)}function ze(O){return O===null||ke(O)?(e.exit("htmlFlowData"),We(O)):(e.consume(O),ze)}function We(O){return e.exit("htmlFlow"),t(O)}}function NT(e,t,n){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(hc,t,n)}}const zT={name:"htmlText",tokenize:BT};function BT(e,t,n){const s=this;let l,o,u;return h;function h(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),Q):T===63?(e.consume(T),N):ii(T)?(e.consume(T),se):n(T)}function p(T){return T===45?(e.consume(T),_):T===91?(e.consume(T),o=0,w):ii(T)?(e.consume(T),P):n(T)}function _(T){return T===45?(e.consume(T),v):n(T)}function g(T){return T===null?n(T):T===45?(e.consume(T),S):ke(T)?(u=g,ie(T)):(e.consume(T),g)}function S(T){return T===45?(e.consume(T),v):g(T)}function v(T){return T===62?H(T):T===45?S(T):g(T)}function w(T){const ze="CDATA[";return T===ze.charCodeAt(o++)?(e.consume(T),o===ze.length?x:w):n(T)}function x(T){return T===null?n(T):T===93?(e.consume(T),E):ke(T)?(u=x,ie(T)):(e.consume(T),x)}function E(T){return T===93?(e.consume(T),M):x(T)}function M(T){return T===62?H(T):T===93?(e.consume(T),M):x(T)}function P(T){return T===null||T===62?H(T):ke(T)?(u=P,ie(T)):(e.consume(T),P)}function N(T){return T===null?n(T):T===63?(e.consume(T),X):ke(T)?(u=N,ie(T)):(e.consume(T),N)}function X(T){return T===62?H(T):N(T)}function Q(T){return ii(T)?(e.consume(T),R):n(T)}function R(T){return T===45||ri(T)?(e.consume(T),R):V(T)}function V(T){return ke(T)?(u=V,ie(T)):Ie(T)?(e.consume(T),V):H(T)}function se(T){return T===45||ri(T)?(e.consume(T),se):T===47||T===62||lt(T)?me(T):n(T)}function me(T){return T===47?(e.consume(T),H):T===58||T===95||ii(T)?(e.consume(T),k):ke(T)?(u=me,ie(T)):Ie(T)?(e.consume(T),me):H(T)}function k(T){return T===45||T===46||T===58||T===95||ri(T)?(e.consume(T),k):K(T)}function K(T){return T===61?(e.consume(T),W):ke(T)?(u=K,ie(T)):Ie(T)?(e.consume(T),K):me(T)}function W(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,q):ke(T)?(u=W,ie(T)):Ie(T)?(e.consume(T),W):(e.consume(T),Z)}function q(T){return T===l?(e.consume(T),l=void 0,F):T===null?n(T):ke(T)?(u=q,ie(T)):(e.consume(T),q)}function Z(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||lt(T)?me(T):(e.consume(T),Z)}function F(T){return T===47||T===62||lt(T)?me(T):n(T)}function H(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ie(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return Ie(T)?Ke(e,oe,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):oe(T)}function oe(T){return e.enter("htmlTextData"),u(T)}}const Um={name:"labelEnd",resolveAll:PT,resolveTo:FT,tokenize:UT},jT={tokenize:VT},HT={tokenize:qT},IT={tokenize:$T};function PT(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",t+=l}}return e.length!==n.length&&mn(e,0,e.length,n),e}function FT(e,t){let n=e.length,s=0,l,o,u;for(;n--;){const _=e[n][1];if(l){if(_.type==="link"||_.type==="labelLink"&&_._inactive)break;e[n][0]==="enter"&&_.type==="labelLink"&&(_._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(_.type==="labelImage"||_.type==="labelLink")&&!_._balanced&&(l=n,_.type!=="labelLink")){s=2;break}}else _.type==="labelEnd"&&(o=n)}const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[l+s+2][1].end},end:{...e[o-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=rn(u,e.slice(l+1,l+s+3)),u=rn(u,[["enter",p,t]]),u=rn(u,hf(t.parser.constructs.insideSpan.null,e.slice(l+s+4,o-3),t)),u=rn(u,[["exit",p,t],e[o-2],e[o-1],["exit",d,t]]),u=rn(u,e.slice(o+1)),u=rn(u,[["exit",h,t]]),mn(e,l,e.length,u),e}function UT(e,t,n){const s=this,l=s._labelStarts;let o,u;if(l){for(;l.length>0&&l[l.length-1]._balanced;)l.pop();o=l[l.length-1]}return h;function h(S){return o?o._inactive?g(S):(u=s.parser.defined.includes(gn(s.sliceSerialize({start:o.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),d):n(S)}function d(S){return S===40?e.attempt(jT,_,u?_:g)(S):S===91?e.attempt(HT,_,u?p:g)(S):u?_(S):g(S)}function p(S){return e.attempt(IT,_,g)(S)}function _(S){return l.pop(),t(S)}function g(S){return o._balanced=!0,n(S)}}function VT(e,t,n){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return lt(g)?Vo(e,o)(g):o(g)}function o(g){return g===41?_(g):G6(e,u,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return lt(g)?Vo(e,d)(g):_(g)}function h(g){return n(g)}function d(g){return g===34||g===39||g===40?Z6(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):_(g)}function p(g){return lt(g)?Vo(e,_)(g):_(g)}function _(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function qT(e,t,n){const s=this;return l;function l(h){return X6.call(s,e,o,u,"reference","referenceMarker","referenceString")(h)}function o(h){return s.parser.defined.includes(gn(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(h):n(h)}function u(h){return n(h)}}function $T(e,t,n){return s;function s(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const YT={name:"labelStartImage",resolveAll:Um.resolveAll,tokenize:KT};function KT(e,t,n){const s=this;let l;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),l=e.exit("labelImage"),h):n(d)}function h(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),t(d))}}const WT={name:"labelStartLink",resolveAll:Um.resolveAll,tokenize:GT};function GT(e,t,n){const s=this;let l;return o;function o(h){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),l=e.exit("labelLink"),u}function u(h){return h===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(l),t(h))}}const p0={name:"lineEnding",tokenize:XT};function XT(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ke(e,t,"linePrefix")}}const hh={name:"thematicBreak",tokenize:ZT};function ZT(e,t,n){let s=0,l;return o;function o(p){return e.enter("thematicBreak"),u(p)}function u(p){return l=p,h(p)}function h(p){return p===l?(e.enter("thematicBreakSequence"),d(p)):s>=3&&(p===null||ke(p))?(e.exit("thematicBreak"),t(p)):n(p)}function d(p){return p===l?(e.consume(p),s++,d):(e.exit("thematicBreakSequence"),Ie(p)?Ke(e,h,"whitespace")(p):h(p))}}const Ei={continuation:{tokenize:tM},exit:nM,name:"list",tokenize:eM},QT={partial:!0,tokenize:rM},JT={partial:!0,tokenize:iM};function eM(e,t,n){const s=this,l=s.events[s.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return h;function h(v){const w=s.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!s.containerState.marker||v===s.containerState.marker:ip(v)){if(s.containerState.type||(s.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(hh,n,p)(v):p(v);if(!s.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return ip(v)&&++u<10?(e.consume(v),d):(!s.interrupt||u<2)&&(s.containerState.marker?v===s.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):n(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||v,e.check(hc,s.interrupt?n:_,e.attempt(QT,S,g))}function _(v){return s.containerState.initialBlankLine=!0,o++,S(v)}function g(v){return Ie(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),S):n(v)}function S(v){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function tM(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(hc,l,o);function l(h){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Ke(e,t,"listItemIndent",s.containerState.size+1)(h)}function o(h){return s.containerState.furtherBlankLines||!Ie(h)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(h)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(JT,t,u)(h))}function u(h){return s.containerState._closeFlow=!0,s.interrupt=void 0,Ke(e,e.attempt(Ei,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function iM(e,t,n){const s=this;return Ke(e,l,"listItemIndent",s.containerState.size+1);function l(o){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?t(o):n(o)}}function nM(e){e.exit(this.containerState.type)}function rM(e,t,n){const s=this;return Ke(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=s.events[s.events.length-1];return!Ie(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Jy={name:"setextUnderline",resolveTo:sM,tokenize:lM};function sM(e,t){const n=new Mh;let s=e.length,l,o,u;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){l=s;break}e[s][1].type==="paragraph"&&(o=s)}else e[s][1].type==="content"&&n.add(s,1,[]),!u&&e[s][1].type==="definition"&&(u=s);const h={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(n.add(o,0,[["enter",h,t]]),n.add(u+1,0,[["exit",e[l][1],t]]),e[l][1].end={...e[u][1].end}):e[l][1]=h,n.add(e.length,0,[["exit",h,t]]),n.consume(e),e}function lM(e,t,n){const s=this;let l;return o;function o(p){let _=s.events.length,g;for(;_--;)if(s.events[_][1].type!=="lineEnding"&&s.events[_][1].type!=="linePrefix"&&s.events[_][1].type!=="content"){g=s.events[_][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),l=p,u(p)):n(p)}function u(p){return e.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===l?(e.consume(p),h):(e.exit("setextHeadingLineSequence"),Ie(p)?Ke(e,d,"lineSuffix")(p):d(p))}function d(p){return p===null||ke(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const aM={tokenize:oM};function oM(e){const t=this,n=e.attempt(hc,s,e.attempt(this.parser.constructs.flowInitial,l,Ke(e,e.attempt(this.parser.constructs.flow,l,e.attempt(gT,l)),"linePrefix")));return n;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cM={resolveAll:eb()},uM=J6("string"),hM=J6("text");function J6(e){return{resolveAll:eb(e==="text"?fM:void 0),tokenize:t};function t(n){const s=this,l=this.parser.constructs[e],o=n.attempt(l,u,h);return u;function u(_){return p(_)?o(_):h(_)}function h(_){if(_===null){n.consume(_);return}return n.enter("data"),n.consume(_),d}function d(_){return p(_)?(n.exit("data"),o(_)):(n.consume(_),d)}function p(_){if(_===null)return!0;const g=l[_];let S=-1;if(g)for(;++S<g.length;){const v=g[S];if(!v.previous||v.previous.call(s,s.previous))return!0}return!1}}}function eb(e){return t;function t(n,s){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,s):n}}function fM(e,t){const n=new Mh;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const l=e[s-1][1],o=t.sliceStream(l);let u=o.length,h=-1,d=0,p;for(;u--;){const _=o[u];if(typeof _=="string"){for(h=_.length;_.charCodeAt(h-1)===32;)d++,h--;if(h)break;h=-1}else if(_===-2)p=!0,d++;else if(_!==-1){u++;break}}if(t._contentTypeTextTrailing&&s===e.length&&(d=0),d){const _={type:s===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?h:l.start._bufferIndex+h,_index:l.start._index+u,line:l.end.line,column:l.end.column-d,offset:l.end.offset-d},end:{...l.end}};l.end={..._.start},l.start.offset===l.end.offset?Object.assign(l,_):n.add(s,0,[["enter",_,t],["exit",_,t]])}s++}return n.consume(e),e}const dM={42:Ei,43:Ei,45:Ei,48:Ei,49:Ei,50:Ei,51:Ei,52:Ei,53:Ei,54:Ei,55:Ei,56:Ei,57:Ei,62:$6},pM={91:bT},mM={[-2]:d0,[-1]:d0,32:d0},gM={35:TT,42:hh,45:[Jy,hh],60:DT,61:Jy,95:hh,96:Qy,126:Qy},_M={38:K6,92:Y6},vM={[-5]:p0,[-4]:p0,[-3]:p0,33:YT,38:K6,42:np,60:[Zk,zT],91:WT,92:[ET,Y6],93:Um,95:np,96:uT},yM={null:[np,cM]},SM={null:[42,95]},bM={null:[]},wM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:SM,contentInitial:pM,disable:bM,document:dM,flow:gM,flowInitial:mM,insideSpan:yM,string:_M,text:vM},Symbol.toStringTag,{value:"Module"}));function xM(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],h=[];const d={attempt:V(Q),check:V(R),consume:P,enter:N,exit:X,interrupt:V(R,{interrupt:!0})},p={code:null,containerState:{},defineSkip:x,events:[],now:w,parser:e,previous:null,sliceSerialize:S,sliceStream:v,write:g};let _=t.tokenize.call(p,d);return t.resolveAll&&o.push(t),p;function g(K){return u=rn(u,K),E(),u[u.length-1]!==null?[]:(se(t,0),p.events=hf(o,p.events,p),p.events)}function S(K,W){return EM(v(K),W)}function v(K){return CM(u,K)}function w(){const{_bufferIndex:K,_index:W,line:q,column:Z,offset:F}=s;return{_bufferIndex:K,_index:W,line:q,column:Z,offset:F}}function x(K){l[K.line]=K.column,k()}function E(){for(;s._index<u.length;){const K=u[s._index];if(typeof K=="string"){const W=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===W&&s._bufferIndex<K.length;)M(K.charCodeAt(s._bufferIndex))}else M(K)}}function M(K){_=_(K)}function P(K){ke(K)?(s.line++,s.column=1,s.offset+=K===-3?2:1,k()):K!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),p.previous=K}function N(K,W){const q=W||{};return q.type=K,q.start=w(),p.events.push(["enter",q,p]),h.push(q),q}function X(K){const W=h.pop();return W.end=w(),p.events.push(["exit",W,p]),W}function Q(K,W){se(K,W.from)}function R(K,W){W.restore()}function V(K,W){return q;function q(Z,F,H){let ie,$,oe,T;return Array.isArray(Z)?We(Z):"tokenize"in Z?We([Z]):ze(Z);function ze(ae){return de;function de(Ee){const ve=Ee!==null&&ae[Ee],Me=Ee!==null&&ae.null,fe=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Me)?Me:Me?[Me]:[]];return We(fe)(Ee)}}function We(ae){return ie=ae,$=0,ae.length===0?H:O(ae[$])}function O(ae){return de;function de(Ee){return T=me(),oe=ae,ae.partial||(p.currentConstruct=ae),ae.name&&p.parser.constructs.disable.null.includes(ae.name)?ne():ae.tokenize.call(W?Object.assign(Object.create(p),W):p,d,D,ne)(Ee)}}function D(ae){return K(oe,T),F}function ne(ae){return T.restore(),++$<ie.length?O(ie[$]):H}}}function se(K,W){K.resolveAll&&!o.includes(K)&&o.push(K),K.resolve&&mn(p.events,W,p.events.length-W,K.resolve(p.events.slice(W),p)),K.resolveTo&&(p.events=K.resolveTo(p.events,p))}function me(){const K=w(),W=p.previous,q=p.currentConstruct,Z=p.events.length,F=Array.from(h);return{from:Z,restore:H};function H(){s=K,p.previous=W,p.currentConstruct=q,p.events.length=Z,h=F,k()}}function k(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function CM(e,t){const n=t.start._index,s=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(s,o)];else{if(u=e.slice(n,l),s>-1){const h=u[0];typeof h=="string"?u[0]=h.slice(s):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function EM(e,t){let n=-1;const s=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
28
+ `;break}case-3:{u=`\r
29
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,s.push(u)}return s.join("")}function kM(e){const s={constructs:F6([wM,...(e||{}).extensions||[]]),content:l(qk),defined:[],document:l(Yk),flow:l(aM),lazy:{},string:l(uM),text:l(hM)};return s;function l(o){return u;function u(h){return xM(s,o,h)}}}function TM(e){for(;!W6(e););return e}const e4=/[\0\t\n\r]/g;function MM(){let e=1,t="",n=!0,s;return l;function l(o,u,h){o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o));const d=[];let p=0;for(t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){e4.lastIndex=p;const _=e4.exec(o),g=_&&_.index!==void 0?_.index:o.length,S=o.charCodeAt(g);if(!_){t=o.slice(p);break}if(S===10&&p===g&&s)d.push(-3),s=void 0;else switch(s&&(d.push(-5),s=void 0),p<g&&(d.push(o.slice(p,g)),e+=g-p),S){case 0:{d.push(65533),e++;break}case 9:{const v=Math.ceil(e/4)*4;for(d.push(-2);e++<v;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:s=!0,e=1}p=g+1}return h&&(s&&d.push(-5),t&&d.push(t),d.push(null)),d}}const AM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DM(e){return e.replace(AM,OM)}function OM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return U6(n.slice(o?2:1),o?16:10)}return Fm(n)||e}const tb={}.hasOwnProperty;function RM(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),LM(n)(TM(kM(n).document().write(MM()(e,t,!0))))}function LM(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(vr),autolinkProtocol:k,autolinkEmail:k,atxHeading:u(Ti),blockQuote:u(fe),characterEscape:k,characterReference:k,codeFenced:u(Se),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:u(Se,h),codeText:u(Be,h),codeTextData:k,data:k,codeFlowValue:k,definition:u(Fn),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:u(_r),hardBreakEscape:u(wt),hardBreakTrailing:u(wt),htmlFlow:u(Ze,h),htmlFlowData:k,htmlText:u(Ze,h),htmlTextData:k,image:u(Vi),label:h,link:u(vr),listItem:u(nl),listItemValue:v,listOrdered:u(an,S),listUnordered:u(an),paragraph:u(rl),reference:D,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:u(Ti),strong:u(yr),thematicBreak:u(sl)},exit:{atxHeading:p(),atxHeadingSequence:R,autolink:p(),autolinkEmail:Me,autolinkProtocol:ve,blockQuote:p(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:de,characterReference:Ee,codeFenced:p(M),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:x,codeFlowValue:K,codeIndented:p(P),codeText:p(H),codeTextData:K,data:K,definition:p(),definitionDestinationString:Q,definitionLabelString:N,definitionTitleString:X,emphasis:p(),hardBreakEscape:p(q),hardBreakTrailing:p(q),htmlFlow:p(Z),htmlFlowData:K,htmlText:p(F),htmlTextData:K,image:p($),label:T,labelText:oe,lineEnding:W,link:p(ie),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ne,resourceDestinationString:ze,resourceTitleString:We,resource:O,setextHeading:p(me),setextHeadingLineSequence:se,setextHeadingText:V,strong:p(),thematicBreak:p()}};ib(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(J){let ce={type:"root",children:[],position:void 0};const xe={stack:[ce],tokenStack:[],config:t,enter:d,exit:_,buffer:h,resume:g,data:n},Re=[],zt=[];let nt=-1;for(;++nt<J.length;)if(zt.push(J[nt]),J[nt][1].type==="listOrdered"||J[nt][1].type==="listUnordered")if(J[nt][0]==="enter")Re.push(zt.length-1);else{const Yt=Re.pop();o(zt,Yt)}for(J=zt,nt=-1;++nt<J.length;){const Yt=t[J[nt][0]];J[nt][0]==="enter"&&t.beforeEnter.length>0&&l(t.beforeEnter,{...xe,sliceSerialize:J[nt][2].sliceSerialize},J[nt][1]),tb.call(Yt,J[nt][1].type)&&Yt[J[nt][1].type].call({...xe,sliceSerialize:J[nt][2].sliceSerialize},J[nt][1]),J[nt][0]==="exit"&&t.afterExit.length>0&&l(t.afterExit,{...xe,sliceSerialize:J[nt][2].sliceSerialize},J[nt][1])}if(xe.tokenStack.length>0){const Yt=xe.tokenStack[xe.tokenStack.length-1];(Yt[1]||t4).call(xe,void 0,Yt[0])}for(ce.position={start:Wr(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:Wr(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)ce=t.transforms[nt](ce)||ce;return ce}function l(J,ce,xe){let Re=-1;for(;++Re<J.length;)J[Re].call(ce,xe)}function o(J,ce){const xe=J.length-1;let Re=ce-1,zt=-1,nt=!1,Yt,_i,Un,Vn;const fs=[];for(;++Re<=xe;){const oi=J[Re];switch(oi[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{oi[0]==="enter"?zt++:zt--,Vn=void 0;break}case"lineEndingBlank":{oi[0]==="enter"&&(Yt&&!Vn&&!zt&&!Un&&(Un=Re),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!zt&&oi[0]==="enter"&&oi[1].type==="listItemPrefix"||zt===-1&&oi[0]==="exit"&&(oi[1].type==="listUnordered"||oi[1].type==="listOrdered")){if(Yt){let qn=Re;for(_i=void 0;qn--;){const qi=J[qn];if(qi[1].type==="lineEnding"||qi[1].type==="lineEndingBlank"){if(qi[0]==="exit")continue;_i&&(J[_i][1].type="lineEndingBlank",nt=!0),qi[1].type="lineEnding",_i=qn}else if(!(qi[1].type==="linePrefix"||qi[1].type==="blockQuotePrefix"||qi[1].type==="blockQuotePrefixWhitespace"||qi[1].type==="blockQuoteMarker"||qi[1].type==="listItemIndent"))break}Un&&(!_i||Un<_i)&&(Yt._spread=!0),Yt.end=Object.assign({},_i?J[_i][1].start:oi[1].end),fs.push({at:_i||Re,event:["exit",Yt,oi[2]]})}if(oi[1].type==="listItemPrefix"){const qn={type:"listItem",_spread:!1,start:Object.assign({},oi[1].start),end:void 0};Yt=qn,fs.push({at:Re,event:["enter",qn,oi[2]]}),Un=void 0,Vn=!0}}}const vc=J.splice(ce);let Kt=0;for(Re=-1;++Re<vc.length;){for(;Kt<fs.length&&fs[Kt].at===ce+Re;)J.push(fs[Kt++].event);J.push(vc[Re])}J[ce][1]._spread=nt}function u(J,ce){return xe;function xe(Re){d.call(this,J(Re),Re),ce&&ce.call(this,Re)}}function h(){this.stack.push({type:"fragment",children:[]})}function d(J,ce,xe){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([ce,xe||void 0]),J.position={start:Wr(ce.start),end:void 0}}function p(J){return ce;function ce(xe){J&&J.call(this,xe),_.call(this,xe)}}function _(J,ce){const xe=this.stack.pop(),Re=this.tokenStack.pop();if(!Re)throw new Error("Cannot close `"+J.type+"` ("+Uo({start:J.start,end:J.end})+"): it’s not open");Re[0].type!==J.type&&(ce?ce.call(this,J,Re[0]):(Re[1]||t4).call(this,J,Re[0])),xe.position.end=Wr(J.end)}function g(){return Pm(this.stack.pop())}function S(){this.data.expectingFirstListItemValue=!0}function v(J){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function w(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=J}function x(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=J}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function M(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function P(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/(\r?\n|\r)$/g,"")}function N(J){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.label=ce,xe.identifier=gn(this.sliceSerialize(J)).toLowerCase()}function X(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function Q(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function R(J){const ce=this.stack[this.stack.length-1];if(!ce.depth){const xe=this.sliceSerialize(J).length;ce.depth=xe}}function V(){this.data.setextHeadingSlurpLineEnding=!0}function se(J){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function me(){this.data.setextHeadingSlurpLineEnding=void 0}function k(J){const xe=this.stack[this.stack.length-1].children;let Re=xe[xe.length-1];(!Re||Re.type!=="text")&&(Re=wa(),Re.position={start:Wr(J.start),end:void 0},xe.push(Re)),this.stack.push(Re)}function K(J){const ce=this.stack.pop();ce.value+=this.sliceSerialize(J),ce.position.end=Wr(J.end)}function W(J){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=ce.children[ce.children.length-1];xe.position.end=Wr(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(k.call(this,J),K.call(this,J))}function q(){this.data.atHardBreak=!0}function Z(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function F(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function H(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function ie(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function $(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function oe(J){const ce=this.sliceSerialize(J),xe=this.stack[this.stack.length-2];xe.label=DM(ce),xe.identifier=gn(ce).toLowerCase()}function T(){const J=this.stack[this.stack.length-1],ce=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const Re=J.children;xe.children=Re}else xe.alt=ce}function ze(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function We(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function O(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ne(J){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.label=ce,xe.identifier=gn(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function ae(J){this.data.characterReferenceType=J.type}function de(J){const ce=this.sliceSerialize(J),xe=this.data.characterReferenceType;let Re;xe?(Re=U6(ce,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Re=Fm(ce);const zt=this.stack[this.stack.length-1];zt.value+=Re}function Ee(J){const ce=this.stack.pop();ce.position.end=Wr(J.end)}function ve(J){K.call(this,J);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(J)}function Me(J){K.call(this,J);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(J)}function fe(){return{type:"blockquote",children:[],position:void 0}}function Se(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Be(){return{type:"inlineCode",value:"",position:void 0}}function Fn(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function _r(){return{type:"emphasis",children:[],position:void 0}}function Ti(){return{type:"heading",depth:0,children:[],position:void 0}}function wt(){return{type:"break",position:void 0}}function Ze(){return{type:"html",value:"",position:void 0}}function Vi(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function vr(){return{type:"link",title:null,url:"",children:[],position:void 0}}function an(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[],position:void 0}}function nl(J){return{type:"listItem",spread:J._spread,checked:null,children:[],position:void 0}}function rl(){return{type:"paragraph",children:[],position:void 0}}function yr(){return{type:"strong",children:[],position:void 0}}function wa(){return{type:"text",value:"",position:void 0}}function sl(){return{type:"thematicBreak",position:void 0}}}function Wr(e){return{line:e.line,column:e.column,offset:e.offset}}function ib(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?ib(e,s):NM(e,s)}}function NM(e,t){let n;for(n in t)if(tb.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"afterExit":case"beforeEnter":{const s=t[n];s&&e[n].push(s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function t4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Uo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Uo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Uo({start:t.start,end:t.end})+") is still open")}function zM(e){const t=this;t.parser=n;function n(s){return RM(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function BM(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 jM(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
+ `}]}function HM(e,t){const n=t.value?t.value+`
31
+ `:"",s={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function IM(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PM(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FM(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),l=va(s.toLowerCase()),o=e.footnoteOrder.indexOf(s);let u,h=e.footnoteCounts.get(s);h===void 0?(h=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=o+1,h+=1,e.footnoteCounts.set(s,h);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,p),e.applyData(t,p)}function UM(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 VM(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nb(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=s:l.push({type:"text",value:s}),l}function qM(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return nb(e,t);const l={src:va(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function $M(e,t){const n={src:va(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 s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function YM(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function KM(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return nb(e,t);const l={href:va(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function WM(e,t){const n={href:va(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function GM(e,t,n){const s=e.all(t),l=n?XM(n):rb(t),o={},u=[];if(typeof t.checked=="boolean"){const _=s[0];let g;_&&_.type==="element"&&_.tagName==="p"?g=_:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let h=-1;for(;++h<s.length;){const _=s[h];(l||h!==0||_.type!=="element"||_.tagName!=="p")&&u.push({type:"text",value:`
32
+ `}),_.type==="element"&&_.tagName==="p"&&!l?u.push(..._.children):u.push(_)}const d=s[s.length-1];d&&(l||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
33
+ `});const p={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,p),e.applyData(t,p)}function XM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=rb(n[s])}return t}function rb(e){const t=e.spread;return t??e.children.length>1}function ZM(e,t){const n={},s=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<s.length;){const u=s[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function QM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tA(e,t){const n=e.all(t),s=n.shift(),l=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},h=Bm(t.children[1]),d=N6(t.children[t.children.length-1]);h&&d&&(u.position={start:h,end:d}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function iA(e,t,n){const s=n?n.children:void 0,o=(s?s.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,h=u?u.length:t.children.length;let d=-1;const p=[];for(;++d<h;){const g=t.children[d],S={},v=u?u[d]:void 0;v&&(S.align=v);let w={type:"element",tagName:o,properties:S,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),p.push(w)}const _={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,_),e.applyData(t,_)}function nA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const i4=9,n4=32;function rA(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),l=0;const o=[];for(;s;)o.push(r4(t.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=n.exec(t);return o.push(r4(t.slice(l),l>0,!1)),o.join("")}function r4(e,t,n){let s=0,l=e.length;if(t){let o=e.codePointAt(s);for(;o===i4||o===n4;)s++,o=e.codePointAt(s)}if(n){let o=e.codePointAt(l-1);for(;o===i4||o===n4;)l--,o=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function sA(e,t){const n={type:"text",value:rA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const aA={blockquote:BM,break:jM,code:HM,delete:IM,emphasis:PM,footnoteReference:FM,heading:UM,html:VM,imageReference:qM,image:$M,inlineCode:YM,linkReference:KM,link:WM,listItem:GM,list:ZM,paragraph:QM,root:JM,strong:eA,table:tA,tableCell:nA,tableRow:iA,text:sA,thematicBreak:lA,toml:Gu,yaml:Gu,definition:Gu,footnoteDefinition:Gu};function Gu(){}const sb=-1,ff=0,qo=1,Ah=2,Vm=3,qm=4,$m=5,Ym=6,lb=7,ab=8,{defineProperty:oA}=Object,ob=typeof self=="object"?self:globalThis,s4=(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 ob[e](t)},cA=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),s=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case ff:case sb:return n(u,l);case qo:{const h=n([],l);for(const d of u)h.push(s(d));return h}case Ah:{const h=n({},l);for(const[d,p]of u){const _=s(d),g=s(p);_==="__proto__"?oA(h,_,{value:g,configurable:!0,enumerable:!0,writable:!0}):h[_]=g}return h}case Vm:return n(new Date(u),l);case qm:{const{source:h,flags:d}=u;return n(new RegExp(h,d),l)}case $m:{const h=n(new Map,l);for(const[d,p]of u)h.set(s(d),s(p));return h}case Ym:{const h=n(new Set,l);for(const d of u)h.add(s(d));return h}case lb:{const{name:h,message:d}=u;return n(typeof ob[h]=="function"?s4(h,d):new Error(d),l)}case ab:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:h}=new Uint8Array(u);return n(new DataView(h),u)}case"-0":return-0}return n(s4(o,u),l)};return s},l4=e=>cA(new Map,e)(0),Hs="",{toString:uA}={},{keys:hA,is:fA}=Object,To=e=>{const t=typeof e;if(t!=="object"||!e)return[ff,t];const n=uA.call(e).slice(8,-1);switch(n){case"Array":return[qo,Hs];case"Object":return[Ah,Hs];case"Date":return[Vm,Hs];case"RegExp":return[qm,Hs];case"Map":return[$m,Hs];case"Set":return[Ym,Hs];case"DataView":return[qo,n]}return n.includes("Array")?[qo,n]:e instanceof Error?[lb,e.name||"Error"]:[Ah,n]},Xu=([e,t])=>e===ff&&(t==="function"||t==="symbol"),dA=(e,t,n,s)=>{const l=(u,h)=>{const d=s.push(u)-1;return n.set(h,d),d},o=u=>{if(n.has(u))return n.get(u);let[h,d]=To(u);switch(h){case ff:{let _=u;switch(d){case"bigint":h=ab,_=u.toString();break;case"number":if(!u&&fA(u,-0))return s.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);_=null;break;case"undefined":return l([sb],u)}return l([h,_],u)}case qo:{if(d){let S=u;return d==="DataView"?S=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(S=new Uint8Array(u)),l([d,[...S]],u)}const _=[],g=l([h,_],u);for(const S of u)_.push(o(S));return g}case Ah:{if(d)switch(d){case"BigInt":return l([d,u.toString()],u);case"Boolean":case"Number":case"String":return l([d,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const _=[],g=l([h,_],u);for(const S of hA(u))(e||!Xu(To(u[S])))&&_.push([o(S),o(u[S])]);return g}case Vm:return l([h,isNaN(u.getTime())?Hs:u.toISOString()],u);case qm:{const{source:_,flags:g}=u;return l([h,{source:_,flags:g}],u)}case $m:{const _=[],g=l([h,_],u);for(const[S,v]of u)(e||!(Xu(To(S))||Xu(To(v))))&&_.push([o(S),o(v)]);return g}case Ym:{const _=[],g=l([h,_],u);for(const S of u)(e||!Xu(To(S)))&&_.push(o(S));return g}}const{message:p}=u;return l([h,{name:d,message:p}],u)};return o},a4=(e,{json:t,lossy:n}={})=>{const s=[];return dA(!(t||n),!!t,new Map,s)(e),s},Dh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?l4(a4(e,t)):structuredClone(e):(e,t)=>l4(a4(e,t));function pA(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 mA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pA,s=e.options.footnoteBackLabel||mA,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let d=-1;for(;++d<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[d]);if(!p)continue;const _=e.all(p),g=String(p.identifier).toUpperCase(),S=va(g.toLowerCase());let v=0;const w=[],x=e.footnoteCounts.get(g);for(;x!==void 0&&++v<=x;){w.length>0&&w.push({type:"text",value:" "});let P=typeof n=="string"?n:n(d,v);typeof P=="string"&&(P={type:"text",value:P}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+S+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(d,v),className:["data-footnote-backref"]},children:Array.isArray(P)?P:[P]})}const E=_[_.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const P=E.children[E.children.length-1];P&&P.type==="text"?P.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...w)}else _.push(...w);const M={type:"element",tagName:"li",properties:{id:t+"fn-"+S},children:e.wrap(_,!0)};e.patch(p,M),h.push(M)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Dh(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
34
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(h,!0)},{type:"text",value:`
35
+ `}]}}const df=(function(e){if(e==null)return SA;if(typeof e=="function")return pf(e);if(typeof e=="object")return Array.isArray(e)?_A(e):vA(e);if(typeof e=="string")return yA(e);throw new Error("Expected function, string, or object as test")});function _A(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=df(e[n]);return pf(s);function s(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function vA(e){const t=e;return pf(n);function n(s){const l=s;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function yA(e){return pf(t);function t(n){return n&&n.type===e}}function pf(e){return t;function t(n,s,l){return!!(bA(n)&&e.call(this,n,typeof s=="number"?s:void 0,l||void 0))}}function SA(){return!0}function bA(e){return e!==null&&typeof e=="object"&&"type"in e}const cb=[],wA=!0,fh=!1,lp="skip";function ap(e,t,n,s){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let l=!0,o,u,h,d;if(typeof n=="function"||n&&typeof n=="object"?(o=t,u=n,s&&(l=!1)):(u=t,n&&(l=!1)),typeof u=="function")h=u;else if(u&&typeof u=="object"){if(!(u.enter===null||u.enter===void 0))if(typeof u.enter=="function")h=u.enter;else throw new Error("Unexpected value `"+u.enter+"` for `visitors.enter`, expected optional visitor");if(typeof u.exit=="function")d=u.exit;else throw new Error("Unexpected value `"+u.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+u+"` for `enter` or `visitors`, expected visitor or object with visitors");const p=df(o),_=l?1:-1;g(e,void 0,[])();function g(S,v,w){const x=S&&typeof S=="object"?S:{};if(typeof x.type=="string"){const M=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(E,"name",{value:"node ("+(S.type+(M?"<"+M+">":""))+")"})}return E;function E(){const M=!o||p(S,v,w[w.length-1]||void 0);let P=cb;if(h&&M&&(P=o4(h(S,w,v)),P[0]===fh))return P;if("children"in S&&S.children){const N=S;if(N.children&&P[0]!==lp){let X=(l?-1:N.children.length)+_;const Q=[...w,N];for(;X>-1&&X<N.children.length;){const R=N.children[X],V=g(R,X,Q)();if(V[0]===fh)return V;X=typeof V[1]=="number"?V[1]:X+_}}}if(d&&M){const N=o4(d(S,w,v));if(N[0]===lp)throw new Error("Unexpected value `"+N[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(N[0]===fh||typeof N[1]=="number")return N}return P}}}function o4(e){return Array.isArray(e)?e:typeof e=="number"?[wA,e]:e==null?cb:[e]}function Km(e,t,n,s){let l,o,u;o=t,u=n,typeof o=="function"?ap(e,l,op(o),u):ap(e,l,xA(o),u)}function xA(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?op(e.enter):e.enter,exit:typeof e.exit=="function"?op(e.exit):e.exit}}function op(e){return t;function t(n,s,l){return e(n,l,s[s.length-1])}}const cp={}.hasOwnProperty,CA={};function EA(e,t){const n=t||CA,s=new Map,l=new Map,o=new Map,u={...aA,...n.handlers},h={all:p,applyData:TA,definitionById:s,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:d,options:n,patch:kA,wrap:AA};return Km(e,function(_){if(_.type==="definition"||_.type==="footnoteDefinition"){const g=_.type==="definition"?s:l,S=String(_.identifier).toUpperCase();g.has(S)||g.set(S,_)}}),h;function d(_,g){const S=_.type,v=h.handlers[S];if(cp.call(h.handlers,S)&&v)return v(h,_,g);if(h.options.passThrough&&h.options.passThrough.includes(S)){if("children"in _){const{children:x,...E}=_,M=Dh(E);return M.children=h.all(_),M}return Dh(_)}return(h.options.unknownHandler||MA)(h,_,g)}function p(_){const g=[];if("children"in _){const S=_.children;let v=-1;for(;++v<S.length;){const w=h.one(S[v],_);if(w){if(v&&S[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=c4(w.value)),!Array.isArray(w)&&w.type==="element")){const x=w.children[0];x&&x.type==="text"&&(x.value=c4(x.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function kA(e,t){e.position&&(t.position=_k(e))}function TA(e,t){let n=t;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const u="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Dh(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function MA(e,t){const n=t.data||{},s="value"in t&&!(cp.call(n,"hProperties")||cp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function AA(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
36
+ `});++s<e.length;)s&&n.push({type:"text",value:`
37
+ `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
38
+ `}),n}function c4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function u4(e,t){const n=EA(e,t),s=n.one(e,void 0),l=gA(n),o=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
39
+ `},l),o}function DA(e,t){return e&&"run"in e?async function(n,s){const l=u4(n,{file:s,...t});await e.run(l,s)}:function(n,s){return u4(n,{file:s,...e||t})}}function h4(e){if(e)throw e}var m0,f4;function OA(){if(f4)return m0;f4=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},o=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var _=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!_&&!g)return!1;var S;for(S in p);return typeof S>"u"||e.call(p,S)},u=function(p,_){n&&_.name==="__proto__"?n(p,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):p[_.name]=_.newValue},h=function(p,_){if(_==="__proto__")if(e.call(p,_)){if(s)return s(p,_).value}else return;return p[_]};return m0=function d(){var p,_,g,S,v,w,x=arguments[0],E=1,M=arguments.length,P=!1;for(typeof x=="boolean"&&(P=x,x=arguments[1]||{},E=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});E<M;++E)if(p=arguments[E],p!=null)for(_ in p)g=h(x,_),S=h(p,_),x!==S&&(P&&S&&(o(S)||(v=l(S)))?(v?(v=!1,w=g&&l(g)?g:[]):w=g&&o(g)?g:{},u(x,{name:_,newValue:d(P,w,S)})):typeof S<"u"&&u(x,{name:_,newValue:S}));return x},m0}var RA=OA();const g0=pa(RA);function up(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 LA(){const e=[],t={run:n,use:s};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);h(null,...l);function h(d,...p){const _=e[++o];let g=-1;if(d){u(d);return}for(;++g<l.length;)(p[g]===null||p[g]===void 0)&&(p[g]=l[g]);l=p,_?NA(_,h)(...p):u(null,...p)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function NA(e,t){let n;return s;function s(...u){const h=e.length>u.length;let d;h&&u.push(l);try{d=e.apply(this,u)}catch(p){const _=p;if(h&&n)throw _;return l(_)}h||(d&&d.then&&typeof d.then=="function"?d.then(o,l):d instanceof Error?l(d):o(d))}function l(u,...h){n||(n=!0,t(u,...h))}function o(u){l(null,u)}}const Rn={basename:zA,dirname:BA,extname:jA,join:HA,sep:"/"};function zA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fc(e);let n=0,s=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else s<0&&(o=!0,s=l+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let u=-1,h=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),h>-1&&(e.codePointAt(l)===t.codePointAt(h--)?h<0&&(s=l):(h=-1,s=u));return n===s?s=u:s<0&&(s=e.length),e.slice(n,s)}function BA(e){if(fc(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jA(e){fc(e);let t=e.length,n=-1,s=0,l=-1,o=0,u;for(;t--;){const h=e.codePointAt(t);if(h===47){if(u){s=t+1;break}continue}n<0&&(u=!0,n=t+1),h===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===s+1?"":e.slice(l,n)}function HA(...e){let t=-1,n;for(;++t<e.length;)fc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":IA(n)}function IA(e){fc(e);const t=e.codePointAt(0)===47;let n=PA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PA(e,t){let n="",s=0,l=-1,o=0,u=-1,h,d;for(;++u<=e.length;){if(u<e.length)h=e.codePointAt(u);else{if(h===47)break;h=47}if(h===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",s=0):(n=n.slice(0,d),s=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",s=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),s=u-l-1;l=u,o=0}else h===46&&o>-1?o++:o=-1}return n}function fc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const FA={cwd:UA};function UA(){return"/"}function hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function VA(e){if(typeof e=="string")e=new URL(e);else if(!hp(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 qA(e)}function qA(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const _0=["history","path","basename","stem","extname","dirname"];class ub{constructor(t){let n;t?hp(t)?n={path:t}:typeof t=="string"||$A(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":FA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<_0.length;){const o=_0[s];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)_0.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Rn.basename(this.path):void 0}set basename(t){y0(t,"basename"),v0(t,"basename"),this.path=Rn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Rn.dirname(this.path):void 0}set dirname(t){d4(this.basename,"dirname"),this.path=Rn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Rn.extname(this.path):void 0}set extname(t){if(v0(t,"extname"),d4(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=Rn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hp(t)&&(t=VA(t)),y0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Rn.basename(this.path,this.extname):void 0}set stem(t){y0(t,"stem"),v0(t,"stem"),this.path=Rn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const l=this.message(t,n,s);throw l.fatal=!0,l}info(t,n,s){const l=this.message(t,n,s);return l.fatal=void 0,l}message(t,n,s){const l=new ai(t,n,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function v0(e,t){if(e&&e.includes(Rn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Rn.sep+"`")}function y0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function d4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $A(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YA=(function(e){const s=this.constructor.prototype,l=s[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,s),o}),KA={}.hasOwnProperty;class Wm extends YA{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=LA()}copy(){const t=new Wm;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(g0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(w0("data",this.frozen),this.namespace[t]=n,this):KA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(w0("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,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=n.call(t,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zu(t),s=this.parser||this.Parser;return S0("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),S0("process",this.parser||this.Parser),b0("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const h=Zu(t),d=s.parse(h);s.run(d,h,function(_,g,S){if(_||!g||!S)return p(_);const v=g,w=s.stringify(v,S);XA(w)?S.value=w:S.result=w,p(_,S)});function p(_,g){_||!g?u(_):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,s;return this.freeze(),S0("processSync",this.parser||this.Parser),b0("processSync",this.compiler||this.Compiler),this.process(t,l),m4("processSync","process",n),s;function l(o,u){n=!0,h4(o),s=u}}run(t,n,s){p4(t),this.freeze();const l=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?o(void 0,s):new Promise(o);function o(u,h){const d=Zu(n);l.run(t,d,p);function p(_,g,S){const v=g||t;_?h(_):u?u(v):s(void 0,v,S)}}}runSync(t,n){let s=!1,l;return this.run(t,n,o),m4("runSync","run",s),l;function o(u,h){h4(u),l=h,s=!0}}stringify(t,n){this.freeze();const s=Zu(n),l=this.compiler||this.Compiler;return b0("stringify",l),p4(t),l(t,s)}use(t,...n){const s=this.attachers,l=this.namespace;if(w0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?h(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[_,...g]=p;d(_,g)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))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");h(p.plugins),p.settings&&(l.settings=g0(!0,l.settings,p.settings))}function h(p){let _=-1;if(p!=null)if(Array.isArray(p))for(;++_<p.length;){const g=p[_];o(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,_){let g=-1,S=-1;for(;++g<s.length;)if(s[g][0]===p){S=g;break}if(S===-1)s.push([p,..._]);else if(_.length>0){let[v,...w]=_;const x=s[S][1];up(x)&&up(v)&&(v=g0(!0,x,v)),s[S]=[p,v,...w]}}}}const WA=new Wm().freeze();function S0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function b0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w0(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 p4(e){if(!up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function m4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zu(e){return GA(e)?e:new ub(e)}function GA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function XA(e){return typeof e=="string"||ZA(e)}function ZA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",g4=[],_4={allowDangerousHtml:!0},JA=/^(https?|ircs?|mailto|xmpp)$/i,eD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function tD(e){const t=iD(e),n=nD(e);return rD(t.runSync(t.parse(n),n),e)}function iD(e){const t=e.rehypePlugins||g4,n=e.remarkPlugins||g4,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._4}:_4;return WA().use(zM).use(n).use(DA,s).use(t)}function nD(e){const t=e.children||"",n=new ub;return typeof t=="string"&&(n.value=t),n}function rD(e,t){const n=t.allowedElements,s=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,h=t.unwrapDisallowed,d=t.urlTransform||sD;for(const _ of eD)Object.hasOwn(t,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+QA+_.id,void 0);return Km(e,p),wk(e,{Fragment:y.Fragment,components:l,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function p(_,g,S){if(_.type==="raw"&&S&&typeof g=="number")return u?S.children.splice(g,1):S.children[g]={type:"text",value:_.value},g;if(_.type==="element"){let v;for(v in f0)if(Object.hasOwn(f0,v)&&Object.hasOwn(_.properties,v)){const w=_.properties[v],x=f0[v];(x===null||x.includes(_.tagName))&&(_.properties[v]=d(String(w||""),v,_))}}if(_.type==="element"){let v=n?!n.includes(_.tagName):o?o.includes(_.tagName):!1;if(!v&&s&&typeof g=="number"&&(v=!s(_,g,S)),v&&S&&typeof g=="number")return h&&_.children?S.children.splice(g,1,..._.children):S.children.splice(g,1),g}}}function sD(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||s!==-1&&t>s||JA.test(e.slice(0,t))?e:""}function v4(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,l=n.indexOf(t);for(;l!==-1;)s++,l=n.indexOf(t,l+t.length);return s}function lD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function aD(e,t,n){const l=df((n||{}).ignore||[]),o=oD(t);let u=-1;for(;++u<o.length;)ap(e,h);function h(p,_,g){if(p.type==="text"&&typeof g=="number")return d(p,_,g);if(l(p,g,_[_.length-1]))return lp}function d(p,_,g){const S=_[_.length-1],v=o[u][0],w=o[u][1];let x=0,E=!1,M=[];v.lastIndex=0;let P=v.exec(p.value);for(;P;){const X=P.index,Q={index:P.index,input:P.input,stack:[..._,p]};let R=w(...P,Q);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1)v.lastIndex=X+1;else{if(x!==X&&N({type:"text",value:p.value.slice(x,X)}),Array.isArray(R))for(const V of R)N(V);else R&&N(R);x=X+P[0].length,E=!0}if(!v.global)break;P=v.exec(p.value)}return E?(x<p.value.length&&N({type:"text",value:p.value.slice(x)}),S.children.splice(g,1,...M)):M=[p],g+M.length;function N(X){const Q=M[M.length-1];Q&&Q.type==="text"&&X.type==="text"?Q.value+=X.value:M.push(X)}}}function oD(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const l=n[s];t.push([cD(l[0]),uD(l[1])])}return t}function cD(e){return typeof e=="string"?new RegExp(lD(e),"g"):e}function uD(e){return typeof e=="function"?e:function(){return e}}const x0="phrasing",C0=["autolink","link","image","label"];function hD(){return{transforms:[vD],enter:{literalAutolink:dD,literalAutolinkEmail:E0,literalAutolinkHttp:E0,literalAutolinkWww:E0},exit:{literalAutolink:_D,literalAutolinkEmail:gD,literalAutolinkHttp:pD,literalAutolinkWww:mD}}}function fD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:x0,notInConstruct:C0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:x0,notInConstruct:C0},{character:":",before:"[ps]",after:"\\/",inConstruct:x0,notInConstruct:C0}]}}function dD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function E0(e){this.config.enter.autolinkProtocol.call(this,e)}function pD(e){this.config.exit.autolinkProtocol.call(this,e)}function mD(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 gD(e){this.config.exit.autolinkEmail.call(this,e)}function _D(e){this.exit(e)}function vD(e){aD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yD],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,SD]],{ignore:["link","linkReference"]})}function yD(e,t,n,s,l){let o="";if(!hb(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!bD(n)))return!1;const u=wD(n+s);if(!u[0])return!1;const h={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[h,{type:"text",value:u[1]}]:h}function SD(e,t,n,s){return!hb(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function bD(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 wD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const l=v4(e,"(");let o=v4(e,")");for(;s!==-1&&l>o;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),o++;return[e,n]}function hb(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gs(n)||uf(n))&&(!t||n!==47)}fb.peek=OD;function xD(){this.buffer()}function CD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ED(){this.buffer()}function kD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function MD(e){this.exit(e)}function AD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DD(e){this.exit(e)}function OD(){return"["}function fb(e,t,n,s){const l=n.createTracker(s);let o=l.move("[^");const u=n.enter("footnoteReference"),h=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),h(),u(),o+=l.move("]"),o}function RD(){return{enter:{gfmFootnoteCallString:xD,gfmFootnoteCall:CD,gfmFootnoteDefinitionLabelString:ED,gfmFootnoteDefinition:kD},exit:{gfmFootnoteCallString:TD,gfmFootnoteCall:MD,gfmFootnoteDefinitionLabelString:AD,gfmFootnoteDefinition:DD}}}function LD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,l,o,u){const h=o.createTracker(u);let d=h.move("[^");const p=o.enter("footnoteDefinition"),_=o.enter("label");return d+=h.move(o.safe(o.associationId(s),{before:d,after:"]"})),_(),d+=h.move("]:"),s.children&&s.children.length>0&&(h.shift(4),d+=h.move((t?`
40
+ `:" ")+o.indentLines(o.containerFlow(s,h.current()),t?db:ND))),p(),d}}function ND(e,t,n){return t===0?e:db(e,t,n)}function db(e,t,n){return(n?"":" ")+e}const zD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gm.attention=PD;Gm.peek=FD;function BD(){return{canContainEols:["delete"],enter:{strikethrough:HD},exit:{strikethrough:ID}}}function jD(){return{handlers:{delete:Gm},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zD}]}}function HD(e){this.enter({type:"delete",children:[],position:void 0},e)}function ID(e){this.exit(e)}function Gm(e,t,n,s){const l=n.createTracker(s),o=n.stack.includes("strikethrough")?"~":"~~",u=n.enter("strikethrough");let h=l.move(o);return h+=n.containerPhrasing(e,{...l.current(),before:h,after:"~"}),h+=l.move(o),u(),h}function PD(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function FD(){return"~"}function UD(e){return e.length}function VD(e,t){const n=t||{},s=(n.align||[]).concat(),l=n.stringLength||UD,o=[],u=[],h=[],d=[];let p=0,_=-1;for(;++_<e.length;){const x=[],E=[];let M=-1;for(e[_].length>p&&(p=e[_].length);++M<e[_].length;){const P=qD(e[_][M]);if(n.alignDelimiters!==!1){const N=l(P);E[M]=N,(d[M]===void 0||N>d[M])&&(d[M]=N)}x.push(P)}u[_]=x,h[_]=E}let g=-1;if(typeof s=="object"&&"length"in s)for(;++g<p;)o[g]=y4(s[g]);else{const x=y4(s);for(;++g<p;)o[g]=x}g=-1;const S=[],v=[];for(;++g<p;){const x=o[g];let E="",M="";x===99?(E=":",M=":"):x===108?E=":":x===114&&(M=":");let P=n.alignDelimiters===!1?1:Math.max(1,d[g]-E.length-M.length);const N=E+"-".repeat(P)+M;n.alignDelimiters!==!1&&(P=E.length+P+M.length,P>d[g]&&(d[g]=P),v[g]=P),S[g]=N}u.splice(1,0,S),h.splice(1,0,v),_=-1;const w=[];for(;++_<u.length;){const x=u[_],E=h[_];g=-1;const M=[];for(;++g<p;){const P=x[g]||"";let N="",X="";if(n.alignDelimiters!==!1){const Q=d[g]-(E[g]||0),R=o[g];R===114?N=" ".repeat(Q):R===99?Q%2?(N=" ".repeat(Q/2+.5),X=" ".repeat(Q/2-.5)):(N=" ".repeat(Q/2),X=N):X=" ".repeat(Q)}n.delimiterStart!==!1&&!g&&M.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&P==="")&&(n.delimiterStart!==!1||g)&&M.push(" "),n.alignDelimiters!==!1&&M.push(N),M.push(P),n.alignDelimiters!==!1&&M.push(X),n.padding!==!1&&M.push(" "),(n.delimiterEnd!==!1||g!==p-1)&&M.push("|")}w.push(n.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return w.join(`
41
+ `)}function qD(e){return e==null?"":String(e)}function y4(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}const $D=df(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function YD(e,t,n,s){const l=n.enter("blockquote"),o=n.createTracker(s);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),KD);return l(),u}function KD(e,t,n){return">"+(n?"":" ")+e}function WD(e,t){return S4(e,t.inConstruct,!0)&&!S4(e,t.notInConstruct,!1)}function S4(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function b4(e,t,n,s){let l=-1;for(;++l<n.unsafe.length;){const o=n.unsafe[l];if(o.character===`
42
+ `&&!o.before&&!o.after&&WD(n.stack,o))return/[\t ]/.test(s.before)?"":" "}return`\\
43
+ `}function GD(e,t){const n=String(e);let s=n.indexOf(t),l=s,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++o>u&&(u=o):o=1,l=s+t.length,s=n.indexOf(t,l);return u}function XD(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function ZD(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 QD(e,t,n,s){const l=ZD(n),o=e.value||"";if(XD(e,n)){const g=n.enter("codeIndented"),S=n.indentLines(o,JD);return g(),S}const u=n.createTracker(s),h=l.repeat(Math.max(GD(o,l)+1,3)),d=n.enter("codeFenced"),p=l==="`"?"GraveAccent":"Tilde";let _=u.move(h);if(e.lang){const g=n.enter(`codeFencedLang${p}`);_+=u.move(n.safe(e.lang,{before:_,after:" ",encode:["`"],...u.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${p}`);_+=u.move(" "),_+=u.move(n.safe(e.meta,{before:_,after:`
44
+ `,encode:["`"],...u.current()})),g()}return _+=u.move(`
45
+ `),o&&(_+=u.move(o+`
46
+ `)),_+=u.move(h),d(),_}function JD(e,t,n){return(n?"":" ")+e}function Xm(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 eO(e,t,n,s){const l=Xm(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let h=n.enter("label");const d=n.createTracker(s);let p=d.move("[");return p+=d.move(n.safe(n.associationId(e),{before:p,after:"]",...d.current()})),p+=d.move("]: "),h(),!e.url||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(h=n.enter("destinationRaw"),p+=d.move(n.safe(e.url,{before:p,after:e.title?" ":`
47
+ `,...d.current()}))),h(),e.title&&(h=n.enter(`title${o}`),p+=d.move(" "+l),p+=d.move(n.safe(e.title,{before:p,after:l,...d.current()})),p+=d.move(l),h()),u(),p}function tO(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 Oh(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function ra(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function pb(e){return"&#x"+e.toString(16).toUpperCase()+";"}function w4(e,t,n){const s=os(e),l=os(t);return s===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function iO(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const h=e.charCodeAt(2);return h===45?2:h===91?5:ii(h)?4:void 0}if(t===63)return 3;const n=t===47,s=n?2:1;let l=s,o=e.charCodeAt(l);if(!ii(o))return;for(;o===45||ri(o);)o=e.charCodeAt(++l);const u=e.slice(s,l).toLowerCase();return!n&&o!==47&&sp.includes(u)?1:Q6.includes(u)?6:7}const nO=new Map([["*",!1],["_",!0]]);function rO(e,t,n){const s=new Set;for(const o of e){const u=n.get(o);if(u&&o.attention&&t.some(h=>h.attention===o.attention))for(const h of u.tokens)s.add(h.attention)}const l=[];for(const o of e)o.attention&&s.delete(o.attention)&&l.push(o.attention);return l.reverse(),l}function mb(e,t,n){const s=[],l=new Map,o=new Map;let u=0;for(;u<e.length;){if(!e[u].attention){u++;continue}const h=e[u].value.charAt(0),d=nO.get(h);let p=u+1;for(;p<e.length&&e[p].attention&&e[p].value.charAt(0)===h;)p++;const _=u?e[u-1].value:t,g=os(_.charCodeAt(_.length-1)),S=os((p<e.length?e[p].value:n).charCodeAt(0)),v=!S||S===2&&!!g,w=!g||g===2&&!!S,x={tokens:e.slice(u,p),markers:[],start:0,end:0,open:d?v&&(!!g||!w):v,close:d?w&&(!!S||!v):w,split:d!==void 0};for(const E of x.tokens){l.set(E,[...x.tokens]),o.set(E,x);let M=E.value.length;for(;M--;)x.markers.push(E)}x.end=x.markers.length,s.push(x),u=p}for(lO(s,l),u=-1;++u<e.length;){const h=l.get(e[u]);if(h)return{attention:rO(e,h,o),index:u}}}function Qu(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const s=t?Oh(n.value):ra(n.value),l=pb(s.codePointAt(0));if(t)n.value=l+n.value.slice(s.length);else{let o=n.value.slice(0,n.value.length-s.length),u=0;for(;o.charCodeAt(o.length-1-u)===92;)u++;u%2&&(o+="\\"),n.value=o+l}}function sO(e,t,n,s,l){for(const o of n.attention){const u=t.get(o)||o.sequences[0];for(const h of o.sequences){if(h===u)continue;const d=new Map(t);d.set(o,h);const p=Qm(e,d,s,l),_=mb(p,s,l);if(!_||_.index>n.index)return{chosen:d,mistake:_,tokens:p}}}}function lO(e,t){const n=new Map;for(const s of e){const l=s.tokens[0].value.charAt(0);let o=n.get(l);o||(o=[],n.set(l,o));let u=s.close?o.length:0;for(;u--&&s.start<s.end;){const h=o[u],d=h.end-h.start,p=s.end-s.start;if(s.split?(h.close||s.open)&&p%3&&!((d+p)%3):d!==h.markers.length||d!==p)continue;const _=s.split?d>1&&p>1?2:1:p,g=h.markers.slice(h.end-_,h.end),S=s.markers.slice(s.start,s.start+_),v=g[0],w=S[0];if(v===g[_-1]&&v.value.length===_&&w===S[_-1]&&w.value.length===_&&v.attention===w.attention)t.delete(v),t.delete(w);else{const x=[...new Set([...g,...S])];for(const E of x){const M=t.get(E);M&&M.push(...x)}}h.end-=_,s.start+=_,h.start===h.end&&o.splice(u,1),u=o.length}s.open&&s.start<s.end&&o.push(s)}}function aO(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const l of n)if(!Number.isSafeInteger(l)||l<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as size, expected positive integer");const s=[];for(const l of t){if(l.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected a single ascii character");if(!V6(l.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+l+"` as marker, expected ascii punctuation");for(const o of n)s.push(l.repeat(o))}return s}function oO(e,t,n){const s=t.indexStack,l=e.children||[],o=[];let u=-1,h=n.before;s.push(-1);let d=t.createTracker(n);for(;++u<l.length;){const p=l[u];let _;if(s[s.length-1]=u,u+1<l.length){let v=t.handle.handlers[l[u+1].type];v&&v.peek&&(v=v.peek),_=v?Oh(v(l[u+1],e,t,{before:"",after:"",...d.current()})):""}else _=n.after;const g=o[o.length-1];typeof g=="string"&&(h==="\r"||h===`
48
+ `)&&p.type==="html"&&iO(p.value)!==7&&(o[o.length-1]=g.replace(/(\r?\n|\r)$/," "),h=" ",d=t.createTracker(n),d.move(mf(o,n.before,n.after)));const S=t.handle.handlers[p.type];if(S&&S.attention){const v=Zm(p,S.attention,t,d);o.push(v),h=ra(v.sequences[0])}else{const v=t.handle(p,e,t,{...d.current(),after:_,before:h});if(!v)continue;d.move(v),o.push(v),h=ra(v)}}return s.pop(),o}function Zm(e,t,n,s){const{construct:l,markers:o,sizes:u}=t(e,n),h=aO(e.type,o,u),d=h[0],p=n.enter(l);s.move(d);const _=oO(e,n,{...s.current(),before:d,after:d});return s.move(mf(_,d,d)),s.move(d),p(),{children:_,sequences:h}}function Qm(e,t,n,s){const l=[];let o,u=ra(n),h=-1;for(;++h<e.length;){const d=e[h];if(typeof d=="string"){const N={value:d,attention:void 0};o&&o===Oh(d)&&Qu([N],!0),o=void 0,l.push(N),N.value&&(u=ra(N.value));continue}const p=t.get(d)||d.sequences[0],_=p.charAt(0),g=e[h+1],S=u,v=Oh(g===void 0?s:typeof g=="string"?g:t.get(g)||g.sequences[0]),w=Qm(d.children,t,p,p),x=w.length>0?w[0].value:"",E=w4(S.charCodeAt(S.length-1),x.charCodeAt(0),_);E.inside&&Qu(w,!0);const M=w.length>0?ra(w[w.length-1].value):"",P=w4(v.charCodeAt(0),M.charCodeAt(M.length-1),_);P.inside&&Qu(w,!1),E.outside&&S!==`
49
+ `&&S!=="\r"&&Qu(l,!1),P.outside&&(o=v),l.push({value:p,attention:d},...w,{value:p,attention:d}),u=p.charAt(p.length-1)}return l}function mf(e,t,n){let s=new Map;const l=Qm(e,s,t,n);let o=l,u=mb(o,t,n);for(;u;){const d=sO(e,s,u,t,n);if(!d){o=l;break}s=d.chosen,o=d.tokens,u=d.mistake}let h="";for(const d of o)h+=d.value;return h}Jm.attention=gb;Jm.peek=cO;function Jm(e,t,n,s){const l=n.enter("phrasing"),o=Zm(e,gb,n,n.createTracker(s)),u=mf([o],s.before,s.after);return l(),u}function gb(e,t){return{construct:"emphasis",markers:tO(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function cO(e,t,n){return n.options.emphasis||"*"}function uO(e,t){let n=!1;return Km(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,fh}),!!((!e.depth||e.depth<3)&&Pm(e)&&(t.options.setext||n))}function hO(e,t,n,s){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(s);if(uO(e,n)){const g=n.enter("headingSetext"),S=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
50
+ `,after:`
51
+ `});return S(),g(),v+`
52
+ `+(l===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
53
+ `))+1))}const u="#".repeat(l),h=n.enter("headingAtx"),d=n.enter("phrasing");o.move(u+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
54
+ `,...o.current()});const _=p.charCodeAt(0);return(_===9||_===32)&&(p=pb(_)+p.slice(1)),p=p?u+" "+p:u,n.options.closeAtx&&(p+=" "+u),d(),h(),p}_b.peek=fO;function _b(e){return e.value||""}function fO(){return"<"}vb.peek=dO;function vb(e,t,n,s){const l=Xm(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let h=n.enter("label");const d=n.createTracker(s);let p=d.move("![");return p+=d.move(n.safe(e.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(h=n.enter("destinationRaw"),p+=d.move(n.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=n.enter(`title${o}`),p+=d.move(" "+l),p+=d.move(n.safe(e.title,{before:p,after:l,...d.current()})),p+=d.move(l),h()),p+=d.move(")"),u(),p}function dO(){return"!"}yb.peek=pO;function yb(e,t,n,s){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const h=n.createTracker(s);let d=h.move("![");const p=n.safe(e.alt,{before:d,after:"]",...h.current()});d+=h.move(p+"]["),u();const _=n.stack;n.stack=_.filter(function(S){return S!=="phrasing"}),u=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...h.current()});return u(),n.stack=_,o(),l==="full"||!p||p!==g?d+=h.move(g+"]"):l==="shortcut"?d=d.slice(0,-1):d+=h.move("]"),d}function pO(){return"!"}Sb.peek=mO;function Sb(e,t,n){let s=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++o<n.unsafe.length;){const u=n.unsafe[o],h=n.compilePattern(u);if(!u.atBreak)continue;let d;for(;d=h.exec(s);){let p=d.index;s.charCodeAt(p)===10&&s.charCodeAt(p-1)===13&&p--,s=s.slice(0,p)+" "+s.slice(d.index+1)}}return l+s+l}function mO(){return"`"}function bb(e,t){const n=Pm(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))}wb.peek=gO;function wb(e,t,n,s){const l=Xm(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(s);if(bb(e,n)){const w=n.stack;n.stack=w.filter(function(M){return M!=="phrasing"});const x=n.enter("autolink");let E=u.move("<");return E+=u.move(n.containerPhrasing(e,{before:E,after:">",...u.current()})),E+=u.move(">"),x(),n.stack=w,E}const h=n.enter("link");let d=n.enter("label"),p=u.move("[");const _=n.containerPhrasing(e,{before:p,after:"](",...u.current()});p+=u.move(_),d(),p+=u.move("](");const g=/[\0- \u007F]/.test(e.url),S=s.before.charAt(s.before.length-1);let v=e.title||void 0;if(!v&&!g&&(S===`
55
+ `||S==="\r")){let w=0;for(;w<_.length&&_.charCodeAt(w)!==93;)w+=_.charCodeAt(w)===92?2:1;_.charCodeAt(w+1)===58&&(v="")}return!e.url&&typeof v=="string"||g?(d=n.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(n.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(d=n.enter("destinationRaw"),p+=u.move(n.safe(e.url,{before:p,after:typeof v=="string"?" ":")",...u.current()}))),d(),typeof v=="string"&&(d=n.enter(`title${o}`),p+=u.move(" "+l),p+=u.move(n.safe(v,{before:p,after:l,...u.current()})),p+=u.move(l),d()),p+=u.move(")"),h(),p}function gO(e,t,n){return bb(e,n)?"<":"["}xb.peek=_O;function xb(e,t,n,s){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const h=n.createTracker(s);let d=h.move("[");const p=n.containerPhrasing(e,{before:d,after:"]",...h.current()});d+=h.move(p+"]["),u();const _=n.stack;n.stack=_.filter(function(S){return S!=="phrasing"}),u=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...h.current()});return u(),n.stack=_,o(),l==="full"||!p||p!==g?d+=h.move(g+"]"):l==="shortcut"?d=d.slice(0,-1):d+=h.move("]"),d}function _O(){return"["}function eg(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 vO(e){const t=eg(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 yO(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 Cb(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 SO(e,t,n,s){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?yO(n):eg(n);const h=e.ordered?u==="."?")":".":vO(n);let d=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&_&&(!_.children||!_.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&&(d=!0),Cb(n)===u&&_){let g=-1;for(;++g<e.children.length;){const S=e.children[g];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(u=h),n.bulletCurrent=u;const p=n.containerFlow(e,s);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),p}function bO(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 wO(e,t,n,s){const l=bO(n);let o=n.bulletCurrent||eg(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const h=n.createTracker(s);h.move(o+" ".repeat(u-o.length)),h.shift(u);const d=n.enter("listItem"),p=n.indentLines(n.containerFlow(e,h.current()),_);return d(),p;function _(g,S,v){return S?(v?"":" ".repeat(u))+g:(v?o:o+" ".repeat(u-o.length))+g}}function xO(e,t,n,s){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,s);return o(),l(),u}function CO(e,t,n,s){if(!e.children.some(function(h){return $D(h)}))return n.containerFlow(e,s);const o=n.enter("phrasing"),u=n.containerPhrasing(e,s);return o(),u}function EO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tg.attention=Eb;tg.peek=kO;function tg(e,t,n,s){const l=n.enter("phrasing"),o=Zm(e,Eb,n,n.createTracker(s)),u=mf([o],s.before,s.after);return l(),u}function Eb(e,t){return{construct:"strong",markers:EO(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function kO(e,t,n){return n.options.strong||"*"}function TO(e,t,n,s){const l=t?t.children:[],o=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...s,afterNode:l[o+1],beforeNode:l[o-1]})}function MO(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 AO(e,t,n){const s=(Cb(n)+(n.options.ruleSpaces?" ":"")).repeat(MO(n));return n.options.ruleSpaces?s.slice(0,-1):s}const kb={blockquote:YD,break:b4,code:QD,definition:eO,emphasis:Jm,hardBreak:b4,heading:hO,html:_b,image:vb,imageReference:yb,inlineCode:Sb,link:wb,linkReference:xb,list:SO,listItem:wO,paragraph:xO,root:CO,strong:tg,text:TO,thematicBreak:AO};function DO(){return{enter:{table:OO,tableData:x4,tableHeader:x4,tableRow:LO},exit:{codeText:NO,table:RO,tableData:k0,tableHeader:k0,tableRow:k0}}}function OO(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 RO(e){this.exit(e),this.data.inTable=void 0}function LO(e){this.enter({type:"tableRow",children:[]},e)}function k0(e){this.exit(e)}function x4(e){this.enter({type:"tableCell",children:[]},e)}function NO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,zO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function zO(e,t){return t==="|"?t:e}function BO(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
56
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:u,tableCell:d,tableRow:h}};function u(v,w,x,E){return p(_(v,x,E),v.align)}function h(v,w,x,E){const M=g(v,x,E),P=p([M]);return P.slice(0,P.indexOf(`
57
+ `))}function d(v,w,x,E){const M=x.enter("tableCell"),P=x.enter("phrasing"),N=x.containerPhrasing(v,{...E,before:o,after:o});return P(),M(),N}function p(v,w){return VD(v,{align:w,alignDelimiters:s,padding:n,stringLength:l})}function _(v,w,x){const E=v.children;let M=-1;const P=[],N=w.enter("table");for(;++M<E.length;)P[M]=g(E[M],w,x);return N(),P}function g(v,w,x){const E=v.children;let M=-1;const P=[],N=w.enter("tableRow");for(;++M<E.length;)P[M]=d(E[M],v,w,x);return N(),P}function S(v,w,x){let E=kb.inlineCode(v,w,x);return x.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function jO(){return{exit:{taskListCheckValueChecked:C4,taskListCheckValueUnchecked:C4,paragraph:IO}}}function HO(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:PO}}}function C4(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function IO(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 s=n.children[0];if(s&&s.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const h=l[o];if(h.type==="paragraph"){u=h;break}}u===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function PO(e,t,n,s){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",h=n.createTracker(s);o&&h.move(u);let d=kb.listItem(e,t,n,{...s,...h.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(_){return _+u}}function FO(){return[hD(),RD(),BD(),DO(),jO()]}function UO(e){return{extensions:[fD(),LD(e),jD(),BO(e),HO()]}}const VO={tokenize:GO,partial:!0},Tb={tokenize:XO,partial:!0},Mb={tokenize:ZO,partial:!0},Ab={tokenize:QO,partial:!0},qO={tokenize:JO,partial:!0},Db={name:"wwwAutolink",tokenize:KO,previous:Rb},Ob={name:"protocolAutolink",tokenize:WO,previous:Lb},dr={name:"emailAutolink",tokenize:YO,previous:Nb},Pn={};function $O(){return{text:Pn}}let Bs=48;for(;Bs<123;)Pn[Bs]=dr,Bs++,Bs===58?Bs=65:Bs===91&&(Bs=97);Pn[43]=dr;Pn[45]=dr;Pn[46]=dr;Pn[95]=dr;Pn[72]=[dr,Ob];Pn[104]=[dr,Ob];Pn[87]=[dr,Db];Pn[119]=[dr,Db];function YO(e,t,n){const s=this;let l,o;return u;function u(g){return!fp(g)||!Nb.call(s,s.previous)||ig(s.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),h(g))}function h(g){return fp(g)?(e.consume(g),h):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(qO,_,p)(g):g===45||g===95||ri(g)?(o=!0,e.consume(g),d):_(g)}function p(g){return e.consume(g),l=!0,d}function _(g){return o&&l&&ii(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function KO(e,t,n){const s=this;return l;function l(u){return u!==87&&u!==119||!Rb.call(s,s.previous)||ig(s.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VO,e.attempt(Tb,e.attempt(Mb,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function WO(e,t,n){const s=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&Lb.call(s,s.previous)&&!ig(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),h):n(g)}function h(g){if(ii(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),h;if(g===58){const S=l.toLowerCase();if(S==="http"||S==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),o?p:(o=!0,d)):n(g)}function p(g){return g===null||Th(g)||lt(g)||Gs(g)||uf(g)?n(g):e.attempt(Tb,e.attempt(Mb,_),n)(g)}function _(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function GO(e,t,n){let s=0;return l;function l(u){return(u===87||u===119)&&s<3?(s++,e.consume(u),l):u===46&&s===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function XO(e,t,n){let s,l,o;return u;function u(p){return p===46||p===95?e.check(Ab,d,h)(p):p===null||lt(p)||Gs(p)||p!==45&&uf(p)?d(p):(o=!0,e.consume(p),u)}function h(p){return p===95?s=!0:(l=s,s=void 0),e.consume(p),u}function d(p){return l||s||!o?n(p):t(p)}}function ZO(e,t){let n=0,s=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&s<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Ab,t,o)(u):u===null||lt(u)||Gs(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&s++,e.consume(u),l}}function QO(e,t,n){return s;function s(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(e.consume(h),s):h===38?(e.consume(h),o):h===93?(e.consume(h),l):h===60||h===null||lt(h)||Gs(h)?t(h):n(h)}function l(h){return h===null||h===40||h===91||lt(h)||Gs(h)?t(h):s(h)}function o(h){return ii(h)?u(h):n(h)}function u(h){return h===59?(e.consume(h),s):ii(h)?(e.consume(h),u):n(h)}}function JO(e,t,n){return s;function s(o){return e.consume(o),l}function l(o){return ri(o)?n(o):t(o)}}function Rb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||lt(e)}function Lb(e){return!ii(e)}function Nb(e){return!(e===47||fp(e))}function fp(e){return e===43||e===45||e===46||e===95||ri(e)}function ig(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const eR={tokenize:oR,partial:!0};function tR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sR,continuation:{tokenize:lR},exit:aR}},text:{91:{name:"gfmFootnoteCall",tokenize:rR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iR,resolveTo:nR}}}}function iR(e,t,n){const s=this;let l=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u;for(;l--;){const d=s.events[l][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return h;function h(d){if(!u||!u._balanced)return n(d);const p=gn(s.sliceSerialize({start:u.end,end:s.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function nR(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 s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},h=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...h),e}function rR(e,t,n){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,u;return h;function h(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(o>999||g===93&&!u||g===null||g===91||lt(g))return n(g);if(g===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return l.includes(gn(s.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return lt(g)||(u=!0),o++,e.consume(g),g===92?_:p}function _(g){return g===91||g===92||g===93?(e.consume(g),o++,p):p(g)}}function sR(e,t,n){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,u=0,h;return d;function d(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):n(w)}function _(w){if(u>999||w===93&&!h||w===null||w===91||lt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=gn(s.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return lt(w)||(h=!0),u++,e.consume(w),w===92?g:_}function g(w){return w===91||w===92||w===93?(e.consume(w),u++,_):_(w)}function S(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),l.includes(o)||l.push(o),Ke(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function lR(e,t,n){return e.check(hc,t,e.attempt(eR,t,n))}function aR(e){e.exit("gfmFootnoteDefinition")}function oR(e,t,n){const s=this;return Ke(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=s.events[s.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function cR(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(u,h){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let p=d;for(;p--;)if(u[p][0]==="exit"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[p][1].end.offset-u[p][1].start.offset){u[d][1].type="strikethroughSequence",u[p][1].type="strikethroughSequence";const _={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[d][1].end)},g={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[d][1].start)},S=[["enter",_,h],["enter",u[p][1],h],["exit",u[p][1],h],["enter",g,h]],v=h.parser.constructs.insideSpan.null;v&&mn(S,S.length,0,hf(v,u.slice(p+1,d),h)),mn(S,S.length,0,[["exit",g,h],["enter",u[d][1],h],["exit",u[d][1],h],["exit",_,h]]),mn(u,p-1,d-p+3,S),d=p+S.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function o(u,h,d){const p=this.previous,_=this.events;let g=0;return S;function S(w){return p===126&&_[_.length-1][1].type!=="characterEscape"?d(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const x=os(p);if(w===126)return g>1?d(w):(u.consume(w),g++,v);if(g<2&&!n)return d(w);const E=u.exit("strikethroughSequenceTemporary"),M=os(w);return E._open=!M||M===2&&!!x,E._close=!x||x===2&&!!M,h(w)}}}class uR{constructor(){this.map=[],this.index=new Map}add(t,n,s){hR(this,t,n,s)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let l=s.pop();for(;l;){for(const o of l)t.push(o);l=s.pop()}this.map.length=0,this.index.clear()}}function hR(e,t,n,s){if(n===0&&s.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,l[2].push(...s);return}const o=[t,n,s];e.map.push(o),e.index.set(t,o)}function fR(e,t){let n=!1;const s=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function dR(){return{flow:{null:{name:"table",tokenize:pR,resolveAll:mR}}}}function pR(e,t,n){const s=this;let l=0,o=0,u;return h;function h(k){let K=s.events.length-1;for(;K>-1;){const{type:Z}=s.events[K][1];if(Z==="lineEnding"||Z==="linePrefix")K--;else break}const W=K>-1?s.events[K][1].type:null,q=W==="tableHead"||W==="tableRow"?R:d;return q===R&&s.parser.lazy[s.now().line]?n(k):q(k)}function d(k){return e.enter("tableHead"),e.enter("tableRow"),p(k)}function p(k){return k===124||(u=!0,o+=1),_(k)}function _(k){return k===null?n(k):ke(k)?o>1?(o=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),v):n(k):Ie(k)?Ke(e,_,"whitespace")(k):(o+=1,u&&(u=!1,l+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),u=!0,_):(e.enter("data"),g(k)))}function g(k){return k===null||k===124||lt(k)?(e.exit("data"),_(k)):(e.consume(k),k===92?S:g)}function S(k){return k===92||k===124?(e.consume(k),g):g(k)}function v(k){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(k):(e.enter("tableDelimiterRow"),u=!1,Ie(k)?Ke(e,w,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):w(k))}function w(k){return k===45||k===58?E(k):k===124?(u=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),x):Q(k)}function x(k){return Ie(k)?Ke(e,E,"whitespace")(k):E(k)}function E(k){return k===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),M):k===45?(o+=1,M(k)):k===null||ke(k)?X(k):Q(k)}function M(k){return k===45?(e.enter("tableDelimiterFiller"),P(k)):Q(k)}function P(k){return k===45?(e.consume(k),P):k===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(k))}function N(k){return Ie(k)?Ke(e,X,"whitespace")(k):X(k)}function X(k){return k===124?w(k):k===null||ke(k)?!u||l!==o?Q(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):Q(k)}function Q(k){return n(k)}function R(k){return e.enter("tableRow"),V(k)}function V(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),V):k===null||ke(k)?(e.exit("tableRow"),t(k)):Ie(k)?Ke(e,V,"whitespace")(k):(e.enter("data"),se(k))}function se(k){return k===null||k===124||lt(k)?(e.exit("data"),V(k)):(e.consume(k),k===92?me:se)}function me(k){return k===92||k===124?(e.consume(k),se):se(k)}}function mR(e,t){let n=-1,s=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],h=!1,d=0,p,_,g;const S=new uR;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(h=!1,d!==0&&(E4(S,t,d,p,_),_=void 0,d=0),p={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},S.add(n,0,[["enter",p,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(s=!0,g=void 0,o=[0,0,0,0],u=[0,n+1,0,0],h&&(h=!1,_={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},S.add(n,0,[["enter",_,t]])),l=w.type==="tableDelimiterRow"?2:_?3:1):l&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(s=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=Ju(S,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(u[0]=u[1],g=Ju(S,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):w.type==="tableHead"?(h=!0,d=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(d=n,o[1]!==0?(u[0]=u[1],g=Ju(S,t,o,l,n,g)):u[1]!==0&&(g=Ju(S,t,u,l,n,g)),l=0):l&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&E4(S,t,d,p,_),S.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=fR(t.events,n))}return e}function Ju(e,t,n,s,l,o){const u=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",h="tableContent";n[0]!==0&&(o.end=Object.assign({},ta(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const d=ta(t.events,n[1]);if(o={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const p=ta(t.events,n[2]),_=ta(t.events,n[3]),g={type:h,start:Object.assign({},p),end:Object.assign({},_)};if(e.add(n[2],0,[["enter",g,t]]),s!==2){const S=t.events[n[2]],v=t.events[n[3]];if(S[1].end=Object.assign({},v[1].end),S[1].type="chunkText",S[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ta(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function E4(e,t,n,s,l){const o=[],u=ta(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),s.end=Object.assign({},u),o.push(["exit",s,t]),e.add(n+1,0,o)}function ta(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const gR={name:"tasklistCheck",tokenize:vR};function _R(){return{text:{91:gR}}}function vR(e,t,n){const s=this;return l;function l(d){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return lt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),h):n(d)}function h(d){return ke(d)?t(d):Ie(d)?e.check({tokenize:yR},t,n)(d):n(d)}}function yR(e,t,n){return Ke(e,s,"whitespace");function s(l){return l===null?n(l):t(l)}}function SR(e){return F6([$O(),tR(),cR(e),dR(),_R()])}const bR={};function wR(e){const t=this,n=e||bR,s=t.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),u=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(SR(n)),o.push(FO()),u.push(UO(n))}function Jo(e,t,n=""){if(e==="")return"";const s=e.replace(/\\/g,"/");if(t!==""){const l=`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/`,o=s.toLowerCase(),u=l.toLowerCase();if(o===u.slice(0,-1))return".";if(o.startsWith(u))return s.slice(l.length)}if(n!==""){const l=`${n.replace(/\\/g,"/").replace(/\/+$/,"")}/`,o=s.toLowerCase(),u=l.toLowerCase();if(o===u.slice(0,-1))return"~";if(o.startsWith(u))return`~/${s.slice(l.length)}`}return s}function zb(e){const t=e.split(/[\\/]/);return t[t.length-1]??e}function gf(e,t){return/[\\/]$/.test(e)?e+t:`${e}\\${t}`}const ng=I.createContext({base:"",streaming:!1}),xR=[wR],k4=24*1024*1024,Is=new Map;let eh=0;function CR(e,t){if(t.length>k4)return;const n=Is.get(e);for(n!==void 0&&(eh-=n.length),Is.delete(e),Is.set(e,t),eh+=t.length;eh>k4;){const s=Is.keys().next().value;if(s===void 0)break;const l=Is.get(s);Is.delete(s),eh-=l?.length??0}}function ER({src:e,alt:t}){const{base:n,fsRead:s}=I.useContext(ng),l=/^(https?:|data:|blob:)/i.test(e),o=l?e:gf(n,decodeURIComponent(e)),u=l?void 0:Is.get(o),[h,d]=I.useState(l?e:u),[p,_]=I.useState(!1);return I.useEffect(()=>{if(l||h!==void 0||s===void 0)return;let g=!0;return s(o).then(S=>{const v=S;if(g)if(v.kind==="image"&&v.tooLarge!==!0&&v.base64!==void 0){const w=`data:${v.mime};base64,${v.base64}`;CR(o,w),d(w)}else _(!0)}).catch(()=>{g&&_(!0)}),()=>{g=!1}},[l,o,s,h]),p||!l&&h===void 0?y.jsxs("span",{className:"file-md-img-missing",children:["[图片:",t||e,"]"]}):y.jsx("img",{src:h,alt:t,loading:"lazy"})}const kR=200,TR=15e5,Qr=new Map;let th=0;const Mo=new Map;function MR(e,t){return t+"\0"+e}function AR(e,t,n){for(Qr.has(t)&&(Qr.delete(t),th-=Mo.get(t)??0,Mo.delete(t)),Qr.set(t,n),Mo.set(t,e.length),th+=e.length;Qr.size>kR||th>TR;){const s=Qr.keys().next().value;if(s===void 0)break;Qr.delete(s),th-=Mo.get(s)??0,Mo.delete(s)}}function Bb({first:e,children:t}){return y.jsxs(y.Fragment,{children:[e?null:`
58
+ `,t]})}function DR(e){return e.split(`
59
+ `).map((t,n)=>y.jsx(Bb,{first:n===0,children:y.jsx("span",{className:"line",children:t})},n))}const OR=120;function RR({code:e,lang:t,streaming:n}){const s=MR(e,t),[l,o]=I.useState(()=>{const d=Qr.get(s);return d===void 0?null:{key:s,value:d}}),u=I.useRef(null);I.useEffect(()=>{const d=Qr.get(s);if(d!==void 0){u.current!==s&&(u.current=s,o({key:s,value:d}));return}let p=!0;const _=()=>{bm(e,t).then(S=>{!p||S===null||(AR(e,s,S),u.current=s,o({key:s,value:S}))}).catch(()=>{})},g=n?window.setTimeout(_,OR):null;return g===null&&_(),()=>{p=!1,g!==null&&window.clearTimeout(g)}},[e,s,t,n]);const h=l!==null&&l.key===s?l.value:null;return y.jsx("div",{className:"file-code-body",children:y.jsx("pre",{className:"shiki",children:y.jsx("code",{children:h===null?DR(e):h.map((d,p)=>y.jsx(Bb,{first:p===0,children:y.jsx("span",{className:"line",children:d.map((_,g)=>y.jsx("span",{style:_.style,children:_.text},g))})},p))})})})}function LR({className:e,children:t,node:n}){const{streaming:s}=I.useContext(ng),l=/language-([\w-]+)/.exec(e??""),o=String(t??"").replace(/\n$/,"");if(l===null)return y.jsx("code",{className:e,children:t});const u=n?.position?.start?.offset;return y.jsx(RR,{code:o,lang:l[1],streaming:s},u===void 0?void 0:"code:"+String(u))}const NR={a:({href:e,children:t,title:n})=>y.jsx("a",{href:e,...n===void 0?{}:{title:n},rel:"noreferrer noopener",target:"_blank",children:t}),img:({src:e,alt:t})=>{const n=typeof e=="string"?e:"";return n===""?y.jsx("span",{className:"file-md-img-missing",children:"[图片]"}):y.jsx(ER,{src:n,alt:t??""})},code:LR,pre:({children:e})=>y.jsx(y.Fragment,{children:e})},jb=I.memo(function({text:t,path:n,fsRead:s,streaming:l=!1}){const o=n.slice(0,Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"))),u=I.useMemo(()=>({base:o,fsRead:s,streaming:l}),[o,s,l]);return y.jsx(ng.Provider,{value:u,children:y.jsx("div",{className:"file-md",children:y.jsx(tD,{remarkPlugins:xR,components:NR,children:t})})})}),rg="这条能力来自桌面外壳的原生桥,浏览器里没有它";function zR(){const e=globalThis.dscNative;if(e===null||typeof e!="object")return null;const t=e;return typeof t.call=="function"?t:null}function el(){const e=zR(),t=e?.on;return{available:e!==null,version:e===null?null:typeof e.version=="number"?e.version:Y0,invoke(n,s=[]){return e===null?Promise.reject(new Error(rg)):e.call(n,[...s])},on(n,s){return t===void 0?()=>{}:t(n,s)}}}function sg(){return I.useMemo(()=>el(),[])}const Rh=200,Lh=420,es=480,lg=80,Nh=300,zh=820,ag=420;function og(){return ca("--dsc-jump-lane",36)+ca("--dsc-scrollbar-w",5)}const cg=3200,Lt={sidebarWidth:"dsc.sidebarWidth",sidebarCollapsed:"dsc.uiSidebarCollapsed",threadWidth:"dsc.threadWidth",dockWidth:"dsc.dockWidth",diffPaneWidth:"dsc.diffPaneWidth"},ug=(()=>{const e={};if(typeof window>"u")return e;const t=new URLSearchParams(window.location.search).get("panels");if(t===null)return e;for(const n of t.split(",")){const[s="",l=""]=n.split(":");if(s==="collapsed"){l==="1"&&(e.collapsed=!0);continue}const o=Number(l);Number.isFinite(o)&&(s==="sidebar"||s==="thread"||s==="dock"||s==="diff")&&(e[s]=o)}return e})(),hg={[Lt.sidebarWidth]:"sidebar",[Lt.threadWidth]:"thread",[Lt.dockWidth]:"dock",[Lt.diffPaneWidth]:"diff",[Lt.sidebarCollapsed]:"collapsed"};let sa={...ug},Hb=null;function Bh(e){sa={...e}}function fg(e){Hb=e}function Ib(e,t){const n=hg[e];n!==void 0&&(t===null?delete sa[n]:sa[n]=t,Hb?.({...sa}))}function la(e,t,n){const s=h=>Number.isFinite(h)&&h>=t&&h<=n;try{const h=localStorage.getItem(e);if(h!==null){const d=Number(h);if(s(d))return d}}catch{}const l=hg[e];if(l===void 0)return null;const o=ug[l];if(typeof o=="number"&&s(o))return o;const u=sa[l];return typeof u=="number"&&s(u)?u:null}function is(e,t){try{t===null?localStorage.removeItem(e):localStorage.setItem(e,String(t))}catch{}Ib(e,t)}function dg(e){try{const l=localStorage.getItem(e);if(l!==null)return l==="1"}catch{}const t=hg[e];if(t===void 0)return!1;const n=ug[t];if(typeof n=="boolean")return n;const s=sa[t];return typeof s=="boolean"?s:!1}function pg(e,t){try{localStorage.setItem(e,t?"1":"0")}catch{}Ib(e,t)}function Nn(e,t){const n=document.documentElement;t===null?n.style.removeProperty(e):n.style.setProperty(e,t)}function ca(e,t){const n=Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue(e));return Number.isFinite(n)&&n>0?n:t}function mg(){return ca("--dsc-sidebar-w",237)}function ua(e){const t=I.useRef(0),n=I.useRef(0),s=I.useRef(0),l=I.useRef(!1),o=I.useRef(null),u=I.useRef(e);u.current=e;const h=()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},d=w=>u.current.clamp(t.current+u.current.sign*(w-n.current)),p=w=>{l.current=!1,h(),w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId),w.currentTarget.toggleAttribute("data-dragging",!1),document.body.classList.remove("resizing")},_=I.useCallback(w=>{w.button===0&&(w.preventDefault(),w.currentTarget.setPointerCapture(w.pointerId),t.current=u.current.getBase(),n.current=w.clientX,s.current=w.clientX,l.current=!0,w.currentTarget.toggleAttribute("data-dragging",!0),document.body.classList.add("resizing"))},[]),g=I.useCallback(w=>{if(!(!l.current||!w.currentTarget.hasPointerCapture(w.pointerId))){if(s.current=w.clientX,u.current.trackPointerY===!0){const x=w.currentTarget.getBoundingClientRect();w.currentTarget.style.setProperty("--dsc-handle-y",`${w.clientY-x.top}px`)}o.current??=requestAnimationFrame(()=>{o.current=null,u.current.onDrag(d(s.current))})}},[]),S=I.useCallback(w=>{if(!l.current)return;const x=w.clientX!==n.current,E=d(w.clientX);p(w),x&&u.current.onCommit(E)},[]),v=I.useCallback(w=>{l.current&&(p(w),u.current.onDrag(u.current.getBase()))},[]);return{onPointerDown:_,onPointerMove:g,onPointerUp:S,onPointerCancel:v}}const T0=50;function Pb({base64:e}){const[t,n]=I.useState([]),[s,l]=I.useState(0),[o,u]=I.useState(""),h=I.useRef(!1);return I.useEffect(()=>{if(h.current)return;h.current=!0;let d=!0;return(async()=>{const[{getDocument:p,GlobalWorkerOptions:_},g]=await Promise.all([_e(()=>import("./chunk-CUWRgxuq.js"),[],import.meta.url),_e(()=>import("./chunk-Dualf0xi.js"),[],import.meta.url)]);_.workerSrc=g.default;const S=Uint8Array.from(atob(e),x=>x.charCodeAt(0)),v=await p({data:S}).promise;if(!d)return;l(v.numPages);const w=Math.min(v.numPages,T0);for(let x=1;x<=w;x+=1){const E=await v.getPage(x),M=E.getViewport({scale:1.5}),P=document.createElement("canvas");P.width=Math.ceil(M.width),P.height=Math.ceil(M.height);const N=P.getContext("2d");if(await E.render({canvas:P,canvasContext:N,viewport:M}).promise,!d)return;const X=P.toDataURL("image/png");n(Q=>[...Q,X])}})().catch(p=>{d&&u(p instanceof Error?p.message:String(p))}),()=>{d=!1}},[e]),o!==""?y.jsx("div",{className:"file-preview-empty",children:`PDF 解析失败:${o}`}):y.jsxs("div",{className:"file-pdf",children:[t.length===0&&y.jsx("div",{className:"file-preview-empty",children:"渲染中…"}),t.map((d,p)=>y.jsx("img",{className:"file-pdf-page",src:d,alt:`第 ${p+1} 页`},p)),s>T0&&y.jsxs("div",{className:"tree-note","data-tree-note":"truncated",children:["共 ",s," 页,仅渲染前 ",T0," 页"]})]})}const _f="【改动前预览·尚未落盘】",Fb={create:"新建",update:"修改"};function BR(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const jR=new RegExp(`^${BR(_f)}(新建|修改) (.+)(([^()]*))$`);function HR(e){const t=/^\+(\d+) 行 \/ -(\d+) 行$/.exec(e);if(t===null)return null;const n=Number(t[1]),s=Number(t[2]);return Number.isFinite(n)&&Number.isFinite(s)?{added:n,removed:s}:null}function IR(e){return e==="新建"?"create":e==="修改"?"update":null}function gg(e){return e.startsWith("@@")?"hunk":e.startsWith("+")?"add":e.startsWith("-")?"remove":e.startsWith(" ")?"context":e.startsWith("(")||e.startsWith("…")?"note":e===""?"context":"note"}function _g(e){return e.startsWith(_f)}function Ub(e){if(!_g(e))return null;const t=e.indexOf(`
60
+ `),n=t===-1?e:e.slice(0,t),s=t===-1?"":e.slice(t+1),l=(s===""?[]:s.split(`
61
+ `)).map(h=>({kind:gg(h),text:h})),o=jR.exec(n);if(o===null)return{head:n,action:null,path:null,counts:null,countsText:null,lines:l};const u=o[3]??"";return{head:n,action:IR(o[1]??""),path:o[2]??"",counts:HR(u),countsText:u,lines:l}}const PR={create:"新建文件",update:"编辑文件"};function Vb({notice:e,cwd:t}){const n=e.path,[s,l]=I.useState(!1),o=I.useId(),u=e.lines.length>0,h=e.action===null?null:PR[e.action];return y.jsxs("div",{className:"entry-review","data-review-notice":"","data-action":e.action??void 0,"data-open":s,children:[y.jsxs("button",{type:"button",className:"entry-review-head",...u?{"aria-expanded":s,"aria-controls":o}:{"aria-expanded":!1},"data-tip":u?s?"收起这份改动":"展开看改了什么":void 0,onClick:()=>{u&&l(d=>!d)},children:[y.jsx(cc,{name:n??"",size:14,className:"entry-review-icon"}),h===null?null:y.jsx("span",{className:"entry-review-verb",children:h}),y.jsx("span",{className:"entry-review-path",title:n??e.head,children:n===null?e.head:Jo(n,t)}),e.counts!==null?y.jsxs("span",{className:"changes-counts",children:[y.jsx("span",{className:"changes-added",children:`+${String(e.counts.added)} 行`}),y.jsx("span",{className:"changes-removed",children:`-${String(e.counts.removed)} 行`})]}):e.countsText===null||e.countsText===""?null:y.jsx("span",{className:"entry-review-counts",children:e.countsText}),u?y.jsx(Jh,{size:11,className:"entry-review-chevron"}):null]}),u?y.jsx("div",{className:"entry-review-diff",id:o,hidden:!s,children:e.lines.map((d,p)=>y.jsx("div",{className:"entry-review-line","data-kind":d.kind,children:d.text},String(p)))}):null]})}const FR=/^\s*<review-findings\b([^>]*)>([\s\S]*)<\/review-findings>\s*$/i,UR=/^#{2,4}\s*\*{0,2}\[P(\d+)\]\*{0,2}\s*(.+?)\s*$/;function T4(e,t){return new RegExp(`(?:^|\\s)${t}="([^"]*)"`).exec(e)?.[1]}function VR(e){const t=Number(e);return t===0||t===1||t===2||t===3?t:void 0}function qR(e){const t=e.replace(/\*\*/g,"").replace(/`/g,"").replace(/^\s*[*-]\s*/,"").trim(),n=t.search(/[::]/);return n<=0?null:{key:t.slice(0,n).trim(),value:t.slice(n+1).trim()}}function $R(e){const t=e.trim().replace(/:/g,":");if(t==="")return;const n=t.lastIndexOf(":");if(n>0){const s=Number.parseInt(t.slice(n+1),10);if(Number.isFinite(s)&&s>0)return{path:t.slice(0,n),line:s}}return{path:t}}function ih(e,t){return t===""?e:e===""?t:`${e} ${t}`}function qb(e){const t=FR.exec(e);if(t===null)return null;const n=t[1]??"",s=(t[2]??"").trim(),l=T4(n,"teammate")??"",o=T4(n,"state"),u=s===""?[]:s.split(`
62
+ `),h=[];for(let g=0;g<u.length;g+=1){const S=UR.exec(u[g]??"");S!==null&&h.push({index:g,priority:VR(S[1]??""),title:S[2]??""})}const d={teammate:l,...o===void 0?{}:{state:o}};if(h.length===0)return{...d,findings:[],note:u.join(" ").trim()};const p=h.map((g,S)=>{const v=g.index+1,w=S+1<h.length?h[S+1]?.index??u.length:u.length,x={...g.priority===void 0?{}:{priority:g.priority},title:g.title,detail:""};let E=null;for(let M=v;M<w;M+=1){const P=u[M]??"",N=qR(P);if(N!==null&&N.key==="位置"){const X=$R(N.value);X!==void 0&&(x.location=X),E=null;continue}if(N!==null&&N.key==="说明"){E="detail",x.detail=ih(x.detail,N.value);continue}if(N!==null&&N.key==="建议"){E="suggestion",x.suggestion=ih(x.suggestion??"",N.value);continue}if(P.trim()===""){E=null;continue}E==="suggestion"?x.suggestion=ih(x.suggestion??"",P.trim()):x.detail=ih(x.detail,P.trim())}return x}),_=u.slice(0,h[0]?.index??0).join(" ").trim();return{...d,findings:p,note:_}}const YR={0:"P0 必须修",1:"P1 重要",2:"P2 建议",3:"P3 可选"};function KR(e,t){const n=/^[a-zA-Z]:[\\/]/.test(t),s=t.startsWith("/")||t.startsWith("\\");return n||s||e===""?t:gf(e,t)}function WR({finding:e,cwd:t,onOpenLocation:n}){const s=e.priority,l=e.location,o=l===void 0?void 0:()=>{n?.(KR(t,l.path),l.line)};return y.jsxs("li",{className:"review-finding",...s===void 0?{}:{"data-priority":`P${String(s)}`},children:[y.jsxs("div",{className:"review-finding-head",children:[y.jsx("span",{className:"review-finding-badge",children:s===void 0?"P?":YR[s]}),y.jsx("span",{className:"review-finding-title",children:e.title})]}),l===void 0?null:y.jsxs("button",{type:"button",className:"review-finding-loc",disabled:n===void 0,title:n===void 0?`${l.path}${l.line===void 0?"":`:${String(l.line)}`}`:l.line===void 0?"在预览里打开这个文件":`在预览里打开 ${l.path}:${String(l.line)}`,onClick:o,children:[l.path,l.line===void 0?"":`:${String(l.line)}`]}),e.detail===""?null:y.jsx("p",{className:"review-finding-detail",children:e.detail}),e.suggestion===void 0||e.suggestion===""?null:y.jsxs("p",{className:"review-finding-suggest",children:["建议:",e.suggestion]})]})}function $b({doc:e,cwd:t="",onOpenLocation:n}){return y.jsxs("div",{className:"review-findings","data-review-findings":"",children:[y.jsxs("div",{className:"review-findings-head",children:[y.jsx(cr,{size:14}),y.jsxs("span",{className:"review-findings-title",children:["代码审查 · ",e.teammate===""?"审查队友":e.teammate]}),e.state===void 0?null:y.jsx("span",{className:"review-findings-state",children:e.state}),e.findings.length===0?null:y.jsx("span",{children:`${String(e.findings.length)} 条`})]}),e.note===""?null:y.jsx("p",{className:"review-findings-note",children:e.note}),e.findings.length===0?null:y.jsx("ul",{className:"review-findings-list",children:e.findings.map((s,l)=>y.jsx(WR,{finding:s,cwd:t,...n===void 0?{}:{onOpenLocation:n}},`${String(l)}:${s.title}`))})]})}const M0=4;function vg(e){const{value:t,options:n,onPick:s,className:l,disabled:o=!1,ariaLabel:u,displayLabel:h}=e,[d,p]=I.useState(!1),[_,g]=I.useState(0),S=I.useRef(null),v=I.useRef(null),[w,x]=I.useState(null),E=I.useId(),M=n.find(V=>V.value===t),P=h??M?.label??"",N=(V=!0)=>{p(!1),V&&S.current?.focus()},X=()=>{if(o||n.length===0)return;const V=Math.max(0,n.findIndex(se=>se.value===t));g(V),p(!0)};I.useLayoutEffect(()=>{if(!d){x(null);return}const V=S.current,se=v.current;if(V===null||se===null)return;const me=V.getBoundingClientRect(),k=se.offsetHeight,W=me.bottom+M0+k<=window.innerHeight?me.bottom+M0:Math.max(4,me.top-M0-k);x({left:me.left,top:W,width:me.width})},[d]),I.useEffect(()=>{if(!d)return;const V=me=>{const k=me.target instanceof Node?me.target:null;k!==null&&(v.current?.contains(k)===!0||S.current?.contains(k)===!0)||p(!1)},se=me=>{v.current?.contains(me.target)!==!0&&p(!1)};return document.addEventListener("pointerdown",V,!0),document.addEventListener("wheel",se,!0),()=>{document.removeEventListener("pointerdown",V,!0),document.removeEventListener("wheel",se,!0)}},[d]);const Q=V=>{V.value!==t&&s(V.value),N()},R=V=>{if(!d){(V.key==="ArrowDown"||V.key==="ArrowUp"||V.key==="Enter"||V.key===" ")&&(V.preventDefault(),X());return}const se=n.length-1;switch(V.key){case"ArrowDown":V.preventDefault(),g(me=>Math.min(se,me+1));break;case"ArrowUp":V.preventDefault(),g(me=>Math.max(0,me-1));break;case"Home":V.preventDefault(),g(0);break;case"End":V.preventDefault(),g(se);break;case"Enter":V.preventDefault(),n[_]!==void 0&&Q(n[_]);break;case"Escape":V.stopPropagation(),N();break;case"Tab":N(!1);break}};return I.useEffect(()=>{d&&v.current?.querySelector('[data-active="true"]')?.scrollIntoView({block:"nearest"})},[_,d]),y.jsxs(y.Fragment,{children:[y.jsxs("button",{ref:S,type:"button",className:`select-trigger${l!==void 0?` ${l}`:""}`,disabled:o,role:"combobox","aria-expanded":d,"aria-haspopup":"listbox","aria-controls":d?E:void 0,"aria-activedescendant":d?`${E}-${String(_)}`:void 0,"aria-label":u,"data-tip":P,onClick:()=>d?N():X(),onKeyDown:R,children:[y.jsx("span",{className:"select-value",children:P}),y.jsx(Jh,{size:14,className:"select-chevron"})]}),d&&cf.createPortal(y.jsx("div",{ref:v,id:E,className:"select-pop",role:"listbox",style:w===null?{visibility:"hidden"}:{left:`${String(w.left)}px`,top:`${String(w.top)}px`,minWidth:`${String(w.width)}px`},children:n.map((V,se)=>{const me=V.value===t;return y.jsxs("button",{type:"button",id:`${E}-${String(se)}`,role:"option",className:"select-opt","data-selected":me||void 0,"data-active":se===_||void 0,"aria-selected":me,onPointerEnter:()=>g(se),onClick:()=>Q(V),children:[y.jsx("span",{className:"select-opt-label",children:V.label}),me&&y.jsx(dm,{size:14,className:"select-opt-check"})]},V.value)})}),document.body)]})}const dp=500,pp=100;function jh({message:e}){return y.jsx("div",{className:"file-preview-empty",children:e})}function GR(e){const t=e.length>dp||e.some(o=>o.length>pp),n=e.slice(0,dp).map(o=>o.slice(0,pp)),[s,...l]=n;return{head:s,body:l,truncated:t}}function Yb({rows:e,lead:t}){const{head:n,body:s,truncated:l}=GR(e);return y.jsxs("div",{className:"file-table-wrap",children:[t,l&&y.jsxs("div",{className:"tree-note","data-tree-note":"truncated",children:["表格较大,仅显示前 ",dp," 行 × ",pp," 列"]}),y.jsxs("table",{className:"file-table",children:[n!==void 0&&y.jsx("thead",{children:y.jsx("tr",{children:n.map((o,u)=>y.jsx("th",{children:o},u))})}),y.jsx("tbody",{children:s.map((o,u)=>y.jsx("tr",{children:o.map((h,d)=>y.jsx("td",{children:h},d))},u))})]})]})}function Kb({text:e,path:t}){const[n,s]=I.useState(null),[l,o]=I.useState("");return I.useEffect(()=>{let u=!0;return s(null),o(""),_e(()=>import("./chunk-Bfdlo8Me.js").then(h=>h.p),[],import.meta.url).then(h=>{const d=h.parse(e.replace(/\r\n/g,`
63
+ `),{delimiter:t.toLowerCase().endsWith(".tsv")?" ":void 0});u&&s(d.data)}).catch(h=>{u&&o(h instanceof Error?h.message:String(h))}),()=>{u=!1}},[e,t]),l!==""?y.jsx(jh,{message:`解析失败:${l}`}):n===null?y.jsx(jh,{message:"解析中…"}):y.jsx(Yb,{rows:n})}function Wb({base64:e}){const[t,n]=I.useState(null),[s,l]=I.useState(0),[o,u]=I.useState([]),[h,d]=I.useState(""),p=I.useRef(null),_=v=>{_e(()=>import("./chunk-YQ4lDkt_.js"),[],import.meta.url).then(w=>{const x=p.current,E=x?.Sheets[x.SheetNames[v]??""];E!==void 0&&u(w.utils.sheet_to_json(E,{header:1,raw:!1,defval:""}).map(M=>M.map(P=>String(P??""))))})};I.useEffect(()=>{let v=!0;n(null),d(""),l(0);const w=Uint8Array.from(atob(e),x=>x.charCodeAt(0));return _e(()=>import("./chunk-YQ4lDkt_.js"),[],import.meta.url).then(x=>{const E=x.read(w,{type:"array"});v&&(p.current=E,n(E.SheetNames),_(0))}).catch(x=>{v&&d(x instanceof Error?x.message:String(x))}),()=>{v=!1}},[e]);const g=v=>{l(v),d(""),_(v)};if(h!=="")return y.jsx(jh,{message:`解析失败:${h}`});if(t===null)return y.jsx(jh,{message:"解析中…"});const S=t.length>1?y.jsx("div",{className:"file-sheets",children:t.map((v,w)=>y.jsx("button",{type:"button",className:`file-sheet${w===s?" on":""}`,onClick:()=>g(w),children:v},v))}):void 0;return y.jsx(Yb,{rows:o,lead:S})}const XR="--dsc-thread-col-start",ZR="--dsc-thread-col-end";function yg(e){const t=g=>{const S=n.current?.parentElement??null;if(S===null)return es;const v=Math.max(es,S.clientWidth-lg-og());if(g===null){const w=S.querySelector(".chat-inner");return Math.min(Math.max(w?.offsetWidth??es,es),v)}return Math.min(Math.max(g,es),v)},n=I.useRef(null),s=I.useCallback(()=>n.current?.parentElement??null,[]),l=I.useCallback(()=>{const g=s();if(g===null)return;const S=g.querySelector(".chat-inner");if(S===null)return;const v=g.getBoundingClientRect(),w=S.getBoundingClientRect();g.style.setProperty(XR,`${String(w.left-v.left)}px`),g.style.setProperty(ZR,`${String(w.right-v.left)}px`)},[s]);I.useLayoutEffect(()=>{l();const g=s();if(g===null)return;const S=new ResizeObserver(l);S.observe(g);const v=g.querySelector(".chat-inner");v!==null&&S.observe(v);const w=new MutationObserver(l);return w.observe(document.documentElement,{attributeFilter:["style"],attributes:!0}),window.addEventListener("resize",l),()=>{S.disconnect(),w.disconnect(),window.removeEventListener("resize",l)}},[l,s,e.width]);const o=I.useCallback(()=>t(e.width),[e.width]),u=I.useCallback(g=>t(g),[e.width]),h=I.useCallback(g=>{Nn("--dsc-thread-user-max",`${g}px`),l()},[l]),d={getBase:o,clamp:u,onDrag:h,trackPointerY:!0},p=ua({...d,sign:-2,onCommit:e.onCommit}),_=ua({...d,sign:2,onCommit:e.onCommit});return y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:n,className:"thread-handle","data-side":"left","data-tip":"拖拽调整正文宽度,双击复位",onPointerDown:p.onPointerDown,onPointerMove:p.onPointerMove,onPointerUp:p.onPointerUp,onPointerCancel:p.onPointerCancel,onDoubleClick:e.onReset}),y.jsx("div",{className:"thread-handle","data-side":"right","data-tip":"拖拽调整正文宽度,双击复位",onPointerDown:_.onPointerDown,onPointerMove:_.onPointerMove,onPointerUp:_.onPointerUp,onPointerCancel:_.onPointerCancel,onDoubleClick:e.onReset})]})}function Gb(e){if(e===void 0)return null;const t=e.ts;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}function Xb(e){if(e===null||!Number.isFinite(e)||e<=0)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Zb(e){if(e===null||!Number.isFinite(e)||e<=0)return null;const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=s=>String(s).padStart(2,"0");return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function Qb(e){if(e===null||!Number.isFinite(e)||e<0)return null;const t=Math.max(1,Math.round(e/1e3)),n=t%60,s=Math.floor(t/60)%60,l=Math.floor(t/3600),o=u=>String(u).padStart(2,"0");return l>0?`${String(l)}时${o(s)}分${o(n)}秒`:s>0?`${String(s)}分${String(n)}秒`:`${String(n)}秒`}function Jb(e){if(e==null||!Number.isFinite(e)||e<0)return null;const t=Math.round(e/100)/10;if(t<60)return`${t.toFixed(1)}s`;const n=Math.round(e/1e3),s=h=>String(h).padStart(2,"0"),l=n%60,o=Math.floor(n/60)%60,u=Math.floor(n/3600);return u>0?`${String(u)}h${s(o)}m`:`${String(o)}m${s(l)}s`}const QR=2200,JR=6e3,eL=4,tL=200,iL='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="8" r="6.5"/><path d="M5.2 8.2 7.1 10.1 10.8 6"/></svg>',nL='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><circle cx="8" cy="8" r="6.5"/><path d="M8 4.8v4"/><path d="M8 11.4h.01"/></svg>';let lr=null;function rL(){return lr!==null&&lr.isConnected||(lr=document.createElement("div"),lr.className="dsc-toasts",lr.setAttribute("role","status"),lr.setAttribute("aria-live","polite"),document.body.appendChild(lr)),lr}function M4(e){e.dataset.leaving!=="1"&&(e.dataset.leaving="1",e.style.transition="opacity var(--dsc-dur) var(--dsc-ease), transform var(--dsc-dur) var(--dsc-ease)",e.style.opacity="0",e.style.transform="translateY(4px)",window.setTimeout(()=>e.remove(),tL))}function e8(e,t,n,s){const l=rL();for(;l.children.length>=eL;){const h=l.firstElementChild;if(h===null||h.dataset.tone==="danger"&&e==="success")break;h.remove()}const o=document.createElement("div");o.className="dsc-toast",o.dataset.tone=e,o.innerHTML=`${e==="success"?iL:nL}<span class="dsc-toast__text"></span>`;const u=o.querySelector(".dsc-toast__text");if(u!==null&&(u.textContent=t),s){const h=document.createElement("button");h.className="dsc-toast__close",h.type="button",h.setAttribute("data-tip","关闭这条提示"),h.setAttribute("aria-label","关闭这条提示"),h.innerHTML='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M4.5 4.5 11.5 11.5"/><path d="M11.5 4.5 4.5 11.5"/></svg>',h.addEventListener("click",()=>M4(o)),o.appendChild(h)}l.appendChild(o),window.setTimeout(()=>M4(o),n)}function t8(e){e8("success",e,QR,!1)}function Sg(e){e8("danger",e,JR,!0)}function Hh(e){const t=e>=100?e.toFixed(0):e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function i8(e){return!Number.isFinite(e)||e<=0?"0":e<1e3?String(Math.round(e)):e<1e6?`${Hh(e/1e3)}K`:`${Hh(e/1e6)}M`}function n8(e){return!Number.isFinite(e)||e<=0?"¥0.00":e<.005?"<¥0.01":`¥${e.toFixed(2)}`}const bg={write:["content"],edit:["old","new"],str_replace_editor:["file_text","old_str","new_str"],apply_patch:["patch","content"]};function sL(e){return e.replace(/\s+/g," ").trim()}function r8(e,t){const n=bg[typeof e=="string"?e.toLowerCase():""];if(n===void 0)return{mutating:!1,fields:[],omitted:[]};let s;try{s=JSON.parse(t)}catch{return{mutating:!0,fields:[],omitted:[]}}if(s===null||typeof s!="object"||Array.isArray(s))return{mutating:!0,fields:[],omitted:[]};const l=[],o=[];for(const[u,h]of Object.entries(s)){if(n.includes(u)){o.push(u);continue}const d=typeof h=="string"?h:JSON.stringify(h)??String(h);l.push({key:u,value:sL(d)})}return{mutating:!0,fields:l,omitted:o}}const wg={bash:["command","description"],shell:["command","description"],pwsh:["command","description"],read:["file_path","path"],read_file:["file_path","path"],read_image:["file_path","path"],write:["file_path","path"],edit:["file_path","path"],glob:["pattern","path"],grep:["pattern","path"],webfetch:["url"],fetch:["url"],web_search:["query"],session_search:["query"],run_code:["code"],ask_user:["question","prompt"],ask_user_question:["question","prompt"],skill:["name"],task:["description","prompt"],subagent:["description","prompt"]},xg=["file_path","path","command","pattern","query","url","description"];function $o(e,t){const n=e.replace(/\s+/g," ").trim(),s=Array.from(n);return s.length>t?`${s.slice(0,t).join("")}…`:n}function Cg(e){try{return new URL(e).host}catch{return e}}function lL(e){for(const t of e.split(`
64
+ `)){const n=t.trim().replace(/^\/\/\s*/,"");if(n!=="")return n}return""}function s8(e,t){let n;try{n=JSON.parse(t)}catch{return $o(t,72)}if(typeof n!="object"||n===null)return"";const s=n,l=wg[e]??xg,o=[];for(const u of l){const h=s[u];if(typeof h!="string"||h==="")continue;const d=u==="url"?Cg(h):u==="code"?lL(h):h;if(d!==""&&(o.push($o(d,48)),o.length===2))break}return $o(o.join(" · "),72)}const l8={preparing:"准备中",running:"进行中",done:"完成",failed:"失败",rejected:"被拒"},Eg={bash:{verb:"运行命令",Icon:ss},shell:{verb:"运行命令",Icon:ss},run_code:{verb:"运行代码",Icon:nf},pwsh:{verb:"运行命令",Icon:ss},read_image:{verb:"读取图片",Icon:rs},web_search:{verb:"搜索网页",Icon:oa},session_search:{verb:"搜索会话",Icon:cr},todo_write:{verb:"更新计划",Icon:Ch},ask_user:{verb:"提问",Icon:wh},ask_user_question:{verb:"提问",Icon:wh},skill:{verb:"读取技能",Icon:aa},subagent:{verb:"子智能体",Icon:rf},exit_plan_mode:{verb:"提交计划",Icon:Ch},read:{verb:"读取",Icon:rs},read_file:{verb:"读取",Icon:rs},write:{verb:"写入",Icon:xh},edit:{verb:"编辑",Icon:xh},glob:{verb:"查找文件",Icon:cr},grep:{verb:"搜索文件内容",Icon:cr},webfetch:{verb:"网页获取",Icon:cr},fetch:{verb:"网页获取",Icon:cr},task:{verb:"子智能体",Icon:aa}},kg=nf,Tg="工具调用";function a8(e){const t=Eg[e];return t!==void 0?{Icon:t.Icon,known:!0,base:t.verb}:{Icon:kg,known:!1,base:Tg}}function o8(e,t){return e}function c8(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const aL=Object.freeze(Object.defineProperty({__proto__:null,CODE_FILE_ARTWORK:Tm,CODE_FILE_ICON_ID_TOKEN:km,CODE_FILE_TYPES:Mm,COMPLETION_SOUND_VARIANTS:xm,CodeFileIcon:Lm,CodeView:g6,CsvView:Kb,DEFAULT_FIELDS:xg,DOCK_DEFAULT_WIDTH:ag,DOCK_MAX_WIDTH:zh,DOCK_MIN_WIDTH:Nh,DiffRows:Em,FileIcon:cc,FileTypeIcon:Rm,IconActivity:US,IconArchive:BS,IconArchiveOff:FS,IconArrowRight:dS,IconArrowUp:fS,IconBolt:mm,IconBrain:MS,IconBranch:tf,IconCalendar:PS,IconChart:HS,IconCheck:dm,IconChevronDown:Jh,IconChevronLeft:bh,IconChevronRight:uS,IconChevronUp:hS,IconCircle:wS,IconClock:vS,IconClose:DS,IconCode:nf,IconCoins:CS,IconCopy:gS,IconCopyColor:JS,IconDatabase:VS,IconDiff:RS,IconEdit:xh,IconExpand:pS,IconFlatList:IS,IconFolder:rs,IconFolderColor:GS,IconFolderOpen:cS,IconFolderOpenColor:XS,IconGear:pm,IconGlobe:oa,IconInfo:wh,IconKey:LS,IconLayers:kS,IconMore:NS,IconNewChat:KS,IconPackage:TS,IconPhone:ES,IconPin:jS,IconPlus:fm,IconPuzzle:ef,IconQueue:Ch,IconRefresh:SS,IconRestart:bS,IconSearch:cr,IconShield:yS,IconSidebar:Ys,IconSort:zS,IconSpark:aa,IconStop:mS,IconStore:AS,IconSwap:_S,IconTarget:xS,IconTerminal:ss,IconTerminalColor:ZS,IconThumbDown:$S,IconThumbUp:qS,IconTrash:OS,IconTree:rf,IconTriangleRightFill:YS,IconVSCodeColor:QS,ImageLightbox:k6,KNOWN_TOOLS:Eg,LoadingStatus:i6,MUTATION_CONTENT_FIELDS:bg,MarkdownView:jb,NATIVE_UNAVAILABLE:rg,NO_ENTRIES:sf,NO_SESSIONS:_m,PANEL_KEYS:Lt,PdfView:Pb,REVIEW_ACTION_TEXT:Fb,REVIEW_NOTICE_BANNER:_f,ReviewFindingsCard:$b,ReviewNoticeCard:Vb,SHIKI_LANG_BY_EXT:vm,SIDEBAR_MAX:Lh,SIDEBAR_MIN:Rh,STORED_MAX:cg,SUMMARY_FIELDS:wg,Select:vg,Skeleton:gm,SkeletonText:t6,THREAD_EDGE_BUDGET:lg,THREAD_MIN:es,TOOL_STATUS_TEXT:l8,Text:p6,ThreadResizer:yg,UNKNOWN_TOOL_ICON:kg,UNKNOWN_TOOL_TITLE:Tg,XlsxView:Wb,averageTtftMs:sS,baseNameOf:zb,basename:oc,classifyCodeFileType:Om,classifyFileType:of,confirmAction:S6,createSignal:ma,displayPathOf:Jo,entryTs:Gb,errText:nS,fileExtension:Am,fileIconName:C6,findLast:_6,formatBytes:n6,formatClock:Xb,formatClockSeconds:Zb,formatCostCny:n8,formatDuration:Qb,formatTokens:i8,formatTokensPerSecond:lS,formatTraceDuration:Jb,getHighlighter:ga,getHostNative:el,highlightLines:wm,highlightToHtml:Sm,highlightToLines:bm,humanErrorLine:f6,humanErrorText:d6,humanizeError:lf,iconSizeStyle:hm,isCodeFileType:Dm,isReviewNotice:_g,joinPath:gf,langForPath:af,loadLang:ac,matchTool:a8,oneLine:$o,parseReviewFindings:qb,parseReviewNotice:Ub,parseUnifiedDiff:um,playCompletionSound:y6,prettyJson:c8,primePanelGeometry:Bh,readCompactingSince:o6,readCssColor:Eh,readCssSolidColor:w6,readCssValue:b6,readCwd:r6,readEntries:c6,readLive:u6,readRightRailPx:og,readRootPx:ca,readSessionId:h6,readSessionPath:l6,readSessions:s6,readSidebarDefaultPx:mg,readStoredFlag:dg,readStoredPx:la,readTurnState:a6,reviewLineKindOf:gg,sameGitSurface:aS,setPanelGeometrySaver:fg,setRootVar:Nn,shortUrl:Cg,splitUnifiedDiffByFile:oS,toHexColor:Cm,toastErr:Sg,toastOk:t8,tokensPerSecond:rS,toolArgFields:r8,toolSummary:s8,toolVerb:o8,trimZero:Hh,useDialogFocus:e6,useHostNative:sg,useHoverDelay:E6,useWidthDrag:ua,writeStoredFlag:pg,writeStoredPx:is},Symbol.toStringTag,{value:"Module"})),oL=["files","git"],cL=10,u8=.2,h8=.8;let A4=0;function f8(){return A4+=1,`t${Date.now().toString(36)}${A4.toString(36)}${Math.floor(Math.random()*1296).toString(36)}`}function mp(){return`p${f8()}`}function ln(e,t,n){const s=n===void 0||n===""?f8():n;return t===void 0?{id:s,kind:e}:{id:s,kind:e,path:t}}function Mg(){const e=ln("guide"),t={id:mp(),tabs:[e],activeTabId:e.id};return{panes:[t],activePaneId:t.id,fraction:.5,expanded:!1,mode:"push"}}function tl(e,t){return e.panes.find(n=>n.id===t)}function hs(e){return tl(e,e.activePaneId)??e.panes[0]}function d8(e){return!e.tabs.some(t=>t.kind==="guide")}function Ag(e,t,n){const s=tl(e,n?.paneId??e.activePaneId)??hs(e);if(oL.includes(t)){const h=e.panes.flatMap(d=>d.tabs).find(d=>d.kind===t);if(h!==void 0)return hr(e,h.id)}if(n?.replaceGuide===!0){const h=s.tabs.findIndex(_=>_.kind==="guide");if(h===-1)return e;const d=ln(t),p=s.tabs.map((_,g)=>g===h?d:_);return pi(e,s.id,{...s,tabs:p,activeTabId:d.id})}const l=s.tabs.find(h=>h.kind==="guide");if(t==="guide"&&l!==void 0)return hr(e,l.id);const o=ln(t),u=[...s.tabs,o];return pi(e,s.id,{...s,tabs:u,activeTabId:o.id})}function p8(e,t,n){const s=n===void 0?{}:{line:n},l=e.panes.flatMap(p=>p.tabs).find(p=>p.kind==="preview"&&p.path===t);if(l!==void 0){const p=hr(e,l.id);return n===void 0?p:{...p,panes:p.panes.map(_=>({..._,tabs:_.tabs.map(g=>g.id===l.id?{...g,line:n}:g)}))}}const o=hs(e);let u=[...o.tabs];const h=u.filter(p=>p.kind==="preview");if(h.length>=cL){const p=h[0];u=u.filter(_=>_.id!==p.id)}const d={...ln("preview",t),...s};return u=[...u,d],pi(e,o.id,{...o,tabs:u,activeTabId:d.id})}function m8(e,t){const n=e.panes.flatMap(o=>o.tabs).find(o=>o.kind==="patch"&&o.path===t);if(n!==void 0)return hr(e,n.id);const s=hs(e),l=ln("patch",t);return pi(e,s.id,{...s,tabs:[...s.tabs,l],activeTabId:l.id})}function g8(e,t,n){const s=e.panes.flatMap(u=>u.tabs).find(u=>u.kind==="subagent"&&u.path===t);if(s!==void 0){const u=hr(e,s.id);return n===void 0?u:{...u,panes:u.panes.map(h=>({...h,tabs:h.tabs.map(d=>d.id===s.id?{...d,label:n}:d)}))}}const l=hs(e),o={...ln("subagent",t),...n===void 0?{}:{label:n}};return pi(e,l.id,{...l,tabs:[...l.tabs,o],activeTabId:o.id})}function _8(e,t,n){const s=e.panes.flatMap(u=>u.tabs).find(u=>u.kind==="work-output"&&u.path===t);if(s!==void 0){const u=hr(e,s.id);return n===void 0?u:{...u,panes:u.panes.map(h=>({...h,tabs:h.tabs.map(d=>d.id===s.id?{...d,label:n}:d)}))}}const l=hs(e),o={...ln("work-output",t),...n===void 0?{}:{label:n}};return pi(e,l.id,{...l,tabs:[...l.tabs,o],activeTabId:o.id})}function v8(e,t,n,s){if(s!==void 0&&s!==""){const u=e.panes.flatMap(h=>h.tabs).find(h=>h.id===s);if(u!==void 0)return hr(e,u.id)}const l=hs(e),o={...ln("browser",t===void 0||t===""?void 0:t,s),...n===void 0||n===""?{}:{label:n}};return pi(e,l.id,{...l,tabs:[...l.tabs,o],activeTabId:o.id})}function y8(e,t,n){const s=e.panes.find(d=>d.tabs.some(p=>p.id===t));if(s===void 0)return e;const l=s.tabs.find(d=>d.id===t),o=n.label===void 0||n.label===""?l.label:n.label,u=n.path===void 0||n.path===""?l.path:n.path;if(o===l.label&&u===l.path)return e;const h={...l,...o===void 0?{}:{label:o},...u===void 0?{}:{path:u}};return pi(e,s.id,{...s,tabs:s.tabs.map(d=>d.id===t?h:d)})}function uL(e,t){return e.panes.find(n=>n.tabs.some(s=>s.id===t))?.id}function pi(e,t,n){return{...e,panes:e.panes.map(s=>s.id===t?n:s)}}function S8(e,t){const n=e.panes.find(d=>d.tabs.some(p=>p.id===t));if(n===void 0)return e;const s=n.tabs.findIndex(d=>d.id===t),l=n.tabs.filter(d=>d.id!==t),o=e.panes.reduce((d,p)=>d+p.tabs.length,0)===1;if(l.length===0){const d=ln("guide"),p=pi(e,n.id,{...n,tabs:[d],activeTabId:d.id});return o?Ln(p,!1):p}const u=n.activeTabId===t?(l[s]??l[l.length-1]).id:n.activeTabId,h=pi(e,n.id,{...n,tabs:l,activeTabId:u});return o?Ln(h,!1):h}function hr(e,t){const n=uL(e,t);return n===void 0?e:{...pi({...e,activePaneId:n},n,{...tl(e,n),activeTabId:t})}}function b8(e,t){return tl(e,t)===void 0?e:{...e,activePaneId:t}}function w8(e,t){if(e.panes.length>=2)return e;const n=tl(e,t??e.activePaneId)??hs(e);if(n.tabs.length<=1&&n.tabs[0]?.kind==="guide")return e;const s=n.tabs.filter(h=>h.id!==n.activeTabId),l=n.tabs.find(h=>h.id===n.activeTabId)??n.tabs[0];if(s.length===0){const h=ln("guide"),d={...n,tabs:[h],activeTabId:h.id},p={id:mp(),tabs:[l],activeTabId:l.id};return{...e,panes:[d,p],activePaneId:p.id}}const o={...n,tabs:s,activeTabId:s[s.length-1].id},u={id:mp(),tabs:[l],activeTabId:l.id};return{...e,panes:[o,u],activePaneId:u.id}}function x8(e){if(e.panes.length<2)return e;const[t,n]=e.panes,s=t.tabs.some(u=>u.kind==="guide")?n.tabs.filter(u=>u.kind!=="guide"):n.tabs,l=[...t.tabs,...s],o={id:t.id,tabs:l,activeTabId:l.some(u=>u.id===t.activeTabId)?t.activeTabId:(l.find(u=>u.id===n.activeTabId)??l[0]).id};return{...e,panes:[o],activePaneId:o.id,fraction:.5}}function C8(e,t,n,s){const l=e.panes.find(g=>g.tabs.some(S=>S.id===t)),o=tl(e,n);if(l===void 0||o===void 0)return e;const u=l.tabs.find(g=>g.id===t);if(l.id===o.id){const g=l.tabs.filter(w=>w.id!==t),S=Math.max(0,Math.min(s??g.length,g.length)),v=[...g.slice(0,S),u,...g.slice(S)];return pi(e,o.id,{...o,tabs:v,activeTabId:t})}const h=l.tabs.filter(g=>g.id!==t),d=Math.max(0,Math.min(s??o.tabs.length,o.tabs.length)),p=[...o.tabs.slice(0,d),u,...o.tabs.slice(d)];let _=pi({...e,activePaneId:o.id},o.id,{...o,tabs:p,activeTabId:t});if(h.length===0){const g=ln("guide");_=pi(_,l.id,{...l,tabs:[g],activeTabId:g.id})}else _=pi(_,l.id,{...l,tabs:h,activeTabId:l.activeTabId===t?h[Math.max(0,l.tabs.findIndex(g=>g.id===t)-1)].id:l.activeTabId});return _}function Ln(e,t){return{...e,expanded:t}}function E8(e){return{...e,mode:e.mode==="push"?"fullscreen":"push"}}function k8(e,t){return Number.isFinite(t)?{...e,fraction:Math.min(h8,Math.max(u8,t))}:e}const T8="dsc.dock.surfaces",D4=30;function hL(e){if(typeof e!="object"||e===null)return null;const t=e;if(!Array.isArray(t.panes)||t.panes.length===0||t.panes.length>2)return null;const n=[];for(const s of t.panes){const l=s;if(!Array.isArray(l.tabs)||l.tabs.length===0)return null;const o=[];for(const u of l.tabs){const h=u;if(typeof h?.id!="string"||typeof h?.kind!="string"||!["guide","terminal","browser","files","git","preview","patch","subagent","work-output"].includes(h.kind))return null;if(h.kind==="preview"){if(typeof h.path!="string"||h.path==="")return null;o.push({id:h.id,kind:"preview",path:h.path,...typeof h.line=="number"?{line:h.line}:{}})}else if(h.kind==="patch"){if(typeof h.path!="string"||h.path==="")return null;o.push({id:h.id,kind:"patch",path:h.path})}else if(h.kind==="subagent"){if(typeof h.path!="string"||h.path==="")return null;o.push({id:h.id,kind:"subagent",path:h.path,...typeof h.label=="string"&&h.label!==""?{label:h.label}:{}})}else if(h.kind==="work-output"){if(typeof h.path!="string"||h.path==="")return null;o.push({id:h.id,kind:"work-output",path:h.path,...typeof h.label=="string"&&h.label!==""?{label:h.label}:{}})}else h.kind==="browser"?o.push({id:h.id,kind:"browser",...typeof h.path=="string"&&h.path!==""?{path:h.path}:{},...typeof h.label=="string"&&h.label!==""?{label:h.label}:{}}):o.push({id:h.id,kind:h.kind})}if(typeof l.id!="string"||typeof l.activeTabId!="string"||!o.some(u=>u.id===l.activeTabId))return null;n.push({id:l.id,tabs:o,activeTabId:l.activeTabId})}return typeof t.activePaneId!="string"||!n.some(s=>s.id===t.activePaneId)?null:{panes:n,activePaneId:t.activePaneId,fraction:typeof t.fraction=="number"&&Number.isFinite(t.fraction)?Math.min(h8,Math.max(u8,t.fraction)):.5,expanded:t.expanded===!0,mode:t.mode==="fullscreen"?"fullscreen":"push"}}function M8(){try{const e=localStorage.getItem(T8);if(e===null)return{};const t=JSON.parse(e),n={};for(const[s,l]of Object.entries(t)){const o=hL(l);o!==null&&(n[s]=o)}return n}catch{return{}}}function A8(e){try{const t=Object.keys(e),n=t.length<=D4?e:Object.fromEntries(t.slice(t.length-D4).map(s=>[s,e[s]]));localStorage.setItem(T8,JSON.stringify(n))}catch{}}let Yo=M8(),gp="",ls=Yo[""]??Mg();const Xs=ma(0);function D8(e){e!==gp&&(gp=e,ls=Yo[e]??Mg(),Xs.notify())}function ti(e){const t=e(ls);t!==ls&&(ls=t,Yo={...Yo,[gp]:t},A8(Yo),Xs.notify())}function ya(e){return Xs.subscribe(e)}function Ih(){return ls}const Hn={openTab:(e,t)=>{ti(n=>Ag(n,e,t))},openPreview:(e,t)=>{ti(n=>Ln(p8(n,e,t),!0))},openBrowserTab:(e,t,n)=>{ti(s=>Ln(v8(s,e,t,n),!0))},setTabInfo:(e,t)=>{ti(n=>y8(n,e,t))},openPatch:e=>{ti(t=>Ln(m8(t,e),!0))},openSubagent:(e,t)=>{ti(n=>Ln(g8(n,e,t),!0))},openWorkOutput:(e,t)=>{ti(n=>Ln(_8(n,e,t),!0))},closeTab:e=>{ti(t=>S8(t,e))},focusTab:e=>{ti(t=>hr(t,e))},focusPane:e=>{ti(t=>b8(t,e))},splitPane:e=>{ti(t=>w8(t,e))},unsplit:()=>{ti(e=>x8(e))},placeTab:(e,t)=>{ti(n=>C8(n,e,t))},setExpanded:e=>{ti(t=>Ln(t,e))},toggleMode:()=>{ti(e=>E8(e))},setFraction:e=>{ti(t=>k8(t,e))}};function Ko(e){ti(t=>Ln(Ag(t,e,{replaceGuide:!0}),!0))}function Dg(e,t){Hn.openBrowserTab(e,void 0,t)}const Ph=new Map;let O8=[];function O4(){O8=[...Ph.values()]}function R8(e){return Ph.set(e.kind,e),O4(),Xs.notify(),()=>{Ph.delete(e.kind),O4(),Xs.notify()}}function fL(){return O8}function L8(e){return Ph.get(e)}function N8(e){if(e.patch!==void 0){z8.set(e.path,e.patch),Xs.notify(),Hn.openPatch(e.path);return}Hn.openPreview(e.path)}const z8=new Map;function B8(e){return I.useSyncExternalStore(ya,()=>z8.get(e)??null,()=>null)}function j8(e){Hn.openSubagent(e.path,e.label)}function H8(e){Hn.openWorkOutput(e.id,e.label)}let I8=null;function P8(){return I8}function Og(e){I8=e,Xs.notify()}function dc(){return I.useSyncExternalStore(ya,Ih,Ih)}function vf(){return I.useSyncExternalStore(ya,P8,()=>null)}function F8(){return I.useSyncExternalStore(ya,()=>{const e=ls.panes.find(n=>n.id===ls.activePaneId)??ls.panes[0],t=e?.tabs.find(n=>n.id===e.activeTabId);return t?.kind==="preview"&&t.path!==void 0?t.path:null},()=>null)}const R4=768,dL=480;function pL(){const e=document.querySelector(".sidebar");return e instanceof HTMLElement?e.getBoundingClientRect().width:0}function mL(){const e=window.innerWidth-pL()-dL;return Math.min(820,Math.max(300,e))}const gL={guide:{title:"开始",icon:oa},terminal:{title:"终端",icon:ss},browser:{title:"浏览器",icon:oa},files:{title:"文件",icon:rs},git:{title:"Git",icon:tf},subagent:{title:"子智能体",icon:rf,titleFromPath:!0},"work-output":{title:"输出",icon:ss},ask:{title:"旁问",icon:aa}},_L=[{kind:"files",title:"工作区文件",description:"浏览会话工作区的文件",tone:"tone-folder",shortcut:"Ctrl + P"},{kind:"terminal",title:"新建终端",description:"在会话工作区运行命令",tone:"tone-terminal",shortcut:"Ctrl + `"},{kind:"browser",title:"浏览器",description:"浏览网页",tone:"tone-browser",shortcut:"Ctrl + T"},{kind:"git",title:"Git 管理",description:"分支、暂存与提交",tone:"tone-git"},{kind:"ask",title:"旁问",description:"只读问答,不写主会话",tone:"tone-ask",shortcut:"Ctrl + Shift + K"}];function U8(e){const t=dc(),n=Hn,[s,l]=I.useState(()=>window.innerWidth<R4);I.useEffect(()=>{const S=()=>l(window.innerWidth<R4);return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const o=s||t.mode==="fullscreen",[u,h]=I.useState(null),d=I.useCallback((S,v,w)=>{h(S===null?null:{tabId:S,x:v??0,y:w??0})},[]),p=S=>{S.preventDefault();const v=S.clientX,w=e.width,x=mL(),E=P=>{e.onResize(Math.min(x,Math.max(300,w-(P.clientX-v))))},M=()=>{document.body.classList.remove("resizing"),window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",M)};document.body.classList.add("resizing"),window.addEventListener("mousemove",E),window.addEventListener("mouseup",M)},_=I.useRef(null),g=S=>{S.preventDefault();const v=_.current;if(v===null)return;const w=E=>{const M=v.getBoundingClientRect();M.width!==0&&n.setFraction((E.clientX-M.left)/M.width)},x=()=>{document.body.classList.remove("resizing"),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",x)};document.body.classList.add("resizing"),window.addEventListener("mousemove",w),window.addEventListener("mouseup",x)};return y.jsxs("aside",{className:`dock${o?" mode-fullscreen":""}${t.expanded?"":" collapsed"}`,style:o?void 0:{width:e.width,marginRight:t.expanded?void 0:-e.width},"aria-hidden":!t.expanded||void 0,children:[!o&&y.jsx("div",{className:"dock-resizer","data-tip":"拖拽调整宽度,双击复位",onMouseDown:p,onDoubleClick:()=>e.onResize(420)}),!o&&y.jsx("div",{className:"caption-bar","aria-hidden":"true"}),y.jsxs("div",{className:"dock-panes",ref:_,children:[t.panes.map((S,v)=>y.jsx(vL,{surface:t,pane:S,active:S.id===t.activePaneId,actions:n,fraction:t.fraction,first:v===0,chrome:v===t.panes.length-1,menuTab:u,setMenuTab:d},S.id)),t.panes.length===2&&y.jsx("div",{className:"dock-split","data-tip":"拖拽调整分栏,双击收回分栏",onMouseDown:g,onDoubleClick:n.unsplit})]}),u!==null&&y.jsx("div",{className:"menu-backdrop",onClick:()=>h(null)}),u!==null&&y.jsxs("div",{className:"row-menu dock-tab-menu",style:{position:"fixed",left:Math.min(u.x,window.innerWidth-140),top:Math.min(u.y,window.innerHeight-120)},onClick:S=>S.stopPropagation(),children:[y.jsx("button",{className:"menu-item",onClick:()=>{n.splitPane(u.tabId),h(null)},children:"向右分栏"}),y.jsx("button",{className:"menu-item",onClick:()=>{n.unsplit(),h(null)},children:"收回分栏"}),y.jsx("div",{className:"menu-sep"}),y.jsx("button",{className:"menu-item",onClick:()=>{n.closeTab(u.tabId),h(null)},children:"关闭页签"})]})]})}function vL(e){const{surface:t,pane:n,actions:s}=e;return y.jsxs("section",{className:"dock-pane",style:t.panes.length===2?{flex:`0 0 calc(${((e.first?e.fraction:1-e.fraction)*100).toString()}% - 4px)`}:void 0,onMouseDown:()=>{e.active||s.focusPane(n.id)},onDragOver:l=>l.preventDefault(),onDrop:l=>{const o=l.dataTransfer.getData("text/plain");o!==""&&s.placeTab(o,n.id)},children:[y.jsxs("div",{className:"dock-strip",children:[n.tabs.map(l=>y.jsx(SL,{tab:l,on:e.active&&n.activeTabId===l.id,actions:s,onMenu:e.setMenuTab,menuOpen:e.menuTab?.tabId===l.id},l.id)),d8(n)&&y.jsx("button",{className:"dock-add","data-tip":"新标签页",onClick:()=>s.openTab("guide"),children:"+"}),y.jsx("span",{className:"dock-strip-fill"}),e.chrome&&y.jsxs(y.Fragment,{children:[y.jsx("button",{className:"dock-chrome-btn","data-tip":t.mode==="fullscreen"?"退出全屏":"全屏","aria-label":t.mode==="fullscreen"?"退出全屏":"全屏",onClick:s.toggleMode,children:t.mode==="fullscreen"?y.jsx(CL,{}):y.jsx(xL,{})}),y.jsx("button",{className:"dock-chrome-btn","data-tip":"收起侧边栏","aria-label":"收起侧边栏",onClick:()=>s.setExpanded(!1),children:y.jsx(Ys,{size:15})})]})]}),y.jsx("div",{className:"dock-pane-body",children:n.tabs.map(l=>y.jsx(yL,{tab:l,active:e.active&&n.activeTabId===l.id,expanded:t.expanded,actions:s},l.id))})]})}function yL(e){const{tab:t,active:n,expanded:s}=e;if(t.kind==="guide")return n?y.jsx(bL,{actions:e.actions}):null;const l=L8(t.kind);return l===void 0?n&&s?y.jsx("div",{className:"dock-tab-body",children:y.jsxs("div",{className:"trace-empty",children:["这块面板的界面没有装上(kind:",t.kind,")。"]})}):null:l.keepMounted===!0?y.jsx("div",{className:"dock-tab-body",style:n?void 0:{display:"none"},children:y.jsx(l.component,{tab:t,active:n,expanded:s})}):n&&s?y.jsx("div",{className:"dock-tab-body",children:y.jsx(l.component,{tab:t,active:n,expanded:s})}):null}function SL(e){const t=e.tab.kind==="preview"||e.tab.kind==="patch"?void 0:gL[e.tab.kind],n=e.tab.label!==void 0&&e.tab.label!==""?e.tab.label:t===void 0||t.titleFromPath===!0?EL(e.tab.path??""):t.title;return y.jsxs("button",{className:`dock-chip${e.on?" on":""}${e.menuOpen?" menu":""}`,onClick:()=>e.actions.focusTab(e.tab.id),onAuxClick:s=>{s.button===1&&e.actions.closeTab(e.tab.id)},onContextMenu:s=>{s.preventDefault(),e.onMenu(e.menuOpen?null:e.tab.id,s.clientX,s.clientY)},draggable:!0,onDragStart:s=>s.dataTransfer.setData("text/plain",e.tab.id),title:n,children:[t!==void 0?y.jsx(t.icon,{size:13}):y.jsx(cc,{name:n,size:13,className:"dock-chip-fileicon"}),y.jsx("span",{className:"dock-chip-label",children:n}),y.jsx("span",{className:"dock-chip-close","data-tip":"关闭页签",onClick:s=>{s.stopPropagation(),e.actions.closeTab(e.tab.id)},children:"✕"})]})}function bL(e){return y.jsxs("div",{className:"dock-guide",children:[y.jsx("span",{className:"dock-guide-hero","aria-hidden":"true",children:y.jsx(wL,{})}),y.jsx("div",{className:"dock-guide-cards",children:_L.map(t=>y.jsxs("button",{className:"dock-guide-entry",onClick:()=>e.actions.openTab(t.kind,{replaceGuide:!0}),children:[y.jsxs("span",{className:`dock-guide-icon ${t.tone}`,children:[t.kind==="files"&&y.jsx(rs,{size:17}),t.kind==="terminal"&&y.jsx(ss,{size:17}),t.kind==="browser"&&y.jsx(oa,{size:17}),t.kind==="git"&&y.jsx(tf,{size:17}),t.kind==="ask"&&y.jsx(aa,{size:17})]}),y.jsxs("span",{className:"dock-guide-text",children:[y.jsx("span",{className:"dock-guide-title",children:t.title}),y.jsx("span",{className:"dock-guide-desc",children:t.description})]}),t.shortcut!==void 0&&y.jsx("kbd",{className:"dock-guide-key",children:t.shortcut})]},t.kind))})]})}function wL(){return y.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[y.jsx("circle",{cx:"12",cy:"12",r:"9.2",stroke:"currentColor",strokeWidth:"1.4",opacity:"0.45"}),y.jsx("path",{d:"M15.8 8.2 13.4 13.4 8.2 15.8 10.6 10.6Z",fill:"currentColor",opacity:"0.6"})]})}function xL(){return y.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:y.jsx("path",{d:"M2.33 10.4v2.76c0 .28.22.5.5.5h2.66v1H2.83a1.5 1.5 0 0 1-1.5-1.5V10.4h1Zm12.34 2.76a1.5 1.5 0 0 1-1.5 1.5h-2.67v-1h2.67a.5.5 0 0 0 .5-.5V10.4h1v2.76ZM13.17 1.33a1.5 1.5 0 0 1 1.5 1.5v2.57h-1V2.83a.5.5 0 0 0-.5-.5h-2.67v-1h2.67ZM5.5 2.33H2.83a.5.5 0 0 0-.5.5v2.57h-1V2.83a1.5 1.5 0 0 1 1.5-1.5H5.5v1Z",fill:"currentColor"})})}function CL(){return y.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[y.jsx("path",{d:"M9 2.5V6c0 .27.1.52.29.71.19.18.44.29.71.29h3.5",stroke:"currentColor"}),y.jsx("path",{d:"M7 13.5V10a1 1 0 0 0-1-1H2.5",stroke:"currentColor"})]})}function EL(e){const t=e.split(/[\\/]/);return t[t.length-1]??e}const kL=Object.freeze(Object.defineProperty({__proto__:null,Dock:U8,activePane:hs,canAddTab:d8,closeTab:S8,defaultSurface:Mg,dockActions:Hn,dockReview:P8,dockSurface:Ih,dockTabKinds:fL,dockTabMeta:L8,focusPane:b8,focusTab:hr,loadSurfaces:M8,makeTab:ln,openBrowserTab:v8,openDockBrowserTab:Dg,openDockTab:Ko,openPatch:m8,openPreview:p8,openSubagent:g8,openTab:Ag,openWorkOutput:_8,paneOf:tl,placeTab:C8,registerDockTab:R8,saveSurfaces:A8,setDockPreview:N8,setDockReview:Og,setDockSession:D8,setDockSubagent:j8,setDockWorkOutput:H8,setExpanded:Ln,setFraction:k8,setTabInfo:y8,splitPane:w8,subscribeDock:ya,toggleMode:E8,unsplitPane:x8,useActivePreviewPath:F8,useDockPatchSource:B8,useDockReview:vf,useDockSurface:dc},Symbol.toStringTag,{value:"Module"})),bt={header:"shell.header",headerLead:"shell.header.lead",sidebar:"shell.sidebar",page:"shell.page",main:"shell.main",thread:"shell.thread",composer:"shell.composer",statusbar:"shell.statusbar",notice:"shell.notice"},_p={[bt.header]:"list",[bt.headerLead]:"list",[bt.sidebar]:"list",[bt.page]:"list",[bt.main]:"list",[bt.thread]:"list",[bt.composer]:"list",[bt.statusbar]:"list",[bt.notice]:"single"},ha=Object.freeze({});function Fi({slots:e,slot:t,owner:n}){const s=cm(e,t);return y.jsx(y.Fragment,{children:s.map(l=>y.jsx(V8,{slots:e,entry:l,owner:n??ha},`${l.cell}|${l.id}|${String(l.priority)}|${String(l.seq)}`))})}function Rg({slots:e,slot:t,owner:n}){cm(e,t);const s=e.elect(t,n);return s===null?null:y.jsx(V8,{slots:e,entry:s.entry,owner:{...n,matched:s.matched}},`${s.entry.cell}|${s.entry.id}|${String(s.entry.priority)}|${String(s.entry.seq)}`)}function V8({slots:e,entry:t,owner:n}){const s=t.component,l=I.useCallback((d,p)=>{if(!t.children.includes(d))throw new jn(`条目 ${t.slot}/${t.id} 没有声明子槽「${d}」(声明过的:${t.children.length===0?"无":t.children.join("、")})`);return e.spec(d)==="chain"?y.jsx(Rg,{slots:e,slot:d,owner:p??ha}):y.jsx(Fi,{slots:e,slot:d,owner:p??ha})},[e,t]),o=I.useCallback((d,p,_)=>y.jsx(Lg,{slots:e,name:d,inputProps:p,selections:_?.slots,fallback:_?.fallback}),[e]),u=I.useMemo(()=>({renderSlot:l,childSlots:t.children,renderFactorySlot:o}),[l,o,t.children]),h=iS(e,t.store);return y.jsx(TL,{slot:t.slot,id:t.id,onFault:d=>{e.reportFault(t,d)},children:y.jsx("div",{className:"slot-entry","data-slot":t.slot,"data-entry":t.id,"data-cell":t.cell,children:y.jsx(s,{...n,...u,...h})})})}class TL extends I.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){if(t instanceof jn)throw t;return{error:t instanceof Error?t.message:String(t)}}componentDidCatch(t){this.props.onFault(t)}render(){return this.state.error!==null?y.jsxs("div",{className:"slot-crash","data-slot":this.props.slot,"data-entry":this.props.id,children:["界面块 ",this.props.id," 渲染失败:",this.state.error]}):this.props.children}}const ML=Object.freeze({}),L4=I.createContext(new Set);function AL(e,t){const n=I.useCallback(l=>e.subscribeFactory(t,l),[e,t]),s=I.useCallback(()=>e.factoryVersion(t),[e,t]);return I.useSyncExternalStore(n,s,s)}function Lg({slots:e,name:t,inputProps:n,selections:s,fallback:l}){const o=AL(e,t),u=e.factory(t),h=I.useContext(L4),d=I.useMemo(()=>new Set(h).add(t),[h,t]);if(u===void 0)return y.jsx(y.Fragment,{children:l??null});if(h.has(t))throw new jn(`装配错误:Factory「${t}」递归渲染(定义在自己的 occurrence 里又出现)`);for(const p of Object.keys(s??{}))if(!u.slots.includes(p))throw new jn(`装配错误:Factory「${t}」没有声明局部位置「${p}」(声明过的:${u.slots.length===0?"无":u.slots.join("、")})`);return y.jsx(q8,{name:t,id:t,onFault:p=>{e.reportFactoryFault(t,t,p)},children:y.jsx(L4.Provider,{value:d,children:y.jsx(DL,{slots:e,definition:u,inputProps:n??ha,selections:s??ML})})},`${t}:${String(o)}`)}function DL({slots:e,definition:t,inputProps:n,selections:s}){const l=I.useMemo(()=>{const d=(_,g)=>{if(!t.children.includes(_))throw new jn(`装配错误:Factory「${t.name}」没有声明子槽「${_}」(声明过的:${t.children.length===0?"无":t.children.join("、")})`);return e.spec(_)==="chain"?y.jsx(Rg,{slots:e,slot:_,owner:g??ha}):y.jsx(Fi,{slots:e,slot:_,owner:g??ha})},p=(_,g,S)=>y.jsx(Lg,{slots:e,name:_,inputProps:g,selections:S?.slots,fallback:S?.fallback});return{renderSlot:d,childSlots:t.children,renderFactorySlot:p}},[e,t]),o=iS(e,t.store),u=I.useCallback((d,p)=>{if(!t.slots.includes(d))throw new jn(`装配错误:Factory「${t.name}」没有声明局部位置「${d}」(声明过的:${t.slots.length===0?"无":t.slots.join("、")})`);const _=s[d]??p;return I.useMemo(()=>S=>y.jsx(q8,{name:t.name,id:d,onFault:v=>{e.reportFactoryFault(t.name,d,v)},children:y.jsx(_,{...l,...o,...S})}),[_,l,o,t,d,e])},[t,s,l,o,e]),h=t.component;return y.jsx(h,{...l,...o,...n,useFactorySlot:u})}class q8 extends I.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){if(t instanceof jn)throw t;return{error:t instanceof Error?t.message:String(t)}}componentDidCatch(t){this.props.onFault(t)}render(){return this.state.error!==null?y.jsxs("div",{className:"factory-crash","data-factory":this.props.name,"data-factory-slot":this.props.id,children:["Factory ",this.props.name," 的 ",this.props.id," 渲染失败:",this.state.error]}):this.props.children}}const OL=Object.freeze(Object.defineProperty({__proto__:null,ChainOutlet:Rg,FactoryOutlet:Lg,SHELL_SLOTS:_p,SLOT:bt,SlotOutlet:Fi,useSlot:cm,useSlotFaults:eS},Symbol.toStringTag,{value:"Module"})),Ng=ma(null);function $8(){return Ng.get()}function ec(e){Ng.set(e)}function Y8(e){return Ng.subscribe(e)}function zg(){return I.useSyncExternalStore(Y8,$8,()=>null)}const fr=ma({view:"chat",focusStep:null});function K8(){return fr.get().view}function dh(e){const t=fr.get();t.view!==e&&fr.set({view:e,focusStep:t.focusStep})}function RL(e){const t=fr.get(),n=e??null;t.view==="trace"&&t.focusStep===n||fr.set({view:"trace",focusStep:n})}function W8(){return fr.get().focusStep}function LL(){const e=fr.get();e.focusStep!==null&&fr.set({view:e.view,focusStep:null})}function Bg(e){return fr.subscribe(e)}function G8(){return I.useSyncExternalStore(Bg,K8,()=>"chat")}function NL(){return I.useSyncExternalStore(Bg,W8,()=>null)}function zL(e){return e===void 0||e<=0?"":e<1024*1024?`${String(Math.round(e/1024))} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function BL(){const e=sg(),[t,n]=I.useState(null),[s,l]=I.useState(null),[o,u]=I.useState(!1),[h,d]=I.useState("");if(I.useEffect(()=>{if(!e.available)return;let S=!0;e.invoke("checkUpdate").then(x=>{S&&n(x)}).catch(()=>{});const v=e.on("update-status",x=>{n(x),d("")}),w=e.on("update-progress",x=>{l(x.percent)});return()=>{S=!1,v(),w()}},[e]),!e.available||t===null||t.status!=="available")return null;const p=t.version??"",_=zL(t.size),g=h!==""?h:o?s===null?"正在下载安装包…":`正在下载安装包… ${String(s)}%`:`发现新版本${p===""?"":` ${p}`}${_===""?"":`(${_})`},点击下载并安装。`;return y.jsx("button",{type:"button",className:"update-btn","data-update-version":p,"data-tip":g,title:g,disabled:o,onClick:()=>{d(""),u(!0),e.invoke("installUpdate").then(S=>{S.ok||(d(S.error??"更新失败"),u(!1))}).catch(S=>{d(`更新失败:${S instanceof Error?S.message:String(S)}`),u(!1)})},children:o?s===null?"更新中":`${String(s)}%`:"更新"})}const X8=I.createContext(null);function jL({channel:e,children:t}){return y.jsx(X8.Provider,{value:e,children:t})}function pr(){const e=I.useContext(X8);if(e===null)throw new Error("useHostChannel 必须在 RuntimeProvider 里用");return e}function HL(){const e=pr();return I.useSyncExternalStore(t=>e.subscribe(t),()=>e.getSnapshot(),()=>e.getSnapshot())}function tc(e,t=Object.is){const n=pr(),s=I.useRef(e);s.current=e;const l=I.useRef(t);l.current=t;const[o,u]=I.useState(()=>e(n.getSnapshot())),h=I.useRef(o);return I.useEffect(()=>{const d=()=>{const p=s.current(n.getSnapshot());l.current(h.current,p)||(h.current=p,u(p))};return d(),n.subscribe(d)},[n]),o}function jg(){const e=pr();return I.useSyncExternalStore(t=>e.subscribe(t),()=>e.getStatus(),()=>e.getStatus())}function IL(){const e=pr();return I.useSyncExternalStore(t=>e.subscribe(t),()=>e.getHello(),()=>e.getHello())}function Z8(){const e=pr();return I.useSyncExternalStore(t=>e.subscribe(t),()=>e.getHostError(),()=>e.getHostError())}function PL(e){const t=pr(),n=I.useRef(e);n.current=e,I.useEffect(()=>t.onAsk(s=>{n.current(s)}),[t])}const N4="dsc.diffView",z4="dsc.diffWrap",nh="--dsc-diff-pane-w",B4=320,j4=900;function FL(){const e=vf(),[t,n]=I.useState(0),[s,l]=I.useState(()=>localStorage.getItem(N4)==="split"),[o,u]=I.useState(()=>localStorage.getItem(z4)==="wrap");I.useEffect(()=>{e!==null&&n(Math.min(e.index,Math.max(0,e.files.length-1)))},[e]),I.useLayoutEffect(()=>{const v=la(Lt.diffPaneWidth,B4,j4);v!==null&&Nn(nh,`${String(v)}px`)},[]);const h=ua({getBase:()=>ca(nh,480),sign:-1,clamp:v=>Math.min(j4,Math.max(B4,v)),onDrag:v=>Nn(nh,`${String(v)}px`),onCommit:v=>is(Lt.diffPaneWidth,v)}),d=()=>{is(Lt.diffPaneWidth,null),Nn(nh,null)},p=()=>{l(v=>{try{localStorage.setItem(N4,v?"unified":"split")}catch{}return!v})},_=()=>{u(v=>{try{localStorage.setItem(z4,v?"nowrap":"wrap")}catch{}return!v})};if(e===null)return null;const g=e.files[t]??e.files[0],S=el();return y.jsxs("aside",{className:"diff-pane","data-diff-pane":!0,children:[y.jsx("div",{className:"diff-resizer",...h,onDoubleClick:d,"data-tip":"拖拽调宽 · 双击复位","aria-label":"调整审查面板宽度"}),y.jsxs("div",{className:"diff-head",children:[e.files.length>1?y.jsx(vg,{className:"diff-file-select",ariaLabel:"选择要审查的文件",value:String(t),options:e.files.map((v,w)=>({value:String(w),label:Jo(v.path,e.cwd)})),onPick:v=>{n(Number(v))}}):g!==void 0&&y.jsx("span",{className:"diff-file-name",title:g.path,children:Jo(g.path,e.cwd)}),g!==void 0&&y.jsxs("span",{className:"changes-counts",children:[g.status==="added"&&y.jsx("span",{className:"diff-badge",children:"新增"}),y.jsx("span",{className:"changes-added",children:`+${String(g.added)}`}),y.jsx("span",{className:"changes-removed",children:`-${String(g.removed)}`})]}),y.jsxs("span",{className:"diff-tools",children:[y.jsx("button",{type:"button",className:"diff-tool","aria-pressed":s,"data-tip":"分栏 / 合并视图",onClick:p,children:s?"合并":"分栏"}),y.jsx("button",{type:"button",className:"diff-tool","aria-pressed":o,"data-tip":"长行自动换行",onClick:_,children:"换行"}),g!==void 0&&y.jsxs(y.Fragment,{children:[y.jsx(cc,{name:g.path,size:15}),S.available?y.jsx("button",{type:"button",className:"diff-tool","data-tip":"用系统默认程序打开。",onClick:()=>{S.invoke("openPath",[g.path]).catch(v=>{Sg(`系统打开失败:${v instanceof Error?v.message:String(v)}`)})},children:"系统打开"}):null,y.jsx("button",{type:"button",className:"diff-tool","data-tip":"在预览中打开当前文件(内容是修改时的快照)。",onClick:()=>{Hn.openPreview(g.path)},children:"打开"})]}),y.jsx("button",{type:"button",className:"diff-tool","data-tip":"关闭审查",onClick:()=>{Og(null)},children:"关闭"})]})]}),g===void 0?y.jsx("p",{className:"diff-note",children:"这一轮没有可审查的改动。"}):y.jsx(UL,{file:g,split:s,wrap:o})]})}function UL({file:e,split:t,wrap:n}){return y.jsxs(y.Fragment,{children:[e.truncated===!0&&y.jsx("p",{className:"diff-note",children:"改动较大,这里只显示了前一部分(完整改动以文件当前内容为准)。"}),y.jsx(Em,{hunks:e.hunks,path:e.path,split:t,wrap:n})]})}const Q8="(max-width: 860px)";function H4(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(Q8).matches}function VL(e,t){const n=I.useMemo(()=>t===null?[]:[{id:"boot",ok:!1,error:t}],[t]),[s,l]=I.useState(()=>e?.getReports()??n);return I.useEffect(()=>{if(e===null){l(n);return}return l(e.getReports()),e.subscribe(()=>{l(e.getReports())})},[e,n]),s}function qL(e){const[t,n]=I.useState(()=>e?.getState()??null);return I.useEffect(()=>{if(e===null){n(null);return}return n(e.getState()),e.subscribe(()=>{n(e.getState())})},[e]),t}function $L(e){const[t,n]=I.useState(()=>e?.getFailures()??[]);return I.useEffect(()=>{if(e===null){n([]);return}return n(e.getFailures()),e.subscribe(()=>{n(e.getFailures())})},[e]),t}function YL({slots:e,boot:t,serviceRegistry:n,session:s,hmr:l,bootError:o,allowedModules:u}){const h=VL(s,o),d=qL(s),p=$L(l),_=n.names(),g=h.filter($=>!$.ok);dc();const S=vf(),v=tc(sN),w=zg(),x=G8(),E=tc(rN);I.useEffect(()=>{D8(v??"")},[v]);const M=I.useMemo(()=>new URLSearchParams(location.search).has("dock"),[]);I.useEffect(()=>{!M||v===null||Ko("guide")},[M,v]);const[P,N]=I.useState(()=>la(Lt.sidebarWidth,Rh,Lh)),[X,Q]=I.useState(()=>H4()),[R,V]=I.useState(()=>dg(Lt.sidebarCollapsed)||H4()),[se,me]=I.useState(()=>la(Lt.threadWidth,es,cg)),[k,K]=I.useState(()=>la(Lt.dockWidth,Nh,zh)??ag);I.useEffect(()=>{Nn("--dsc-sidebar-w",P===null?null:`${String(P)}px`)},[P]),I.useEffect(()=>(se!==null&&Nn("--dsc-thread-user-max",`${String(se)}px`),()=>Nn("--dsc-thread-user-max",null)),[se]),I.useEffect(()=>{const $=window.matchMedia(Q8),oe=()=>{Q($.matches),$.matches&&V(!0)};return oe(),$.addEventListener("change",oe),()=>$.removeEventListener("change",oe)},[]),I.useEffect(()=>{X&&w!==null&&V(!0)},[X,w]),I.useEffect(()=>{const $=()=>{const oe=window.innerWidth-(P??0)-480,T=Math.min(zh,Math.max(Nh,oe));K(ze=>ze>T?T:ze)};return window.addEventListener("resize",$),$(),()=>window.removeEventListener("resize",$)},[P]);const W=$=>{N($),is(Lt.sidebarWidth,$)},q=$=>{me($),is(Lt.threadWidth,$)},Z=()=>{me(null),is(Lt.threadWidth,null)},F=$=>{K($),is(Lt.dockWidth,$)},H=()=>{V($=>(pg(Lt.sidebarCollapsed,!$),!$))};I.useEffect(()=>{const $=T=>{!(T.ctrlKey||T.metaKey)||T.altKey||T.shiftKey||(T.key==="b"||T.key==="B"?(T.preventDefault(),H()):T.key==="p"||T.key==="P"?(T.preventDefault(),Ko("files")):T.key==="`"||T.code==="Backquote"?(T.preventDefault(),Ko("terminal")):(T.key==="t"||T.key==="T")&&(T.preventDefault(),Dg()))},oe=()=>H();return window.addEventListener("keydown",$),window.addEventListener("shell.sidebar.toggle",oe),()=>{window.removeEventListener("keydown",$),window.removeEventListener("shell.sidebar.toggle",oe)}},[]);const ie=ua({sign:1,getBase:()=>P??mg(),clamp:$=>Math.min(Lh,Math.max(Rh,$)),onDrag:$=>Nn("--dsc-sidebar-w",`${String($)}px`),onCommit:$=>W($)});return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"app","data-rail":R?"1":"0",children:[y.jsxs("aside",{className:`sidebar${R?" rail":""}`,children:[y.jsxs("div",{className:"sidebar-header","data-rail-hidden":R?"1":void 0,"aria-hidden":R||void 0,children:[y.jsx("img",{src:"icon.png",alt:"Pneuma",draggable:!1}),y.jsx("span",{className:"brand",children:t.host.name}),y.jsx(BL,{}),y.jsx("button",{type:"button",className:"icon-btn rail-toggle","data-tip":"收起侧边栏,快捷键 Ctrl+B",title:"收起侧边栏(Ctrl+B)","aria-label":"收起侧边栏",onClick:H,children:y.jsx(Ys,{size:15})})]}),R&&!X?y.jsx(ZL,{onExpand:H}):null,y.jsx("div",{className:"sidebar-slot","data-rail-hidden":R?"1":void 0,children:y.jsx(Fi,{slots:e,slot:bt.sidebar})}),R?null:y.jsx("div",{className:"sidebar-resizer","data-tip":"拖拽调整侧边栏宽度,双击复位",onPointerDown:ie.onPointerDown,onPointerMove:ie.onPointerMove,onPointerUp:ie.onPointerUp,onPointerCancel:ie.onPointerCancel,onDoubleClick:()=>W(null)})]}),X&&!R?y.jsx("div",{className:"sidebar-scrim",onClick:H,"aria-hidden":"true"}):null,y.jsxs("div",{className:"main",children:[y.jsx("div",{className:"caption-bar","aria-hidden":"true"}),w===null?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"topbar",children:[y.jsxs("div",{className:"topbar-title-row",children:[X?y.jsx("button",{type:"button",className:"icon-btn topbar-nav-btn","data-tip":"会话","aria-label":"会话",onClick:H,children:y.jsx(Ys,{size:16})}):null,y.jsx("span",{className:"title",children:y.jsx(KL,{})}),y.jsx("div",{className:"topbar-cluster",children:y.jsx(Fi,{slots:e,slot:bt.headerLead})}),y.jsx("div",{className:"drag-fill"}),y.jsx("button",{type:"button",className:"icon-btn topbar-search","data-tip":"搜索动作、会话与设置(Ctrl K)","aria-label":"搜索",onClick:()=>{window.dispatchEvent(new CustomEvent("shell.palette.open"))},children:y.jsx(cr,{size:15})}),y.jsx(Fi,{slots:e,slot:bt.header}),X?y.jsx("button",{type:"button",className:`icon-btn topbar-nav-btn${w==="plugins"?" on":""}`,"data-tip":"插件","aria-label":"插件","aria-pressed":w==="plugins",onClick:()=>{ec(w==="plugins"?null:"plugins")},children:y.jsx(ef,{size:16})}):null,y.jsx(WL,{})]}),X?x==="trace"?y.jsx("nav",{className:"tabs","aria-label":"正文区视图",children:y.jsxs("button",{type:"button",onClick:()=>{dh("chat")},children:[y.jsx(bh,{size:14}),"对话"]})}):null:y.jsxs("nav",{className:"tabs",role:"tablist","aria-label":"正文区视图",children:[y.jsx("button",{type:"button",role:"tab","aria-selected":x==="chat",className:x==="chat"?"on":"",onClick:()=>{dh("chat")},children:"对话"}),y.jsx("button",{type:"button",role:"tab","aria-selected":x==="trace",className:x==="trace"?"on":"",onClick:()=>{dh("trace")},children:"轨迹"})]})]}),y.jsx(GL,{}),y.jsx(XL,{}),y.jsxs("div",{className:"thread-zone",...S!==null?{"data-review":"1"}:{},children:[y.jsxs("div",{"data-thread-area":"",className:x==="chat"&&E?"thread-main":x==="chat"?"thread-main thread-main-empty":"thread-main",children:[x==="trace"?y.jsx(Fi,{slots:e,slot:bt.thread}):y.jsx("div",{className:"chat-wrap",children:y.jsx("div",{className:"chat",children:y.jsx("div",{className:"chat-inner",children:y.jsx(Fi,{slots:e,slot:bt.main})})})}),y.jsxs("div",{className:"composer-zone",children:[y.jsx(Fi,{slots:e,slot:bt.composer}),y.jsx("div",{className:"statusbar",children:y.jsx(Fi,{slots:e,slot:bt.statusbar})})]})]}),S===null?y.jsx(yg,{width:se,onCommit:q,onReset:Z}):null,y.jsx(FL,{})]})]}):y.jsxs(y.Fragment,{children:[X?y.jsxs("div",{className:"page-strip",children:[y.jsx("button",{type:"button",className:"icon-btn topbar-nav-btn","data-tip":"返回对话","aria-label":"返回对话",onClick:()=>{ec(null)},children:y.jsx(bh,{size:16})}),y.jsx("span",{className:"title",children:w==="plugins"?"插件":"技能"}),y.jsx("div",{className:"drag-fill"}),y.jsx("button",{type:"button",className:"icon-btn topbar-nav-btn","data-tip":"会话","aria-label":"会话",onClick:H,children:y.jsx(Ys,{size:16})})]}):null,y.jsx(Fi,{slots:e,slot:bt.page})]}),w===null?null:y.jsx("div",{className:"statusbar",children:y.jsx(Fi,{slots:e,slot:bt.statusbar})})]}),v!==null?y.jsx(U8,{width:k,onResize:F}):null,y.jsx("div",{className:"dsc-toasts",children:y.jsx(Fi,{slots:e,slot:bt.notice})})]}),y.jsx(tN,{slots:e,boot:t,reports:h,services:_,failed:g.length,ledger:d,syncFailures:p,allowedModules:u,onRetrySync:l===null?null:()=>{l.retry()}})]})}function KL(){const e=tc(nN);return y.jsx(y.Fragment,{children:e})}function WL(){return dc().expanded?null:y.jsx("button",{type:"button",className:"icon-btn dock-toggle","data-tip":"工作区面板:开始、终端、浏览器、文件、Git","aria-label":"工作区面板",onClick:()=>{Hn.setExpanded(!0)},children:y.jsx(Ys,{size:15})})}function GL(){const e=pr(),t=jg(),[n,s]=I.useState(!1);if(I.useEffect(()=>{if(t==="open"){s(!1);return}const o=window.setTimeout(()=>{s(!0)},3e3);return()=>{window.clearTimeout(o)}},[t]),!n)return null;const l=t==="closed";return y.jsxs("div",{className:"conn-banner","data-conn":t,role:"status",children:[y.jsx("span",{className:"conn-dot","aria-hidden":"true"}),y.jsx("span",{className:"conn-text",children:l?"连接已断开":"连不上宿主"}),y.jsx("span",{className:"conn-hint",children:l?"这个窗口的重连已经被浏览器放弃(凭据失效或宿主换了端口)。":"宿主可能正在重启,浏览器每 3 秒重试一次。"}),y.jsx("button",{type:"button",className:"conn-retry",onClick:()=>{e.reconnect()},children:"立即重连"})]})}function XL(){const e=Z8();return e===null?null:y.jsxs("p",{className:"host-error","data-host-error":"1",children:["宿主状态异常:",e]})}function ZL({onExpand:e}){const t=zg(),n=tc(QL);return y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",className:"rail-logo","data-tip":"展开侧边栏,快捷键 Ctrl+B",title:"展开侧边栏(Ctrl+B)","aria-label":"展开侧边栏",onClick:e,children:y.jsx("img",{src:"icon.png",alt:"Pneuma",draggable:!1})}),y.jsx("button",{type:"button",className:"rail-btn","data-tip":"新会话","aria-label":"新会话",onClick:()=>{window.dispatchEvent(new CustomEvent("shell.session.new"))},children:y.jsx(fm,{size:18})}),y.jsxs("nav",{className:"rail-nav",children:[y.jsx("button",{type:"button",className:`rail-btn${t==="skills"?" on":""}`,"data-tip":"技能","aria-label":"技能","aria-pressed":t==="skills",onClick:()=>{ec(t==="skills"?null:"skills")},children:y.jsx(mm,{size:18})}),y.jsx("button",{type:"button",className:`rail-btn${t==="plugins"?" on":""}`,"data-tip":"插件","aria-label":"插件","aria-pressed":t==="plugins",onClick:()=>{ec(t==="plugins"?null:"plugins")},children:y.jsx(ef,{size:18})})]}),y.jsxs("div",{className:"rail-foot",children:[y.jsx("button",{type:"button",className:"rail-btn","data-tip":n===null?"展开侧边栏后可选择会话":`工作目录 ${n},展开侧边栏后可选择会话`,"aria-label":"展开侧边栏(查看工作目录)",onClick:e,children:y.jsx(rs,{size:18})}),y.jsx("button",{type:"button",className:"rail-btn","data-tip":"设置:外观、模型、模式、技能、插件","aria-label":"设置",onClick:()=>{window.dispatchEvent(new CustomEvent("shell.settings.open"))},children:y.jsx(pm,{size:18})})]})]})}function QL(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.cwd;return typeof n=="string"&&n!==""?n:null}const JL={0:"待装",1:"装载中",2:"已生效",3:"装载失败",4:"已卸载",5:"已卸载"};function eN(e){return e===void 0?"状态未知":JL[e]??`状态 ${String(e)}`}function tN({slots:e,boot:t,reports:n,services:s,failed:l,ledger:o,syncFailures:u,allowedModules:h,onRetrySync:d}){const p=eS(e),[_]=I.useState(()=>new URLSearchParams(location.search).has("diag")),g=el(),S=iN(),v=jg(),w=IL();if(!_&&l===0&&p.length===0&&u.length===0)return null;const x=E=>t.batches.find(M=>M.phase===E)?.rev??"";return y.jsxs("details",{className:"diagnostics",children:[y.jsxs("summary",{children:["诊断(",n.length," 个插件 / ",e.slots.length," 个槽",p.length===0?"":` / ${String(p.length)} 处故障`,")"]}),y.jsxs("ul",{className:"diag-plugins",children:[n.map(E=>y.jsxs("li",{className:E.ok?"ok":"bad","data-plugin":E.id,children:[y.jsx("code",{children:E.id})," ",E.ok?"已装上":`失败:${E.error??"未知原因"}`,E.name===void 0?"":`(${E.name})`,E.provides===void 0?"":`(提供:${E.provides.join("、")})`,E.ok&&(E.attempts??1)>1?`(重试 ${String(E.attempts)} 次才成功)`:"",y.jsxs("span",{"data-plugin-phase":o?.plugins[E.id]?.phase??"",children:[" ","· ",o?.plugins[E.id]?.phase==="early"?"首屏批":"应用批"]}),y.jsxs("span",{"data-plugin-via":o?.plugins[E.id]?.via??"","data-plugin-fiber":o?.plugins[E.id]?.fiber??"",children:[" ","· ",o?.plugins[E.id]?.via==="cordis"?`cordis(${eN(o?.plugins[E.id]?.fiber)})`:"退订账本"]})]},E.id)),n.length===0?y.jsx("li",{className:"empty",children:"启动清单里没有插件"}):null]}),o===null?null:y.jsxs("p",{className:"diag-line diag-batches",children:["批次:",o.batches.map(E=>{const M=E.entries.filter(N=>o.plugins[N]?.state==="loaded").length,P=E.doneAt??E.startedAt??E.scheduledAt;return y.jsxs("span",{"data-batch":E.phase,"data-batch-state":E.state,"data-batch-loaded":`${String(M)}/${String(E.entries.length)}`,"data-batch-rev":x(E.phase),style:{marginRight:10},children:[E.phase==="early"?"首屏":"应用"," ",M,"/",E.entries.length," ","(",E.state,P===void 0?"":` @${String(Math.round(P-o.startedAt))}ms`,x(E.phase)===""?"":`,rev ${x(E.phase)}`,")"]},E.phase)})]}),u.length===0?null:y.jsx("ul",{className:"diag-plugins",children:u.map(E=>y.jsxs("li",{className:"bad","data-sync-failure":E.id,children:[y.jsx("code",{children:E.id})," 页内同步失败:",E.message]},E.id))}),d===null?null:y.jsx("p",{className:"diag-line",children:y.jsx("button",{type:"button","data-sync-retry":"1",onClick:d,children:"重试页内同步"})}),p.length===0?null:y.jsx("ul",{className:"diag-plugins",children:p.map((E,M)=>y.jsxs("li",{className:"bad","data-fault":E.slot,children:[y.jsx("code",{children:E.slot}),E.id===""?"":` / ${E.id}`," 在",E.phase==="render"?"渲染":E.phase==="contribute"?"贡献槽位":"卸载","时出错:",E.error.message]},`${E.slot}|${E.id}|${String(M)}`))}),y.jsxs("p",{className:"diag-line",children:["清单 ",t.rev,":",t.entries.map(E=>E.id).join("、")||"空"]}),y.jsxs("p",{className:"diag-line",children:["槽:",e.slots.join("、")||"无"]}),y.jsxs("p",{className:"diag-line","data-services":s.join(","),children:["服务:",s.join("、")||"无"]}),y.jsxs("p",{className:"diag-line",children:["放行的模块:",h.join("、")]}),y.jsxs("p",{className:"diag-line diag-channel","data-channel":v,"data-protocol":w?.protocolVersion??"",children:["数据通道:",v==="open"?`已连接${w===null?"":`(协议 v${String(w.protocolVersion)},放行 ${String(w.methods.length)} 个方法)`}`:v==="connecting"?"连接中…":"已断开(请用宿主新打印的地址重开)"]}),y.jsxs("p",{className:"diag-line","data-native":g.available?"on":"off","data-native-probe":S.state,children:["原生桥:",g.available?`v${String(g.version??"?")} 已就绪(${String(K0.length)} 个操作:${K0.join("、")})`:"浏览器里没有(桌面窗口才有)",g.available&&g.version!==null&&g.version!==Y0?` ⚠ 版本对不上:这一版壳按 v${String(Y0)} 写,外壳的桥是 v${String(g.version)}(多半是壳产物没跟着外壳一起重建)`:"",S.detail===""?"":` · ${S.detail}`]})]})}function iN(){const[e,t]=I.useState({state:"pending",detail:""});return I.useEffect(()=>{const n=el();let s=!0;return n.invoke("recentCwds").then(l=>{s&&t({state:"ok",detail:`试点 recentCwds 回了 ${String(Array.isArray(l)?l.length:0)} 个最近工作区`})}).catch(l=>{if(!s)return;const o=l instanceof Error?l.message:String(l);t(n.available?{state:"error",detail:`试点未通过:${o}`}:{state:"off",detail:`降级正常:${o}`})}),()=>{s=!1}},[]),e}function nN(e){const t=e?.status,n=e?.sessions;if(typeof t!="object"||t===null||!Array.isArray(n))return"新会话";const s=t.sessionPath;if(typeof s!="string")return"新会话";for(const l of n){if(typeof l!="object"||l===null)continue;const o=l;if(o.id!==s)continue;const u=o.title;return typeof u=="string"&&u!==""?u:"新会话"}return"新会话"}function rN(e){const t=e?.entries;if(Array.isArray(t)&&t.some(s=>s.kind!=="system"))return!0;const n=e?.liveEntries;return Array.isArray(n)&&n.length>0}function sN(e){const t=e?.status;if(typeof t!="object"||t===null)return null;const n=t.sessionId;return typeof n=="string"&&n!==""?n:null}const lN=.85,aN=1.35,J8=1,oN={sm:.92,md:1,lg:1.12},Fh={themeMode:"claude",fontSize:J8,density:"standard"};function e7(e){const n=(typeof e=="string"?oN[e]:void 0)??(typeof e=="number"&&Number.isFinite(e)?e:J8);return Math.min(aN,Math.max(lN,Math.round(n*100)/100))}function cN(e){return e==="compact"||e==="roomy"?e:"standard"}const uN=["dark","light","claude","system"];function hN(e){return typeof e=="string"&&uN.includes(e)?e:"claude"}function t7(e){return{themeMode:hN(e?.themeMode),fontSize:e7(e?.fontSize),density:cN(e?.density)}}const i7="dsc.appearance",rh=typeof window>"u"?void 0:window.matchMedia?.("(prefers-color-scheme: light)");let Ql,I4=null,P4=Fh;function Uh(e){P4=e;const t=document.documentElement,n=e.themeMode,s=n==="system"?rh?.matches?"light":"dark":n;t.dataset.theme=s,t.dataset.density=e.density,t.style.setProperty("--dsc-font-scale",String(e7(e.fontSize))),fN(n),rh&&(n==="system"&&!Ql?(Ql=()=>{Uh(P4)},rh.addEventListener("change",Ql)):n!=="system"&&Ql&&(rh.removeEventListener("change",Ql),Ql=void 0))}function fN(e){const t=el();if(!t.available)return;t.invoke("setThemeSource",[e]).catch(()=>{});const n=dN();if(n===null||n===I4)return;I4=n;const[s,l]=n.split(" ");t.invoke("setWindowChrome",[s,l]).catch(()=>{})}function dN(){const e=Eh("--dsc-chrome-bar"),t=Eh("--dsc-chrome-symbol");return e===null||t===null?null:`${e} ${t}`}function pN(){const e=mN();try{const t=localStorage.getItem(i7);if(t!==null){const n=t7(JSON.parse(t));return e===null?n:{...n,themeMode:e}}}catch(t){console.warn("[ui-shell] 外观缓存读取失败,回退启动主题",t)}return e===null?Fh:{...Fh,themeMode:e}}function mN(){if(typeof window>"u")return null;const e=/[?&]theme=(dark|light|claude)/.exec(window.location.search);return e===null?null:e[1]}function n7(e){try{localStorage.setItem(i7,JSON.stringify(e))}catch(t){console.warn("[ui-shell] 外观缓存写入失败",t)}}const gN=3e4,_N=33e4;class vN extends Error{reason;constructor(t,n){super(t==="timeout"?`调用宿主方法超时(${String(n)} 毫秒)`:"调用宿主方法已被中止"),this.name="HostInvokeAbortedError",this.reason=t}}function yN(){let e=null,t=null,n=null,s="connecting",l=null,o=null,u=!1;const h=new Set,d=new Set,p=new Set,_=()=>{for(const v of[...h])try{v()}catch{}},g=v=>{s!==v&&(s=v,_())},S=()=>{if(u)return;const v=new EventSource("/api/events");o=v,v.addEventListener("hello",w=>{if(v===o)try{t=JSON.parse(w.data),s="open",_()}catch(x){console.error("[ui-shell] 握手帧认不出",x)}}),v.addEventListener("frame",w=>{if(v===o)try{const x=JSON.parse(w.data);e=mC(e,x),s="open",_()}catch(x){if(x instanceof G5){console.warn("[ui-shell] 帧号跳号,重开数据通道换一帧全量:",x.message),o=null,v.close(),g("connecting"),S();return}console.error("[ui-shell] 帧认不出",x)}}),v.addEventListener("plugins",w=>{if(v===o){try{n=JSON.parse(w.data)}catch(x){console.error("[ui-shell] 启动图热更帧认不出",x);return}_();for(const x of[...d])try{x(n)}catch{}}}),v.addEventListener("ask",w=>{if(v!==o)return;let x;try{x=JSON.parse(w.data)}catch{return}if(!(typeof x.id!="string"||typeof x.delta!="string"))for(const E of[...p])try{E(x)}catch{}}),v.onopen=()=>{v===o&&g("open")},v.onerror=w=>{if(v!==o)return;const x=w.data;if(typeof x=="string"&&x!==""){try{const E=JSON.parse(x);l=typeof E.error=="string"?E.error:x}catch{l=x}console.error("[ui-shell] 宿主报错",l),_();return}g(v.readyState===EventSource.CLOSED?"closed":"connecting")}};return S(),{getSnapshot:()=>e,reconnect(){if(u)return;const v=o;o=null,v?.close(),g("connecting"),S()},getHello:()=>t,getStatus:()=>s,getHostError:()=>l,getPluginsFrame:()=>n,onPlugins(v){return d.add(v),()=>{d.delete(v)}},onAsk(v){return p.add(v),()=>{p.delete(v)}},subscribe(v){return h.add(v),()=>{h.delete(v)}},async invoke(v,w=[],x){const E=x?.timeoutMs??gN,M=new AbortController;let P=!1;const N=setTimeout(()=>{P=!0,M.abort()},E),X=x?.signal,Q=()=>{M.abort()};X?.addEventListener("abort",Q),X?.aborted===!0&&M.abort();try{let R;try{R=await fetch("/api/invoke",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({method:v,args:w}),signal:M.signal})}catch(se){throw M.signal.aborted?new vN(P?"timeout":"aborted",E):se}const V=await R.json().catch(()=>null);if(R.status===401&&(l=V?.error??"界面凭据已失效,请用宿主新打印的地址重开",g("closed")),!R.ok)throw new Error(V?.error??`HTTP ${String(R.status)}`);if(V?.ok!==!0)throw new Error(V?.error??"调用失败");return V.value}finally{clearTimeout(N),X?.removeEventListener("abort",Q)}},close(){u=!0,s="closed",o?.close(),o=null,_()}}}const SN={tokens:0,cost:null};function bN(e=null){const t=pr(),[n,s]=I.useState(SN);return I.useEffect(()=>{let l=!0;const o=()=>{t.invoke("usageStats").then(h=>{if(!l)return;const d=h.days[h.days.length-1];s({tokens:d===void 0?0:d.inputTokens+d.outputTokens,cost:d?.costCny??null})}).catch(()=>{})};o();const u=window.setInterval(o,6e4);return()=>{l=!1,window.clearInterval(u)}},[t,e]),n}const wN={noticeExtensions:"tui.notice.extensions"};function xN(e){return e}function CN(e){if(e===null)return null;const t=e.status;if(t===null||typeof t!="object")return null;const n=t,s=n.usage;return{sessionId:typeof n.sessionId=="string"?n.sessionId:null,model:typeof n.model=="string"?n.model:"",effort:typeof n.effort=="string"?n.effort:null,turnState:typeof n.turnState=="string"?n.turnState:"unknown",usage:s!==null&&typeof s=="object"?{inputTokens:Number(s.inputTokens??0),outputTokens:Number(s.outputTokens??0)}:null,...typeof n.contextWindow=="number"?{contextWindow:n.contextWindow}:{}}}const vp=new Set;function EN(e){for(const t of vp)t(e)}function r7(e){return vp.add(e),()=>{vp.delete(e)}}const s7="actions",kN=Object.freeze([]),TN=()=>()=>{},F4=()=>kN;function MN(){const e=J5(s7);return I.useSyncExternalStore(e?.subscribe??TN,e?.list??F4,F4)}const AN=Object.freeze(Object.defineProperty({__proto__:null,ACTIONS_SERVICE:s7,CODE_FILE_ARTWORK:Tm,CODE_FILE_ICON_ID_TOKEN:km,CODE_FILE_TYPES:Mm,COMPLETION_SOUND_VARIANTS:xm,CodeFileIcon:Lm,CodeView:g6,CsvView:Kb,DEFAULT_CAPS:KC,DEFAULT_FIELDS:xg,DOCK_DEFAULT_WIDTH:ag,DOCK_MAX_WIDTH:zh,DOCK_MIN_WIDTH:Nh,DiffRows:Em,EFFORT_WIRE_HINT:qC,FileIcon:cc,FileTypeIcon:Rm,HUMAN_WAIT_TIMEOUT_MS:_N,IconActivity:US,IconArchive:BS,IconArchiveOff:FS,IconArrowRight:dS,IconArrowUp:fS,IconBolt:mm,IconBrain:MS,IconBranch:tf,IconCalendar:PS,IconChart:HS,IconCheck:dm,IconChevronDown:Jh,IconChevronLeft:bh,IconChevronRight:uS,IconChevronUp:hS,IconCircle:wS,IconClock:vS,IconClose:DS,IconCode:nf,IconCoins:CS,IconCopy:gS,IconCopyColor:JS,IconDatabase:VS,IconDiff:RS,IconEdit:xh,IconExpand:pS,IconFlatList:IS,IconFolder:rs,IconFolderColor:GS,IconFolderOpen:cS,IconFolderOpenColor:XS,IconGear:pm,IconGlobe:oa,IconInfo:wh,IconKey:LS,IconLayers:kS,IconMore:NS,IconNewChat:KS,IconPackage:TS,IconPhone:ES,IconPin:jS,IconPlus:fm,IconPuzzle:ef,IconQueue:Ch,IconRefresh:SS,IconRestart:bS,IconSearch:cr,IconShield:yS,IconSidebar:Ys,IconSort:zS,IconSpark:aa,IconStop:mS,IconStore:AS,IconSwap:_S,IconTarget:xS,IconTerminal:ss,IconTerminalColor:ZS,IconThumbDown:$S,IconThumbUp:qS,IconTrash:OS,IconTree:rf,IconTriangleRightFill:YS,IconVSCodeColor:QS,ImageLightbox:k6,KNOWN_TOOLS:Eg,LoadingStatus:i6,MODALITIES:PC,MODALITY_LABELS:$C,MUTATION_CONTENT_FIELDS:bg,MarkdownView:jb,NATIVE_UNAVAILABLE:rg,NO_ENTRIES:sf,NO_SESSIONS:_m,PANEL_KEYS:Lt,PdfView:Pb,REVIEW_ACTION_TEXT:Fb,REVIEW_NOTICE_BANNER:_f,ReviewFindingsCard:$b,ReviewNoticeCard:Vb,SHIKI_LANG_BY_EXT:vm,SIDEBAR_MAX:Lh,SIDEBAR_MIN:Rh,SLOT:bt,STORED_MAX:cg,SUMMARY_FIELDS:wg,Select:vg,Skeleton:gm,SkeletonText:t6,THINKING_LEVELS:HC,THINKING_LEVEL_LABELS:VC,THINKING_PARAMS:IC,THINKING_PARAM_LABELS:YC,THREAD_EDGE_BUDGET:lg,THREAD_MIN:es,TOOL_STATUS_TEXT:l8,TUI_SLOTS:wN,Text:p6,ThreadResizer:yg,UNKNOWN_TOOL_ICON:kg,UNKNOWN_TOOL_TITLE:Tg,XlsxView:Wb,averageTtftMs:sS,baseNameOf:zb,basename:oc,classifyCodeFileType:Om,classifyFileType:of,clearTraceFocus:LL,confirmAction:S6,createSignal:ma,defineStore:EC,defineUiPlugin:xN,diffLines:ZC,displayPathOf:Jo,dockActions:Hn,dockSurface:Ih,entryTs:Gb,errText:nS,estimateTextTokens:jC,fileExtension:Am,fileIconName:C6,findLast:_6,formatBytes:n6,formatClock:Xb,formatClockSeconds:Zb,formatCostCny:n8,formatDuration:Qb,formatTokens:i8,formatTokensPerSecond:lS,formatTraceDuration:Jb,getHighlighter:ga,getHostNative:el,highlightLines:wm,highlightToHtml:Sm,highlightToLines:bm,hostStatus:CN,humanErrorLine:f6,humanErrorText:d6,humanizeError:lf,iconSizeStyle:hm,isCodeFileType:Dm,isReviewNotice:_g,joinPath:gf,langForPath:af,loadLang:ac,matchTool:a8,onAppearanceRequest:r7,oneLine:$o,openDockBrowserTab:Dg,openDockTab:Ko,openTrace:RL,parseReviewFindings:qb,parseReviewNotice:Ub,parseUnifiedDiff:um,playCompletionSound:y6,prettyJson:c8,primePanelGeometry:Bh,readCompactingSince:o6,readCssColor:Eh,readCssSolidColor:w6,readCssValue:b6,readCwd:r6,readEntries:c6,readLive:u6,readRightRailPx:og,readRootPx:ca,readSessionId:h6,readSessionPath:l6,readSessions:s6,readSidebarDefaultPx:mg,readStoredFlag:dg,readStoredPx:la,readTurnState:a6,registerDockTab:R8,requestAppearance:EN,reviewLineKindOf:gg,sameGitSurface:aS,setDockPreview:N8,setDockReview:Og,setDockSubagent:j8,setDockWorkOutput:H8,setPanelGeometrySaver:fg,setRootVar:Nn,setShellPage:ec,setThreadView:dh,shellPage:$8,shellThreadView:K8,shortUrl:Cg,splitUnifiedDiffByFile:oS,subscribeDock:ya,subscribePage:Y8,subscribeThreadView:Bg,toHexColor:Cm,toastErr:Sg,toastOk:t8,tokensPerSecond:rS,toolArgFields:r8,toolSummary:s8,toolVerb:o8,traceFocusStep:W8,trimZero:Hh,useActions:MN,useActivePreviewPath:F8,useAskStream:PL,useChannelStatus:jg,useDialogFocus:e6,useDockPatchSource:B8,useDockReview:vf,useDockSurface:dc,useHostChannel:pr,useHostError:Z8,useHostNative:sg,useHostSelector:tc,useHostSnapshot:HL,useHoverDelay:E6,useSeat:tS,useService:J5,useShellPage:zg,useThreadView:G8,useTodayUsage:bN,useTraceFocus:NL,useWidthDrag:ua,writeStoredFlag:pg,writeStoredPx:is},Symbol.toStringTag,{value:"Module"}));var l7=Object.defineProperty,DN=Object.getOwnPropertyDescriptor,ON=(e,t)=>{for(var n in t)l7(e,n,{get:t[n],enumerable:!0})},vt=(e,t,n,s)=>{for(var l=s>1?void 0:s?DN(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(l=(s?u(t,n,l):u(l))||l);return s&&l&&l7(t,n,l),l},pe=(e,t)=>(n,s)=>t(n,s,e),U4="Terminal input",yp={get:()=>U4,set:e=>U4=e},V4="Too much output to announce, navigate to rows manually to read",Sp={get:()=>V4,set:e=>V4=e};function RN(e){return e.replace(/\r?\n/g,"\r")}function LN(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function NN(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function zN(e,t,n,s){if(e.stopPropagation(),e.clipboardData){let l=e.clipboardData.getData("text/plain");a7(l,t,n,s)}}function a7(e,t,n,s){e=RN(e),e=LN(e,n.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function o7(e,t,n){let s=n.getBoundingClientRect(),l=e.clientX-s.left-10,o=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${l}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function q4(e,t,n,s,l){o7(e,t,n),l&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Jr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function yf(e,t=0,n=e.length){let s="";for(let l=t;l<n;++l){let o=e[l];o>65535?(o-=65536,s+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):s+=String.fromCharCode(o)}return s}var BN=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let s=0,l=0;if(this._interim){let o=e.charCodeAt(l++);56320<=o&&o<=57343?t[s++]=(this._interim-55296)*1024+o-56320+65536:(t[s++]=this._interim,t[s++]=o),this._interim=0}for(let o=l;o<n;++o){let u=e.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=n)return this._interim=u,s;let h=e.charCodeAt(o);56320<=h&&h<=57343?t[s++]=(u-55296)*1024+h-56320+65536:(t[s++]=u,t[s++]=h);continue}u!==65279&&(t[s++]=u)}return s}},jN=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let s=0,l,o,u,h,d=0,p=0;if(this.interim[0]){let S=!1,v=this.interim[0];v&=(v&224)===192?31:(v&240)===224?15:7;let w=0,x;for(;(x=this.interim[++w]&63)&&w<4;)v<<=6,v|=x;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=E-w;for(;p<M;){if(p>=n)return 0;if(x=e[p++],(x&192)!==128){p--,S=!0;break}else this.interim[w++]=x,v<<=6,v|=x&63}S||(E===2?v<128?p--:t[s++]=v:E===3?v<2048||v>=55296&&v<=57343||v===65279||(t[s++]=v):v<65536||v>1114111||(t[s++]=v)),this.interim.fill(0)}let _=n-4,g=p;for(;g<n;){for(;g<_&&!((l=e[g])&128)&&!((o=e[g+1])&128)&&!((u=e[g+2])&128)&&!((h=e[g+3])&128);)t[s++]=l,t[s++]=o,t[s++]=u,t[s++]=h,g+=4;if(l=e[g++],l<128)t[s++]=l;else if((l&224)===192){if(g>=n)return this.interim[0]=l,s;if(o=e[g++],(o&192)!==128){g--;continue}if(d=(l&31)<<6|o&63,d<128){g--;continue}t[s++]=d}else if((l&240)===224){if(g>=n)return this.interim[0]=l,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=o,s;if(u=e[g++],(u&192)!==128){g--;continue}if(d=(l&15)<<12|(o&63)<<6|u&63,d<2048||d>=55296&&d<=57343||d===65279)continue;t[s++]=d}else if((l&248)===240){if(g>=n)return this.interim[0]=l,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=o,s;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=o,this.interim[2]=u,s;if(h=e[g++],(h&192)!==128){g--;continue}if(d=(l&7)<<18|(o&63)<<12|(u&63)<<6|h&63,d<65536||d>1114111)continue;t[s++]=d}}return s}},c7="",ns=" ",pc=class u7{constructor(){this.fg=0,this.bg=0,this.extended=new Vh}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new u7;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Vh=class h7{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new h7(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},sn=class f7 extends pc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Vh,this.combinedData=""}static fromCharData(t){let n=new f7;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Jr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let l=t[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(s-55296)*1024+l-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$4="di$target",bp="di$dependencies",A0=new Map;function HN(e){return e[bp]||[]}function $t(e){if(A0.has(e))return A0.get(e);let t=function(n,s,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");IN(t,n,l)};return t._id=e,A0.set(e,t),t}function IN(e,t,n){t[$4]===t?t[bp].push({id:e,index:n}):(t[bp]=[{id:e,index:n}],t[$4]=t)}var mi=$t("BufferService"),d7=$t("CoreMouseService"),il=$t("CoreService"),PN=$t("CharsetService"),Hg=$t("InstantiationService"),p7=$t("LogService"),gi=$t("OptionsService"),m7=$t("OscLinkService"),FN=$t("UnicodeService"),mc=$t("DecorationService"),wp=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let s=[],l=this._optionsService.rawOptions.linkHandler,o=new sn,u=n.getTrimmedLength(),h=-1,d=-1,p=!1;for(let _=0;_<u;_++)if(!(d===-1&&!n.hasContent(_))){if(n.loadCell(_,o),o.hasExtendedAttrs()&&o.extended.urlId)if(d===-1){d=_,h=o.extended.urlId;continue}else p=o.extended.urlId!==h;else d!==-1&&(p=!0);if(p||d!==-1&&_===u-1){let g=this._oscLinkService.getLinkData(h)?.uri;if(g){let S={start:{x:d+1,y:e},end:{x:_+(!p&&_===u-1?1:0),y:e}},v=!1;if(!l?.allowNonHttpProtocols)try{let w=new URL(g);["http:","https:"].includes(w.protocol)||(v=!0)}catch{v=!0}v||s.push({text:g,range:S,activate:(w,x)=>l?l.activate(w,x,S):UN(w,x),hover:(w,x)=>l?.hover?.(w,x,S),leave:(w,x)=>l?.leave?.(w,x,S)})}p=!1,o.hasExtendedAttrs()&&o.extended.urlId?(d=_,h=o.extended.urlId):(d=-1,h=-1)}}t(s)}};wp=vt([pe(0,mi),pe(1,gi),pe(2,m7)],wp);function UN(e,t){if(confirm(`Do you want to navigate to ${t}?
65
+
66
+ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Sf=$t("CharSizeService"),mr=$t("CoreBrowserService"),Ig=$t("MouseService"),gr=$t("RenderService"),VN=$t("SelectionService"),g7=$t("CharacterJoinerService"),Sa=$t("ThemeService"),_7=$t("LinkProviderService"),qN=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Y4.isErrorNoTelemetry(e)?new Y4(e.message+`
67
+
68
+ `+e.stack):new Error(e.message+`
69
+
70
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},$N=new qN;function ph(e){YN(e)||$N.onUnexpectedError(e)}var xp="Canceled";function YN(e){return e instanceof KN?!0:e instanceof Error&&e.name===xp&&e.message===xp}var KN=class extends Error{constructor(){super(xp),this.name=this.message}};function WN(e){return new Error(`Illegal argument: ${e}`)}var Y4=class Cp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Cp)return t;let n=new Cp;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Ep=class v7 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,v7.prototype)}};function Hi(e,t=0){return e[e.length-(1+t)]}var GN;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function s(o){return o>0}e.isGreaterThan=s;function l(o){return o===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(GN||={});function XN(e,t){let n=this,s=!1,l;return function(){return s||(s=!0,t||(l=e.apply(n,arguments))),l}}var y7;(e=>{function t(X){return X&&typeof X=="object"&&typeof X[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function s(){return n}e.empty=s;function*l(X){yield X}e.single=l;function o(X){return t(X)?X:l(X)}e.wrap=o;function u(X){return X||n}e.from=u;function*h(X){for(let Q=X.length-1;Q>=0;Q--)yield X[Q]}e.reverse=h;function d(X){return!X||X[Symbol.iterator]().next().done===!0}e.isEmpty=d;function p(X){return X[Symbol.iterator]().next().value}e.first=p;function _(X,Q){let R=0;for(let V of X)if(Q(V,R++))return!0;return!1}e.some=_;function g(X,Q){for(let R of X)if(Q(R))return R}e.find=g;function*S(X,Q){for(let R of X)Q(R)&&(yield R)}e.filter=S;function*v(X,Q){let R=0;for(let V of X)yield Q(V,R++)}e.map=v;function*w(X,Q){let R=0;for(let V of X)yield*Q(V,R++)}e.flatMap=w;function*x(...X){for(let Q of X)yield*Q}e.concat=x;function E(X,Q,R){let V=R;for(let se of X)V=Q(V,se);return V}e.reduce=E;function*M(X,Q,R=X.length){for(Q<0&&(Q+=X.length),R<0?R+=X.length:R>X.length&&(R=X.length);Q<R;Q++)yield X[Q]}e.slice=M;function P(X,Q=Number.POSITIVE_INFINITY){let R=[];if(Q===0)return[R,X];let V=X[Symbol.iterator]();for(let se=0;se<Q;se++){let me=V.next();if(me.done)return[R,e.empty()];R.push(me.value)}return[R,{[Symbol.iterator](){return V}}]}e.consume=P;async function N(X){let Q=[];for await(let R of X)Q.push(R);return Promise.resolve(Q)}e.asyncToArray=N})(y7||={});function Zs(e){if(y7.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function ZN(...e){return ht(()=>Zs(e))}function ht(e){return{dispose:XN(()=>{e()})}}var S7=class b7{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Zs(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?b7.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};S7.DISABLE_DISPOSED_WARNING=!1;var as=S7,Pe=class{constructor(){this._store=new as,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Pe.None=Object.freeze({dispose(){}});var fa=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},ur=typeof window=="object"?window:globalThis,kp=class Tp{constructor(t){this.element=t,this.next=Tp.Undefined,this.prev=Tp.Undefined}};kp.Undefined=new kp(void 0);var dt=kp,K4=class{constructor(){this._first=dt.Undefined,this._last=dt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===dt.Undefined}clear(){let e=this._first;for(;e!==dt.Undefined;){let t=e.next;e.prev=dt.Undefined,e.next=dt.Undefined,e=t}this._first=dt.Undefined,this._last=dt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new dt(e);if(this._first===dt.Undefined)this._first=n,this._last=n;else if(t){let l=this._last;this._last=n,n.prev=l,l.next=n}else{let l=this._first;this._first=n,n.next=l,l.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==dt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==dt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==dt.Undefined&&e.next!==dt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===dt.Undefined&&e.next===dt.Undefined?(this._first=dt.Undefined,this._last=dt.Undefined):e.next===dt.Undefined?(this._last=this._last.prev,this._last.next=dt.Undefined):e.prev===dt.Undefined&&(this._first=this._first.next,this._first.prev=dt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==dt.Undefined;)yield e.element,e=e.next}},QN=globalThis.performance&&typeof globalThis.performance.now=="function",JN=class w7{static create(t){return new w7(t)}constructor(t){this._now=QN&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ni;(e=>{e.None=()=>Pe.None;function t(W,q){return g(W,()=>{},0,void 0,!0,void 0,q)}e.defer=t;function n(W){return(q,Z=null,F)=>{let H=!1,ie;return ie=W($=>{if(!H)return ie?ie.dispose():H=!0,q.call(Z,$)},null,F),H&&ie.dispose(),ie}}e.once=n;function s(W,q,Z){return p((F,H=null,ie)=>W($=>F.call(H,q($)),null,ie),Z)}e.map=s;function l(W,q,Z){return p((F,H=null,ie)=>W($=>{q($),F.call(H,$)},null,ie),Z)}e.forEach=l;function o(W,q,Z){return p((F,H=null,ie)=>W($=>q($)&&F.call(H,$),null,ie),Z)}e.filter=o;function u(W){return W}e.signal=u;function h(...W){return(q,Z=null,F)=>{let H=ZN(...W.map(ie=>ie($=>q.call(Z,$))));return _(H,F)}}e.any=h;function d(W,q,Z,F){let H=Z;return s(W,ie=>(H=q(H,ie),H),F)}e.reduce=d;function p(W,q){let Z,F={onWillAddFirstListener(){Z=W(H.fire,H)},onDidRemoveLastListener(){Z?.dispose()}},H=new ue(F);return q?.add(H),H.event}function _(W,q){return q instanceof Array?q.push(W):q&&q.add(W),W}function g(W,q,Z=100,F=!1,H=!1,ie,$){let oe,T,ze,We=0,O,D={leakWarningThreshold:ie,onWillAddFirstListener(){oe=W(ae=>{We++,T=q(T,ae),F&&!ze&&(ne.fire(T),T=void 0),O=()=>{let de=T;T=void 0,ze=void 0,(!F||We>1)&&ne.fire(de),We=0},typeof Z=="number"?(clearTimeout(ze),ze=setTimeout(O,Z)):ze===void 0&&(ze=0,queueMicrotask(O))})},onWillRemoveListener(){H&&We>0&&O?.()},onDidRemoveLastListener(){O=void 0,oe.dispose()}},ne=new ue(D);return $?.add(ne),ne.event}e.debounce=g;function S(W,q=0,Z){return e.debounce(W,(F,H)=>F?(F.push(H),F):[H],q,void 0,!0,void 0,Z)}e.accumulate=S;function v(W,q=(F,H)=>F===H,Z){let F=!0,H;return o(W,ie=>{let $=F||!q(ie,H);return F=!1,H=ie,$},Z)}e.latch=v;function w(W,q,Z){return[e.filter(W,q,Z),e.filter(W,F=>!q(F),Z)]}e.split=w;function x(W,q=!1,Z=[],F){let H=Z.slice(),ie=W(T=>{H?H.push(T):oe.fire(T)});F&&F.add(ie);let $=()=>{H?.forEach(T=>oe.fire(T)),H=null},oe=new ue({onWillAddFirstListener(){ie||(ie=W(T=>oe.fire(T)),F&&F.add(ie))},onDidAddFirstListener(){H&&(q?setTimeout($):$())},onDidRemoveLastListener(){ie&&ie.dispose(),ie=null}});return F&&F.add(oe),oe.event}e.buffer=x;function E(W,q){return(Z,F,H)=>{let ie=q(new P);return W(function($){let oe=ie.evaluate($);oe!==M&&Z.call(F,oe)},void 0,H)}}e.chain=E;let M=Symbol("HaltChainable");class P{constructor(){this.steps=[]}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(Z=>(q(Z),Z)),this}filter(q){return this.steps.push(Z=>q(Z)?Z:M),this}reduce(q,Z){let F=Z;return this.steps.push(H=>(F=q(F,H),F)),this}latch(q=(Z,F)=>Z===F){let Z=!0,F;return this.steps.push(H=>{let ie=Z||!q(H,F);return Z=!1,F=H,ie?H:M}),this}evaluate(q){for(let Z of this.steps)if(q=Z(q),q===M)break;return q}}function N(W,q,Z=F=>F){let F=(...oe)=>$.fire(Z(...oe)),H=()=>W.on(q,F),ie=()=>W.removeListener(q,F),$=new ue({onWillAddFirstListener:H,onDidRemoveLastListener:ie});return $.event}e.fromNodeEventEmitter=N;function X(W,q,Z=F=>F){let F=(...oe)=>$.fire(Z(...oe)),H=()=>W.addEventListener(q,F),ie=()=>W.removeEventListener(q,F),$=new ue({onWillAddFirstListener:H,onDidRemoveLastListener:ie});return $.event}e.fromDOMEventEmitter=X;function Q(W){return new Promise(q=>n(W)(q))}e.toPromise=Q;function R(W){let q=new ue;return W.then(Z=>{q.fire(Z)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}e.fromPromise=R;function V(W,q){return W(Z=>q.fire(Z))}e.forward=V;function se(W,q,Z){return q(Z),W(F=>q(F))}e.runAndSubscribe=se;class me{constructor(q,Z){this._observable=q,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{q.addObserver(this)},onDidRemoveLastListener:()=>{q.removeObserver(this)}};this.emitter=new ue(F),Z&&Z.add(this.emitter)}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,Z){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function k(W,q){return new me(W,q).emitter.event}e.fromObservable=k;function K(W){return(q,Z,F)=>{let H=0,ie=!1,$={beginUpdate(){H++},endUpdate(){H--,H===0&&(W.reportChanges(),ie&&(ie=!1,q.call(Z)))},handlePossibleChange(){},handleChange(){ie=!0}};W.addObserver($),W.reportChanges();let oe={dispose(){W.removeObserver($)}};return F instanceof as?F.add(oe):Array.isArray(F)&&F.push(oe),oe}}e.fromObservableLight=K})(ni||={});var Mp=class Ap{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Ap._idPool++}`,Ap.all.add(this)}start(t){this._stopWatch=new JN,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Mp.all=new Set,Mp._idPool=0;var ez=Mp,tz=-1,x7=class C7{constructor(t,n,s=(C7._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,n){let s=this.threshold;if(s<=0||n<s)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[o,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(o);let d=new rz(h,o);this._errorHandler(d)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[s,l]of this._stacks)(!t||n<l)&&(t=[s,l],n=l);return t}};x7._idPool=1;var iz=x7,nz=class E7{constructor(t){this.value=t}static create(){let t=new Error;return new E7(t.stack??"")}print(){console.warn(this.value.split(`
71
+ `).slice(2).join(`
72
+ `))}},rz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},sz=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},lz=0,D0=class{constructor(e){this.value=e,this.id=lz++}},az=2,oz,ue=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new iz(e?.onListenerError??ph,this._options?.leakWarningThreshold??tz):void 0,this._perfMon=this._options?._profName?new ez(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new sz(`${u}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||ph)(d),Pe.None}if(this._disposed)return Pe.None;t&&(e=e.bind(t));let s=new D0(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=nz.create(),l=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof D0?(this._deliveryQueue??=new cz,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=ht(()=>{l?.(),this._removeListener(s)});return n instanceof as?n.add(o):Array.isArray(n)&&n.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*az<=t.length){let l=0;for(let o=0;o<t.length;o++)t[o]?t[l++]=t[o]:s&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=l}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||ph;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof D0)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},cz=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Dp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ue,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ue,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let s=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let s=this.getWindowId(n);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Dp.INSTANCE=new Dp;var Pg=Dp;function uz(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Pg.INSTANCE.onDidChangeZoomLevel;function hz(e){return Pg.INSTANCE.getZoomFactor(e)}Pg.INSTANCE.onDidChangeFullscreen;var ba=typeof navigator=="object"?navigator.userAgent:"",Op=ba.indexOf("Firefox")>=0,fz=ba.indexOf("AppleWebKit")>=0,Fg=ba.indexOf("Chrome")>=0,dz=!Fg&&ba.indexOf("Safari")>=0;ba.indexOf("Electron/")>=0;ba.indexOf("Android")>=0;var O0=!1;if(typeof ur.matchMedia=="function"){let e=ur.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ur.matchMedia("(display-mode: fullscreen)");O0=e.matches,uz(ur,e,({matches:n})=>{O0&&t.matches||(O0=n)})}var ia="en",Rp=!1,Lp=!1,mh=!1,k7=!1,sh,gh=ia,W4=ia,pz,or,Ws=globalThis,Ui;typeof Ws.vscode<"u"&&typeof Ws.vscode.process<"u"?Ui=Ws.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ui=process);var mz=typeof Ui?.versions?.electron=="string",gz=mz&&Ui?.type==="renderer";if(typeof Ui=="object"){Rp=Ui.platform==="win32",Lp=Ui.platform==="darwin",mh=Ui.platform==="linux",mh&&Ui.env.SNAP&&Ui.env.SNAP_REVISION,Ui.env.CI||Ui.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sh=ia,gh=ia;let e=Ui.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);sh=t.userLocale,W4=t.osLocale,gh=t.resolvedLanguage||ia,pz=t.languagePack?.translationsConfigFile}catch{}k7=!0}else typeof navigator=="object"&&!gz?(or=navigator.userAgent,Rp=or.indexOf("Windows")>=0,Lp=or.indexOf("Macintosh")>=0,(or.indexOf("Macintosh")>=0||or.indexOf("iPad")>=0||or.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mh=or.indexOf("Linux")>=0,or?.indexOf("Mobi")>=0,gh=globalThis._VSCODE_NLS_LANGUAGE||ia,sh=navigator.language.toLowerCase(),W4=sh):console.error("Unable to resolve platform.");var T7=Rp,Bn=Lp,_z=mh,G4=k7,In=or,Gr=gh,vz;(e=>{function t(){return Gr}e.value=t;function n(){return Gr.length===2?Gr==="en":Gr.length>=3?Gr[0]==="e"&&Gr[1]==="n"&&Gr[2]==="-":!1}e.isDefaultVariant=n;function s(){return Gr==="en"}e.isDefault=s})(vz||={});var yz=typeof Ws.postMessage=="function"&&!Ws.importScripts;(()=>{if(yz){let e=[];Ws.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let s=0,l=e.length;s<l;s++){let o=e[s];if(o.id===n.data.vscodeScheduleAsyncWork){e.splice(s,1),o.callback();return}}});let t=0;return n=>{let s=++t;e.push({id:s,callback:n}),Ws.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var Sz=!!(In&&In.indexOf("Chrome")>=0);In&&In.indexOf("Firefox")>=0;!Sz&&In&&In.indexOf("Safari")>=0;In&&In.indexOf("Edg/")>=0;In&&In.indexOf("Android")>=0;var Jl=typeof navigator=="object"?navigator:{};G4||document.queryCommandSupported&&document.queryCommandSupported("copy")||Jl&&Jl.clipboard&&Jl.clipboard.writeText,G4||Jl&&Jl.clipboard&&Jl.clipboard.readText;var Ug=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},R0=new Ug,X4=new Ug,Z4=new Ug,bz=new Array(230),M7;(e=>{function t(h){return R0.keyCodeToStr(h)}e.toString=t;function n(h){return R0.strToKeyCode(h)}e.fromString=n;function s(h){return X4.keyCodeToStr(h)}e.toUserSettingsUS=s;function l(h){return Z4.keyCodeToStr(h)}e.toUserSettingsGeneral=l;function o(h){return X4.strToKeyCode(h)||Z4.strToKeyCode(h)}e.fromUserSettings=o;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return R0.keyCodeToStr(h)}e.toElectronAccelerator=u})(M7||={});var wz=class A7{constructor(t,n,s,l,o){this.ctrlKey=t,this.shiftKey=n,this.altKey=s,this.metaKey=l,this.keyCode=o}equals(t){return t instanceof A7&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",s=this.altKey?"1":"0",l=this.metaKey?"1":"0";return`K${t}${n}${s}${l}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new xz([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},xz=class{constructor(e){if(e.length===0)throw WN("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function Cz(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return M7.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Op)switch(t){case 59:return 85;case 60:if(_z)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Bn)return 57;break}else if(fz&&(Bn&&t===93||!Bn&&t===92))return 57;return bz[t]||0}var Ez=Bn?256:2048,kz=512,Tz=1024,Mz=Bn?2048:256,Q4=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=Cz(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Ez),this.altKey&&(t|=kz),this.shiftKey&&(t|=Tz),this.metaKey&&(t|=Mz),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new wz(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},J4=new WeakMap;function Az(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var Dz=class{static getSameOriginWindowChain(e){let t=J4.get(e);if(!t){t=[],J4.set(e,t);let n=e,s;do s=Az(n),s?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=s;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,s=0,l=this.getSameOriginWindowChain(e);for(let o of l){let u=o.window.deref();if(n+=u?.scrollY??0,s+=u?.scrollX??0,u===t||!o.iframeElement)break;let h=o.iframeElement.getBoundingClientRect();n+=h.top,s+=h.left}return{top:n,left:s}}},lh=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Dz.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},e5=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let s=!1;if(Fg){let l=navigator.userAgent.match(/Chrome\/(\d+)/);s=(l?parseInt(l[1]):123)<=122}if(e){let l=e,o=e,u=e.view?.devicePixelRatio||1;if(typeof l.wheelDeltaY<"u")s?this.deltaY=l.wheelDeltaY/(120*u):this.deltaY=l.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Op&&!Bn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")dz&&T7?this.deltaX=-(l.wheelDeltaX/120):s?this.deltaX=l.wheelDeltaX/(120*u):this.deltaX=l.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Op&&!Bn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},D7=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Oz;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof Rz?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ni.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D7})})(Oz||={});var Rz=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?D7:(this._emitter||(this._emitter=new ue),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Vg=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ep("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ep("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Lz=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Ep("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=n.setInterval(()=>{e()},t);this.disposable=ht(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Nz;(e=>{async function t(s){let l,o=await Promise.all(s.map(u=>u.then(h=>h,h=>{l||(l=h)})));if(typeof l<"u")throw l;return o}e.settled=t;function n(s){return new Promise(async(l,o)=>{try{await s(l,o)}catch(u){o(u)}})}e.withAsyncBody=n})(Nz||={});var t5=class tn{static fromArray(t){return new tn(n=>{n.emitMany(t)})}static fromPromise(t){return new tn(async n=>{n.emitMany(await t)})}static fromPromises(t){return new tn(async n=>{await Promise.all(t.map(async s=>n.emitOne(await s)))})}static merge(t){return new tn(async n=>{await Promise.all(t.map(async s=>{for await(let l of s)n.emitOne(l)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ue,queueMicrotask(async()=>{let s={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(t(s)),this.resolve()}catch(l){this.reject(l)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ni.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new tn(async s=>{for await(let l of t)s.emitOne(n(l))})}map(t){return tn.map(this,t)}static filter(t,n){return new tn(async s=>{for await(let l of t)n(l)&&s.emitOne(l)})}filter(t){return tn.filter(this,t)}static coalesce(t){return tn.filter(t,n=>!!n)}coalesce(){return tn.coalesce(this)}static async toPromise(t){let n=[];for await(let s of t)n.push(s);return n}toPromise(){return tn.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};t5.EMPTY=t5.fromArray([]);var{getWindow:zn,getWindowId:zz,onDidRegisterWindow:Bz}=(function(){let e=new Map,t={window:ur,disposables:new as};e.set(ur.vscodeWindowId,t);let n=new ue,s=new ue,l=new ue;function o(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:s.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Pe.None;let h=new as,d={window:u,disposables:h.add(new as)};return e.set(u.vscodeWindowId,d),h.add(ht(()=>{e.delete(u.vscodeWindowId),s.fire(u)})),h.add(Ae(u,Ft.BEFORE_UNLOAD,()=>{l.fire(u)})),n.fire(d),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:o,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let d=u;return d?.view?d.view.window:ur},getDocument(u){return zn(u).document}}})(),jz=class{constructor(e,t,n,s){this._node=e,this._type=t,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ae(e,t,n,s){return new jz(e,t,n,s)}var i5=function(e,t,n,s){return Ae(e,t,n,s)},qg,Hz=class extends Lz{constructor(e){super(),this.defaultTarget=e&&zn(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},n5=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ph(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,s=new Map,l=o=>{n.set(o,!1);let u=e.get(o)??[];for(t.set(o,u),e.set(o,[]),s.set(o,!0);u.length>0;)u.sort(n5.sort),u.shift().execute();s.set(o,!1)};qg=(o,u,h=0)=>{let d=zz(o),p=new n5(u,h),_=e.get(d);return _||(_=[],e.set(d,_)),_.push(p),n.get(d)||(n.set(d,!0),o.requestAnimationFrame(()=>l(d))),p}})();function Iz(e){let t=e.getBoundingClientRect(),n=zn(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Ft={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Pz=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ci(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ci(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ci(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ci(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ci(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ci(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ci(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ci(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ci(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ci(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ci(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ci(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ci(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ci(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ci(e){return typeof e=="number"?`${e}px`:e}function Wo(e){return new Pz(e)}var O7=class{constructor(){this._hooks=new as,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,s,l){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=l;let o=e;try{e.setPointerCapture(t),this._hooks.add(ht(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=zn(e)}this._hooks.add(Ae(o,Ft.POINTER_MOVE,u=>{if(u.buttons!==n){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ae(o,Ft.POINTER_UP,u=>this.stopMonitoring(!0)))}};function Fz(e,t,n){let s=null,l=null;if(typeof n.value=="function"?(s="value",l=n.value,l.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(s="get",l=n.get),!l)throw new Error("not supported");let o=`$memoize$${t}`;n[s]=function(...u){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:l.apply(this,u)}),this[o]}}var On;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(On||={});var Bo=class li extends Pe{constructor(){super(),this.dispatched=!1,this.targets=new K4,this.ignoreTargets=new K4,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ni.runAndSubscribe(Bz,({window:t,disposables:n})=>{n.add(Ae(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),n.add(Ae(t.document,"touchend",s=>this.onTouchEnd(t,s))),n.add(Ae(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:ur,disposables:this._store}))}static addTarget(t){if(!li.isTouchDevice())return Pe.None;li.INSTANCE||(li.INSTANCE=new li);let n=li.INSTANCE.targets.push(t);return ht(n)}static ignoreTarget(t){if(!li.isTouchDevice())return Pe.None;li.INSTANCE||(li.INSTANCE=new li);let n=li.INSTANCE.ignoreTargets.push(t);return ht(n)}static isTouchDevice(){return"ontouchstart"in ur||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,l=t.targetTouches.length;s<l;s++){let o=t.targetTouches.item(s);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:n,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[n],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let u=this.newGestureEvent(On.Start,o.target);u.pageX=o.pageX,u.pageY=o.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let s=Date.now(),l=Object.keys(this.activeTouches).length;for(let o=0,u=n.changedTouches.length;o<u;o++){let h=n.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let d=this.activeTouches[h.identifier],p=Date.now()-d.initialTimeStamp;if(p<li.HOLD_DELAY&&Math.abs(d.initialPageX-Hi(d.rollingPageX))<30&&Math.abs(d.initialPageY-Hi(d.rollingPageY))<30){let _=this.newGestureEvent(On.Tap,d.initialTarget);_.pageX=Hi(d.rollingPageX),_.pageY=Hi(d.rollingPageY),this.dispatchEvent(_)}else if(p>=li.HOLD_DELAY&&Math.abs(d.initialPageX-Hi(d.rollingPageX))<30&&Math.abs(d.initialPageY-Hi(d.rollingPageY))<30){let _=this.newGestureEvent(On.Contextmenu,d.initialTarget);_.pageX=Hi(d.rollingPageX),_.pageY=Hi(d.rollingPageY),this.dispatchEvent(_)}else if(l===1){let _=Hi(d.rollingPageX),g=Hi(d.rollingPageY),S=Hi(d.rollingTimestamps)-d.rollingTimestamps[0],v=_-d.rollingPageX[0],w=g-d.rollingPageY[0],x=[...this.targets].filter(E=>d.initialTarget instanceof Node&&E.contains(d.initialTarget));this.inertia(t,x,s,Math.abs(v)/S,v>0?1:-1,_,Math.abs(w)/S,w>0?1:-1,g)}this.dispatchEvent(this.newGestureEvent(On.End,d.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=n,s.tapCount=0,s}dispatchEvent(t){if(t.type===On.Tap){let n=new Date().getTime(),s=0;n-this._lastSetTapCountTime>li.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=n,t.tapCount=s}else(t.type===On.Change||t.type===On.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let n=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let l=0,o=t.initialTarget;for(;o&&o!==s;)l++,o=o.parentElement;n.push([l,s])}n.sort((s,l)=>s[0]-l[0]);for(let[s,l]of n)l.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,s,l,o,u,h,d,p){this.handle=qg(t,()=>{let _=Date.now(),g=_-s,S=0,v=0,w=!0;l+=li.SCROLL_FRICTION*g,h+=li.SCROLL_FRICTION*g,l>0&&(w=!1,S=o*l*g),h>0&&(w=!1,v=d*h*g);let x=this.newGestureEvent(On.Change);x.translationX=S,x.translationY=v,n.forEach(E=>E.dispatchEvent(x)),w||this.inertia(t,n,_,l,o,u+S,h,d,p+v)})}onTouchMove(t){let n=Date.now();for(let s=0,l=t.changedTouches.length;s<l;s++){let o=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let u=this.activeTouches[o.identifier],h=this.newGestureEvent(On.Change,u.initialTarget);h.translationX=o.pageX-Hi(u.rollingPageX),h.translationY=o.pageY-Hi(u.rollingPageY),h.pageX=o.pageX,h.pageY=o.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(o.pageX),u.rollingPageY.push(o.pageY),u.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Bo.SCROLL_FRICTION=-.005,Bo.HOLD_DELAY=700,Bo.CLEAR_TAP_COUNT_TIME=400,vt([Fz],Bo,"isTouchDevice",1);var Uz=Bo,$g=class extends Pe{onclick(e,t){this._register(Ae(e,Ft.CLICK,n=>t(new lh(zn(e),n))))}onmousedown(e,t){this._register(Ae(e,Ft.MOUSE_DOWN,n=>t(new lh(zn(e),n))))}onmouseover(e,t){this._register(Ae(e,Ft.MOUSE_OVER,n=>t(new lh(zn(e),n))))}onmouseleave(e,t){this._register(Ae(e,Ft.MOUSE_LEAVE,n=>t(new lh(zn(e),n))))}onkeydown(e,t){this._register(Ae(e,Ft.KEY_DOWN,n=>t(new Q4(n))))}onkeyup(e,t){this._register(Ae(e,Ft.KEY_UP,n=>t(new Q4(n))))}oninput(e,t){this._register(Ae(e,Ft.INPUT,t))}onblur(e,t){this._register(Ae(e,Ft.BLUR,t))}onfocus(e,t){this._register(Ae(e,Ft.FOCUS,t))}onchange(e,t){this._register(Ae(e,Ft.CHANGE,t))}ignoreGesture(e){return Uz.ignoreTarget(e)}},r5=11,Vz=class extends $g{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=r5+"px",this.domNode.style.height=r5+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new O7),this._register(i5(this.bgDomNode,Ft.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(i5(this.domNode,Ft.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Hz),this._pointerdownScheduleRepeatTimer=this._register(new Vg)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,zn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},qz=class Np{constructor(t,n,s,l,o,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,s=s|0,l=l|0,o=o|0,u=u|0,h=h|0),this.rawScrollLeft=l,this.rawScrollTop=h,n<0&&(n=0),l+n>s&&(l=s-n),l<0&&(l=0),o<0&&(o=0),h+o>u&&(h=u-o),h<0&&(h=0),this.width=n,this.scrollWidth=s,this.scrollLeft=l,this.height=o,this.scrollHeight=u,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new Np(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Np(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let s=this.width!==t.width,l=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,d=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:l,scrollLeftChanged:o,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:d}}},$z=class extends Pe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new qz(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let s;t?s=new l5(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=l5.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},s5=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function L0(e,t){let n=t-e;return function(s){return e+n*Wz(s)}}function Yz(e,t,n){return function(s){return s<n?e(s/n):t((s-n)/(1-n))}}var l5=class zp{constructor(t,n,s,l){this.from=t,this.to=n,this.duration=l,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,s){if(Math.abs(t-n)>2.5*s){let l,o;return t<n?(l=t+.75*s,o=n-.75*s):(l=t-.75*s,o=n+.75*s),Yz(L0(t,l),L0(o,n),.33)}return L0(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let s=this.scrollLeft(n),l=this.scrollTop(n);return new s5(s,l,!1)}return new s5(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,s){return zp.start(t,n,s)}static start(t,n,s){s=s+10;let l=Date.now()-10;return new zp(t,n,l,s)}};function Kz(e){return Math.pow(e,3)}function Wz(e){return 1-Kz(1-e)}var Gz=class extends Pe{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Vg)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},Xz=140,R7=class extends $g{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Gz(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new O7),this._shouldRender=!0,this.domNode=Wo(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ae(this.domNode.domNode,Ft.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Vz(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,s){this.slider=Wo(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ae(this.slider.domNode,Ft.POINTER_DOWN,l=>{l.button===0&&(l.preventDefault(),this._sliderPointerDown(l))})),this.onclick(this.slider.domNode,l=>{l.leftButton&&l.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),l=this._sliderPointerPosition(e);n<=l&&l<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let l=Iz(this.domNode.domNode);t=e.pageX-l.left,n=e.pageY-l.top}let s=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,l=>{let o=this._sliderOrthogonalPointerPosition(l),u=Math.abs(o-n);if(T7&&u>Xz){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let h=this._sliderPointerPosition(l)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},L7=class Bp{constructor(t,n,s,l,o,u){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=l,this._scrollSize=o,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Bp(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,s,l,o){let u=Math.max(0,s-t),h=Math.max(0,u-2*n),d=l>0&&l>s;if(!d)return{computedAvailableSize:Math.round(u),computedIsNeeded:d,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let p=Math.round(Math.max(20,Math.floor(s*h/l))),_=(h-p)/(l-s),g=o*_;return{computedAvailableSize:Math.round(u),computedIsNeeded:d,computedSliderSize:Math.round(p),computedSliderRatio:_,computedSliderPosition:Math.round(g)}}_refreshComputedValues(){let t=Bp._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,s=this._scrollPosition;return n<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},Zz=class extends R7{constructor(e,t,n){let s=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new L7(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,l.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Qz=class extends R7{constructor(e,t,n){let s=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new L7(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,l.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},Jz=500,a5=50,eB=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},jp=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,s=1,l=this._rear;do{let o=l===this._front?t:Math.pow(2,-s);if(t-=o,n+=this._memory[l].score*o,l===this._front)break;l=(this._capacity+l-1)%this._capacity,s++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(Fg){let n=zn(t.browserEvent),s=hz(n);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,s){let l=null,o=new eB(t,n,s);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(l=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,l)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),n){let l=Math.abs(t.deltaX),o=Math.abs(t.deltaY),u=Math.abs(n.deltaX),h=Math.abs(n.deltaY),d=Math.max(Math.min(l,u),1),p=Math.max(Math.min(o,h),1),_=Math.max(l,u),g=Math.max(o,h);_%d===0&&g%p===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};jp.INSTANCE=new jp;var tB=jp,iB=class extends $g{constructor(e,t,n){super(),this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ue),this.onWillScroll=this._onWillScroll.event,this._options=rB(t),this._scrollable=n,this._register(this._scrollable.onScroll(l=>{this._onWillScroll.fire(l),this._onDidScroll(l),this._onScroll.fire(l)}));let s={onMouseWheel:l=>this._onMouseWheel(l),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Qz(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Zz(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Wo(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Wo(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Wo(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,l=>this._onMouseOver(l)),this.onmouseleave(this._listenOnDomNode,l=>this._onMouseLeave(l)),this._hideTimeout=this._register(new Vg),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Zs(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Bn&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new e5(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Zs(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new e5(n))};this._mouseWheelToDispose.push(Ae(this._listenOnDomNode,Ft.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=tB.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+l===0?o=l=0:Math.abs(l)>=Math.abs(o)?o=0:l=0),this._options.flipAxes&&([l,o]=[o,l]);let u=!Bn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!o&&(o=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(l){let p=a5*l,_=h.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(d,_)}if(o){let p=a5*o,_=h.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(d,_)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,s=n?" left":"",l=t?" top":"",o=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${l}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${l}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Jz)}},nB=class extends iB{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function rB(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Bn&&(t.className+=" mac"),t}var Hp=class extends Pe{constructor(e,t,n,s,l,o,u,h){super(),this._bufferService=n,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new ue),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new $z({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:p=>qg(s.window,p)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new nB(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(l.onProtocolChange(p=>{this._scrollableElement.updateOptions({handleMouseWheel:!(p&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ni.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ht(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ht(()=>this._styleElement.remove())),this._register(ni.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
73
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(p=>this._handleScroll(p)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Hp=vt([pe(2,mi),pe(3,mr),pe(4,d7),pe(5,Sa),pe(6,gi),pe(7,gr)],Hp);var Ip=class extends Pe{constructor(e,t,n,s,l){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=s,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(ht(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Ip=vt([pe(1,mi),pe(2,mr),pe(3,mc),pe(4,gr)],Ip);var sB=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Mn={full:0,left:0,center:0,right:0},Xr={full:0,left:0,center:0,right:0},Ao={full:0,left:0,center:0,right:0},qh=class extends Pe{constructor(e,t,n,s,l,o,u,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=s,this._renderService=l,this._optionsService=o,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new sB,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(ht(()=>this._canvas?.remove()));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Xr.full=this._canvas.width,Xr.left=e,Xr.center=t,Xr.right=e,this._refreshDrawHeightConstants(),Ao.full=1,Ao.left=1,Ao.center=1+Xr.left,Ao.right=1+Xr.left+Xr.center}_refreshDrawHeightConstants(){Mn.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Mn.left=t,Mn.center=t,Mn.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Mn.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Mn.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Mn.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Mn.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ao[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Mn[e.position||"full"]/2),Xr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Mn[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};qh=vt([pe(2,mi),pe(3,mc),pe(4,gr),pe(5,gi),pe(6,Sa),pe(7,mr)],qh);var re;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
74
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(re||={});var _h;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(_h||={});var N7;(e=>e.ST=`${re.ESC}\\`)(N7||={});var Pp=class{constructor(e,t,n,s,l,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=s,this._coreService=l,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${re.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Pp=vt([pe(2,mi),pe(3,gi),pe(4,il),pe(5,gr)],Pp);var Ut=0,Vt=0,qt=0,_t=0,o5={css:"#00000000",rgba:0},At;(e=>{function t(l,o,u,h){return h!==void 0?`#${js(l)}${js(o)}${js(u)}${js(h)}`:`#${js(l)}${js(o)}${js(u)}`}e.toCss=t;function n(l,o,u,h=255){return(l<<24|o<<16|u<<8|h)>>>0}e.toRgba=n;function s(l,o,u,h){return{css:e.toCss(l,o,u,h),rgba:e.toRgba(l,o,u,h)}}e.toColor=s})(At||={});var ct;(e=>{function t(d,p){if(_t=(p.rgba&255)/255,_t===1)return{css:p.css,rgba:p.rgba};let _=p.rgba>>24&255,g=p.rgba>>16&255,S=p.rgba>>8&255,v=d.rgba>>24&255,w=d.rgba>>16&255,x=d.rgba>>8&255;Ut=v+Math.round((_-v)*_t),Vt=w+Math.round((g-w)*_t),qt=x+Math.round((S-x)*_t);let E=At.toCss(Ut,Vt,qt),M=At.toRgba(Ut,Vt,qt);return{css:E,rgba:M}}e.blend=t;function n(d){return(d.rgba&255)===255}e.isOpaque=n;function s(d,p,_){let g=vh.ensureContrastRatio(d.rgba,p.rgba,_);if(g)return At.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=s;function l(d){let p=(d.rgba|255)>>>0;return[Ut,Vt,qt]=vh.toChannels(p),{css:At.toCss(Ut,Vt,qt),rgba:p}}e.opaque=l;function o(d,p){return _t=Math.round(p*255),[Ut,Vt,qt]=vh.toChannels(d.rgba),{css:At.toCss(Ut,Vt,qt,_t),rgba:At.toRgba(Ut,Vt,qt,_t)}}e.opacity=o;function u(d,p){return _t=d.rgba&255,o(d,_t*p/255)}e.multiplyOpacity=u;function h(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}e.toColorRGB=h})(ct||={});var pt;(e=>{let t,n;try{let l=document.createElement("canvas");l.width=1,l.height=1;let o=l.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function s(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return Ut=parseInt(l.slice(1,2).repeat(2),16),Vt=parseInt(l.slice(2,3).repeat(2),16),qt=parseInt(l.slice(3,4).repeat(2),16),At.toColor(Ut,Vt,qt);case 5:return Ut=parseInt(l.slice(1,2).repeat(2),16),Vt=parseInt(l.slice(2,3).repeat(2),16),qt=parseInt(l.slice(3,4).repeat(2),16),_t=parseInt(l.slice(4,5).repeat(2),16),At.toColor(Ut,Vt,qt,_t);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let o=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return Ut=parseInt(o[1]),Vt=parseInt(o[2]),qt=parseInt(o[3]),_t=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),At.toColor(Ut,Vt,qt,_t);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=l,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Ut,Vt,qt,_t]=t.getImageData(0,0,1,1).data,_t!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:At.toRgba(Ut,Vt,qt,_t),css:l}}e.toColor=s})(pt||={});var di;(e=>{function t(s){return n(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function n(s,l,o){let u=s/255,h=l/255,d=o/255,p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),_=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),g=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return p*.2126+_*.7152+g*.0722}e.relativeLuminance2=n})(di||={});var vh;(e=>{function t(u,h){if(_t=(h&255)/255,_t===1)return h;let d=h>>24&255,p=h>>16&255,_=h>>8&255,g=u>>24&255,S=u>>16&255,v=u>>8&255;return Ut=g+Math.round((d-g)*_t),Vt=S+Math.round((p-S)*_t),qt=v+Math.round((_-v)*_t),At.toRgba(Ut,Vt,qt)}e.blend=t;function n(u,h,d){let p=di.relativeLuminance(u>>8),_=di.relativeLuminance(h>>8);if(ar(p,_)<d){if(_<p){let v=s(u,h,d),w=ar(p,di.relativeLuminance(v>>8));if(w<d){let x=l(u,h,d),E=ar(p,di.relativeLuminance(x>>8));return w>E?v:x}return v}let g=l(u,h,d),S=ar(p,di.relativeLuminance(g>>8));if(S<d){let v=s(u,h,d),w=ar(p,di.relativeLuminance(v>>8));return S>w?g:v}return g}}e.ensureContrastRatio=n;function s(u,h,d){let p=u>>24&255,_=u>>16&255,g=u>>8&255,S=h>>24&255,v=h>>16&255,w=h>>8&255,x=ar(di.relativeLuminance2(S,v,w),di.relativeLuminance2(p,_,g));for(;x<d&&(S>0||v>0||w>0);)S-=Math.max(0,Math.ceil(S*.1)),v-=Math.max(0,Math.ceil(v*.1)),w-=Math.max(0,Math.ceil(w*.1)),x=ar(di.relativeLuminance2(S,v,w),di.relativeLuminance2(p,_,g));return(S<<24|v<<16|w<<8|255)>>>0}e.reduceLuminance=s;function l(u,h,d){let p=u>>24&255,_=u>>16&255,g=u>>8&255,S=h>>24&255,v=h>>16&255,w=h>>8&255,x=ar(di.relativeLuminance2(S,v,w),di.relativeLuminance2(p,_,g));for(;x<d&&(S<255||v<255||w<255);)S=Math.min(255,S+Math.ceil((255-S)*.1)),v=Math.min(255,v+Math.ceil((255-v)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),x=ar(di.relativeLuminance2(S,v,w),di.relativeLuminance2(p,_,g));return(S<<24|v<<16|w<<8|255)>>>0}e.increaseLuminance=l;function o(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=o})(vh||={});function js(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ar(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var lB=class extends pc{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$h=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new sn}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],s=t.translateToString(!0),l=0,o=0,u=0,h=t.getFg(0),d=t.getBg(0);for(let p=0;p<t.getTrimmedLength();p++)if(t.loadCell(p,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==d){if(p-l>1){let _=this._getJoinedRanges(s,u,o,t,l);for(let g=0;g<_.length;g++)n.push(_[g])}l=p,u=o,h=this._workCell.fg,d=this._workCell.bg}o+=this._workCell.getChars().length||ns.length}if(this._bufferService.cols-l>1){let p=this._getJoinedRanges(s,u,o,t,l);for(let _=0;_<p.length;_++)n.push(p[_])}return n}_getJoinedRanges(e,t,n,s,l){let o=e.substring(t,n),u=[];try{u=this._characterJoiners[0].handler(o)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let d=this._characterJoiners[h].handler(o);for(let p=0;p<d.length;p++)$h._mergeRanges(u,d[p])}catch(d){console.error(d)}return this._stringRangesToCellRanges(u,s,l),u}_stringRangesToCellRanges(e,t,n){let s=0,l=!1,o=0,u=e[s];if(u){for(let h=n;h<this._bufferService.cols;h++){let d=t.getWidth(h),p=t.getString(h).length||ns.length;if(d!==0){if(!l&&u[0]<=o&&(u[0]=h,l=!0),u[1]<=o){if(u[1]=h,u=e[++s],!u)break;u[0]<=o?(u[0]=h,l=!0):l=!1}o+=p}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let s=0;s<e.length;s++){let l=e[s];if(n){if(t[1]<=l[0])return e[s-1][1]=t[1],e;if(t[1]<=l[1])return e[s-1][1]=Math.max(t[1],l[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=l[0])return e.splice(s,0,t),e;if(t[1]<=l[1])return l[0]=Math.min(t[0],l[0]),e;t[0]<l[1]&&(l[0]=Math.min(t[0],l[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};$h=vt([pe(0,mi)],$h);function aB(e){return 57508<=e&&e<=57558}function oB(e){return 9472<=e&&e<=9631}function cB(e){return aB(e)||oB(e)}function uB(){return{css:{canvas:ah(),cell:ah()},device:{canvas:ah(),cell:ah(),char:{width:0,height:0,left:0,top:0}}}}function ah(){return{width:0,height:0}}var Fp=class{constructor(e,t,n,s,l,o,u){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=s,this._coreService=l,this._decorationService=o,this._themeService=u,this._workCell=new sn,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,s,l,o,u,h,d,p,_){let g=[],S=this._characterJoinerService.getJoinedCharacters(t),v=this._themeService.colors,w=e.getNoBgTrimmedLength();n&&w<o+1&&(w=o+1);let x,E=0,M="",P=0,N=0,X=0,Q=0,R=!1,V=0,se=!1,me=0,k=0,K=[],W=p!==-1&&_!==-1;for(let q=0;q<w;q++){e.loadCell(q,this._workCell);let Z=this._workCell.getWidth();if(Z===0)continue;let F=!1,H=q>=k,ie=q,$=this._workCell;if(S.length>0&&q===S[0][0]&&H){let Be=S.shift(),Fn=this._isCellInSelection(Be[0],t);for(P=Be[0]+1;P<Be[1];P++)H&&=Fn===this._isCellInSelection(P,t);H&&=!n||o<Be[0]||o>=Be[1],H?(F=!0,$=new lB(this._workCell,e.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),ie=Be[1]-1,Z=$.getWidth()):k=Be[1]}let oe=this._isCellInSelection(q,t),T=n&&q===o,ze=W&&q>=p&&q<=_,We=!1;this._decorationService.forEachDecorationAtCell(q,t,void 0,Be=>{We=!0});let O=$.getChars()||ns;if(O===" "&&($.isUnderline()||$.isOverline())&&(O=" "),me=Z*h-d.get(O,$.isBold(),$.isItalic()),!x)x=this._document.createElement("span");else if(E&&(oe&&se||!oe&&!se&&$.bg===N)&&(oe&&se&&v.selectionForeground||$.fg===X)&&$.extended.ext===Q&&ze===R&&me===V&&!T&&!F&&!We&&H){$.isInvisible()?M+=ns:M+=O,E++;continue}else E&&(x.textContent=M),x=this._document.createElement("span"),E=0,M="";if(N=$.bg,X=$.fg,Q=$.extended.ext,R=ze,V=me,se=oe,F&&o>=q&&o<=ie&&(o=q),!this._coreService.isCursorHidden&&T&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&K.push("xterm-cursor-blink"),K.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(l)switch(l){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline");break}}if($.isBold()&&K.push("xterm-bold"),$.isItalic()&&K.push("xterm-italic"),$.isDim()&&K.push("xterm-dim"),$.isInvisible()?M=ns:M=$.getChars()||ns,$.isUnderline()&&(K.push(`xterm-underline-${$.extended.underlineStyle}`),M===" "&&(M=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${pc.toColorRGB($.getUnderlineColor()).join(",")})`;else{let Be=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&Be<8&&(Be+=8),x.style.textDecorationColor=v.ansi[Be].css}$.isOverline()&&(K.push("xterm-overline"),M===" "&&(M=" ")),$.isStrikethrough()&&K.push("xterm-strikethrough"),ze&&(x.style.textDecoration="underline");let D=$.getFgColor(),ne=$.getFgColorMode(),ae=$.getBgColor(),de=$.getBgColorMode(),Ee=!!$.isInverse();if(Ee){let Be=D;D=ae,ae=Be;let Fn=ne;ne=de,de=Fn}let ve,Me,fe=!1;this._decorationService.forEachDecorationAtCell(q,t,void 0,Be=>{Be.options.layer!=="top"&&fe||(Be.backgroundColorRGB&&(de=50331648,ae=Be.backgroundColorRGB.rgba>>8&16777215,ve=Be.backgroundColorRGB),Be.foregroundColorRGB&&(ne=50331648,D=Be.foregroundColorRGB.rgba>>8&16777215,Me=Be.foregroundColorRGB),fe=Be.options.layer==="top")}),!fe&&oe&&(ve=this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque,ae=ve.rgba>>8&16777215,de=50331648,fe=!0,v.selectionForeground&&(ne=50331648,D=v.selectionForeground.rgba>>8&16777215,Me=v.selectionForeground)),fe&&K.push("xterm-decoration-top");let Se;switch(de){case 16777216:case 33554432:Se=v.ansi[ae],K.push(`xterm-bg-${ae}`);break;case 50331648:Se=At.toColor(ae>>16,ae>>8&255,ae&255),this._addStyle(x,`background-color:#${c5((ae>>>0).toString(16),"0",6)}`);break;default:Ee?(Se=v.foreground,K.push("xterm-bg-257")):Se=v.background}switch(ve||$.isDim()&&(ve=ct.multiplyOpacity(Se,.5)),ne){case 16777216:case 33554432:$.isBold()&&D<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(D+=8),this._applyMinimumContrast(x,Se,v.ansi[D],$,ve,void 0)||K.push(`xterm-fg-${D}`);break;case 50331648:let Be=At.toColor(D>>16&255,D>>8&255,D&255);this._applyMinimumContrast(x,Se,Be,$,ve,Me)||this._addStyle(x,`color:#${c5(D.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,Se,v.foreground,$,ve,Me)||Ee&&K.push("xterm-fg-257")}K.length&&(x.className=K.join(" "),K.length=0),!T&&!F&&!We&&H?E++:x.textContent=M,me!==this.defaultSpacing&&(x.style.letterSpacing=`${me}px`),g.push(x),q=ie}return x&&E&&(x.textContent=M),g}_applyMinimumContrast(e,t,n,s,l,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||cB(s.getCode()))return!1;let u=this._getContrastCache(s),h;if(!l&&!o&&(h=u.getColor(t.rgba,n.rgba)),h===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);h=ct.ensureContrastRatio(l||t,o||n,d),u.setColor((l||t).rgba,(o||n).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&t>=n[1]&&e<s[0]&&t<=s[1]:e<n[0]&&t>=n[1]&&e>=s[0]&&t<=s[1]:t>n[1]&&t<s[1]||n[1]===s[1]&&t===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&t===s[1]&&e<s[0]||n[1]<s[1]&&t===n[1]&&e>=n[0]}};Fp=vt([pe(1,g7),pe(2,gi),pe(3,mr),pe(4,il),pe(5,mc),pe(6,Sa)],Fp);function c5(e,t,n){for(;e.length<n;)e=t+e;return e}var hB=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,s,l,o],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(l),this._container.appendChild(o),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,s){e===this._font&&t===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,n){let s=0;if(!t&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let u=this._measure(e,0);return u>0&&(this._flat[s]=u),u}let l=e;t&&(l+="B"),n&&(l+="I");let o=this._holey.get(l);if(o===void 0){let u=0;t&&(u|=1),n&&(u|=2),o=this._measure(e,u),o>0&&this._holey.set(l,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},fB=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,s=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let l=e.buffers.active.ydisp,o=t[1]-l,u=n[1]-l,h=Math.max(o,0),d=Math.min(u,e.rows-1);if(h>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=d,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function dB(){return new fB}var N0="xterm-dom-renderer-owner-",en="xterm-rows",oh="xterm-fg-",u5="xterm-bg-",Do="xterm-focus",ch="xterm-selection",pB=1,Up=class extends Pe{constructor(e,t,n,s,l,o,u,h,d,p,_,g,S,v){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=s,this._viewportElement=l,this._helperContainer=o,this._linkifier2=u,this._charSizeService=d,this._optionsService=p,this._bufferService=_,this._coreService=g,this._coreBrowserService=S,this._themeService=v,this._terminalClass=pB++,this._rowElements=[],this._selectionRenderModel=dB(),this.onRequestRedraw=this._register(new ue).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(en),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(ch),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=uB(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(w=>this._injectCss(w))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(Fp,document),this._element.classList.add(N0+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(w=>this._handleLinkHover(w))),this._register(this._linkifier2.onHideLinkUnderline(w=>this._handleLinkLeave(w))),this._register(ht(()=>{this._element.classList.remove(N0+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new hB(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${en} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${en} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${en} .xterm-dim { color: ${ct.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,l=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${l} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${en}.${Do} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${en}.${Do} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${en}.${Do} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${en} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${en} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${en} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${en} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${en} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${ch} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${ch} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${ch} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,u]of e.ansi.entries())t+=`${this._terminalSelector} .${oh}${o} { color: ${u.css}; }${this._terminalSelector} .${oh}${o}.xterm-dim { color: ${ct.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${u5}${o} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${oh}257 { color: ${ct.opaque(e.background).css}; }${this._terminalSelector} .${oh}257.xterm-dim { color: ${ct.multiplyOpacity(ct.opaque(e.background),.5).css}; }${this._terminalSelector} .${u5}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Do),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Do),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,l=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(n){let d=e[0]>t[0];h.appendChild(this._createSelectionElement(o,d?t[0]:e[0],d?e[0]:t[0],u-o+1))}else{let d=s===o?e[0]:0,p=o===l?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(o,d,p));let _=u-o-1;if(h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,_)),o!==u){let g=l===u?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(u,0,g))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,n,s=1){let l=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(n-t);return o+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-o),l.style.height=`${s*this.dimensions.css.cell.height}px`,l.style.top=`${e*this.dimensions.css.cell.height}px`,l.style.left=`${o}px`,l.style.width=`${u}px`,l}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,s=n.ybase+n.y,l=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=t;d++){let p=d+n.ydisp,_=this._rowElements[d],g=n.lines.get(p);if(!_||!g)break;_.replaceChildren(...this._rowFactory.createRow(g,p,p===s,u,h,l,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N0}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,s,l,o){n<0&&(e=0),s<0&&(t=0);let u=this._bufferService.rows-1;n=Math.max(Math.min(n,u),0),s=Math.max(Math.min(s,u),0),l=Math.min(l,this._bufferService.cols);let h=this._bufferService.buffer,d=h.ybase+h.y,p=Math.min(h.x,l-1),_=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=n;v<=s;++v){let w=v+h.ydisp,x=this._rowElements[v],E=h.lines.get(w);if(!x||!E)break;x.replaceChildren(...this._rowFactory.createRow(E,w,w===d,g,S,p,_,this.dimensions.css.cell.width,this._widthCache,o?v===n?e:0:-1,o?(v===s?t:l)-1:-1))}}};Up=vt([pe(7,Hg),pe(8,Sf),pe(9,gi),pe(10,mi),pe(11,il),pe(12,mr),pe(13,Sa)],Up);var Vp=class extends Pe{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ue),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new gB(this._optionsService))}catch{this._measureStrategy=this._register(new mB(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Vp=vt([pe(2,gi)],Vp);var z7=class extends Pe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},mB=class extends z7{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},gB=class extends z7{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},_B=class extends Pe{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new vB(this._window)),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ue),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(ni.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ae(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ae(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},vB=class extends Pe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new fa),this._onDprChange=this._register(new ue),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ht(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ae(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},yB=class extends Pe{constructor(){super(),this.linkProviders=[],this._register(ht(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Yg(e,t,n){let s=n.getBoundingClientRect(),l=e.getComputedStyle(n),o=parseInt(l.getPropertyValue("padding-left")),u=parseInt(l.getPropertyValue("padding-top"));return[t.clientX-s.left-o,t.clientY-s.top-u]}function SB(e,t,n,s,l,o,u,h,d){if(!o)return;let p=Yg(e,t,n);if(p)return p[0]=Math.ceil((p[0]+(d?u/2:0))/u),p[1]=Math.ceil(p[1]/h),p[0]=Math.min(Math.max(p[0],1),s+(d?1:0)),p[1]=Math.min(Math.max(p[1],1),l),p}var qp=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,s,l){return SB(window,e,t,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(e,t){let n=Yg(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};qp=vt([pe(0,gr),pe(1,Sf)],qp);var bB=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},B7={};ON(B7,{getSafariVersion:()=>xB,isChromeOS:()=>P7,isFirefox:()=>j7,isIpad:()=>CB,isIphone:()=>EB,isLegacyEdge:()=>wB,isLinux:()=>Kg,isMac:()=>Yh,isNode:()=>bf,isSafari:()=>H7,isWindows:()=>I7});var bf=typeof process<"u"&&"title"in process,gc=bf?"node":navigator.userAgent,_c=bf?"node":navigator.platform,j7=gc.includes("Firefox"),wB=gc.includes("Edge"),H7=/^((?!chrome|android).)*safari/i.test(gc);function xB(){if(!H7)return 0;let e=gc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Yh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_c),CB=_c==="iPad",EB=_c==="iPhone",I7=["Windows","Win16","Win32","WinCE"].includes(_c),Kg=_c.indexOf("Linux")>=0,P7=/\bCrOS\b/.test(gc),F7=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,s=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),l=e.timeRemaining(),n*1.5>l){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=l}this.clear()}},kB=class extends F7{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},TB=class extends F7{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Kh=!bf&&"requestIdleCallback"in window?TB:kB,MB=class{constructor(){this._queue=new Kh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},$p=class extends Pe{constructor(e,t,n,s,l,o,u,h,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=l,this._coreBrowserService=h,this._renderer=this._register(new fa),this._pausedResizeTask=new MB,this._observerDisposable=this._register(new fa),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new ue),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ue),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ue),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new bB((p,_)=>this._renderRows(p,_),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new AB(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ht(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(p=>this._registerIntersectionObserver(p,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=ht(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};$p=vt([pe(2,gi),pe(3,Sf),pe(4,il),pe(5,mc),pe(6,mi),pe(7,mr),pe(8,Sa)],$p);var AB=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function DB(e,t,n,s){let l=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return LB(l,o,e,t,n,s)+wf(o,t,n,s)+NB(l,o,e,t,n,s);let u;if(o===t)return u=l>e?"D":"C",nc(Math.abs(l-e),ic(u,s));u=o>t?"D":"C";let h=Math.abs(o-t),d=RB(o>t?e:l,n)+(h-1)*n.cols+1+OB(o>t?l:e);return nc(d,ic(u,s))}function OB(e,t){return e-1}function RB(e,t){return t.cols-e}function LB(e,t,n,s,l,o){return wf(t,s,l,o).length===0?"":nc(V7(e,t,e,t-Qs(t,l),!1,l).length,ic("D",o))}function wf(e,t,n,s){let l=e-Qs(e,n),o=t-Qs(t,n),u=Math.abs(l-o)-zB(e,t,n);return nc(u,ic(U7(e,t),s))}function NB(e,t,n,s,l,o){let u;wf(t,s,l,o).length>0?u=s-Qs(s,l):u=t;let h=s,d=BB(e,t,n,s,l,o);return nc(V7(e,u,n,h,d==="C",l).length,ic(d,o))}function zB(e,t,n){let s=0,l=e-Qs(e,n),o=t-Qs(t,n);for(let u=0;u<Math.abs(l-o);u++){let h=U7(e,t)==="A"?-1:1;n.buffer.lines.get(l+h*u)?.isWrapped&&s++}return s}function Qs(e,t){let n=0,s=t.buffer.lines.get(e),l=s?.isWrapped;for(;l&&e>=0&&e<t.rows;)n++,s=t.buffer.lines.get(--e),l=s?.isWrapped;return n}function BB(e,t,n,s,l,o){let u;return wf(n,s,l,o).length>0?u=s-Qs(s,l):u=t,e<n&&u<=s||e>=n&&u<s?"C":"D"}function U7(e,t){return e>t?"A":"B"}function V7(e,t,n,s,l,o){let u=e,h=t,d="";for(;(u!==n||h!==s)&&h>=0&&h<o.buffer.lines.length;)u+=l?1:-1,l&&u>o.cols-1?(d+=o.buffer.translateBufferLineToString(h,!1,e,u),u=0,e=0,h++):!l&&u<0&&(d+=o.buffer.translateBufferLineToString(h,!1,0,e+1),u=o.cols-1,e=u,h--);return d+o.buffer.translateBufferLineToString(h,!1,e,u)}function ic(e,t){let n=t?"O":"[";return re.ESC+n+e}function nc(e,t){e=Math.floor(e);let n="";for(let s=0;s<e;s++)n+=t;return n}var jB=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function h5(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var z0=50,HB=15,IB=50,PB=500,FB=" ",UB=new RegExp(FB,"g"),Yp=class extends Pe{constructor(e,t,n,s,l,o,u,h,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=s,this._coreService=l,this._mouseService=o,this._optionsService=u,this._renderService=h,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new sn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ue),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ue),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ue),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=p=>this._handleMouseMove(p),this._mouseUpListener=p=>this._handleMouseUp(p),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(p=>this._handleTrim(p)),this._register(this._bufferService.buffers.onBufferActivate(p=>this._handleBufferActivate(p))),this.enable(),this._model=new jB(this._bufferService),this._activeSelectionMode=0,this._register(ht(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(p=>{p.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let l=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let h=n.translateBufferLineToString(u,!0,l,o);s.push(h)}}else{let l=e[1]===t[1]?t[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],l));for(let o=e[1]+1;o<=t[1]-1;o++){let u=n.lines.get(o),h=n.translateBufferLineToString(o,!0);u?.isWrapped?s[s.length-1]+=h:s.push(h)}if(e[1]!==t[1]){let o=n.lines.get(t[1]),u=n.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?s[s.length-1]+=u:s.push(u)}}return s.map(l=>l.replace(UB," ")).join(I7?`\r
75
+ `:`
76
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Kg&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s||!t?!1:this._areCoordsInSelection(t,n,s)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s?!1:this._areCoordsInSelection([e,t],n,s)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=h5(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Yg(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-z0),z0),t/=z0,t/Math.abs(t)+Math.round(t*(HB-1)))}shouldForceSelection(e){return Yh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),IB)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Yh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let s=n.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<PB&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let s=DB(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let s=0;t>=s;s++){let l=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:l>1&&t!==s&&(n+=l-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let l=this._bufferService.buffer,o=l.lines.get(e[1]);if(!o)return;let u=l.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(o,e[0]),d=h,p=e[0]-h,_=0,g=0,S=0,v=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;d<u.length&&u.charAt(d+1)===" ";)d++}else{let E=e[0],M=e[0];o.getWidth(E)===0&&(_++,E--),o.getWidth(M)===2&&(g++,M++);let P=o.getString(M).length;for(P>1&&(v+=P-1,d+=P-1);E>0&&h>0&&!this._isCharWordSeparator(o.loadCell(E-1,this._workCell));){o.loadCell(E-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(_++,E--):N>1&&(S+=N-1,h-=N-1),h--,E--}for(;M<o.length&&d+1<u.length&&!this._isCharWordSeparator(o.loadCell(M+1,this._workCell));){o.loadCell(M+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,M++):N>1&&(v+=N-1,d+=N-1),d++,M++}}d++;let w=h+p-_+S,x=Math.min(this._bufferService.cols,d-h+_+g-S-v);if(!(!t&&u.slice(h,d).trim()==="")){if(n&&w===0&&o.getCodePoint(0)!==32){let E=l.lines.get(e[1]-1);if(E&&o.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let M=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(M){let P=this._bufferService.cols-M.start;w-=P,x+=P}}}if(s&&w+x===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let E=l.lines.get(e[1]+1);if(E?.isWrapped&&E.getCodePoint(0)!==32){let M=this._getWordAt([0,e[1]+1],!1,!1,!0);M&&(x+=M.length)}}return{start:w,length:x}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=h5(n,this._bufferService.cols)}};Yp=vt([pe(3,mi),pe(4,il),pe(5,Ig),pe(6,gi),pe(7,gr),pe(8,mr)],Yp);var f5=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},d5=class{constructor(){this._color=new f5,this._css=new f5}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Ot=Object.freeze((()=>{let e=[pt.toColor("#2e3436"),pt.toColor("#cc0000"),pt.toColor("#4e9a06"),pt.toColor("#c4a000"),pt.toColor("#3465a4"),pt.toColor("#75507b"),pt.toColor("#06989a"),pt.toColor("#d3d7cf"),pt.toColor("#555753"),pt.toColor("#ef2929"),pt.toColor("#8ae234"),pt.toColor("#fce94f"),pt.toColor("#729fcf"),pt.toColor("#ad7fa8"),pt.toColor("#34e2e2"),pt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let s=t[n/36%6|0],l=t[n/6%6|0],o=t[n%6];e.push({css:At.toCss(s,l,o),rgba:At.toRgba(s,l,o)})}for(let n=0;n<24;n++){let s=8+n*10;e.push({css:At.toCss(s,s,s),rgba:At.toRgba(s,s,s)})}return e})()),Ps=pt.toColor("#ffffff"),jo=pt.toColor("#000000"),p5=pt.toColor("#ffffff"),m5=jo,Oo={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},VB=Ps,Kp=class extends Pe{constructor(e){super(),this._optionsService=e,this._contrastCache=new d5,this._halfContrastCache=new d5,this._onChangeColors=this._register(new ue),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ps,background:jo,cursor:p5,cursorAccent:m5,selectionForeground:void 0,selectionBackgroundTransparent:Oo,selectionBackgroundOpaque:ct.blend(jo,Oo),selectionInactiveBackgroundTransparent:Oo,selectionInactiveBackgroundOpaque:ct.blend(jo,Oo),scrollbarSliderBackground:ct.opacity(Ps,.2),scrollbarSliderHoverBackground:ct.opacity(Ps,.4),scrollbarSliderActiveBackground:ct.opacity(Ps,.5),overviewRulerBorder:Ps,ansi:Ot.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=it(e.foreground,Ps),t.background=it(e.background,jo),t.cursor=ct.blend(t.background,it(e.cursor,p5)),t.cursorAccent=ct.blend(t.background,it(e.cursorAccent,m5)),t.selectionBackgroundTransparent=it(e.selectionBackground,Oo),t.selectionBackgroundOpaque=ct.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=it(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ct.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?it(e.selectionForeground,o5):void 0,t.selectionForeground===o5&&(t.selectionForeground=void 0),ct.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ct.opacity(t.selectionBackgroundTransparent,.3)),ct.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ct.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=it(e.scrollbarSliderBackground,ct.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=it(e.scrollbarSliderHoverBackground,ct.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=it(e.scrollbarSliderActiveBackground,ct.opacity(t.foreground,.5)),t.overviewRulerBorder=it(e.overviewRulerBorder,VB),t.ansi=Ot.slice(),t.ansi[0]=it(e.black,Ot[0]),t.ansi[1]=it(e.red,Ot[1]),t.ansi[2]=it(e.green,Ot[2]),t.ansi[3]=it(e.yellow,Ot[3]),t.ansi[4]=it(e.blue,Ot[4]),t.ansi[5]=it(e.magenta,Ot[5]),t.ansi[6]=it(e.cyan,Ot[6]),t.ansi[7]=it(e.white,Ot[7]),t.ansi[8]=it(e.brightBlack,Ot[8]),t.ansi[9]=it(e.brightRed,Ot[9]),t.ansi[10]=it(e.brightGreen,Ot[10]),t.ansi[11]=it(e.brightYellow,Ot[11]),t.ansi[12]=it(e.brightBlue,Ot[12]),t.ansi[13]=it(e.brightMagenta,Ot[13]),t.ansi[14]=it(e.brightCyan,Ot[14]),t.ansi[15]=it(e.brightWhite,Ot[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<n;s++)t.ansi[s+16]=it(e.extendedAnsi[s],Ot[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Kp=vt([pe(0,gi)],Kp);function it(e,t){if(e!==void 0)try{return pt.toColor(e)}catch{}return t}var qB=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},$B=class{constructor(){this._services=new qB,this._services.set(Hg,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=HN(e).sort((o,u)=>o.index-u.index),s=[];for(let o of n){let u=this._services.get(o.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);s.push(u)}let l=n.length>0?n[0].index:t.length;if(t.length!==l)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${l+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},YB={trace:0,debug:1,info:2,warn:3,error:4,off:5},KB="xterm.js: ",Wp=class extends Pe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=YB[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":KB)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Wp=vt([pe(0,gi)],Wp);var g5=class extends Pe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ue),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ue),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ue),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+n.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<n.length;s++)this._array[this._getCyclicIndex(e+s)]=n[s];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let s=this._length+n.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let l=t-1;l>=0;l--)this.set(e+l+n,this.get(e+l));let s=e+t+n-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+n,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},He=3,Mt=Object.freeze(new pc),uh=0,B0=2,Ho=class q7{constructor(t,n,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*He);let l=n||sn.fromCharData([0,c7,1,0]);for(let o=0;o<t;++o)this.setCell(o,l);this.length=t}get(t){let n=this._data[t*He+0],s=n&2097151;return[this._data[t*He+1],n&2097152?this._combined[t]:s?Jr(s):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,n){this._data[t*He+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*He+0]=t|2097152|n[2]<<22):this._data[t*He+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*He+0]>>22}hasWidth(t){return this._data[t*He+0]&12582912}getFg(t){return this._data[t*He+1]}getBg(t){return this._data[t*He+2]}hasContent(t){return this._data[t*He+0]&4194303}getCodePoint(t){let n=this._data[t*He+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*He+0]&2097152}getString(t){let n=this._data[t*He+0];return n&2097152?this._combined[t]:n&2097151?Jr(n&2097151):""}isProtected(t){return this._data[t*He+2]&536870912}loadCell(t,n){return uh=t*He,n.content=this._data[uh+0],n.fg=this._data[uh+1],n.bg=this._data[uh+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*He+0]=n.content,this._data[t*He+1]=n.fg,this._data[t*He+2]=n.bg}setCellFromCodepoint(t,n,s,l){l.bg&268435456&&(this._extendedAttrs[t]=l.extended),this._data[t*He+0]=n|s<<22,this._data[t*He+1]=l.fg,this._data[t*He+2]=l.bg}addCodepointToCell(t,n,s){let l=this._data[t*He+0];l&2097152?this._combined[t]+=Jr(n):l&2097151?(this._combined[t]=Jr(l&2097151)+Jr(n),l&=-2097152,l|=2097152):l=n|1<<22,s&&(l&=-12582913,l|=s<<22),this._data[t*He+0]=l}insertCells(t,n,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length-t){let l=new sn;for(let o=this.length-t-n-1;o>=0;--o)this.setCell(t+n+o,this.loadCell(t+o,l));for(let o=0;o<n;++o)this.setCell(t+o,s)}else for(let l=t;l<this.length;++l)this.setCell(l,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,n,s){if(t%=this.length,n<this.length-t){let l=new sn;for(let o=0;o<this.length-t-n;++o)this.setCell(t+o,this.loadCell(t+n+o,l));for(let o=this.length-n;o<this.length;++o)this.setCell(o,s)}else for(let l=t;l<this.length;++l)this.setCell(l,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,n,s,l=!1){if(l){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.setCell(t++,s)}resize(t,n){if(t===this.length)return this._data.length*4*B0<this._data.buffer.byteLength;let s=t*He;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let l=new Uint32Array(s);l.set(this._data),this._data=l}for(let l=this.length;l<t;++l)this.setCell(l,n)}else{this._data=this._data.subarray(0,s);let l=Object.keys(this._combined);for(let u=0;u<l.length;u++){let h=parseInt(l[u],10);h>=t&&delete this._combined[h]}let o=Object.keys(this._extendedAttrs);for(let u=0;u<o.length;u++){let h=parseInt(o[u],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,s*4*B0<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*B0<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new q7(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*He+0]&4194303)return t+(this._data[t*He+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*He+0]&4194303||this._data[t*He+2]&50331648)return t+(this._data[t*He+0]>>22);return 0}copyCellsFrom(t,n,s,l,o){let u=t._data;if(o)for(let d=l-1;d>=0;d--){for(let p=0;p<He;p++)this._data[(s+d)*He+p]=u[(n+d)*He+p];u[(n+d)*He+2]&268435456&&(this._extendedAttrs[s+d]=t._extendedAttrs[n+d])}else for(let d=0;d<l;d++){for(let p=0;p<He;p++)this._data[(s+d)*He+p]=u[(n+d)*He+p];u[(n+d)*He+2]&268435456&&(this._extendedAttrs[s+d]=t._extendedAttrs[n+d])}let h=Object.keys(t._combined);for(let d=0;d<h.length;d++){let p=parseInt(h[d],10);p>=n&&(this._combined[p-n+s]=t._combined[p])}}translateToString(t,n,s,l){n=n??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),l&&(l.length=0);let o="";for(;n<s;){let u=this._data[n*He+0],h=u&2097151,d=u&2097152?this._combined[n]:h?Jr(h):ns;if(o+=d,l)for(let p=0;p<d.length;++p)l.push(n);n+=u>>22||1}return l&&l.push(n),o}};function WB(e,t,n,s,l,o){let u=[];for(let h=0;h<e.length-1;h++){let d=h,p=e.get(++d);if(!p.isWrapped)continue;let _=[e.get(h)];for(;d<e.length&&p.isWrapped;)_.push(p),p=e.get(++d);if(!o&&s>=h&&s<d){h+=_.length-1;continue}let g=0,S=rc(_,g,t),v=1,w=0;for(;v<_.length;){let E=rc(_,v,t),M=E-w,P=n-S,N=Math.min(M,P);_[g].copyCellsFrom(_[v],w,S,N,!1),S+=N,S===n&&(g++,S=0),w+=N,w===E&&(v++,w=0),S===0&&g!==0&&_[g-1].getWidth(n-1)===2&&(_[g].copyCellsFrom(_[g-1],n-1,S++,1,!1),_[g-1].setCell(n-1,l))}_[g].replaceCells(S,n,l);let x=0;for(let E=_.length-1;E>0&&(E>g||_[E].getTrimmedLength()===0);E--)x++;x>0&&(u.push(h+_.length-x),u.push(x)),h+=_.length-1}return u}function GB(e,t){let n=[],s=0,l=t[s],o=0;for(let u=0;u<e.length;u++)if(l===u){let h=t[++s];e.onDeleteEmitter.fire({index:u-o,amount:h}),u+=h-1,o+=h,l=t[++s]}else n.push(u);return{layout:n,countRemoved:o}}function XB(e,t){let n=[];for(let s=0;s<t.length;s++)n.push(e.get(t[s]));for(let s=0;s<n.length;s++)e.set(s,n[s]);e.length=t.length}function ZB(e,t,n){let s=[],l=e.map((d,p)=>rc(e,p,t)).reduce((d,p)=>d+p),o=0,u=0,h=0;for(;h<l;){if(l-h<n){s.push(l-h);break}o+=n;let d=rc(e,u,t);o>d&&(o-=d,u++);let p=e[u].getWidth(o-1)===2;p&&o--;let _=p?n-1:n;s.push(_),h+=_}return s}function rc(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,l=e[t+1].getWidth(0)===2;return s&&l?n-1:n}var $7=class Y7{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Y7._nextId++,this._onDispose=this.register(new ue),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Zs(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};$7._nextId=1;var QB=$7,Nt={},Fs=Nt.B;Nt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Nt.A={"#":"£"};Nt.B=void 0;Nt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Nt.C=Nt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Nt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Nt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Nt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Nt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Nt.E=Nt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Nt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Nt.H=Nt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Nt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var _5=4294967295,v5=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Mt.clone(),this.savedCharset=Fs,this.markers=[],this._nullCell=sn.fromCharData([0,c7,1,0]),this._whitespaceCell=sn.fromCharData([0,ns,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Kh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new g5(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Vh),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Vh),this._whitespaceCell}getBlankLine(e,t){return new Ho(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>_5?_5:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Mt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new g5(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Mt),s=0,l=this._getCorrectBufferLength(t);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)s+=+this.lines.get(u).resize(e,n);let o=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Ho(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ho(e,n)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l<this.lines.maxLength){let u=this.lines.length-l;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=l}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,s=WB(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Mt),n);if(s.length>0){let l=GB(this.lines,s);XB(this.lines,l.layout),this._reflowLargerAdjustViewport(e,t,l.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let s=this.getNullCell(Mt),l=n;for(;l-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Ho(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(Mt),l=[],o=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let d=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),d.unshift(h);if(!n){let N=this.ybase+this.y;if(N>=u&&N<u+d.length)continue}let p=d[d.length-1].getTrimmedLength(),_=ZB(d,this._cols,e),g=_.length-d.length,S;this.ybase===0&&this.y!==this.lines.length-1?S=Math.max(0,this.y-this.lines.maxLength+g):S=Math.max(0,this.lines.length-this.lines.maxLength+g);let v=[];for(let N=0;N<g;N++){let X=this.getBlankLine(Mt,!0);v.push(X)}v.length>0&&(l.push({start:u+d.length+o,newLines:v}),o+=v.length),d.push(...v);let w=_.length-1,x=_[w];x===0&&(w--,x=_[w]);let E=d.length-g-1,M=p;for(;E>=0;){let N=Math.min(M,x);if(d[w]===void 0)break;if(d[w].copyCellsFrom(d[E],M-N,x-N,N,!0),x-=N,x===0&&(w--,x=_[w]),M-=N,M===0){E--;let X=Math.max(E,0);M=rc(d,X,this._cols)}}for(let N=0;N<d.length;N++)_[N]<e&&d[N].setCell(_[N],s);let P=g-S;for(;P-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+g,this.ybase+t-1)}if(l.length>0){let u=[],h=[];for(let x=0;x<this.lines.length;x++)h.push(this.lines.get(x));let d=this.lines.length,p=d-1,_=0,g=l[_];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let S=0;for(let x=Math.min(this.lines.maxLength-1,d+o-1);x>=0;x--)if(g&&g.start>p+S){for(let E=g.newLines.length-1;E>=0;E--)this.lines.set(x--,g.newLines[E]);x++,u.push({index:p+1,amount:g.newLines.length}),S+=g.newLines.length,g=l[++_]}else this.lines.set(x,h[p--]);let v=0;for(let x=u.length-1;x>=0;x--)u[x].index+=v,this.lines.onInsertEmitter.fire(u[x]),v+=u[x].amount;let w=Math.max(0,d+o-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}translateBufferLineToString(e,t,n=0,s){let l=this.lines.get(e);return l?l.translateToString(t,n,s):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new QB(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},JB=class extends Pe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ue),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new v5(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new v5(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},K7=2,W7=1,Gp=class extends Pe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,K7),this.rows=Math.max(e.rawOptions.rows||0,W7),this.buffers=this._register(new JB(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=n.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let l=n.ybase+n.scrollTop,o=n.ybase+n.scrollBottom;if(n.scrollTop===0){let u=n.lines.isFull;o===n.lines.length-1?u?n.lines.recycle().copyFrom(s):n.lines.push(s.clone()):n.lines.splice(o+1,0,s.clone()),u?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let u=o-l+1;n.lines.shiftElements(l+1,u-1,-1),n.lines.set(o,s.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let s=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),s!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Gp=vt([pe(0,gi)],Gp);var ea={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Yh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},ej=["normal","bold","100","200","300","400","500","600","700","800","900"],tj=class extends Pe{constructor(e){super(),this._onOptionChange=this._register(new ue),this.onOptionChange=this._onOptionChange.event;let t={...ea};for(let n in e)if(n in t)try{let s=e[n];t[n]=this._sanitizeAndValidateOption(n,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ht(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in ea))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,s)=>{if(!(n in ea))throw new Error(`No option with key "${n}"`);s=this._sanitizeAndValidateOption(n,s),this.rawOptions[n]!==s&&(this.rawOptions[n]=s,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let s={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ea[e]),!ij(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ea[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=ej.includes(t)?t:ea[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function ij(e){return e==="block"||e==="underline"||e==="bar"}function Io(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let s in e)n[s]=t<=1?e[s]:e[s]&&Io(e[s],t-1);return n}var y5=Object.freeze({insertMode:!1}),S5=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Xp=class extends Pe{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ue),this.onData=this._onData.event,this._onUserInput=this._register(new ue),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ue),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Io(y5),this.decPrivateModes=Io(S5)}reset(){this.modes=Io(y5),this.decPrivateModes=Io(S5)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Xp=vt([pe(0,mi),pe(1,p7),pe(2,gi)],Xp);var b5={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function j0(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var H0=String.fromCharCode,w5={DEFAULT:e=>{let t=[j0(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${H0(t[0])}${H0(t[1])}${H0(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${j0(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${j0(e,!0)};${e.x};${e.y}${t}`}},Zp=class extends Pe{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ue),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(b5))this.addProtocol(s,b5[s]);for(let s of Object.keys(w5))this.addEncoding(s,w5[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let s=t/n,l=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=s+0,Math.abs(e.deltaY)<50&&(l*=.3),this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Zp=vt([pe(0,mi),pe(1,il),pe(2,gi)],Zp);var I0=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],nj=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Rt;function rj(e,t){let n=0,s=t.length-1,l;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=n;)if(l=n+s>>1,e>t[l][1])n=l+1;else if(e<t[l][0])s=l-1;else return!0;return!1}var sj=class{constructor(){if(this.version="6",!Rt){Rt=new Uint8Array(65536),Rt.fill(1),Rt[0]=0,Rt.fill(0,1,32),Rt.fill(0,127,160),Rt.fill(2,4352,4448),Rt[9001]=2,Rt[9002]=2,Rt.fill(2,11904,42192),Rt[12351]=1,Rt.fill(2,44032,55204),Rt.fill(2,63744,64256),Rt.fill(2,65040,65050),Rt.fill(2,65072,65136),Rt.fill(2,65280,65377),Rt.fill(2,65504,65511);for(let e=0;e<I0.length;++e)Rt.fill(0,I0[e][0],I0[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Rt[e]:rj(e,nj)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),s=n===0&&t!==0;if(s){let l=Vs.extractWidth(t);l===0?s=!1:l>n&&(n=l)}return Vs.createPropertyValue(0,n,s)}},Vs=class yh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ue,this.onChange=this._onChange.event;let t=new sj;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,s=!1){return(t&16777215)<<3|(n&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,s=0,l=t.length;for(let o=0;o<l;++o){let u=t.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=l)return n+this.wcwidth(u);let p=t.charCodeAt(o);56320<=p&&p<=57343?u=(u-55296)*1024+p-56320+65536:n+=this.wcwidth(p)}let h=this.charProperties(u,s),d=yh.extractWidth(h);yh.extractShouldJoin(h)&&(d-=yh.extractWidth(s)),n+=d,s=h}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},lj=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function x5(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Ro=2147483647,aj=256,G7=class Qp{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>aj)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new Qp;if(!t.length)return n;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let l=t[s];if(Array.isArray(l))for(let o=0;o<l.length;++o)n.addSubParam(l[o]);else n.addParam(l)}return n}clone(){let t=new Qp(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let s=this._subParamsIdx[n]>>8,l=this._subParamsIdx[n]&255;l-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,l))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Ro?Ro:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Ro?Ro:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-n>0?this._subParams.subarray(n,s):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let s=this._subParamsIdx[n]>>8,l=this._subParamsIdx[n]&255;l-s>0&&(t[n]=this._subParams.slice(s,l))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,l=s[n-1];s[n-1]=~l?Math.min(l*10+t,Ro):t}},Lo=[],oj=class{constructor(){this._state=0,this._active=Lo,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Lo}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Lo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Lo,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",yf(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,s=this._active.length-1,l=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;s>=0&&(n=this._active[s].end(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=Lo,this._id=-1,this._state=0}}},Ii=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=yf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},No=[],cj=class{constructor(){this._handlers=Object.create(null),this._active=No,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=No}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=No,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||No,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",yf(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,s=this._active.length-1,l=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;s>=0&&(n=this._active[s].unhook(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=No,this._ident=0}},Po=new G7;Po.addParam(0);var C5=class{constructor(e){this._handler=e,this._data="",this._params=Po,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Po,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=yf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=Po,this._data="",this._hitLimit=!1,n));return this._params=Po,this._data="",this._hitLimit=!1,t}},uj=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,s){this.table[t<<8|e]=n<<4|s}addMany(e,t,n,s){for(let l=0;l<e.length;l++)this.table[t<<8|e[l]]=n<<4|s}},nn=160,hj=(function(){let e=new uj(4095),t=Array.apply(null,Array(256)).map((h,d)=>d),n=(h,d)=>t.slice(h,d),s=n(32,127),l=n(0,24);l.push(25),l.push.apply(l,n(28,32));let o=n(0,14),u;e.setDefault(1,0),e.addMany(s,0,2,0);for(u in o)e.addMany([24,26,153,154],u,3,0),e.addMany(n(128,144),u,3,0),e.addMany(n(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(l,0,3,0),e.addMany(l,1,3,1),e.add(127,1,0,1),e.addMany(l,8,0,8),e.addMany(l,3,3,3),e.add(127,3,0,3),e.addMany(l,4,3,4),e.add(127,4,0,4),e.addMany(l,6,3,6),e.addMany(l,5,3,5),e.add(127,5,0,5),e.addMany(l,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(l,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(l,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(l,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(l,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(l,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(l,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(nn,0,2,0),e.add(nn,8,5,8),e.add(nn,6,0,6),e.add(nn,11,0,11),e.add(nn,13,13,13),e})(),fj=class extends Pe{constructor(e=hj){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new G7,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ht(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new oj),this._dcsParser=this._register(new cj),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let l=0;l<e.intermediates.length;++l){let o=e.intermediates.charCodeAt(l);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=s,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let s=this._escHandlers[n];return s.push(t),{dispose:()=>{let l=s.indexOf(t);l!==-1&&s.splice(l,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let s=this._csiHandlers[n];return s.push(t),{dispose:()=>{let l=s.indexOf(t);l!==-1&&s.splice(l,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,s,l){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=s,this._parseStack.chunkPos=l}parse(e,t,n){let s=0,l=0,o=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(u=h[d](this._params),u!==!0);d--)if(u instanceof Promise)return this._parseStack.handlerPos=d,u}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(u=h[d](),u!==!0);d--)if(u instanceof Promise)return this._parseStack.handlerPos=d,u}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(s!==24&&s!==26,n),u)return u;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],u=this._oscParser.end(s!==24&&s!==26,n),u)return u;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=o;h<t;++h){switch(s=e[h],l=this._transitions.table[this.currentState<<8|(s<160?s:nn)],l>>4){case 2:for(let S=h+1;;++S){if(S>=t||(s=e[S])<32||s>126&&s<nn){this._printHandler(e,h,S),h=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<nn){this._printHandler(e,h,S),h=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<nn){this._printHandler(e,h,S),h=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<nn){this._printHandler(e,h,S),h=S-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|s],p=d?d.length-1:-1;for(;p>=0&&(u=d[p](this._params),u!==!0);p--)if(u instanceof Promise)return this._preserveStack(3,d,p,l,h),u;p<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++h<t&&(s=e[h])>47&&s<60);h--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let _=this._escHandlers[this._collect<<8|s],g=_?_.length-1:-1;for(;g>=0&&(u=_[g](),u!==!0);g--)if(u instanceof Promise)return this._preserveStack(4,_,g,l,h),u;g<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let S=h+1;;++S)if(S>=t||(s=e[S])===24||s===26||s===27||s>127&&s<nn){this._dcsParser.put(e,h,S),h=S-1;break}break;case 14:if(u=this._dcsParser.unhook(s!==24&&s!==26),u)return this._preserveStack(6,[],0,l,h),u;s===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let S=h+1;;S++)if(S>=t||(s=e[S])<32||s>127&&s<nn){this._oscParser.put(e,h,S),h=S-1;break}break;case 6:if(u=this._oscParser.end(s!==24&&s!==26),u)return this._preserveStack(5,[],0,l,h),u;s===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=l&15}}},dj=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,pj=/^[\da-f]+$/;function E5(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=dj.exec(t);if(n){let s=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/s*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/s*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),pj.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,s=[0,0,0];for(let l=0;l<3;++l){let o=parseInt(t.slice(n*l,n*l+n),16);s[l]=n===1?o<<4:n===2?o:n===3?o>>4:o>>8}return s}}function P0(e,t){let n=e.toString(16),s=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function mj(e,t=16){let[n,s,l]=e;return`rgb:${P0(n,t)}/${P0(s,t)}/${P0(l,t)}`}var gj={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Zr=131072,k5=10;function T5(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var M5=5e3,A5=0,_j=class extends Pe{constructor(e,t,n,s,l,o,u,h,d=new fj){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=s,this._optionsService=l,this._oscLinkService=o,this._coreMouseService=u,this._unicodeService=h,this._parser=d,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new BN,this._utf8Decoder=new jN,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Mt.clone(),this._eraseAttrDataInternal=Mt.clone(),this._onRequestBell=this._register(new ue),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ue),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ue),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ue),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ue),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ue),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ue),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ue),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ue),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ue),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ue),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ue),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Jp(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._parser.setCsiHandlerFallback((p,_)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(p),params:_.toArray()})}),this._parser.setEscHandlerFallback(p=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(p)})}),this._parser.setExecuteHandlerFallback(p=>{this._logService.debug("Unknown EXECUTE code: ",{code:p})}),this._parser.setOscHandlerFallback((p,_,g)=>{this._logService.debug("Unknown OSC code: ",{identifier:p,action:_,data:g})}),this._parser.setDcsHandlerFallback((p,_,g)=>{_==="HOOK"&&(g=g.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(p),action:_,payload:g})}),this._parser.setPrintHandler((p,_,g)=>this.print(p,_,g)),this._parser.registerCsiHandler({final:"@"},p=>this.insertChars(p)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},p=>this.scrollLeft(p)),this._parser.registerCsiHandler({final:"A"},p=>this.cursorUp(p)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},p=>this.scrollRight(p)),this._parser.registerCsiHandler({final:"B"},p=>this.cursorDown(p)),this._parser.registerCsiHandler({final:"C"},p=>this.cursorForward(p)),this._parser.registerCsiHandler({final:"D"},p=>this.cursorBackward(p)),this._parser.registerCsiHandler({final:"E"},p=>this.cursorNextLine(p)),this._parser.registerCsiHandler({final:"F"},p=>this.cursorPrecedingLine(p)),this._parser.registerCsiHandler({final:"G"},p=>this.cursorCharAbsolute(p)),this._parser.registerCsiHandler({final:"H"},p=>this.cursorPosition(p)),this._parser.registerCsiHandler({final:"I"},p=>this.cursorForwardTab(p)),this._parser.registerCsiHandler({final:"J"},p=>this.eraseInDisplay(p,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},p=>this.eraseInDisplay(p,!0)),this._parser.registerCsiHandler({final:"K"},p=>this.eraseInLine(p,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},p=>this.eraseInLine(p,!0)),this._parser.registerCsiHandler({final:"L"},p=>this.insertLines(p)),this._parser.registerCsiHandler({final:"M"},p=>this.deleteLines(p)),this._parser.registerCsiHandler({final:"P"},p=>this.deleteChars(p)),this._parser.registerCsiHandler({final:"S"},p=>this.scrollUp(p)),this._parser.registerCsiHandler({final:"T"},p=>this.scrollDown(p)),this._parser.registerCsiHandler({final:"X"},p=>this.eraseChars(p)),this._parser.registerCsiHandler({final:"Z"},p=>this.cursorBackwardTab(p)),this._parser.registerCsiHandler({final:"`"},p=>this.charPosAbsolute(p)),this._parser.registerCsiHandler({final:"a"},p=>this.hPositionRelative(p)),this._parser.registerCsiHandler({final:"b"},p=>this.repeatPrecedingCharacter(p)),this._parser.registerCsiHandler({final:"c"},p=>this.sendDeviceAttributesPrimary(p)),this._parser.registerCsiHandler({prefix:">",final:"c"},p=>this.sendDeviceAttributesSecondary(p)),this._parser.registerCsiHandler({final:"d"},p=>this.linePosAbsolute(p)),this._parser.registerCsiHandler({final:"e"},p=>this.vPositionRelative(p)),this._parser.registerCsiHandler({final:"f"},p=>this.hVPosition(p)),this._parser.registerCsiHandler({final:"g"},p=>this.tabClear(p)),this._parser.registerCsiHandler({final:"h"},p=>this.setMode(p)),this._parser.registerCsiHandler({prefix:"?",final:"h"},p=>this.setModePrivate(p)),this._parser.registerCsiHandler({final:"l"},p=>this.resetMode(p)),this._parser.registerCsiHandler({prefix:"?",final:"l"},p=>this.resetModePrivate(p)),this._parser.registerCsiHandler({final:"m"},p=>this.charAttributes(p)),this._parser.registerCsiHandler({final:"n"},p=>this.deviceStatus(p)),this._parser.registerCsiHandler({prefix:"?",final:"n"},p=>this.deviceStatusPrivate(p)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},p=>this.softReset(p)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},p=>this.setCursorStyle(p)),this._parser.registerCsiHandler({final:"r"},p=>this.setScrollRegion(p)),this._parser.registerCsiHandler({final:"s"},p=>this.saveCursor(p)),this._parser.registerCsiHandler({final:"t"},p=>this.windowOptions(p)),this._parser.registerCsiHandler({final:"u"},p=>this.restoreCursor(p)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},p=>this.insertColumns(p)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},p=>this.deleteColumns(p)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},p=>this.selectProtected(p)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},p=>this.requestMode(p,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},p=>this.requestMode(p,!1)),this._parser.setExecuteHandler(re.BEL,()=>this.bell()),this._parser.setExecuteHandler(re.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(re.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(re.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(re.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(re.BS,()=>this.backspace()),this._parser.setExecuteHandler(re.HT,()=>this.tab()),this._parser.setExecuteHandler(re.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(re.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(_h.IND,()=>this.index()),this._parser.setExecuteHandler(_h.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(_h.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ii(p=>(this.setTitle(p),this.setIconName(p),!0))),this._parser.registerOscHandler(1,new Ii(p=>this.setIconName(p))),this._parser.registerOscHandler(2,new Ii(p=>this.setTitle(p))),this._parser.registerOscHandler(4,new Ii(p=>this.setOrReportIndexedColor(p))),this._parser.registerOscHandler(8,new Ii(p=>this.setHyperlink(p))),this._parser.registerOscHandler(10,new Ii(p=>this.setOrReportFgColor(p))),this._parser.registerOscHandler(11,new Ii(p=>this.setOrReportBgColor(p))),this._parser.registerOscHandler(12,new Ii(p=>this.setOrReportCursorColor(p))),this._parser.registerOscHandler(104,new Ii(p=>this.restoreIndexedColor(p))),this._parser.registerOscHandler(110,new Ii(p=>this.restoreFgColor(p))),this._parser.registerOscHandler(111,new Ii(p=>this.restoreBgColor(p))),this._parser.registerOscHandler(112,new Ii(p=>this.restoreCursorColor(p))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let p in Nt)this._parser.registerEscHandler({intermediates:"(",final:p},()=>this.selectCharset("("+p)),this._parser.registerEscHandler({intermediates:")",final:p},()=>this.selectCharset(")"+p)),this._parser.registerEscHandler({intermediates:"*",final:p},()=>this.selectCharset("*"+p)),this._parser.registerEscHandler({intermediates:"+",final:p},()=>this.selectCharset("+"+p)),this._parser.registerEscHandler({intermediates:"-",final:p},()=>this.selectCharset("-"+p)),this._parser.registerEscHandler({intermediates:".",final:p},()=>this.selectCharset("."+p)),this._parser.registerEscHandler({intermediates:"/",final:p},()=>this.selectCharset("/"+p));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(p=>(this._logService.error("Parsing error: ",p),p)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new C5((p,_)=>this.requestStatusString(p,_)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),M5))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${M5} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,s=this._activeBuffer.x,l=this._activeBuffer.y,o=0,u=this._parseStack.paused;if(u){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;s=this._parseStack.cursorStartX,l=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Zr&&(o=this._parseStack.position+Zr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,p=>String.fromCharCode(p)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(p=>p.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Zr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Zr))),u||this._dirtyRowTracker.clearRange(),e.length>Zr)for(let p=o;p<e.length;p+=Zr){let _=p+Zr<e.length?p+Zr:e.length,g=typeof e=="string"?this._stringDecoder.decode(e.substring(p,_),this._parseBuffer):this._utf8Decoder.decode(e.subarray(p,_),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,g))return this._preserveStack(s,l,g,p),this._logSlowResolvingAsync(n),n}else if(!u){let p=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(s,l,p,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==s||this._activeBuffer.y!==l)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),d=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);d<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(d,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,n){let s,l,o=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,d=this._coreService.decPrivateModes.wraparound,p=this._coreService.modes.insertMode,_=this._curAttrData,g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&g.getWidth(this._activeBuffer.x-1)===2&&g.setCellFromCodepoint(this._activeBuffer.x-1,0,1,_);let S=this._parser.precedingJoinState;for(let v=t;v<n;++v){if(s=e[v],s<127&&o){let M=o[String.fromCharCode(s)];M&&(s=M.charCodeAt(0))}let w=this._unicodeService.charProperties(s,S);l=Vs.extractWidth(w);let x=Vs.extractShouldJoin(w),E=x?Vs.extractWidth(S):0;if(S=w,u&&this._onA11yChar.fire(Jr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+l-E>h){if(d){let M=g,P=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&g instanceof Ho&&g.copyCellsFrom(M,P,0,E,!1);P<h;)M.setCellFromCodepoint(P++,0,1,_)}else if(this._activeBuffer.x=h-1,l===2)continue}if(x&&this._activeBuffer.x){let M=g.getWidth(this._activeBuffer.x-1)?1:2;g.addCodepointToCell(this._activeBuffer.x-M,s,l);for(let P=l-E;--P>=0;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,_);continue}if(p&&(g.insertCells(this._activeBuffer.x,l-E,this._activeBuffer.getNullCell(_)),g.getWidth(h-1)===2&&g.setCellFromCodepoint(h-1,0,1,_)),g.setCellFromCodepoint(this._activeBuffer.x++,s,l,_),l>0)for(;--l;)g.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}this._parser.precedingJoinState=S,this._activeBuffer.x<h&&n-t>0&&g.getWidth(this._activeBuffer.x)===0&&!g.hasContent(this._activeBuffer.x)&&g.setCellFromCodepoint(this._activeBuffer.x,0,1,_),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>T5(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new C5(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ii(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,s=!1,l=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),l),s&&(o.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(l-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Mt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,s=Vs.extractWidth(t),l=this._activeBuffer.x-s,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(l),u=new Uint32Array(o.length*n),h=0;for(let p=0;p<o.length;){let _=o.codePointAt(p)||0;u[h++]=_,p+=_>65535?2:1}let d=h;for(let p=1;p<n;++p)u.copyWithin(d,0,h),d+=h;return this.print(u,0,d),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(re.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(re.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(re.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(re.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(re.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Fs),this._charsetService.setgCharset(1,Fs),this._charsetService.setgCharset(2,Fs),this._charsetService.setgCharset(3,Fs);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let n;(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let s=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:o}=this._coreMouseService,u=this._coreService,{buffers:h,cols:d}=this._bufferService,{active:p,alt:_}=h,g=this._optionsService.rawOptions,S=(x,E)=>(u.triggerDataEvent(`${re.ESC}[${t?"":"?"}${x};${E}$y`),!0),v=x=>x?1:2,w=e.params[0];return t?w===2?S(w,4):w===4?S(w,v(u.modes.insertMode)):w===12?S(w,3):w===20?S(w,v(g.convertEol)):S(w,0):w===1?S(w,v(s.applicationCursorKeys)):w===3?S(w,g.windowOptions.setWinLines?d===80?2:d===132?1:0:0):w===6?S(w,v(s.origin)):w===7?S(w,v(s.wraparound)):w===8?S(w,3):w===9?S(w,v(l==="X10")):w===12?S(w,v(g.cursorBlink)):w===25?S(w,v(!u.isCursorHidden)):w===45?S(w,v(s.reverseWraparound)):w===66?S(w,v(s.applicationKeypad)):w===67?S(w,4):w===1e3?S(w,v(l==="VT200")):w===1002?S(w,v(l==="DRAG")):w===1003?S(w,v(l==="ANY")):w===1004?S(w,v(s.sendFocus)):w===1005?S(w,4):w===1006?S(w,v(o==="SGR")):w===1015?S(w,4):w===1016?S(w,v(o==="SGR_PIXELS")):w===1048?S(w,1):w===47||w===1047||w===1049?S(w,v(p===_)):w===2004?S(w,v(s.bracketedPasteMode)):w===2026?S(w,v(s.synchronizedOutput)):S(w,0)}_updateAttrColor(e,t,n,s,l){return t===2?(e|=50331648,e&=-16777216,e|=pc.fromColorRGB([n,s,l])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let s=[0,0,-1,0,0,0],l=0,o=0;do{if(s[o+l]=e.params[t+o],e.hasSubParams(t+o)){let u=e.getSubParams(t+o),h=0;do s[1]===5&&(l=1),s[o+h+1+l]=u[h];while(++h<u.length&&h+o+1+l<s.length);break}if(s[1]===5&&o+l>=2||s[1]===2&&o+l>=5)break;s[1]&&(l=1)}while(++o+t<e.length&&o+l<s.length);for(let u=2;u<s.length;++u)s[u]===-1&&(s[u]=0);switch(s[0]){case 38:n.fg=this._updateAttrColor(n.fg,s[1],s[3],s[4],s[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,s[1],s[3],s[4],s[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Mt.fg,e.bg=Mt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,s=this._curAttrData;for(let l=0;l<t;l++)n=e.params[l],n>=30&&n<=37?(s.fg&=-50331904,s.fg|=16777216|n-30):n>=40&&n<=47?(s.bg&=-50331904,s.bg|=16777216|n-40):n>=90&&n<=97?(s.fg&=-50331904,s.fg|=16777216|n-90|8):n>=100&&n<=107?(s.bg&=-50331904,s.bg|=16777216|n-100|8):n===0?this._processSGR0(s):n===1?s.fg|=134217728:n===3?s.bg|=67108864:n===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(l)?e.getSubParams(l)[0]:1,s)):n===5?s.fg|=536870912:n===7?s.fg|=67108864:n===8?s.fg|=1073741824:n===9?s.fg|=2147483648:n===2?s.bg|=134217728:n===21?this._processUnderline(2,s):n===22?(s.fg&=-134217729,s.bg&=-134217729):n===23?s.bg&=-67108865:n===24?(s.fg&=-268435457,this._processUnderline(0,s)):n===25?s.fg&=-536870913:n===27?s.fg&=-67108865:n===28?s.fg&=-1073741825:n===29?s.fg&=2147483647:n===39?(s.fg&=-67108864,s.fg|=Mt.fg&16777215):n===49?(s.bg&=-67108864,s.bg|=Mt.bg&16777215):n===38||n===48||n===58?l+=this._extractColor(e,l,s):n===53?s.bg|=1073741824:n===55?s.bg&=-1073741825:n===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):n===100?(s.fg&=-67108864,s.fg|=Mt.fg&16777215,s.bg&=-67108864,s.bg|=Mt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${re.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${re.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${re.ESC}[?${t};${n}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Mt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!T5(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${re.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>k5&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>k5&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let s=n.shift(),l=n.shift();if(/^\d+$/.exec(s)){let o=parseInt(s);if(D5(o))if(l==="?")t.push({type:0,index:o});else{let u=E5(l);u&&t.push({type:1,index:o,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(n,s):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),s,l=n.findIndex(o=>o.startsWith("id="));return l!==-1&&(s=n[l].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let s=0;s<n.length&&!(t>=this._specialColors.length);++s,++t)if(n[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let l=E5(n[s]);l&&this._onColor.fire([{type:1,index:this._specialColors[t],color:l}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let s=0;s<n.length;++s)if(/^\d+$/.exec(n[s])){let l=parseInt(n[s]);D5(l)&&t.push({type:2,index:l})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Fs),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(gj[e[0]],Nt[e[1]]||Fs),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Mt.clone(),this._eraseAttrDataInternal=Mt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new sn;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(n);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=u=>(this._coreService.triggerDataEvent(`${re.ESC}${u}${re.ESC}\\`),!0),s=this._bufferService.buffer,l=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[l.cursorStyle]-(l.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Jp=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(A5=e,e=t,t=A5),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Jp=vt([pe(0,mi)],Jp);function D5(e){return 0<=e&&e<256}var vj=5e7,O5=12,yj=50,Sj=class extends Pe{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ue),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>vj)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],l=this._action(s,t);if(l){let u=h=>performance.now()-n>=O5?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(n,h);l.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(u);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-n>=O5)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>yj&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},em=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),d={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(d,h)),this._dataByLinkId.set(d.id,d),d.id}let n=e,s=this._getEntryIdKey(n),l=this._entriesWithId.get(s);if(l)return this.addLineToLink(l.id,t.ybase+t.y),l.id;let o=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(u,o)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);n.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(n,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};em=vt([pe(0,mi)],em);var R5=!1,bj=class extends Pe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new fa),this._onBinary=this._register(new ue),this.onBinary=this._onBinary.event,this._onData=this._register(new ue),this.onData=this._onData.event,this._onLineFeed=this._register(new ue),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ue),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ue),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ue),this._instantiationService=new $B,this.optionsService=this._register(new tj(e)),this._instantiationService.setService(gi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Gp)),this._instantiationService.setService(mi,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Wp)),this._instantiationService.setService(p7,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Xp)),this._instantiationService.setService(il,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Zp)),this._instantiationService.setService(d7,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Vs)),this._instantiationService.setService(FN,this.unicodeService),this._charsetService=this._instantiationService.createInstance(lj),this._instantiationService.setService(PN,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(em),this._instantiationService.setService(m7,this._oscLinkService),this._inputHandler=this._register(new _j(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ni.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ni.forward(this._bufferService.onResize,this._onResize)),this._register(ni.forward(this.coreService.onData,this._onData)),this._register(ni.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Sj((t,n)=>this._inputHandler.parse(t,n))),this._register(ni.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ue),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!R5&&(this._logService.warn("writeSync is unreliable and will be removed soon."),R5=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,K7),t=Math.max(t,W7),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(x5.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(x5(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ht(()=>{for(let t of e)t.dispose()})}}},wj={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function xj(e,t,n,s){let l={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?l.key=re.ESC+"OA":l.key=re.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?l.key=re.ESC+"OD":l.key=re.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?l.key=re.ESC+"OC":l.key=re.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?l.key=re.ESC+"OB":l.key=re.ESC+"[B");break;case 8:l.key=e.ctrlKey?"\b":re.DEL,e.altKey&&(l.key=re.ESC+l.key);break;case 9:if(e.shiftKey){l.key=re.ESC+"[Z";break}l.key=re.HT,l.cancel=!0;break;case 13:l.key=e.altKey?re.ESC+re.CR:re.CR,l.cancel=!0;break;case 27:l.key=re.ESC,e.altKey&&(l.key=re.ESC+re.ESC),l.cancel=!0;break;case 37:if(e.metaKey)break;o?l.key=re.ESC+"[1;"+(o+1)+"D":t?l.key=re.ESC+"OD":l.key=re.ESC+"[D";break;case 39:if(e.metaKey)break;o?l.key=re.ESC+"[1;"+(o+1)+"C":t?l.key=re.ESC+"OC":l.key=re.ESC+"[C";break;case 38:if(e.metaKey)break;o?l.key=re.ESC+"[1;"+(o+1)+"A":t?l.key=re.ESC+"OA":l.key=re.ESC+"[A";break;case 40:if(e.metaKey)break;o?l.key=re.ESC+"[1;"+(o+1)+"B":t?l.key=re.ESC+"OB":l.key=re.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(l.key=re.ESC+"[2~");break;case 46:o?l.key=re.ESC+"[3;"+(o+1)+"~":l.key=re.ESC+"[3~";break;case 36:o?l.key=re.ESC+"[1;"+(o+1)+"H":t?l.key=re.ESC+"OH":l.key=re.ESC+"[H";break;case 35:o?l.key=re.ESC+"[1;"+(o+1)+"F":t?l.key=re.ESC+"OF":l.key=re.ESC+"[F";break;case 33:e.shiftKey?l.type=2:e.ctrlKey?l.key=re.ESC+"[5;"+(o+1)+"~":l.key=re.ESC+"[5~";break;case 34:e.shiftKey?l.type=3:e.ctrlKey?l.key=re.ESC+"[6;"+(o+1)+"~":l.key=re.ESC+"[6~";break;case 112:o?l.key=re.ESC+"[1;"+(o+1)+"P":l.key=re.ESC+"OP";break;case 113:o?l.key=re.ESC+"[1;"+(o+1)+"Q":l.key=re.ESC+"OQ";break;case 114:o?l.key=re.ESC+"[1;"+(o+1)+"R":l.key=re.ESC+"OR";break;case 115:o?l.key=re.ESC+"[1;"+(o+1)+"S":l.key=re.ESC+"OS";break;case 116:o?l.key=re.ESC+"[15;"+(o+1)+"~":l.key=re.ESC+"[15~";break;case 117:o?l.key=re.ESC+"[17;"+(o+1)+"~":l.key=re.ESC+"[17~";break;case 118:o?l.key=re.ESC+"[18;"+(o+1)+"~":l.key=re.ESC+"[18~";break;case 119:o?l.key=re.ESC+"[19;"+(o+1)+"~":l.key=re.ESC+"[19~";break;case 120:o?l.key=re.ESC+"[20;"+(o+1)+"~":l.key=re.ESC+"[20~";break;case 121:o?l.key=re.ESC+"[21;"+(o+1)+"~":l.key=re.ESC+"[21~";break;case 122:o?l.key=re.ESC+"[23;"+(o+1)+"~":l.key=re.ESC+"[23~";break;case 123:o?l.key=re.ESC+"[24;"+(o+1)+"~":l.key=re.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?l.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?l.key=re.NUL:e.keyCode>=51&&e.keyCode<=55?l.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?l.key=re.DEL:e.keyCode===219?l.key=re.ESC:e.keyCode===220?l.key=re.FS:e.keyCode===221&&(l.key=re.GS);else if((!n||s)&&e.altKey&&!e.metaKey){let u=wj[e.keyCode]?.[e.shiftKey?1:0];if(u)l.key=re.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),l.key=re.ESC+d}else if(e.keyCode===32)l.key=re.ESC+(e.ctrlKey?re.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),l.key=re.ESC+h,l.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(l.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?l.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(l.key=re.US),e.key==="@"&&(l.key=re.NUL));break}return l}var St=0,Cj=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Kh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Kh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((l,o)=>this._getKey(l)-this._getKey(o)),t=0,n=0,s=new Array(this._array.length+this._insertedValues.length);for(let l=0;l<s.length;l++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(s[l]=e[t],t++):s[l]=this._array[n++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(St=this._search(t),St===-1)||this._getKey(this._array[St])!==t)return!1;do if(this._array[St]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(St),!0;while(++St<this._array.length&&this._getKey(this._array[St])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((l,o)=>l-o),t=0,n=new Array(this._array.length-e.length),s=0;for(let l=0;l<this._array.length;l++)e[t]===l?t++:n[s++]=this._array[l];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(St=this._search(e),!(St<0||St>=this._array.length)&&this._getKey(this._array[St])===e))do yield this._array[St];while(++St<this._array.length&&this._getKey(this._array[St])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(St=this._search(e),!(St<0||St>=this._array.length)&&this._getKey(this._array[St])===e))do t(this._array[St]);while(++St<this._array.length&&this._getKey(this._array[St])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let s=t+n>>1,l=this._getKey(this._array[s]);if(l>e)n=s-1;else if(l<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},F0=0,L5=0,Ej=class extends Pe{constructor(){super(),this._decorations=new Cj(e=>e?.marker.line),this._onDecorationRegistered=this._register(new ue),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ue),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ht(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new kj(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let s=0,l=0;for(let o of this._decorations.getKeyIterator(t))s=o.options.x??0,l=s+(o.options.width??1),e>=s&&e<l&&(!n||(o.options.layer??"bottom")===n)&&(yield o)}forEachDecorationAtCell(e,t,n,s){this._decorations.forEachByKey(t,l=>{F0=l.options.x??0,L5=F0+(l.options.width??1),e>=F0&&e<L5&&(!n||(l.options.layer??"bottom")===n)&&s(l)})}},kj=class extends as{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ue),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ue),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=pt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=pt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Tj=1e3,Mj=class{constructor(e,t=Tj){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let l=s-this._lastRefreshMs,o=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},N5=20,Wh=class extends Pe{constructor(e,t,n,s){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let l=this._coreBrowserService.mainDocument;this._accessibilityContainer=l.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=l.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=l.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Mj(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
77
+ `))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ae(l,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ht(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<N5+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
78
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===N5+1&&(this._liveRegion.textContent+=Sp.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,s=n.lines.length.toString();for(let l=e;l<=t;l++){let o=n.lines.get(n.ydisp+l),u=[],h=o?.translateToString(!0,void 0,void 0,u)||"",d=(n.ydisp+l+1).toString(),p=this._rowElements[l];p&&(h.length===0?(p.textContent=" ",this._rowColumns.set(p,[0,1])):(p.textContent=h,this._rowColumns.set(p,u)),p.setAttribute("aria-posinset",d),p.setAttribute("aria-setsize",s),this._alignRowWidth(p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],l=n.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(l===o||e.relatedTarget!==s)return;let u,h;if(t===0?(u=n,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=n,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let d=this._createAccessibilityTreeNode();this._rowElements.unshift(d),this._rowContainer.insertAdjacentElement("afterbegin",d)}else{let d=this._createAccessibilityTreeNode();this._rowElements.push(d),this._rowContainer.appendChild(d)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let l=({node:h,offset:d})=>{let p=h instanceof Text?h.parentNode:h,_=parseInt(p?.getAttribute("aria-posinset"),10)-1;if(isNaN(_))return console.warn("row is invalid. Race condition?"),null;let g=this._rowColumns.get(p);if(!g)return console.warn("columns is null. Race condition?"),null;let S=d<g.length?g[d]:g.slice(-1)[0]+1;return S>=this._terminal.cols&&(++_,S=0),{row:_,column:S}},o=l(t),u=l(n);if(!(!o||!u)){if(o.row>u.row||o.row===u.row&&o.column>=u.column)throw new Error("invalid range");this._terminal.select(o.column,o.row,(u.row-o.row)*this._terminal.cols-o.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let s=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Wh=vt([pe(1,Hg),pe(2,mr),pe(3,gr)],Wh);var tm=class extends Pe{constructor(e,t,n,s,l){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=s,this._linkProviderService=l,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ue),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ue),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ht(()=>{Zs(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ae(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ae(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ae(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ae(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let s=0;s<n.length;s++){let l=n[s];if(l.classList.contains("xterm"))break;if(l.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[s,l]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(n=this._checkLinkProviderResult(s,e,n)):l.provideLinks(e.y,o=>{if(this._isMouseOut)return;let u=o?.map(h=>({link:h}));this._activeProviderReplies?.set(s,u),n=this._checkLinkProviderResult(s,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let s=0;s<t.size;s++){let l=t.get(s);if(l)for(let o=0;o<l.length;o++){let u=l[o],h=u.link.range.start.y<e?0:u.link.range.start.x,d=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let p=h;p<=d;p++){if(n.has(p)){l.splice(o--,1);break}n.add(p)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let s=this._activeProviderReplies.get(e),l=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(l=!0);if(!l&&s){let o=s.find(u=>this._linkAtPosition(u.link,t));o&&(n=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let o=0;o<this._activeProviderReplies.size;o++){let u=this._activeProviderReplies.get(o)?.find(h=>this._linkAtPosition(h.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Aj(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Zs(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let s=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=l&&(this._clearCurrentLink(s,l),this._lastMouseEvent)){let o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,s=this._bufferService.buffer.ydisp,l=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-s-1,n.end.x,n.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(l)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,l=t.y*this._bufferService.cols+t.x;return n<=l&&l<=s}_positionFromMouseEvent(e,t,n){let s=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,s,l){return{x1:e,y1:t,x2:n,y2:s,cols:this._bufferService.cols,fg:l}}};tm=vt([pe(1,Ig),pe(2,gr),pe(3,mi),pe(4,_7)],tm);function Aj(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Dj=class extends bj{constructor(e={}){super(e),this._linkifier=this._register(new fa),this.browser=B7,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new fa),this._onCursorMove=this._register(new ue),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ue),this.onKey=this._onKey.event,this._onRender=this._register(new ue),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ue),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ue),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ue),this.onBell=this._onBell.event,this._onFocus=this._register(new ue),this._onBlur=this._register(new ue),this._onA11yCharEmitter=this._register(new ue),this._onA11yTabEmitter=this._register(new ue),this._onWillOpen=this._register(new ue),this._setup(),this._decorationService=this._instantiationService.createInstance(Ej),this._instantiationService.setService(mc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(yB),this._instantiationService.setService(_7,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(wp)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ni.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ni.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ni.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ni.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ht(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,s="";switch(t.index){case 256:n="foreground",s="10";break;case 257:n="background",s="11";break;case 258:n="cursor",s="12";break;default:n="ansi",s="4;"+t.index}switch(t.type){case 0:let l=ct.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${re.ESC}]${s};${mj(l)}${N7.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=At.toColor(...t.color));else{let o=n;this._themeService.modifyColors(u=>u[o]=At.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Wh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,l=t.getWidth(n),o=this._renderService.dimensions.css.cell.width*l,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=u+"px",this.textarea.style.width=o+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ae(this.element,"copy",t=>{this.hasSelection()&&NN(t,this._selectionService)}));let e=t=>zN(t,this.textarea,this.coreService,this.optionsService);this._register(Ae(this.textarea,"paste",e)),this._register(Ae(this.element,"paste",e)),j7?this._register(Ae(this.element,"mousedown",t=>{t.button===2&&q4(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ae(this.element,"contextmenu",t=>{q4(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Kg&&this._register(Ae(this.element,"auxclick",t=>{t.button===1&&o7(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ae(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ae(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ae(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ae(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ae(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ae(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ae(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ae(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",yp.get()),P7||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(_B,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(mr,this._coreBrowserService),this._register(Ae(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Ae(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Vp,this._document,this._helperContainer),this._instantiationService.setService(Sf,this._charSizeService),this._themeService=this._instantiationService.createInstance(Kp),this._instantiationService.setService(Sa,this._themeService),this._characterJoinerService=this._instantiationService.createInstance($h),this._instantiationService.setService(g7,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance($p,this.rows,this.screenElement)),this._instantiationService.setService(gr,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Pp,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(qp),this._instantiationService.setService(Ig,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(tm,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Hp,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Yp,this.element,this.screenElement,s)),this._instantiationService.setService(VN,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(ni.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Ip,this.screenElement)),this._register(Ae(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Wh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(qh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(qh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Up,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(o){let u=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!u)return!1;let h,d;switch(o.overrideType||o.type){case"mousemove":d=32,o.buttons===void 0?(h=3,o.button!==void 0&&(h=o.button<3?o.button:3)):h=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":d=0,h=o.button<3?o.button:3;break;case"mousedown":d=1,h=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let p=o.deltaY;if(p===0||e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;d=p<0?0:1,h=4;break;default:return!1}return d===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:h,action:d,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},l={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),o&8?s.mousemove||(t.addEventListener("mousemove",l.mousemove),s.mousemove=l.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),o&16?s.wheel||(t.addEventListener("wheel",l.wheel,{passive:!1}),s.wheel=l.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),o&2?s.mouseup||(s.mouseup=l.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),o&4?s.mousedrag||(s.mousedrag=l.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ae(t,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(o)})),this._register(Ae(t,"wheel",o=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(o,!0);let u=re.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){a7(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=xj(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let s=this.rows-1;return this.scrollLines(n.type===2?-s:s),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===re.ETX||n.key===re.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Oj(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Mt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(re.ESC+"[I"):this.coreService.triggerDataEvent(re.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${re.ESC}[4;${n};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),l=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${re.ESC}[6;${l};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Oj(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var Rj=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},Lj=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new sn)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},z5=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new Lj(t)}getNullCell(){return new sn}},Nj=class extends Pe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ue),this.onBufferChange=this._onBufferChange.event,this._normal=new z5(this._core.buffers.normal,"normal"),this._alternate=new z5(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},zj=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,s)=>t(n,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Bj=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},jj=["cols","rows"],An=0,Hj=class extends Pe{constructor(e){super(),this._core=this._register(new Dj(e)),this._addonManager=this._register(new Rj),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],n=(s,l)=>{this._checkReadonlyOptions(s),this._core.options[s]=l};for(let s in this._core.options){let l={get:t.bind(this,s),set:n.bind(this,s)};Object.defineProperty(this._publicOptions,s,l)}}_checkReadonlyOptions(e){if(jj.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new zj(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Bj(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Nj(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
79
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return yp.get()},set promptLabel(e){yp.set(e)},get tooMuchOutput(){return Sp.get()},set tooMuchOutput(e){Sp.set(e)}}}_verifyIntegers(...e){for(An of e)if(An===1/0||isNaN(An)||An%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(An of e)if(An&&(An===1/0||isNaN(An)||An%1!==0||An<0))throw new Error("This API only accepts positive integers")}};const Ij=Object.freeze(Object.defineProperty({__proto__:null,Terminal:Hj},Symbol.toStringTag,{value:"Module"}));var Pj=2,Fj=1,Uj=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(n.getPropertyValue("height")),l=Math.max(0,parseInt(n.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),u={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},h=u.top+u.bottom,d=u.right+u.left,p=s-h,_=l-d-t;return{cols:Math.max(Pj,Math.floor(_/e.css.cell.width)),rows:Math.max(Fj,Math.floor(p/e.css.cell.height))}}};const Vj=Object.freeze(Object.defineProperty({__proto__:null,FitAddon:Uj},Symbol.toStringTag,{value:"Module"}));function Sh(e){return e==null}function cs(e,t,n){return Object.defineProperty(e,t,{writable:!0,value:n,enumerable:!1})}function im(e,t){return arguments.length===1?n=>im(e,n):e in globalThis&&t instanceof globalThis[e]||Object.prototype.toString.call(t).slice(8,-1)===e}function X7(e){return im("ArrayBuffer",e)||im("SharedArrayBuffer",e)}function qj(e){return X7(e)||ArrayBuffer.isView(e)}var da;(function(e){e.is=X7,e.isSource=qj;function t(u){return ArrayBuffer.isView(u)?u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength):u}e.fromSource=t;function n(u){if(u=t(u),typeof Buffer<"u")return Buffer.from(u).toString("base64");let h="";const d=new Uint8Array(u);for(let p=0;p<d.byteLength;p++)h+=String.fromCharCode(d[p]);return btoa(h)}e.toBase64=n;function s(u){return typeof Buffer<"u"?t(Buffer.from(u,"base64")):Uint8Array.from(atob(u),h=>h.charCodeAt(0))}e.fromBase64=s;function l(u){return u=t(u),typeof Buffer<"u"?Buffer.from(u).toString("hex"):Array.from(new Uint8Array(u),h=>h.toString(16).padStart(2,"0")).join("")}e.toHex=l;function o(u){if(typeof Buffer<"u")return t(Buffer.from(u,"hex"));const h=u.length%2===0?u:u.slice(0,u.length-1),d=[];for(let p=0;p<h.length;p+=2)d.push(parseInt(`${h[p]}${h[p+1]}`,16));return Uint8Array.from(d).buffer}e.fromHex=o})(da||(da={}));da.fromBase64;da.toBase64;da.fromHex;da.toHex;function $j(e,t,n){const s=[];let l=0;for(let o=0;o<e.length;o++){const u=e.charCodeAt(o);if(u>=65&&u<=90){if(l===1){const h=e.charCodeAt(o+1);h>=97&&h<=122&&s.push(n),s.push(u+32)}else l!==0&&s.push(n),s.push(u+32);l=1}else u>=97&&u<=122?(s.push(u),l=2):t.includes(u)?(l!==0&&s.push(n),l=0):s.push(u)}return String.fromCharCode(...s)}function Yj(e){return $j(e,[45,95],45)}const Kj=Yj;var B5;(function(e){e.millisecond=1,e.second=1e3,e.minute=e.second*60,e.hour=e.minute*60,e.day=e.hour*24,e.week=e.day*7;let t=new Date().getTimezoneOffset();function n(v){t=v}e.setTimezoneOffset=n;function s(){return t}e.getTimezoneOffset=s;function l(v=new Date,w){return typeof v=="number"&&(v=new Date(v)),w===void 0&&(w=t),Math.floor((v.valueOf()/e.minute-w)/1440)}e.getDateNumber=l;function o(v,w){const x=new Date(v*e.day);return w===void 0&&(w=t),new Date(+x+w*e.minute)}e.fromDateNumber=o;const u=/\d+(?:\.\d+)?/.source,h=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(v=>`(${u}${v})?`).join("")}$`);function d(v){const w=h.exec(v);return w?(parseFloat(w[1])*e.week||0)+(parseFloat(w[2])*e.day||0)+(parseFloat(w[3])*e.hour||0)+(parseFloat(w[4])*e.minute||0)+(parseFloat(w[5])*e.second||0):0}e.parseTime=d;function p(v){const w=d(v);return w?v=Date.now()+w:/^\d{1,2}(:\d{1,2}){1,2}$/.test(v)?v=`${new Date().toLocaleDateString()}-${v}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(v)&&(v=`${new Date().getFullYear()}-${v}`),v?new Date(v):new Date}e.parseDate=p;function _(v){const w=Math.abs(v);return w>=e.day-e.hour/2?Math.round(v/e.day)+"d":w>=e.hour-e.minute/2?Math.round(v/e.hour)+"h":w>=e.minute-e.second/2?Math.round(v/e.minute)+"m":w>=e.second?Math.round(v/e.second)+"s":v+"ms"}e.format=_;function g(v,w=2){return v.toString().padStart(w,"0")}e.toDigits=g;function S(v,w=new Date){return v.replace("yyyy",w.getFullYear().toString()).replace("yy",w.getFullYear().toString().slice(2)).replace("MM",g(w.getMonth()+1)).replace("dd",g(w.getDate())).replace("hh",g(w.getHours())).replace("mm",g(w.getMinutes())).replace("ss",g(w.getSeconds())).replace("SSS",g(w.getMilliseconds(),3))}e.template=S})(B5||(B5={}));var Wg=class{sn=0;map=new Map;weak=new WeakMap;get length(){return this.map.size}push(e){const t=++this.sn;return this.map.set(t,e),this.weak.set(e,t),()=>this.map.delete(t)}delete(e){const t=this.weak.get(e);return t?this.map.delete(t):!1}clear(){const e=[...this.map.values()];return this.map.clear(),e.reverse()}[Symbol.iterator](){return this.map.values()}[Symbol.for("nodejs.util.inspect.custom")](){return[...this]}};const Ce={shadow:Symbol.for("cordis.shadow"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),metadata:Symbol.for("cordis.metadata"),initHooks:Symbol.for("cordis.initHooks"),checkProto:Symbol.for("cordis.checkProto"),effect:Symbol.for("cordis.effect"),filter:Symbol.for("cordis.filter"),isolate:Symbol.for("cordis.isolate"),intercept:Symbol.for("cordis.intercept"),init:Symbol.for("cordis.init"),check:Symbol.for("cordis.check"),config:Symbol.for("cordis.config"),invoke:Symbol.for("cordis.invoke"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),resolveConfig:Symbol.for("cordis.resolveConfig")},Wj=function*(){}.constructor,j5=async function*(){}.constructor;function Gj(e){return!(!e.prototype||e instanceof Wj||j5!==Function&&e instanceof j5)}function Z7(e,t){if(e===Object.prototype)return t;const n=Object.create(Z7(Object.getPrototypeOf(e),t));for(const s of Reflect.ownKeys(e))Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(e,s));return n}function na(e){return e&&(typeof e=="object"||typeof e=="function")}function Xj(e,t){let n=e;for(;n;){const s=Reflect.getOwnPropertyDescriptor(n,t);if(s)return s;n=Object.getPrototypeOf(n)}}function qs(e,t){if(!na(t))return t;if(Object.hasOwn(t,Ce.shadow))return Object.getPrototypeOf(t);const n=t[Ce.tracker];return n?Gg(e,t,n):t}function Gh(e,t){return t?new Proxy(e,{get:(n,s,l)=>s in t&&s!=="constructor"?Reflect.get(t,s,l):Reflect.get(n,s,l),set:(n,s,l,o)=>s in t&&s!=="constructor"?Reflect.set(t,s,l,o):Reflect.set(n,s,l,o)}):e}function nm(e,t,n){return Gh(e,Object.defineProperty(Object.create(null),t,{value:n,writable:!1}))}function U0(e,t,n,s){if(!n)return s;const l=Reflect.getOwnPropertyDescriptor(t,n)?.value;return l?nm(s,n,e.extend({[Ce.shadow]:l})):s}function Zj(e,t,n,s){return new Proxy(t,{apply:(l,o,u)=>(o===n&&(o=s),qs(e,Reflect.apply(l,o,u)))})}function Gg(e,t,n){e[Ce.shadow]&&!n.noShadow&&(e=Object.getPrototypeOf(e));const s=new Proxy(t,{get:(l,o,u)=>{if(o===Ce.original)return l;if(o===n.property)return e;if(typeof o=="symbol")return Reflect.get(l,o,u);if(n.associate&&e.reflect.props[`${n.associate}.${o}`])return Reflect.get(e,`${n.associate}.${o}`,nm(e,Ce.receiver,u));let h,d;const p=Xj(l,o);p&&"value"in p?d=p.value:(h=U0(e,l,n.property,u),d=Reflect.get(l,o,h));const _=d?.[Ce.tracker];return _?Gg(e,d,_):!n.noShadow&&typeof d=="function"?(h??=U0(e,l,n.property,u),Zj(e,d,u,h)):d},set:(l,o,u,h)=>{if(o===Ce.original||o===n.property)return!1;if(typeof o=="symbol")return Reflect.set(l,o,u,h);if(n.associate&&e.reflect.props[`${n.associate}.${o}`])return Reflect.set(e,`${n.associate}.${o}`,u,nm(e,Ce.receiver,h));const d=U0(e,l,n.property,h);return Reflect.set(l,o,u,d)},apply:(l,o,u)=>Q7(s,l,o,u)});return s}function Q7(e,t,n,s){return t[Ce.invoke]?t[Ce.invoke].apply(e,s):Reflect.apply(t,n,s)}function Qj(e,t,n){const s=function(...l){return Q7(Gg(s.ctx,s,n),s,this,l)};return cs(s,"name",e),Object.setPrototypeOf(s,t)}function H5(e,t,n){const s=e.error.stack.split(`
80
+ `);if(typeof t?.stack!="string"){const u=new Error(t),h=u.stack.split(`
81
+ `);throw h.splice(1,1/0,...n()),u.stack=h.join(`
82
+ `),u}const l=t.stack.split(`
83
+ `);let o=l.indexOf(s[2]);if(o===-1)throw t;for(o-=e.offset;o>0&&l[o-1].endsWith(" (<anonymous>)");)o-=1;throw l.splice(o,1/0,...n()),t.stack=l.join(`
84
+ `),t}function I5(e,t=Xg()){const n={offset:1,error:new Error};try{const s=e(n);return na(s)&&"then"in s?s.then(void 0,l=>H5(n,l,t)):s}catch(s){H5(n,s,t)}}function Xg(e=0){const t=new Error;return()=>t.stack.split(`
85
+ `).slice(3+e)}function P5(e){return e!==null&&e!==!1&&e!==void 0}var Jj=class{ctx;_hooks={};constructor(e){this.ctx=e,cs(this,Ce.tracker,{property:"ctx",noShadow:!0}),this.on("internal/listener",function(t,n,s){if(t==="internal/update"&&!s.global)return(this.fiber._hooks["internal/update"]??=new Wg)[s.prepend?"unshift":"push"](n)}),this.on("internal/update",function(t,n,s){const l=[...this._hooks["internal/update"]||[]],o=()=>(l.shift()??s).call(this,t,n,o);return o()},{global:!0,prepend:!0})}dispatch(e,t){const n=typeof t[0]=="object"||typeof t[0]=="function"?t.shift():null,s=t.shift();s.startsWith("internal/")||this.emit("internal/dispatch",e,s,t,n);const l=n?.[Go.filter];return(this._hooks[s]||[]).filter(o=>o.global||!l||l.call(n,o.ctx)).map(o=>o.callback.bind(n))}async parallel(...e){const t=(await Promise.allSettled(this.dispatch("emit",e).map(async n=>n(...e)))).filter(n=>n.status==="rejected");if(t.length)throw new AggregateError(t.map(n=>n.reason))}emit(...e){this.dispatch("emit",e).map(t=>t(...e))}async serial(...e){for(const t of this.dispatch("serial",e)){const n=await t(...e);if(P5(n))return n}}bail(...e){for(const t of this.dispatch("bail",e)){const n=t(...e);if(P5(n))return n}}waterfall(...e){const t=this.dispatch("waterfall",e),n=e.pop(),s=()=>(t.shift()??n)(...e);return e.push(s),s()}register(e,t,n,s){const l=s.prepend?"unshift":"push";return this.ctx.fiber.effect(()=>(t[l]({ctx:this.ctx,callback:n,...s}),()=>this.unregister(t,n)),e)}unregister(e,t){const n=e.findIndex(s=>s.callback===t);if(n>=0)return e.splice(n,1),!0}on(e,t,n){typeof n!="object"&&(n={prepend:n}),this.ctx.fiber.assertActive(),t=this.ctx.reflect.bind(t);const s=this.bail(this.ctx,"internal/listener",e,t,n);if(s)return s;const l=this._hooks[e]||=[],o=`ctx.on(${typeof e=="string"?JSON.stringify(e):e.toString()})`;return this.register(o,l,t,n)}once(e,t,n){const s=this.on(e,function(...l){return s(),t.apply(this,l)},n);return s}};const F5={s:e=>String(e),d:e=>Math.trunc(Number(e)),i:e=>Math.trunc(Number(e)),f:e=>Number(e),o:e=>JSON.stringify(e),O:e=>JSON.stringify(e),c:()=>"",C:(e,t,n)=>rm.color(t,rm.code(n.name,t.colors),e)};function eH(e){return e instanceof Error&&Array.isArray(e.errors)}var rm=class{service;static color(e,t,n,s=""){return e.colors?`\x1B[3${t<8?t:"8;5;"+t}${e.colors>=2?s:""}m${n}\x1B[0m`:""+n}static code(e,t){let n=0;for(let l=0;l<e.length;l++)n=(n<<3)-n+e.charCodeAt(l)+13,n|=0;const s=t?t>=2?iH:tH:[];return s[Math.abs(n)%s.length]}static format(e,t){const n=t.args.slice();n[0]instanceof Error?(n[0]=n[0].stack||n[0].message,n.unshift("%s")):typeof n[0]!="string"&&n.unshift("%o");let s=n.shift();s=s.replace(/%([a-zA-Z%])/g,(u,h)=>{if(u==="%%")return"%";const d=e.formatters?.[h]??F5[h];return typeof d=="function"?d(n.shift(),e,t):u});const l=e.formatters?.o??F5.o;for(let u of n)typeof u=="object"&&u&&(u=l(u,e,t)),s+=" "+u;const{maxLength:o=10240}=e;return s.split(/\r?\n/g).map(u=>u.slice(0,o)+(u.length>o?"...":"")).join(`
86
+ `)}constructor(e,t){this.service=t,Object.assign(this,e),this.error=this._method("error",0),this.info=this._method("info",1),this.warn=this._method("warn",2),this.debug=this._method("debug",3)}_method(e,t){return(...n)=>{if(n.length===1&&n[0]instanceof Error){if(n[0].cause)this[e](n[0].cause);else if(eH(n[0])){n[0].errors.forEach(o=>this[e](o));return}}const s=++this.service._snMessage,l=Date.now();for(const o of this.service.exporters.values()){if((o.levels?.[this.name]??o.levels?.default??this.level??1)<t)continue;const u={sn:s,ts:l,type:e,level:t,name:this.name,...this.meta,args:n};o.export(u)}}}};const tH=[6,2,3,4,5,1],iH=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221];var nH=class J7{bufferSize=1e3;buffer=[];ctx;_snMessage=0;_snExporter=0;exporters=new Map;constructor(t){const n={property:"ctx",noShadow:!0},s=Qj("logger",Z7(Object.getPrototypeOf(this),Function.prototype),n);return Object.assign(s,this),s.ctx=t,cs(s,Ce.tracker,n),s.exporter({colors:3,export:l=>{s.buffer.push(l),s.buffer.length>s.bufferSize&&(s.buffer=s.buffer.slice(-s.bufferSize))}}),s}exporter(t){return this.ctx.effect(()=>{const n=++this._snExporter;return this.exporters.set(n,t),()=>this.exporters.delete(n)},"ctx.logger.exporter()")}_resolveConfig(){let t=this.ctx[Ce.intercept];const n=[];for(;"logger"in t;)Object.hasOwn(t,"logger")&&n.unshift(t.logger),t=Object.getPrototypeOf(t);return Object.assign({},...n)}[Ce.invoke](t){const n=this._resolveConfig(),s=(this.ctx[Ce.shadow]??this.ctx).fiber;return t??=n.name,t??=Kj(s.name),new rm({name:t,level:n.level,meta:{fiber:new WeakRef(s)}},this)}static{for(const t of["error","info","warn","debug"])J7.prototype[t]=function(...n){return this()[t](...n)}}};function V0(e){const t=e.stack.split(`
87
+ `);return t.splice(0,2,`Error: ${e.message}`),e.stack=t.join(`
88
+ `),e}const rH=["prototype","then"];function q0(e){return typeof e=="symbol"||rH.includes(e)||parseInt(e).toString()===e||e.startsWith("_")}var U5=class{ctx;static handler={get:(e,t,n)=>{if(q0(t))return Reflect.get(e,t,n);if(Reflect.has(e,t))return qs(n,Reflect.get(e,t,n));const s=new Error(`cannot get property "${t}" without inject`);try{const l=e.reflect.props[t];return l?.type==="accessor"?l.get.call(n,n[Ce.receiver],s):n.fiber.runtime?n.events.waterfall("internal/get",n,t,s,()=>{const o=e[Ce.isolate][t];let u=(n[Ce.shadow]??n).fiber;for(;;){const h=u.store?.[t];if(h)return qs(n,h.value);if(t in u.inject)throw s.message=`cannot get required service "${t}" in inactive context`,s;if(!u.runtime||u.parent[Ce.isolate][t]!==o)throw s;u=u.parent.fiber}}):n.reflect.get(t,!1)}catch(l){throw l===s?V0(l):l}},set:(e,t,n,s)=>{if(q0(t))return Reflect.set(e,t,n,s);const l=new Error(`cannot set property "${t}" without provide`),o=e.reflect.props[t];if(!o){if(!s.fiber.runtime)return Reflect.set(e,t,n,s);throw V0(l)}try{return o.type==="accessor"?o.set?o.set.call(s,n,s[Ce.receiver],l):!1:s.events.waterfall("internal/set",s,t,n,l,()=>s.reflect.set(t,n,l))}catch(u){throw u===l?V0(u):u}},has:(e,t)=>q0(t)?Reflect.has(e,t):Reflect.has(e,t)?!0:!!e.reflect.props[t]};store=Object.create(null);props=Object.create(null);constructor(e){this.ctx=e,cs(this,Ce.tracker,{property:"ctx",noShadow:!0}),this.mixin("reflect",["get","set","provide","accessor","mixin"]),this.mixin("fiber",["runtime","effect"]),this.mixin("registry",["inject","plugin"]),this.mixin("events",["on","once","parallel","emit","serial","bail","waterfall"])}get(e,t=!0){return qs(this.ctx,this._getImpl(e,t)?.value)}_getImpl(e,t=!0){const n=this.ctx[Ce.isolate][e],s=n&&this.store[n];if(s&&!(t&&s.fiber.state!==2))return s}set(e,t,n){const s=this.ctx[Ce.isolate][e],l=this.store[s];if(!l)throw new Error(`cannot set property "${e}" without provide`);if(l.fiber!==this.ctx.fiber)throw new Error(`cannot set property "${e}" in multiple fibers`);return l.value=t,!0}provide(e,t,n){return this.ctx.fiber.effect(()=>{if(!this.props[e])this.props[e]??={type:"service"};else if(this.props[e].type!=="service")throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);this.props[e]={type:"service"},this.ctx.root[Ce.isolate][e]??=Symbol(e);const s=this.ctx[Ce.isolate][e],l={name:e,value:t,fiber:this.ctx.fiber,check:n};if(this.store[s])throw new Error(`service "${e}" has been registered at <${this.store[s].fiber.name}>`);return this.store[s]=l,this.ctx.fiber.store[e]=l,this.ctx.fiber.state===2&&this.notify([e]),async()=>{delete this.store[s];const o=this.notify([e]);await Promise.allSettled(o.map(u=>u.await())),delete this.ctx.fiber.store[e]}},`ctx.provide(${JSON.stringify(e)})`)}notify(e,t=(n,s)=>n[Ce.isolate][s]===this.ctx[Ce.isolate][s]){const n=[];for(const s of this.ctx.registry.values())for(const l of s.fibers){let o=!1;for(const u of e)u in l.inject&&t(l.ctx,u)&&(o=!0,l._checkImpl(u));o&&(l._refresh(),n.push(l))}for(const s of e){const l=Object.create(this.ctx);l[Ce.filter]=o=>t(o,s),this.ctx.events.emit(l,"internal/service",s,this._getImpl(s,!1)?.value)}return n}accessor(e,t){return this.ctx.fiber.effect(()=>{if(e in this.props)throw new Error(`property "${e}" is already declared as ${this.props[e].type}`);return this.props[e]={type:"accessor",...t},()=>delete this.props[e]},`ctx.accessor(${JSON.stringify(e)})`)}mixin(e,t){const n=this;return this.ctx.fiber.effect(function*(){const s=Array.isArray(t)?t.map(o=>[o,o]):Object.entries(t),l=(o,u)=>o[e];for(const[o,u]of s)yield n.accessor(u,{get(h,d){const p=l(this);if(Sh(p))return p;const _=h?Gh(h,p):p,g=Reflect.get(p,o,_);return typeof g!="function"?g:g.bind(_??p)},set(h,d,p){const _=l(this),g=d?Gh(d,_):_;return Reflect.set(_,o,h,g)}})},`ctx.mixin(${JSON.stringify(e)})`)}trace(e){return qs(this.ctx,e)}bind(e){return new Proxy(e,{apply:(t,n,s)=>Reflect.apply(t,this.trace(n),s.map(l=>this.trace(l))),construct:(t,n,s)=>Reflect.construct(t,n.map(l=>this.trace(l)),s)})}};const sH=Symbol.for("ValidationError");var ew=class extends TypeError{name="ValidationError";constructor(e){super(`invalid config:
89
+ `+e.map(t=>t.path?` - ${t.message} (at ${t.path.join(".")})`:` - ${t.message}`).join(`
90
+ `))}};Object.defineProperty(ew.prototype,sH,{value:!0});function lH(e,t){if(!e.Config)return t;const n=e.Config["~standard"].validate(t);if("then"in n)throw new TypeError("Async config validation is not supported");if(n.issues)throw new ew(n.issues);return n.value}const tw=new WeakMap;function $0(e){const t=e();return tw.get(e)?.()??t}function aH(e,t){const n=["internal/plugin",t];let s;try{s=e.events.dispatch("emit",n)}catch(l){e.logger.error(l);return}for(const l of s)try{const o=l(...n);Promise.resolve(o).catch(u=>e.logger.error(u))}catch(o){e.logger.error(o)}}var Xh=class iw extends Error{code;constructor(t,n){super(n??iw.Code[t]),this.code=t}};(function(e){e.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(Xh||(Xh={}));const Dn="__INACTIVE__";var nw=class{parent;inject;runtime;uid;ctx;config;_config;state=0;dispose;store;inertia;_hooks=Object.create(null);_disposables=new Wg;context;_error;_runner;_store=Object.create(null);constructor(e,t,n,s,l){this.parent=e,this.inject=n,this.runtime=s,this._config=t;const o=u=>{this._disposables.push(u)};if(s){this.uid=e.registry.counter,this.ctx=this.context=e.extend({fiber:this});const u=Object.entries(this.inject);if(u.length){this.ctx[Go.intercept]=Object.create(e[Go.intercept]);for(const[h,d]of u)Sh(d)||(this.ctx[Go.intercept][h]=d)}this._runner={epoch:Dn,getOuterStack:l,execute:function(){if(Gj(s.callback)){const h=new s.callback(this.ctx,this.config);for(const d of h?.[Ce.initHooks]??[])d();return h?.[Ce.init]?.()}else return s.callback(this.ctx,this.config)},collect:o},this.dispose=e.fiber.effect(()=>{const h=s.fibers.push(this);return async()=>{for(this.uid=null,aH(this.context,this),this.ctx.registry.has(s.callback)&&(h(),s.fibers.length||this.ctx.registry.delete(s.callback)),this._setEpoch(Dn),this.inertia||this._updateState(()=>(this.inertia=this._unload(),5));this.inertia;)await this.inertia}},"ctx.plugin()");try{this.context.emit("internal/plugin",this)}catch(h){throw Promise.resolve(this.dispose()).catch(d=>this.ctx.logger.error(d)),h}if(this.uid!==null&&e.fiber.state!==5){for(const h of Object.keys(this.inject))this._checkImpl(h);this._refresh()}}else this.uid=0,this.ctx=this.context=e,this.state=2,this.store=Object.create(null),this._runner={epoch:"",getOuterStack:l,execute:()=>{},collect:o},this.dispose=()=>this.restart()}get name(){let e=this;do{if(e.runtime?.name)return e.runtime.name;e=e.parent.fiber}while(e!==e.parent.fiber);return"root"}assertActive(){if(this.uid===null)throw new Xh("INACTIVE_EFFECT")}_execute(e){const t=e.epoch;return I5(n=>{const s=o=>{if(typeof o=="function")e.collect(o);else if(!Sh(o))throw new TypeError("Invalid effect")},l=e.execute.call(this);if(typeof l=="function")return e.collect(l);if(!Sh(l))if(na(l)){if("then"in l)return l.then(s);if(Symbol.iterator in l){n.error=new Error;const o=l[Symbol.iterator]();for(;;){const u=o.next();if(s(u.value),u.done)return}}else if(Symbol.asyncIterator in l){const o=l[Symbol.asyncIterator]();return(async()=>{for(await Promise.resolve(),n.error=new Error;;){if(e.epoch!==t)return;const u=await o.next();if(s(u.value),u.done)return}})()}else throw new TypeError("Invalid effect")}else throw new TypeError("Invalid effect")},e.getOuterStack)}effect(e,t="anonymous"){if(this.assertActive(),this.state===5)throw new Xh("INACTIVE_EFFECT");const n=[];let s=!1,l;const o=()=>{if(s)return l;s=!0;let Q;for(const R of n.splice(0).reverse())if(Q)Q=Q.then(()=>$0(R));else{const V=$0(R);na(V)&&"then"in V&&(Q=V)}return l=Q},u={label:t,children:[]},h={execute:e,epoch:!0,collect:Q=>{n.push(Q),this._disposables.delete(Q),Q[Ce.effect]&&u.children.push(Q[Ce.effect])},getOuterStack:Xg()};let d,p=!0,_,g,S,v=!1,w,x=()=>!1;const E=()=>(S??=new Promise((Q,R)=>{_=Q,g=R}),S),M=Q=>Promise.resolve(Q).then(()=>o(),async R=>{throw await o(),R}),P=Q=>{let R;try{R=Q()}catch(V){throw x(),V}if(na(R)&&"then"in R){const V=Promise.resolve(R).finally(()=>{x(),w===V&&(w=void 0)});return w=V}return x(),R},N=cs(()=>h.epoch?(h.epoch=!1,P(()=>p?M(E()):d?M(d):o())):v?w:void 0,Ce.effect,u);tw.set(N,()=>w),x=this._disposables.push(N);try{d=this._execute(h)}catch(Q){p=!1,v=!0,h.epoch=!1;let R;try{R=P(o)}finally{g?.(Q)}throw na(R)&&"then"in R&&R.catch(V=>this.ctx.logger.error(V)),Q}p=!1,S&&Promise.resolve(d).then(_,g),d?.catch(()=>h.epoch?P(o):o()).catch(Q=>this.ctx.logger.error(Q));const X=()=>{if(h.epoch)return h.epoch=!1,P(o)};return N.then=async(Q,R)=>Promise.resolve(d).then(()=>X).then(Q,R),N}getEffects(){return[...this._disposables].map(e=>e[Ce.effect]).filter(Boolean)}_getState(){return this.uid===null?4:this._error?3:this._runner.epoch!==Dn?2:0}_updateState(e){const t=this.state;if(this.state=e()??this._getState(),t!==this.state&&(this.context.emit("internal/status",this,t),!(t!==2&&this.state!==2)))for(const n of Reflect.ownKeys(this.ctx.reflect.store)){const s=this.ctx.reflect.store[n];s.fiber===this&&this.ctx.reflect.notify([s.name])}}_checkImpl(e){const t=this.ctx.reflect._getImpl(e,!0);if(!t)return delete this._store[e];try{if(t.check&&!t.check.call(qs(this.ctx,t.value)))return delete this._store[e]}catch(n){return t.fiber.ctx.logger.error(n),delete this._store[e]}this._store[e]=t}_refresh(){let e=!1;e="";for(const t of Object.keys(this.inject)){const n=this._store[t];if(!n){e=Dn;break}e+=":"+n.fiber.uid}this._setEpoch(e)}_setEpoch(e){const t=this._runner.epoch;e!==t&&(this._runner.epoch=e,!this.inertia&&this._updateState(()=>e!==Dn&&t===Dn?(this.inertia=this._reload(),1):(this.inertia=this._unload(),5)))}_resolveConfig(e){return e=this.context.waterfall(this,"internal/config",e,()=>e),this.runtime?lH(this.runtime,e):e}async _reload(){this.store={...this._store};const e=this._runner.epoch;try{await Promise.resolve(),this._runner.epoch===e&&(this.config=this._resolveConfig(this._config),await this._execute(this._runner),this._error=void 0)}catch(t){this.ctx.logger.error(t),this._error=t,this._runner.epoch=Dn}this._updateState(()=>{if(this._runner.epoch===e)this.inertia=void 0;else return this.inertia=this._unload(),5})}async _unload(){await Promise.all(this._disposables.clear().map(async e=>{try{await I5(async t=>{await Promise.resolve(),t.error=new Error,await $0(e)},this._runner.getOuterStack)}catch(t){this.ctx.logger.error(t)}})),this.store=void 0,this._updateState(()=>{if(this._runner.epoch===Dn)this.inertia=void 0;else return this.inertia=this._reload(),1})}async await(){for(;this.inertia;)await this.inertia;if(this._error)throw this._error;return this}async restart(){this.assertActive(),this._setEpoch(Dn),this._refresh(),await this.await()}update(e,t=!1){if(this.assertActive(),this._config=e,this.state!==2){this._error=void 0,this._setEpoch(Dn),this._refresh();return}e=this._resolveConfig(e),this.context.waterfall(this,"internal/update",e,t,()=>(this.config=e,this._error=void 0,this.restart()))}};function oH(e){return e&&typeof e=="object"&&typeof e.apply=="function"}function sm(e,t){return function(n,s){if(s.kind==="class")Object.hasOwn(n,"inject")||(cs(n,"inject",Object.create(Object.getPrototypeOf(n).inject??null)),cs(n.inject,Ce.checkProto,!0)),n.inject[e]=t;else if(s.kind==="method"){const l=(n[Ce.metadata]??={}).inject??=Object.create(null);l[e]=t,s.addInitializer(function(){const o=this[Ce.tracker]?.property;(this[Ce.initHooks]??=[]).push(()=>{this.ctx.inject(l,u=>n.call(o?Gh(this,{[o]:u}):this))})})}else throw new Error("@Inject() can only be used on class or class methods")}}(function(e){function t(n,s=Object.create(null)){if(!n)return s;if(Array.isArray(n))for(const l of n)s[l]=null;else if(Reflect.has(n,Ce.checkProto)){Object.assign(s,t(Object.getPrototypeOf(n)));for(const l of Object.keys(n))s[l]=n[l]??null}else for(const l of Object.keys(n))s[l]=n[l]??null;return s}e.resolve=t})(sm||(sm={}));var cH=class{ctx;_counter=0;_internal=new Map;constructor(e){this.ctx=e,cs(this,Ce.tracker,{property:"ctx",noShadow:!0})}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e){try{if(typeof e=="function")return e;if(oH(e))return e.apply}catch{}}get(e){const t=this.resolve(e);return t&&this._internal.get(t)}has(e){const t=this.resolve(e);return!!t&&this._internal.has(t)}delete(e){const t=this.resolve(e),n=t&&this._internal.get(t);if(n){this._internal.delete(t);for(const s of n.fibers)s.dispose();return n}}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}inject(e,t){return this.plugin({inject:e,apply:t,name:t.name})}plugin(e,t,n=Xg()){const s=this.resolve(e);if(!s)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e);this.ctx.fiber.assertActive();let l=this._internal.get(s);if(!l){let h=e.name;h==="apply"&&(h=void 0),l={name:h,callback:s,fibers:new Wg,Config:e.Config},this._internal.set(s,l)}const o=new nw(this.ctx,t,sm.resolve(e.inject),l,n),u=Object.create(o);return u.then=(h,d)=>o.await().then(h,d),u}},Go=class Fo{static effect=Ce.effect;static filter=Ce.filter;static isolate=Ce.isolate;static intercept=Ce.intercept;static is(t){return!!t?.[Fo.is]}static{Fo.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),Fo.prototype[Fo.is]=!0}constructor(){this[Ce.isolate]=Object.create(null),this[Ce.intercept]=Object.create(null);const t=new Proxy(this,U5.handler);return this.root=t,this.baseUrl=void 0,this.fiber=new nw(t,{},Object.create(null),null,()=>[]),this.reflect=new U5(t),this.registry=new cH(t),this.events=new Jj(t),this.logger=new nH(t),this.fiber._disposables.clear(),t}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.fiber.name}>`}extend(t={}){const n=Reflect.getOwnPropertyDescriptor(this,Ce.shadow)?.value,s=Object.create(qs(this,this));for(const l of Reflect.ownKeys(t))Object.defineProperty(s,l,Reflect.getOwnPropertyDescriptor(t,l));return n?Object.assign(Object.create(s),{[Ce.shadow]:n}):s}isolate(t,n){const s=Object.create(this[Ce.isolate]);return s[t]=n??Symbol(t),this.extend({[Ce.isolate]:s})}intercept(t,n){const s=Object.create(this[Ce.intercept]);return s[t]=n,this.extend({[Ce.intercept]:s})}};function uH(e){const t=new Go;t.provide("slots",e.slots),t.provide("host",e.host),t.provide("uiRuntime",e.runtime);const n=new Map,s=new Map,l=h=>Object.keys(h.inject??{}).filter(d=>h.store?.[d]===void 0),o=h=>{const d=s.get(h);if(d!==void 0)return d;const p=n.get(h);if(p===void 0)return Promise.resolve();n.delete(h);const _=p.dispose().catch(g=>{console.warn(`[ui-shell] 插件 ${h} 卸载时出错:`,g)}).finally(()=>{s.delete(h)});return s.set(h,_),_},u=(h,d,p)=>({id:d,slots:X5(h.slots,_=>(h.effect(()=>_),_)),host:h.host,runtime:h.uiRuntime,provide:(_,g)=>{const S=e.services.provide(_,g,d);h.effect(()=>S);try{h.provide(_,g)}catch(v){console.warn(`[ui-shell] 服务「${_}」没能在 cordis 里镜像:`,v)}p?.onProvide?.(_)},consume:_=>h.get(_)??e.services.consume(_)});return{ctx:t,mount:async(h,d,p)=>{await o(h);const _=t.plugin({name:h,...p?.inject===void 0||p.inject.length===0?{}:{inject:[...p.inject]},apply:g=>d(u(g,h,p))});try{await _}catch(g){throw await _.dispose().catch(()=>{}),g}if(n.set(h,_),p?.onState!==void 0){const g=p.onState,S=w=>{_.uid===null||w.uid!==_.uid||g(w.state,l(w))},v=t.on("internal/status",S);t.effect(()=>typeof v=="function"?v:()=>{})}return _},unmount:h=>o(h),stateOf:h=>n.get(h)?.state,missingOf:h=>{const d=n.get(h);return d===void 0?[]:l(d)},disposeAll:async()=>{await Promise.all([...n.keys()].map(async h=>{const d=n.get(h);n.delete(h),await d?.dispose().catch(()=>{})})),await Promise.all([...s.values()])}}}const hH=["react","react-dom","react-dom/client","react/jsx-runtime","@dsc/ui","@dsc/ui-slots","@dsc/ui-primitives","@dsc/ui-dockkit","@xterm/xterm","@xterm/addon-fit"],fH="__DSC_BOOT__",V5="__DSC_UI_FACTORIES__",dH="__DSC_UI_BOOT_STATE__",sc={react:rC,"react-dom":KE,"react-dom/client":hC,"react/jsx-runtime":tC,"@dsc/ui":AN,"@dsc/ui-slots":OL,"@dsc/ui-primitives":aL,"@dsc/ui-dockkit":kL,"@xterm/xterm":Ij,"@xterm/addon-fit":Vj},rw=Object.keys(sc),q5=hH,$5=[...q5.filter(e=>!(e in sc)),...Object.keys(sc).filter(e=>!q5.includes(e))];$5.length>0&&console.error(`[ui-shell] 平台模块表与运行时 require 表对不上:${$5.join("、")}`);const sw=ma(0);function pH(e){return sw.subscribe(()=>{try{e()}catch{}})}function Y5(){sw.notify()}async function mH(){const e=globalThis[fH];if(e!=null)return e;const t=await fetch("/api/boot",{headers:{accept:"application/json"}});if(!t.ok)throw new Error(`取启动清单失败:HTTP ${String(t.status)}(这一页不是宿主伺服的页面?宿主启动时会打印一个带令牌的地址,用那个地址打开)`);return await t.json()}const gH=!0;function _H(){const e=globalThis.__DSC_CORDIS_PROBE__;if(e==="none")return()=>!1;if(e==="*")return()=>!0;if(Array.isArray(e)){const t=new Set(e.filter(n=>typeof n=="string"));return n=>t.has(n)}return()=>gH}async function vH(e,t){const n=yH(e),s=new Map;for(const k of n)for(const K of k.entries)s.set(K,k);const l={rev:e.rev,host:{name:e.host.name,version:e.host.version},startedAt:Date.now(),firstFrameAt:null,batches:n.map(k=>({phase:k.phase,entries:[...k.entries],state:"pending",failures:[]})),plugins:{},requests:[]};for(const k of e.entries)l.plugins[k.id]={id:k.id,phase:s.get(k.id)?.phase??"application",rev:k.rev,state:"pending",attempts:0};const o=new Map;for(let k=0;k<n.length;k+=1)for(const K of n[k].entries)o.set(K,l.batches[k]);globalThis[dH]=l,Y5();const u=new gC,h=SH(),d=new Map;let p=Promise.resolve();const _=k=>{const K=p.then(k);return p=K.then(()=>{},()=>{}),K},g=new Z5,S=uH({slots:t.slots,host:t.host,runtime:t.runtime,services:g}),v=_H(),w=k=>[...k.services??[]],x=new Map,E=new Map,M=[...e.entries],P=()=>{Y5()},N=(k,K)=>{const W=l.plugins[k];W!==void 0&&(Object.assign(W,K),P())},X=(k,K)=>({has:W=>typeof h[W]=="function",load:W=>{const q={url:W,kind:W.includes("??")?"batch":"single",id:k,phase:K,at:Date.now(),ok:!0};return l.requests.push(q),EH(W,k).catch(Z=>{throw q.ok=!1,P(),Z})}}),Q=async(k,K,W="batch")=>{if(E.get(k.id)===k.rev&&x.get(k.id)?.ok===!0)return null;const q=s.get(k.id),Z=q?.phase??"application",F=[],H=[],ie=()=>{for(const oe of[...F].reverse())try{oe()}catch(T){console.error(`插件 ${k.id} 回滚登记时出错:`,T)}F.length=0},$=MC({...k.inject===void 0?{}:{plugins:k.inject},...k.services===void 0?{}:{services:k.services}},oe=>x.get(oe),g,new Set(e.disabled??[]));if($.length>0){const oe=`等待:${$.join(";")}`;return x.set(k.id,{id:k.id,ok:!1,error:oe,attempts:K}),N(k.id,{state:"failed",at:Date.now(),attempts:K,error:oe}),oe}N(k.id,{state:"loading",phase:Z,rev:k.rev,attempts:K,via:v(k.id)?"cordis":"ledger"});try{const oe=W==="single"?k.url:q?.url??k.url,T=oe===k.url?void 0:k.url;await u.arrive({id:k.id,preferred:oe,...T===void 0?{}:{fallback:T}},X(k.id,Z));const ze=h[k.id];if(typeof ze!="function")throw new Error(`插件 ${k.id} 的脚本没有注册工厂(bundle 形状不对?)`);const We=CH(ze,k.id),O=We?.default??We,D=O?.apply;if(typeof D!="function")throw new Error("插件没有导出 apply(ui)");let ne;if(v(k.id)){const de=await S.mount(k.id,D,{onProvide:ve=>H.push(ve),inject:w(k),onState:(ve,Me)=>{if(ve===2){N(k.id,{fiber:2,state:"loaded",error:void 0,at:Date.now()});const fe=x.get(k.id);fe!==void 0&&fe.ok!==!0&&x.set(k.id,{...fe,ok:!0,error:void 0});return}if(ve===3){const fe="cordis 纤维装载失败(细节见控制台)";x.set(k.id,{id:k.id,ok:!1,error:fe,attempts:K}),N(k.id,{fiber:3,state:"failed",error:fe,at:Date.now()});return}N(k.id,{fiber:ve,...Me.length===0?{}:{error:`等待服务:${Me.join("、")}`}})}}),Ee=S.missingOf(k.id);if(de.state!==2){const ve=Ee.length===0?"等待依赖就绪":`等待服务:${Ee.join("、")}`;return x.set(k.id,{id:k.id,ok:!1,error:ve,attempts:K}),N(k.id,{via:"cordis",fiber:de.state,state:"loading",error:ve}),d.set(k.id,ie),E.set(k.id,k.rev),F.push(()=>{S.unmount(k.id)}),null}N(k.id,{via:"cordis",fiber:de.state}),ne=()=>{S.unmount(k.id)}}else{const de={id:k.id,slots:X5(t.slots,ve=>K5(F,ve)),host:t.host,runtime:t.runtime,provide:(ve,Me)=>{K5(F,g.provide(ve,Me,k.id)),H.push(ve)},consume:ve=>g.consume(ve)},Ee=D(de);ne=typeof Ee=="function"?Ee:void 0}typeof ne=="function"&&F.push(ne),d.set(k.id,ie),E.set(k.id,k.rev);const ae=O?.name;return x.set(k.id,{id:k.id,ok:!0,attempts:K,...typeof ae=="string"&&ae!==""?{name:ae}:{},...H.length===0?{}:{provides:[...H]}}),N(k.id,{state:"loaded",at:Date.now(),attempts:K,error:void 0}),null}catch(oe){ie();const T=oe instanceof Error?oe.message:String(oe);return x.set(k.id,{id:k.id,ok:!1,error:T,attempts:K}),N(k.id,{state:"failed",error:T,at:Date.now(),attempts:K}),T}},R=async(k,K)=>{K!==void 0&&(K.state="loading",K.startedAt=Date.now(),K.failures=[],P());const W=[];for(const q of k.entries){const Z=e.entries.find(F=>F.id===q);Z!==void 0&&await Q(Z,1)!==null&&W.push(Z)}for(const q of W)x.get(q.id)?.ok!==!0&&await Q(q,2);K!==void 0&&(K.failures=k.entries.filter(q=>x.get(q)?.ok===!1),K.state=K.failures.length>0?"failed":"done",K.doneAt=Date.now(),P())},V=async k=>{const K=s.get(k.id),W=K?.url??k.url,q=W===k.url?void 0:k.url;try{await u.arrive({id:k.id,preferred:W,...q===void 0?{}:{fallback:q}},X(k.id,K?.phase??"application"))}catch{}};await Promise.all(e.entries.filter(k=>k.immediately===!0&&l.plugins[k.id]?.state==="pending").map(k=>V(k)));for(let k=0;k<n.length;k+=1)n[k].phase==="early"&&await R(n[k],l.batches[k]);let se=!1;const me={graph:e,getReports:()=>M.map(k=>x.get(k.id)).filter(k=>k!==void 0),getState:()=>l,subscribe:pH,markFirstFrame:()=>{l.firstFrameAt===null&&(l.firstFrameAt=Date.now(),P())},startApplication:()=>{if(se)return;se=!0;const k=()=>{const W=[];for(let q=0;q<n.length;q+=1){if(n[q].phase!=="application")continue;const Z=l.batches[q];Z!==void 0&&Z.state==="pending"&&(Z.state="scheduled",Z.scheduledAt=Date.now()),W.push({batch:n[q],batchState:Z})}P(),_(async()=>{for(const q of W)await R(q.batch,q.batchState)}).catch(q=>{console.error("[ui-shell] 应用批安装出错",q)})},K=globalThis.requestIdleCallback;typeof K=="function"?K(k,{timeout:2e3}):setTimeout(k,0)},reload:async k=>(M.some(K=>K.id===k.id)||M.push(k),me.uninstall(k.id),await S.unmount(k.id),Q(k,1,"single")),uninstall:k=>{const K=d.get(k);if(K!==void 0)try{K()}catch(W){console.error(`插件 ${k} 卸载时出错:`,W)}d.delete(k),E.delete(k),delete h[k],xH(k),x.delete(k),N(k,{state:"removed",at:Date.now(),error:void 0})},installedRev:k=>E.get(k),enqueue:_,awaitingBatch:k=>{const K=o.get(k);return K!==void 0&&(K.state==="pending"||K.state==="scheduled")},services:g,disposeAll:()=>{for(const[k,K]of[...d].reverse())try{K()}catch(W){console.error(`插件 ${k} 卸载时出错:`,W)}d.clear(),E.clear(),S.disposeAll()}};return me}function yH(e){const t=new Set(e.entries.map(u=>u.id)),n=[];for(const u of e.batches??[]){const h=u.entries.filter(d=>t.has(d));h.length>0&&n.push({...u,entries:h})}const s=new Set(n.flatMap(u=>u.entries)),l=e.entries.filter(u=>!s.has(u.id)).map(u=>u.id);l.length>0&&n.push({phase:"application",entries:l});const o=u=>u==="early"?0:1;return[...n].sort((u,h)=>o(u.phase)-o(h.phase))}function K5(e,t){return e.push(t),t}function SH(){const e=globalThis,t=e[V5];if(t!==void 0&&typeof t=="object"&&t!==null)return t;const n={};return e[V5]=n,n}function bH(){const e=new Set;if(typeof document>"u")return e;for(const t of document.querySelectorAll("style:not([data-dsc-plugin])"))e.add(t);return e}function wH(e,t){if(!(typeof document>"u"))for(const n of document.querySelectorAll("style:not([data-dsc-plugin])"))e.has(n)||n.setAttribute("data-dsc-plugin",t)}function xH(e){if(!(typeof document>"u"))for(const t of document.querySelectorAll("style[data-dsc-plugin]"))t.getAttribute("data-dsc-plugin")===e&&t.remove()}function CH(e,t){const n=bH(),s={exports:{}},l=o=>{if(!(o in sc))throw new Error(`插件 ${t} 请求了白名单外的模块「${o}」(允许:${rw.join("、")})`);return sc[o]};try{return e(l,s,s.exports),s.exports}finally{wH(n,t)}}function EH(e,t){return new Promise((n,s)=>{const l=document.createElement("script");l.src=e,l.async=!1,l.dataset.dscPlugin=t,l.addEventListener("load",()=>{l.remove(),n()}),l.addEventListener("error",()=>{l.remove(),s(new Error(`取 bundle 失败:${e}`))}),document.head.append(l)})}function kH(e){const t=new Map,n=new Set;let s=!1,l=null;const o=()=>{for(const p of[...n])try{p()}catch{}},u=async p=>{const _=new Set(p.graph.entries.map(g=>g.id));for(const[g,S]of Object.entries(e.session.getState().plugins))S.state!=="loaded"||_.has(g)||(e.session.uninstall(g),t.delete(g));for(const g of p.graph.entries){if(e.session.installedRev(g.id)===g.rev){t.delete(g.id);continue}if(e.session.awaitingBatch(g.id))continue;const S=await e.session.reload(g);S===null?t.delete(g.id):t.set(g.id,{id:g.id,message:S,at:Date.now()})}o()},h=p=>{l=p,e.session.enqueue(async()=>{if(s)return;const _=l;_!==null&&await u(_)}).catch(_=>{console.error("[ui-shell] 插件热更对账出错",_)})},d=e.channel.onPlugins(p=>{h(p)});return{getFailures:()=>[...t.values()],retry:()=>{h(l??{rev:e.session.graph.rev,changed:[],removed:[],graph:e.session.graph})},subscribe:p=>(n.add(p),()=>{n.delete(p)}),stop:()=>{s=!0,d(),n.clear()}}}const TH={rev:"unavailable",entries:[],batches:[],host:{name:"Pneuma",version:"未知版本"}};async function MH(e){Uh(pN());const t=await e;t!==null&&($s=t7(t),Uh($s),n7($s))}async function AH(e,t){return Promise.race([e,new Promise(n=>{window.setTimeout(()=>{n(null)},t)})])}let $s=Fh;r7(e=>{$s={...$s,...e},Uh($s),n7($s)});function DH(){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=document.getElementById("boot-splash");e!==null&&(e.classList.add("boot-splash--done"),window.setTimeout(()=>{e.remove()},240))})})}async function OH(){const e=document.getElementById("root");if(e===null)throw new Error("页面里没有 #root");const t=new wC;Object.keys(_p).map(g=>t.declare(g,_p[g]));const n=yN(),s=n.invoke("getUiPrefs").catch(g=>(console.warn("[ui-shell] 读界面偏好失败,沿用上次的外观镜像与默认宽度",g),null));MH(s);let l=TH,o=null,u=null;try{l=await mH(),o=await vH(l,{slots:t,host:l.host,runtime:n})}catch(g){u=g instanceof Error?g.message:String(g)}const h=o===null?null:kH({channel:n,session:o}),d=o?.services??new Z5,p=await AH(s,1500);Bh(p?.panelWidths??{});const _=()=>{fg(g=>{n.invoke("setUiPrefs",[{panelWidths:g}]).catch(S=>{console.warn("[ui-shell] 面板几何没写成,下次启动会回默认宽",S)})})};p!==null?_():s.then(g=>{g!==null&&(Bh(g.panelWidths??{}),_())}),am.createRoot(e).render(y.jsx(I.StrictMode,{children:y.jsx(jL,{channel:n,children:y.jsx(AC,{services:d,children:y.jsx(YL,{slots:t,boot:l,serviceRegistry:d,session:o,hmr:h,bootError:u,allowedModules:rw})})})})),o?.markFirstFrame(),o?.startApplication(),DH()}OH();export{WE as a,uk as b,v4 as c,lk as f,pa as g,ck as h,zm as s,JE as w};