@kaitranntt/ccs 7.79.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/README.md +29 -11
  2. package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
  3. package/dist/bin/ccsxp-runtime.js +8 -0
  4. package/dist/bin/ccsxp-runtime.js.map +1 -1
  5. package/dist/bin/codex-runtime-router.d.ts +24 -0
  6. package/dist/bin/codex-runtime-router.d.ts.map +1 -0
  7. package/dist/bin/codex-runtime-router.js +117 -0
  8. package/dist/bin/codex-runtime-router.js.map +1 -0
  9. package/dist/bin/codex-runtime.d.ts +1 -0
  10. package/dist/bin/codex-runtime.js +7 -2
  11. package/dist/bin/codex-runtime.js.map +1 -1
  12. package/dist/ccs.js +2 -1
  13. package/dist/ccs.js.map +1 -1
  14. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js +2 -2
  15. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js.map +1 -1
  16. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts +2 -2
  17. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts.map +1 -1
  18. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js +16 -8
  19. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js.map +1 -1
  20. package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts +8 -0
  21. package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts.map +1 -1
  22. package/dist/cliproxy/ai-providers/model-id-normalizer.js +19 -2
  23. package/dist/cliproxy/ai-providers/model-id-normalizer.js.map +1 -1
  24. package/dist/cliproxy/ai-providers/service.d.ts.map +1 -1
  25. package/dist/cliproxy/ai-providers/service.js +39 -12
  26. package/dist/cliproxy/ai-providers/service.js.map +1 -1
  27. package/dist/cliproxy/auth/oauth-handler.d.ts +13 -1
  28. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  29. package/dist/cliproxy/auth/oauth-handler.js +111 -34
  30. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  31. package/dist/cliproxy/auth/oauth-trace/redactor.d.ts.map +1 -1
  32. package/dist/cliproxy/auth/oauth-trace/redactor.js +9 -1
  33. package/dist/cliproxy/auth/oauth-trace/redactor.js.map +1 -1
  34. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  35. package/dist/cliproxy/config/generator.js +5 -2
  36. package/dist/cliproxy/config/generator.js.map +1 -1
  37. package/dist/cliproxy/config/thinking-config.js +6 -6
  38. package/dist/cliproxy/config/thinking-config.js.map +1 -1
  39. package/dist/cliproxy/executor/env-resolver.js +1 -1
  40. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  41. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
  42. package/dist/cliproxy/quota/quota-fetcher-claude.js +35 -4
  43. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
  44. package/dist/cliproxy/quota/quota-manager.d.ts +1 -0
  45. package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -1
  46. package/dist/cliproxy/quota/quota-manager.js +53 -2
  47. package/dist/cliproxy/quota/quota-manager.js.map +1 -1
  48. package/dist/cliproxy/services/oauth-usage-log-transformer.d.ts.map +1 -1
  49. package/dist/cliproxy/services/oauth-usage-log-transformer.js +5 -0
  50. package/dist/cliproxy/services/oauth-usage-log-transformer.js.map +1 -1
  51. package/dist/codex-auth/codex-account-identity.d.ts +8 -0
  52. package/dist/codex-auth/codex-account-identity.d.ts.map +1 -0
  53. package/dist/codex-auth/codex-account-identity.js +53 -0
  54. package/dist/codex-auth/codex-account-identity.js.map +1 -0
  55. package/dist/codex-auth/codex-auth-dashboard-service.d.ts +46 -0
  56. package/dist/codex-auth/codex-auth-dashboard-service.d.ts.map +1 -0
  57. package/dist/codex-auth/codex-auth-dashboard-service.js +228 -0
  58. package/dist/codex-auth/codex-auth-dashboard-service.js.map +1 -0
  59. package/dist/codex-auth/codex-auth-help.d.ts +7 -0
  60. package/dist/codex-auth/codex-auth-help.d.ts.map +1 -0
  61. package/dist/codex-auth/codex-auth-help.js +87 -0
  62. package/dist/codex-auth/codex-auth-help.js.map +1 -0
  63. package/dist/codex-auth/codex-auth-router.d.ts +16 -0
  64. package/dist/codex-auth/codex-auth-router.d.ts.map +1 -0
  65. package/dist/codex-auth/codex-auth-router.js +77 -0
  66. package/dist/codex-auth/codex-auth-router.js.map +1 -0
  67. package/dist/codex-auth/codex-config-symlink.d.ts +14 -0
  68. package/dist/codex-auth/codex-config-symlink.d.ts.map +1 -0
  69. package/dist/codex-auth/codex-config-symlink.js +128 -0
  70. package/dist/codex-auth/codex-config-symlink.js.map +1 -0
  71. package/dist/codex-auth/codex-profile-paths.d.ts +5 -0
  72. package/dist/codex-auth/codex-profile-paths.d.ts.map +1 -0
  73. package/dist/codex-auth/codex-profile-paths.js +58 -0
  74. package/dist/codex-auth/codex-profile-paths.js.map +1 -0
  75. package/dist/codex-auth/codex-profile-registry.d.ts +34 -0
  76. package/dist/codex-auth/codex-profile-registry.d.ts.map +1 -0
  77. package/dist/codex-auth/codex-profile-registry.js +360 -0
  78. package/dist/codex-auth/codex-profile-registry.js.map +1 -0
  79. package/dist/codex-auth/codex-profile-resources.d.ts +6 -0
  80. package/dist/codex-auth/codex-profile-resources.d.ts.map +1 -0
  81. package/dist/codex-auth/codex-profile-resources.js +119 -0
  82. package/dist/codex-auth/codex-profile-resources.js.map +1 -0
  83. package/dist/codex-auth/commands/create-command.d.ts +9 -0
  84. package/dist/codex-auth/commands/create-command.d.ts.map +1 -0
  85. package/dist/codex-auth/commands/create-command.js +203 -0
  86. package/dist/codex-auth/commands/create-command.js.map +1 -0
  87. package/dist/codex-auth/commands/import-default-command.d.ts +18 -0
  88. package/dist/codex-auth/commands/import-default-command.d.ts.map +1 -0
  89. package/dist/codex-auth/commands/import-default-command.js +385 -0
  90. package/dist/codex-auth/commands/import-default-command.js.map +1 -0
  91. package/dist/codex-auth/commands/index.d.ts +13 -0
  92. package/dist/codex-auth/commands/index.d.ts.map +1 -0
  93. package/dist/codex-auth/commands/index.js +27 -0
  94. package/dist/codex-auth/commands/index.js.map +1 -0
  95. package/dist/codex-auth/commands/login-command.d.ts +9 -0
  96. package/dist/codex-auth/commands/login-command.d.ts.map +1 -0
  97. package/dist/codex-auth/commands/login-command.js +152 -0
  98. package/dist/codex-auth/commands/login-command.js.map +1 -0
  99. package/dist/codex-auth/commands/remove-command.d.ts +10 -0
  100. package/dist/codex-auth/commands/remove-command.d.ts.map +1 -0
  101. package/dist/codex-auth/commands/remove-command.js +230 -0
  102. package/dist/codex-auth/commands/remove-command.js.map +1 -0
  103. package/dist/codex-auth/commands/show-command.d.ts +10 -0
  104. package/dist/codex-auth/commands/show-command.d.ts.map +1 -0
  105. package/dist/codex-auth/commands/show-command.js +127 -0
  106. package/dist/codex-auth/commands/show-command.js.map +1 -0
  107. package/dist/codex-auth/commands/show-detail-view.d.ts +7 -0
  108. package/dist/codex-auth/commands/show-detail-view.d.ts.map +1 -0
  109. package/dist/codex-auth/commands/show-detail-view.js +134 -0
  110. package/dist/codex-auth/commands/show-detail-view.js.map +1 -0
  111. package/dist/codex-auth/commands/switch-command.d.ts +7 -0
  112. package/dist/codex-auth/commands/switch-command.d.ts.map +1 -0
  113. package/dist/codex-auth/commands/switch-command.js +48 -0
  114. package/dist/codex-auth/commands/switch-command.js.map +1 -0
  115. package/dist/codex-auth/commands/types.d.ts +45 -0
  116. package/dist/codex-auth/commands/types.d.ts.map +1 -0
  117. package/dist/codex-auth/commands/types.js +85 -0
  118. package/dist/codex-auth/commands/types.js.map +1 -0
  119. package/dist/codex-auth/commands/use-command.d.ts +16 -0
  120. package/dist/codex-auth/commands/use-command.d.ts.map +1 -0
  121. package/dist/codex-auth/commands/use-command.js +86 -0
  122. package/dist/codex-auth/commands/use-command.js.map +1 -0
  123. package/dist/codex-auth/decode-id-token.d.ts +12 -0
  124. package/dist/codex-auth/decode-id-token.d.ts.map +1 -0
  125. package/dist/codex-auth/decode-id-token.js +83 -0
  126. package/dist/codex-auth/decode-id-token.js.map +1 -0
  127. package/dist/codex-auth/index.d.ts +9 -0
  128. package/dist/codex-auth/index.d.ts.map +1 -0
  129. package/dist/codex-auth/index.js +22 -0
  130. package/dist/codex-auth/index.js.map +1 -0
  131. package/dist/codex-auth/resolve-active-profile.d.ts +13 -0
  132. package/dist/codex-auth/resolve-active-profile.d.ts.map +1 -0
  133. package/dist/codex-auth/resolve-active-profile.js +161 -0
  134. package/dist/codex-auth/resolve-active-profile.js.map +1 -0
  135. package/dist/codex-auth/shell-detect.d.ts +19 -0
  136. package/dist/codex-auth/shell-detect.d.ts.map +1 -0
  137. package/dist/codex-auth/shell-detect.js +129 -0
  138. package/dist/codex-auth/shell-detect.js.map +1 -0
  139. package/dist/codex-auth/types.d.ts +26 -0
  140. package/dist/codex-auth/types.d.ts.map +1 -0
  141. package/dist/codex-auth/types.js +34 -0
  142. package/dist/codex-auth/types.js.map +1 -0
  143. package/dist/commands/cliproxy/variant-subcommand.js +1 -1
  144. package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
  145. package/dist/commands/command-catalog.d.ts +1 -1
  146. package/dist/commands/command-catalog.d.ts.map +1 -1
  147. package/dist/commands/command-catalog.js +10 -1
  148. package/dist/commands/command-catalog.js.map +1 -1
  149. package/dist/commands/completion-backend.d.ts.map +1 -1
  150. package/dist/commands/completion-backend.js +2 -0
  151. package/dist/commands/completion-backend.js.map +1 -1
  152. package/dist/commands/config-command.d.ts +2 -0
  153. package/dist/commands/config-command.d.ts.map +1 -1
  154. package/dist/commands/config-command.js +31 -20
  155. package/dist/commands/config-command.js.map +1 -1
  156. package/dist/commands/docker/finalize-key-rotation-subcommand.d.ts +2 -0
  157. package/dist/commands/docker/finalize-key-rotation-subcommand.d.ts.map +1 -0
  158. package/dist/commands/docker/finalize-key-rotation-subcommand.js +79 -0
  159. package/dist/commands/docker/finalize-key-rotation-subcommand.js.map +1 -0
  160. package/dist/commands/docker/help-subcommand.d.ts.map +1 -1
  161. package/dist/commands/docker/help-subcommand.js +6 -0
  162. package/dist/commands/docker/help-subcommand.js.map +1 -1
  163. package/dist/commands/docker/index.d.ts.map +1 -1
  164. package/dist/commands/docker/index.js +4 -0
  165. package/dist/commands/docker/index.js.map +1 -1
  166. package/dist/commands/docker/show-key-subcommand.d.ts +2 -0
  167. package/dist/commands/docker/show-key-subcommand.d.ts.map +1 -0
  168. package/dist/commands/docker/show-key-subcommand.js +96 -0
  169. package/dist/commands/docker/show-key-subcommand.js.map +1 -0
  170. package/dist/commands/docker/up-subcommand.d.ts.map +1 -1
  171. package/dist/commands/docker/up-subcommand.js +4 -0
  172. package/dist/commands/docker/up-subcommand.js.map +1 -1
  173. package/dist/commands/persist-command.d.ts.map +1 -1
  174. package/dist/commands/persist-command.js +77 -5
  175. package/dist/commands/persist-command.js.map +1 -1
  176. package/dist/dispatcher/cli-argument-parser.d.ts +3 -2
  177. package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -1
  178. package/dist/dispatcher/cli-argument-parser.js +37 -7
  179. package/dist/dispatcher/cli-argument-parser.js.map +1 -1
  180. package/dist/dispatcher/pre-dispatch.d.ts.map +1 -1
  181. package/dist/dispatcher/pre-dispatch.js +7 -0
  182. package/dist/dispatcher/pre-dispatch.js.map +1 -1
  183. package/dist/dispatcher/target-executor.d.ts +2 -2
  184. package/dist/dispatcher/target-executor.d.ts.map +1 -1
  185. package/dist/dispatcher/target-executor.js +5 -5
  186. package/dist/dispatcher/target-executor.js.map +1 -1
  187. package/dist/docker/docker-bootstrap.d.ts +1 -1
  188. package/dist/docker/docker-bootstrap.d.ts.map +1 -1
  189. package/dist/docker/docker-bootstrap.js +99 -3
  190. package/dist/docker/docker-bootstrap.js.map +1 -1
  191. package/dist/docker/docker-executor.d.ts +3 -0
  192. package/dist/docker/docker-executor.d.ts.map +1 -1
  193. package/dist/docker/docker-executor.js +53 -0
  194. package/dist/docker/docker-executor.js.map +1 -1
  195. package/dist/docker/docker-key-rotation.d.ts +48 -0
  196. package/dist/docker/docker-key-rotation.d.ts.map +1 -0
  197. package/dist/docker/docker-key-rotation.js +179 -0
  198. package/dist/docker/docker-key-rotation.js.map +1 -0
  199. package/dist/management/checks/config-check.d.ts.map +1 -1
  200. package/dist/management/checks/config-check.js +10 -1
  201. package/dist/management/checks/config-check.js.map +1 -1
  202. package/dist/management/doctor.d.ts +1 -0
  203. package/dist/management/doctor.d.ts.map +1 -1
  204. package/dist/management/doctor.js +23 -0
  205. package/dist/management/doctor.js.map +1 -1
  206. package/dist/proxy/proxy-daemon.d.ts.map +1 -1
  207. package/dist/proxy/proxy-daemon.js +15 -3
  208. package/dist/proxy/proxy-daemon.js.map +1 -1
  209. package/dist/proxy/server/messages-route.d.ts.map +1 -1
  210. package/dist/proxy/server/messages-route.js +27 -1
  211. package/dist/proxy/server/messages-route.js.map +1 -1
  212. package/dist/shared/claude-extension-setup.d.ts.map +1 -1
  213. package/dist/shared/claude-extension-setup.js +21 -1
  214. package/dist/shared/claude-extension-setup.js.map +1 -1
  215. package/dist/shared/stale-codex-translator-settings.d.ts +4 -0
  216. package/dist/shared/stale-codex-translator-settings.d.ts.map +1 -0
  217. package/dist/shared/stale-codex-translator-settings.js +35 -0
  218. package/dist/shared/stale-codex-translator-settings.js.map +1 -0
  219. package/dist/targets/codex-adapter.d.ts.map +1 -1
  220. package/dist/targets/codex-adapter.js +64 -5
  221. package/dist/targets/codex-adapter.js.map +1 -1
  222. package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -1
  223. package/dist/targets/codex-cliproxy-provider-config.js +56 -24
  224. package/dist/targets/codex-cliproxy-provider-config.js.map +1 -1
  225. package/dist/ui/assets/Trans-dEd8UC39.js +1 -0
  226. package/dist/ui/assets/accounts-B2THsSu_.js +1 -0
  227. package/dist/ui/assets/{alert-dialog-DC1l1GRX.js → alert-dialog-Vurq1xzV.js} +1 -1
  228. package/dist/ui/assets/api-CjLfG9mL.js +4 -0
  229. package/dist/ui/assets/auth-section-iGkrMaT4.js +1 -0
  230. package/dist/ui/assets/backups-section-DUGG_4KP.js +1 -0
  231. package/dist/ui/assets/channels-CimlCc2d.js +1 -0
  232. package/dist/ui/assets/{charts-CeK2xCSo.js → charts-eIPy2oG6.js} +34 -34
  233. package/dist/ui/assets/{checkbox-Dgd2ucy2.js → checkbox-HiMHasEB.js} +1 -1
  234. package/dist/ui/assets/claude-extension-B2v9bsN9.js +1 -0
  235. package/dist/ui/assets/{cliproxy-ai-providers-DxoCNEaQ.js → cliproxy-ai-providers-2lI5jSHb.js} +6 -6
  236. package/dist/ui/assets/cliproxy-control-panel-63gDI-e5.js +1 -0
  237. package/dist/ui/assets/cliproxy-fai69Vyd.js +4 -0
  238. package/dist/ui/assets/code-highlight-ClSMkeL5.js +1 -0
  239. package/dist/ui/assets/codex-i_hfI4Tv.js +30 -0
  240. package/dist/ui/assets/{confirm-dialog-nDFNrH0F.js → confirm-dialog-B_6SrSxL.js} +1 -1
  241. package/dist/ui/assets/copilot-BgG5x_X6.js +3 -0
  242. package/dist/ui/assets/cursor-DF63lFcy.js +1 -0
  243. package/dist/ui/assets/droid-CqlQmFtN.js +2 -0
  244. package/dist/ui/assets/globalenv-section-CYNmD12i.js +1 -0
  245. package/dist/ui/assets/health-7ZO5PEm9.js +1 -0
  246. package/dist/ui/assets/index-BC5ssPfF.js +1 -0
  247. package/dist/ui/assets/index-BMoGhs28.css +1 -0
  248. package/dist/ui/assets/index-Bgcd4FYK.js +1 -0
  249. package/dist/ui/assets/index-CFu0saCM.js +1 -0
  250. package/dist/ui/assets/index-CqsmdQoA.js +1 -0
  251. package/dist/ui/assets/index-D3kxCuJ7.js +1 -0
  252. package/dist/ui/assets/index-DmV9wJET.js +56 -0
  253. package/dist/ui/assets/index-hHb9o079.js +1 -0
  254. package/dist/ui/assets/logs-Dy-yZhIK.js +1 -0
  255. package/dist/ui/assets/{masked-input-5TJ4LSuz.js → masked-input-BSLeznEs.js} +1 -1
  256. package/dist/ui/assets/proxy-status-widget-hRH1agF9.js +1 -0
  257. package/dist/ui/assets/{raw-json-settings-editor-panel-Fg4WMiuD.js → raw-json-settings-editor-panel-Bs83yILR.js} +1 -1
  258. package/dist/ui/assets/{searchable-select-CPJn5vA1.js → searchable-select-pXUC_0Ih.js} +1 -1
  259. package/dist/ui/assets/{separator-BrQkfpAp.js → separator-FZR_61I9.js} +1 -1
  260. package/dist/ui/assets/shared-BiIwM7--.js +8 -0
  261. package/dist/ui/assets/{table-DRzNRkpJ.js → table-_9IusQ8G.js} +1 -1
  262. package/dist/ui/assets/updates-ButNfJqt.js +1 -0
  263. package/dist/ui/assets/{use-accounts-B6AXtlfF.js → use-accounts-BdtI0lBv.js} +1 -1
  264. package/dist/ui/index.html +3 -3
  265. package/dist/utils/claude-subcommand-detector.d.ts +7 -0
  266. package/dist/utils/claude-subcommand-detector.d.ts.map +1 -1
  267. package/dist/utils/claude-subcommand-detector.js +52 -9
  268. package/dist/utils/claude-subcommand-detector.js.map +1 -1
  269. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  270. package/dist/web-server/middleware/auth-middleware.js +25 -1
  271. package/dist/web-server/middleware/auth-middleware.js.map +1 -1
  272. package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
  273. package/dist/web-server/routes/claude-extension-routes.js +5 -0
  274. package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
  275. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +8 -0
  276. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  277. package/dist/web-server/routes/cliproxy-stats-routes.js +13 -26
  278. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  279. package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
  280. package/dist/web-server/routes/codex-routes.js +14 -0
  281. package/dist/web-server/routes/codex-routes.js.map +1 -1
  282. package/dist/web-server/services/cliproxy-dashboard-restart-service.d.ts +21 -0
  283. package/dist/web-server/services/cliproxy-dashboard-restart-service.d.ts.map +1 -0
  284. package/dist/web-server/services/cliproxy-dashboard-restart-service.js +49 -0
  285. package/dist/web-server/services/cliproxy-dashboard-restart-service.js.map +1 -0
  286. package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
  287. package/dist/web-server/services/codex-dashboard-service.js +30 -3
  288. package/dist/web-server/services/codex-dashboard-service.js.map +1 -1
  289. package/dist/web-server/usage/aggregator.d.ts +13 -7
  290. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  291. package/dist/web-server/usage/aggregator.js +37 -22
  292. package/dist/web-server/usage/aggregator.js.map +1 -1
  293. package/dist/web-server/usage/handlers.d.ts +1 -0
  294. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  295. package/dist/web-server/usage/handlers.js +16 -8
  296. package/dist/web-server/usage/handlers.js.map +1 -1
  297. package/dist/web-server/usage/profile-filter.d.ts +13 -0
  298. package/dist/web-server/usage/profile-filter.d.ts.map +1 -0
  299. package/dist/web-server/usage/profile-filter.js +30 -0
  300. package/dist/web-server/usage/profile-filter.js.map +1 -0
  301. package/dist/web-server/usage/types.d.ts +8 -0
  302. package/dist/web-server/usage/types.d.ts.map +1 -1
  303. package/lib/hooks/websearch-transformer.cjs +12 -3
  304. package/lib/mcp/ccs-browser-server.cjs +217 -12
  305. package/package.json +1 -1
  306. package/scripts/docker-dashboard-sunset-guard.js +171 -0
  307. package/scripts/run-test-bucket.js +1 -0
  308. package/scripts/verify-bundle.js +4 -1
  309. package/dist/ui/assets/accounts-BQu3Aeey.js +0 -1
  310. package/dist/ui/assets/api-BTbrbjic.js +0 -4
  311. package/dist/ui/assets/auth-section-BsSVWOMp.js +0 -1
  312. package/dist/ui/assets/backups-section-BGHYHASS.js +0 -1
  313. package/dist/ui/assets/channels-vJ8L4j-z.js +0 -1
  314. package/dist/ui/assets/claude-extension-B3ern4Ad.js +0 -1
  315. package/dist/ui/assets/cliproxy-CGljI0Or.js +0 -4
  316. package/dist/ui/assets/cliproxy-control-panel-BJ3Mliy1.js +0 -1
  317. package/dist/ui/assets/code-highlight-D4E79GKQ.js +0 -3
  318. package/dist/ui/assets/codex-DBGHPn0v.js +0 -30
  319. package/dist/ui/assets/copilot-CE_Z3NB0.js +0 -3
  320. package/dist/ui/assets/cursor-YzGsSR_d.js +0 -1
  321. package/dist/ui/assets/droid-C-ItViCi.js +0 -2
  322. package/dist/ui/assets/globalenv-section-C9gSGyZ8.js +0 -1
  323. package/dist/ui/assets/health-DEeA97sQ.js +0 -1
  324. package/dist/ui/assets/index-B71yJlMj.css +0 -1
  325. package/dist/ui/assets/index-BPVO-QAw.js +0 -1
  326. package/dist/ui/assets/index-BRZp_Csi.js +0 -72
  327. package/dist/ui/assets/index-BYUwpOeA.js +0 -1
  328. package/dist/ui/assets/index-D2r_fAW5.js +0 -1
  329. package/dist/ui/assets/index-DGiziSVQ.js +0 -1
  330. package/dist/ui/assets/index-DwG6bbUr.js +0 -1
  331. package/dist/ui/assets/index-Dwtj4wGT.js +0 -1
  332. package/dist/ui/assets/logs-Mt2W7M3G.js +0 -1
  333. package/dist/ui/assets/proxy-status-widget-BQOAlYsb.js +0 -1
  334. package/dist/ui/assets/shared-BlkDl2HF.js +0 -8
  335. package/dist/ui/assets/updates-BQNeSzLj.js +0 -1
@@ -0,0 +1,56 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bgcd4FYK.js","assets/radix-ui-nu4wz29m.js","assets/react-vendor-Bjx91N7w.js","assets/masked-input-BSLeznEs.js","assets/icons-DzKUh8vG.js","assets/tanstack-bhJxV1h8.js","assets/notifications-B4_o8bcr.js","assets/utils-CzKF5WmX.js","assets/form-utils-CuHzLhJZ.js","assets/charts-eIPy2oG6.js","assets/index-hHb9o079.js","assets/proxy-C4-M_9kB.js","assets/index-CFu0saCM.js","assets/channels-CimlCc2d.js","assets/globalenv-section-CYNmD12i.js","assets/index-BC5ssPfF.js","assets/index-D3kxCuJ7.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-hRH1agF9.js","assets/alert-dialog-Vurq1xzV.js","assets/Trans-dEd8UC39.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-iGkrMaT4.js","assets/backups-section-DUGG_4KP.js","assets/index-CqsmdQoA.js","assets/use-accounts-BdtI0lBv.js","assets/api-CjLfG9mL.js","assets/confirm-dialog-B_6SrSxL.js","assets/cliproxy-fai69Vyd.js","assets/checkbox-HiMHasEB.js","assets/separator-FZR_61I9.js","assets/searchable-select-pXUC_0Ih.js","assets/cliproxy-ai-providers-2lI5jSHb.js","assets/cliproxy-control-panel-63gDI-e5.js","assets/copilot-BgG5x_X6.js","assets/cursor-DF63lFcy.js","assets/claude-extension-B2v9bsN9.js","assets/codex-i_hfI4Tv.js","assets/table-_9IusQ8G.js","assets/raw-json-settings-editor-panel-Bs83yILR.js","assets/droid-CqlQmFtN.js","assets/logs-Dy-yZhIK.js","assets/accounts-B2THsSu_.js","assets/health-7ZO5PEm9.js","assets/shared-BiIwM7--.js","assets/updates-ButNfJqt.js"])))=>i.map(i=>d[i]);
2
+ import{j as p,S as Gh,R as jA,C as BA,a as HA,T as _A,D as UA,P as zA,O as FA,b as NR,c as LR,d as RR,e as ER,f as IR,A as jR,g as BR,h as HR,i as _R,k as UR,l as zR,m as FR,n as qR,I as GR,o as qA,p as KR,q as GA,r as KA,s as VR,t as VA,V as WR,L as WA,u as QA,v as QR,w as YR,x as YA,y as $R,z as XR,B as $A,E as JR,F as ZR,G as XA,H as eE,J as JA,K as ZA,M as eP,N as tE,Q as nE,U as iE,W as oE,X as sE,Y as tP,Z as aE,_ as rE,$ as lE}from"./radix-ui-nu4wz29m.js";import{b as nP,d as cE,r as A,u as Kh,O as ey,N as iP,e as yb,L as uh,R as uE,h as oP,E as me,B as dE,i as hE,j as Et}from"./react-vendor-Bjx91N7w.js";import{Q as fE,u as jt,a as bt,b as ft,c as pE,d as gE}from"./tanstack-bhJxV1h8.js";import{t as fe,T as mE}from"./notifications-B4_o8bcr.js";import{L as hi,X as Gr,P as yE,C as Vh,H as bE,a as xE,K as ty,G as vE,Z as sP,F as aP,U as rP,b as CE,S as SE,c as lP,A as bc,d as cP,e as kE,f as uP,M as dP,E as Kc,g as Vc,B as wE,R as xc,W as AE,h as PE,i as DE,j as OE,k as $S,l as XS,m as Lr,n as bb,o as dh,p as hP,q as fP,r as TE,s as Wh,t as xb,u as pP,v as Rr,T as Qi,w as vc,x as Wc,y as JS,z as ME,D as gP,I as vb,J as NE,N as Qh,O as LE,Q as RE,V as EE,Y as IE,_ as Yh,$ as jE,a0 as BE,a1 as mP,a2 as HE,a3 as _E,a4 as UE,a5 as zE,a6 as FE,a7 as Cb,a8 as yP,a9 as ZS,aa as qE,ab as GE,ac as KE,ad as VE,ae as WE,af as QE,ag as ek,ah as YE,ai as Cd,aj as tk,ak as nk,al as $E}from"./icons-DzKUh8vG.js";import{t as XE,c as JE,a as $h,e as Ul,f as Yl,b as ZE,d as e2,g as t2,h as n2,i as i2,j as o2,k as s2,l as a2,m as r2,n as l2,o as c2,p as u2,q as d2,r as h2,s as f2,u as p2,v as g2,w as m2,x as y2,y as b2,z as x2,A as v2,B as C2,C as S2,D as k2,E as w2,F as A2,G as P2,H as D2,I as O2,J as T2}from"./utils-CzKF5WmX.js";import{o as ik,s as ok,p as M2,a as N2,$ as L2,b as bP,c as ls,d as R2,_ as E2,u as I2,e as sk}from"./form-utils-CuHzLhJZ.js";import{_ as j2,a as B2}from"./charts-eIPy2oG6.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=t(o);fetch(o.href,a)}})();var Yg={exports:{}},zl={},$g={exports:{}},Xg={};var ak;function H2(){return ak||(ak=1,(function(n){function e(B,Z){var se=B.length;B.push(Z);e:for(;0<se;){var Y=se-1>>>1,ae=B[Y];if(0<o(ae,Z))B[Y]=Z,B[se]=ae,se=Y;else break e}}function t(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var Z=B[0],se=B.pop();if(se!==Z){B[0]=se;e:for(var Y=0,ae=B.length,de=ae>>>1;Y<de;){var be=2*(Y+1)-1,te=B[be],le=be+1,xe=B[le];if(0>o(te,se))le<ae&&0>o(xe,te)?(B[Y]=xe,B[le]=se,Y=le):(B[Y]=te,B[be]=se,Y=be);else if(le<ae&&0>o(xe,se))B[Y]=xe,B[le]=se,Y=le;else break e}}return Z}function o(B,Z){var se=B.sortIndex-Z.sortIndex;return se!==0?se:B.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var r=Date,c=r.now();n.unstable_now=function(){return r.now()-c}}var d=[],f=[],g=1,m=null,x=3,v=!1,C=!1,k=!1,w=!1,D=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var Z=t(f);Z!==null;){if(Z.callback===null)i(f);else if(Z.startTime<=B)i(f),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=t(f)}}function L(B){if(k=!1,T(B),!C)if(t(d)!==null)C=!0,N||(N=!0,_());else{var Z=t(f);Z!==null&&oe(L,Z.startTime-B)}}var N=!1,I=-1,K=5,U=-1;function z(){return w?!0:!(n.unstable_now()-U<K)}function X(){if(w=!1,N){var B=n.unstable_now();U=B;var Z=!0;try{e:{C=!1,k&&(k=!1,O(I),I=-1),v=!0;var se=x;try{t:{for(T(B),m=t(d);m!==null&&!(m.expirationTime>B&&z());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,x=m.priorityLevel;var ae=Y(m.expirationTime<=B);if(B=n.unstable_now(),typeof ae=="function"){m.callback=ae,T(B),Z=!0;break t}m===t(d)&&i(d),T(B)}else i(d);m=t(d)}if(m!==null)Z=!0;else{var de=t(f);de!==null&&oe(L,de.startTime-B),Z=!1}}break e}finally{m=null,x=se,v=!1}Z=void 0}}finally{Z?_():N=!1}}}var _;if(typeof M=="function")_=function(){M(X)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ie=V.port2;V.port1.onmessage=X,_=function(){ie.postMessage(null)}}else _=function(){D(X,0)};function oe(B,Z){I=D(function(){B(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var se=x;x=Z;try{return B()}finally{x=se}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(B,Z){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var se=x;x=B;try{return Z()}finally{x=se}},n.unstable_scheduleCallback=function(B,Z,se){var Y=n.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?Y+se:Y):se=Y,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=se+ae,B={id:g++,callback:Z,priorityLevel:B,startTime:se,expirationTime:ae,sortIndex:-1},se>Y?(B.sortIndex=se,e(f,B),t(d)===null&&B===t(f)&&(k?(O(I),I=-1):k=!0,oe(L,se-Y))):(B.sortIndex=ae,e(d,B),C||v||(C=!0,N||(N=!0,_()))),B},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(B){var Z=x;return function(){var se=x;x=Z;try{return B.apply(this,arguments)}finally{x=se}}}})(Xg)),Xg}var rk;function _2(){return rk||(rk=1,$g.exports=H2()),$g.exports}var lk;function U2(){if(lk)return zl;lk=1;var n=_2(),e=nP(),t=cE();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,u=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(u=l.return),s=l.return;while(s)}return l.tag===3?u:null}function r(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(i(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(i(188));return l!==s?null:s}for(var u=s,h=l;;){var y=u.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===u)return d(y),s;if(b===h)return d(y),l;b=b.sibling}throw Error(i(188))}if(u.return!==h.return)u=y,h=b;else{for(var S=!1,P=y.child;P;){if(P===u){S=!0,u=y,h=b;break}if(P===h){S=!0,h=y,u=b;break}P=P.sibling}if(!S){for(P=b.child;P;){if(P===u){S=!0,u=b,h=y;break}if(P===h){S=!0,h=b,u=y;break}P=P.sibling}if(!S)throw Error(i(189))}}if(u.alternate!==h)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?s:l}function g(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=g(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),M=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function _(s){return s===null||typeof s!="object"?null:(s=X&&s[X]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function ie(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case D:return"Profiler";case w:return"StrictMode";case L:return"Suspense";case N:return"SuspenseList";case U:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case C:return"Portal";case M:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case T:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case I:return l=s.displayName||null,l!==null?l:ie(s.type)||"Memo";case K:l=s._payload,s=s._init;try{return ie(s(l))}catch{}}return null}var oe=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},Y=[],ae=-1;function de(s){return{current:s}}function be(s){0>ae||(s.current=Y[ae],Y[ae]=null,ae--)}function te(s,l){ae++,Y[ae]=s.current,s.current=l}var le=de(null),xe=de(null),Se=de(null),ye=de(null);function Oe(s,l){switch(te(Se,l),te(xe,s),te(le,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?xS(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=xS(l),s=vS(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}be(le),te(le,s)}function je(){be(le),be(xe),be(Se)}function nt(s){s.memoizedState!==null&&te(ye,s);var l=le.current,u=vS(l,s.type);l!==u&&(te(xe,s),te(le,u))}function Pt(s){xe.current===s&&(be(le),be(xe)),ye.current===s&&(be(ye),jl._currentValue=se)}var Te,Ye;function it(s){if(Te===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);Te=l&&l[1]||"",Ye=-1<u.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Te+s+Ye}var ln=!1;function Sn(s,l){if(!s||ln)return"";ln=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Q){var W=Q}Reflect.construct(s,[],ne)}else{try{ne.call()}catch(Q){W=Q}s.call(ne.prototype)}}else{try{throw Error()}catch(Q){W=Q}(ne=s())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),S=b[0],P=b[1];if(S&&P){var R=S.split(`
5
+ `),G=P.split(`
6
+ `);for(y=h=0;h<R.length&&!R[h].includes("DetermineComponentFrameRoot");)h++;for(;y<G.length&&!G[y].includes("DetermineComponentFrameRoot");)y++;if(h===R.length||y===G.length)for(h=R.length-1,y=G.length-1;1<=h&&0<=y&&R[h]!==G[y];)y--;for(;1<=h&&0<=y;h--,y--)if(R[h]!==G[y]){if(h!==1||y!==1)do if(h--,y--,0>y||R[h]!==G[y]){var $=`
7
+ `+R[h].replace(" at new "," at ");return s.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",s.displayName)),$}while(1<=h&&0<=y);break}}}finally{ln=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?it(u):""}function As(s,l){switch(s.tag){case 26:case 27:case 5:return it(s.type);case 16:return it("Lazy");case 13:return s.child!==l&&l!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return Sn(s.type,!1);case 11:return Sn(s.type.render,!1);case 1:return Sn(s.type,!0);case 31:return it("Activity");default:return""}}function zt(s){try{var l="",u=null;do l+=As(s,u),u=s,s=s.return;while(s);return l}catch(h){return`
8
+ Error generating stack: `+h.message+`
9
+ `+h.stack}}var Bo=Object.prototype.hasOwnProperty,Ps=n.unstable_scheduleCallback,gi=n.unstable_cancelCallback,ka=n.unstable_shouldYield,wa=n.unstable_requestPaint,Xt=n.unstable_now,$r=n.unstable_getCurrentPriorityLevel,ou=n.unstable_ImmediatePriority,su=n.unstable_UserBlockingPriority,Aa=n.unstable_NormalPriority,Rf=n.unstable_LowPriority,au=n.unstable_IdlePriority,Ef=n.log,If=n.unstable_setDisableYieldValue,Ds=null,pn=null;function Di(s){if(typeof Ef=="function"&&If(s),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(Ds,s)}catch{}}var gn=Math.clz32?Math.clz32:Re,ru=Math.log,jf=Math.LN2;function Re(s){return s>>>=0,s===0?32:31-(ru(s)/jf|0)|0}var Ve=256,Me=262144,$e=4194304;function Kt(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function He(s,l,u){var h=s.pendingLanes;if(h===0)return 0;var y=0,b=s.suspendedLanes,S=s.pingedLanes;s=s.warmLanes;var P=h&134217727;return P!==0?(h=P&~b,h!==0?y=Kt(h):(S&=P,S!==0?y=Kt(S):u||(u=P&~s,u!==0&&(y=Kt(u))))):(P=h&~b,P!==0?y=Kt(P):S!==0?y=Kt(S):u||(u=h&~s,u!==0&&(y=Kt(u)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,u=l&-l,b>=u||b===32&&(u&4194048)!==0)?l:y}function Os(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Bf(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 lu(){var s=$e;return $e<<=1,($e&62914560)===0&&($e=4194304),s}function Ts(s){for(var l=[],u=0;31>u;u++)l.push(s);return l}function eo(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function xN(s,l,u,h,y,b){var S=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var P=s.entanglements,R=s.expirationTimes,G=s.hiddenUpdates;for(u=S&~u;0<u;){var $=31-gn(u),ne=1<<$;P[$]=0,R[$]=-1;var W=G[$];if(W!==null)for(G[$]=null,$=0;$<W.length;$++){var Q=W[$];Q!==null&&(Q.lane&=-536870913)}u&=~ne}h!==0&&tv(s,h,0),b!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=b&~(S&~l))}function tv(s,l,u){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-gn(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function nv(s,l){var u=s.entangledLanes|=l;for(s=s.entanglements;u;){var h=31-gn(u),y=1<<h;y&l|s[h]&l&&(s[h]|=l),u&=~y}}function iv(s,l){var u=l&-l;return u=(u&42)!==0?1:Hf(u),(u&(s.suspendedLanes|l))!==0?0:u}function Hf(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function _f(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ov(){var s=Z.p;return s!==0?s:(s=window.event,s===void 0?32:qS(s.type))}function sv(s,l){var u=Z.p;try{return Z.p=s,l()}finally{Z.p=u}}var Ho=Math.random().toString(36).slice(2),Jt="__reactFiber$"+Ho,kn="__reactProps$"+Ho,Pa="__reactContainer$"+Ho,Uf="__reactEvents$"+Ho,vN="__reactListeners$"+Ho,CN="__reactHandles$"+Ho,av="__reactResources$"+Ho,Xr="__reactMarker$"+Ho;function zf(s){delete s[Jt],delete s[kn],delete s[Uf],delete s[vN],delete s[CN]}function Da(s){var l=s[Jt];if(l)return l;for(var u=s.parentNode;u;){if(l=u[Pa]||u[Jt]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(s=DS(s);s!==null;){if(u=s[Jt])return u;s=DS(s)}return l}s=u,u=s.parentNode}return null}function Oa(s){if(s=s[Jt]||s[Pa]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Jr(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function Ta(s){var l=s[av];return l||(l=s[av]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vt(s){s[Xr]=!0}var rv=new Set,lv={};function Ms(s,l){Ma(s,l),Ma(s+"Capture",l)}function Ma(s,l){for(lv[s]=l,s=0;s<l.length;s++)rv.add(l[s])}var SN=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]*$"),cv={},uv={};function kN(s){return Bo.call(uv,s)?!0:Bo.call(cv,s)?!1:SN.test(s)?uv[s]=!0:(cv[s]=!0,!1)}function cu(s,l,u){if(kN(l))if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+u)}}function uu(s,l,u){if(u===null)s.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+u)}}function to(s,l,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(l,u,""+h)}}function Xn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function dv(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function wN(s,l,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,b=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return y.call(this)},set:function(S){u=""+S,b.call(this,S)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(S){u=""+S},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Ff(s){if(!s._valueTracker){var l=dv(s)?"checked":"value";s._valueTracker=wN(s,l,""+s[l])}}function hv(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return s&&(h=dv(s)?s.checked?"true":"false":s.value),s=h,s!==u?(l.setValue(s),!0):!1}function du(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var AN=/[\n"\\]/g;function Jn(s){return s.replace(AN,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function qf(s,l,u,h,y,b,S,P){s.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?s.type=S:s.removeAttribute("type"),l!=null?S==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+Xn(l)):s.value!==""+Xn(l)&&(s.value=""+Xn(l)):S!=="submit"&&S!=="reset"||s.removeAttribute("value"),l!=null?Gf(s,S,Xn(l)):u!=null?Gf(s,S,Xn(u)):h!=null&&s.removeAttribute("value"),y==null&&b!=null&&(s.defaultChecked=!!b),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+Xn(P):s.removeAttribute("name")}function fv(s,l,u,h,y,b,S,P){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(s.type=b),l!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){Ff(s);return}u=u!=null?""+Xn(u):"",l=l!=null?""+Xn(l):u,P||l===s.value||(s.value=l),s.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=P?s.checked:!!h,s.defaultChecked=!!h,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(s.name=S),Ff(s)}function Gf(s,l,u){l==="number"&&du(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Na(s,l,u,h){if(s=s.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=l.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&h&&(s[u].defaultSelected=!0)}else{for(u=""+Xn(u),l=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,h&&(s[y].defaultSelected=!0);return}l!==null||s[y].disabled||(l=s[y])}l!==null&&(l.selected=!0)}}function pv(s,l,u){if(l!=null&&(l=""+Xn(l),l!==s.value&&(s.value=l),u==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=u!=null?""+Xn(u):""}function gv(s,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(i(92));if(oe(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=Xn(l),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),Ff(s)}function La(s,l){if(l){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=l;return}}s.textContent=l}var PN=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 mv(s,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,u):typeof u!="number"||u===0||PN.has(l)?l==="float"?s.cssFloat=u:s[l]=(""+u).trim():s[l]=u+"px"}function yv(s,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&u[y]!==h&&mv(s,y,h)}else for(var b in l)l.hasOwnProperty(b)&&mv(s,b,l[b])}function Kf(s){if(s.indexOf("-")===-1)return!1;switch(s){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 DN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ON=/^[\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 hu(s){return ON.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function no(){}var Vf=null;function Wf(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ra=null,Ea=null;function bv(s){var l=Oa(s);if(l&&(s=l.stateNode)){var u=s[kn]||null;e:switch(s=l.stateNode,l.type){case"input":if(qf(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Jn(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==s&&h.form===s.form){var y=h[kn]||null;if(!y)throw Error(i(90));qf(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===s.form&&hv(h)}break e;case"textarea":pv(s,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&Na(s,!!u.multiple,l,!1)}}}var Qf=!1;function xv(s,l,u){if(Qf)return s(l,u);Qf=!0;try{var h=s(l);return h}finally{if(Qf=!1,(Ra!==null||Ea!==null)&&(Zu(),Ra&&(l=Ra,s=Ea,Ea=Ra=null,bv(l),s)))for(l=0;l<s.length;l++)bv(s[l])}}function Zr(s,l){var u=s.stateNode;if(u===null)return null;var h=u[kn]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yf=!1;if(io)try{var el={};Object.defineProperty(el,"passive",{get:function(){Yf=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Yf=!1}var _o=null,$f=null,fu=null;function vv(){if(fu)return fu;var s,l=$f,u=l.length,h,y="value"in _o?_o.value:_o.textContent,b=y.length;for(s=0;s<u&&l[s]===y[s];s++);var S=u-s;for(h=1;h<=S&&l[u-h]===y[b-h];h++);return fu=y.slice(s,1<h?1-h:void 0)}function pu(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function gu(){return!0}function Cv(){return!1}function wn(s){function l(u,h,y,b,S){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=S,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(u=s[P],this[P]=u?u(b):b[P]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?gu:Cv,this.isPropagationStopped=Cv,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=gu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=gu)},persist:function(){},isPersistent:gu}),l}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mu=wn(Ns),tl=m({},Ns,{view:0,detail:0}),TN=wn(tl),Xf,Jf,nl,yu=m({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==nl&&(nl&&s.type==="mousemove"?(Xf=s.screenX-nl.screenX,Jf=s.screenY-nl.screenY):Jf=Xf=0,nl=s),Xf)},movementY:function(s){return"movementY"in s?s.movementY:Jf}}),Sv=wn(yu),MN=m({},yu,{dataTransfer:0}),NN=wn(MN),LN=m({},tl,{relatedTarget:0}),Zf=wn(LN),RN=m({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=wn(RN),IN=m({},Ns,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),jN=wn(IN),BN=m({},Ns,{data:0}),kv=wn(BN),HN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_N={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"},UN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zN(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=UN[s])?!!l[s]:!1}function ep(){return zN}var FN=m({},tl,{key:function(s){if(s.key){var l=HN[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=pu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?_N[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(s){return s.type==="keypress"?pu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?pu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),qN=wn(FN),GN=m({},yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wv=wn(GN),KN=m({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),VN=wn(KN),WN=m({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),QN=wn(WN),YN=m({},yu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),$N=wn(YN),XN=m({},Ns,{newState:0,oldState:0}),JN=wn(XN),ZN=[9,13,27,32],tp=io&&"CompositionEvent"in window,il=null;io&&"documentMode"in document&&(il=document.documentMode);var eL=io&&"TextEvent"in window&&!il,Av=io&&(!tp||il&&8<il&&11>=il),Pv=" ",Dv=!1;function Ov(s,l){switch(s){case"keyup":return ZN.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ia=!1;function tL(s,l){switch(s){case"compositionend":return Tv(l);case"keypress":return l.which!==32?null:(Dv=!0,Pv);case"textInput":return s=l.data,s===Pv&&Dv?null:s;default:return null}}function nL(s,l){if(Ia)return s==="compositionend"||!tp&&Ov(s,l)?(s=vv(),fu=$f=_o=null,Ia=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Av&&l.locale!=="ko"?null:l.data;default:return null}}var iL={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 Mv(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!iL[s.type]:l==="textarea"}function Nv(s,l,u,h){Ra?Ea?Ea.push(h):Ea=[h]:Ra=h,l=ad(l,"onChange"),0<l.length&&(u=new mu("onChange","change",null,u,h),s.push({event:u,listeners:l}))}var ol=null,sl=null;function oL(s){fS(s,0)}function bu(s){var l=Jr(s);if(hv(l))return s}function Lv(s,l){if(s==="change")return l}var Rv=!1;if(io){var np;if(io){var ip="oninput"in document;if(!ip){var Ev=document.createElement("div");Ev.setAttribute("oninput","return;"),ip=typeof Ev.oninput=="function"}np=ip}else np=!1;Rv=np&&(!document.documentMode||9<document.documentMode)}function Iv(){ol&&(ol.detachEvent("onpropertychange",jv),sl=ol=null)}function jv(s){if(s.propertyName==="value"&&bu(sl)){var l=[];Nv(l,sl,s,Wf(s)),xv(oL,l)}}function sL(s,l,u){s==="focusin"?(Iv(),ol=l,sl=u,ol.attachEvent("onpropertychange",jv)):s==="focusout"&&Iv()}function aL(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return bu(sl)}function rL(s,l){if(s==="click")return bu(l)}function lL(s,l){if(s==="input"||s==="change")return bu(l)}function cL(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var Bn=typeof Object.is=="function"?Object.is:cL;function al(s,l){if(Bn(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var u=Object.keys(s),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Bo.call(l,y)||!Bn(s[y],l[y]))return!1}return!0}function Bv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Hv(s,l){var u=Bv(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=l&&h>=l)return{node:u,offset:l-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Bv(u)}}function _v(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?_v(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function Uv(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=du(s.document);l instanceof s.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)s=l.contentWindow;else break;l=du(s.document)}return l}function op(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var uL=io&&"documentMode"in document&&11>=document.documentMode,ja=null,sp=null,rl=null,ap=!1;function zv(s,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ap||ja==null||ja!==du(h)||(h=ja,"selectionStart"in h&&op(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),rl&&al(rl,h)||(rl=h,h=ad(sp,"onSelect"),0<h.length&&(l=new mu("onSelect","select",null,l,u),s.push({event:l,listeners:h}),l.target=ja)))}function Ls(s,l){var u={};return u[s.toLowerCase()]=l.toLowerCase(),u["Webkit"+s]="webkit"+l,u["Moz"+s]="moz"+l,u}var Ba={animationend:Ls("Animation","AnimationEnd"),animationiteration:Ls("Animation","AnimationIteration"),animationstart:Ls("Animation","AnimationStart"),transitionrun:Ls("Transition","TransitionRun"),transitionstart:Ls("Transition","TransitionStart"),transitioncancel:Ls("Transition","TransitionCancel"),transitionend:Ls("Transition","TransitionEnd")},rp={},Fv={};io&&(Fv=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function Rs(s){if(rp[s])return rp[s];if(!Ba[s])return s;var l=Ba[s],u;for(u in l)if(l.hasOwnProperty(u)&&u in Fv)return rp[s]=l[u];return s}var qv=Rs("animationend"),Gv=Rs("animationiteration"),Kv=Rs("animationstart"),dL=Rs("transitionrun"),hL=Rs("transitionstart"),fL=Rs("transitioncancel"),Vv=Rs("transitionend"),Wv=new Map,lp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lp.push("scrollEnd");function mi(s,l){Wv.set(s,l),Ms(l,[s])}var xu=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Zn=[],Ha=0,cp=0;function vu(){for(var s=Ha,l=cp=Ha=0;l<s;){var u=Zn[l];Zn[l++]=null;var h=Zn[l];Zn[l++]=null;var y=Zn[l];Zn[l++]=null;var b=Zn[l];if(Zn[l++]=null,h!==null&&y!==null){var S=h.pending;S===null?y.next=y:(y.next=S.next,S.next=y),h.pending=y}b!==0&&Qv(u,y,b)}}function Cu(s,l,u,h){Zn[Ha++]=s,Zn[Ha++]=l,Zn[Ha++]=u,Zn[Ha++]=h,cp|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function up(s,l,u,h){return Cu(s,l,u,h),Su(s)}function Es(s,l){return Cu(s,null,null,l),Su(s)}function Qv(s,l,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var y=!1,b=s.return;b!==null;)b.childLanes|=u,h=b.alternate,h!==null&&(h.childLanes|=u),b.tag===22&&(s=b.stateNode,s===null||s._visibility&1||(y=!0)),s=b,b=b.return;return s.tag===3?(b=s.stateNode,y&&l!==null&&(y=31-gn(u),s=b.hiddenUpdates,h=s[y],h===null?s[y]=[l]:h.push(l),l.lane=u|536870912),b):null}function Su(s){if(50<Tl)throw Tl=0,xg=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var _a={};function pL(s,l,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(s,l,u,h){return new pL(s,l,u,h)}function dp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function oo(s,l){var u=s.alternate;return u===null?(u=Hn(s.tag,l,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=l,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,l=s.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function Yv(s,l){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,l=u.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function ku(s,l,u,h,y,b){var S=0;if(h=s,typeof s=="function")dp(s)&&(S=1);else if(typeof s=="string")S=xR(s,u,le.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case U:return s=Hn(31,u,l,y),s.elementType=U,s.lanes=b,s;case k:return Is(u.children,y,b,l);case w:S=8,y|=24;break;case D:return s=Hn(12,u,l,y|2),s.elementType=D,s.lanes=b,s;case L:return s=Hn(13,u,l,y),s.elementType=L,s.lanes=b,s;case N:return s=Hn(19,u,l,y),s.elementType=N,s.lanes=b,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case M:S=10;break e;case O:S=9;break e;case T:S=11;break e;case I:S=14;break e;case K:S=16,h=null;break e}S=29,u=Error(i(130,s===null?"null":typeof s,"")),h=null}return l=Hn(S,u,l,y),l.elementType=s,l.type=h,l.lanes=b,l}function Is(s,l,u,h){return s=Hn(7,s,h,l),s.lanes=u,s}function hp(s,l,u){return s=Hn(6,s,null,l),s.lanes=u,s}function $v(s){var l=Hn(18,null,null,0);return l.stateNode=s,l}function fp(s,l,u){return l=Hn(4,s.children!==null?s.children:[],s.key,l),l.lanes=u,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var Xv=new WeakMap;function ei(s,l){if(typeof s=="object"&&s!==null){var u=Xv.get(s);return u!==void 0?u:(l={value:s,source:l,stack:zt(l)},Xv.set(s,l),l)}return{value:s,source:l,stack:zt(l)}}var Ua=[],za=0,wu=null,ll=0,ti=[],ni=0,Uo=null,Oi=1,Ti="";function so(s,l){Ua[za++]=ll,Ua[za++]=wu,wu=s,ll=l}function Jv(s,l,u){ti[ni++]=Oi,ti[ni++]=Ti,ti[ni++]=Uo,Uo=s;var h=Oi;s=Ti;var y=32-gn(h)-1;h&=~(1<<y),u+=1;var b=32-gn(l)+y;if(30<b){var S=y-y%5;b=(h&(1<<S)-1).toString(32),h>>=S,y-=S,Oi=1<<32-gn(l)+y|u<<y|h,Ti=b+s}else Oi=1<<b|u<<y|h,Ti=s}function pp(s){s.return!==null&&(so(s,1),Jv(s,1,0))}function gp(s){for(;s===wu;)wu=Ua[--za],Ua[za]=null,ll=Ua[--za],Ua[za]=null;for(;s===Uo;)Uo=ti[--ni],ti[ni]=null,Ti=ti[--ni],ti[ni]=null,Oi=ti[--ni],ti[ni]=null}function Zv(s,l){ti[ni++]=Oi,ti[ni++]=Ti,ti[ni++]=Uo,Oi=l.id,Ti=l.overflow,Uo=s}var Zt=null,vt=null,We=!1,zo=null,ii=!1,mp=Error(i(519));function Fo(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cl(ei(l,s)),mp}function e0(s){var l=s.stateNode,u=s.type,h=s.memoizedProps;switch(l[Jt]=s,l[kn]=h,u){case"dialog":Fe("cancel",l),Fe("close",l);break;case"iframe":case"object":case"embed":Fe("load",l);break;case"video":case"audio":for(u=0;u<Nl.length;u++)Fe(Nl[u],l);break;case"source":Fe("error",l);break;case"img":case"image":case"link":Fe("error",l),Fe("load",l);break;case"details":Fe("toggle",l);break;case"input":Fe("invalid",l),fv(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Fe("invalid",l);break;case"textarea":Fe("invalid",l),gv(l,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||yS(l.textContent,u)?(h.popover!=null&&(Fe("beforetoggle",l),Fe("toggle",l)),h.onScroll!=null&&Fe("scroll",l),h.onScrollEnd!=null&&Fe("scrollend",l),h.onClick!=null&&(l.onclick=no),l=!0):l=!1,l||Fo(s,!0)}function t0(s){for(Zt=s.return;Zt;)switch(Zt.tag){case 5:case 31:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:Zt=Zt.return}}function Fa(s){if(s!==Zt)return!1;if(!We)return t0(s),We=!0,!1;var l=s.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Eg(s.type,s.memoizedProps)),u=!u),u&&vt&&Fo(s),t0(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));vt=PS(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));vt=PS(s)}else l===27?(l=vt,ns(s.type)?(s=_g,_g=null,vt=s):vt=l):vt=Zt?si(s.stateNode.nextSibling):null;return!0}function js(){vt=Zt=null,We=!1}function yp(){var s=zo;return s!==null&&(On===null?On=s:On.push.apply(On,s),zo=null),s}function cl(s){zo===null?zo=[s]:zo.push(s)}var bp=de(null),Bs=null,ao=null;function qo(s,l,u){te(bp,l._currentValue),l._currentValue=u}function ro(s){s._currentValue=bp.current,be(bp)}function xp(s,l,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===u)break;s=s.return}}function vp(s,l,u,h){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var b=y.dependencies;if(b!==null){var S=y.child;b=b.firstContext;e:for(;b!==null;){var P=b;b=y;for(var R=0;R<l.length;R++)if(P.context===l[R]){b.lanes|=u,P=b.alternate,P!==null&&(P.lanes|=u),xp(b.return,u,s),h||(S=null);break e}b=P.next}}else if(y.tag===18){if(S=y.return,S===null)throw Error(i(341));S.lanes|=u,b=S.alternate,b!==null&&(b.lanes|=u),xp(S,u,s),S=null}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===s){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}}function qa(s,l,u,h){s=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var S=y.alternate;if(S===null)throw Error(i(387));if(S=S.memoizedProps,S!==null){var P=y.type;Bn(y.pendingProps.value,S.value)||(s!==null?s.push(P):s=[P])}}else if(y===ye.current){if(S=y.alternate,S===null)throw Error(i(387));S.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(jl):s=[jl])}y=y.return}s!==null&&vp(l,s,u,h),l.flags|=262144}function Au(s){for(s=s.firstContext;s!==null;){if(!Bn(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Hs(s){Bs=s,ao=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function en(s){return n0(Bs,s)}function Pu(s,l){return Bs===null&&Hs(s),n0(s,l)}function n0(s,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},ao===null){if(s===null)throw Error(i(308));ao=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else ao=ao.next=l;return u}var gL=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(u){return u()})}},mL=n.unstable_scheduleCallback,yL=n.unstable_NormalPriority,Bt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cp(){return{controller:new gL,data:new Map,refCount:0}}function ul(s){s.refCount--,s.refCount===0&&mL(yL,function(){s.controller.abort()})}var dl=null,Sp=0,Ga=0,Ka=null;function bL(s,l){if(dl===null){var u=dl=[];Sp=0,Ga=Ag(),Ka={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Sp++,l.then(i0,i0),l}function i0(){if(--Sp===0&&dl!==null){Ka!==null&&(Ka.status="fulfilled");var s=dl;dl=null,Ga=0,Ka=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function xL(s,l){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var o0=B.S;B.S=function(s,l){zC=Xt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&bL(s,l),o0!==null&&o0(s,l)};var _s=de(null);function kp(){var s=_s.current;return s!==null?s:pt.pooledCache}function Du(s,l){l===null?te(_s,_s.current):te(_s,l.pool)}function s0(){var s=kp();return s===null?null:{parent:Bt._currentValue,pool:s}}var Va=Error(i(460)),wp=Error(i(474)),Ou=Error(i(542)),Tu={then:function(){}};function a0(s){return s=s.status,s==="fulfilled"||s==="rejected"}function r0(s,l,u){switch(u=s[u],u===void 0?s.push(l):u!==l&&(l.then(no,no),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c0(s),s;default:if(typeof l.status=="string")l.then(no,no);else{if(s=pt,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,c0(s),s}throw zs=l,Va}}function Us(s){try{var l=s._init;return l(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(zs=u,Va):u}}var zs=null;function l0(){if(zs===null)throw Error(i(459));var s=zs;return zs=null,s}function c0(s){if(s===Va||s===Ou)throw Error(i(483))}var Wa=null,hl=0;function Mu(s){var l=hl;return hl+=1,Wa===null&&(Wa=[]),r0(Wa,s,l)}function fl(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Nu(s,l){throw l.$$typeof===x?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function u0(s){function l(H,j){if(s){var F=H.deletions;F===null?(H.deletions=[j],H.flags|=16):F.push(j)}}function u(H,j){if(!s)return null;for(;j!==null;)l(H,j),j=j.sibling;return null}function h(H){for(var j=new Map;H!==null;)H.key!==null?j.set(H.key,H):j.set(H.index,H),H=H.sibling;return j}function y(H,j){return H=oo(H,j),H.index=0,H.sibling=null,H}function b(H,j,F){return H.index=F,s?(F=H.alternate,F!==null?(F=F.index,F<j?(H.flags|=67108866,j):F):(H.flags|=67108866,j)):(H.flags|=1048576,j)}function S(H){return s&&H.alternate===null&&(H.flags|=67108866),H}function P(H,j,F,ee){return j===null||j.tag!==6?(j=hp(F,H.mode,ee),j.return=H,j):(j=y(j,F),j.return=H,j)}function R(H,j,F,ee){var Ae=F.type;return Ae===k?$(H,j,F.props.children,ee,F.key):j!==null&&(j.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===K&&Us(Ae)===j.type)?(j=y(j,F.props),fl(j,F),j.return=H,j):(j=ku(F.type,F.key,F.props,null,H.mode,ee),fl(j,F),j.return=H,j)}function G(H,j,F,ee){return j===null||j.tag!==4||j.stateNode.containerInfo!==F.containerInfo||j.stateNode.implementation!==F.implementation?(j=fp(F,H.mode,ee),j.return=H,j):(j=y(j,F.children||[]),j.return=H,j)}function $(H,j,F,ee,Ae){return j===null||j.tag!==7?(j=Is(F,H.mode,ee,Ae),j.return=H,j):(j=y(j,F),j.return=H,j)}function ne(H,j,F){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=hp(""+j,H.mode,F),j.return=H,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case v:return F=ku(j.type,j.key,j.props,null,H.mode,F),fl(F,j),F.return=H,F;case C:return j=fp(j,H.mode,F),j.return=H,j;case K:return j=Us(j),ne(H,j,F)}if(oe(j)||_(j))return j=Is(j,H.mode,F,null),j.return=H,j;if(typeof j.then=="function")return ne(H,Mu(j),F);if(j.$$typeof===M)return ne(H,Pu(H,j),F);Nu(H,j)}return null}function W(H,j,F,ee){var Ae=j!==null?j.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ae!==null?null:P(H,j,""+F,ee);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return F.key===Ae?R(H,j,F,ee):null;case C:return F.key===Ae?G(H,j,F,ee):null;case K:return F=Us(F),W(H,j,F,ee)}if(oe(F)||_(F))return Ae!==null?null:$(H,j,F,ee,null);if(typeof F.then=="function")return W(H,j,Mu(F),ee);if(F.$$typeof===M)return W(H,j,Pu(H,F),ee);Nu(H,F)}return null}function Q(H,j,F,ee,Ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return H=H.get(F)||null,P(j,H,""+ee,Ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:return H=H.get(ee.key===null?F:ee.key)||null,R(j,H,ee,Ae);case C:return H=H.get(ee.key===null?F:ee.key)||null,G(j,H,ee,Ae);case K:return ee=Us(ee),Q(H,j,F,ee,Ae)}if(oe(ee)||_(ee))return H=H.get(F)||null,$(j,H,ee,Ae,null);if(typeof ee.then=="function")return Q(H,j,F,Mu(ee),Ae);if(ee.$$typeof===M)return Q(H,j,F,Pu(j,ee),Ae);Nu(j,ee)}return null}function ve(H,j,F,ee){for(var Ae=null,Ze=null,ke=j,Ie=j=0,Ke=null;ke!==null&&Ie<F.length;Ie++){ke.index>Ie?(Ke=ke,ke=null):Ke=ke.sibling;var et=W(H,ke,F[Ie],ee);if(et===null){ke===null&&(ke=Ke);break}s&&ke&&et.alternate===null&&l(H,ke),j=b(et,j,Ie),Ze===null?Ae=et:Ze.sibling=et,Ze=et,ke=Ke}if(Ie===F.length)return u(H,ke),We&&so(H,Ie),Ae;if(ke===null){for(;Ie<F.length;Ie++)ke=ne(H,F[Ie],ee),ke!==null&&(j=b(ke,j,Ie),Ze===null?Ae=ke:Ze.sibling=ke,Ze=ke);return We&&so(H,Ie),Ae}for(ke=h(ke);Ie<F.length;Ie++)Ke=Q(ke,H,Ie,F[Ie],ee),Ke!==null&&(s&&Ke.alternate!==null&&ke.delete(Ke.key===null?Ie:Ke.key),j=b(Ke,j,Ie),Ze===null?Ae=Ke:Ze.sibling=Ke,Ze=Ke);return s&&ke.forEach(function(rs){return l(H,rs)}),We&&so(H,Ie),Ae}function De(H,j,F,ee){if(F==null)throw Error(i(151));for(var Ae=null,Ze=null,ke=j,Ie=j=0,Ke=null,et=F.next();ke!==null&&!et.done;Ie++,et=F.next()){ke.index>Ie?(Ke=ke,ke=null):Ke=ke.sibling;var rs=W(H,ke,et.value,ee);if(rs===null){ke===null&&(ke=Ke);break}s&&ke&&rs.alternate===null&&l(H,ke),j=b(rs,j,Ie),Ze===null?Ae=rs:Ze.sibling=rs,Ze=rs,ke=Ke}if(et.done)return u(H,ke),We&&so(H,Ie),Ae;if(ke===null){for(;!et.done;Ie++,et=F.next())et=ne(H,et.value,ee),et!==null&&(j=b(et,j,Ie),Ze===null?Ae=et:Ze.sibling=et,Ze=et);return We&&so(H,Ie),Ae}for(ke=h(ke);!et.done;Ie++,et=F.next())et=Q(ke,H,Ie,et.value,ee),et!==null&&(s&&et.alternate!==null&&ke.delete(et.key===null?Ie:et.key),j=b(et,j,Ie),Ze===null?Ae=et:Ze.sibling=et,Ze=et);return s&&ke.forEach(function(MR){return l(H,MR)}),We&&so(H,Ie),Ae}function ut(H,j,F,ee){if(typeof F=="object"&&F!==null&&F.type===k&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case v:e:{for(var Ae=F.key;j!==null;){if(j.key===Ae){if(Ae=F.type,Ae===k){if(j.tag===7){u(H,j.sibling),ee=y(j,F.props.children),ee.return=H,H=ee;break e}}else if(j.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===K&&Us(Ae)===j.type){u(H,j.sibling),ee=y(j,F.props),fl(ee,F),ee.return=H,H=ee;break e}u(H,j);break}else l(H,j);j=j.sibling}F.type===k?(ee=Is(F.props.children,H.mode,ee,F.key),ee.return=H,H=ee):(ee=ku(F.type,F.key,F.props,null,H.mode,ee),fl(ee,F),ee.return=H,H=ee)}return S(H);case C:e:{for(Ae=F.key;j!==null;){if(j.key===Ae)if(j.tag===4&&j.stateNode.containerInfo===F.containerInfo&&j.stateNode.implementation===F.implementation){u(H,j.sibling),ee=y(j,F.children||[]),ee.return=H,H=ee;break e}else{u(H,j);break}else l(H,j);j=j.sibling}ee=fp(F,H.mode,ee),ee.return=H,H=ee}return S(H);case K:return F=Us(F),ut(H,j,F,ee)}if(oe(F))return ve(H,j,F,ee);if(_(F)){if(Ae=_(F),typeof Ae!="function")throw Error(i(150));return F=Ae.call(F),De(H,j,F,ee)}if(typeof F.then=="function")return ut(H,j,Mu(F),ee);if(F.$$typeof===M)return ut(H,j,Pu(H,F),ee);Nu(H,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,j!==null&&j.tag===6?(u(H,j.sibling),ee=y(j,F),ee.return=H,H=ee):(u(H,j),ee=hp(F,H.mode,ee),ee.return=H,H=ee),S(H)):u(H,j)}return function(H,j,F,ee){try{hl=0;var Ae=ut(H,j,F,ee);return Wa=null,Ae}catch(ke){if(ke===Va||ke===Ou)throw ke;var Ze=Hn(29,ke,null,H.mode);return Ze.lanes=ee,Ze.return=H,Ze}finally{}}}var Fs=u0(!0),d0=u0(!1),Go=!1;function Ap(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pp(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ko(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Vo(s,l,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(ot&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=Su(s),Qv(s,null,u),l}return Cu(s,h,l,u),Su(s)}function pl(s,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,nv(s,u)}}function Dp(s,l){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var S={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=S:b=b.next=S,u=u.next}while(u!==null);b===null?y=b=l:b=b.next=l}else y=b=l;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=l}var Op=!1;function gl(){if(Op){var s=Ka;if(s!==null)throw s}}function ml(s,l,u,h){Op=!1;var y=s.updateQueue;Go=!1;var b=y.firstBaseUpdate,S=y.lastBaseUpdate,P=y.shared.pending;if(P!==null){y.shared.pending=null;var R=P,G=R.next;R.next=null,S===null?b=G:S.next=G,S=R;var $=s.alternate;$!==null&&($=$.updateQueue,P=$.lastBaseUpdate,P!==S&&(P===null?$.firstBaseUpdate=G:P.next=G,$.lastBaseUpdate=R))}if(b!==null){var ne=y.baseState;S=0,$=G=R=null,P=b;do{var W=P.lane&-536870913,Q=W!==P.lane;if(Q?(Ge&W)===W:(h&W)===W){W!==0&&W===Ga&&(Op=!0),$!==null&&($=$.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var ve=s,De=P;W=l;var ut=u;switch(De.tag){case 1:if(ve=De.payload,typeof ve=="function"){ne=ve.call(ut,ne,W);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=De.payload,W=typeof ve=="function"?ve.call(ut,ne,W):ve,W==null)break e;ne=m({},ne,W);break e;case 2:Go=!0}}W=P.callback,W!==null&&(s.flags|=64,Q&&(s.flags|=8192),Q=y.callbacks,Q===null?y.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:P.tag,payload:P.payload,callback:P.callback,next:null},$===null?(G=$=Q,R=ne):$=$.next=Q,S|=W;if(P=P.next,P===null){if(P=y.shared.pending,P===null)break;Q=P,P=Q.next,Q.next=null,y.lastBaseUpdate=Q,y.shared.pending=null}}while(!0);$===null&&(R=ne),y.baseState=R,y.firstBaseUpdate=G,y.lastBaseUpdate=$,b===null&&(y.shared.lanes=0),Xo|=S,s.lanes=S,s.memoizedState=ne}}function h0(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function f0(s,l){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)h0(u[s],l)}var Qa=de(null),Lu=de(0);function p0(s,l){s=yo,te(Lu,s),te(Qa,l),yo=s|l.baseLanes}function Tp(){te(Lu,yo),te(Qa,Qa.current)}function Mp(){yo=Lu.current,be(Qa),be(Lu)}var _n=de(null),oi=null;function Wo(s){var l=s.alternate;te(Lt,Lt.current&1),te(_n,s),oi===null&&(l===null||Qa.current!==null||l.memoizedState!==null)&&(oi=s)}function Np(s){te(Lt,Lt.current),te(_n,s),oi===null&&(oi=s)}function g0(s){s.tag===22?(te(Lt,Lt.current),te(_n,s),oi===null&&(oi=s)):Qo()}function Qo(){te(Lt,Lt.current),te(_n,_n.current)}function Un(s){be(_n),oi===s&&(oi=null),be(Lt)}var Lt=de(0);function Ru(s){for(var l=s;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Bg(u)||Hg(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var lo=0,Ee=null,lt=null,Ht=null,Eu=!1,Ya=!1,qs=!1,Iu=0,yl=0,$a=null,vL=0;function Dt(){throw Error(i(321))}function Lp(s,l){if(l===null)return!1;for(var u=0;u<l.length&&u<s.length;u++)if(!Bn(s[u],l[u]))return!1;return!0}function Rp(s,l,u,h,y,b){return lo=b,Ee=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,B.H=s===null||s.memoizedState===null?J0:Qp,qs=!1,b=u(h,y),qs=!1,Ya&&(b=y0(l,u,h,y)),m0(s),b}function m0(s){B.H=vl;var l=lt!==null&&lt.next!==null;if(lo=0,Ht=lt=Ee=null,Eu=!1,yl=0,$a=null,l)throw Error(i(300));s===null||_t||(s=s.dependencies,s!==null&&Au(s)&&(_t=!0))}function y0(s,l,u,h){Ee=s;var y=0;do{if(Ya&&($a=null),yl=0,Ya=!1,25<=y)throw Error(i(301));if(y+=1,Ht=lt=null,s.updateQueue!=null){var b=s.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}B.H=Z0,b=l(u,h)}while(Ya);return b}function CL(){var s=B.H,l=s.useState()[0];return l=typeof l.then=="function"?bl(l):l,s=s.useState()[0],(lt!==null?lt.memoizedState:null)!==s&&(Ee.flags|=1024),l}function Ep(){var s=Iu!==0;return Iu=0,s}function Ip(s,l,u){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~u}function jp(s){if(Eu){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Eu=!1}lo=0,Ht=lt=Ee=null,Ya=!1,yl=Iu=0,$a=null}function mn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ee.memoizedState=Ht=s:Ht=Ht.next=s,Ht}function Rt(){if(lt===null){var s=Ee.alternate;s=s!==null?s.memoizedState:null}else s=lt.next;var l=Ht===null?Ee.memoizedState:Ht.next;if(l!==null)Ht=l,lt=s;else{if(s===null)throw Ee.alternate===null?Error(i(467)):Error(i(310));lt=s,s={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Ht===null?Ee.memoizedState=Ht=s:Ht=Ht.next=s}return Ht}function ju(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(s){var l=yl;return yl+=1,$a===null&&($a=[]),s=r0($a,s,l),l=Ee,(Ht===null?l.memoizedState:Ht.next)===null&&(l=l.alternate,B.H=l===null||l.memoizedState===null?J0:Qp),s}function Bu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return bl(s);if(s.$$typeof===M)return en(s)}throw Error(i(438,String(s)))}function Bp(s){var l=null,u=Ee.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=Ee.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=ju(),Ee.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(s),h=0;h<s;h++)u[h]=z;return l.index++,u}function co(s,l){return typeof l=="function"?l(s):l}function Hu(s){var l=Rt();return Hp(l,lt,s)}function Hp(s,l,u){var h=s.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var y=s.baseQueue,b=h.pending;if(b!==null){if(y!==null){var S=y.next;y.next=b.next,b.next=S}l.baseQueue=y=b,h.pending=null}if(b=s.baseState,y===null)s.memoizedState=b;else{l=y.next;var P=S=null,R=null,G=l,$=!1;do{var ne=G.lane&-536870913;if(ne!==G.lane?(Ge&ne)===ne:(lo&ne)===ne){var W=G.revertLane;if(W===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ne===Ga&&($=!0);else if((lo&W)===W){G=G.next,W===Ga&&($=!0);continue}else ne={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(P=R=ne,S=b):R=R.next=ne,Ee.lanes|=W,Xo|=W;ne=G.action,qs&&u(b,ne),b=G.hasEagerState?G.eagerState:u(b,ne)}else W={lane:ne,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(P=R=W,S=b):R=R.next=W,Ee.lanes|=ne,Xo|=ne;G=G.next}while(G!==null&&G!==l);if(R===null?S=b:R.next=P,!Bn(b,s.memoizedState)&&(_t=!0,$&&(u=Ka,u!==null)))throw u;s.memoizedState=b,s.baseState=S,s.baseQueue=R,h.lastRenderedState=b}return y===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function _p(s){var l=Rt(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=s;var h=u.dispatch,y=u.pending,b=l.memoizedState;if(y!==null){u.pending=null;var S=y=y.next;do b=s(b,S.action),S=S.next;while(S!==y);Bn(b,l.memoizedState)||(_t=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),u.lastRenderedState=b}return[b,h]}function b0(s,l,u){var h=Ee,y=Rt(),b=We;if(b){if(u===void 0)throw Error(i(407));u=u()}else u=l();var S=!Bn((lt||y).memoizedState,u);if(S&&(y.memoizedState=u,_t=!0),y=y.queue,Fp(C0.bind(null,h,y,s),[s]),y.getSnapshot!==l||S||Ht!==null&&Ht.memoizedState.tag&1){if(h.flags|=2048,Xa(9,{destroy:void 0},v0.bind(null,h,y,u,l),null),pt===null)throw Error(i(349));b||(lo&127)!==0||x0(h,l,u)}return u}function x0(s,l,u){s.flags|=16384,s={getSnapshot:l,value:u},l=Ee.updateQueue,l===null?(l=ju(),Ee.updateQueue=l,l.stores=[s]):(u=l.stores,u===null?l.stores=[s]:u.push(s))}function v0(s,l,u,h){l.value=u,l.getSnapshot=h,S0(l)&&k0(s)}function C0(s,l,u){return u(function(){S0(l)&&k0(s)})}function S0(s){var l=s.getSnapshot;s=s.value;try{var u=l();return!Bn(s,u)}catch{return!0}}function k0(s){var l=Es(s,2);l!==null&&Tn(l,s,2)}function Up(s){var l=mn();if(typeof s=="function"){var u=s;if(s=u(),qs){Di(!0);try{u()}finally{Di(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:s},l}function w0(s,l,u,h){return s.baseState=u,Hp(s,lt,typeof h=="function"?h:co)}function SL(s,l,u,h,y){if(zu(s))throw Error(i(485));if(s=l.action,s!==null){var b={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){b.listeners.push(S)}};B.T!==null?u(!0):b.isTransition=!1,h(b),u=l.pending,u===null?(b.next=l.pending=b,A0(l,b)):(b.next=u.next,l.pending=u.next=b)}}function A0(s,l){var u=l.action,h=l.payload,y=s.state;if(l.isTransition){var b=B.T,S={};B.T=S;try{var P=u(y,h),R=B.S;R!==null&&R(S,P),P0(s,l,P)}catch(G){zp(s,l,G)}finally{b!==null&&S.types!==null&&(b.types=S.types),B.T=b}}else try{b=u(y,h),P0(s,l,b)}catch(G){zp(s,l,G)}}function P0(s,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){D0(s,l,h)},function(h){return zp(s,l,h)}):D0(s,l,u)}function D0(s,l,u){l.status="fulfilled",l.value=u,O0(l),s.state=u,l=s.pending,l!==null&&(u=l.next,u===l?s.pending=null:(u=u.next,l.next=u,A0(s,u)))}function zp(s,l,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,O0(l),l=l.next;while(l!==h)}s.action=null}function O0(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function T0(s,l){return l}function M0(s,l){if(We){var u=pt.formState;if(u!==null){e:{var h=Ee;if(We){if(vt){t:{for(var y=vt,b=ii;y.nodeType!==8;){if(!b){y=null;break t}if(y=si(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){vt=si(y.nextSibling),h=y.data==="F!";break e}}Fo(h)}h=!1}h&&(l=u[0])}}return u=mn(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:T0,lastRenderedState:l},u.queue=h,u=Y0.bind(null,Ee,h),h.dispatch=u,h=Up(!1),b=Wp.bind(null,Ee,!1,h.queue),h=mn(),y={state:l,dispatch:null,action:s,pending:null},h.queue=y,u=SL.bind(null,Ee,y,b,u),y.dispatch=u,h.memoizedState=s,[l,u,!1]}function N0(s){var l=Rt();return L0(l,lt,s)}function L0(s,l,u){if(l=Hp(s,l,T0)[0],s=Hu(co)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=bl(l)}catch(S){throw S===Va?Ou:S}else h=l;l=Rt();var y=l.queue,b=y.dispatch;return u!==l.memoizedState&&(Ee.flags|=2048,Xa(9,{destroy:void 0},kL.bind(null,y,u),null)),[h,b,s]}function kL(s,l){s.action=l}function R0(s){var l=Rt(),u=lt;if(u!==null)return L0(l,u,s);Rt(),l=l.memoizedState,u=Rt();var h=u.queue.dispatch;return u.memoizedState=s,[l,h,!1]}function Xa(s,l,u,h){return s={tag:s,create:u,deps:h,inst:l,next:null},l=Ee.updateQueue,l===null&&(l=ju(),Ee.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,l.lastEffect=s),s}function E0(){return Rt().memoizedState}function _u(s,l,u,h){var y=mn();Ee.flags|=s,y.memoizedState=Xa(1|l,{destroy:void 0},u,h===void 0?null:h)}function Uu(s,l,u,h){var y=Rt();h=h===void 0?null:h;var b=y.memoizedState.inst;lt!==null&&h!==null&&Lp(h,lt.memoizedState.deps)?y.memoizedState=Xa(l,b,u,h):(Ee.flags|=s,y.memoizedState=Xa(1|l,b,u,h))}function I0(s,l){_u(8390656,8,s,l)}function Fp(s,l){Uu(2048,8,s,l)}function wL(s){Ee.flags|=4;var l=Ee.updateQueue;if(l===null)l=ju(),Ee.updateQueue=l,l.events=[s];else{var u=l.events;u===null?l.events=[s]:u.push(s)}}function j0(s){var l=Rt().memoizedState;return wL({ref:l,nextImpl:s}),function(){if((ot&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function B0(s,l){return Uu(4,2,s,l)}function H0(s,l){return Uu(4,4,s,l)}function _0(s,l){if(typeof l=="function"){s=s();var u=l(s);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function U0(s,l,u){u=u!=null?u.concat([s]):null,Uu(4,4,_0.bind(null,l,s),u)}function qp(){}function z0(s,l){var u=Rt();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&Lp(l,h[1])?h[0]:(u.memoizedState=[s,l],s)}function F0(s,l){var u=Rt();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&Lp(l,h[1]))return h[0];if(h=s(),qs){Di(!0);try{s()}finally{Di(!1)}}return u.memoizedState=[h,l],h}function Gp(s,l,u){return u===void 0||(lo&1073741824)!==0&&(Ge&261930)===0?s.memoizedState=l:(s.memoizedState=u,s=qC(),Ee.lanes|=s,Xo|=s,u)}function q0(s,l,u,h){return Bn(u,l)?u:Qa.current!==null?(s=Gp(s,u,h),Bn(s,l)||(_t=!0),s):(lo&42)===0||(lo&1073741824)!==0&&(Ge&261930)===0?(_t=!0,s.memoizedState=u):(s=qC(),Ee.lanes|=s,Xo|=s,l)}function G0(s,l,u,h,y){var b=Z.p;Z.p=b!==0&&8>b?b:8;var S=B.T,P={};B.T=P,Wp(s,!1,l,u);try{var R=y(),G=B.S;if(G!==null&&G(P,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var $=xL(R,h);xl(s,l,$,qn(s))}else xl(s,l,h,qn(s))}catch(ne){xl(s,l,{then:function(){},status:"rejected",reason:ne},qn())}finally{Z.p=b,S!==null&&P.types!==null&&(S.types=P.types),B.T=S}}function AL(){}function Kp(s,l,u,h){if(s.tag!==5)throw Error(i(476));var y=K0(s).queue;G0(s,y,l,se,u===null?AL:function(){return V0(s),u(h)})}function K0(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:se},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:u},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function V0(s){var l=K0(s);l.next===null&&(l=s.alternate.memoizedState),xl(s,l.next.queue,{},qn())}function Vp(){return en(jl)}function W0(){return Rt().memoizedState}function Q0(){return Rt().memoizedState}function PL(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var u=qn();s=Ko(u);var h=Vo(l,s,u);h!==null&&(Tn(h,l,u),pl(h,l,u)),l={cache:Cp()},s.payload=l;return}l=l.return}}function DL(s,l,u){var h=qn();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},zu(s)?$0(l,u):(u=up(s,l,u,h),u!==null&&(Tn(u,s,h),X0(u,l,h)))}function Y0(s,l,u){var h=qn();xl(s,l,u,h)}function xl(s,l,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(zu(s))$0(l,y);else{var b=s.alternate;if(s.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var S=l.lastRenderedState,P=b(S,u);if(y.hasEagerState=!0,y.eagerState=P,Bn(P,S))return Cu(s,l,y,0),pt===null&&vu(),!1}catch{}finally{}if(u=up(s,l,y,h),u!==null)return Tn(u,s,h),X0(u,l,h),!0}return!1}function Wp(s,l,u,h){if(h={lane:2,revertLane:Ag(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},zu(s)){if(l)throw Error(i(479))}else l=up(s,u,h,2),l!==null&&Tn(l,s,2)}function zu(s){var l=s.alternate;return s===Ee||l!==null&&l===Ee}function $0(s,l){Ya=Eu=!0;var u=s.pending;u===null?l.next=l:(l.next=u.next,u.next=l),s.pending=l}function X0(s,l,u){if((u&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,u|=h,l.lanes=u,nv(s,u)}}var vl={readContext:en,use:Bu,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};vl.useEffectEvent=Dt;var J0={readContext:en,use:Bu,useCallback:function(s,l){return mn().memoizedState=[s,l===void 0?null:l],s},useContext:en,useEffect:I0,useImperativeHandle:function(s,l,u){u=u!=null?u.concat([s]):null,_u(4194308,4,_0.bind(null,l,s),u)},useLayoutEffect:function(s,l){return _u(4194308,4,s,l)},useInsertionEffect:function(s,l){_u(4,2,s,l)},useMemo:function(s,l){var u=mn();l=l===void 0?null:l;var h=s();if(qs){Di(!0);try{s()}finally{Di(!1)}}return u.memoizedState=[h,l],h},useReducer:function(s,l,u){var h=mn();if(u!==void 0){var y=u(l);if(qs){Di(!0);try{u(l)}finally{Di(!1)}}}else y=l;return h.memoizedState=h.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},h.queue=s,s=s.dispatch=DL.bind(null,Ee,s),[h.memoizedState,s]},useRef:function(s){var l=mn();return s={current:s},l.memoizedState=s},useState:function(s){s=Up(s);var l=s.queue,u=Y0.bind(null,Ee,l);return l.dispatch=u,[s.memoizedState,u]},useDebugValue:qp,useDeferredValue:function(s,l){var u=mn();return Gp(u,s,l)},useTransition:function(){var s=Up(!1);return s=G0.bind(null,Ee,s.queue,!0,!1),mn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,u){var h=Ee,y=mn();if(We){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),pt===null)throw Error(i(349));(Ge&127)!==0||x0(h,l,u)}y.memoizedState=u;var b={value:u,getSnapshot:l};return y.queue=b,I0(C0.bind(null,h,b,s),[s]),h.flags|=2048,Xa(9,{destroy:void 0},v0.bind(null,h,b,u,l),null),u},useId:function(){var s=mn(),l=pt.identifierPrefix;if(We){var u=Ti,h=Oi;u=(h&~(1<<32-gn(h)-1)).toString(32)+u,l="_"+l+"R_"+u,u=Iu++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=vL++,l="_"+l+"r_"+u.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:Vp,useFormState:M0,useActionState:M0,useOptimistic:function(s){var l=mn();l.memoizedState=l.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Wp.bind(null,Ee,!0,u),u.dispatch=l,[s,l]},useMemoCache:Bp,useCacheRefresh:function(){return mn().memoizedState=PL.bind(null,Ee)},useEffectEvent:function(s){var l=mn(),u={impl:s};return l.memoizedState=u,function(){if((ot&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Qp={readContext:en,use:Bu,useCallback:z0,useContext:en,useEffect:Fp,useImperativeHandle:U0,useInsertionEffect:B0,useLayoutEffect:H0,useMemo:F0,useReducer:Hu,useRef:E0,useState:function(){return Hu(co)},useDebugValue:qp,useDeferredValue:function(s,l){var u=Rt();return q0(u,lt.memoizedState,s,l)},useTransition:function(){var s=Hu(co)[0],l=Rt().memoizedState;return[typeof s=="boolean"?s:bl(s),l]},useSyncExternalStore:b0,useId:W0,useHostTransitionStatus:Vp,useFormState:N0,useActionState:N0,useOptimistic:function(s,l){var u=Rt();return w0(u,lt,s,l)},useMemoCache:Bp,useCacheRefresh:Q0};Qp.useEffectEvent=j0;var Z0={readContext:en,use:Bu,useCallback:z0,useContext:en,useEffect:Fp,useImperativeHandle:U0,useInsertionEffect:B0,useLayoutEffect:H0,useMemo:F0,useReducer:_p,useRef:E0,useState:function(){return _p(co)},useDebugValue:qp,useDeferredValue:function(s,l){var u=Rt();return lt===null?Gp(u,s,l):q0(u,lt.memoizedState,s,l)},useTransition:function(){var s=_p(co)[0],l=Rt().memoizedState;return[typeof s=="boolean"?s:bl(s),l]},useSyncExternalStore:b0,useId:W0,useHostTransitionStatus:Vp,useFormState:R0,useActionState:R0,useOptimistic:function(s,l){var u=Rt();return lt!==null?w0(u,lt,s,l):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Bp,useCacheRefresh:Q0};Z0.useEffectEvent=j0;function Yp(s,l,u,h){l=s.memoizedState,u=u(h,l),u=u==null?l:m({},l,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var $p={enqueueSetState:function(s,l,u){s=s._reactInternals;var h=qn(),y=Ko(h);y.payload=l,u!=null&&(y.callback=u),l=Vo(s,y,h),l!==null&&(Tn(l,s,h),pl(l,s,h))},enqueueReplaceState:function(s,l,u){s=s._reactInternals;var h=qn(),y=Ko(h);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=Vo(s,y,h),l!==null&&(Tn(l,s,h),pl(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var u=qn(),h=Ko(u);h.tag=2,l!=null&&(h.callback=l),l=Vo(s,h,u),l!==null&&(Tn(l,s,u),pl(l,s,u))}};function eC(s,l,u,h,y,b,S){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,b,S):l.prototype&&l.prototype.isPureReactComponent?!al(u,h)||!al(y,b):!0}function tC(s,l,u,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==s&&$p.enqueueReplaceState(l,l.state,null)}function Gs(s,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(s=s.defaultProps){u===l&&(u=m({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function nC(s){xu(s)}function iC(s){console.error(s)}function oC(s){xu(s)}function Fu(s,l){try{var u=s.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function sC(s,l,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Xp(s,l,u){return u=Ko(u),u.tag=3,u.payload={element:null},u.callback=function(){Fu(s,l)},u}function aC(s){return s=Ko(s),s.tag=3,s}function rC(s,l,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;s.payload=function(){return y(b)},s.callback=function(){sC(l,u,h)}}var S=u.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(s.callback=function(){sC(l,u,h),typeof y!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this));var P=h.stack;this.componentDidCatch(h.value,{componentStack:P!==null?P:""})})}function OL(s,l,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&qa(l,u,y,!0),u=_n.current,u!==null){switch(u.tag){case 31:case 13:return oi===null?ed():u.alternate===null&&Ot===0&&(Ot=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===Tu?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),Sg(s,h,y)),!1;case 22:return u.flags|=65536,h===Tu?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),Sg(s,h,y)),!1}throw Error(i(435,u.tag))}return Sg(s,h,y),ed(),!1}if(We)return l=_n.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==mp&&(s=Error(i(422),{cause:h}),cl(ei(s,u)))):(h!==mp&&(l=Error(i(423),{cause:h}),cl(ei(l,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,h=ei(h,u),y=Xp(s.stateNode,h,y),Dp(s,y),Ot!==4&&(Ot=2)),!1;var b=Error(i(520),{cause:h});if(b=ei(b,u),Ol===null?Ol=[b]:Ol.push(b),Ot!==4&&(Ot=2),l===null)return!0;h=ei(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=Xp(u.stateNode,h,s),Dp(u,s),!1;case 1:if(l=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Jo===null||!Jo.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=aC(y),rC(y,s,u,h),Dp(u,y),!1}u=u.return}while(u!==null);return!1}var Jp=Error(i(461)),_t=!1;function tn(s,l,u,h){l.child=s===null?d0(l,null,u,h):Fs(l,s.child,u,h)}function lC(s,l,u,h,y){u=u.render;var b=l.ref;if("ref"in h){var S={};for(var P in h)P!=="ref"&&(S[P]=h[P])}else S=h;return Hs(l),h=Rp(s,l,u,S,b,y),P=Ep(),s!==null&&!_t?(Ip(s,l,y),uo(s,l,y)):(We&&P&&pp(l),l.flags|=1,tn(s,l,h,y),l.child)}function cC(s,l,u,h,y){if(s===null){var b=u.type;return typeof b=="function"&&!dp(b)&&b.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=b,uC(s,l,b,h,y)):(s=ku(u.type,null,h,l,l.mode,y),s.ref=l.ref,s.return=l,l.child=s)}if(b=s.child,!ag(s,y)){var S=b.memoizedProps;if(u=u.compare,u=u!==null?u:al,u(S,h)&&s.ref===l.ref)return uo(s,l,y)}return l.flags|=1,s=oo(b,h),s.ref=l.ref,s.return=l,l.child=s}function uC(s,l,u,h,y){if(s!==null){var b=s.memoizedProps;if(al(b,h)&&s.ref===l.ref)if(_t=!1,l.pendingProps=h=b,ag(s,y))(s.flags&131072)!==0&&(_t=!0);else return l.lanes=s.lanes,uo(s,l,y)}return Zp(s,l,u,h,y)}function dC(s,l,u,h){var y=h.children,b=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,s!==null){for(h=l.child=s.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~b}else h=0,l.child=null;return hC(s,l,b,u,h)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Du(l,b!==null?b.cachePool:null),b!==null?p0(l,b):Tp(),g0(l);else return h=l.lanes=536870912,hC(s,l,b!==null?b.baseLanes|u:u,u,h)}else b!==null?(Du(l,b.cachePool),p0(l,b),Qo(),l.memoizedState=null):(s!==null&&Du(l,null),Tp(),Qo());return tn(s,l,y,u),l.child}function Cl(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function hC(s,l,u,h,y){var b=kp();return b=b===null?null:{parent:Bt._currentValue,pool:b},l.memoizedState={baseLanes:u,cachePool:b},s!==null&&Du(l,null),Tp(),g0(l),s!==null&&qa(s,l,h,!0),l.childLanes=y,null}function qu(s,l){return l=Ku({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function fC(s,l,u){return Fs(l,s.child,null,u),s=qu(l,l.pendingProps),s.flags|=2,Un(l),l.memoizedState=null,s}function TL(s,l,u){var h=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(We){if(h.mode==="hidden")return s=qu(l,h),l.lanes=536870912,Cl(null,s);if(Np(l),(s=vt)?(s=AS(s,ii),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Uo!==null?{id:Oi,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=l,l.child=u,Zt=l,vt=null)):s=null,s===null)throw Fo(l);return l.lanes=536870912,null}return qu(l,h)}var b=s.memoizedState;if(b!==null){var S=b.dehydrated;if(Np(l),y)if(l.flags&256)l.flags&=-257,l=fC(s,l,u);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(_t||qa(s,l,u,!1),y=(u&s.childLanes)!==0,_t||y){if(h=pt,h!==null&&(S=iv(h,u),S!==0&&S!==b.retryLane))throw b.retryLane=S,Es(s,S),Tn(h,s,S),Jp;ed(),l=fC(s,l,u)}else s=b.treeContext,vt=si(S.nextSibling),Zt=l,We=!0,zo=null,ii=!1,s!==null&&Zv(l,s),l=qu(l,h),l.flags|=4096;return l}return s=oo(s.child,{mode:h.mode,children:h.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Gu(s,l){var u=l.ref;if(u===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(s===null||s.ref!==u)&&(l.flags|=4194816)}}function Zp(s,l,u,h,y){return Hs(l),u=Rp(s,l,u,h,void 0,y),h=Ep(),s!==null&&!_t?(Ip(s,l,y),uo(s,l,y)):(We&&h&&pp(l),l.flags|=1,tn(s,l,u,y),l.child)}function pC(s,l,u,h,y,b){return Hs(l),l.updateQueue=null,u=y0(l,h,u,y),m0(s),h=Ep(),s!==null&&!_t?(Ip(s,l,b),uo(s,l,b)):(We&&h&&pp(l),l.flags|=1,tn(s,l,u,b),l.child)}function gC(s,l,u,h,y){if(Hs(l),l.stateNode===null){var b=_a,S=u.contextType;typeof S=="object"&&S!==null&&(b=en(S)),b=new u(h,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=$p,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=h,b.state=l.memoizedState,b.refs={},Ap(l),S=u.contextType,b.context=typeof S=="object"&&S!==null?en(S):_a,b.state=l.memoizedState,S=u.getDerivedStateFromProps,typeof S=="function"&&(Yp(l,u,S,h),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(S=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),S!==b.state&&$p.enqueueReplaceState(b,b.state,null),ml(l,h,b,y),gl(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){b=l.stateNode;var P=l.memoizedProps,R=Gs(u,P);b.props=R;var G=b.context,$=u.contextType;S=_a,typeof $=="object"&&$!==null&&(S=en($));var ne=u.getDerivedStateFromProps;$=typeof ne=="function"||typeof b.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,$||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P||G!==S)&&tC(l,b,h,S),Go=!1;var W=l.memoizedState;b.state=W,ml(l,h,b,y),gl(),G=l.memoizedState,P||W!==G||Go?(typeof ne=="function"&&(Yp(l,u,ne,h),G=l.memoizedState),(R=Go||eC(l,u,R,h,W,G,S))?($||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=G),b.props=h,b.state=G,b.context=S,h=R):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{b=l.stateNode,Pp(s,l),S=l.memoizedProps,$=Gs(u,S),b.props=$,ne=l.pendingProps,W=b.context,G=u.contextType,R=_a,typeof G=="object"&&G!==null&&(R=en(G)),P=u.getDerivedStateFromProps,(G=typeof P=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==ne||W!==R)&&tC(l,b,h,R),Go=!1,W=l.memoizedState,b.state=W,ml(l,h,b,y),gl();var Q=l.memoizedState;S!==ne||W!==Q||Go||s!==null&&s.dependencies!==null&&Au(s.dependencies)?(typeof P=="function"&&(Yp(l,u,P,h),Q=l.memoizedState),($=Go||eC(l,u,$,h,W,Q,R)||s!==null&&s.dependencies!==null&&Au(s.dependencies))?(G||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,Q,R),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,Q,R)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=Q),b.props=h,b.state=Q,b.context=R,h=$):(typeof b.componentDidUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===s.memoizedProps&&W===s.memoizedState||(l.flags|=1024),h=!1)}return b=h,Gu(s,l),h=(l.flags&128)!==0,b||h?(b=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,s!==null&&h?(l.child=Fs(l,s.child,null,y),l.child=Fs(l,null,u,y)):tn(s,l,u,y),l.memoizedState=b.state,s=l.child):s=uo(s,l,y),s}function mC(s,l,u,h){return js(),l.flags|=256,tn(s,l,u,h),l.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(s){return{baseLanes:s,cachePool:s0()}}function ng(s,l,u){return s=s!==null?s.childLanes&~u:0,l&&(s|=Fn),s}function yC(s,l,u){var h=l.pendingProps,y=!1,b=(l.flags&128)!==0,S;if((S=b)||(S=s!==null&&s.memoizedState===null?!1:(Lt.current&2)!==0),S&&(y=!0,l.flags&=-129),S=(l.flags&32)!==0,l.flags&=-33,s===null){if(We){if(y?Wo(l):Qo(),(s=vt)?(s=AS(s,ii),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Uo!==null?{id:Oi,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=l,l.child=u,Zt=l,vt=null)):s=null,s===null)throw Fo(l);return Hg(s)?l.lanes=32:l.lanes=536870912,null}var P=h.children;return h=h.fallback,y?(Qo(),y=l.mode,P=Ku({mode:"hidden",children:P},y),h=Is(h,y,u,null),P.return=l,h.return=l,P.sibling=h,l.child=P,h=l.child,h.memoizedState=tg(u),h.childLanes=ng(s,S,u),l.memoizedState=eg,Cl(null,h)):(Wo(l),ig(l,P))}var R=s.memoizedState;if(R!==null&&(P=R.dehydrated,P!==null)){if(b)l.flags&256?(Wo(l),l.flags&=-257,l=og(s,l,u)):l.memoizedState!==null?(Qo(),l.child=s.child,l.flags|=128,l=null):(Qo(),P=h.fallback,y=l.mode,h=Ku({mode:"visible",children:h.children},y),P=Is(P,y,u,null),P.flags|=2,h.return=l,P.return=l,h.sibling=P,l.child=h,Fs(l,s.child,null,u),h=l.child,h.memoizedState=tg(u),h.childLanes=ng(s,S,u),l.memoizedState=eg,l=Cl(null,h));else if(Wo(l),Hg(P)){if(S=P.nextSibling&&P.nextSibling.dataset,S)var G=S.dgst;S=G,h=Error(i(419)),h.stack="",h.digest=S,cl({value:h,source:null,stack:null}),l=og(s,l,u)}else if(_t||qa(s,l,u,!1),S=(u&s.childLanes)!==0,_t||S){if(S=pt,S!==null&&(h=iv(S,u),h!==0&&h!==R.retryLane))throw R.retryLane=h,Es(s,h),Tn(S,s,h),Jp;Bg(P)||ed(),l=og(s,l,u)}else Bg(P)?(l.flags|=192,l.child=s.child,l=null):(s=R.treeContext,vt=si(P.nextSibling),Zt=l,We=!0,zo=null,ii=!1,s!==null&&Zv(l,s),l=ig(l,h.children),l.flags|=4096);return l}return y?(Qo(),P=h.fallback,y=l.mode,R=s.child,G=R.sibling,h=oo(R,{mode:"hidden",children:h.children}),h.subtreeFlags=R.subtreeFlags&65011712,G!==null?P=oo(G,P):(P=Is(P,y,u,null),P.flags|=2),P.return=l,h.return=l,h.sibling=P,l.child=h,Cl(null,h),h=l.child,P=s.child.memoizedState,P===null?P=tg(u):(y=P.cachePool,y!==null?(R=Bt._currentValue,y=y.parent!==R?{parent:R,pool:R}:y):y=s0(),P={baseLanes:P.baseLanes|u,cachePool:y}),h.memoizedState=P,h.childLanes=ng(s,S,u),l.memoizedState=eg,Cl(s.child,h)):(Wo(l),u=s.child,s=u.sibling,u=oo(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,s!==null&&(S=l.deletions,S===null?(l.deletions=[s],l.flags|=16):S.push(s)),l.child=u,l.memoizedState=null,u)}function ig(s,l){return l=Ku({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Ku(s,l){return s=Hn(22,s,null,l),s.lanes=0,s}function og(s,l,u){return Fs(l,s.child,null,u),s=ig(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function bC(s,l,u){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),xp(s.return,l,u)}function sg(s,l,u,h,y,b){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:b}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=h,S.tail=u,S.tailMode=y,S.treeForkCount=b)}function xC(s,l,u){var h=l.pendingProps,y=h.revealOrder,b=h.tail;h=h.children;var S=Lt.current,P=(S&2)!==0;if(P?(S=S&1|2,l.flags|=128):S&=1,te(Lt,S),tn(s,l,h,u),h=We?ll:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&bC(s,u,l);else if(s.tag===19)bC(s,u,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)s=u.alternate,s!==null&&Ru(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),sg(l,!1,y,u,b,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(s=y.alternate,s!==null&&Ru(s)===null){l.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}sg(l,!0,u,null,b,h);break;case"together":sg(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function uo(s,l,u){if(s!==null&&(l.dependencies=s.dependencies),Xo|=l.lanes,(u&l.childLanes)===0)if(s!==null){if(qa(s,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,u=oo(s,s.pendingProps),l.child=u,u.return=l;s.sibling!==null;)s=s.sibling,u=u.sibling=oo(s,s.pendingProps),u.return=l;u.sibling=null}return l.child}function ag(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Au(s)))}function ML(s,l,u){switch(l.tag){case 3:Oe(l,l.stateNode.containerInfo),qo(l,Bt,s.memoizedState.cache),js();break;case 27:case 5:nt(l);break;case 4:Oe(l,l.stateNode.containerInfo);break;case 10:qo(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Np(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Wo(l),l.flags|=128,null):(u&l.child.childLanes)!==0?yC(s,l,u):(Wo(l),s=uo(s,l,u),s!==null?s.sibling:null);Wo(l);break;case 19:var y=(s.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(qa(s,l,u,!1),h=(u&l.childLanes)!==0),y){if(h)return xC(s,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),te(Lt,Lt.current),h)break;return null;case 22:return l.lanes=0,dC(s,l,u,l.pendingProps);case 24:qo(l,Bt,s.memoizedState.cache)}return uo(s,l,u)}function vC(s,l,u){if(s!==null)if(s.memoizedProps!==l.pendingProps)_t=!0;else{if(!ag(s,u)&&(l.flags&128)===0)return _t=!1,ML(s,l,u);_t=(s.flags&131072)!==0}else _t=!1,We&&(l.flags&1048576)!==0&&Jv(l,ll,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(s=Us(l.elementType),l.type=s,typeof s=="function")dp(s)?(h=Gs(s,h),l.tag=1,l=gC(null,l,s,h,u)):(l.tag=0,l=Zp(null,l,s,h,u));else{if(s!=null){var y=s.$$typeof;if(y===T){l.tag=11,l=lC(null,l,s,h,u);break e}else if(y===I){l.tag=14,l=cC(null,l,s,h,u);break e}}throw l=ie(s)||s,Error(i(306,l,""))}}return l;case 0:return Zp(s,l,l.type,l.pendingProps,u);case 1:return h=l.type,y=Gs(h,l.pendingProps),gC(s,l,h,y,u);case 3:e:{if(Oe(l,l.stateNode.containerInfo),s===null)throw Error(i(387));h=l.pendingProps;var b=l.memoizedState;y=b.element,Pp(s,l),ml(l,h,null,u);var S=l.memoizedState;if(h=S.cache,qo(l,Bt,h),h!==b.cache&&vp(l,[Bt],u,!0),gl(),h=S.element,b.isDehydrated)if(b={element:h,isDehydrated:!1,cache:S.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=mC(s,l,h,u);break e}else if(h!==y){y=ei(Error(i(424)),l),cl(y),l=mC(s,l,h,u);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(vt=si(s.firstChild),Zt=l,We=!0,zo=null,ii=!0,u=d0(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(js(),h===y){l=uo(s,l,u);break e}tn(s,l,h,u)}l=l.child}return l;case 26:return Gu(s,l),s===null?(u=NS(l.type,null,l.pendingProps,null))?l.memoizedState=u:We||(u=l.type,s=l.pendingProps,h=rd(Se.current).createElement(u),h[Jt]=l,h[kn]=s,nn(h,u,s),Vt(h),l.stateNode=h):l.memoizedState=NS(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return nt(l),s===null&&We&&(h=l.stateNode=OS(l.type,l.pendingProps,Se.current),Zt=l,ii=!0,y=vt,ns(l.type)?(_g=y,vt=si(h.firstChild)):vt=y),tn(s,l,l.pendingProps.children,u),Gu(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&We&&((y=h=vt)&&(h=aR(h,l.type,l.pendingProps,ii),h!==null?(l.stateNode=h,Zt=l,vt=si(h.firstChild),ii=!1,y=!0):y=!1),y||Fo(l)),nt(l),y=l.type,b=l.pendingProps,S=s!==null?s.memoizedProps:null,h=b.children,Eg(y,b)?h=null:S!==null&&Eg(y,S)&&(l.flags|=32),l.memoizedState!==null&&(y=Rp(s,l,CL,null,null,u),jl._currentValue=y),Gu(s,l),tn(s,l,h,u),l.child;case 6:return s===null&&We&&((s=u=vt)&&(u=rR(u,l.pendingProps,ii),u!==null?(l.stateNode=u,Zt=l,vt=null,s=!0):s=!1),s||Fo(l)),null;case 13:return yC(s,l,u);case 4:return Oe(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=Fs(l,null,h,u):tn(s,l,h,u),l.child;case 11:return lC(s,l,l.type,l.pendingProps,u);case 7:return tn(s,l,l.pendingProps,u),l.child;case 8:return tn(s,l,l.pendingProps.children,u),l.child;case 12:return tn(s,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,qo(l,l.type,h.value),tn(s,l,h.children,u),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,Hs(l),y=en(y),h=h(y),l.flags|=1,tn(s,l,h,u),l.child;case 14:return cC(s,l,l.type,l.pendingProps,u);case 15:return uC(s,l,l.type,l.pendingProps,u);case 19:return xC(s,l,u);case 31:return TL(s,l,u);case 22:return dC(s,l,u,l.pendingProps);case 24:return Hs(l),h=en(Bt),s===null?(y=kp(),y===null&&(y=pt,b=Cp(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),l.memoizedState={parent:h,cache:y},Ap(l),qo(l,Bt,y)):((s.lanes&u)!==0&&(Pp(s,l),ml(l,null,null,u),gl()),y=s.memoizedState,b=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),qo(l,Bt,h)):(h=b.cache,qo(l,Bt,h),h!==y.cache&&vp(l,[Bt],u,!0))),tn(s,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function ho(s){s.flags|=4}function rg(s,l,u,h,y){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(WC())s.flags|=8192;else throw zs=Tu,wp}else s.flags&=-16777217}function CC(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!jS(l))if(WC())s.flags|=8192;else throw zs=Tu,wp}function Vu(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?lu():536870912,s.lanes|=l,tr|=l)}function Sl(s,l){if(!We)switch(s.tailMode){case"hidden":l=s.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Ct(s){var l=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(l)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=h,s.childLanes=u,l}function NL(s,l,u){var h=l.pendingProps;switch(gp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(l),null;case 1:return Ct(l),null;case 3:return u=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ro(Bt),je(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Fa(l)?ho(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,yp())),Ct(l),null;case 26:var y=l.type,b=l.memoizedState;return s===null?(ho(l),b!==null?(Ct(l),CC(l,b)):(Ct(l),rg(l,y,null,h,u))):b?b!==s.memoizedState?(ho(l),Ct(l),CC(l,b)):(Ct(l),l.flags&=-16777217):(s=s.memoizedProps,s!==h&&ho(l),Ct(l),rg(l,y,s,h,u)),null;case 27:if(Pt(l),u=Se.current,y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Ct(l),null}s=le.current,Fa(l)?e0(l):(s=OS(y,h,u),l.stateNode=s,ho(l))}return Ct(l),null;case 5:if(Pt(l),y=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return Ct(l),null}if(b=le.current,Fa(l))e0(l);else{var S=rd(Se.current);switch(b){case 1:b=S.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=S.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=S.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=S.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof h.is=="string"?S.createElement("select",{is:h.is}):S.createElement("select"),h.multiple?b.multiple=!0:h.size&&(b.size=h.size);break;default:b=typeof h.is=="string"?S.createElement(y,{is:h.is}):S.createElement(y)}}b[Jt]=l,b[kn]=h;e:for(S=l.child;S!==null;){if(S.tag===5||S.tag===6)b.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===l)break e;for(;S.sibling===null;){if(S.return===null||S.return===l)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}l.stateNode=b;e:switch(nn(b,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ho(l)}}return Ct(l),rg(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,u),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&ho(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(i(166));if(s=Se.current,Fa(l)){if(s=l.stateNode,u=l.memoizedProps,h=null,y=Zt,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}s[Jt]=l,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||yS(s.nodeValue,u)),s||Fo(l,!0)}else s=rd(s).createTextNode(h),s[Jt]=l,l.stateNode=s}return Ct(l),null;case 31:if(u=l.memoizedState,s===null||s.memoizedState!==null){if(h=Fa(l),u!==null){if(s===null){if(!h)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Jt]=l}else js(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ct(l),s=!1}else u=yp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return l.flags&256?(Un(l),l):(Un(l),null);if((l.flags&128)!==0)throw Error(i(558))}return Ct(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Fa(l),h!==null&&h.dehydrated!==null){if(s===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Jt]=l}else js(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ct(l),y=!1}else y=yp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Un(l),l):(Un(l),null)}return Un(l),(l.flags&128)!==0?(l.lanes=u,l):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),b=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)),u!==s&&u&&(l.child.flags|=8192),Vu(l,l.updateQueue),Ct(l),null);case 4:return je(),s===null&&Tg(l.stateNode.containerInfo),Ct(l),null;case 10:return ro(l.type),Ct(l),null;case 19:if(be(Lt),h=l.memoizedState,h===null)return Ct(l),null;if(y=(l.flags&128)!==0,b=h.rendering,b===null)if(y)Sl(h,!1);else{if(Ot!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(b=Ru(s),b!==null){for(l.flags|=128,Sl(h,!1),s=b.updateQueue,l.updateQueue=s,Vu(l,s),l.subtreeFlags=0,s=u,u=l.child;u!==null;)Yv(u,s),u=u.sibling;return te(Lt,Lt.current&1|2),We&&so(l,h.treeForkCount),l.child}s=s.sibling}h.tail!==null&&Xt()>Xu&&(l.flags|=128,y=!0,Sl(h,!1),l.lanes=4194304)}else{if(!y)if(s=Ru(b),s!==null){if(l.flags|=128,y=!0,s=s.updateQueue,l.updateQueue=s,Vu(l,s),Sl(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!We)return Ct(l),null}else 2*Xt()-h.renderingStartTime>Xu&&u!==536870912&&(l.flags|=128,y=!0,Sl(h,!1),l.lanes=4194304);h.isBackwards?(b.sibling=l.child,l.child=b):(s=h.last,s!==null?s.sibling=b:l.child=b,h.last=b)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Xt(),s.sibling=null,u=Lt.current,te(Lt,y?u&1|2:u&1),We&&so(l,h.treeForkCount),s):(Ct(l),null);case 22:case 23:return Un(l),Mp(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(Ct(l),l.subtreeFlags&6&&(l.flags|=8192)):Ct(l),u=l.updateQueue,u!==null&&Vu(l,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),s!==null&&be(_s),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ro(Bt),Ct(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function LL(s,l){switch(gp(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return ro(Bt),je(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Pt(l),null;case 31:if(l.memoizedState!==null){if(Un(l),l.alternate===null)throw Error(i(340));js()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Un(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));js()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return be(Lt),null;case 4:return je(),null;case 10:return ro(l.type),null;case 22:case 23:return Un(l),Mp(),s!==null&&be(_s),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return ro(Bt),null;case 25:return null;default:return null}}function SC(s,l){switch(gp(l),l.tag){case 3:ro(Bt),je();break;case 26:case 27:case 5:Pt(l);break;case 4:je();break;case 31:l.memoizedState!==null&&Un(l);break;case 13:Un(l);break;case 19:be(Lt);break;case 10:ro(l.type);break;case 22:case 23:Un(l),Mp(),s!==null&&be(_s);break;case 24:ro(Bt)}}function kl(s,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&s)===s){h=void 0;var b=u.create,S=u.inst;h=b(),S.destroy=h}u=u.next}while(u!==y)}}catch(P){at(l,l.return,P)}}function Yo(s,l,u){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&s)===s){var S=h.inst,P=S.destroy;if(P!==void 0){S.destroy=void 0,y=l;var R=u,G=P;try{G()}catch($){at(y,R,$)}}}h=h.next}while(h!==b)}}catch($){at(l,l.return,$)}}function kC(s){var l=s.updateQueue;if(l!==null){var u=s.stateNode;try{f0(l,u)}catch(h){at(s,s.return,h)}}}function wC(s,l,u){u.props=Gs(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){at(s,l,h)}}function wl(s,l){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(y){at(s,l,y)}}function Mi(s,l){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){at(s,l,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){at(s,l,y)}else u.current=null}function AC(s){var l=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){at(s,s.return,y)}}function lg(s,l,u){try{var h=s.stateNode;eR(h,s.type,u,l),h[kn]=l}catch(y){at(s,s.return,y)}}function PC(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ns(s.type)||s.tag===4}function cg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||PC(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ns(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function ug(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(s),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=no));else if(h!==4&&(h===27&&ns(s.type)&&(u=s.stateNode,l=null),s=s.child,s!==null))for(ug(s,l,u),s=s.sibling;s!==null;)ug(s,l,u),s=s.sibling}function Wu(s,l,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?u.insertBefore(s,l):u.appendChild(s);else if(h!==4&&(h===27&&ns(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Wu(s,l,u),s=s.sibling;s!==null;)Wu(s,l,u),s=s.sibling}function DC(s){var l=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);nn(l,h,u),l[Jt]=s,l[kn]=u}catch(b){at(s,s.return,b)}}var fo=!1,Ut=!1,dg=!1,OC=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function RL(s,l){if(s=s.containerInfo,Lg=pd,s=Uv(s),op(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var S=0,P=-1,R=-1,G=0,$=0,ne=s,W=null;t:for(;;){for(var Q;ne!==u||y!==0&&ne.nodeType!==3||(P=S+y),ne!==b||h!==0&&ne.nodeType!==3||(R=S+h),ne.nodeType===3&&(S+=ne.nodeValue.length),(Q=ne.firstChild)!==null;)W=ne,ne=Q;for(;;){if(ne===s)break t;if(W===u&&++G===y&&(P=S),W===b&&++$===h&&(R=S),(Q=ne.nextSibling)!==null)break;ne=W,W=ne.parentNode}ne=Q}u=P===-1||R===-1?null:{start:P,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(Rg={focusedElem:s,selectionRange:u},pd=!1,Wt=l;Wt!==null;)if(l=Wt,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Wt=s;else for(;Wt!==null;){switch(l=Wt,b=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&b!==null){s=void 0,u=l,y=b.memoizedProps,b=b.memoizedState,h=u.stateNode;try{var ve=Gs(u.type,y);s=h.getSnapshotBeforeUpdate(ve,b),h.__reactInternalSnapshotBeforeUpdate=s}catch(De){at(u,u.return,De)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,u=s.nodeType,u===9)jg(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":jg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=l.sibling,s!==null){s.return=l.return,Wt=s;break}Wt=l.return}}function TC(s,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:go(s,u),h&4&&kl(5,u);break;case 1:if(go(s,u),h&4)if(s=u.stateNode,l===null)try{s.componentDidMount()}catch(S){at(u,u.return,S)}else{var y=Gs(u.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(y,l,s.__reactInternalSnapshotBeforeUpdate)}catch(S){at(u,u.return,S)}}h&64&&kC(u),h&512&&wl(u,u.return);break;case 3:if(go(s,u),h&64&&(s=u.updateQueue,s!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{f0(s,l)}catch(S){at(u,u.return,S)}}break;case 27:l===null&&h&4&&DC(u);case 26:case 5:go(s,u),l===null&&h&4&&AC(u),h&512&&wl(u,u.return);break;case 12:go(s,u);break;case 31:go(s,u),h&4&&LC(s,u);break;case 13:go(s,u),h&4&&RC(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=FL.bind(null,u),lR(s,u))));break;case 22:if(h=u.memoizedState!==null||fo,!h){l=l!==null&&l.memoizedState!==null||Ut,y=fo;var b=Ut;fo=h,(Ut=l)&&!b?mo(s,u,(u.subtreeFlags&8772)!==0):go(s,u),fo=y,Ut=b}break;case 30:break;default:go(s,u)}}function MC(s){var l=s.alternate;l!==null&&(s.alternate=null,MC(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&zf(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var St=null,An=!1;function po(s,l,u){for(u=u.child;u!==null;)NC(s,l,u),u=u.sibling}function NC(s,l,u){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(Ds,u)}catch{}switch(u.tag){case 26:Ut||Mi(u,l),po(s,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Ut||Mi(u,l);var h=St,y=An;ns(u.type)&&(St=u.stateNode,An=!1),po(s,l,u),Rl(u.stateNode),St=h,An=y;break;case 5:Ut||Mi(u,l);case 6:if(h=St,y=An,St=null,po(s,l,u),St=h,An=y,St!==null)if(An)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(u.stateNode)}catch(b){at(u,l,b)}else try{St.removeChild(u.stateNode)}catch(b){at(u,l,b)}break;case 18:St!==null&&(An?(s=St,kS(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),cr(s)):kS(St,u.stateNode));break;case 4:h=St,y=An,St=u.stateNode.containerInfo,An=!0,po(s,l,u),St=h,An=y;break;case 0:case 11:case 14:case 15:Yo(2,u,l),Ut||Yo(4,u,l),po(s,l,u);break;case 1:Ut||(Mi(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&wC(u,l,h)),po(s,l,u);break;case 21:po(s,l,u);break;case 22:Ut=(h=Ut)||u.memoizedState!==null,po(s,l,u),Ut=h;break;default:po(s,l,u)}}function LC(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{cr(s)}catch(u){at(l,l.return,u)}}}function RC(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{cr(s)}catch(u){at(l,l.return,u)}}function EL(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new OC),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new OC),l;default:throw Error(i(435,s.tag))}}function Qu(s,l){var u=EL(s);l.forEach(function(h){if(!u.has(h)){u.add(h);var y=qL.bind(null,s,h);h.then(y,y)}})}function Pn(s,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],b=s,S=l,P=S;e:for(;P!==null;){switch(P.tag){case 27:if(ns(P.type)){St=P.stateNode,An=!1;break e}break;case 5:St=P.stateNode,An=!1;break e;case 3:case 4:St=P.stateNode.containerInfo,An=!0;break e}P=P.return}if(St===null)throw Error(i(160));NC(b,S,y),St=null,An=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)EC(l,s),l=l.sibling}var yi=null;function EC(s,l){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Pn(l,s),Dn(s),h&4&&(Yo(3,s,s.return),kl(3,s),Yo(5,s,s.return));break;case 1:Pn(l,s),Dn(s),h&512&&(Ut||u===null||Mi(u,u.return)),h&64&&fo&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=yi;if(Pn(l,s),Dn(s),h&512&&(Ut||u===null||Mi(u,u.return)),h&4){var b=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Xr]||b[Jt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),nn(b,h,u),b[Jt]=s,Vt(b),h=b;break e;case"link":var S=ES("link","href",y).get(h+(u.href||""));if(S){for(var P=0;P<S.length;P++)if(b=S[P],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){S.splice(P,1);break t}}b=y.createElement(h),nn(b,h,u),y.head.appendChild(b);break;case"meta":if(S=ES("meta","content",y).get(h+(u.content||""))){for(P=0;P<S.length;P++)if(b=S[P],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){S.splice(P,1);break t}}b=y.createElement(h),nn(b,h,u),y.head.appendChild(b);break;default:throw Error(i(468,h))}b[Jt]=s,Vt(b),h=b}s.stateNode=h}else IS(y,s.type,s.stateNode);else s.stateNode=RS(y,h,s.memoizedProps);else b!==h?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,h===null?IS(y,s.type,s.stateNode):RS(y,h,s.memoizedProps)):h===null&&s.stateNode!==null&&lg(s,s.memoizedProps,u.memoizedProps)}break;case 27:Pn(l,s),Dn(s),h&512&&(Ut||u===null||Mi(u,u.return)),u!==null&&h&4&&lg(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Pn(l,s),Dn(s),h&512&&(Ut||u===null||Mi(u,u.return)),s.flags&32){y=s.stateNode;try{La(y,"")}catch(ve){at(s,s.return,ve)}}h&4&&s.stateNode!=null&&(y=s.memoizedProps,lg(s,y,u!==null?u.memoizedProps:y)),h&1024&&(dg=!0);break;case 6:if(Pn(l,s),Dn(s),h&4){if(s.stateNode===null)throw Error(i(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(ve){at(s,s.return,ve)}}break;case 3:if(ud=null,y=yi,yi=ld(l.containerInfo),Pn(l,s),yi=y,Dn(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{cr(l.containerInfo)}catch(ve){at(s,s.return,ve)}dg&&(dg=!1,IC(s));break;case 4:h=yi,yi=ld(s.stateNode.containerInfo),Pn(l,s),Dn(s),yi=h;break;case 12:Pn(l,s),Dn(s);break;case 31:Pn(l,s),Dn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 13:Pn(l,s),Dn(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&($u=Xt()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 22:y=s.memoizedState!==null;var R=u!==null&&u.memoizedState!==null,G=fo,$=Ut;if(fo=G||y,Ut=$||R,Pn(l,s),Ut=$,fo=G,Dn(s),h&8192)e:for(l=s.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||R||fo||Ut||Ks(s)),u=null,l=s;;){if(l.tag===5||l.tag===26){if(u===null){R=u=l;try{if(b=R.stateNode,y)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{P=R.stateNode;var ne=R.memoizedProps.style,W=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;P.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ve){at(R,R.return,ve)}}}else if(l.tag===6){if(u===null){R=l;try{R.stateNode.nodeValue=y?"":R.memoizedProps}catch(ve){at(R,R.return,ve)}}}else if(l.tag===18){if(u===null){R=l;try{var Q=R.stateNode;y?wS(Q,!0):wS(R.stateNode,!1)}catch(ve){at(R,R.return,ve)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Qu(s,u))));break;case 19:Pn(l,s),Dn(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Qu(s,h)));break;case 30:break;case 21:break;default:Pn(l,s),Dn(s)}}function Dn(s){var l=s.flags;if(l&2){try{for(var u,h=s.return;h!==null;){if(PC(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,b=cg(s);Wu(s,b,y);break;case 5:var S=u.stateNode;u.flags&32&&(La(S,""),u.flags&=-33);var P=cg(s);Wu(s,P,S);break;case 3:case 4:var R=u.stateNode.containerInfo,G=cg(s);ug(s,G,R);break;default:throw Error(i(161))}}catch($){at(s,s.return,$)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function IC(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;IC(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function go(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)TC(s,l.alternate,l),l=l.sibling}function Ks(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Yo(4,l,l.return),Ks(l);break;case 1:Mi(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&wC(l,l.return,u),Ks(l);break;case 27:Rl(l.stateNode);case 26:case 5:Mi(l,l.return),Ks(l);break;case 22:l.memoizedState===null&&Ks(l);break;case 30:Ks(l);break;default:Ks(l)}s=s.sibling}}function mo(s,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=s,b=l,S=b.flags;switch(b.tag){case 0:case 11:case 15:mo(y,b,u),kl(4,b);break;case 1:if(mo(y,b,u),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(G){at(h,h.return,G)}if(h=b,y=h.updateQueue,y!==null){var P=h.stateNode;try{var R=y.shared.hiddenCallbacks;if(R!==null)for(y.shared.hiddenCallbacks=null,y=0;y<R.length;y++)h0(R[y],P)}catch(G){at(h,h.return,G)}}u&&S&64&&kC(b),wl(b,b.return);break;case 27:DC(b);case 26:case 5:mo(y,b,u),u&&h===null&&S&4&&AC(b),wl(b,b.return);break;case 12:mo(y,b,u);break;case 31:mo(y,b,u),u&&S&4&&LC(y,b);break;case 13:mo(y,b,u),u&&S&4&&RC(y,b);break;case 22:b.memoizedState===null&&mo(y,b,u),wl(b,b.return);break;case 30:break;default:mo(y,b,u)}l=l.sibling}}function hg(s,l){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&ul(u))}function fg(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&ul(s))}function bi(s,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)jC(s,l,u,h),l=l.sibling}function jC(s,l,u,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:bi(s,l,u,h),y&2048&&kl(9,l);break;case 1:bi(s,l,u,h);break;case 3:bi(s,l,u,h),y&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&ul(s)));break;case 12:if(y&2048){bi(s,l,u,h),s=l.stateNode;try{var b=l.memoizedProps,S=b.id,P=b.onPostCommit;typeof P=="function"&&P(S,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(R){at(l,l.return,R)}}else bi(s,l,u,h);break;case 31:bi(s,l,u,h);break;case 13:bi(s,l,u,h);break;case 23:break;case 22:b=l.stateNode,S=l.alternate,l.memoizedState!==null?b._visibility&2?bi(s,l,u,h):Al(s,l):b._visibility&2?bi(s,l,u,h):(b._visibility|=2,Ja(s,l,u,h,(l.subtreeFlags&10256)!==0||!1)),y&2048&&hg(S,l);break;case 24:bi(s,l,u,h),y&2048&&fg(l.alternate,l);break;default:bi(s,l,u,h)}}function Ja(s,l,u,h,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=s,S=l,P=u,R=h,G=S.flags;switch(S.tag){case 0:case 11:case 15:Ja(b,S,P,R,y),kl(8,S);break;case 23:break;case 22:var $=S.stateNode;S.memoizedState!==null?$._visibility&2?Ja(b,S,P,R,y):Al(b,S):($._visibility|=2,Ja(b,S,P,R,y)),y&&G&2048&&hg(S.alternate,S);break;case 24:Ja(b,S,P,R,y),y&&G&2048&&fg(S.alternate,S);break;default:Ja(b,S,P,R,y)}l=l.sibling}}function Al(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=s,h=l,y=h.flags;switch(h.tag){case 22:Al(u,h),y&2048&&hg(h.alternate,h);break;case 24:Al(u,h),y&2048&&fg(h.alternate,h);break;default:Al(u,h)}l=l.sibling}}var Pl=8192;function Za(s,l,u){if(s.subtreeFlags&Pl)for(s=s.child;s!==null;)BC(s,l,u),s=s.sibling}function BC(s,l,u){switch(s.tag){case 26:Za(s,l,u),s.flags&Pl&&s.memoizedState!==null&&vR(u,yi,s.memoizedState,s.memoizedProps);break;case 5:Za(s,l,u);break;case 3:case 4:var h=yi;yi=ld(s.stateNode.containerInfo),Za(s,l,u),yi=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=Pl,Pl=16777216,Za(s,l,u),Pl=h):Za(s,l,u));break;default:Za(s,l,u)}}function HC(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Dl(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wt=h,UC(h,s)}HC(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)_C(s),s=s.sibling}function _C(s){switch(s.tag){case 0:case 11:case 15:Dl(s),s.flags&2048&&Yo(9,s,s.return);break;case 3:Dl(s);break;case 12:Dl(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Yu(s)):Dl(s);break;default:Dl(s)}}function Yu(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wt=h,UC(h,s)}HC(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Yo(8,l,l.return),Yu(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Yu(l));break;default:Yu(l)}s=s.sibling}}function UC(s,l){for(;Wt!==null;){var u=Wt;switch(u.tag){case 0:case 11:case 15:Yo(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:ul(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Wt=h;else e:for(u=s;Wt!==null;){h=Wt;var y=h.sibling,b=h.return;if(MC(h),h===u){Wt=null;break e}if(y!==null){y.return=b,Wt=y;break e}Wt=b}}}var IL={getCacheForType:function(s){var l=en(Bt),u=l.data.get(s);return u===void 0&&(u=s(),l.data.set(s,u)),u},cacheSignal:function(){return en(Bt).controller.signal}},jL=typeof WeakMap=="function"?WeakMap:Map,ot=0,pt=null,ze=null,Ge=0,st=0,zn=null,$o=!1,er=!1,pg=!1,yo=0,Ot=0,Xo=0,Vs=0,gg=0,Fn=0,tr=0,Ol=null,On=null,mg=!1,$u=0,zC=0,Xu=1/0,Ju=null,Jo=null,Ft=0,Zo=null,nr=null,bo=0,yg=0,bg=null,FC=null,Tl=0,xg=null;function qn(){return(ot&2)!==0&&Ge!==0?Ge&-Ge:B.T!==null?Ag():ov()}function qC(){if(Fn===0)if((Ge&536870912)===0||We){var s=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Fn=s}else Fn=536870912;return s=_n.current,s!==null&&(s.flags|=32),Fn}function Tn(s,l,u){(s===pt&&(st===2||st===9)||s.cancelPendingCommit!==null)&&(ir(s,0),es(s,Ge,Fn,!1)),eo(s,u),((ot&2)===0||s!==pt)&&(s===pt&&((ot&2)===0&&(Vs|=u),Ot===4&&es(s,Ge,Fn,!1)),Ni(s))}function GC(s,l,u){if((ot&6)!==0)throw Error(i(327));var h=!u&&(l&127)===0&&(l&s.expiredLanes)===0||Os(s,l),y=h?_L(s,l):Cg(s,l,!0),b=h;do{if(y===0){er&&!h&&es(s,l,0,!1);break}else{if(u=s.current.alternate,b&&!BL(u)){y=Cg(s,l,!1),b=!1;continue}if(y===2){if(b=l,s.errorRecoveryDisabledLanes&b)var S=0;else S=s.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){l=S;e:{var P=s;y=Ol;var R=P.current.memoizedState.isDehydrated;if(R&&(ir(P,S).flags|=256),S=Cg(P,S,!1),S!==2){if(pg&&!R){P.errorRecoveryDisabledLanes|=b,Vs|=b,y=4;break e}b=On,On=y,b!==null&&(On===null?On=b:On.push.apply(On,b))}y=S}if(b=!1,y!==2)continue}}if(y===1){ir(s,0),es(s,l,0,!0);break}e:{switch(h=s,b=y,b){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:es(h,l,Fn,!$o);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=$u+300-Xt(),10<y)){if(es(h,l,Fn,!$o),He(h,0,!0)!==0)break e;bo=l,h.timeoutHandle=CS(KC.bind(null,h,u,On,Ju,mg,l,Fn,Vs,tr,$o,b,"Throttled",-0,0),y);break e}KC(h,u,On,Ju,mg,l,Fn,Vs,tr,$o,b,null,-0,0)}}break}while(!0);Ni(s)}function KC(s,l,u,h,y,b,S,P,R,G,$,ne,W,Q){if(s.timeoutHandle=-1,ne=l.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:no},BC(l,b,ne);var ve=(b&62914560)===b?$u-Xt():(b&4194048)===b?zC-Xt():0;if(ve=CR(ne,ve),ve!==null){bo=b,s.cancelPendingCommit=ve(ZC.bind(null,s,l,b,u,h,y,S,P,R,$,ne,null,W,Q)),es(s,b,S,!G);return}}ZC(s,l,b,u,h,y,S,P,R)}function BL(s){for(var l=s;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],b=y.getSnapshot;y=y.value;try{if(!Bn(b(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function es(s,l,u,h){l&=~gg,l&=~Vs,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var y=l;0<y;){var b=31-gn(y),S=1<<b;h[b]=-1,y&=~S}u!==0&&tv(s,u,l)}function Zu(){return(ot&6)===0?(Ml(0),!1):!0}function vg(){if(ze!==null){if(st===0)var s=ze.return;else s=ze,ao=Bs=null,jp(s),Wa=null,hl=0,s=ze;for(;s!==null;)SC(s.alternate,s),s=s.return;ze=null}}function ir(s,l){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,iR(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),bo=0,vg(),pt=s,ze=u=oo(s.current,null),Ge=l,st=0,zn=null,$o=!1,er=Os(s,l),pg=!1,tr=Fn=gg=Vs=Xo=Ot=0,On=Ol=null,mg=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var y=31-gn(h),b=1<<y;l|=s[y],h&=~b}return yo=l,vu(),u}function VC(s,l){Ee=null,B.H=vl,l===Va||l===Ou?(l=l0(),st=3):l===wp?(l=l0(),st=4):st=l===Jp?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,zn=l,ze===null&&(Ot=1,Fu(s,ei(l,s.current)))}function WC(){var s=_n.current;return s===null?!0:(Ge&4194048)===Ge?oi===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?s===oi:!1}function QC(){var s=B.H;return B.H=vl,s===null?vl:s}function YC(){var s=B.A;return B.A=IL,s}function ed(){Ot=4,$o||(Ge&4194048)!==Ge&&_n.current!==null||(er=!0),(Xo&134217727)===0&&(Vs&134217727)===0||pt===null||es(pt,Ge,Fn,!1)}function Cg(s,l,u){var h=ot;ot|=2;var y=QC(),b=YC();(pt!==s||Ge!==l)&&(Ju=null,ir(s,l)),l=!1;var S=Ot;e:do try{if(st!==0&&ze!==null){var P=ze,R=zn;switch(st){case 8:vg(),S=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(l=!0);var G=st;if(st=0,zn=null,or(s,P,R,G),u&&er){S=0;break e}break;default:G=st,st=0,zn=null,or(s,P,R,G)}}HL(),S=Ot;break}catch($){VC(s,$)}while(!0);return l&&s.shellSuspendCounter++,ao=Bs=null,ot=h,B.H=y,B.A=b,ze===null&&(pt=null,Ge=0,vu()),S}function HL(){for(;ze!==null;)$C(ze)}function _L(s,l){var u=ot;ot|=2;var h=QC(),y=YC();pt!==s||Ge!==l?(Ju=null,Xu=Xt()+500,ir(s,l)):er=Os(s,l);e:do try{if(st!==0&&ze!==null){l=ze;var b=zn;t:switch(st){case 1:st=0,zn=null,or(s,l,b,1);break;case 2:case 9:if(a0(b)){st=0,zn=null,XC(l);break}l=function(){st!==2&&st!==9||pt!==s||(st=7),Ni(s)},b.then(l,l);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:a0(b)?(st=0,zn=null,XC(l)):(st=0,zn=null,or(s,l,b,7));break;case 5:var S=null;switch(ze.tag){case 26:S=ze.memoizedState;case 5:case 27:var P=ze;if(S?jS(S):P.stateNode.complete){st=0,zn=null;var R=P.sibling;if(R!==null)ze=R;else{var G=P.return;G!==null?(ze=G,td(G)):ze=null}break t}}st=0,zn=null,or(s,l,b,5);break;case 6:st=0,zn=null,or(s,l,b,6);break;case 8:vg(),Ot=6;break e;default:throw Error(i(462))}}UL();break}catch($){VC(s,$)}while(!0);return ao=Bs=null,B.H=h,B.A=y,ot=u,ze!==null?0:(pt=null,Ge=0,vu(),Ot)}function UL(){for(;ze!==null&&!ka();)$C(ze)}function $C(s){var l=vC(s.alternate,s,yo);s.memoizedProps=s.pendingProps,l===null?td(s):ze=l}function XC(s){var l=s,u=l.alternate;switch(l.tag){case 15:case 0:l=pC(u,l,l.pendingProps,l.type,void 0,Ge);break;case 11:l=pC(u,l,l.pendingProps,l.type.render,l.ref,Ge);break;case 5:jp(l);default:SC(u,l),l=ze=Yv(l,yo),l=vC(u,l,yo)}s.memoizedProps=s.pendingProps,l===null?td(s):ze=l}function or(s,l,u,h){ao=Bs=null,jp(l),Wa=null,hl=0;var y=l.return;try{if(OL(s,y,l,u,Ge)){Ot=1,Fu(s,ei(u,s.current)),ze=null;return}}catch(b){if(y!==null)throw ze=y,b;Ot=1,Fu(s,ei(u,s.current)),ze=null;return}l.flags&32768?(We||h===1?s=!0:er||(Ge&536870912)!==0?s=!1:($o=s=!0,(h===2||h===9||h===3||h===6)&&(h=_n.current,h!==null&&h.tag===13&&(h.flags|=16384))),JC(l,s)):td(l)}function td(s){var l=s;do{if((l.flags&32768)!==0){JC(l,$o);return}s=l.return;var u=NL(l.alternate,l,yo);if(u!==null){ze=u;return}if(l=l.sibling,l!==null){ze=l;return}ze=l=s}while(l!==null);Ot===0&&(Ot=5)}function JC(s,l){do{var u=LL(s.alternate,s);if(u!==null){u.flags&=32767,ze=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(s=s.sibling,s!==null)){ze=s;return}ze=s=u}while(s!==null);Ot=6,ze=null}function ZC(s,l,u,h,y,b,S,P,R){s.cancelPendingCommit=null;do nd();while(Ft!==0);if((ot&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));if(b=l.lanes|l.childLanes,b|=cp,xN(s,u,b,S,P,R),s===pt&&(ze=pt=null,Ge=0),nr=l,Zo=s,bo=u,yg=b,bg=y,FC=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,GL(Aa,function(){return oS(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=B.T,B.T=null,y=Z.p,Z.p=2,S=ot,ot|=4;try{RL(s,l,u)}finally{ot=S,Z.p=y,B.T=h}}Ft=1,eS(),tS(),nS()}}function eS(){if(Ft===1){Ft=0;var s=Zo,l=nr,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=B.T,B.T=null;var h=Z.p;Z.p=2;var y=ot;ot|=4;try{EC(l,s);var b=Rg,S=Uv(s.containerInfo),P=b.focusedElem,R=b.selectionRange;if(S!==P&&P&&P.ownerDocument&&_v(P.ownerDocument.documentElement,P)){if(R!==null&&op(P)){var G=R.start,$=R.end;if($===void 0&&($=G),"selectionStart"in P)P.selectionStart=G,P.selectionEnd=Math.min($,P.value.length);else{var ne=P.ownerDocument||document,W=ne&&ne.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ve=P.textContent.length,De=Math.min(R.start,ve),ut=R.end===void 0?De:Math.min(R.end,ve);!Q.extend&&De>ut&&(S=ut,ut=De,De=S);var H=Hv(P,De),j=Hv(P,ut);if(H&&j&&(Q.rangeCount!==1||Q.anchorNode!==H.node||Q.anchorOffset!==H.offset||Q.focusNode!==j.node||Q.focusOffset!==j.offset)){var F=ne.createRange();F.setStart(H.node,H.offset),Q.removeAllRanges(),De>ut?(Q.addRange(F),Q.extend(j.node,j.offset)):(F.setEnd(j.node,j.offset),Q.addRange(F))}}}}for(ne=[],Q=P;Q=Q.parentNode;)Q.nodeType===1&&ne.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ne.length;P++){var ee=ne[P];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}pd=!!Lg,Rg=Lg=null}finally{ot=y,Z.p=h,B.T=u}}s.current=l,Ft=2}}function tS(){if(Ft===2){Ft=0;var s=Zo,l=nr,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=B.T,B.T=null;var h=Z.p;Z.p=2;var y=ot;ot|=4;try{TC(s,l.alternate,l)}finally{ot=y,Z.p=h,B.T=u}}Ft=3}}function nS(){if(Ft===4||Ft===3){Ft=0,wa();var s=Zo,l=nr,u=bo,h=FC;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Ft=5:(Ft=0,nr=Zo=null,iS(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(Jo=null),_f(u),l=l.stateNode,pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(Ds,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=B.T,y=Z.p,Z.p=2,B.T=null;try{for(var b=s.onRecoverableError,S=0;S<h.length;S++){var P=h[S];b(P.value,{componentStack:P.stack})}}finally{B.T=l,Z.p=y}}(bo&3)!==0&&nd(),Ni(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===xg?Tl++:(Tl=0,xg=s):Tl=0,Ml(0)}}function iS(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,ul(l)))}function nd(){return eS(),tS(),nS(),oS()}function oS(){if(Ft!==5)return!1;var s=Zo,l=yg;yg=0;var u=_f(bo),h=B.T,y=Z.p;try{Z.p=32>u?32:u,B.T=null,u=bg,bg=null;var b=Zo,S=bo;if(Ft=0,nr=Zo=null,bo=0,(ot&6)!==0)throw Error(i(331));var P=ot;if(ot|=4,_C(b.current),jC(b,b.current,S,u),ot=P,Ml(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(Ds,b)}catch{}return!0}finally{Z.p=y,B.T=h,iS(s,l)}}function sS(s,l,u){l=ei(u,l),l=Xp(s.stateNode,l,2),s=Vo(s,l,2),s!==null&&(eo(s,2),Ni(s))}function at(s,l,u){if(s.tag===3)sS(s,s,u);else for(;l!==null;){if(l.tag===3){sS(l,s,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Jo===null||!Jo.has(h))){s=ei(u,s),u=aC(2),h=Vo(l,u,2),h!==null&&(rC(u,h,l,s),eo(h,2),Ni(h));break}}l=l.return}}function Sg(s,l,u){var h=s.pingCache;if(h===null){h=s.pingCache=new jL;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(u)||(pg=!0,y.add(u),s=zL.bind(null,s,l,u),l.then(s,s))}function zL(s,l,u){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,pt===s&&(Ge&u)===u&&(Ot===4||Ot===3&&(Ge&62914560)===Ge&&300>Xt()-$u?(ot&2)===0&&ir(s,0):gg|=u,tr===Ge&&(tr=0)),Ni(s)}function aS(s,l){l===0&&(l=lu()),s=Es(s,l),s!==null&&(eo(s,l),Ni(s))}function FL(s){var l=s.memoizedState,u=0;l!==null&&(u=l.retryLane),aS(s,u)}function qL(s,l){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(l),aS(s,u)}function GL(s,l){return Ps(s,l)}var id=null,sr=null,kg=!1,od=!1,wg=!1,ts=0;function Ni(s){s!==sr&&s.next===null&&(sr===null?id=sr=s:sr=sr.next=s),od=!0,kg||(kg=!0,VL())}function Ml(s,l){if(!wg&&od){wg=!0;do for(var u=!1,h=id;h!==null;){if(s!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var S=h.suspendedLanes,P=h.pingedLanes;b=(1<<31-gn(42|s)+1)-1,b&=y&~(S&~P),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,uS(h,b))}else b=Ge,b=He(h,h===pt?b:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(b&3)===0||Os(h,b)||(u=!0,uS(h,b));h=h.next}while(u);wg=!1}}function KL(){rS()}function rS(){od=kg=!1;var s=0;ts!==0&&nR()&&(s=ts);for(var l=Xt(),u=null,h=id;h!==null;){var y=h.next,b=lS(h,l);b===0?(h.next=null,u===null?id=y:u.next=y,y===null&&(sr=u)):(u=h,(s!==0||(b&3)!==0)&&(od=!0)),h=y}Ft!==0&&Ft!==5||Ml(s),ts!==0&&(ts=0)}function lS(s,l){for(var u=s.suspendedLanes,h=s.pingedLanes,y=s.expirationTimes,b=s.pendingLanes&-62914561;0<b;){var S=31-gn(b),P=1<<S,R=y[S];R===-1?((P&u)===0||(P&h)!==0)&&(y[S]=Bf(P,l)):R<=l&&(s.expiredLanes|=P),b&=~P}if(l=pt,u=Ge,u=He(s,s===l?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===l&&(st===2||st===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&gi(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Os(s,u)){if(l=u&-u,l===s.callbackPriority)return l;switch(h!==null&&gi(h),_f(u)){case 2:case 8:u=su;break;case 32:u=Aa;break;case 268435456:u=au;break;default:u=Aa}return h=cS.bind(null,s),u=Ps(u,h),s.callbackPriority=l,s.callbackNode=u,l}return h!==null&&h!==null&&gi(h),s.callbackPriority=2,s.callbackNode=null,2}function cS(s,l){if(Ft!==0&&Ft!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(nd()&&s.callbackNode!==u)return null;var h=Ge;return h=He(s,s===pt?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(GC(s,h,l),lS(s,Xt()),s.callbackNode!=null&&s.callbackNode===u?cS.bind(null,s):null)}function uS(s,l){if(nd())return null;GC(s,l,!0)}function VL(){oR(function(){(ot&6)!==0?Ps(ou,KL):rS()})}function Ag(){if(ts===0){var s=Ga;s===0&&(s=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),ts=s}return ts}function dS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:hu(""+s)}function hS(s,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,s.id&&u.setAttribute("form",s.id),l.parentNode.insertBefore(u,l),s=new FormData(s),u.parentNode.removeChild(u),s}function WL(s,l,u,h,y){if(l==="submit"&&u&&u.stateNode===y){var b=dS((y[kn]||null).action),S=h.submitter;S&&(l=(l=S[kn]||null)?dS(l.formAction):S.getAttribute("formAction"),l!==null&&(b=l,S=null));var P=new mu("action","action",null,h,y);s.push({event:P,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ts!==0){var R=S?hS(y,S):new FormData(y);Kp(u,{pending:!0,data:R,method:y.method,action:b},null,R)}}else typeof b=="function"&&(P.preventDefault(),R=S?hS(y,S):new FormData(y),Kp(u,{pending:!0,data:R,method:y.method,action:b},b,R))},currentTarget:y}]})}}for(var Pg=0;Pg<lp.length;Pg++){var Dg=lp[Pg],QL=Dg.toLowerCase(),YL=Dg[0].toUpperCase()+Dg.slice(1);mi(QL,"on"+YL)}mi(qv,"onAnimationEnd"),mi(Gv,"onAnimationIteration"),mi(Kv,"onAnimationStart"),mi("dblclick","onDoubleClick"),mi("focusin","onFocus"),mi("focusout","onBlur"),mi(dL,"onTransitionRun"),mi(hL,"onTransitionStart"),mi(fL,"onTransitionCancel"),mi(Vv,"onTransitionEnd"),Ma("onMouseEnter",["mouseout","mouseover"]),Ma("onMouseLeave",["mouseout","mouseover"]),Ma("onPointerEnter",["pointerout","pointerover"]),Ma("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 Nl="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(" "),$L=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nl));function fS(s,l){l=(l&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],y=h.event;h=h.listeners;e:{var b=void 0;if(l)for(var S=h.length-1;0<=S;S--){var P=h[S],R=P.instance,G=P.currentTarget;if(P=P.listener,R!==b&&y.isPropagationStopped())break e;b=P,y.currentTarget=G;try{b(y)}catch($){xu($)}y.currentTarget=null,b=R}else for(S=0;S<h.length;S++){if(P=h[S],R=P.instance,G=P.currentTarget,P=P.listener,R!==b&&y.isPropagationStopped())break e;b=P,y.currentTarget=G;try{b(y)}catch($){xu($)}y.currentTarget=null,b=R}}}}function Fe(s,l){var u=l[Uf];u===void 0&&(u=l[Uf]=new Set);var h=s+"__bubble";u.has(h)||(pS(l,s,2,!1),u.add(h))}function Og(s,l,u){var h=0;l&&(h|=4),pS(u,s,h,l)}var sd="_reactListening"+Math.random().toString(36).slice(2);function Tg(s){if(!s[sd]){s[sd]=!0,rv.forEach(function(u){u!=="selectionchange"&&($L.has(u)||Og(u,!1,s),Og(u,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[sd]||(l[sd]=!0,Og("selectionchange",!1,l))}}function pS(s,l,u,h){switch(qS(l)){case 2:var y=wR;break;case 8:y=AR;break;default:y=Gg}u=y.bind(null,l,u,s),y=void 0,!Yf||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?s.addEventListener(l,u,{capture:!0,passive:y}):s.addEventListener(l,u,!0):y!==void 0?s.addEventListener(l,u,{passive:y}):s.addEventListener(l,u,!1)}function Mg(s,l,u,h,y){var b=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var S=h.tag;if(S===3||S===4){var P=h.stateNode.containerInfo;if(P===y)break;if(S===4)for(S=h.return;S!==null;){var R=S.tag;if((R===3||R===4)&&S.stateNode.containerInfo===y)return;S=S.return}for(;P!==null;){if(S=Da(P),S===null)return;if(R=S.tag,R===5||R===6||R===26||R===27){h=b=S;continue e}P=P.parentNode}}h=h.return}xv(function(){var G=b,$=Wf(u),ne=[];e:{var W=Wv.get(s);if(W!==void 0){var Q=mu,ve=s;switch(s){case"keypress":if(pu(u)===0)break e;case"keydown":case"keyup":Q=qN;break;case"focusin":ve="focus",Q=Zf;break;case"focusout":ve="blur",Q=Zf;break;case"beforeblur":case"afterblur":Q=Zf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Sv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=NN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=VN;break;case qv:case Gv:case Kv:Q=EN;break;case Vv:Q=QN;break;case"scroll":case"scrollend":Q=TN;break;case"wheel":Q=$N;break;case"copy":case"cut":case"paste":Q=jN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=wv;break;case"toggle":case"beforetoggle":Q=JN}var De=(l&4)!==0,ut=!De&&(s==="scroll"||s==="scrollend"),H=De?W!==null?W+"Capture":null:W;De=[];for(var j=G,F;j!==null;){var ee=j;if(F=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||F===null||H===null||(ee=Zr(j,H),ee!=null&&De.push(Ll(j,ee,F))),ut)break;j=j.return}0<De.length&&(W=new Q(W,ve,null,u,$),ne.push({event:W,listeners:De}))}}if((l&7)===0){e:{if(W=s==="mouseover"||s==="pointerover",Q=s==="mouseout"||s==="pointerout",W&&u!==Vf&&(ve=u.relatedTarget||u.fromElement)&&(Da(ve)||ve[Pa]))break e;if((Q||W)&&(W=$.window===$?$:(W=$.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ve=u.relatedTarget||u.toElement,Q=G,ve=ve?Da(ve):null,ve!==null&&(ut=a(ve),De=ve.tag,ve!==ut||De!==5&&De!==27&&De!==6)&&(ve=null)):(Q=null,ve=G),Q!==ve)){if(De=Sv,ee="onMouseLeave",H="onMouseEnter",j="mouse",(s==="pointerout"||s==="pointerover")&&(De=wv,ee="onPointerLeave",H="onPointerEnter",j="pointer"),ut=Q==null?W:Jr(Q),F=ve==null?W:Jr(ve),W=new De(ee,j+"leave",Q,u,$),W.target=ut,W.relatedTarget=F,ee=null,Da($)===G&&(De=new De(H,j+"enter",ve,u,$),De.target=F,De.relatedTarget=ut,ee=De),ut=ee,Q&&ve)t:{for(De=XL,H=Q,j=ve,F=0,ee=H;ee;ee=De(ee))F++;ee=0;for(var Ae=j;Ae;Ae=De(Ae))ee++;for(;0<F-ee;)H=De(H),F--;for(;0<ee-F;)j=De(j),ee--;for(;F--;){if(H===j||j!==null&&H===j.alternate){De=H;break t}H=De(H),j=De(j)}De=null}else De=null;Q!==null&&gS(ne,W,Q,De,!1),ve!==null&&ut!==null&&gS(ne,ut,ve,De,!0)}}e:{if(W=G?Jr(G):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var Ze=Lv;else if(Mv(W))if(Rv)Ze=lL;else{Ze=aL;var ke=sL}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?G&&Kf(G.elementType)&&(Ze=Lv):Ze=rL;if(Ze&&(Ze=Ze(s,G))){Nv(ne,Ze,u,$);break e}ke&&ke(s,W,G),s==="focusout"&&G&&W.type==="number"&&G.memoizedProps.value!=null&&Gf(W,"number",W.value)}switch(ke=G?Jr(G):window,s){case"focusin":(Mv(ke)||ke.contentEditable==="true")&&(ja=ke,sp=G,rl=null);break;case"focusout":rl=sp=ja=null;break;case"mousedown":ap=!0;break;case"contextmenu":case"mouseup":case"dragend":ap=!1,zv(ne,u,$);break;case"selectionchange":if(uL)break;case"keydown":case"keyup":zv(ne,u,$)}var Ie;if(tp)e:{switch(s){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Ia?Ov(s,u)&&(Ke="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Ke="onCompositionStart");Ke&&(Av&&u.locale!=="ko"&&(Ia||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Ia&&(Ie=vv()):(_o=$,$f="value"in _o?_o.value:_o.textContent,Ia=!0)),ke=ad(G,Ke),0<ke.length&&(Ke=new kv(Ke,s,null,u,$),ne.push({event:Ke,listeners:ke}),Ie?Ke.data=Ie:(Ie=Tv(u),Ie!==null&&(Ke.data=Ie)))),(Ie=eL?tL(s,u):nL(s,u))&&(Ke=ad(G,"onBeforeInput"),0<Ke.length&&(ke=new kv("onBeforeInput","beforeinput",null,u,$),ne.push({event:ke,listeners:Ke}),ke.data=Ie)),WL(ne,s,G,u,$)}fS(ne,l)})}function Ll(s,l,u){return{instance:s,listener:l,currentTarget:u}}function ad(s,l){for(var u=l+"Capture",h=[];s!==null;){var y=s,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Zr(s,u),y!=null&&h.unshift(Ll(s,y,b)),y=Zr(s,l),y!=null&&h.push(Ll(s,y,b))),s.tag===3)return h;s=s.return}return[]}function XL(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function gS(s,l,u,h,y){for(var b=l._reactName,S=[];u!==null&&u!==h;){var P=u,R=P.alternate,G=P.stateNode;if(P=P.tag,R!==null&&R===h)break;P!==5&&P!==26&&P!==27||G===null||(R=G,y?(G=Zr(u,b),G!=null&&S.unshift(Ll(u,G,R))):y||(G=Zr(u,b),G!=null&&S.push(Ll(u,G,R)))),u=u.return}S.length!==0&&s.push({event:l,listeners:S})}var JL=/\r\n?/g,ZL=/\u0000|\uFFFD/g;function mS(s){return(typeof s=="string"?s:""+s).replace(JL,`
10
+ `).replace(ZL,"")}function yS(s,l){return l=mS(l),mS(s)===l}function ct(s,l,u,h,y,b){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||La(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&La(s,""+h);break;case"className":uu(s,"class",h);break;case"tabIndex":uu(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":uu(s,u,h);break;case"style":yv(s,h,b);break;case"data":if(l!=="object"){uu(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=hu(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(l!=="input"&&ct(s,l,"name",y.name,y,null),ct(s,l,"formEncType",y.formEncType,y,null),ct(s,l,"formMethod",y.formMethod,y,null),ct(s,l,"formTarget",y.formTarget,y,null)):(ct(s,l,"encType",y.encType,y,null),ct(s,l,"method",y.method,y,null),ct(s,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=hu(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=no);break;case"onScroll":h!=null&&Fe("scroll",s);break;case"onScrollEnd":h!=null&&Fe("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=hu(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":Fe("beforetoggle",s),Fe("toggle",s),cu(s,"popover",h);break;case"xlinkActuate":to(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":to(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":to(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":to(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":to(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":to(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":to(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":to(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":to(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":cu(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=DN.get(u)||u,cu(s,u,h))}}function Ng(s,l,u,h,y,b){switch(u){case"style":yv(s,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(i(60));s.innerHTML=u}}break;case"children":typeof h=="string"?La(s,h):(typeof h=="number"||typeof h=="bigint")&&La(s,""+h);break;case"onScroll":h!=null&&Fe("scroll",s);break;case"onScrollEnd":h!=null&&Fe("scrollend",s);break;case"onClick":h!=null&&(s.onclick=no);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lv.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),b=s[kn]||null,b=b!=null?b[u]:null,typeof b=="function"&&s.removeEventListener(l,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(l,h,y);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):cu(s,u,h)}}}function nn(s,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",s),Fe("load",s);var h=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var S=u[b];if(S!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ct(s,l,b,S,u,null)}}y&&ct(s,l,"srcSet",u.srcSet,u,null),h&&ct(s,l,"src",u.src,u,null);return;case"input":Fe("invalid",s);var P=b=S=y=null,R=null,G=null;for(h in u)if(u.hasOwnProperty(h)){var $=u[h];if($!=null)switch(h){case"name":y=$;break;case"type":S=$;break;case"checked":R=$;break;case"defaultChecked":G=$;break;case"value":b=$;break;case"defaultValue":P=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,l));break;default:ct(s,l,h,$,u,null)}}fv(s,b,P,R,G,S,y,!1);return;case"select":Fe("invalid",s),h=S=b=null;for(y in u)if(u.hasOwnProperty(y)&&(P=u[y],P!=null))switch(y){case"value":b=P;break;case"defaultValue":S=P;break;case"multiple":h=P;default:ct(s,l,y,P,u,null)}l=b,u=S,s.multiple=!!h,l!=null?Na(s,!!h,l,!1):u!=null&&Na(s,!!h,u,!0);return;case"textarea":Fe("invalid",s),b=y=h=null;for(S in u)if(u.hasOwnProperty(S)&&(P=u[S],P!=null))switch(S){case"value":h=P;break;case"defaultValue":y=P;break;case"children":b=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:ct(s,l,S,P,u,null)}gv(s,h,y,b);return;case"option":for(R in u)if(u.hasOwnProperty(R)&&(h=u[R],h!=null))switch(R){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:ct(s,l,R,h,u,null)}return;case"dialog":Fe("beforetoggle",s),Fe("toggle",s),Fe("cancel",s),Fe("close",s);break;case"iframe":case"object":Fe("load",s);break;case"video":case"audio":for(h=0;h<Nl.length;h++)Fe(Nl[h],s);break;case"image":Fe("error",s),Fe("load",s);break;case"details":Fe("toggle",s);break;case"embed":case"source":case"link":Fe("error",s),Fe("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in u)if(u.hasOwnProperty(G)&&(h=u[G],h!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ct(s,l,G,h,u,null)}return;default:if(Kf(l)){for($ in u)u.hasOwnProperty($)&&(h=u[$],h!==void 0&&Ng(s,l,$,h,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(h=u[P],h!=null&&ct(s,l,P,h,u,null))}function eR(s,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,S=null,P=null,R=null,G=null,$=null;for(Q in u){var ne=u[Q];if(u.hasOwnProperty(Q)&&ne!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":R=ne;default:h.hasOwnProperty(Q)||ct(s,l,Q,null,h,ne)}}for(var W in h){var Q=h[W];if(ne=u[W],h.hasOwnProperty(W)&&(Q!=null||ne!=null))switch(W){case"type":b=Q;break;case"name":y=Q;break;case"checked":G=Q;break;case"defaultChecked":$=Q;break;case"value":S=Q;break;case"defaultValue":P=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,l));break;default:Q!==ne&&ct(s,l,W,Q,h,ne)}}qf(s,S,P,R,G,$,b,y);return;case"select":Q=S=P=W=null;for(b in u)if(R=u[b],u.hasOwnProperty(b)&&R!=null)switch(b){case"value":break;case"multiple":Q=R;default:h.hasOwnProperty(b)||ct(s,l,b,null,h,R)}for(y in h)if(b=h[y],R=u[y],h.hasOwnProperty(y)&&(b!=null||R!=null))switch(y){case"value":W=b;break;case"defaultValue":P=b;break;case"multiple":S=b;default:b!==R&&ct(s,l,y,b,h,R)}l=P,u=S,h=Q,W!=null?Na(s,!!u,W,!1):!!h!=!!u&&(l!=null?Na(s,!!u,l,!0):Na(s,!!u,u?[]:"",!1));return;case"textarea":Q=W=null;for(P in u)if(y=u[P],u.hasOwnProperty(P)&&y!=null&&!h.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:ct(s,l,P,null,h,y)}for(S in h)if(y=h[S],b=u[S],h.hasOwnProperty(S)&&(y!=null||b!=null))switch(S){case"value":W=y;break;case"defaultValue":Q=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==b&&ct(s,l,S,y,h,b)}pv(s,W,Q);return;case"option":for(var ve in u)if(W=u[ve],u.hasOwnProperty(ve)&&W!=null&&!h.hasOwnProperty(ve))switch(ve){case"selected":s.selected=!1;break;default:ct(s,l,ve,null,h,W)}for(R in h)if(W=h[R],Q=u[R],h.hasOwnProperty(R)&&W!==Q&&(W!=null||Q!=null))switch(R){case"selected":s.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:ct(s,l,R,W,h,Q)}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 De in u)W=u[De],u.hasOwnProperty(De)&&W!=null&&!h.hasOwnProperty(De)&&ct(s,l,De,null,h,W);for(G in h)if(W=h[G],Q=u[G],h.hasOwnProperty(G)&&W!==Q&&(W!=null||Q!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,l));break;default:ct(s,l,G,W,h,Q)}return;default:if(Kf(l)){for(var ut in u)W=u[ut],u.hasOwnProperty(ut)&&W!==void 0&&!h.hasOwnProperty(ut)&&Ng(s,l,ut,void 0,h,W);for($ in h)W=h[$],Q=u[$],!h.hasOwnProperty($)||W===Q||W===void 0&&Q===void 0||Ng(s,l,$,W,h,Q);return}}for(var H in u)W=u[H],u.hasOwnProperty(H)&&W!=null&&!h.hasOwnProperty(H)&&ct(s,l,H,null,h,W);for(ne in h)W=h[ne],Q=u[ne],!h.hasOwnProperty(ne)||W===Q||W==null&&Q==null||ct(s,l,ne,W,h,Q)}function bS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tR(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],b=y.transferSize,S=y.initiatorType,P=y.duration;if(b&&P&&bS(S)){for(S=0,P=y.responseEnd,h+=1;h<u.length;h++){var R=u[h],G=R.startTime;if(G>P)break;var $=R.transferSize,ne=R.initiatorType;$&&bS(ne)&&(R=R.responseEnd,S+=$*(R<P?1:(P-G)/(R-G)))}if(--h,l+=8*(b+S)/(y.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Lg=null,Rg=null;function rd(s){return s.nodeType===9?s:s.ownerDocument}function xS(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vS(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Eg(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Ig=null;function nR(){var s=window.event;return s&&s.type==="popstate"?s===Ig?!1:(Ig=s,!0):(Ig=null,!1)}var CS=typeof setTimeout=="function"?setTimeout:void 0,iR=typeof clearTimeout=="function"?clearTimeout:void 0,SS=typeof Promise=="function"?Promise:void 0,oR=typeof queueMicrotask=="function"?queueMicrotask:typeof SS<"u"?function(s){return SS.resolve(null).then(s).catch(sR)}:CS;function sR(s){setTimeout(function(){throw s})}function ns(s){return s==="head"}function kS(s,l){var u=l,h=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(y),cr(l);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Rl(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Rl(u);for(var b=u.firstChild;b;){var S=b.nextSibling,P=b.nodeName;b[Xr]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=S}}else u==="body"&&Rl(s.ownerDocument.body);u=y}while(u);cr(l)}function wS(s,l){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function jg(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":jg(u),zf(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function aR(s,l,u,h){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Xr])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(b=s.getAttribute("rel"),b==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(b!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(b=s.getAttribute("src"),(b!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===b)return s}else return s;if(s=si(s.nextSibling),s===null)break}return null}function rR(s,l,u){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=si(s.nextSibling),s===null))return null;return s}function AS(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=si(s.nextSibling),s===null))return null;return s}function Bg(s){return s.data==="$?"||s.data==="$~"}function Hg(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function lR(s,l){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||u.readyState!=="loading")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function si(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var _g=null;function PS(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(l===0)return si(s.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}s=s.nextSibling}return null}function DS(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return s;l--}else u!=="/$"&&u!=="/&"||l++}s=s.previousSibling}return null}function OS(s,l,u){switch(l=rd(u),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function Rl(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);zf(s)}var ai=new Map,TS=new Set;function ld(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var xo=Z.d;Z.d={f:cR,r:uR,D:dR,C:hR,L:fR,m:pR,X:mR,S:gR,M:yR};function cR(){var s=xo.f(),l=Zu();return s||l}function uR(s){var l=Oa(s);l!==null&&l.tag===5&&l.type==="form"?V0(l):xo.r(s)}var ar=typeof document>"u"?null:document;function MS(s,l,u){var h=ar;if(h&&typeof l=="string"&&l){var y=Jn(l);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),TS.has(y)||(TS.add(y),s={rel:s,crossOrigin:u,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),nn(l,"link",s),Vt(l),h.head.appendChild(l)))}}function dR(s){xo.D(s),MS("dns-prefetch",s,null)}function hR(s,l){xo.C(s,l),MS("preconnect",s,l)}function fR(s,l,u){xo.L(s,l,u);var h=ar;if(h&&s&&l){var y='link[rel="preload"][as="'+Jn(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Jn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Jn(u.imageSizes)+'"]')):y+='[href="'+Jn(s)+'"]';var b=y;switch(l){case"style":b=rr(s);break;case"script":b=lr(s)}ai.has(b)||(s=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:s,as:l},u),ai.set(b,s),h.querySelector(y)!==null||l==="style"&&h.querySelector(El(b))||l==="script"&&h.querySelector(Il(b))||(l=h.createElement("link"),nn(l,"link",s),Vt(l),h.head.appendChild(l)))}}function pR(s,l){xo.m(s,l);var u=ar;if(u&&s){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Jn(h)+'"][href="'+Jn(s)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=lr(s)}if(!ai.has(b)&&(s=m({rel:"modulepreload",href:s},l),ai.set(b,s),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Il(b)))return}h=u.createElement("link"),nn(h,"link",s),Vt(h),u.head.appendChild(h)}}}function gR(s,l,u){xo.S(s,l,u);var h=ar;if(h&&s){var y=Ta(h).hoistableStyles,b=rr(s);l=l||"default";var S=y.get(b);if(!S){var P={loading:0,preload:null};if(S=h.querySelector(El(b)))P.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},u),(u=ai.get(b))&&Ug(s,u);var R=S=h.createElement("link");Vt(R),nn(R,"link",s),R._p=new Promise(function(G,$){R.onload=G,R.onerror=$}),R.addEventListener("load",function(){P.loading|=1}),R.addEventListener("error",function(){P.loading|=2}),P.loading|=4,cd(S,l,h)}S={type:"stylesheet",instance:S,count:1,state:P},y.set(b,S)}}}function mR(s,l){xo.X(s,l);var u=ar;if(u&&s){var h=Ta(u).hoistableScripts,y=lr(s),b=h.get(y);b||(b=u.querySelector(Il(y)),b||(s=m({src:s,async:!0},l),(l=ai.get(y))&&zg(s,l),b=u.createElement("script"),Vt(b),nn(b,"link",s),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function yR(s,l){xo.M(s,l);var u=ar;if(u&&s){var h=Ta(u).hoistableScripts,y=lr(s),b=h.get(y);b||(b=u.querySelector(Il(y)),b||(s=m({src:s,async:!0,type:"module"},l),(l=ai.get(y))&&zg(s,l),b=u.createElement("script"),Vt(b),nn(b,"link",s),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function NS(s,l,u,h){var y=(y=Se.current)?ld(y):null;if(!y)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=rr(u.href),u=Ta(y).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=rr(u.href);var b=Ta(y).hoistableStyles,S=b.get(s);if(S||(y=y.ownerDocument||y,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(s,S),(b=y.querySelector(El(s)))&&!b._p&&(S.instance=b,S.state.loading=5),ai.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ai.set(s,u),b||bR(y,s,u,S.state))),l&&h===null)throw Error(i(528,""));return S}if(l&&h!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=lr(u),u=Ta(y).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function rr(s){return'href="'+Jn(s)+'"'}function El(s){return'link[rel="stylesheet"]['+s+"]"}function LS(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function bR(s,l,u,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),nn(l,"link",u),Vt(l),s.head.appendChild(l))}function lr(s){return'[src="'+Jn(s)+'"]'}function Il(s){return"script[async]"+s}function RS(s,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+Jn(u.href)+'"]');if(h)return l.instance=h,Vt(h),h;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Vt(h),nn(h,"style",y),cd(h,u.precedence,s),l.instance=h;case"stylesheet":y=rr(u.href);var b=s.querySelector(El(y));if(b)return l.state.loading|=4,l.instance=b,Vt(b),b;h=LS(u),(y=ai.get(y))&&Ug(h,y),b=(s.ownerDocument||s).createElement("link"),Vt(b);var S=b;return S._p=new Promise(function(P,R){S.onload=P,S.onerror=R}),nn(b,"link",h),l.state.loading|=4,cd(b,u.precedence,s),l.instance=b;case"script":return b=lr(u.src),(y=s.querySelector(Il(b)))?(l.instance=y,Vt(y),y):(h=u,(y=ai.get(b))&&(h=m({},u),zg(h,y)),s=s.ownerDocument||s,y=s.createElement("script"),Vt(y),nn(y,"link",h),s.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,cd(h,u.precedence,s));return l.instance}function cd(s,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,S=0;S<h.length;S++){var P=h[S];if(P.dataset.precedence===l)b=P;else if(b!==y)break}b?b.parentNode.insertBefore(s,b.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(s,l.firstChild))}function Ug(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function zg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var ud=null;function ES(s,l,u){if(ud===null){var h=new Map,y=ud=new Map;y.set(u,h)}else y=ud,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var b=u[y];if(!(b[Xr]||b[Jt]||s==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var S=b.getAttribute(l)||"";S=s+S;var P=h.get(S);P?P.push(b):h.set(S,[b])}}return h}function IS(s,l,u){s=s.ownerDocument||s,s.head.insertBefore(u,l==="title"?s.querySelector("head > title"):null)}function xR(s,l,u){if(u===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function jS(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function vR(s,l,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=rr(h.href),b=l.querySelector(El(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=dd.bind(s),l.then(s,s)),u.state.loading|=4,u.instance=b,Vt(b);return}b=l.ownerDocument||l,h=LS(h),(y=ai.get(y))&&Ug(h,y),b=b.createElement("link"),Vt(b);var S=b;S._p=new Promise(function(P,R){S.onload=P,S.onerror=R}),nn(b,"link",h),u.instance=b}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=dd.bind(s),l.addEventListener("load",u),l.addEventListener("error",u))}}var Fg=0;function CR(s,l){return s.stylesheets&&s.count===0&&fd(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&fd(s,s.stylesheets),s.unsuspend){var b=s.unsuspend;s.unsuspend=null,b()}},6e4+l);0<s.imgBytes&&Fg===0&&(Fg=62500*tR());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&fd(s,s.stylesheets),s.unsuspend)){var b=s.unsuspend;s.unsuspend=null,b()}},(s.imgBytes>Fg?50:800)+l);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function dd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fd(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var hd=null;function fd(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,hd=new Map,l.forEach(SR,s),hd=null,dd.call(s))}function SR(s,l){if(!(l.state.loading&4)){var u=hd.get(s);if(u)var h=u.get(null);else{u=new Map,hd.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var S=y[b];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(u.set(S.dataset.precedence,S),h=S)}h&&u.set(null,h)}y=l.instance,S=y.getAttribute("data-precedence"),b=u.get(S)||h,b===h&&u.set(null,y),u.set(S,y),this.count++,h=dd.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),l.state.loading|=4}}var jl={$$typeof:M,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function kR(s,l,u,h,y,b,S,P,R){this.tag=1,this.containerInfo=s,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=Ts(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ts(0),this.hiddenUpdates=Ts(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function BS(s,l,u,h,y,b,S,P,R,G,$,ne){return s=new kR(s,l,u,S,R,G,$,ne,P),l=1,b===!0&&(l|=24),b=Hn(3,null,null,l),s.current=b,b.stateNode=s,l=Cp(),l.refCount++,s.pooledCache=l,l.refCount++,b.memoizedState={element:h,isDehydrated:u,cache:l},Ap(b),s}function HS(s){return s?(s=_a,s):_a}function _S(s,l,u,h,y,b){y=HS(y),h.context===null?h.context=y:h.pendingContext=y,h=Ko(l),h.payload={element:u},b=b===void 0?null:b,b!==null&&(h.callback=b),u=Vo(s,h,l),u!==null&&(Tn(u,s,l),pl(u,s,l))}function US(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<l?u:l}}function qg(s,l){US(s,l),(s=s.alternate)&&US(s,l)}function zS(s){if(s.tag===13||s.tag===31){var l=Es(s,67108864);l!==null&&Tn(l,s,67108864),qg(s,67108864)}}function FS(s){if(s.tag===13||s.tag===31){var l=qn();l=Hf(l);var u=Es(s,l);u!==null&&Tn(u,s,l),qg(s,l)}}var pd=!0;function wR(s,l,u,h){var y=B.T;B.T=null;var b=Z.p;try{Z.p=2,Gg(s,l,u,h)}finally{Z.p=b,B.T=y}}function AR(s,l,u,h){var y=B.T;B.T=null;var b=Z.p;try{Z.p=8,Gg(s,l,u,h)}finally{Z.p=b,B.T=y}}function Gg(s,l,u,h){if(pd){var y=Kg(h);if(y===null)Mg(s,l,h,gd,u),GS(s,h);else if(DR(y,s,l,u,h))h.stopPropagation();else if(GS(s,h),l&4&&-1<PR.indexOf(s)){for(;y!==null;){var b=Oa(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var S=Kt(b.pendingLanes);if(S!==0){var P=b;for(P.pendingLanes|=2,P.entangledLanes|=2;S;){var R=1<<31-gn(S);P.entanglements[1]|=R,S&=~R}Ni(b),(ot&6)===0&&(Xu=Xt()+500,Ml(0))}}break;case 31:case 13:P=Es(b,2),P!==null&&Tn(P,b,2),Zu(),qg(b,2)}if(b=Kg(h),b===null&&Mg(s,l,h,gd,u),b===y)break;y=b}y!==null&&h.stopPropagation()}else Mg(s,l,h,null,u)}}function Kg(s){return s=Wf(s),Vg(s)}var gd=null;function Vg(s){if(gd=null,s=Da(s),s!==null){var l=a(s);if(l===null)s=null;else{var u=l.tag;if(u===13){if(s=r(l),s!==null)return s;s=null}else if(u===31){if(s=c(l),s!==null)return s;s=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return gd=s,null}function qS(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($r()){case ou:return 2;case su:return 8;case Aa:case Rf:return 32;case au:return 268435456;default:return 32}default:return 32}}var Wg=!1,is=null,os=null,ss=null,Bl=new Map,Hl=new Map,as=[],PR="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 GS(s,l){switch(s){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Bl.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hl.delete(l.pointerId)}}function _l(s,l,u,h,y,b){return s===null||s.nativeEvent!==b?(s={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},l!==null&&(l=Oa(l),l!==null&&zS(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),s)}function DR(s,l,u,h,y){switch(l){case"focusin":return is=_l(is,s,l,u,h,y),!0;case"dragenter":return os=_l(os,s,l,u,h,y),!0;case"mouseover":return ss=_l(ss,s,l,u,h,y),!0;case"pointerover":var b=y.pointerId;return Bl.set(b,_l(Bl.get(b)||null,s,l,u,h,y)),!0;case"gotpointercapture":return b=y.pointerId,Hl.set(b,_l(Hl.get(b)||null,s,l,u,h,y)),!0}return!1}function KS(s){var l=Da(s.target);if(l!==null){var u=a(l);if(u!==null){if(l=u.tag,l===13){if(l=r(u),l!==null){s.blockedOn=l,sv(s.priority,function(){FS(u)});return}}else if(l===31){if(l=c(u),l!==null){s.blockedOn=l,sv(s.priority,function(){FS(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function md(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var u=Kg(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);Vf=h,u.target.dispatchEvent(h),Vf=null}else return l=Oa(u),l!==null&&zS(l),s.blockedOn=u,!1;l.shift()}return!0}function VS(s,l,u){md(s)&&u.delete(l)}function OR(){Wg=!1,is!==null&&md(is)&&(is=null),os!==null&&md(os)&&(os=null),ss!==null&&md(ss)&&(ss=null),Bl.forEach(VS),Hl.forEach(VS)}function yd(s,l){s.blockedOn===l&&(s.blockedOn=null,Wg||(Wg=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,OR)))}var bd=null;function WS(s){bd!==s&&(bd=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){bd===s&&(bd=null);for(var l=0;l<s.length;l+=3){var u=s[l],h=s[l+1],y=s[l+2];if(typeof h!="function"){if(Vg(h||u)===null)continue;break}var b=Oa(u);b!==null&&(s.splice(l,3),l-=3,Kp(b,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function cr(s){function l(R){return yd(R,s)}is!==null&&yd(is,s),os!==null&&yd(os,s),ss!==null&&yd(ss,s),Bl.forEach(l),Hl.forEach(l);for(var u=0;u<as.length;u++){var h=as[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<as.length&&(u=as[0],u.blockedOn===null);)KS(u),u.blockedOn===null&&as.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],b=u[h+1],S=y[kn]||null;if(typeof b=="function")S||WS(u);else if(S){var P=null;if(b&&b.hasAttribute("formAction")){if(y=b,S=b[kn]||null)P=S.formAction;else if(Vg(y)!==null)continue}else P=S.action;typeof P=="function"?u[h+1]=P:(u.splice(h,3),h-=3),WS(u)}}}function QS(){function s(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(S){return y=S})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function Qg(s){this._internalRoot=s}xd.prototype.render=Qg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,h=qn();_S(u,h,s,l,null,null)},xd.prototype.unmount=Qg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;_S(s.current,2,null,s,null,null),Zu(),l[Pa]=null}};function xd(s){this._internalRoot=s}xd.prototype.unstable_scheduleHydration=function(s){if(s){var l=ov();s={blockedOn:null,target:s,priority:l};for(var u=0;u<as.length&&l!==0&&l<as[u].priority;u++);as.splice(u,0,s),u===0&&KS(s)}};var YS=e.version;if(YS!=="19.2.1")throw Error(i(527,YS,"19.2.1"));Z.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=f(l),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var TR={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vd.isDisabled&&vd.supportsFiber)try{Ds=vd.inject(TR),pn=vd}catch{}}return zl.createRoot=function(s,l){if(!o(s))throw Error(i(299));var u=!1,h="",y=nC,b=iC,S=oC;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),l=BS(s,1,!1,null,null,u,h,null,y,b,S,QS),s[Pa]=l.current,Tg(s),new Qg(l)},zl.hydrateRoot=function(s,l,u){if(!o(s))throw Error(i(299));var h=!1,y="",b=nC,S=iC,P=oC,R=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(R=u.formState)),l=BS(s,1,!0,l,u??null,h,y,R,b,S,P,QS),l.context=HS(null),u=l.current,h=qn(),h=Hf(h),y=Ko(h),y.callback=null,Vo(u,y,h),u=h,l.current.lanes=u,eo(l,u),Ni(l),s[Pa]=l.current,Tg(s),new xd(l)},zl.version="19.2.1",zl}var ck;function z2(){if(ck)return Yg.exports;ck=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Yg.exports=U2(),Yg.exports}var F2=z2();const q2="modulepreload",G2=function(n){return"/"+n},uk={},rt=function(e,t,i){let o=Promise.resolve();if(t&&t.length>0){let d=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=r?.nonce||r?.getAttribute("nonce");o=d(t.map(f=>{if(f=G2(f),f in uk)return;uk[f]=!0;const g=f.endsWith(".css"),m=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":q2,g||(x.as="script"),x.crossOrigin="",x.href=f,c&&x.setAttribute("nonce",c),document.head.appendChild(x),g)return new Promise((v,C)=>{x.addEventListener("load",v),x.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(r){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r}return o.then(r=>{for(const c of r||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})},K2=new fE({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ne=n=>typeof n=="string",Fl=()=>{let n,e;const t=new Promise((i,o)=>{n=i,e=o});return t.resolve=n,t.reject=e,t},dk=n=>n==null?"":""+n,V2=(n,e,t)=>{n.forEach(i=>{e[i]&&(t[i]=e[i])})},W2=/###/g,hk=n=>n&&n.indexOf("###")>-1?n.replace(W2,"."):n,fk=n=>!n||Ne(n),oc=(n,e,t)=>{const i=Ne(e)?e.split("."):e;let o=0;for(;o<i.length-1;){if(fk(n))return{};const a=hk(i[o]);!n[a]&&t&&(n[a]=new t),Object.prototype.hasOwnProperty.call(n,a)?n=n[a]:n={},++o}return fk(n)?{}:{obj:n,k:hk(i[o])}},pk=(n,e,t)=>{const{obj:i,k:o}=oc(n,e,Object);if(i!==void 0||e.length===1){i[o]=t;return}let a=e[e.length-1],r=e.slice(0,e.length-1),c=oc(n,r,Object);for(;c.obj===void 0&&r.length;)a=`${r[r.length-1]}.${a}`,r=r.slice(0,r.length-1),c=oc(n,r,Object),c?.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=t},Q2=(n,e,t,i)=>{const{obj:o,k:a}=oc(n,e,Object);o[a]=o[a]||[],o[a].push(t)},hh=(n,e)=>{const{obj:t,k:i}=oc(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i]},Y2=(n,e,t)=>{const i=hh(n,t);return i!==void 0?i:hh(e,t)},xP=(n,e,t)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in n?Ne(n[i])||n[i]instanceof String||Ne(e[i])||e[i]instanceof String?t&&(n[i]=e[i]):xP(n[i],e[i],t):n[i]=e[i]);return n},Ws=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var $2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const X2=n=>Ne(n)?n.replace(/[&<>"'\/]/g,e=>$2[e]):n;class J2{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const Z2=[" ",",","?","!",";"],eI=new J2(20),tI=(n,e,t)=>{e=e||"",t=t||"";const i=Z2.filter(r=>e.indexOf(r)<0&&t.indexOf(r)<0);if(i.length===0)return!0;const o=eI.getRegExp(`(${i.map(r=>r==="?"?"\\?":r).join("|")})`);let a=!o.test(n);if(!a){const r=n.indexOf(t);r>0&&!o.test(n.substring(0,r))&&(a=!0)}return a},ny=(n,e,t=".")=>{if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;const i=e.split(t);let o=n;for(let a=0;a<i.length;){if(!o||typeof o!="object")return;let r,c="";for(let d=a;d<i.length;++d)if(d!==a&&(c+=t),c+=i[d],r=o[c],r!==void 0){if(["string","number","boolean"].indexOf(typeof r)>-1&&d<i.length-1)continue;a+=d-a+1;break}o=r}return o},Cc=n=>n?.replace("_","-"),nI={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console?.[n]?.apply?.(console,e)}};class fh{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||nI,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,o){return o&&!this.debug?null:(Ne(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new fh(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new fh(this.logger,e)}}var zi=new fh;class Xh{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(t)||0;this.observers[i].set(t,o+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([o,a])=>{for(let r=0;r<a;r++)o(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,a])=>{for(let r=0;r<a;r++)o.apply(o,[e,...t])})}}class gk extends Xh{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i,o={}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,r=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.indexOf(".")>-1?c=e.split("."):(c=[e,t],i&&(Array.isArray(i)?c.push(...i):Ne(i)&&a?c.push(...i.split(a)):c.push(i)));const d=hh(this.data,c);return!d&&!t&&!i&&e.indexOf(".")>-1&&(e=c[0],t=c[1],i=c.slice(2).join(".")),d||!r||!Ne(i)?d:ny(this.data?.[e]?.[t],i,a)}addResource(e,t,i,o,a={silent:!1}){const r=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[e,t];i&&(c=c.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(c=e.split("."),o=t,t=c[1]),this.addNamespaces(t),pk(this.data,c,o),a.silent||this.emit("added",e,t,i,o)}addResources(e,t,i,o={silent:!1}){for(const a in i)(Ne(i[a])||Array.isArray(i[a]))&&this.addResource(e,t,a,i[a],{silent:!0});o.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,o,a,r={silent:!1,skipCopy:!1}){let c=[e,t];e.indexOf(".")>-1&&(c=e.split("."),o=i,i=t,t=c[1]),this.addNamespaces(t);let d=hh(this.data,c)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?xP(d,i,a):d={...d,...i},pk(this.data,c,d),r.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(o=>t[o]&&Object.keys(t[o]).length>0)}toJSON(){return this.data}}var vP={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,i,o){return n.forEach(a=>{e=this.processors[a]?.process(e,t,i,o)??e}),e}};const CP=Symbol("i18next/PATH_KEY");function iI(){const n=[],e=Object.create(null);let t;return e.get=(i,o)=>(t?.revoke?.(),o===CP?n:(n.push(o),t=Proxy.revocable(i,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function iy(n,e){const{[CP]:t}=n(iI());return t.join(e?.keySeparator??".")}const mk={},Jg=n=>!Ne(n)&&typeof n!="boolean"&&typeof n!="number";class ph extends Xh{constructor(e,t={}){super(),V2(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=zi.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const i={...t};if(e==null)return!1;const o=this.resolve(e,i);if(o?.res===void 0)return!1;const a=Jg(o.res);return!(i.returnObjects===!1&&a)}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const r=i&&e.indexOf(i)>-1,c=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!tI(e,i,o);if(r&&!c){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:Ne(a)?[a]:a};const f=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(f[0])>-1)&&(a=f.shift()),e=f.join(o)}return{key:e,namespaces:Ne(a)?[a]:a}}translate(e,t,i){let o=typeof t=="object"?{...t}:t;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),e==null)return"";typeof e=="function"&&(e=iy(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const a=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:c,namespaces:d}=this.extractFromKey(e[e.length-1],o),f=d[d.length-1];let g=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const m=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m?.toLowerCase()==="cimode")return x?a?{res:`${f}${g}${c}`,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(o)}:`${f}${g}${c}`:a?{res:c,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(o)}:c;const v=this.resolve(e,o);let C=v?.res;const k=v?.usedKey||c,w=v?.exactUsedKey||c,D=["[object Number]","[object Function]","[object RegExp]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,T=o.count!==void 0&&!Ne(o.count),L=ph.hasDefaultValue(o),N=T?this.pluralResolver.getSuffix(m,o.count,o):"",I=o.ordinal&&T?this.pluralResolver.getSuffix(m,o.count,{ordinal:!1}):"",K=T&&!o.ordinal&&o.count===0,U=K&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${N}`]||o[`defaultValue${I}`]||o.defaultValue;let z=C;M&&!C&&L&&(z=U);const X=Jg(z),_=Object.prototype.toString.apply(z);if(M&&z&&X&&D.indexOf(_)<0&&!(Ne(O)&&Array.isArray(z))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,z,{...o,ns:d}):`key '${c} (${this.language})' returned an object instead of string.`;return a?(v.res=V,v.usedParams=this.getUsedParamsDetails(o),v):V}if(r){const V=Array.isArray(z),ie=V?[]:{},oe=V?w:k;for(const B in z)if(Object.prototype.hasOwnProperty.call(z,B)){const Z=`${oe}${r}${B}`;L&&!C?ie[B]=this.translate(Z,{...o,defaultValue:Jg(U)?U[B]:void 0,joinArrays:!1,ns:d}):ie[B]=this.translate(Z,{...o,joinArrays:!1,ns:d}),ie[B]===Z&&(ie[B]=z[B])}C=ie}}else if(M&&Ne(O)&&Array.isArray(C))C=C.join(O),C&&(C=this.extendTranslation(C,e,o,i));else{let V=!1,ie=!1;!this.isValidLookup(C)&&L&&(V=!0,C=U),this.isValidLookup(C)||(ie=!0,C=c);const B=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:C,Z=L&&U!==C&&this.options.updateMissing;if(ie||V||Z){if(this.logger.log(Z?"updateKey":"missingKey",m,f,c,Z?U:C),r){const de=this.resolve(c,{...o,keySeparator:!1});de&&de.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let se=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let de=0;de<Y.length;de++)se.push(Y[de]);else this.options.saveMissingTo==="all"?se=this.languageUtils.toResolveHierarchy(o.lng||this.language):se.push(o.lng||this.language);const ae=(de,be,te)=>{const le=L&&te!==C?te:B;this.options.missingKeyHandler?this.options.missingKeyHandler(de,f,be,le,Z,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,f,be,le,Z,o),this.emit("missingKey",de,f,be,C)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?se.forEach(de=>{const be=this.pluralResolver.getSuffixes(de,o);K&&o[`defaultValue${this.options.pluralSeparator}zero`]&&be.indexOf(`${this.options.pluralSeparator}zero`)<0&&be.push(`${this.options.pluralSeparator}zero`),be.forEach(te=>{ae([de],c+te,o[`defaultValue${te}`]||U)})}):ae(se,c,U))}C=this.extendTranslation(C,e,o,v,i),ie&&C===c&&this.options.appendNamespaceToMissingKey&&(C=`${f}${g}${c}`),(ie||V)&&this.options.parseMissingKeyHandler&&(C=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${g}${c}`:c,V?C:void 0,o))}return a?(v.res=C,v.usedParams=this.getUsedParamsDetails(o),v):C}extendTranslation(e,t,i,o,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Ne(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=e.match(this.interpolator.nestingRegexp);f=m&&m.length}let g=i.replace&&!Ne(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,i.lng||this.language||o.usedLng,i),d){const m=e.match(this.interpolator.nestingRegexp),x=m&&m.length;f<x&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>a?.[0]===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),i)),i.interpolation&&this.interpolator.reset()}const r=i.postProcess||this.options.postProcess,c=Ne(r)?[r]:r;return e!=null&&c?.length&&i.applyPostProcessor!==!1&&(e=vP.handle(c,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,t={}){let i,o,a,r,c;return Ne(e)&&(e=[e]),e.forEach(d=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(d,t),g=f.key;o=g;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const x=t.count!==void 0&&!Ne(t.count),v=x&&!t.ordinal&&t.count===0,C=t.context!==void 0&&(Ne(t.context)||typeof t.context=="number")&&t.context!=="",k=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);m.forEach(w=>{this.isValidLookup(i)||(c=w,!mk[`${k[0]}-${w}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(mk[`${k[0]}-${w}`]=!0,this.logger.warn(`key "${o}" for languages "${k.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(D=>{if(this.isValidLookup(i))return;r=D;const O=[g];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(O,g,D,w,t);else{let T;x&&(T=this.pluralResolver.getSuffix(D,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(t.ordinal&&T.indexOf(N)===0&&O.push(g+T.replace(N,this.options.pluralSeparator)),O.push(g+T),v&&O.push(g+L)),C){const I=`${g}${this.options.contextSeparator||"_"}${t.context}`;O.push(I),x&&(t.ordinal&&T.indexOf(N)===0&&O.push(I+T.replace(N,this.options.pluralSeparator)),O.push(I+T),v&&O.push(I+L))}}let M;for(;M=O.pop();)this.isValidLookup(i)||(a=M,i=this.getResource(D,w,M,t))}))})}),{res:i,usedKey:o,exactUsedKey:a,usedLng:r,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,i,o):this.resourceStore.getResource(e,t,i,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!Ne(e.replace);let o=i?e.replace:e;if(i&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const a of t)delete o[a]}return o}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}}class yk{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zi.create("languageUtils")}getScriptPartFromCode(e){if(e=Cc(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Cc(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ne(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(t=o)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return t=o;const a=this.getLanguagePartFromCode(i);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(r=>{if(r===a)return r;if(!(r.indexOf("-")<0&&a.indexOf("-")<0)&&(r.indexOf("-")>0&&a.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===a||r.indexOf(a)===0&&a.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),Ne(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),o=[],a=r=>{r&&(this.isSupportedCode(r)?o.push(r):this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`))};return Ne(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Ne(e)&&a(this.formatLanguageCode(e)),i.forEach(r=>{o.indexOf(r)<0&&a(this.formatLanguageCode(r))}),o}}const bk={zero:0,one:1,two:2,few:3,many:4,other:5},xk={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class oI{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=zi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const i=Cc(e==="dev"?"en":e),o=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:i,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let r;try{r=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),xk;if(!e.match(/-|_/))return xk;const d=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(d,t)}return this.pluralRulesCache[a]=r,r}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(o=>`${t}${o}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((o,a)=>bk[o]-bk[a]).map(o=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(e,t,i={}){const o=this.getRule(e,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}}const vk=(n,e,t,i=".",o=!0)=>{let a=Y2(n,e,t);return!a&&o&&Ne(t)&&(a=ny(n,t,i),a===void 0&&(a=ny(e,t,i))),a},Zg=n=>n.replace(/\$/g,"$$$$");class Ck{constructor(e={}){this.logger=zi.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:o,prefix:a,prefixEscaped:r,suffix:c,suffixEscaped:d,formatSeparator:f,unescapeSuffix:g,unescapePrefix:m,nestingPrefix:x,nestingPrefixEscaped:v,nestingSuffix:C,nestingSuffixEscaped:k,nestingOptionsSeparator:w,maxReplaces:D,alwaysFormat:O}=e.interpolation;this.escape=t!==void 0?t:X2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?Ws(a):r||"{{",this.suffix=c?Ws(c):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=g?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=x?Ws(x):v||Ws("$t("),this.nestingSuffix=C?Ws(C):k||Ws(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=D||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,i,o){let a,r,c;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=v=>{if(v.indexOf(this.formatSeparator)<0){const D=vk(t,d,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,i,{...o,...t,interpolationkey:v}):D}const C=v.split(this.formatSeparator),k=C.shift().trim(),w=C.join(this.formatSeparator).trim();return this.format(vk(t,d,k,this.options.keySeparator,this.options.ignoreJSONStructure),w,i,{...o,...t,interpolationkey:k})};this.resetRegExp();const g=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>Zg(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?Zg(this.escape(v)):Zg(v)}].forEach(v=>{for(c=0;a=v.regex.exec(e);){const C=a[1].trim();if(r=f(C),r===void 0)if(typeof g=="function"){const w=g(e,a,o);r=Ne(w)?w:""}else if(o&&Object.prototype.hasOwnProperty.call(o,C))r="";else if(m){r=a[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${e}`),r="";else!Ne(r)&&!this.useRawValueToEscape&&(r=dk(r));const k=v.safeValue(r);if(e=e.replace(a[0],k),m?(v.regex.lastIndex+=r.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,t,i={}){let o,a,r;const c=(d,f)=>{const g=this.nestingOptionsSeparator;if(d.indexOf(g)<0)return d;const m=d.split(new RegExp(`${Ws(g)}[ ]*{`));let x=`{${m[1]}`;d=m[0],x=this.interpolate(x,r);const v=x.match(/'/g),C=x.match(/"/g);((v?.length??0)%2===0&&!C||(C?.length??0)%2!==0)&&(x=x.replace(/'/g,'"'));try{r=JSON.parse(x),f&&(r={...f,...r})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,k),`${d}${g}${x}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,d};for(;o=this.nestingRegexp.exec(e);){let d=[];r={...i},r=r.replace&&!Ne(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const f=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(f!==-1&&(d=o[1].slice(f).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),o[1]=o[1].slice(0,f)),a=t(c.call(this,o[1].trim(),r),r),a&&o[0]===e&&!Ne(a))return a;Ne(a)||(a=dk(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),d.length&&(a=d.reduce((g,m)=>this.format(g,m,i.lng,{...i,interpolationkey:o[1].trim()}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}const sI=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const i=n.split("(");e=i[0].toLowerCase().trim();const o=i[1].substring(0,i[1].length-1);e==="currency"&&o.indexOf(":")<0?t.currency||(t.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?t.range||(t.range=o.trim()):o.split(";").forEach(r=>{if(r){const[c,...d]=r.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),g=c.trim();t[g]||(t[g]=f),f==="false"&&(t[g]=!1),f==="true"&&(t[g]=!0),isNaN(f)||(t[g]=parseInt(f,10))}})}return{formatName:e,formatOptions:t}},Sk=n=>{const e={};return(t,i,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const r=i+JSON.stringify(a);let c=e[r];return c||(c=n(Cc(i),o),e[r]=c),c(t)}},aI=n=>(e,t,i)=>n(Cc(t),i)(e);class rI{constructor(e={}){this.logger=zi.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const i=t.cacheInBuiltFormats?Sk:aI;this.formats={number:i((o,a)=>{const r=new Intl.NumberFormat(o,{...a});return c=>r.format(c)}),currency:i((o,a)=>{const r=new Intl.NumberFormat(o,{...a,style:"currency"});return c=>r.format(c)}),datetime:i((o,a)=>{const r=new Intl.DateTimeFormat(o,{...a});return c=>r.format(c)}),relativetime:i((o,a)=>{const r=new Intl.RelativeTimeFormat(o,{...a});return c=>r.format(c,a.range||"day")}),list:i((o,a)=>{const r=new Intl.ListFormat(o,{...a});return c=>r.format(c)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Sk(t)}format(e,t,i,o={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(d=>d.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,d)=>{const{formatName:f,formatOptions:g}=sI(d);if(this.formats[f]){let m=c;try{const x=o?.formatParams?.[o.interpolationkey]||{},v=x.locale||x.lng||o.locale||o.lng||i;m=this.formats[f](c,v,{...g,...o,...x})}catch(x){this.logger.warn(x)}return m}else this.logger.warn(`there was no format function for ${f}`);return c},e)}}const lI=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class cI extends Xh{constructor(e,t,i,o={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=zi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(e,t,i,o){const a={},r={},c={},d={};return e.forEach(f=>{let g=!0;t.forEach(m=>{const x=`${f}|${m}`;!i.reload&&this.store.hasResourceBundle(f,m)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?r[x]===void 0&&(r[x]=!0):(this.state[x]=1,g=!1,r[x]===void 0&&(r[x]=!0),a[x]===void 0&&(a[x]=!0),d[m]===void 0&&(d[m]=!0)))}),g||(c[f]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(d)}}loaded(e,t,i){const o=e.split("|"),a=o[0],r=o[1];t&&this.emit("failedLoading",a,r,t),!t&&i&&this.store.addResourceBundle(a,r,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const c={};this.queue.forEach(d=>{Q2(d.loaded,[a],r),lI(d,e),t&&d.errors.push(t),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{c[f]||(c[f]={});const g=d.loaded[f];g.length&&g.forEach(m=>{c[f][m]===void 0&&(c[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(d=>!d.done)}read(e,t,i,o=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:o,wait:a,callback:r});return}this.readingCalls++;const c=(f,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&g&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,o+1,a*2,r)},a);return}r(f,g)},d=this.backend[i].bind(this.backend);if(d.length===2){try{const f=d(e,t);f&&typeof f.then=="function"?f.then(g=>c(null,g)).catch(c):c(null,f)}catch(f){c(f)}return}return d(e,t,c)}prepareLoading(e,t,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ne(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ne(t)&&(t=[t]);const a=this.queueLoad(e,t,i,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(r=>{this.loadOne(r)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){const i=e.split("|"),o=i[0],a=i[1];this.read(o,a,"read",void 0,void 0,(r,c)=>{r&&this.logger.warn(`${t}loading namespace ${a} for language ${o} failed`,r),!r&&c&&this.logger.log(`${t}loaded namespace ${a} for language ${o}`,c),this.loaded(e,r,c)})}saveMissing(e,t,i,o,a,r={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const d={...r,isUpdate:a},f=this.backend.create.bind(this.backend);if(f.length<6)try{let g;f.length===5?g=f(e,t,i,o,d):g=f(e,t,i,o),g&&typeof g.then=="function"?g.then(m=>c(null,m)).catch(c):c(null,g)}catch(g){c(g)}else f(e,t,i,o,c,d)}!e||!e[0]||this.store.addResource(e[0],t,i,o)}}}const em=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),Ne(n[1])&&(e.defaultValue=n[1]),Ne(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(i=>{e[i]=t[i]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),kk=n=>(Ne(n.ns)&&(n.ns=[n.ns]),Ne(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Ne(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Sd=()=>{},uI=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})},SP="__i18next_supportNoticeShown",dI=()=>typeof globalThis<"u"&&!!globalThis[SP],hI=()=>{typeof globalThis<"u"&&(globalThis[SP]=!0)},fI=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(e=>e?.projectId));class sc extends Xh{constructor(e={},t){if(super(),this.options=kk(e),this.services={},this.logger=zi,this.modules={external:[]},uI(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Ne(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=em();this.options={...i,...this.options,...kk(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!fI(this)&&!dI()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),hI());const o=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?zi.init(o(this.modules.logger),this.options):zi.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=rI;const g=new yk(this.options);this.store=new gk(this.options.resources,this.options);const m=this.services;m.logger=zi,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new oI(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(m.formatter=o(f),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new Ck(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new cI(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(v,...C)=>{this.emit(v,...C)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new ph(this.services,this.options),this.translator.on("*",(v,...C)=>{this.emit(v,...C)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Sd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...g)=>this.store[f](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...g)=>(this.store[f](...g),this)});const c=Fl(),d=()=>{const f=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),t(g,m)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),c}loadResources(e,t=Sd){let i=t;const o=Ne(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const a=[],r=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&a.indexOf(f)<0&&a.push(f)})};o?r(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>r(d)),this.options.preload?.forEach?.(c=>r(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(c)})}else i(null)}reloadResources(e,t,i){const o=Fl();return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=Sd),this.services.backendConnector.reload(e,t,a=>{o.resolve(),i(a)}),o}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&vP.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const i=Fl();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,d)=>{d?this.isLanguageChangingTo===e&&(o(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),t&&t(c,(...f)=>this.t(...f))},r=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const d=Ne(c)?c:c&&c[0],f=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(Ne(c)?[c]:c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,g=>{a(g,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?r(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e),i}getFixedT(e,t,i){const o=(a,r,...c)=>{let d;typeof r!="object"?d=this.options.overloadTranslationOptionHandler([a,r].concat(c)):d={...r},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs,d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const f=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(a)?g=a.map(m=>(typeof m=="function"&&(m=iy(m,{...this.options,...r})),`${d.keyPrefix}${f}${m}`)):(typeof a=="function"&&(a=iy(a,{...this.options,...r})),g=d.keyPrefix?`${d.keyPrefix}${f}${a}`:a),this.t(g,d)};return Ne(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=i,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const r=(c,d)=>{const f=this.services.backendConnector.state[`${c}|${d}`];return f===-1||f===0||f===2};if(t.precheck){const c=t.precheck(this,r);if(c!==void 0)return c}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(i,e)&&(!o||r(a,e)))}loadNamespaces(e,t){const i=Fl();return this.options.ns?(Ne(e)&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),t&&t(o)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=Fl();Ne(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(r=>o.indexOf(r)<0&&this.services.languageUtils.isSupportedCode(r));return a.length?(this.options.preload=o.concat(a),this.loadResources(r=>{i.resolve(),t&&t(r)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new yk(em());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const i=new sc(e,t);return i.createInstance=sc.createInstance,i}cloneInstance(e={},t=Sd){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},a=new sc(o);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},i){const c=Object.keys(this.store.data).reduce((d,f)=>(d[f]={...this.store.data[f]},d[f]=Object.keys(d[f]).reduce((g,m)=>(g[m]={...d[f][m]},g),d[f]),d),{});a.store=new gk(c,o),a.services.resourceStore=a.store}if(e.interpolation){const d={...em().interpolation,...this.options.interpolation,...e.interpolation},f={...o,interpolation:d};a.services.interpolator=new Ck(f)}return a.translator=new ph(a.services,o),a.translator.on("*",(c,...d)=>{a.emit(c,...d)}),a.init(o,t),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const re=sc.createInstance();re.createInstance;re.dir;re.init;re.loadResources;re.reloadResources;re.use;re.changeLanguage;re.getFixedT;re.t;re.exists;re.setDefaultNamespace;re.hasLoadedNamespace;re.loadNamespaces;re.loadLanguages;const pI=(n,e,t,i)=>{const o=[t,{code:e,...i||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(o,"warn","react-i18next::",!0);ha(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...o):console?.warn&&console.warn(...o)},wk={},kP=(n,e,t,i)=>{ha(t)&&wk[t]||(ha(t)&&(wk[t]=new Date),pI(n,e,t,i))},wP=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},oy=(n,e,t)=>{n.loadNamespaces(e,wP(n,t))},Ak=(n,e,t,i)=>{if(ha(t)&&(t=[t]),n.options.preload&&n.options.preload.indexOf(e)>-1)return oy(n,t,i);t.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(e,wP(n,i))},gI=(n,e,t={})=>!e.languages||!e.languages.length?(kP(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,o)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,n))return!1}}),ha=n=>typeof n=="string",mI=n=>typeof n=="object"&&n!==null,yI=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bI={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},xI=n=>bI[n],vI=n=>n.replace(yI,xI);let sy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:vI,transDefaultProps:void 0};const CI=(n={})=>{sy={...sy,...n}},SI=()=>sy;let AP;const kI=n=>{AP=n},wI=()=>AP,AI={type:"3rdParty",init(n){CI(n.options.react),kI(n)}},PI=A.createContext();class DI{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var tm={exports:{}},nm={};var Pk;function OI(){if(Pk)return nm;Pk=1;var n=nP();function e(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,o=n.useEffect,a=n.useLayoutEffect,r=n.useDebugValue;function c(m,x){var v=x(),C=i({inst:{value:v,getSnapshot:x}}),k=C[0].inst,w=C[1];return a(function(){k.value=v,k.getSnapshot=x,d(k)&&w({inst:k})},[m,v,x]),o(function(){return d(k)&&w({inst:k}),m(function(){d(k)&&w({inst:k})})},[m]),r(v),v}function d(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!t(m,v)}catch{return!0}}function f(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return nm.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,nm}var Dk;function TI(){return Dk||(Dk=1,tm.exports=OI()),tm.exports}var MI=TI();const NI=(n,e)=>ha(e)?e:mI(e)&&ha(e.defaultValue)?e.defaultValue:Array.isArray(n)?n[n.length-1]:n,LI={t:NI,ready:!1},RI=()=>()=>{},Ce=(n,e={})=>{const{i18n:t}=e,{i18n:i,defaultNS:o}=A.useContext(PI)||{},a=t||i||wI();a&&!a.reportNamespaces&&(a.reportNamespaces=new DI),a||kP(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const r=A.useMemo(()=>({...SI(),...a?.options?.react,...e}),[a,e]),{useSuspense:c,keyPrefix:d}=r,f=o||a?.options?.defaultNS,g=ha(f)?[f]:f||["translation"],m=A.useMemo(()=>g,g);a?.reportNamespaces?.addUsedNamespaces?.(m);const x=A.useRef(0),v=A.useCallback(U=>{if(!a)return RI;const{bindI18n:z,bindI18nStore:X}=r,_=()=>{x.current+=1,U()};return z&&a.on(z,_),X&&a.store.on(X,_),()=>{z&&z.split(" ").forEach(V=>a.off(V,_)),X&&X.split(" ").forEach(V=>a.store.off(V,_))}},[a,r]),C=A.useRef(),k=A.useCallback(()=>{if(!a)return LI;const U=!!(a.isInitialized||a.initializedStoreOnce)&&m.every(oe=>gI(oe,a,r)),z=e.lng||a.language,X=x.current,_=C.current;if(_&&_.ready===U&&_.lng===z&&_.keyPrefix===d&&_.revision===X)return _;const ie={t:a.getFixedT(z,r.nsMode==="fallback"?m:m[0],d),ready:U,lng:z,keyPrefix:d,revision:X};return C.current=ie,ie},[a,m,d,r,e.lng]),[w,D]=A.useState(0),{t:O,ready:M}=MI.useSyncExternalStore(v,k,k);A.useEffect(()=>{if(a&&!M&&!c){const U=()=>D(z=>z+1);e.lng?Ak(a,e.lng,m,U):oy(a,m,U)}},[a,e.lng,m,M,c,w]);const T=a||{},L=A.useRef(null),N=A.useRef(),I=U=>{const z=Object.getOwnPropertyDescriptors(U);z.__original&&delete z.__original;const X=Object.create(Object.getPrototypeOf(U),z);if(!Object.prototype.hasOwnProperty.call(X,"__original"))try{Object.defineProperty(X,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return X},K=A.useMemo(()=>{const U=T,z=U?.language;let X=U;U&&(L.current&&L.current.__original===U?N.current!==z?(X=I(U),L.current=X,N.current=z):X=L.current:(X=I(U),L.current=X,N.current=z));const _=[O,X,M];return _.t=O,_.i18n=X,_.ready=M,_},[O,T,M,T.resolvedLanguage,T.language,T.languages]);if(a&&c&&!M)throw new Promise(U=>{const z=()=>U();e.lng?Ak(a,e.lng,m,z):oy(a,m,z)});return K},PP="ccs-ui-locale",EI=["en","zh-CN","vi","ja","ko"];function Qc(n){return n?n.toLowerCase().startsWith("ko")?"ko":n.toLowerCase().startsWith("ja")?"ja":n.toLowerCase().startsWith("zh")?"zh-CN":n.toLowerCase().startsWith("vi")?"vi":"en":"en"}function DP(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(PP);return n?Qc(n):null}catch{return null}}function II(){const n=DP();return n||(typeof navigator<"u"?Qc(navigator.language):"en")}function Sb(n){const e=DP();return e||(typeof navigator<"u"?Qc(navigator.language):"en")}function jI(n){const e=Qc(n);if(typeof window<"u")try{window.localStorage.setItem(PP,e)}catch{}return e}const BI={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese",vi:"Vietnamese",ja:"Japanese",ko:"Korean"},layout:{languageSwitcher:"Language"},nav:{general:"General",home:"Home",analytics:"Analytics",identityAccess:"Identity & Access",apiProfiles:"Profiles",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Overview",controlPanel:"Control Panel",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Accounts",allAccounts:"All Accounts",sharedData:"Shared Resources",compatibleClis:"Compatible",deprecated:"Deprecated",factoryDroid:"Factory Droid",system:"System",health:"Health",logs:"Logs",settings:"Settings",openrouterTooltip:"Featured: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health",configurationRequired:"Configuration Required"},auth:{dashboardTitle:"CCS Dashboard",protectedAccessLabel:"Protected access",remoteGuardLabel:"Remote access guard",loading:"Checking dashboard access…",loginDescription:"Use the username and password configured for this CCS instance to access the dashboard.",username:"Username",password:"Password",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",signIn:"Sign In",signingIn:"Signing in...",loginFailed:"Login failed",lightMode:"Light",darkMode:"Dark",noDefaultCredentials:"No default credentials ship with CCS.",credentialsHint:"Credentials are created with `ccs config auth setup` on the CCS host. Docker deployments must run that command inside the container.",remoteSetupTitle:"Remote access needs auth setup",remoteSetupDescription:"This dashboard was opened from a non-local address, but dashboard auth is not enabled for this CCS instance yet.",incompleteSetupDescription:"Dashboard auth is turned on, but the setup is incomplete. Finish the configuration for this CCS instance before signing in.",safetyNoteRemote:"Remote management stays locked until the CCS host owner enables dashboard auth.",safetyNoteLocal:"If you are on the same machine, the localhost URL remains the simplest path in.",safetyNoteSession:"Successful sign-ins create an HTTP-only session that stays scoped to this dashboard host.",hostStepTitle:"On the CCS host",hostStepDescription:"Create or re-enable dashboard credentials, then reopen this page from the remote device.",dockerStepDescription:"Docker deployment? Run the setup inside the running container:",localStepTitle:"If this is your machine",localStepDescription:"Open the localhost URL printed by `ccs config` instead of the LAN or Tailscale address.",showPassword:"Show password",hidePassword:"Hide password"},commonToast:{apiKeyRequired:"API key is required",accountAddedPresetFailed:"Account added, but failed to apply default preset",settingsCopied:"Settings copied to clipboard",enterPresetName:"Please enter a preset name to save",codeCopied:"Code copied to clipboard",copyCodeFailed:"Failed to copy code",appliedModelAllTiers:"Applied model to all tiers",settingsSaved:"Settings saved",defaultTargetUpdated:"Default target updated",failedUpdateDefaultTarget:"Failed to update default target to {{target}}{{suffix}}",resourcesUpdated:"Shared resources updated"},profileDialog:{editTitle:"Edit Profile",createTitle:"Create API Profile",name:"Name",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"Default Model (ANTHROPIC_MODEL)",defaultModelHint:"Leave blank to use: {{model}}",modelMappingTitle:"Model Mapping (Opus/Sonnet/Haiku)",modelMappingDesc:"Configure different model IDs for each tier. Useful for API proxies that route different model types to different backends.",opusModel:"Opus Model (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet Model (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku Model (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Cancel",saving:"Saving...",update:"Update",create:"Create"},modelTierMapping:{title:"Model Tier Mapping",advanced:"Advanced",description:"Configure different models for Claude Code's opus/sonnet/haiku tiers.",autoSuggest:"Auto-suggest based on {{provider}}",opusPlaceholder:"e.g., anthropic/claude-opus-4",sonnetPlaceholder:"e.g., anthropic/claude-sonnet-4",haikuPlaceholder:"e.g., anthropic/claude-3.5-haiku",footer:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"sensitive",none:"No environment variables configured.",noneHint:"Add variables using the input below or edit the JSON directly.",addVariable:"Add Environment Variable",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"Using:",variantNameRequired:"Runtime Variant Name *",variantNamePlaceholder:"e.g., my-gemini, g3, flash",invokeHintPrefix:"Run with this variant:",model:"Model",modelPlaceholder:"e.g., gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"Choose from presets instead",selectModel:"Select a model",customModelName:"Custom model name...",enterAnyModel:"Enter any model name supported by CLIProxy",defaultModel:"Default: {{model}}",providerDefault:"provider default",back:"Back",skip:"Skip",creating:"Creating...",createVariant:"Create Variant",skipHint:"Skip if account setup is enough and you do not need a separate runtime variant"},customPresetDialog:{title:"Custom Preset",presetNameOptional:"Preset Name (optional)",presetNamePlaceholder:"e.g., My Custom Config",codexTipPrefix:"Codex tip: suffixes",codexTipSuffix:"pin effort. Unsuffixed models use Thinking settings.",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested",opusModel:"Opus (Most capable)",opusModelDesc:"For complex reasoning tasks",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"Balance of speed and capability",haikuModel:"Haiku (Fast)",haikuModelDesc:"Quick responses for simple tasks",cancel:"Cancel",savePreset:"Save Preset",applyPreset:"Apply Preset",deletePreset:"Delete Preset"},componentModelSelector:{selectModel:"Select model",availableModelsCount:"Available Models ({{count}})",preview:"Preview"},searchableSelect:{searchModels:"Search models...",noResults:"No results found."},copilotSettings:{enableCopilot:"Enable Copilot",enableCopilotDesc:"Allow using GitHub Copilot subscription",basicSettings:"Basic Settings",accountType:"Account Type",accountTypeIndividual:"Individual",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Rate Limiting",rateLimitSeconds:"Rate Limit (seconds)",noLimit:"No limit",waitOnRateLimit:"Wait on Rate Limit",waitOnRateLimitDesc:"Wait instead of error when limit hit",daemonSettings:"Daemon Settings",autoStartDaemon:"Auto-start Daemon",autoStartDaemonDesc:"Start copilot-api when using profile"},providerModelSelector:{selectModel:"Select model",noModelsForProvider:"No models available for this provider",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Free Tier",paidTier:"Paid Tier",modelKnownIssues:"This model has known issues",viewIssueDetails:"View issue details",modelDeprecated:"This model is deprecated",recommended:"Recommended",allModelsCount:"All Models ({{count}})",noModelsAvailable:"No models available",shadowed:"Shadowed",prefixOnly:"Prefix only",current:"Current",currentValue:"Current value",preferredPinnedModel:"Preferred pinned model:",pinnedRouteStatus:"Pinned route status:",pinnedModelNotAdvertised:"Pinned model is not currently advertised by the proxy: {{model}}",codexReasoningVariants:"Reasoning variants",codexFastVariants:"Fast variants"},createAuthProfileDialog:{title:"Create New Account",description:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table.",profileName:"Profile Name",profileNamePlaceholder:"e.g., work, personal, client",invalidProfileName:"Name must start with a letter and contain only letters, numbers, dashes, or underscores.",enableSharedHistory:"Enable shared history sync with other ccs auth accounts",historySyncGroupOptional:"History Sync Group (optional)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Leave empty to use the default shared group. Spaces are normalized to dashes.",deeperContinuity:"Advanced: deeper continuity mode",deeperContinuityHint:"Adds sync for session-env, file-history, shell-snapshots, and todos. Credentials stay isolated.",invalidContextGroup:"Group must start with a letter and use only letters, numbers, dashes, or underscores (max {{max}} chars).",command:"Command",commandFallback:"ccs auth create <name>",afterRunPrefix:"After running the command:",afterRunStep1:"Complete the Claude login in your browser",afterRunStep2:"Return here and refresh to see the new account",poolingHint:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button.",close:"Close",copied:"Copied!",copyCommand:"Copy Command"},accountRouteGuide:{title:"Recommended two-account route",description:"Use separate account profiles for token isolation. Turn on history sync only when both accounts should see the same local continuity.",status:{empty:"create accounts",isolated:"isolated ready",shared:"shared project context",deeper:"deeper sync ready",mixed:"mixed setup"},cards:{isolated:{title:"Tokens stay separate",desc:"Each ccs auth account owns its own Claude config, login, and credentials. Sync settings never copy tokens."},select:{title:"You choose the account",desc:"Run ccs work or ccs personal for explicit usage. Set Default only when plain ccs should follow one account."},settings:{title:"Settings follow root",desc:"Non-bare accounts link settings.json through CCS shared state to ~/.claude/settings.json. ccs auth show confirms it."},sync:{title:"History sync is opt-in",desc:"Both accounts need Shared mode and the same group. Deeper sync adds extra local continuity artifacts."}},commands:{isolated:"Isolated account usage",sync:"Optional shared history",syncDesc:'Use the same group, such as "{{group}}", on both accounts when you want them to share local history.'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Other"},cliproxyOverviewComponents:{availableModels:"Available Models",noModelsAvailable:"No models available",startSessionHint:"Start a CLIProxy session to fetch available models",totalCount:"{{count}} total",availableThroughGroupedByProvider:"Models available through {{backendLabel}}, grouped by provider",moreCount:"+{{count}} more"},categorizedModelSelector:{selectModel:"Select a model",noModelsAvailable:"No models available",modelPlaceholder:"Model..."},openrouterQuickStart:{recommended:"Recommended",title:"Start with OpenRouter",description:"Access {{modelCountLabel}} models from OpenAI, Anthropic, Google, Meta and more - all through one API.",featureOneApi:"One API, all providers",profileSummaryCount:"{{count}} profile",profileSummaryCount_other:"{{count}} profiles",profileSummaryEmpty:"Premium quality + local control",summaryBadgeDefaultQuality:"Best quality by default",summaryBadgeLocalLane:"Local lane when task fit wins",summaryExistingTitle:"Choose a profile or add another lane",summaryEmptyTitle:"Choose your first profile lane",summaryExistingDescription:"You already have {{count}} profile in this workspace. Keep premium-quality providers for serious coding and add local runtimes when privacy, cost, or offline work matters.",summaryExistingDescription_other:"You already have {{count}} profiles in this workspace. Keep premium-quality providers for serious coding and add local runtimes when privacy, cost, or offline work matters.",summaryEmptyDescription:"Pick the lane that matches the work. Premium providers stay the default for reliable coding. Local runtimes are best for privacy, cheaper transforms, and experimentation.",qualityLanesTitle:"Best quality lanes",qualityLaneHighlightDefaultQuality:"Best default lane for high-stakes coding quality",alibabaLaneDescription:"Strong direct coding profile when you want a dedicated premium lane outside the OpenRouter catalog.",alibabaLaneHighlightQuality:"Good when you want premium quality with a dedicated endpoint",localRuntimesTitle:"Local runtimes",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"Best for private prompts, local cleanup, and cheap batch transforms",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"Best for custom GGUF setups and advanced self-hosted local workflows",localDetectedModels:"{{count}} local model detected",localDetectedModels_other:"{{count}} local models detected",localNoModelsDetected:"No local models detected yet",localWaitingServer:"Waiting for a local server and model list",localRuntimeCheckingBadge:"Checking",localRuntimeReadyBadge:"Ready",localRuntimeNeedsModelBadge:"Needs model",localRuntimeOfflineBadge:"Offline",localRuntimeCheckingDescription:"Checking the local runtime status before showing setup guidance.",localRuntimeReadyDescription:"Best for private prompts, offline workflows, and cheaper batch transforms.",localRuntimeNeedsModelDescription:"The runtime is up, but the recommended local model still needs to be pulled or loaded.",localRuntimeOfflineDescription:"Use this lane for privacy-sensitive work, cheap local transforms, and offline sessions.",localRuntimeCheckingFooter:"Checking the local runtime...",localRuntimeReadyFooter:"Endpoint ready at {{endpoint}}",localRuntimeMissingModelFooter:"Run `{{command}}` to finish local setup.",localRuntimeOfflineFooter:"Run `{{command}}` to bring the local endpoint online.",localRuntimeSetupAction:"Set up {{label}}",localRuntimeUseAction:"Use {{label}}",localRuntimeFinishAction:"Finish {{label}} setup",runtimeProviderBadge:"Runtime provider setup",runtimeProviderTitle:"Open AI Providers",runtimeProviderManagedDescription:"Use this when you need CLIProxy-managed connectors, provider secrets, and advanced routing controls.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex, and OpenAI-compatible connectors",runtimeProviderFeatureSecrets:"Shared secrets stay outside individual API profiles",runtimeProviderFooter:"Best when multiple profiles should share one provider configuration.",createOpenRouterProfile:"Create OpenRouter Profile",getApiKeyAt:"Get your API key at",createCustomProfile:"Create Custom API Profile"},alibabaCodingPlanQuickStart:{recommended:"Recommended",title:"Try Alibaba Coding Plan",description:"Use Alibaba Cloud Coding Plan through an Anthropic-compatible endpoint for coding workloads.",featureEndpoint:"Anthropic-compatible endpoint",featureKeyFormat:"Dedicated sk-sp API keys",createAlibabaProfile:"Create Alibaba Coding Plan Profile",readGuideAt:"Read setup guide at"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan via Anthropic endpoint",add:"Add"},credentialHealth:{title:"Credential Health",ready:"Ready",noCredentialsConfigured:"No credentials configured. Use the login buttons above to authenticate.",neverUsed:"Never used",justNow:"Just now",unknown:"Unknown",daysAgo:"{{count}}d ago",hoursAgo:"{{count}}h ago",minutesAgo:"{{count}}m ago"},proxyStatusWidget:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",syncReady:"Sync Ready",noConfig:"No Config",remoteProxy:"Remote Proxy",active:"Active",trafficAutoRouted:"Traffic auto-routed to remote server",tooltipSync:"Sync profiles to CLIProxy",tooltipRestart:"Restart",tooltipStop:"Stop",tooltipClose:"Close",tooltipVersionSettings:"Version settings",versionManagement:"Version Management",selectVersionPlaceholder:"Select version to install...",stable:"(stable)",install:"Install",versionsAboveUnstable:"Versions above {{version}} have known issues",versionsKnownIssues:"Version {{version}} has known issues",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",installFaultyTitle:"Install Version With Known Issues?",installFaultyDesc:"You are about to install <strong>v{{version}}</strong>, which falls inside the known faulty range <strong>{{range}}</strong>.",installFaultyWarning:"This version has known bugs and may fail or leave the proxy in a bad state.",installUnstableTitle:"Install Unstable Version?",installUnstableDesc:"You are about to install <strong>v{{version}}</strong>, which is above the maximum stable version <strong>v{{maxStable}}</strong>.",installUnstableWarning:"This version has known stability issues and may cause unexpected behavior.",installUnstableConfirm:"Are you sure you want to proceed?",cancel:"Cancel",installAnyway:"Install Anyway",clickToDowngrade:"Click to downgrade",clickToUpdate:"Click to update"},syncStatusCard:{profileSync:"Profile Sync",ready:"Ready",noConfig:"No Config",syncsProfilesDesc:"Syncs API profiles to local CLIProxy config",runDoctorHint:"Run <code>ccs doctor --fix</code> to generate config.",details:"Details",syncNow:"Sync Now"},syncDialog:{title:"Sync Profiles to Local CLIProxy",description:"Sync your CCS API profiles to the local CLIProxy config.yaml.",noProfiles:"No profiles configured to sync.",createProfilesFirst:"Create API profiles first using the Profiles tab.",modelLabel:"Model:",ready:"Ready",profilesToSync_one:"{{count}} profile to sync",profilesToSync_other:"{{count}} profiles to sync",cancel:"Cancel",syncing:"Syncing...",synced:"Synced!",syncNow:"Sync Now"},errorLogs:{title:"Error Logs",failedRequests_one:"{{count}} failed request",failedRequests_other:"{{count}} failed requests",cliproxyDiagnostics:"CLIProxy Diagnostics",showingCount:"Showing 50 of {{total}} logs",selectLog:"Select a log to view details",failedLoadContent:"Failed to load log content",copyAbsolutePath:"Copy absolute path",copyRawContent:"Copy raw log content",tabOverview:"Overview",tabHeaders:"Headers",tabRequest:"Request",tabResponse:"Response",tabRaw:"Raw",modelLabel:"Model:",quotaResetsIn:"Quota resets in ",method:"Method",provider:"Provider",version:"Version",endpoint:"Endpoint",url:"URL",timestamp:"Timestamp",na:"N/A",noHeaders:"No headers available",noRequestBody:"No request body",noResponseBody:"No response body",rateLimitedMsg:"Rate Limited. Switch to a different account or wait for quota reset. Model {{model}} has exhausted quota.",rateLimitedMsgNoModel:"Rate Limited. Switch to a different account or wait for quota reset.",authFailedMsg:"Authentication failed. Re-authenticate via CLIProxy Settings or check API key.",notFoundMsg:"Endpoint not found. This endpoint may not exist on this provider.",serverErrorMsg:"Server error from upstream. Retry later or check provider status page.",timeoutMsg:"Request timed out. Check network connection or increase timeout settings.",unknown:"unknown"},editAccountContext:{title:"Edit History Sync",description:'Configure how "{{name}}" shares history and continuity with other ccs auth accounts.',syncMode:"Sync Mode",selectContextMode:"Select context mode",isolatedOption:"Isolated",sharedOption:"Shared",sharedModeHint:"Reuses workspace context across accounts in the same history group.",isolatedModeHint:"Keeps this account fully separate from other ccs auth accounts.",historySyncGroup:"History Sync Group",groupPlaceholder:"default",groupHint:"Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, _ , - (max {{max}} chars).",invalidGroup:"Enter a valid group name that starts with a letter.",continuityDepth:"Continuity Depth",selectContinuityDepth:"Select continuity depth",standardOption:"Standard",deeperOption:"Deeper",deeperHint:"Syncs comprehensive session-env, file-history, shell-snapshots, and todos.",standardHint:"Standard mode syncs project workspace context only.",credentialsIsolated:"Credentials and .anthropic remain isolated per account in all modes.",implicationTitle:"What this means after save",isolatedImplication:"This account stays separate. Other accounts will not be able to resume its continuity state.",sameGroupRule:'Accounts must use the same group "{{group}}" before they can share continuity with each other.',noSameGroupPeer:"No other account currently shares this group.",sameGroupPeerCount_one:"{{count}} other account already shares this group.",sameGroupPeerCount_other:"{{count}} other accounts already share this group.",deeperReady_one:"{{count}} same-group account already uses deeper continuity. This is the strongest available handoff setup.",deeperReady_other:"{{count}} same-group accounts already use deeper continuity. This is the strongest available handoff setup.",deeperNeedsPeers:"Deeper continuity is enabled here, but another account in this group still needs deeper continuity for stronger cross-account resume expectations.",standardWarning:"Standard shared mode is good for project context only. Cross-account resume expectations are stronger when both accounts use deeper continuity.",resumeOriginalWarning:"If the old conversation matters, resume it from the original account before you change the setup.",cancel:"Cancel",save:"Save",saving:"Saving..."},historySyncLearningMap:{title:"How History Sync Works",description:"Isolated -> Shared -> Deeper. Cross-account resume needs the same group on both accounts.",learningMap:"Learning Map",isolated:"Isolated",shared:"Shared",deeper:"Deeper",cliproxyManaged_one:"{{count}} CLIProxy Claude pool account is managed in Action Center / CLIProxy page.",cliproxyManaged_other:"{{count}} CLIProxy Claude pool accounts are managed in Action Center / CLIProxy page.",showDetails:"Show details: groups, switching, and legacy policy",modeSwitch:"Mode Switch",modeSwitchDesc:"Use Sync on each account to move between isolated/shared and choose deeper continuity.",historySyncGroup:"History Sync Group",historySyncGroupDesc:"Same group is required before accounts can share continuity. Default fallback is default.",sameGroupRule:"Right now, accounts only share continuity when both are shared in the same group.",deeperRecommendation:'Group "{{group}}" is shared, but deeper continuity is still the safer choice if users expect cross-account resume.',partialGroup:'Group "{{group}}" is in good shape, but other accounts or groups still need the same-group or deeper setup.',readyGroup:'Group "{{group}}" already has deeper continuity on multiple accounts. This is the strongest available handoff setup.',legacyConfirmation_one:"{{count}} legacy account still needs explicit confirmation.",legacyConfirmation_other:"{{count}} legacy accounts still need explicit confirmation."},continuityReadiness:{title:"Cross-Account Resume Check",description:"Use this card to see what is missing before users switch accounts.",state:{single:"single account",isolated:"resume off","shared-alone":"shared but incomplete","shared-standard":"projects only",partial:"partially ready",ready:"stronger handoff ready"},metrics:{isolated:"Isolated",sharedPeers:"Shared With Peer",deeperReady:"Deeper Ready"},messages:{single:{title:"Only one auth account is configured.",description:"Cross-account handoff does not apply yet. Add another auth account before configuring shared continuity."},isolated:{title:"Cross-account resume is off right now.",description:"All visible accounts are isolated, so a session created in one account will stay with that account."},"shared-alone":{title:"Shared mode exists, but no group has a peer yet.",description_one:"{{count}} shared account is still waiting for another account in the same group.",description_other:"{{count}} shared accounts are still waiting for another account in the same group."},"shared-standard":{title:'Group "{{group}}" shares project context, but deeper continuity is not paired yet.',description:"Users may still expect more than project sharing. Enable deeper continuity on both accounts in this group for stronger handoff expectations."},partial:{title:"One group is ready, but the overall setup is still mixed.",description:"At least one group already uses deeper continuity, but other accounts are still isolated, alone in a shared group, or missing deeper continuity."},ready:{title:'Group "{{group}}" has the strongest available continuity setup.',description:"Multiple accounts in this group already use deeper continuity. Resume behavior still depends on what Claude stores upstream."}},stepsTitle:"What users should do next",steps:{syncBoth:"Open Sync on both accounts, not just the one you are switching into.",sameGroup:'Use the same History Sync Group on both accounts. "{{group}}" is the current recommended group.',enableDeeper:"If users expect cross-account resume instead of project-only sharing, turn on deeper continuity on both accounts.",resumeOriginal:"If the original conversation is important, resume it from the original account before changing continuity settings."},singleSteps:{addAccount:"Create a second ccs auth account before planning any cross-account handoff.",sameGroupLater:"When that second account exists, put both accounts in the same History Sync Group.",enableDeeperLater:"If users will expect cross-account resume instead of project-only sharing, enable deeper continuity on both accounts.",resumeOriginal:"If the original conversation is important, keep resuming it from the original account until the second account is ready."}},continuityOverview:{plainLaneTitle:"Plain ccs is using a different resume lane",plainLaneDescription:"Plain ccs currently resumes from {{lane}}, not this account lane. Recover the original lane first before changing sync settings.",setDefaultHint:"Use the Set Default action on the account you want plain ccs to follow in future sessions.",recommendBadge:"Recommend {{group}}",partialBadge:"Partial sync {{group}}",lane:{native:"native Claude (~/.claude)",accountDefault:"account {{name}}",accountInherited:"account {{name}} via continuity inheritance",profileDefault:"default profile {{name}} via native Claude lane"}},accountsTable:{name:"Name",type:"Type",defaultBadge:"default",created:"Created",lastUsed:"Last Used",historySync:"History Sync",sharedResources:"Resources",actions:"Actions",syncTitle:"Edit sync mode, group, and continuity depth",resourcesTitle:"Edit shared resource inheritance",confirmLegacyTitle:"Confirm this legacy account's current mode as explicit",sync:"Sync",confirm:"Confirm",active:"Active",setDefault:"Set Default",deleteAccount:"Delete account",cannotDeleteDefault:"Cannot delete default account",noAccounts:"No CCS auth accounts found. Use ccs auth create to add accounts.",resetToDefault:"Reset to CCS Default",deleteDialogTitle:"Delete Account",deleteDialogDesc:'Are you sure you want to delete the account "{{name}}"? This will remove the profile and all its session data. This action cannot be undone.',cancel:"Cancel",delete:"Delete",sharedGroupStandard:"shared ({{group}}, projects only)",sharedGroupDeeper:"shared ({{group}}, deeper continuity)",sharedGroupLegacy:"shared ({{group}}, projects only, legacy)",isolatedLegacy:"isolated (legacy default)",isolated:"isolated",resourcesShared:"shared",resourcesProfileLocal:"profile-local",noSameGroupPeer:"No same-group peer yet",sameGroupPeerCount_one:"{{count}} same-group peer",sameGroupPeerCount_other:"{{count}} same-group peers",legacyReview:"Review and confirm this inferred default.",noHandoff:"Cross-account resume stays in the original account.",badges:{shared:"Shared",deeper:"Deeper",legacy:"Legacy",isolated:"Isolated",profileLocal:"Local"}},addAccountDialog:{title:"Add {{displayName}} Account",descKiro:"Choose a Kiro auth method, then authenticate via browser or import from Kiro IDE.",descDeviceCode:"Click Authenticate. A verification code will appear for you to enter on the provider website.",descOauth:"Click Authenticate to get an OAuth URL. Open it in any browser to sign in.",powerUserEnabled:"Power user mode enabled",powerUserSkipped:"Settings > Proxy power user mode is skipping the AGY responsibility checklist and Gemini dashboard risk phrase. You accept full responsibility for OAuth/account risk.",powerUserLoadFailed:"Failed to load power user mode settings. Check Settings > Proxy and try again.",powerUserLoading:"Loading power user safety settings. Please wait a moment and retry.",powerUserUnavailableRetry:"Power user mode is unavailable. Complete the required provider safety step and retry.",authMethod:"Auth Method",selectKiroAuthMethod:"Select Kiro auth method",gitlabAuthMethod:"GitLab auth method",selectGitlabAuthMethod:"Select GitLab auth method",gitlabAuthOAuth:"Browser OAuth",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"Use Browser OAuth for gitlab.com, or PAT for self-hosted and admin-managed setups.",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"Optional. Leave blank for gitlab.com, or set your self-hosted GitLab base URL.",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"Token must include at least",gitlabPatRequired:"GitLab Personal Access Token is required for PAT login.",nicknameRequired:"Nickname (required)",nicknameOptional:"Nickname (optional)",nicknamePlaceholder:"e.g., work, personal",nicknameRequiredHint:"Required for this provider. Use a unique friendly name (e.g., work, personal).",nicknameOptionalHint:"A friendly name to identify this account. Leave blank to use a safe generated identifier.",waitingForAuth:"Waiting for authentication...",deviceCodeHint:"A verification code dialog will appear shortly. Enter the code on the provider website.",browserHint:"Complete the authentication in your browser. This dialog closes automatically.",openUrlLabel:"Open this URL in any browser to sign in:",copied:"Copied",copy:"Copy",open:"Open",popupBlocked:"Popup blocked. Copy the URL above and open it manually in your browser.",redirectPasteLabel:"Redirect didn't work? Paste the callback URL:",callbackPlaceholder:"Paste the redirect URL here...",submitCallback:"Submit Callback",submitting:"Submitting...",preparingUrl:"Preparing sign-in URL...",cancel:"Cancel",importingToken:"Importing token from Kiro IDE...",authenticate:"Authenticate",importFromIde:"Import from IDE",importing:"Importing..."},flowViz:{backToProviders:"Back to providers",showDetails:"Show Details",hideDetails:"Hide Details",showPausedAccounts:"Show Paused ({{count}})",hidePausedAccounts:"Hide Paused ({{count}})",visibleTotalRequests:"Visible Requests",visibleAccounts:"Visible Accounts",excludingPausedAccounts:"Excluding {{count}} paused",resetLayout:"Reset layout",provider:"Provider",totalRequests:"Total Requests",accounts:"Accounts",connectionTimeline:"Connection Timeline",noRecentConnections:"No recent connections"},quickStats:{totalRequests:"Total Requests",successRate:"Success Rate",totalTokens:"Total Tokens",activeModels:"Active Models"},authMonitor:{accounts:"Accounts",accountsCount:"{{count}} accounts",success:"Success",failed:"Failed",successRate:"Success Rate"},accountCard:{resumeAccount:"Resume account",pauseAccount:"Pause account",quotaLoading:"Quota...",quota:"Quota",quotaUnavailable:"Quota limits unavailable",reauthNeeded:"Reauth needed",failureLabelReauth:"Reauth",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"No Access",failureLabelRetry:"Retry",failureLabelReconnect:"Reconnect",failureLabelTemporary:"Temporary",failureLabelUnavailable:"Unavailable",failureHintReauth:"Refresh this account by running its auth flow again.",failureHintWorkspace:"Move this account back to an active workspace, then remove and re-add it.",failureHintNoAccess:"This account cannot access the provider quota endpoint.",failureHintRetry:"Wait a bit, then retry the quota request.",failureHintReconnect:"Remove the stale account and authenticate it again.",failureHintTemporary:"Retry later. This looks temporary.",removeAndReadd:"Remove and re-add account",autoRefreshFailed:"Auto-refresh failed"},antigravityChecklist:{title:"Antigravity OAuth Responsibility",subtitle:"Complete all 4 steps before you can authenticate.",mandatory:"Mandatory",completion:"Completion",stepsCount:"{{current}}/4 steps"},accountSafetyWarning:{title:"OAuth Account Safety Warning",subtitle:"Issue #509 · Gemini + AGY OAuth risk",firstLine:"Issue #509 documents suspension/ban reports tied to ccs agy and shared-account usage between ccs gemini and ccs agy.",secondLine:"Continue only if you accept full responsibility for OAuth and account-access risk.",issueLabel:"Read issue #509",proxySettingsLabel:"Gemini + AGY controls: Settings > Proxy"},cliproxyDialog:{name:"Name",provider:"Provider",account:"Account",accountOptional:"Account (optional)",model:"Model",modelOptional:"Model (optional)",defaultTarget:"Default Target",defaultTier:"Default Tier",tierConfig:"Tier Configuration",selectProvider:"Select provider...",useDefaultAccount:"Use default account",defaultSuffix:"(default)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Cancel",create:"Create",creating:"Creating...",saveChanges:"Save Changes",saving:"Saving...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Edit Composite Variant: {{name}}",editSingleTitle:"Edit Single Variant: {{name}}"},profileEditor:{profileInfo:"Profile Information",profileName:"Profile Name",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",runWithProfile:"Run with profile",runOnDroid:"Run on Droid",runOnDroidWithFlag:"Run on Droid (--target)",droidAliasExplicit:"Droid alias (explicit)",overrideToClaude:"Override to Claude",overrideToClaudeExplicit:"Override to Claude (explicit)",targetHintPreferredAlias:"Preferred explicit alias:",targetHintClaudeDefault:"Default command:",targetHintLegacyAlias:"Legacy shortcut still works:",targetHintOverride:"You can still override each run with",setAsDefault:"Set as default",provider:"Provider",custom:"Custom",providerChooserHint:"Start with a preset, then adjust the URL, API key, or model mapping as needed.",featuredProviders:"Featured Providers",scrollHint:"Scroll if your screen is narrow",customEndpoint:"Custom Endpoint",morePresets:"More Presets",customEndpointDescription:"Start from a blank Anthropic-compatible URL and configure everything manually."},settings:{sectionLoadFailed:"Failed to load section",unknownError:"Unknown error occurred",reloadPage:"Reload page",refresh:"Refresh",copy:"Copy",copied:"Copied",saved:"Saved",loading:"Loading...",configFileNotFound:"Config file not found"},settingsTabs:{browser:"Browser",web:"Web",image:"Image",channels:"Channels",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup"},settingsAuth:{failedFetchTokens:"Failed to fetch auth tokens",failedSaveTokens:"Failed to save tokens",tokensUpdated:"Tokens updated. Restart CLIProxy to apply.",failedRegenerate:"Failed to regenerate secret",secretRegenerated:"New management secret generated. Restart CLIProxy to apply.",failedReset:"Failed to reset tokens",tokensReset:"Tokens reset to defaults. Restart CLIProxy to apply.",description:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart.",apiKey:"API Key",custom:"Custom",apiKeyDesc:"Used by Claude Code to authenticate with CLIProxy",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"Used by CCS dashboard to access CLIProxy management APIs",managementSecretPlaceholder:"Management secret",generateSecret:"Generate new secure secret",resetDefaults:"Reset to Defaults",resetDesc:"Resets both API key and management secret to their default values.",saving:"Saving...",save:"Save"},settingsGlobalEnv:{description:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)",enabled:"Global Env enabled",disabled:"Global Env disabled",enabledDesc:"Env vars will be injected into third-party profiles",disabledDesc:"Env vars will not be injected",envVars:"Environment Variables",noneConfigured:"No environment variables configured",addNew:"Add New Variable",keyName:"KEY_NAME",value:"value",add:"Add",quickAdd:"Quick Add Common Variables",allConfigured:"All common variables are configured"},settingsBackups:{failedFetch:"Failed to fetch backups",failedRestore:"Failed to restore backup",restoreSuccess:"Backup restored successfully",title:"Settings Backups",description:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified.",none:"No backups available",noneHint:"Backups will appear here when you modify settings",latest:"Latest",restoring:"Restoring...",restore:"Restore",restoreConfirmTitle:"Restore Backup?",restoreConfirmPrefix:"This will replace your current settings with backup from",restoreConfirmSuffix:"This action cannot be undone.",cancel:"Cancel"},settingsWebsearch:{description:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)",enabled:"WebSearch enabled",disabled:"WebSearch disabled",checking:"Checking status...",providers:"Providers",noneConfigured:"No providers configured",noneConfiguredHint:"Install CLI tools to enable web search providers",checkProviders:"Check for providers",installed:"installed",notInstalled:"not installed",model:"Model:",howInstall:"How to install {{name}} CLI",installGlobally:"Install globally",requiresKey:"(requires xAI API key)",freeTier:"(FREE tier available)",viewDocs:"View documentation"},settingsProxy:{failedLoadAgyMode:"Failed to load power user mode",failedUpdateAgyMode:"Failed to update power user mode",failedVerifyAgyMode:"Failed to verify power user mode persistence",notPersistedAgyMode:"Power user mode was not persisted. Config may have been modified by another process.",agyModeEnabled:"Power user mode enabled.",agyModeDisabled:"Power user mode disabled.",typePhraseToContinue:'Type "{{value}}" to continue.',description:"Configure local or remote {{backend}} connection for proxy-based profiles",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Instance Status",connectionMode:"Connection Mode",local:"Local",remote:"Remote",localDesc:"Run {{backend}} binary on this machine",remoteDesc:"Connect to a remote {{backend}} server",backendBinary:"Backend Binary",stopProxyToSwitch:"Stop the running proxy in Instance Status to switch backend.",default:"Default",plusDesc:"Optional track for extra providers. Still supported, but currently community-maintained instead of upstream-maintained.",originalDesc:"Default, always-available backend for the core provider track.",plusFallbackNotice:"The Plus provider track is not deprecated, but local CLIProxy still falls back to the original backend while the maintained fork path is being brought back.",variantsIncompatible:"Existing plus-extra variants ({{providers}}) will not run on the original backend. Keep them visible for reference, but switch to Plus before using them.",safety:"Safety",agyModeTitle:"Antigravity + Gemini Power User Mode",agyModeDesc:"Skip the AGY responsibility checklist and the Gemini dashboard typed acknowledgement.",agyWarning:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss.",finalConfirm:"Final confirmation required",finalConfirmDesc:"Enabling this will skip AGY safety checkpoints and the Gemini dashboard risk phrase gate. Review issue #509 and type the exact phrase to proceed.",step1:"Step 1",readIssue:"Read issue #509",step2:"Step 2",typePrefix:"Type",typeSuffix:"to enable.",typePhraseAria:"Type I ACCEPT RISK to enable Antigravity + Gemini power user mode",exactPhrase:"Exact phrase required.",enableAgyMode:"Enable Antigravity + Gemini Power User Mode",toggleAgyMode:"Toggle Antigravity + Gemini power user mode",fallbackSettings:"Fallback Settings",enableFallback:"Enable fallback to local",enableFallbackDesc:"Use local proxy if remote is unreachable",autoStartLocal:"Auto-start local proxy",autoStartLocalDesc:"Automatically start local proxy on fallback",advanced:"Advanced",debugMode:"Debug Mode",debugModeDesc:"Enable developer diagnostics in browser console",debugModeEnabled:"Debug mode enabled. Check browser console for detailed logs.",localProxy:"Local Proxy",port:"Port",autoStart:"Auto-start",localAutoStartDesc:"Start local proxy automatically when needed",remoteConfigTitle:"Remote Server Configuration",host:"Host",hostPlaceholder:"192.168.1.100 or proxy.example.com",defaultPort:"default: {{value}}",portPlaceholder:"Leave empty for {{value}}",protocol:"Protocol",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"For /v1/* API endpoints",apiKeyDesc:"Used for API requests to /v1/chat/completions",managementKeyOptional:"Management Key (optional)",managementKeyPlaceholder:"For /v0/management/* endpoints",managementKeyDesc:"Used for dashboard management APIs. Falls back to API Key if not set.",testing:"Testing...",testConnection:"Test Connection",connectedLatency:"Connected ({{value}}ms)",connectionFailed:"Connection failed",invalidPortOrEmpty:"Port must be an integer between 1 and 65535, or empty for default",invalidLocalPort:"Local port must be an integer between 1 and 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Configure extended thinking/reasoning for supported models.",supportedProviders:"Supported Providers",modeTitle:"Thinking Mode",modeAutoDesc:"Automatically set thinking based on model tier",modeOffDesc:"Disable extended thinking",modeManualDesc:"Set a persistent override level or use CLI flags per run",tierDefaults:"Tier Defaults",tierDefaultsDesc:"Default thinking level for each model tier when in auto mode.",persistentOverride:"Persistent Override",persistentOverrideDesc:"Applied to all sessions. CLI flags still take priority.",enterCustomBudget:"Enter custom budget",apply:"Apply",providerOverrides:"Provider Overrides ({{count}})",providerOverridesDesc:"Override tier defaults for specific providers. Add custom provider keys as needed.",addProviderPlaceholder:"Add provider key (e.g. qwen)",showWarnings:"Show Warnings",showWarningsDesc:"Display warnings when thinking values are clamped or adjusted",cliEnvOverride:"CLI & Env Override",supportLine1Prefix:"Thinking budget:",supportLine1Suffix:"(token-based)",supportLine2Prefix:"Reasoning effort:",supportLine2SuffixPrefix:"(suffix or ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex suffixes pin effort (for example ",supportLine3Suffix:"); unsuffixed models use Thinking mode."},analytics:{title:"Analytics",noDailyUsage:"No usage data for today",noUsageData:"No usage data available",subtitle:"Track usage and insights",month:"Month",allTime:"All Time",updated:"Updated {{value}}"},analyticsSummary:{totalTokens:"Total Tokens",totalTokensSubtitle:"{{input}} in / {{output}} out",totalCost:"Total Cost",totalCostSubtitle:"${{value}}/day avg",cacheTokens:"Cache Tokens",cacheTokensSubtitle:"${{cost}} ({{percent}}% of cost)",inputCost:"Input Cost",outputCost:"Output Cost",tokensSubtitle:"{{value}} tokens"},apiProfiles:{title:"Profiles",sidebarTitle:"API Profiles",sidebarSubtitle:"Premium APIs, local runtimes, custom endpoints",new:"New",searchPlaceholder:"Search profiles...",loadingProfiles:"Loading profiles...",failedLoadTitle:"Failed to load profiles",failedLoadDesc:"Unable to fetch API profiles. Please try again.",retry:"Retry",noProfilesYet:"No API profiles yet",noProfilesDesc:"Create your first profile to connect to custom API endpoints",createProfile:"Create Profile",noProfileMatch:'No profiles match "{{query}}"',profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",configuredCount:"{{count}} configured",deleteProfileTitle:"Delete Profile",deleteProfileDesc:'Are you sure you want to delete "{{name}}"? This will remove the settings file and cannot be undone.',delete:"Delete",unsavedChangesTitle:"Unsaved Changes",unsavedChangesDesc:'You have unsaved changes in "{{current}}". Discard and switch to "{{next}}"?',discardSwitch:"Discard and Switch",noOrphansFound:"No orphan profile settings found",confirmRegisterOrphans:"Found {{total}} orphan profile setting file(s), with {{valid}} ready to register. Register them now?",registeredWithSkipped:" ({{count}} skipped)",registeredProfiles:"Registered {{count}} profile(s)",copyPrompt:'Copy "{{name}}" to which new profile name?',destinationEmpty:"Destination profile name cannot be empty",exportRedacted:"Export created with redacted token. Use include-secrets flow in CLI if needed.",exportDownloaded:"Profile export downloaded",importFailed:"Failed to import profile bundle",discoverOrphans:"Discover orphan profiles",importProfileBundle:"Import profile bundle"},accountsPage:{title:"Accounts",managePrefix:"Manage",manageSuffix:"accounts and pool onboarding from one panel.",mobileManageSuffix:"continuity per account.",primaryActions:"Primary Actions",createAccount:"Create Account",authClaudeInPool:"Authenticate Claude in Pool",openClaudePoolSettings:"Open Claude Pool Settings",openCliProxyClaudePool:"Open CLIProxy Claude Pool",migrationFollowup:"Migration Follow-up",legacyContextPending:"{{count}} account still needs first-time mode confirmation.",legacyContextPending_other:"{{count}} accounts still need first-time mode confirmation.",legacyContinuityPending:"{{count}} shared account remains on standard legacy continuity depth.",legacyContinuityPending_other:"{{count}} shared accounts remain on standard legacy continuity depth.",confirmingLegacy:"Confirming Legacy Policies...",confirmLegacy:"Confirm Legacy Policies ({{count}})",noLegacyFollowup:"No legacy follow-up pending.",continuityGuide:"Continuity Guide",expandWhenNeeded:"Expand only when needed.",sharedStandard:"Shared Standard",sharedStandardDesc:"Shared workspace only. Put both accounts in the same group before expecting any handoff.",sharedDeeper:"Shared Deeper",sharedDeeperPrefix:"Adds",sharedDeeperDesc:"Adds session-env, file-history, shell-snapshots, and todos. Recommended when users expect cross-account resume.",isolated:"Isolated",isolatedDesc:"No link. Conversations stay with the original account.",quickCommands:"Quick Commands",quickCommandsDesc:"Copy and run in terminal.",workspaceBadge:"ccs auth Workspace",historySyncBadge:"History & Resume Controls",resourcesBadge:"Shared Resources Controls",resourcesShared:"Shared",resourcesProfileLocal:"Profile Local",authAccounts:"Auth Accounts",tableScopePrefix:"This table is intentionally scoped to",tableScopeMiddle:"accounts. Use",tableScopeSuffix:"for mode/group/depth changes.",accountMatrix:"Account Matrix",sharedTotalDesc:"Shared total: {{count}}. Actions include Sync settings and legacy confirmation.",loadingAccounts:"Loading accounts..."},health:{justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",systemHealth:"System Health",build:"build {{version}}",lastScan:"Last scan:",autoRefresh:"Auto-refresh:",refresh:"Refresh",checks:"Checks",version:"Version",platform:"Platform",liveMonitoring:"Live monitoring active",copied:"Copied to clipboard",refreshing:"Refreshing health checks...",fix:"Fix",applyFix:"Apply Fix",healthLabel:"health"},updates:{actionRequired:"Action Required",done:"Done",all:"All",inboxTitle:"Updates Center",inboxSubtitle:"Focus on actions, then mark updates done or dismissed.",needsAction:"Needs Action",doneCount:"Done",searchPlaceholder:"Search actions or commands",noNotices:"No notices match this view.",noUpdates:"No updates available.",published:"Published {{date}}",markDone:"Mark done",dismiss:"Dismiss",reopen:"Reopen",doNext:"Do Next",impactedIntegrations:"Impacted Integrations",impactedDesc:"Related areas based on update scope and routing.",whyMatters:"Why It Matters",whyMattersDesc:"Short context only, no wall-of-text release notes.",open:"Open",progressNeedsAction:"Needs Action",progressInReview:"In Review",progressDone:"Done",progressDismissed:"Dismissed",statusNew:"New",statusStable:"Stable",statusPlanned:"Planned",dashboard:"Dashboard",cliUsage:"CLI Usage"},cliproxyPage:{connected:"Connected",notConnected:"Not connected",variant:"variant",parentNotConnected:"Parent not connected",viaProvider:"via {{provider}}",emptyTitle:"CCS Profile Manager",emptyDesc:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends.",emptyControlPanelPrefix:"For live usage stats and real-time monitoring, visit the",controlPanel:"Control Panel",quickSetup:"Quick Setup",addAccount:"Add Account",advancedVariant:"Advanced Variant",setupActionsHint:"Add accounts here. Create variants only when you need a separate runtime/profile.",accountManagement:"CCS-level account management",providers:"Providers",variants:"Variants",providerCount:"{{count}} provider",providerCount_other:"{{count}} providers",connectedCount:"{{count}} connected",variantDisplay:"{{name}} ({{provider}} variant)"},copilotPage:{title:"Copilot",subtitle:"Deprecated GitHub Copilot compatibility bridge",deprecatedBadge:"Deprecated",deprecationTitle:"Deprecated compatibility bridge",deprecationItem1:"GitHub usage-based Copilot billing begins June 1, 2026",deprecationItem2:"Existing local setups remain available for compatibility",deprecationItem3:"Prefer Codex or another active provider for new work",setup:"Setup",auth:"Auth",daemon:"Daemon",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered API - may break anytime",unofficialItem2:"Excessive use may trigger account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",yes:"Yes",no:"No",installed:"Installed",missing:"Missing",integration:"Integration",enabled:"Enabled",disabled:"Disabled",github:"GitHub",connected:"Connected",notConnected:"Not Connected",authenticate:"Authenticate",authenticating:"Authenticating...",status:"Status",running:"Running",stopped:"Stopped",port:"Port",stopping:"Stopping...",stop:"Stop",starting:"Starting...",start:"Start",installing:"Installing...",installCopilotApi:"Install copilot-api",proxy:"Proxy",active:"Active",inactive:"Inactive"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"Deprecated",subtitle:"Deprecated local bridge for legacy Cursor setups",unofficialTitle:"Deprecated legacy bridge - prefer CLIProxy-backed Cursor",unofficialItem1:"Supported path: CLIProxy-backed Cursor auth and account management",unofficialItem2:"This reverse-engineered local bridge remains only for existing setups",unofficialItem3:"CCS provides no warranty for this legacy path",supportedPathTitle:"Supported path",supportedPathDesc:"Use CLIProxy-backed Cursor auth and account management for new setups. Keep the legacy bridge below only if you still rely on the old local daemon flow.",startCliproxyAuth:"Start CLIProxy Cursor Auth",openCliproxyCursor:"Open CLIProxy Cursor",integration:"Integration",authentication:"Authentication",daemon:"Daemon",enabled:"Enabled",disabled:"Disabled",expired:"Expired",connected:"Connected",notConnected:"Not connected",running:"Running",stopped:"Stopped",actions:"Legacy Actions",disableIntegration:"Disable Integration",enableIntegration:"Enable Integration",autoDetectAuth:"Legacy IDE Auto-detect",manualAuthImport:"Legacy Manual Import",stopDaemon:"Stop Daemon",startDaemon:"Start Daemon",port:"Port",configuration:"Cursor Configuration",lastModified:"Last modified:",neverSaved:"Never saved",saving:"Saving...",save:"Save",modelConfig:"Model Config",settings:"Settings",info:"Info",presets:"Presets",presetsDesc:"Apply pre-configured model mappings",modelMapping:"Model Mapping",modelMappingDesc:"Configure which models to use for each tier",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested.",opusModel:"Opus (Most capable)",opusModelDesc:"Complex reasoning and highest quality responses.",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"General coding and day-to-day chat workloads.",haikuModel:"Haiku (Fast)",haikuModelDesc:"Low-latency and lightweight request paths.",runtimeSettings:"Runtime Settings",autoStartDaemon:"Auto-start Daemon",autoStartDesc:"Start Cursor daemon automatically when integration is used.",ghostMode:"Ghost Mode",ghostModeDesc:"Request x-ghost-mode to reduce telemetry.",provider:"Provider",filePath:"File Path",availableModels:"Available Models",loadingModels:"Loading models...",noModels:"No model metadata available yet. Start daemon and refresh.",default:"Default",rawConfiguration:"Raw Configuration (JSON)",manualImportTitle:"Manual Cursor Auth Import",manualImportDesc:"Provide Cursor access token and machine ID if auto-detect is unavailable.",accessToken:"Access Token",accessTokenPlaceholder:"Paste Cursor access token",machineId:"Machine ID",machineIdPlaceholder:"32-char hex (UUID without hyphens)",cancel:"Cancel",import:"Import",selectModel:"Select model",useDefaultModel:"Use Default Model",availableModelCount:"Available Models ({{count}})",invalidPort:"Port must be an integer between 1 and 65535",defaultModelRequired:"Default model is required",savedConfig:"Cursor config and model mapping saved",failedSaveConfig:"Failed to save config",modelsLoadingWait:"Models are still loading. Please wait before applying a preset.",noModelsAvailable:"No models available yet. Start the daemon and refresh first.",appliedCodexPreset:"Applied GPT-5.3 Codex preset",appliedClaudePreset:"Applied Claude 4.6 preset",appliedGeminiPreset:"Applied Gemini 3 preset",integrationEnabled:"Cursor integration enabled",integrationDisabled:"Cursor integration disabled",failedUpdateIntegration:"Failed to update integration state",credentialsImported:"Cursor credentials imported",autoDetectFailed:"Auto-detect failed",manualRequired:"Token and machine ID are required",manualImportFailed:"Manual import failed",failedStartDaemon:"Failed to start daemon",daemonStarted:"Daemon started",daemonStartedWithPid:"Daemon started (PID: {{pid}})",failedStopDaemon:"Failed to stop daemon",daemonStopped:"Daemon stopped",rawLoading:"Raw settings are still loading. Please wait and try again.",invalidJson:"Invalid JSON",rawSaved:"Raw settings saved",rawChanged:"Raw settings changed externally. Refresh and retry.",failedSaveRaw:"Failed to save raw settings",savedAll:"Cursor configuration saved",liveProbe:"Live Probe",runLiveProbe:"Run Live Probe",rerunLiveProbe:"Re-run Live Probe",probing:"Running probe...",probeNotRun:"Probe not run yet",probeLocalReadinessHint:"Local readiness checks can pass while live runtime access still fails. Use the live probe to verify the full Cursor path.",probeStage:"Stage",probeHttpStatus:"HTTP Status",probeDuration:"Duration",probeModel:"Model",probeMessage:"Message",probeSucceeded:"Probe succeeded",probeFailed:"Probe failed",probeSaveFirst:"Save or discard Cursor changes before running the live probe",refreshStatus:"Refresh Cursor status",refreshConfiguration:"Refresh Cursor configuration"},droidPage:{loadingDiagnostics:"Loading Droid diagnostics...",failedDiagnostics:"Failed to load Droid diagnostics.",overview:"Overview",byok:"BYOK",docs:"Docs",runtimeInstall:"Runtime and Installation",status:"Status",detected:"Detected",notFound:"Not Found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",version:"Version",overridePath:"Override (CCS_DROID_PATH)",configFiles:"Config Files",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",parseWarning:"Parse warning: {{value}}",readWarning:"Read warning: {{value}}",warnings:"Warnings",byokSummary:"BYOK Summary",activeModelSelector:"Active model selector",customModels:"Custom models",ccsManaged:"CCS-managed",userManaged:"User-managed",malformedEntries:"Malformed entries",providers:"Providers",none:"none",customModelsTitle:"Custom Models",modelName:"Name / Model",provider:"Provider",baseUrl:"Base URL",noCustomModels:"No custom models",docsAlignedNotes:"Docs-Aligned Notes",factoryDocs:"Factory Docs",providerFactCheckDocs:"Provider Fact-Check Docs",providerValues:"Provider values: {{value}}",settingsHierarchy:"Settings hierarchy: {{value}}",settingsTitle:"Droid BYOK Settings",fixJsonBeforeQuickSettings:"Fix JSON syntax before using quick settings controls.",fixJsonBeforeReasoning:"Fix JSON syntax before updating BYOK reasoning settings.",unableUpdateReasoning:"Unable to update selected BYOK model reasoning setting.",fixJsonBeforeBudget:"Fix JSON syntax before updating thinking budget.",anthropicOnlyBudget:"Thinking budget is only available for Anthropic BYOK models.",invalidJson:"Invalid JSON: {{value}}",saved:"Droid settings saved",changedExternally:"Droid settings changed externally. Refresh and retry.",failedSave:"Failed to save Droid settings"},sharedPage:{commands:"Commands",skills:"Skills",agents:"Agents",plugins:"Plugins",settings:"Settings",title:"Shared Resources",subtitle:"Commands, skills, agents, plugins, and configuration shared across accounts",totalShared:"Total Resources",visible:"Visible",markdownDetail:"Markdown detail view",registryDetail:"Registry detail view",maskedSettingsDetail:"Masked settings view",filterPrefix:"Filter:",configurationRequired:"Configuration Required",countsUnavailable:"Counts unavailable",retryCounts:"Retry counts",filterPlaceholder:"Filter {{tab}} by name, description, or path",showing:"Showing {{visible}} of {{total}} {{tab}}",showingQuery:' for "{{query}}"',refreshing:" (refreshing...)",loadingShared:"Loading shared {{tab}}...",failedLoadShared:"Failed to load shared {{tab}}",retry:"Retry",noSharedFound:"No shared {{tab}} found. Run `ccs sync` or add items in your shared directory.",noPluginsFound:"No shared plugins are installed. Plugin registry files and cache folders are hidden until an actual plugin is present.",noMatch:'No {{tab}} match "{{query}}".',selectOne:"Select a {{tab}} to view full content.",pathLabel:"Path",resolvedSource:"Resolved Source",loadingMarkdown:"Loading markdown content...",loadingSettings:"Loading settings content...",failedLoadContent:"Failed to load content",retryContent:"Retry content",noMarkdown:"No markdown content available.",settingsTitle:"settings.json",settingsDescription:"This file contains shared settings that are linked across all shared-mode accounts.",settingsPath:"Shared Settings Path",settingsActive:"Active",settingsInactive:"Not Found",resourcePolicies:"Resource policies",resourcePoliciesDescription:"Accounts marked shared inherit this hub. Profile-local accounts keep separate commands, skills, agents, plugins, and settings.",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} more"},editAccountSharedResources:{title:"Edit Shared Resources",description:'Configure how "{{name}}" inherits commands, skills, and settings from the CCS shared directory.',resourceMode:"Resource Mode",selectResourceMode:"Select resource mode",sharedOption:"Shared",sharedHint:"Inherits commands, skills, and agents from the shared directory.",profileLocalOption:"Profile Local",profileLocalHint:"Uses isolated resources in the account's private directory.",implicationTitle:"What this means",sharedImplication:"This account will see all tools and configuration in the shared resource hub.",profileLocalImplication:"This account will not see shared tools. It stays fully isolated for security or testing.",cancel:"Cancel",save:"Save",saving:"Saving..."},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},hubFooter:{logs:"Logs",settings:"Settings",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"Toggle theme"},ccsLogo:{alt:"CCS Logo",text:"CCS Config"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"Reveal sensitive values",maskSensitive:"Mask sensitive values",valid:"Valid {{language}}",readOnly:"(Read-only)"},commandBuilder:{title:"Command Builder",searchPlaceholder:"Type or select a command...",copy:"Copy",run:"Run",cmdConfig:"Open configuration interface",cmdCreateProfile:"Create a new profile",cmdSwitchProfile:"Switch to a profile",cmdDoctor:"Check system health",cmdListProviders:"List available CLIProxy providers",cmdAddProvider:"Add CLIProxy provider"},confirmDialog:{confirm:"Confirm",cancel:"Cancel"},connectionIndicator:{connected:"Connected",connecting:"Connecting...",disconnected:"Disconnected",reconnecting:"Reconnecting..."},docsLink:{title:"View documentation"},githubLink:{title:"Report an issue on GitHub"},globalEnvIndicator:{injectedCount_one:"{{count}} global env var will be injected at runtime",injectedCount_other:"{{count}} global env vars will be injected at runtime",overriddenCount:"({{count}} overridden by profile)",skippedLabel:"Skipped (profile already defines):",configureInSettings:"Configure in Settings"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"Remote dashboard access is read-only because dashboard auth is currently disabled for this CCS instance. Re-enable it on the CCS host. Docker deployments must do that inside the running container.",remoteReadonlyAuthDisabledShort:"Remote dashboard is read-only until dashboard auth is re-enabled for this CCS instance.",remoteReadonlySetupLong:"Remote dashboard access is read-only until you run ccs config auth setup for this CCS instance. Docker deployments must run it inside the container.",remoteReadonlySetupShort:"Remote dashboard is read-only until auth is configured for this CCS instance.",localLong:"This dashboard runs locally. All data stays on your machine.",localShort:"Local dashboard - data stays on your device.",dismiss:"Dismiss disclaimer"},privacyToggle:{modeOn:"Privacy mode ON - Click to show data",modeOff:"Privacy mode OFF - Click to hide data"},projectSelectionDialog:{title:"Select Google Cloud Project",description:"Choose which project to use for {{provider}} authentication.",autoSelectCountdown:"(Auto-selecting default in {{count}}s)",default:"Default",allProjects:"All Projects",allProjectsDescription:"Onboard all {{count}} listed projects",useDefault:"Use Default",selecting:"Selecting...",confirmSelection:"Confirm Selection",codeCopied:"Code copied",copyVerificationCode:"Copy verification code"},quickCommands:{title:"Quick Commands",startDefault:"Start Default",startDefaultDesc:"Launch Claude with default profile",glmProfile:"GLM Profile",glmProfileDesc:"Switch to GLM model",healthCheck:"Health Check",healthCheckDesc:"Run system diagnostics",delegateTask:"Delegate Task",delegateTaskDesc:"Delegate to GLM profile"},quotaTooltip:{loadingQuota:"Loading quota...",failedLoadQuota:"Failed to load quota",modelQuotas:"Model Quotas:",rateLimits:"Rate Limits:",plan:"Plan: {{plan}}",quotaSnapshots:"Quota Snapshots:",unlimited:"Unlimited",remaining:"{{remaining}}/{{entitlement}} remaining",tier:"Tier",tierId:"Tier ID",state:"State",credits:"Credits",modelQuotasLower:"Model quotas:",allBucketsReport:"All buckets report {{tokenType}}",requestsRemaining:"{{count}} requests remaining",inputTokensRemaining:"{{count}} input tokens remaining",outputTokensRemaining:"{{count}} output tokens remaining",amountRemaining:"{{count}} remaining",fiveHourLimit:"5h usage limit",weeklyLimit:"Weekly usage limit",weeklyOpus:"Weekly usage (Opus)",weeklySonnet:"Weekly usage (Sonnet)",weeklyOAuthApps:"Weekly usage (OAuth apps)",weeklyCowork:"Weekly usage (Cowork)",extraUsage:"Extra usage",premiumInteractions:"Premium Interactions",chat:"Chat",completions:"Completions",resets:"Resets {{time}}",fiveHourResets:"5h resets {{time}}",weeklyResets:"Weekly resets {{time}}"},utils:{codeReview5h:"Code review (5h)",codeReviewWeekly:"Code review (weekly)",codeReview:"Code review",codexAdditional5h:"{{name}} (5h)",codexAdditionalWeekly:"{{name}} (weekly)",codexAdditional:"{{name}}"},sponsorButton:{title:"Sponsor this project on GitHub",sponsor:"Sponsor"},valueMetrics:{apiCostSaved:"API Cost Saved",tokensSaved:"Tokens Saved",queriesFaster:"Queries Faster",errorsReduced:"Errors Reduced",vsLastMonth:"vs last month",throughCaching:"through caching",averageSpeedup:"average speedup",withRetryLogic:"with retry logic",performanceMetrics:"Performance Metrics",monthlySummary:"Monthly Summary",totalSaved:"Total Saved",tokensProcessed:"Tokens Processed",queriesHandled:"Queries Handled",uptime:"Uptime"},updatesSpotlight:{openUpdatesCenter:"Open Updates Center"},deviceCodeDialog:{authorize:"Authorize {{provider}}",enterCodeAtPage:"Enter the code below at the authorization page.",expiresIn:"(Expires in {{time}})",codeExpired:"(Code expired)",copied:"Copied!",copyCode:"Copy Code",waitingForAuth:"Waiting for authorization...",openVerificationPage:"Open verification page",openProviderPage:"Open {{provider}}",copyCodeAria:"Copy verification code",codeCopiedAria:"Code copied"},settingsDialog:{editProfile:"Edit Profile: {{name}}",description:"Configure environment variables and settings for this profile.",loadingSettings:"Loading settings...",envTab:"Environment",rawJsonTab:"Raw JSON",generalTab:"General",noEnvVars:"No environment variables configured.",noEnvVarsHint:"Add variables in your settings.json file.",loadingEditor:"Loading editor...",profileInfo:"Profile Information",profileInfoDesc:"Details about this configuration file.",path:"Path",lastModified:"Last Modified",cancel:"Cancel",saving:"Saving...",saveChanges:"Save Changes",conflictTitle:"File Modified Externally",conflictDesc:"This settings file was modified by another process. Overwrite with your changes or discard?",overwrite:"Overwrite",invalidJson:"Invalid JSON",failedSave:"Failed to save"},setupWizard:{title:"Advanced Variant Setup",stepProviderDesc:"Select a provider for the runtime variant",stepAuthDesc:"Authenticate with your provider",stepAccountDesc:"Select which account to use",stepVariantDesc:"Optional: create a custom runtime variant",stepSuccessDesc:"Setup complete!",authStep:{authenticateWith:"Authenticate with {{provider}} to add an account",authenticating:"Authenticating...",authenticateInBrowser:"Authenticate in Browser",completeOAuth:"Complete the OAuth flow in your browser...",orUseTerminal:"Or use terminal",runCommandHint:"Run this command in your terminal:",back:"Back",checking:"Checking...",refreshStatus:"Refresh Status"},accountStep:{selectAccount:"Select an account ({{count}})",defaultAccount:"Default account",or:"Or",addNewAccount:"Add new account",addNewAccountDesc:"Authenticate with a different account",back:"Back"},variantStep:{back:"Back",skip:"Skip"},successStep:{title:"Variant Created!",subtitle:"Your custom variant is ready to use",usage:"Usage:",done:"Done"}},accountSurfaceCard:{business:"Biz",free:"Free",personal:"Pers",variant:"Variant"},accountIdentity:{business:"Business",personal:"Personal",free:"Free",team:"Team",plus:"Plus",pro:"Pro",workspace:"Workspace {{id}}"},accountCardStats:{notUsedYet:"Not used yet"},accountQuotaPanel:{weekly:"Weekly",loadingQuota:"Loading quota..."},userMenu:{signedInAs:"Signed in as {{username}}"},authMonitorLive:{live:"LIVE",accountMonitor:"Account Monitor",updated:"Updated {{time}}",updatedNow:"Updated now",requestsLabel:"req",stats:"Stats",successRate:"Success Rate",missingProjectId:"Missing Project ID",noActivity:"no activity"},providerCard:{missingProjectIdAria:"Missing Project ID"},loginPage:{showPassword:"Show password",hidePassword:"Hide password"},cliproxyStatsOverview:{sessionStatistics:"Session Statistics",realTimeMetrics:"Real-time usage metrics from {{backend}}",offline:"Offline",running:"Running",noActiveSession:"No Active Session",noActiveSessionHint:"Start a CLIProxy session using ccs gemini, ccs codex, or ccs agy to view real-time statistics.",failedLoadStats:"Failed to Load Statistics",totalRequests:"Total Requests",successCount:"{{count}} success",successRate:"Success Rate",totalTokens:"Total Tokens",estimatedCost:"~${{cost}} estimated",modelsUsed:"Models Used",modelUsageDistribution:"Model Usage Distribution",requestCount:"{{count}} requests"},cliproxyTable:{name:"Name",provider:"Provider",model:"Model",account:"Account",status:"Status",default:"Default",actions:"Actions"},cliproxyTabs:{overview:"Overview",variants:"Variants",aiProviders:"AI Providers",controlPanel:"Control Panel"},cliproxyHeader:{ccsLevelAccountManagement:"CCS-level account management",cliproxyNotAvailable:"CLIProxy Not Available",cliproxyControlPanel:"CLIProxy Control Panel",noVariants:"No CLIProxy variants found.",addAccountToStart:"Add an account to get started"},routingGuidance:{roundRobin:"Round robin spreads usage.",fillFirst:"Fill first keeps backup accounts cold until they are needed.",routingStrategy:"Routing strategy",optionalRouting:"Optional routing",sessionAffinity:"Session affinity",sessionAffinityOn:"On",sessionAffinityOff:"Off",sessionAffinityEnabled:"Enabled",sessionAffinityDisabled:"Disabled",enableSessionAffinity:"Enable session affinity",disableSessionAffinity:"Disable session affinity",sessionAffinityUnavailable:"Session affinity unavailable",localOnly:"Local only",localOnlySetting:"Local-only setting",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"Keep one conversation pinned to the same account when possible. CLIProxy prefers explicit session or thread identifiers when clients send them, then falls back to request metadata or the opening prompt history when it has to infer a stable key.",sessionRecognitionTitle:"Session recognition",sessionRecognitionDescription:"CCS does not promise one universal precedence order here. In practice, upstream backends prefer explicit session or thread IDs first, then fall back to metadata fields and finally a hash based on the opening prompt history."},extendedContext:{extendedContext:"Extended Context"},cliproxyConfig:{unsavedChanges:"Unsaved changes",original:"Original",modified:"Modified",reviewChanges:"Review Changes",loadingEditor:"Loading editor..."},providerEditor:{provider:"Provider",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",modelMapping:"Model Mapping",status:"Status",loadingSettings:"Loading settings...",loadingEditor:"Loading editor...",accounts:"Accounts",addAccount:"Add Account",noAccountsConnected:"No accounts connected",addAccountToStart:"Add an account to get started",gcpProjectIdReadonly:"GCP Project ID (read-only)",projectIdNA:"Project ID: N/A",missingProjectId:"Missing Project ID",missingProjectIdHint:"This may cause errors. Remove the account and re-add it to fetch the project ID.",useIncognito:"Use incognito",aliases:"Aliases",current:"Current",currentValue:"Current value",composite:"composite",defaultLabel:"default",requiredSetup:"Required setup",connectorName:"Connector Name",proxyUrl:"Proxy URL",proxyUrlSet:"Proxy URL set",excludedModels:"Excluded Models",headers:"Headers",secret:"Secret",prefix:"Prefix",modelMappings:"Model Mappings",baseUri:"Base URL",apiKeys:"API Keys",presets:"Apply pre-configured model mappings",createVariant:"Create CLIProxy Variant",agyDenylist:"Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated."},providerEditorAccountItem:{modelsUsed:"Models Used"},bulkActionBar:{applyPreset:"Apply preset"},modelConfigSection:{defaultModel:"Default Model"},rawEditorSection:{rawConfig:"Raw Configuration"},providerEditorHeader:{connectorName:"Connector Name"},aiProvidersFamilyRail:{current:"Current"},aiProvidersEntryCard:{apiKeys:"API Keys"},aiProvidersEntryDialog:{connectorName:"Connector Name",baseUri:"Base URL",proxyUrl:"Proxy URL",secret:"Secret",prefix:"Prefix",excludedModels:"Excluded Models",headers:"Headers",modelMappings:"Model Mappings",requiredSetup:"Required setup",optionalRouting:"Optional routing"},codex:{controlCenter:"Control Center",overview:"Overview",docs:"Docs",nativeCodexRuntime:"Native Codex Runtime",ccsCodexProvider:"Cliproxy shortcut / managed bridge",codexDocs:"Codex docs",howCodexWorks:"How Codex works in CCS",supportedFlows:"Supported flows",twoSupportedPaths:"Two supported paths:",nativeLabel:"Native:",nativeDesc:"Codex is a first-class, runtime-only target in CCS v1.",nativeConfigLabel:"Native config:",nativeConfigDesc:"ccs-codex and ccsx launch native Codex using your saved defaults.",transientOverridesLabel:"Transient overrides:",transientOverridesDesc:"ccsxp stays on native Codex and prepends the cliproxy provider override; ccs codex --target codex remains the explicit CCS-managed bridge.",cliproxyDefaultLabel:"CLIProxy default:",cliproxyDefaultDesc:'To make plain codex use CLIProxy, set model_provider = "cliproxy" and add the recipe below.',ccsBridge:"CCS Bridge",apiProfilesDefault:"API profiles continue to default to Claude or Droid.",runtimeInstall:"Runtime install",detected:"Detected",notFound:"Not found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",versionLabel:"Version",nativeAliases:"Native aliases",ccsProviderShortcut:"Cliproxy shortcut",configOverrideSupport:"--config override support",available:"Available",missing:"Missing",cliproxyNativeCodex:"CLIProxy-backed native Codex",builtInLabel:"Built-in:",builtInCcsxpDesc:"Use ccsxp for native Codex with the cliproxy provider shortcut.",managedBridgeLabel:"Managed bridge:",managedBridgeDesc:"Use ccs codex --target codex when you want the stricter CCS-managed route explicitly.",nativeRecipeLabel:"Native:",nativeRecipeDesc:"Configure the recipe below to use CLIProxy directly with codex.",saveProviderNamedCliproxy:"Save a provider named cliproxy with the base URL and env key above.",inTopLevelSetDefault:"In Top-level settings, set Default provider to cliproxy.",exportCliproxyApiKey:"Export CLIPROXY_API_KEY in your shell before launching native Codex.",noConfigOverrides:"This Codex build can still use the plain native path, but ccsxp and the explicit CCS-managed Codex bridge stay unavailable until the detected Codex binary exposes --config overrides.",configFile:"Config file",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",tomlWarning:"TOML warning",readWarning:"Read warning",currentUserLayerSummary:"Current user-layer summary",activeProfile:"Active profile",notSet:"Not set",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"User-layer keys present",recommendedSetupFlow:"Recommended setup flow",fastestPath:"Fastest path",officialChannels:"Official Channels",codexCli:"Codex CLI",openNativeCodex:"Open native Codex",runBuiltInCodex:"Run native Codex with the cliproxy shortcut",runBuiltInCodexExplicit:"Run the CCS-managed Codex bridge explicitly",openCodexDashboard:"Open Codex dashboard",nativeShortAlias:"Native short alias",ccsCodexShortcut:"Cliproxy shortcut",explicitProviderRoute:"Managed bridge route",status:"Status",profiles:"Profiles",createNewProfile:"Create new profile",createNewProvider:"Create new provider",createNewMcpServer:"Create new MCP server",defaultProvider:"Default provider",useDefault:"Use default",useGlobalProvider:"Use global provider",useProviderDefault:"Use provider default",quickFillWarning:"Quick-fill only. Review before saving.",thisFileUpstreamOwned:"This file is upstream-owned by Codex CLI.",notes:"Notes",approvalPolicy:"Approval policy",sandboxMode:"Sandbox mode",reasoningEffort:"Reasoning effort",useGlobalEffort:"Use global effort",reasoningEffortCapitalized:"Reasoning Effort",thinkingBudgetTokens:"Thinking Budget Tokens",modelContextWindow:"Model context window",autoCompactTokenLimit:"Auto-compact token limit",toolOutputTokenLimit:"Tool output token limit",webSearch:"Web search",personality:"Personality",model:"Model",rawOnly:"Raw only",trusted:"trusted",untrusted:"untrusted",noProjectTrustEntries:"No explicit project trust entries saved.",codexNativeRecipe:"Saved native Codex recipe",runtimeVsProvider:"Runtime vs provider",honorsSavedNativeConfig:"Honors saved native user config",usesTransientOverrides:"Uses transient overrides",unavailableNoConfig:"Unavailable (Codex build lacks --config support).",gptContextCap:"GPT-5.4 context cap",usageLimitCost:"Usage-limit cost above 272K",longContextOverride:"Long context override",counts2x:"Counts 2x",normalUsageWindow:"Normal usage window",useCodexDefault:"Use Codex default",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"Default Target CLI",executionChain:"Execution chain",targetPath:"Current target path",userConfig:"User config",configYaml:"config.yaml",flow:"Flow",docsTab:"Docs",yes:"Yes",no:"No",warningsTitle:"Warnings",features:"Features",featuresDesc:"Toggle the supported Codex feature flags CCS can safely manage.",configOnlyFlags:"Existing config-only flags",configOnlyFlagsDesc:"These feature keys already exist in your `config.toml`, so CCS can surface them without claiming full catalog coverage.",existing:"existing",nonBooleanForm:"Stored in a non-boolean form. Use raw TOML if you need to edit it.",discoveredFromFile:"Discovered from the current file instead of CCS's built-in catalog.",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"Enable subagent collaboration tools.",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"Use the PTY-backed unified exec tool.",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"Reuse shell environment snapshots.",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"Enable freeform apply_patch edits.",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Enable the Node-backed JavaScript REPL.",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Collect Codex runtime metrics.",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"Keep the machine awake while active.",featureFastModeLabel:"Fast mode",featureFastModeDesc:"Allow the fast service tier path.",featureAppsLabel:"Apps",featureAppsDesc:"Enable ChatGPT Apps and connectors support.",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"Route eligible approvals through the guardian flow.",auth:{terminalOnlyTooltip:"Use ccsx auth switch <name> or ccsx auth remove <name> in terminal.",terminalOnlyTooltipRich:"Use <code>ccsx auth switch &lt;name&gt;</code> or <code>ccsx auth remove &lt;name&gt;</code> in terminal.",activeSourceBadge:"{{source}}",statusOk:"OK",statusInvalid:"[!] auth invalid",loading:"Loading auth profiles...",loadError:"[!] Failed to load codex-auth profiles.",emptyRegistry:"[i] No codex-auth profiles. Run ccsx auth create <name> to create one.",emptyRegistryRich:"[i] No codex-auth profiles. Run <code>ccsx auth create &lt;name&gt;</code> to create one.",legacyCodexHome:"Codex will use the default ~/.codex location.",legacyCodexHomeRich:"Codex will use the default <code>~/.codex</code> location.",legacyMode:"[i] No active profile. Using ~/.codex (legacy). Run ccsx auth switch <name> in terminal to activate one.",legacyModeRich:"[i] No active profile. Using <code>~/.codex</code> (legacy). Run <code>ccsx auth switch &lt;name&gt;</code> in terminal to activate one.",externalCodexHome:"[i] $CODEX_HOME set externally to {{path}}. Profile registry not in use for this session.",externalCodexHomeRich:"[i] <code>$CODEX_HOME</code> set externally to <code>{{path}}</code>. Profile registry not in use for this session.",activeProfile:"Active profile:",unknownProfile:"(unknown)",planLabel:"Plan:",switchAction:"Switch",removeAction:"Remove",sourceDefault:"default",sourceEnv:"$CCS_CODEX_PROFILE",sourceExplicitCodexHome:"$CODEX_HOME",col:{name:"Name",email:"Email",plan:"Plan",lastUsed:"Last used",status:"Status",actions:"Actions"}}},droidSettings:{quickControls:"Quick Controls",reasoningControls:"Reasoning Controls",thinkingBudget:"Thinking Budget",anthropicOnly:"Anthropic models only",byokCustomModels:"BYOK Custom Models"},rawJsonSettingsEditor:{title:"Raw Settings Editor"},copilotConfigForm:{copilotConfiguration:"Copilot Configuration",deprecatedModels:"Deprecated Copilot models detected",failedLoadStatus:"Failed to load status",useWithClaudeCode:"Use your GitHub Copilot subscription with Claude Code",githubCopilotControls:"GitHub Copilot controls prompt/context limits upstream.",provider:"Provider",filePath:"File Path",status:"Status",enabled:"Enabled",disabled:"Disabled",loadingEditor:"Loading editor...",modelMapping:"Model Mapping",quickUsage:"Quick Usage",noPremiumUsage:"No premium usage count"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"All Systems Nominal",machineChecks:"Machine checks"},analyticsCards:{cacheCost:"Cache Cost",hitRate:"Hit Rate",inputOutputRatio:"Input/Output Ratio",noCacheData:"No cache data available",noModelData:"No model data available",noSessionData:"No session data available",noTokenData:"No token data available",totalCost:"Total Cost",totalTokens:"Total Tokens",usageInsights:"Usage Insights"},dateRangeFilter:{pickADate:"Pick a date"},logsConfig:{level:"Lvl",message:"Message",source:"Source",time:"Time",proc:"Proc",open:"Open",run:"Run",refreshEntries:"Refresh Entries"},logsDetailPanel:{details:"Details"},logsFilters:{filters:"Filters"},logsOverviewCards:{overview:"Overview"},logsPageSkeleton:{loadingLogs:"Loading logs..."},monitoringErrorLogs:{logContent:"Log Content"},analyticsPages:{chartsGrid:"Charts",costByModel:"Cost by Model"},toasts:{profileCreated:"Profile created successfully",profileUpdated:"Profile updated successfully",profileDeleted:"Profile deleted successfully",orphanProfilesComplete:"Orphan profiles registration complete",profileCopied:"Profile copied successfully",profileImported:"Profile imported successfully",authRequired:"{{provider}} authorization required",authSuccess:"{{provider}} authentication successful!",authFailed:"{{provider}} authentication failed",deviceCodeExpired:"Device code expired. Please try again.",codeCopied:"Code copied to clipboard",failedCopy:"Failed to copy code",configSaved:"Configuration saved successfully",configSaveFailed:"Failed to save: {{error}}",invalidYaml:"Cannot save invalid YAML",configUpdatedExternally:"Configuration updated externally",settingsFileUpdated:"Settings file updated",accountsUpdated:"Accounts updated",noProfilesToSync:"No profiles to sync",syncFailed:"Sync failed: {{error}}",sessionAffinityUpdated:"Session affinity {{state}}.",providerAuthSuccess:"{{provider}} authentication successful",providerDeviceCodeInCallback:"Provider returned Device Code flow in callback mode",providerAuthTimeout:"Authentication timed out. Please try again.",providerAccountRegistrationFailed:"Authenticated account could not be registered",providerLostStatusEndpoint:"Lost contact with the auth status endpoint",providerUnknown:"Unknown provider: {{provider}}",providerStartOAuthFailed:"Failed to start OAuth",providerCallbackFailed:"Callback submission failed",providerSubmitCallbackFailed:"Failed to submit callback",loggingConfigSaved:"Logging configuration saved.",loggingConfigSaveFailed:"Failed to save logging configuration.",unifiedConfigUpdated:"Configuration updated successfully",migrationPreviewComplete:"Migration preview completed",migrationComplete:"Migration completed successfully",migrationFailed:"Migration failed",rollbackComplete:"Rollback completed successfully",rollbackFailed:"Rollback failed",defaultAccountSet:'Default account set to "{{name}}"',defaultAccountReset:"Default account reset to CCS",accountDeleted:'Account "{{name}}" deleted',contextUpdated:'Updated "{{name}}" context to {{summary}}',legacyConfirmError:'Account "{{name}}" needs explicit confirmation. Use Edit History Sync on this account.',legacyConfirmFailed:'Legacy account "{{name}}" failed confirmation: {{error}}',legacyConfirmSuccess_one:"{{count}} legacy account confirmed",legacyConfirmSuccess_other:"{{count}} legacy accounts confirmed",legacyConfirmPartial:"Confirmed {{updated}} legacy account(s), but {{failed}} update(s) failed. Refreshed account state.",legacyConfirmAllFailed:"Failed to confirm {{failed}} legacy account(s). Refreshed account state.",noLegacyAccounts:"No legacy accounts need confirmation",routingStrategySet:"Routing strategy set to {{strategy}}",variantCreated:"Variant created successfully",variantUpdated:"Variant updated successfully",variantDeleted:"Variant deleted successfully",defaultAccountUpdated:"Default account updated",accountRemoved:"Account removed",accountPaused:"Account paused",accountResumed:"Account resumed",accountAdded:"Account added for {{provider}}",kiroImported:"Imported Kiro account: {{name}}",kiroTokenImported:"Kiro token imported",modelUpdated:"Model updated",presetSaved:'Preset "{{name}}" saved',presetDeleted:"Preset deleted",cliproxyAlreadyRunning:"CLIProxy was already running",cliproxyStarted:"CLIProxy started successfully",cliproxyStartFailed:"Failed to start CLIProxy",cliproxyStopped:"CLIProxy stopped",cliproxyStopFailed:"Failed to stop CLIProxy",presetApplied:'Applied "{{name}}" preset',presetAppliedCustom:"Applied custom preset",settingsSavedWithAdjustments:"Settings saved with model adjustments",settingsSaved:"Settings saved",failedSaveSettings:"Failed to save settings",codexRefreshFailed:"Failed to refresh Codex snapshot. Raw edits were kept.",codexRefreshError:"Failed to refresh Codex snapshot.",codexFixToml:"Fix TOML before saving.",codexSaved:"Saved Codex config.toml.",codexChangedExternally:"config.toml changed externally. Refresh and retry.",codexSaveFailed:"Failed to save Codex config.toml.",codexUpdateFailed:"Failed to update Codex config.",noOrphanProfiles:"No orphan profile settings found",profilesRegistered:"Registered {{count}} profile(s){{skipped}}",destinationEmpty:"Destination profile name cannot be empty",profileExportDownloaded:"Profile export downloaded",profileImportFailed:"Failed to import profile bundle"},providerConfig:{defaultDeviceCodeInstruction:"Complete the authorization in your browser.",trackLabel:"Track",sectionCoreLabel:"Core / original backend",sectionCoreHint:"Default, always-available provider track",sectionPlusLabel:"Plus extras / community-maintained",sectionPlusHint:"Still supported, but separated from the default backend for now",plusTrackNote:"Requires the optional Plus backend while that track remains community-maintained."},profileEditorSections:{imageAnalysis:"Image Analysis",loadingImageSettings:"Loading image settings...",skipPermissionPrompts:"Skip permission prompts on launch",useNativeImageReading:"Use native image reading",skipTransformer:"Skip transformer",friendlyUi:"Friendly UI",info:"Info"},imageAnalysisStatus:{sectionTitle:"Image",openSettings:"Open Settings",useNativeImageReading:"Use native image reading",refreshingPreview:"Refreshing preview",savedStatus:"Saved status",livePreview:"Live preview",disabledGlobally:"Disabled globally",targetBypassesHook:"{{target}} bypasses the hook",nativeImageReading:"Native image reading",setupNeeded:"Setup needed",needsAuth:"Needs auth",needsProxy:"Needs proxy",nativeFallback:"Native fallback",transformerReady:"Transformer ready",badgeDisabled:"Disabled",badgeBypassed:"Bypassed",badgeNative:"Native",badgeSetup:"Setup",badgeAuth:"Auth",badgeProxy:"Proxy",badgeReady:"Ready",capabilityVerified:"Verified",capabilityUnknown:"Unknown",toggleSummaryNativeCapable:"{{model}} looks image-ready. CCS will bypass the transformer here.",toggleSummaryNativeModel:"CCS will prefer native reading for {{model}}.",toggleSummaryNativeDefault:"CCS will prefer native image reading for this profile.",toggleSummaryNativeFileAccess:"This profile currently stays on native file access.",toggleSummaryInactiveTarget:"Saved Claude-side image routing is inactive while {{target}} is selected.",toggleSummaryTransformerRoute:"Transformer route: {{backend}}{{modelSuffix}}.",noteDisabledGlobally:"Image is disabled globally in CCS settings.",noteTargetBypassesHook:"Current target {{target}} bypasses the Claude Read hook.",notePersistHook:"Persist the profile hook before transformer routing can run here.",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"NEW",integration:"OpenRouter Integration"},openrouterBanner:{accessModels:"Access {{count}}+ models via OpenRouter",add:"Add"},openrouterModelPicker:{searchModels:"Search Models",newestModels:"Newest Models"},openrouterPromoCard:{title:"OpenRouter",description:"Access hundreds of models from one API endpoint."},profileCard:{profile:"Profile",openRouter:"OpenRouter profile",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code (default)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS profile"},profileDeck:{profiles:"Profiles",failedToLoad:"Failed to load profiles: {{message}}",noProfiles:"No profiles configured. Create your first profile to get started."},profilesTable:{name:"Name",provider:"Provider",model:"Model",target:"Target",lastModified:"Last Modified",actions:"Actions",edit:"Edit"},profileCreateDialog:{createProfile:"Create Profile",appliedModelToTiers:'Applied "{{model}}" to all model tiers',profileCreated:'Profile "{{name}}" created',failedCreate:"Failed to create profile",chooseProviderHint:"Choose a provider preset or configure a custom API endpoint.",basicInformation:"Basic Information",modelConfiguration:"Model Configuration",usedInCli:"Used in CLI:",apiBaseUrl:"API Base URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"Pre-filled from {{name}}. You can customize if needed.",optionalForPreset:"Optional for {{name}}. Leave blank to use native Anthropic auth.",endpointHint:"The endpoint that accepts OpenAI-compatible and Anthropic requests",optional:"(optional)",apiKeyOptionalPlaceholder:"Optional - only if auth is enabled",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"Only needed if your local endpoint has authentication enabled",defaultTargetCli:"Default Target CLI",modelMapping:"Model Mapping",modelMappingDesc:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider.",searchModelsPlaceholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",noModelsFound:'No models found for "{{query}}"',loadingModels:"Loading models...",defaultModel:"Default Model",sonnetMapping:"Sonnet Mapping",opusMapping:"Opus Mapping",haikuMapping:"Haiku Mapping",sonnetMappingPlaceholder:"e.g. gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"e.g. o1, claude-opus-4.5",haikuMappingPlaceholder:"e.g. gpt-4o-mini, claude-3.5-haiku",free:"Free"},profileDialogLegacy:{editProfile:"Edit Profile"},supportEntryCard:{actionRequired:"Action Required"},settingsPage:{title:"Settings",loading:"Loading...",failedLoad:"Failed to load settings.",tabs:{web:"Web",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup",channels:"Channels",imageAnalysis:"Image"},websearchSection:{title:"Web Search",description:"CLI-based web search configuration."},thinkingSection:{title:"Thinking",description:"Configure extended thinking/reasoning for supported models.",directOverride:"Direct override",youType:"You type:",ccsAdds:"CCS adds:",executionChain:"Execution chain",primaryBackends:"Primary backends",legacyCliFallbacks:"Legacy CLI fallbacks",managedPayload:"Managed payload",sharedTargetMetadata:"Shared target metadata",ideTargetMetadata:"IDE target metadata",ideSettingsPath:"IDE settings path",ideHost:"IDE host",resolvedBinding:"Resolved binding",bindingName:"Binding name",inSync:"In sync",currentTargetPath:"Current target path",warnings:"Warnings",notes:"Notes",workspacePresets:"Workspace presets",draft:"Draft",advanced:"Advanced",recommended:"Recommended setup flow",configureModelFirst:"Configure a model first"},proxySection:{title:"Proxy",loadingImageSettings:"Loading image settings..."},channelsSection:{title:"Official Channels",description:"View and manage official release channels."},imageAnalysisSection:{title:"Image Analysis",description:"Configure image analysis settings.",loading:"Loading image settings..."},browserSection:{title:"Browser",description:"Primary setup surface for managed browser automation in CCS.",primaryTitle:"Settings > Browser is the primary browser setup surface.",primaryDescription:"Configure Claude Browser Attach and Codex Browser Tools here, then use the guidance below to launch or verify each lane.",readiness:"Readiness",nextStep:"Next step",technicalDetails:"Technical Details",diagnostics:"Diagnostics",evalMode:{label:"browser_eval access",options:{disabled:"Disabled",readonly:"Read-only",readwrite:"Read/write"}},actions:{saveClaude:"Save Claude settings",saveCodex:"Save Codex settings",testConnection:"Test connection",copyLaunchCommand:"Copy launch command"},messages:{statusRefreshed:"Browser status refreshed",launchCommandCopied:"Launch command copied"},claude:{title:"Claude Browser Attach",description:"Attach Claude-target launches to a managed Chrome session with remote debugging enabled.",enabledLabel:"Enable Claude Browser Attach",enabledDescription:"When enabled, CCS prepares the managed browser MCP runtime for Claude-target launches.",userDataDir:"Chrome user-data directory",userDataDirHint:"Use a dedicated Chrome profile directory so attach-mode state stays isolated from your daily browser.",devtoolsPort:"DevTools port",devtoolsPortHint:"Use the same port when you launch Chrome in attach mode.",devtoolsPortInvalid:"Enter a valid port between 1 and 65535.",effectivePath:"Effective attach path",recommendedPath:"Recommended path",managedRuntime:"Managed browser runtime",evalModeHint:"Controls browser_eval access for Claude Browser Attach. Read-only allows inspection; read/write also allows page-side mutations.",overrideMessage:"An environment override is currently active from {{source}}. This dashboard remains the source of truth once that override is removed.",launchGuidance:"Launch guidance",launchGuidanceHint:"Start Chrome with remote debugging enabled, then rerun Test connection if needed."},codex:{title:"Codex Browser Tools",description:"Controls the managed Playwright MCP override path for Codex-target launches.",enabledLabel:"Enable Codex Browser Tools",enabledDescription:"Keep this on to make the Browser page the first-class setup surface for Codex browser tooling.",serverName:"Managed server name",overrideSupport:"Config override support",overrideSupported:"Supported",overrideUnsupported:"Not supported",binary:"Detected Codex binary",notDetected:"Not detected",evalModeHint:"Stored for Browser settings parity. In Phase 1, browser_eval enforcement primarily applies to Claude Browser Attach."}}},codexPage:{title:"Codex",controlCenter:"Control Center",overview:"Overview",docs:"Docs",authProfiles:"Auth Profiles",nativeRuntime:"Native Runtime",ccsProvider:"CCS Provider",setup:"Setup"},apiPage:{title:"API Profiles",subtitle:"Manage your API profiles and endpoints."},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension integration settings.",claudeAuth:"Claude auth",status:"Status",targetMetadata:"IDE target metadata"},sharedPageV2:{title:"Shared",subtitle:"Shared data management."},homePageV2:{title:"Home",logsMoved:"Logs moved to a dedicated workspace",profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health"},analyticsPageV2:{title:"Analytics",subtitle:"Usage analytics and insights."},logsPageV2:{title:"Logs",subtitle:"View and manage system logs."},healthPageV2:{title:"Health",subtitle:"System health monitoring."},aiProvidersPage:{title:"AI Providers",subtitle:"Manage AI provider configurations.",unableToLoad:"Unable to load AI Providers"}}},"zh-CN":{translation:{locale:{en:"English","zh-CN":"简体中文",vi:"越南语",ja:"日语",ko:"韩语"},layout:{languageSwitcher:"语言"},nav:{general:"通用",home:"首页",analytics:"分析",identityAccess:"身份与访问",apiProfiles:"API 配置",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概览",controlPanel:"控制面板",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"账号",allAccounts:"全部账号",sharedData:"共享数据",compatibleClis:"兼容",deprecated:"已弃用",factoryDroid:"Factory Droid",system:"系统",health:"健康",logs:"日志",settings:"设置",openrouterTooltip:"精选:OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康",configurationRequired:"需要配置"},auth:{dashboardTitle:"CCS 控制台",protectedAccessLabel:"受保护访问",remoteGuardLabel:"远程访问保护",loading:"正在检查控制台访问状态…",loginDescription:"使用主机上配置的用户名和密码访问控制台。",username:"用户名",password:"密码",usernamePlaceholder:"请输入用户名",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",loginFailed:"登录失败",lightMode:"浅色",darkMode:"深色",noDefaultCredentials:"CCS 不提供默认用户名或密码。",credentialsHint:"凭据需要在 CCS 主机上通过 `ccs config auth setup` 创建;Docker 部署必须在容器内运行该命令。",remoteSetupTitle:"远程访问需要完成认证设置",remoteSetupDescription:"当前通过非本机地址打开控制台,但此 CCS 实例尚未启用控制台认证。",incompleteSetupDescription:"控制台认证已开启,但设置尚未完成。请先为此 CCS 实例完成配置再登录。",safetyNoteRemote:"在 CCS 主机所有者启用控制台认证前,远程管理会保持锁定。",safetyNoteLocal:"如果你就在这台机器上,使用 localhost 地址始终是最直接的方式。",safetyNoteSession:"登录成功后会创建仅限此控制台主机的 HTTP-only 会话。",hostStepTitle:"在 CCS 主机上操作",hostStepDescription:"创建或重新启用控制台凭据,然后再从远程设备重新打开此页面。",dockerStepDescription:"如果是 Docker 部署,请在正在运行的容器内执行:",localStepTitle:"如果这就是你的机器",localStepDescription:"请使用 `ccs config` 输出的 localhost 地址,而不是局域网或 Tailscale 地址。",showPassword:"显示密码",hidePassword:"隐藏密码"},commonToast:{apiKeyRequired:"API key 为必填项",accountAddedPresetFailed:"账号已添加,但应用默认预设失败",settingsCopied:"设置已复制到剪贴板",enterPresetName:"请先输入预设名称再保存",codeCopied:"验证码已复制到剪贴板",copyCodeFailed:"复制验证码失败",appliedModelAllTiers:"已将模型应用到全部层级",settingsSaved:"设置已保存",defaultTargetUpdated:"默认目标已更新",failedUpdateDefaultTarget:"更新默认目标到 {{target}} 失败{{suffix}}",resourcesUpdated:"共享资源已更新"},profileDialog:{editTitle:"编辑配置",createTitle:"创建 API 配置",name:"名称",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"默认模型(ANTHROPIC_MODEL)",defaultModelHint:"留空则使用:{{model}}",modelMappingTitle:"模型映射(Opus/Sonnet/Haiku)",modelMappingDesc:"为不同档位配置不同模型 ID,适合按模型类型路由到不同后端的 API 代理。",opusModel:"Opus 模型(ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 模型(ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 模型(ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"取消",saving:"保存中...",update:"更新",create:"创建"},modelTierMapping:{title:"模型档位映射",advanced:"高级",description:"为 Claude Code 的 opus/sonnet/haiku 档位配置不同模型。",autoSuggest:"基于 {{provider}} 自动建议",opusPlaceholder:"例如:anthropic/claude-opus-4",sonnetPlaceholder:"例如:anthropic/claude-sonnet-4",haikuPlaceholder:"例如:anthropic/claude-3.5-haiku",footer:"这些字段对应 ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL。"},envEditor:{sensitive:"敏感",none:"尚未配置环境变量。",noneHint:"可在下方输入添加,或直接编辑 JSON。",addVariable:"添加环境变量",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"当前使用:",variantNameRequired:"运行时变体名称 *",variantNamePlaceholder:"例如:my-gemini、g3、flash",invokeHintPrefix:"使用此变体运行:",model:"模型",modelPlaceholder:"例如:gemini-2.5-pro、claude-opus-4-6-thinking",choosePresetInstead:"改为从预设中选择",selectModel:"选择模型",customModelName:"自定义模型名称...",enterAnyModel:"可输入 CLIProxy 支持的任意模型名",defaultModel:"默认:{{model}}",providerDefault:"提供商默认值",back:"返回",skip:"跳过",creating:"创建中...",createVariant:"创建变体",skipHint:"如果账号设置已足够且不需要单独运行时变体,可以跳过"},customPresetDialog:{title:"自定义预设",presetNameOptional:"预设名称(可选)",presetNamePlaceholder:"例如:我的自定义配置",codexTipPrefix:"Codex 提示:后缀",codexTipSuffix:"会固定 effort。无后缀模型使用 Thinking 设置。",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用",opusModel:"Opus(最强)",opusModelDesc:"用于复杂推理任务",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"兼顾速度与能力",haikuModel:"Haiku(快速)",haikuModelDesc:"适合简单任务的快速响应",cancel:"取消",savePreset:"保存预设",applyPreset:"应用预设",deletePreset:"删除预设"},componentModelSelector:{selectModel:"选择模型",availableModelsCount:"可用模型({{count}})",preview:"预览"},searchableSelect:{searchModels:"搜索模型...",noResults:"未找到匹配结果。"},copilotSettings:{enableCopilot:"启用 Copilot",enableCopilotDesc:"允许使用 GitHub Copilot 订阅",basicSettings:"基础设置",accountType:"账户类型",accountTypeIndividual:"个人",accountTypeBusiness:"企业",accountTypeEnterprise:"组织",rateLimiting:"速率限制",rateLimitSeconds:"速率限制(秒)",noLimit:"不限制",waitOnRateLimit:"触发限速时等待",waitOnRateLimitDesc:"达到限制时等待而不是报错",daemonSettings:"守护进程设置",autoStartDaemon:"自动启动守护进程",autoStartDaemonDesc:"使用配置时自动启动 copilot-api"},providerModelSelector:{selectModel:"选择模型",noModelsForProvider:"该提供商暂无可用模型",broken:"故障",deprecated:"已弃用",paid:"付费",freeTier:"免费档",paidTier:"付费档",modelKnownIssues:"该模型存在已知问题",viewIssueDetails:"查看问题详情",modelDeprecated:"该模型已弃用",recommended:"推荐",allModelsCount:"全部模型({{count}})",noModelsAvailable:"暂无可用模型",shadowed:"已遮蔽",prefixOnly:"仅前缀",current:"当前",currentValue:"当前值",preferredPinnedModel:"偏好的固定模型:",pinnedRouteStatus:"固定路由状态:",pinnedModelNotAdvertised:"固定模型当前未被代理广播:{{model}}",codexReasoningVariants:"推理变体",codexFastVariants:"快速变体"},createAuthProfileDialog:{title:"创建新账号",description:"Auth 配置需要先完成 Claude CLI 登录。请在终端执行下方命令。稍后你仍可在 Accounts 表中编辑同步模式、分组与连续性深度。",profileName:"配置名称",profileNamePlaceholder:"例如:work、personal、client",invalidProfileName:"名称必须以字母开头,且只能包含字母、数字、短横线或下划线。",enableSharedHistory:"与其他 ccs auth 账号启用共享历史同步",historySyncGroupOptional:"历史同步分组(可选)",historySyncGroupPlaceholder:"default、sprint-a、client-x",historySyncGroupHint:"留空将使用默认共享分组。空格会自动规范为短横线。",deeperContinuity:"高级:更深连续性模式",deeperContinuityHint:"会同步 session-env、file-history、shell-snapshots 与 todos。凭据仍保持隔离。",invalidContextGroup:"分组必须以字母开头,且只能包含字母、数字、短横线或下划线(最多 {{max}} 个字符)。",command:"命令",commandFallback:"ccs auth create <name>",afterRunPrefix:"执行命令后:",afterRunStep1:"在浏览器中完成 Claude 登录",afterRunStep2:"返回此处并刷新,即可看到新账号",poolingHint:"如果更倾向于共享池化 Claude OAuth 路由,可在 Accounts 页面操作按钮中使用 CLIProxy Claude pool。",close:"关闭",copied:"已复制!",copyCommand:"复制命令"},accountRouteGuide:{title:"推荐的双账号路线",description:"使用独立 account profile 保持 token 隔离。只有当两个账号应该看到同一份本地连续性时,才开启历史同步。",status:{empty:"创建账号",isolated:"隔离已就绪",shared:"共享项目上下文",deeper:"更深同步已就绪",mixed:"混合设置"},cards:{isolated:{title:"Token 仍然隔离",desc:"每个 ccs auth 账号都有自己的 Claude 配置、登录和凭据。同步设置不会复制 token。"},select:{title:"你选择使用哪个账号",desc:"运行 ccs work 或 ccs personal 来明确选择账号。只有当普通 ccs 应跟随某个账号时才设置默认。"},settings:{title:"设置跟随根目录",desc:"非 bare 账号会通过 CCS shared state 将 settings.json 链接到 ~/.claude/settings.json。ccs auth show 会确认状态。"},sync:{title:"历史同步需要主动开启",desc:"两个账号都需要使用 Shared 模式和同一分组。更深同步会加入额外的本地连续性文件。"}},commands:{isolated:"隔离账号用法",sync:"可选共享历史",syncDesc:'当希望两个账号共享本地历史时,在两个账号上使用同一分组,例如 "{{group}}"。'}},cliproxyModelCategory:{google:"Google(Gemini)",openai:"OpenAI(GPT)",anthropic:"Anthropic(Claude)",antigravity:"Antigravity",other:"其他"},cliproxyOverviewComponents:{availableModels:"可用模型",noModelsAvailable:"暂无可用模型",startSessionHint:"启动 CLIProxy 会话后即可拉取可用模型",totalCount:"共 {{count}} 个",availableThroughGroupedByProvider:"通过 {{backendLabel}} 提供的模型,按提供商分组",moreCount:"另外 {{count}} 个"},categorizedModelSelector:{selectModel:"选择模型",noModelsAvailable:"暂无可用模型",modelPlaceholder:"模型..."},openrouterQuickStart:{recommended:"推荐",title:"从 OpenRouter 开始",description:"通过一个 API 即可访问来自 OpenAI、Anthropic、Google、Meta 等的 {{modelCountLabel}} 个模型。",featureOneApi:"一个 API,接入全部提供商",profileSummaryCount:"{{count}} 个配置",profileSummaryCount_other:"{{count}} 个配置",profileSummaryEmpty:"高级质量 + 本地控制",summaryBadgeDefaultQuality:"默认最佳质量",summaryBadgeLocalLane:"任务合适时使用本地通道",summaryExistingTitle:"选择一个配置,或添加新的通道",summaryEmptyTitle:"选择你的第一条配置通道",summaryExistingDescription:"此工作区中已存在 {{count}} 个配置。对于严肃编码工作请优先使用高质量提供商,而在隐私、成本或离线场景下再增加本地运行时。",summaryExistingDescription_other:"此工作区中已存在 {{count}} 个配置。对于严肃编码工作请优先使用高质量提供商,而在隐私、成本或离线场景下再增加本地运行时。",summaryEmptyDescription:"根据任务选择通道。高级提供商仍是可靠编码的默认选择;本地运行时更适合隐私、低成本转换和实验。",qualityLanesTitle:"高质量通道",qualityLaneHighlightDefaultQuality:"高风险编码任务的默认最佳通道",alibabaLaneDescription:"当你想要一个独立于 OpenRouter 目录之外的高级编码通道时,这是一个强力的直连配置。",alibabaLaneHighlightQuality:"适合需要独立端点的高级质量场景",localRuntimesTitle:"本地运行时",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"最适合隐私敏感提示、本地清理和低成本批处理转换",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"最适合自定义 GGUF 部署和高级自托管本地工作流",localDetectedModels:"已检测到 {{count}} 个本地模型",localDetectedModels_other:"已检测到 {{count}} 个本地模型",localNoModelsDetected:"尚未检测到本地模型",localWaitingServer:"正在等待本地服务和模型列表",localRuntimeCheckingBadge:"检测中",localRuntimeReadyBadge:"就绪",localRuntimeNeedsModelBadge:"缺少模型",localRuntimeOfflineBadge:"离线",localRuntimeCheckingDescription:"正在检查本地运行时状态,然后再显示设置引导。",localRuntimeReadyDescription:"最适合私有提示、离线工作流和更便宜的批量转换。",localRuntimeNeedsModelDescription:"运行时已启动,但推荐的本地模型仍需要拉取或加载。",localRuntimeOfflineDescription:"这个通道适合隐私敏感工作、低成本本地转换和离线会话。",localRuntimeCheckingFooter:"正在检查本地运行时...",localRuntimeReadyFooter:"端点已就绪:{{endpoint}}",localRuntimeMissingModelFooter:"运行 `{{command}}` 完成本地设置。",localRuntimeOfflineFooter:"运行 `{{command}}` 启动本地端点。",localRuntimeSetupAction:"设置 {{label}}",localRuntimeUseAction:"使用 {{label}}",localRuntimeFinishAction:"完成 {{label}} 设置",runtimeProviderBadge:"运行时提供商设置",runtimeProviderTitle:"打开 AI Providers",runtimeProviderManagedDescription:"当你需要 CLIProxy 管理的连接器、提供商密钥和高级路由控制时使用这里。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex 以及 OpenAI 兼容连接器",runtimeProviderFeatureSecrets:"共享密钥与单个 API 配置分离存放",runtimeProviderFooter:"当多个配置需要共享同一提供商设置时最适合使用。",createOpenRouterProfile:"创建 OpenRouter 配置",getApiKeyAt:"在此获取 API Key:",createCustomProfile:"创建自定义 API 配置"},alibabaCodingPlanQuickStart:{recommended:"推荐",title:"试用阿里云 Coding Plan",description:"通过 Anthropic 兼容端点接入阿里云 Model Studio Coding Plan。",featureEndpoint:"Anthropic 兼容端点",featureKeyFormat:"专用 sk-sp API Key",createAlibabaProfile:"创建 Alibaba Coding Plan 配置",readGuideAt:"查看配置文档:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"通过 Anthropic 端点接入 Model Studio Coding Plan",add:"添加"},credentialHealth:{title:"凭据健康状态",ready:"就绪",noCredentialsConfigured:"尚未配置凭据。请使用上方登录按钮完成认证。",neverUsed:"从未使用",justNow:"刚刚",unknown:"未知",daysAgo:"{{count}} 天前",hoursAgo:"{{count}} 小时前",minutesAgo:"{{count}} 分钟前"},proxyStatusWidget:{justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",syncReady:"同步就绪",noConfig:"未配置",remoteProxy:"远程代理",active:"已连接",trafficAutoRouted:"流量已自动转发到远程服务器",tooltipSync:"同步配置到 CLIProxy",tooltipRestart:"重启",tooltipStop:"停止",tooltipClose:"关闭",tooltipVersionSettings:"版本设置",versionManagement:"版本管理",selectVersionPlaceholder:"选择要安装的版本...",stable:"(稳定版)",install:"安装",versionsAboveUnstable:"高于 {{version}} 的版本存在已知问题",versionsKnownIssues:"版本 {{version}} 存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",installFaultyTitle:"安装存在已知问题的版本?",installFaultyDesc:"即将安装 <strong>v{{version}}</strong>,该版本位于已知故障范围 <strong>{{range}}</strong> 内。",installFaultyWarning:"该版本存在已知缺陷,可能安装失败或让代理处于异常状态。",installUnstableTitle:"安装非稳定版本?",installUnstableDesc:"即将安装 <strong>v{{version}}</strong>,该版本高于当前最大稳定版 <strong>v{{maxStable}}</strong>。",installUnstableWarning:"该版本存在已知稳定性问题,可能导致异常行为。",installUnstableConfirm:"确定要继续吗?",cancel:"取消",installAnyway:"仍要安装",clickToDowngrade:"点击降级",clickToUpdate:"点击更新"},syncStatusCard:{profileSync:"配置同步",ready:"就绪",noConfig:"未配置",syncsProfilesDesc:"将 API 配置同步到本地 CLIProxy 配置",runDoctorHint:"运行 <code>ccs doctor --fix</code> 生成配置。",details:"详情",syncNow:"立即同步"},syncDialog:{title:"同步配置到本地 CLIProxy",description:"将 CCS API 配置同步到本地 CLIProxy 的 config.yaml。",noProfiles:"没有可同步的配置。",createProfilesFirst:"请先在「配置」页创建 API 配置。",modelLabel:"模型:",ready:"就绪",profilesToSync_one:"{{count}} 个配置待同步",profilesToSync_other:"{{count}} 个配置待同步",cancel:"取消",syncing:"同步中...",synced:"已同步!",syncNow:"立即同步"},errorLogs:{title:"错误日志",failedRequests_one:"{{count}} 个失败请求",failedRequests_other:"{{count}} 个失败请求",cliproxyDiagnostics:"CLIProxy 诊断",showingCount:"显示 50 / {{total}} 条",selectLog:"选择一条日志查看详情",failedLoadContent:"加载日志内容失败",copyAbsolutePath:"复制绝对路径",copyRawContent:"复制原始日志",tabOverview:"概览",tabHeaders:"请求头",tabRequest:"请求体",tabResponse:"响应体",tabRaw:"原始",modelLabel:"模型:",quotaResetsIn:"配额重置于 ",method:"方法",provider:"提供商",version:"版本",endpoint:"端点",url:"URL",timestamp:"时间戳",na:"无",noHeaders:"无请求头",noRequestBody:"无请求体内容",noResponseBody:"无响应体内容",rateLimitedMsg:"触发限速。请切换账号或等待配额重置。模型 {{model}} 配额已用尽。",rateLimitedMsgNoModel:"触发限速。请切换账号或等待配额重置。",authFailedMsg:"认证失败。请通过 CLIProxy 设置重新认证或检查 API Key。",notFoundMsg:"端点未找到,该提供商可能不存在此端点。",serverErrorMsg:"上游服务器错误。请稍后重试或查看提供商状态页。",timeoutMsg:"请求超时。请检查网络或增大超时设置。",unknown:"未知"},editAccountContext:{title:"编辑历史同步",description:"配置「{{name}}」与其他 ccs auth 账号共享历史与连续性的方式。",syncMode:"同步模式",selectContextMode:"选择同步模式",isolatedOption:"隔离(不同步)",sharedOption:"共享(启用同步)",sharedModeHint:"共享模式会为同一历史同步分组内的账号复用工作区上下文。",isolatedModeHint:"隔离模式使该账号与其他 ccs auth 账号完全独立。",historySyncGroup:"历史同步分组",groupPlaceholder:"default",groupHint:"会规范为小写(空格变为短横线)。允许:字母、数字、_、-(最多 {{max}} 字符)。",invalidGroup:"请输入以字母开头的有效分组名。",continuityDepth:"连续性深度",selectContinuityDepth:"选择连续性深度",standardOption:"标准(仅项目)",deeperOption:"更深连续性(高级)",deeperHint:"高级模式还会同步 session-env、file-history、shell-snapshots 和 todos。",standardHint:"标准模式仅同步项目工作区上下文。",credentialsIsolated:"凭据与 .anthropic 在所有模式下均按账号隔离。",implicationTitle:"保存后会发生什么",isolatedImplication:"该账号会继续保持隔离,其他账号无法续接它的连续性状态。",sameGroupRule:"只有账号都使用同一个分组“{{group}}”时,才会彼此共享连续性。",noSameGroupPeer:"当前没有其他账号使用这个分组。",sameGroupPeerCount_one:"已有 {{count}} 个其他账号使用这个分组。",sameGroupPeerCount_other:"已有 {{count}} 个其他账号使用这个分组。",deeperReady_one:"已有 {{count}} 个同组账号启用更深连续性。这是当前最强的交接设置。",deeperReady_other:"已有 {{count}} 个同组账号启用更深连续性。这是当前最强的交接设置。",deeperNeedsPeers:"此账号已启用更深连续性,但同组中的其他账号也需要启用更深连续性,才能更好满足跨账号续接的预期。",standardWarning:"标准共享更适合项目上下文。如果用户期望跨账号续接,两个账号都应启用更深连续性。",resumeOriginalWarning:"如果旧会话很重要,请先在原账号中恢复它,再调整设置。",cancel:"取消",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"历史同步说明",description:"隔离 -> 共享 -> 更深。在每行使用「同步」进行所有更改。",learningMap:"说明",isolated:"隔离",shared:"共享",deeper:"更深",cliproxyManaged_one:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",cliproxyManaged_other:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",showDetails:"显示详情:分组、切换与旧策略",modeSwitch:"模式切换",modeSwitchDesc:"同步对话框可让用户在隔离/共享间切换并选择更深连续性。",historySyncGroup:"历史同步分组",historySyncGroupDesc:"同一分组即共享项目上下文。默认回退为 default。",sameGroupRule:"只有两个账号都设为共享且使用同一分组时,才会共享连续性。",deeperRecommendation:"分组“{{group}}”已开启共享,但如果用户期望跨账号续接,更推荐同时启用更深连续性。",partialGroup:"分组“{{group}}”已经配置得不错,但其他账号或分组仍需要补齐同组或更深连续性设置。",readyGroup:"分组“{{group}}”已有多个账号启用更深连续性。这是当前最强的交接设置。",legacyConfirmation_one:"{{count}} 个旧账号仍需要显式确认。",legacyConfirmation_other:"{{count}} 个旧账号仍需要显式确认。"},continuityReadiness:{title:"跨账号续接检查",description:"在切换账号前,用这张卡快速确认还缺什么。",state:{single:"单账号",isolated:"续接关闭","shared-alone":"已共享但未完成","shared-standard":"仅项目共享",partial:"部分就绪",ready:"强交接已就绪"},metrics:{isolated:"隔离账号",sharedPeers:"有同组伙伴",deeperReady:"更深已就绪"},messages:{single:{title:"目前只配置了一个 auth 账号。",description:"现在还不涉及跨账号交接。请先再添加一个 auth 账号,再配置共享连续性。"},isolated:{title:"当前还没有开启跨账号续接。",description:"当前可见账号都处于隔离模式,因此在一个账号中创建的会话仍会留在原账号。"},"shared-alone":{title:"已经开启共享,但还没有任何分组拥有同组伙伴。",description_one:"{{count}} 个共享账号仍在等待另一个账号加入同一分组。",description_other:"{{count}} 个共享账号仍在等待另一个账号加入同一分组。"},"shared-standard":{title:"分组“{{group}}”已共享项目上下文,但尚未形成更深连续性的配对。",description:"用户可能期望的不只是项目共享。如果希望更稳妥地支持跨账号续接,请让这个分组中的两个账号都启用更深连续性。"},partial:{title:"已有一个分组准备就绪,但整体配置仍是混合状态。",description:"至少有一个分组已经启用更深连续性,但其他账号仍可能处于隔离、单独共享分组,或尚未启用更深连续性。"},ready:{title:"分组“{{group}}”已经具备当前最强的连续性设置。",description:"这个分组中已有多个账号启用更深连续性。是否能够恢复仍取决于 Claude 上游实际保存了什么。"}},stepsTitle:"下一步建议",steps:{syncBoth:"请在两个账号上都打开“同步”,而不是只调整要切换进去的那个账号。",sameGroup:"两个账号都使用同一个历史同步分组。“{{group}}”是当前推荐的分组。",enableDeeper:"如果用户期望的是跨账号续接,而不是仅共享项目上下文,请在两个账号上都启用更深连续性。",resumeOriginal:"如果原来的会话很重要,请先在原账号中恢复它,再修改连续性设置。"},singleSteps:{addAccount:"先再创建一个 ccs auth 账号,然后再考虑跨账号交接。",sameGroupLater:"当第二个账号准备好后,再把两个账号放到同一个历史同步分组。",enableDeeperLater:"如果未来会期望跨账号续接而不是仅共享项目上下文,请在两个账号上都启用更深连续性。",resumeOriginal:"在第二个账号配置完成之前,重要会话仍应从原账号继续恢复。"}},continuityOverview:{plainLaneTitle:"普通 ccs 正在使用不同的续接通道",plainLaneDescription:"普通 ccs 当前会从 {{lane}} 续接,而不是这个账号通道。请先恢复原通道中的会话,再修改同步设置。",setDefaultHint:"如果希望以后普通 ccs 跟随某个账号,请使用该账号行上的“设为默认”。",recommendBadge:"建议 {{group}}",partialBadge:"部分同步 {{group}}",lane:{native:"原生 Claude(~/.claude)",accountDefault:"账号 {{name}}",accountInherited:"通过连续性继承使用账号 {{name}}",profileDefault:"默认配置 {{name}}(仍走原生 Claude 通道)"}},accountsTable:{name:"名称",type:"类型",defaultBadge:"默认",created:"创建时间",lastUsed:"最后使用",historySync:"历史同步",sharedResources:"资源",actions:"操作",syncTitle:"编辑同步模式、分组与连续性深度",resourcesTitle:"编辑共享资源继承",confirmLegacyTitle:"确认此旧账号的当前模式为显式",sync:"同步",confirm:"确认",active:"当前",setDefault:"设为默认",deleteAccount:"删除账号",cannotDeleteDefault:"不能删除默认账号",noAccounts:"未找到 CCS auth 账号。请使用 ccs auth create 添加。",resetToDefault:"恢复为 CCS 默认",deleteDialogTitle:"删除账号",deleteDialogDesc:"确定要删除账号「{{name}}」吗?将移除该配置及其所有会话数据,且无法撤销。",cancel:"取消",delete:"删除",sharedGroupStandard:"共享({{group}},标准)",sharedGroupDeeper:"共享({{group}},更深)",sharedGroupLegacy:"共享({{group}},标准旧策略)",isolatedLegacy:"隔离(旧默认)",isolated:"隔离",resourcesShared:"共享",resourcesProfileLocal:"配置本地",noSameGroupPeer:"同组中还没有其他账号",sameGroupPeerCount_one:"{{count}} 个同组账号",sameGroupPeerCount_other:"{{count}} 个同组账号",legacyReview:"请检查并确认这个推断出的默认状态。",noHandoff:"跨账号续接仍会回到原账号。",badges:{shared:"共享",deeper:"更深",legacy:"旧策略",isolated:"隔离",profileLocal:"本地"}},addAccountDialog:{title:"添加 {{displayName}} 账号",descKiro:"选择 Kiro 认证方式,然后通过浏览器或从 Kiro IDE 导入完成认证。",descDeviceCode:"点击认证后,验证码将显示,请在提供商网站输入。",descOauth:"点击认证获取 OAuth URL,在任意浏览器中打开即可登录。",powerUserEnabled:"已启用高级用户模式",powerUserSkipped:"设置 > 代理 中的高级用户模式会跳过 AGY 责任确认清单和 Gemini Dashboard 的风险短语。OAuth / 账号风险需自行承担。",powerUserLoadFailed:"加载高级用户模式设置失败。请检查“设置 > 代理”后重试。",powerUserLoading:"正在加载高级用户安全设置。请稍候后重试。",powerUserUnavailableRetry:"高级用户模式不可用。请完成当前提供商要求的安全步骤后重试。",authMethod:"认证方式",selectKiroAuthMethod:"选择 Kiro 认证方式",gitlabAuthMethod:"GitLab 认证方式",selectGitlabAuthMethod:"选择 GitLab 认证方式",gitlabAuthOAuth:"浏览器 OAuth",gitlabAuthPat:"个人访问令牌",gitlabAuthHint:"gitlab.com 推荐使用浏览器 OAuth;自托管或管理员管理场景可使用 PAT。",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"可选。留空表示 gitlab.com,或填写你的自托管 GitLab 基础 URL。",gitlabPat:"个人访问令牌",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"令牌至少需要包含",gitlabPatRequired:"PAT 登录需要提供 GitLab 个人访问令牌。",nicknameRequired:"昵称(必填)",nicknameOptional:"昵称(选填)",nicknamePlaceholder:"例如:工作、个人",nicknameRequiredHint:"该提供商必填。请使用唯一易记名称(如工作、个人)。",nicknameOptionalHint:"用于区分账号的友好名称。留空将自动生成安全标识。",waitingForAuth:"等待认证中...",deviceCodeHint:"验证码对话框即将出现,请在提供商网站输入验证码。",browserHint:"在浏览器中完成认证后,本对话框将自动关闭。",openUrlLabel:"在任意浏览器中打开此 URL 登录:",copied:"已复制",copy:"复制",open:"打开",popupBlocked:"弹窗被拦截。请复制上方 URL 在浏览器中手动打开。",redirectPasteLabel:"重定向未生效?请粘贴回调 URL:",callbackPlaceholder:"在此粘贴重定向 URL...",submitCallback:"提交回调",submitting:"提交中...",preparingUrl:"正在准备登录 URL...",cancel:"取消",importingToken:"正在从 Kiro IDE 导入令牌...",authenticate:"认证",importFromIde:"从 IDE 导入",importing:"导入中..."},flowViz:{backToProviders:"返回提供商",showDetails:"显示详情",hideDetails:"隐藏详情",showPausedAccounts:"显示已暂停 ({{count}})",hidePausedAccounts:"隐藏已暂停 ({{count}})",visibleTotalRequests:"可见请求数",visibleAccounts:"可见账号",excludingPausedAccounts:"已排除 {{count}} 个已暂停",resetLayout:"重置布局",provider:"提供商",totalRequests:"总请求数",accounts:"账号",connectionTimeline:"连接时间线",noRecentConnections:"暂无最近连接"},quickStats:{totalRequests:"总请求数",successRate:"成功率",totalTokens:"总 Token 数",activeModels:"活跃模型数"},authMonitor:{accounts:"账号",accountsCount:"{{count}} 个账号",success:"成功",failed:"失败",successRate:"成功率"},accountCard:{resumeAccount:"恢复账号",pauseAccount:"暂停账号",quotaLoading:"配额...",quota:"配额",quotaUnavailable:"配额限制不可用",reauthNeeded:"需要重新认证",failureLabelReauth:"重新认证",failureLabelWorkspace:"工作区",failureLabelNoAccess:"无权限",failureLabelRetry:"重试",failureLabelReconnect:"重新连接",failureLabelTemporary:"临时问题",failureLabelUnavailable:"不可用",failureHintReauth:"请重新运行该账号的认证流程以刷新访问权限。",failureHintWorkspace:"请将该账号移回可用的工作区,然后移除并重新添加。",failureHintNoAccess:"该账号无法访问提供商的配额接口。",failureHintRetry:"稍后再试一次。",failureHintReconnect:"请移除这个失效账号并重新认证。",failureHintTemporary:"这看起来是临时问题,请稍后重试。",removeAndReadd:"移除并重新添加账号",autoRefreshFailed:"自动刷新失败"},antigravityChecklist:{title:"Antigravity OAuth 责任须知",subtitle:"认证前请完成全部 4 步。",mandatory:"必读",completion:"完成度",stepsCount:"{{current}}/4 步"},accountSafetyWarning:{title:"OAuth 账号安全提示",subtitle:"Issue #509 · Gemini + AGY OAuth 风险",firstLine:"Issue #509 记录了与 ccs agy 及 ccs gemini 与 ccs agy 共享账号使用相关的封禁/停用报告。",secondLine:"仅在您愿意承担 OAuth 与账号访问风险的前提下继续。",issueLabel:"查看 issue #509",proxySettingsLabel:"Gemini + AGY 控制:设置 > 代理"},cliproxyDialog:{name:"名称",provider:"提供商",account:"账号",accountOptional:"账号(选填)",model:"模型",modelOptional:"模型(选填)",defaultTarget:"默认目标",defaultTier:"默认档位",tierConfig:"档位配置",selectProvider:"选择提供商...",useDefaultAccount:"使用默认账号",defaultSuffix:"(默认)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"取消",create:"创建",creating:"创建中...",saveChanges:"保存更改",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"编辑复合变体:{{name}}",editSingleTitle:"编辑单一样式:{{name}}"},profileEditor:{profileInfo:"配置信息",profileName:"配置名称",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",runWithProfile:"使用配置运行",runOnDroid:"在 Droid 上运行",runOnDroidWithFlag:"通过 --target 在 Droid 上运行",droidAliasExplicit:"Droid 别名(显式)",overrideToClaude:"切换为 Claude",overrideToClaudeExplicit:"切换为 Claude(显式)",targetHintPreferredAlias:"推荐显式别名:",targetHintClaudeDefault:"默认命令:",targetHintLegacyAlias:"旧快捷方式仍可用:",targetHintOverride:"你仍可在每次运行时用",setAsDefault:"设为默认",provider:"提供商",custom:"自定义",providerChooserHint:"先选择一个预设,之后仍可调整 URL、API key 和模型映射。",featuredProviders:"精选提供商",scrollHint:"屏幕较窄时可横向滚动",customEndpoint:"自定义端点",morePresets:"更多预设",customEndpointDescription:"从空白的 Anthropic 兼容 URL 开始,手动配置全部内容。"},settings:{sectionLoadFailed:"加载分区失败",unknownError:"发生未知错误",reloadPage:"重新加载页面",refresh:"刷新",copy:"复制",copied:"已复制",saved:"已保存",loading:"加载中...",configFileNotFound:"未找到配置文件"},settingsTabs:{browser:"浏览器",web:"网页",image:"图片",channels:"频道",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份"},settingsAuth:{failedFetchTokens:"获取认证令牌失败",failedSaveTokens:"保存令牌失败",tokensUpdated:"令牌已更新,请重启 CLIProxy 生效。",failedRegenerate:"重新生成密钥失败",secretRegenerated:"新的管理密钥已生成,请重启 CLIProxy 生效。",failedReset:"重置令牌失败",tokensReset:"令牌已重置为默认值,请重启 CLIProxy 生效。",description:"配置 CLIProxy 认证令牌。修改后需要重启 CLIProxy。",apiKey:"API Key",custom:"自定义",apiKeyDesc:"Claude Code 通过该值向 CLIProxy 鉴权",apiKeyPlaceholder:"API key",managementSecret:"管理密钥",managementSecretDesc:"CCS Dashboard 使用该值访问 CLIProxy 管理接口",managementSecretPlaceholder:"管理密钥",generateSecret:"生成新的安全密钥",resetDefaults:"重置为默认值",resetDesc:"将 API key 和管理密钥都恢复为默认值。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"向所有非 Claude 订阅型配置注入环境变量(gemini、codex、agy、ghcp 等)",enabled:"全局环境变量已启用",disabled:"全局环境变量已禁用",enabledDesc:"环境变量将注入第三方配置",disabledDesc:"环境变量不会被注入",envVars:"环境变量",noneConfigured:"尚未配置环境变量",addNew:"新增变量",keyName:"KEY_NAME",value:"value",add:"添加",quickAdd:"快速添加常用变量",allConfigured:"常用变量已全部配置"},settingsBackups:{failedFetch:"获取备份失败",failedRestore:"恢复备份失败",restoreSuccess:"备份恢复成功",title:"设置备份",description:"恢复 settings.json 的历史版本。每次修改设置时会自动创建备份。",none:"暂无备份",noneHint:"修改设置后,备份会显示在这里",latest:"最新",restoring:"恢复中...",restore:"恢复",restoreConfirmTitle:"确认恢复备份?",restoreConfirmPrefix:"这将用以下备份替换当前设置:",restoreConfirmSuffix:"此操作不可撤销。",cancel:"取消"},settingsWebsearch:{description:"面向第三方配置(gemini、codex、agy 等)的 CLI 网页搜索",enabled:"WebSearch 已启用",disabled:"WebSearch 已禁用",checking:"正在检查状态...",providers:"提供商",noneConfigured:"未配置任何提供商",noneConfiguredHint:"请先安装 CLI 工具以启用网页搜索提供商",checkProviders:"检查可用提供商",installed:"已安装",notInstalled:"未安装",model:"模型:",howInstall:"如何安装 {{name}} CLI",installGlobally:"全局安装",requiresKey:"(需要 xAI API key)",freeTier:"(提供免费额度)",viewDocs:"查看文档"},settingsProxy:{failedLoadAgyMode:"加载高级模式失败",failedUpdateAgyMode:"更新高级模式失败",failedVerifyAgyMode:"校验高级模式持久化失败",notPersistedAgyMode:"高级模式未成功持久化,配置可能被其他进程修改。",agyModeEnabled:"高级模式已启用。",agyModeDisabled:"高级模式已关闭。",typePhraseToContinue:"请输入“{{value}}”后继续。",description:"为基于代理的配置设置本地或远程 {{backend}} 连接",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"实例状态",connectionMode:"连接模式",local:"本地",remote:"远程",localDesc:"在本机运行 {{backend}} 二进制",remoteDesc:"连接到远程 {{backend}} 服务器",backendBinary:"后端二进制",stopProxyToSwitch:"请先在实例状态中停止正在运行的代理,再切换后端。",default:"默认",plusDesc:"额外提供商的可选线路。仍受支持,但目前由社区维护而非上游维护。",originalDesc:"核心提供商线路的默认、始终可用后端。",plusFallbackNotice:"Plus 提供商线路并未弃用,但在受维护的 fork 恢复之前,本地 CLIProxy 仍会回退到原始后端。",variantsIncompatible:"现有 plus 扩展变体({{providers}})无法在原始后端上运行。可以保留作参考,但使用前请切换到 Plus。",safety:"安全",agyModeTitle:"Antigravity + Gemini 高级模式",agyModeDesc:"跳过 AGY 责任确认清单,以及 Gemini Dashboard 中输入风险短语的步骤。",agyWarning:"仅在你充分理解 OAuth 封禁风险模式(#509)后使用。CCS 不对账号损失承担责任。",finalConfirm:"需要最终确认",finalConfirmDesc:"启用后会跳过 Dashboard / CLI 中的 AGY 安全检查,以及 Gemini Dashboard 的风险短语确认。请先阅读 issue #509,并输入精确短语后继续。",step1:"步骤 1",readIssue:"阅读 issue #509",step2:"步骤 2",typePrefix:"输入",typeSuffix:"以启用。",typePhraseAria:"输入 I ACCEPT RISK 以启用 Antigravity + Gemini 高级模式",exactPhrase:"必须输入完全一致的短语。",enableAgyMode:"启用 Antigravity + Gemini 高级模式",toggleAgyMode:"切换 Antigravity + Gemini 高级模式",fallbackSettings:"回退设置",enableFallback:"启用本地回退",enableFallbackDesc:"远程不可达时使用本地代理",autoStartLocal:"自动启动本地代理",autoStartLocalDesc:"发生回退时自动启动本地代理",advanced:"高级",debugMode:"调试模式",debugModeDesc:"在浏览器控制台输出开发诊断信息",debugModeEnabled:"调试模式已开启,请在浏览器控制台查看详细日志。",localProxy:"本地代理",port:"端口",autoStart:"自动启动",localAutoStartDesc:"需要时自动启动本地代理",remoteConfigTitle:"远程服务器配置",host:"主机",hostPlaceholder:"192.168.1.100 或 proxy.example.com",defaultPort:"默认:{{value}}",portPlaceholder:"留空使用 {{value}}",protocol:"协议",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"用于 /v1/* API 接口",apiKeyDesc:"用于 /v1/chat/completions 接口请求",managementKeyOptional:"管理密钥(可选)",managementKeyPlaceholder:"用于 /v0/management/* 接口",managementKeyDesc:"用于 Dashboard 管理接口。未设置时回退使用 API Key。",testing:"测试中...",testConnection:"测试连接",connectedLatency:"已连接({{value}}ms)",connectionFailed:"连接失败",invalidPortOrEmpty:"端口必须是 1 到 65535 的整数,或留空使用默认值",invalidLocalPort:"本地端口必须是 1 到 65535 的整数",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"为支持的模型配置扩展思考/推理。",supportedProviders:"支持的提供商",modeTitle:"思考模式",modeAutoDesc:"根据模型档位自动设置思考级别",modeOffDesc:"关闭扩展思考",modeManualDesc:"设置持久覆盖级别,或按次使用 CLI 参数",tierDefaults:"档位默认值",tierDefaultsDesc:"自动模式下各模型档位的默认思考级别。",persistentOverride:"持久覆盖",persistentOverrideDesc:"应用到所有会话。CLI 参数仍具有更高优先级。",enterCustomBudget:"输入自定义预算",apply:"应用",providerOverrides:"提供商覆盖({{count}})",providerOverridesDesc:"为特定提供商覆盖档位默认值。可按需添加自定义提供商键。",addProviderPlaceholder:"添加提供商键(例如 qwen)",showWarnings:"显示告警",showWarningsDesc:"当思考值被限制或调整时显示告警",cliEnvOverride:"CLI 与环境变量覆盖",supportLine1Prefix:"思考预算:",supportLine1Suffix:"(基于 token)",supportLine2Prefix:"推理强度:",supportLine2SuffixPrefix:"(后缀或 ",supportLine2SuffixPostfix:":minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex 后缀会固定强度(例如 ",supportLine3Suffix:");无后缀模型使用 Thinking mode。"},analytics:{title:"分析",noDailyUsage:"今日无使用数据",noUsageData:"无可用使用数据",subtitle:"追踪使用情况与洞察",month:"本月",allTime:"全部时间",updated:"更新于 {{value}}"},analyticsSummary:{totalTokens:"总 Token",totalTokensSubtitle:"输入 {{input}} / 输出 {{output}}",totalCost:"总成本",totalCostSubtitle:"日均 ${{value}}",cacheTokens:"缓存 Token",cacheTokensSubtitle:"${{cost}}(占成本 {{percent}}%)",inputCost:"输入成本",outputCost:"输出成本",tokensSubtitle:"{{value}} 个 token"},apiProfiles:{title:"API 配置",sidebarTitle:"API 配置",sidebarSubtitle:"高级 API、本地运行时、自定义端点",new:"新建",searchPlaceholder:"搜索配置...",loadingProfiles:"正在加载配置...",failedLoadTitle:"加载配置失败",failedLoadDesc:"无法获取 API 配置,请稍后重试。",retry:"重试",noProfilesYet:"还没有 API 配置",noProfilesDesc:"创建你的第一个配置以连接自定义 API 端点",createProfile:"创建配置",noProfileMatch:"没有匹配“{{query}}”的配置",profileCount:"{{count}} 个配置",profileCount_other:"{{count}} 个配置",configuredCount:"{{count}} 个已配置",deleteProfileTitle:"删除配置",deleteProfileDesc:"确定要删除“{{name}}”吗?这会移除设置文件且无法恢复。",delete:"删除",unsavedChangesTitle:"未保存的更改",unsavedChangesDesc:"你在“{{current}}”中有未保存内容,是否丢弃并切换到“{{next}}”?",discardSwitch:"丢弃并切换",noOrphansFound:"未发现孤立配置",confirmRegisterOrphans:"发现 {{total}} 个孤立配置文件,其中 {{valid}} 个可直接注册。现在注册吗?",registeredWithSkipped:"(跳过 {{count}} 个)",registeredProfiles:"已注册 {{count}} 个配置",copyPrompt:"将“{{name}}”复制为哪个新配置名称?",destinationEmpty:"目标配置名称不能为空",exportRedacted:"导出内容中的令牌已脱敏。如需包含密钥,请改用 CLI 的 include-secrets 流程。",exportDownloaded:"配置导出已下载",importFailed:"导入配置包失败",discoverOrphans:"发现孤立配置",importProfileBundle:"导入配置包"},accountsPage:{title:"账号",managePrefix:"统一管理",manageSuffix:"账号与池化接入流程。",mobileManageSuffix:"的连续性配置。",primaryActions:"主要操作",createAccount:"创建账号",authClaudeInPool:"在 Pool 中认证 Claude",openClaudePoolSettings:"打开 Claude Pool 设置",openCliProxyClaudePool:"打开 CLIProxy Claude Pool",migrationFollowup:"迁移后续处理",legacyContextPending:"{{count}} 个账号仍需首次模式确认。",legacyContextPending_other:"{{count}} 个账号仍需首次模式确认。",legacyContinuityPending:"{{count}} 个共享账号仍处于标准旧版连续性深度。",legacyContinuityPending_other:"{{count}} 个共享账号仍处于标准旧版连续性深度。",confirmingLegacy:"正在确认旧版策略...",confirmLegacy:"确认旧版策略({{count}})",noLegacyFollowup:"暂无待处理的迁移后续项。",continuityGuide:"连续性指南",expandWhenNeeded:"按需展开查看。",sharedStandard:"共享标准",sharedStandardDesc:"仅同步项目工作区。适合大多数团队。",sharedDeeper:"共享更深",sharedDeeperDesc:"会额外同步 session-env、file-history、shell-snapshots 和 todos。适合需要跨账号续接的场景。",sharedDeeperPrefix:"额外包含",isolated:"隔离",isolatedDesc:"不建立链接。适合严格隔离场景。",quickCommands:"快捷命令",quickCommandsDesc:"复制后在终端运行。",workspaceBadge:"ccs auth 工作区",historySyncBadge:"历史同步控制",resourcesBadge:"共享资源控制",resourcesShared:"共享",resourcesProfileLocal:"配置本地",authAccounts:"认证账号",tableScopePrefix:"该表仅展示",tableScopeMiddle:"账号。模式/分组/深度调整请使用",tableScopeSuffix:"。",accountMatrix:"账号矩阵",sharedTotalDesc:"共享总数:{{count}}。可执行 Sync 设置和旧版确认操作。",loadingAccounts:"正在加载账号..."},health:{justNow:"刚刚",secondsAgo:"{{count}} 秒前",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",systemHealth:"系统健康",build:"构建 {{version}}",lastScan:"上次扫描:",autoRefresh:"自动刷新:",refresh:"刷新",checks:"检查项",version:"版本",platform:"平台",liveMonitoring:"实时监控已启用",copied:"已复制到剪贴板",refreshing:"正在刷新健康检查...",fix:"修复",applyFix:"应用修复",healthLabel:"健康"},updates:{actionRequired:"待处理",done:"已完成",all:"全部",inboxTitle:"更新中心",inboxSubtitle:"先处理操作,再将更新标记为完成或忽略。",needsAction:"需处理",doneCount:"已完成",searchPlaceholder:"搜索操作或命令",noNotices:"当前视图下没有通知。",noUpdates:"暂无更新。",published:"发布于 {{date}}",markDone:"标记完成",dismiss:"忽略",reopen:"重新打开",doNext:"下一步",impactedIntegrations:"受影响的集成",impactedDesc:"根据更新范围与路由匹配的相关区域。",whyMatters:"为什么重要",whyMattersDesc:"仅保留简要背景,不展示冗长发布说明。",open:"打开",progressNeedsAction:"需处理",progressInReview:"审阅中",progressDone:"已完成",progressDismissed:"已忽略",statusNew:"新",statusStable:"稳定",statusPlanned:"计划中",dashboard:"Dashboard",cliUsage:"CLI 用法"},cliproxyPage:{connected:"已连接",notConnected:"未连接",variant:"变体",parentNotConnected:"上游未连接",viaProvider:"通过 {{provider}}",emptyTitle:"CCS 配置管理",emptyDesc:"管理 CLIProxy 提供商的 OAuth 认证、账号偏好与模型选择,配置 CCS 的请求路由。",emptyControlPanelPrefix:"如需查看实时用量和监控,请前往",controlPanel:"控制面板",quickSetup:"快速设置",addAccount:"添加账号",advancedVariant:"高级变体",setupActionsHint:"在这里添加账号。只有需要单独运行时/配置档时才创建变体。",accountManagement:"CCS 级账号管理",providers:"提供商",variants:"变体",providerCount:"{{count}} 个提供商",providerCount_other:"{{count}} 个提供商",connectedCount:"{{count}} 个已连接",variantDisplay:"{{name}}({{provider}} 变体)"},copilotPage:{title:"Copilot",subtitle:"已弃用的 GitHub Copilot 兼容桥接",deprecatedBadge:"已弃用",deprecationTitle:"已弃用的兼容桥接",deprecationItem1:"GitHub Copilot 用量计费将于 2026 年 6 月 1 日开始",deprecationItem2:"现有本地配置仍可作为兼容路径继续使用",deprecationItem3:"新的配置请优先使用 Codex 或其他活跃提供商",setup:"安装",auth:"认证",daemon:"守护进程",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向接口,可能随时失效",unofficialItem2:"过度使用可能触发账号限制",unofficialItem3:"CCS 不提供担保,也不承担责任",yes:"是",no:"否",installed:"已安装",missing:"缺失",integration:"集成",enabled:"已启用",disabled:"已禁用",github:"GitHub",connected:"已连接",notConnected:"未连接",authenticate:"去认证",authenticating:"认证中...",status:"状态",running:"运行中",stopped:"已停止",port:"端口",stopping:"停止中...",stop:"停止",starting:"启动中...",start:"启动",installing:"安装中...",installCopilotApi:"安装 copilot-api",proxy:"代理",active:"活跃",inactive:"未激活"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"已弃用",subtitle:"面向旧版 Cursor 使用场景的已弃用本地桥接",unofficialTitle:"旧版桥接已弃用,优先使用 CLIProxy 支持的 Cursor",unofficialItem1:"推荐路径:使用 CLIProxy 管理 Cursor 认证与账号",unofficialItem2:"这个逆向本地桥接仅为仍在使用旧流程的用户保留",unofficialItem3:"CCS 不为这个旧路径提供担保,也不承担责任",supportedPathTitle:"推荐路径",supportedPathDesc:"新的配置请使用 CLIProxy 支持的 Cursor 认证与账号管理。只有在你仍依赖旧的本地守护进程流程时,才继续使用下方旧版桥接。",startCliproxyAuth:"启动 CLIProxy Cursor 认证",openCliproxyCursor:"打开 CLIProxy Cursor",integration:"集成",authentication:"认证",daemon:"守护进程",enabled:"已启用",disabled:"已禁用",expired:"已过期",connected:"已连接",notConnected:"未连接",running:"运行中",stopped:"已停止",actions:"旧版操作",disableIntegration:"禁用集成",enableIntegration:"启用集成",autoDetectAuth:"旧版 IDE 自动检测",manualAuthImport:"旧版手动导入",stopDaemon:"停止守护进程",startDaemon:"启动守护进程",port:"端口",configuration:"Cursor 配置",lastModified:"最后修改:",neverSaved:"从未保存",saving:"保存中...",save:"保存",modelConfig:"模型配置",settings:"设置",info:"信息",presets:"预设",presetsDesc:"应用预设模型映射",modelMapping:"模型映射",modelMappingDesc:"为不同档位配置使用模型",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用。",opusModel:"Opus(最强)",opusModelDesc:"复杂推理与最高质量输出。",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"日常编码和通用对话。",haikuModel:"Haiku(快速)",haikuModelDesc:"低延迟与轻量请求。",runtimeSettings:"运行时设置",autoStartDaemon:"自动启动守护进程",autoStartDesc:"在使用集成时自动启动 Cursor 守护进程。",ghostMode:"Ghost 模式",ghostModeDesc:"请求时附带 x-ghost-mode 以减少遥测。",provider:"提供商",filePath:"文件路径",availableModels:"可用模型",loadingModels:"加载模型中...",noModels:"暂无模型元数据,请先启动守护进程后刷新。",default:"默认",rawConfiguration:"原始配置(JSON)",manualImportTitle:"手动导入 Cursor 认证",manualImportDesc:"若无法自动检测,请提供 Cursor access token 与 machine ID。",accessToken:"访问令牌",accessTokenPlaceholder:"粘贴 Cursor access token",machineId:"机器 ID",machineIdPlaceholder:"32 位十六进制(无连字符 UUID)",cancel:"取消",import:"导入",selectModel:"选择模型",useDefaultModel:"使用默认模型",availableModelCount:"可用模型({{count}})",invalidPort:"端口必须是 1 到 65535 之间的整数",defaultModelRequired:"默认模型必填",savedConfig:"Cursor 配置与模型映射已保存",failedSaveConfig:"保存配置失败",modelsLoadingWait:"模型仍在加载中,请稍后再应用预设。",noModelsAvailable:"暂无可用模型,请先启动守护进程并刷新。",appliedCodexPreset:"已应用 GPT-5.3 Codex 预设",appliedClaudePreset:"已应用 Claude 4.6 预设",appliedGeminiPreset:"已应用 Gemini 3 预设",integrationEnabled:"Cursor 集成已启用",integrationDisabled:"Cursor 集成已禁用",failedUpdateIntegration:"更新集成状态失败",credentialsImported:"Cursor 凭据已导入",autoDetectFailed:"自动检测失败",manualRequired:"Token 和 machine ID 为必填项",manualImportFailed:"手动导入失败",failedStartDaemon:"启动守护进程失败",daemonStarted:"守护进程已启动",daemonStartedWithPid:"守护进程已启动(PID: {{pid}})",failedStopDaemon:"停止守护进程失败",daemonStopped:"守护进程已停止",rawLoading:"原始设置仍在加载,请稍后重试。",invalidJson:"JSON 无效",rawSaved:"原始设置已保存",rawChanged:"原始设置已被外部修改,请刷新后重试。",failedSaveRaw:"保存原始设置失败",savedAll:"Cursor 配置已保存",liveProbe:"实时探测",runLiveProbe:"运行实时探测",rerunLiveProbe:"重新运行实时探测",probing:"正在运行探测...",probeNotRun:"尚未运行探测",probeLocalReadinessHint:"本地就绪检查可能通过,但实时运行链路仍可能失败。请使用实时探测验证完整的 Cursor 路径。",probeStage:"阶段",probeHttpStatus:"HTTP 状态",probeDuration:"耗时",probeModel:"模型",probeMessage:"消息",probeSucceeded:"探测成功",probeFailed:"探测失败",probeSaveFirst:"请先保存或放弃 Cursor 更改,再运行实时探测",refreshStatus:"刷新 Cursor 状态",refreshConfiguration:"刷新 Cursor 配置"},droidPage:{loadingDiagnostics:"加载 Droid 诊断中...",failedDiagnostics:"加载 Droid 诊断失败。",overview:"概览",byok:"BYOK",docs:"文档",runtimeInstall:"运行时与安装",status:"状态",detected:"已检测",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",version:"版本",overridePath:"覆盖路径(CCS_DROID_PATH)",configFiles:"配置文件",path:"路径",resolved:"解析结果",size:"大小",lastModified:"最后修改",parseWarning:"解析告警:{{value}}",readWarning:"读取告警:{{value}}",warnings:"告警",byokSummary:"BYOK 概览",activeModelSelector:"当前模型选择器",customModels:"自定义模型",ccsManaged:"CCS 管理",userManaged:"用户管理",malformedEntries:"异常条目",providers:"提供商",none:"无",customModelsTitle:"自定义模型",modelName:"名称 / 模型",provider:"提供商",baseUrl:"Base URL",noCustomModels:"没有自定义模型",docsAlignedNotes:"文档对齐说明",factoryDocs:"Factory 文档",providerFactCheckDocs:"Provider 校验文档",providerValues:"Provider 值:{{value}}",settingsHierarchy:"Settings 层级:{{value}}",settingsTitle:"Droid BYOK 设置",fixJsonBeforeQuickSettings:"请先修复 JSON 语法,再使用快速设置。",fixJsonBeforeReasoning:"请先修复 JSON 语法,再更新 BYOK 推理设置。",unableUpdateReasoning:"无法更新所选 BYOK 模型的推理设置。",fixJsonBeforeBudget:"请先修复 JSON 语法,再更新思考预算。",anthropicOnlyBudget:"思考预算仅适用于 Anthropic BYOK 模型。",invalidJson:"JSON 无效:{{value}}",saved:"Droid 设置已保存",changedExternally:"Droid 设置已被外部修改,请刷新后重试。",failedSave:"保存 Droid 设置失败"},sharedPage:{commands:"命令",skills:"技能",agents:"代理",plugins:"插件",settings:"设置",title:"共享资源",subtitle:"在账号之间共享的命令、技能、代理、插件和配置",totalShared:"共享总数",visible:"可见",markdownDetail:"Markdown 详情视图",registryDetail:"注册表详情视图",maskedSettingsDetail:"脱敏设置视图",filterPrefix:"筛选:",configurationRequired:"需要配置",countsUnavailable:"统计不可用",retryCounts:"重试统计",filterPlaceholder:"按名称、描述或路径筛选 {{tab}}",showing:"显示 {{visible}} / {{total}} 个{{tab}}",showingQuery:"(关键字“{{query}}”)",refreshing:"(刷新中...)",loadingShared:"正在加载共享{{tab}}...",failedLoadShared:"加载共享{{tab}}失败",retry:"重试",noSharedFound:"未找到共享{{tab}}。请运行 `ccs sync` 或在共享目录添加内容。",noPluginsFound:"未安装共享插件。真实插件存在前,插件注册表文件和缓存文件夹会保持隐藏。",noMatch:"没有匹配“{{query}}”的{{tab}}。",selectOne:"选择一个{{tab}}查看完整内容。",pathLabel:"路径",resolvedSource:"解析后来源",loadingMarkdown:"正在加载 Markdown 内容...",loadingSettings:"正在加载设置内容...",failedLoadContent:"加载内容失败",retryContent:"重试内容加载",noMarkdown:"暂无 Markdown 内容。",settingsTitle:"settings.json",settingsDescription:"此文件包含所有 shared 模式账号链接使用的共享设置。",settingsPath:"共享设置路径",settingsActive:"已启用",settingsInactive:"未找到",resourcePolicies:"资源策略",resourcePoliciesDescription:"标记为 shared 的账号继承此中心。profile-local 账号保留单独的命令、技能、代理、插件和设置。",sharedAccounts:"{{count}} 个 shared",profileLocalAccounts:"{{count}} 个 profile-local",moreProfileLocalAccounts:"+{{count}} 个更多"},editAccountSharedResources:{title:"编辑共享资源",description:"配置「{{name}}」如何从 CCS 共享目录继承命令、技能与设置。",resourceMode:"资源模式",selectResourceMode:"选择资源模式",sharedOption:"共享",sharedHint:"从共享目录继承命令、技能与代理。",profileLocalOption:"配置本地",profileLocalHint:"使用该账号私有目录中的隔离资源。",implicationTitle:"保存后会发生什么",sharedImplication:"此账号将看到共享资源中心内的所有工具与配置。",profileLocalImplication:"此账号不会看到共享工具,并出于安全或测试目的保持完全隔离。",cancel:"取消",save:"保存",saving:"保存中..."},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},hubFooter:{logs:"日志",settings:"设置",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"切换主题"},ccsLogo:{alt:"CCS Logo",text:"CCS Config"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"显示敏感值",maskSensitive:"隐藏敏感值",valid:"有效的 {{language}}",readOnly:"(只读)"},commandBuilder:{title:"命令构建器",searchPlaceholder:"输入或选择命令...",copy:"复制",run:"运行",cmdConfig:"打开配置界面",cmdCreateProfile:"创建新配置",cmdSwitchProfile:"切换到指定配置",cmdDoctor:"检查系统健康",cmdListProviders:"列出可用 CLIProxy 提供商",cmdAddProvider:"添加 CLIProxy 提供商"},confirmDialog:{confirm:"确认",cancel:"取消"},connectionIndicator:{connected:"已连接",connecting:"连接中...",disconnected:"已断开",reconnecting:"重新连接中..."},docsLink:{title:"查看文档"},githubLink:{title:"在 GitHub 上报告问题"},globalEnvIndicator:{injectedCount_one:"{{count}} 个全局环境变量将在运行时注入",injectedCount_other:"{{count}} 个全局环境变量将在运行时注入",overriddenCount:"({{count}} 个已被配置覆盖)",skippedLabel:"已跳过(配置中已定义):",configureInSettings:"在设置中配置"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"远程控制台当前为只读,因为此 CCS 实例未启用控制台认证。请在 CCS 主机上重新启用;Docker 部署需要在运行中的容器内完成。",remoteReadonlyAuthDisabledShort:"远程控制台为只读,直到此 CCS 实例重新启用控制台认证。",remoteReadonlySetupLong:"远程控制台为只读,直到为此 CCS 实例运行 ccs config auth setup。Docker 部署必须在容器内运行该命令。",remoteReadonlySetupShort:"远程控制台为只读,直到为此 CCS 实例完成认证配置。",localLong:"本控制台在本地运行,所有数据保留在本机。",localShort:"本地控制台 - 数据保留在本机。",dismiss:"关闭提示"},privacyToggle:{modeOn:"隐私模式已开启 - 点击显示数据",modeOff:"隐私模式已关闭 - 点击隐藏数据"},projectSelectionDialog:{title:"选择 Google Cloud 项目",description:"选择用于 {{provider}} 认证的项目。",autoSelectCountdown:"({{count}} 秒后自动选择默认值)",default:"默认",allProjects:"全部项目",allProjectsDescription:"接入全部 {{count}} 个已列出的项目",useDefault:"使用默认值",selecting:"选择中...",confirmSelection:"确认选择",codeCopied:"验证码已复制",copyVerificationCode:"复制验证码"},quickCommands:{title:"快捷命令",startDefault:"启动默认",startDefaultDesc:"使用默认配置启动 Claude",glmProfile:"GLM 配置",glmProfileDesc:"切换到 GLM 模型",healthCheck:"健康检查",healthCheckDesc:"运行系统诊断",delegateTask:"委托任务",delegateTaskDesc:"委托到 GLM 配置"},quotaTooltip:{loadingQuota:"加载配额中...",failedLoadQuota:"加载配额失败",modelQuotas:"模型配额:",rateLimits:"速率限制:",plan:"计划:{{plan}}",quotaSnapshots:"配额快照:",unlimited:"无限制",remaining:"剩余 {{remaining}}/{{entitlement}}",tier:"档位",tierId:"档位 ID",state:"状态",credits:"额度",modelQuotasLower:"模型配额:",allBucketsReport:"所有桶报告 {{tokenType}}",requestsRemaining:"剩余 {{count}} 次请求",inputTokensRemaining:"剩余 {{count}} 个输入 token",outputTokensRemaining:"剩余 {{count}} 个输出 token",amountRemaining:"剩余 {{count}}",fiveHourLimit:"5 小时用量限制",weeklyLimit:"每周用量限制",weeklyOpus:"每周用量(Opus)",weeklySonnet:"每周用量(Sonnet)",weeklyOAuthApps:"每周用量(OAuth 应用)",weeklyCowork:"每周用量(Cowork)",extraUsage:"额外用量",premiumInteractions:"高级交互次数",chat:"对话",completions:"补全",resets:"重置于 {{time}}",fiveHourResets:"5 小时重置于 {{time}}",weeklyResets:"每周重置于 {{time}}"},utils:{codeReview5h:"代码审查(5 小时)",codeReviewWeekly:"代码审查(每周)",codeReview:"代码审查",codexAdditional5h:"{{name}}(5 小时)",codexAdditionalWeekly:"{{name}}(每周)",codexAdditional:"{{name}}"},sponsorButton:{title:"在 GitHub 上赞助此项目",sponsor:"赞助"},valueMetrics:{apiCostSaved:"API 成本节省",tokensSaved:"Token 节省",queriesFaster:"查询加速",errorsReduced:"错误减少",vsLastMonth:"对比上月",throughCaching:"通过缓存",averageSpeedup:"平均加速",withRetryLogic:"通过重试逻辑",performanceMetrics:"性能指标",monthlySummary:"月度概览",totalSaved:"总节省",tokensProcessed:"处理 Token 数",queriesHandled:"处理请求数",uptime:"正常运行时间"},updatesSpotlight:{openUpdatesCenter:"打开更新中心"},deviceCodeDialog:{authorize:"授权 {{provider}}",enterCodeAtPage:"在授权页面输入下方验证码。",expiresIn:"({{time}} 后过期)",codeExpired:"(验证码已过期)",copied:"已复制!",copyCode:"复制验证码",waitingForAuth:"等待授权中...",openVerificationPage:"打开验证页面",openProviderPage:"打开 {{provider}}",copyCodeAria:"复制验证码",codeCopiedAria:"验证码已复制"},settingsDialog:{editProfile:"编辑配置:{{name}}",description:"为此配置设置环境变量和其他设置。",loadingSettings:"加载设置中...",envTab:"环境变量",rawJsonTab:"原始 JSON",generalTab:"常规",noEnvVars:"尚未配置环境变量。",noEnvVarsHint:"在 settings.json 文件中添加变量。",loadingEditor:"加载编辑器中...",profileInfo:"配置信息",profileInfoDesc:"此配置文件的详细信息。",path:"路径",lastModified:"最后修改",cancel:"取消",saving:"保存中...",saveChanges:"保存更改",conflictTitle:"文件被外部修改",conflictDesc:"此设置文件已被其他进程修改。用你的更改覆盖还是丢弃?",overwrite:"覆盖",invalidJson:"JSON 无效",failedSave:"保存失败"},setupWizard:{title:"高级变体设置",stepProviderDesc:"为运行时变体选择提供商",stepAuthDesc:"完成提供商认证",stepAccountDesc:"选择要使用的账号",stepVariantDesc:"可选:创建自定义运行时变体",stepSuccessDesc:"设置完成!",authStep:{authenticateWith:"通过 {{provider}} 认证以添加账号",authenticating:"认证中...",authenticateInBrowser:"在浏览器中认证",completeOAuth:"在浏览器中完成 OAuth 流程...",orUseTerminal:"或使用终端",runCommandHint:"在终端中运行此命令:",back:"返回",checking:"检查中...",refreshStatus:"刷新状态"},accountStep:{selectAccount:"选择账号({{count}})",defaultAccount:"默认账号",or:"或",addNewAccount:"添加新账号",addNewAccountDesc:"使用其他账号认证",back:"返回"},variantStep:{back:"返回",skip:"跳过"},successStep:{title:"变体已创建!",subtitle:"你的自定义变体已准备就绪",usage:"用法:",done:"完成"}},accountSurfaceCard:{business:"企业",free:"免费",personal:"个人",variant:"变体"},accountIdentity:{business:"企业",personal:"个人",free:"免费",team:"团队",plus:"Plus",pro:"Pro",workspace:"工作区 {{id}}"},accountCardStats:{notUsedYet:"尚未使用"},accountQuotaPanel:{weekly:"每周",loadingQuota:"加载配额中..."},userMenu:{signedInAs:"已登录为 {{username}}"},authMonitorLive:{live:"实时",accountMonitor:"账号监控",updated:"更新于 {{time}}",updatedNow:"刚刚更新",requestsLabel:"请求",stats:"统计",successRate:"成功率",missingProjectId:"缺少项目 ID",noActivity:"无活动"},providerCard:{missingProjectIdAria:"缺少项目 ID"},loginPage:{showPassword:"显示密码",hidePassword:"隐藏密码"},cliproxyStatsOverview:{sessionStatistics:"会话统计",realTimeMetrics:"来自 {{backend}} 的实时使用指标",offline:"离线",running:"运行中",noActiveSession:"无活跃会话",noActiveSessionHint:"使用 ccs gemini、ccs codex 或 ccs agy 启动 CLIProxy 会话后即可查看实时统计。",failedLoadStats:"加载统计数据失败",totalRequests:"总请求数",successCount:"{{count}} 次成功",successRate:"成功率",totalTokens:"总 Token 数",estimatedCost:"预估 ${{cost}}",modelsUsed:"使用模型数",modelUsageDistribution:"模型使用分布",requestCount:"{{count}} 次请求"},cliproxyTable:{name:"名称",provider:"提供商",model:"模型",account:"账号",status:"状态",default:"默认",actions:"操作"},cliproxyTabs:{overview:"概览",variants:"变体",aiProviders:"AI 提供商",controlPanel:"控制面板"},cliproxyHeader:{ccsLevelAccountManagement:"CCS 级账号管理",cliproxyNotAvailable:"CLIProxy 不可用",cliproxyControlPanel:"CLIProxy 控制面板",noVariants:"未找到 CLIProxy 变体。",addAccountToStart:"添加账号以开始"},routingGuidance:{roundRobin:"轮询模式均匀分配用量。",fillFirst:"优先填满模式让备用账号保持冷启动直到需要时。",routingStrategy:"路由策略",optionalRouting:"可选路由",sessionAffinity:"会话粘性",sessionAffinityOn:"开启",sessionAffinityOff:"关闭",sessionAffinityEnabled:"已启用",sessionAffinityDisabled:"已禁用",enableSessionAffinity:"启用会话粘性",disableSessionAffinity:"禁用会话粘性",sessionAffinityUnavailable:"会话粘性不可用",localOnly:"仅本地",localOnlySetting:"仅限本地设置",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"尽量将同一对话固定到同一个账号。CLIProxy 会优先使用客户端显式提供的会话或线程标识;如果没有,再回退到请求元数据或开场提示历史来推断稳定键。",sessionRecognitionTitle:"会话识别",sessionRecognitionDescription:"CCS 不承诺所有后端都使用同一优先级顺序。通常上游会优先使用显式会话或线程 ID,然后回退到元数据字段,最后再回退到基于开场提示历史的哈希。"},extendedContext:{extendedContext:"扩展上下文"},cliproxyConfig:{unsavedChanges:"未保存的更改",original:"原始值",modified:"已修改",reviewChanges:"查看更改",loadingEditor:"加载编辑器中..."},providerEditor:{provider:"提供商",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",modelMapping:"模型映射",status:"状态",loadingSettings:"加载设置中...",loadingEditor:"加载编辑器中...",accounts:"账号",addAccount:"添加账号",noAccountsConnected:"未连接账号",addAccountToStart:"添加账号以开始",gcpProjectIdReadonly:"GCP 项目 ID(只读)",projectIdNA:"项目 ID:无",missingProjectId:"缺少项目 ID",missingProjectIdHint:"可能导致错误。请移除该账号并重新添加以获取项目 ID。",useIncognito:"使用隐身模式",aliases:"别名",current:"当前",currentValue:"当前值",composite:"复合",defaultLabel:"默认",requiredSetup:"必要设置",connectorName:"连接器名称",proxyUrl:"代理 URL",proxyUrlSet:"代理 URL 已设置",excludedModels:"排除模型",headers:"请求头",secret:"密钥",prefix:"前缀",modelMappings:"模型映射",baseUri:"Base URL",apiKeys:"API Key",presets:"应用预设模型映射",createVariant:"创建 CLIProxy 变体",agyDenylist:"Antigravity 禁用列表:Claude Opus 4.5 和 Claude Sonnet 4.5 已弃用。"},providerEditorAccountItem:{modelsUsed:"使用模型数"},bulkActionBar:{applyPreset:"应用预设"},modelConfigSection:{defaultModel:"默认模型"},rawEditorSection:{rawConfig:"原始配置"},providerEditorHeader:{connectorName:"连接器名称"},aiProvidersFamilyRail:{current:"当前"},aiProvidersEntryCard:{apiKeys:"API Key"},aiProvidersEntryDialog:{connectorName:"连接器名称",baseUri:"Base URL",proxyUrl:"代理 URL",secret:"密钥",prefix:"前缀",excludedModels:"排除模型",headers:"请求头",modelMappings:"模型映射",requiredSetup:"必要设置",optionalRouting:"可选路由"},codex:{controlCenter:"控制中心",overview:"概览",docs:"文档",nativeCodexRuntime:"原生 Codex 运行时",ccsCodexProvider:"Cliproxy 快捷方式 / 托管桥接",codexDocs:"Codex 文档",supportedFlows:"支持的工作流",twoSupportedPaths:"两种支持路径:",nativeLabel:"原生:",nativeDesc:"Codex 是 CCS v1 的一等公民运行时目标。",ccsBridge:"CCS 桥接",apiProfilesDefault:"API 配置默认仍使用 Claude 或 Droid。",recommendedSetupFlow:"推荐设置流程",fastestPath:"最快路径",officialChannels:"官方渠道",codexCli:"Codex CLI",openNativeCodex:"打开原生 Codex",runBuiltInCodex:"通过 cliproxy 快捷方式运行原生 Codex",runBuiltInCodexExplicit:"显式运行 CCS 托管 Codex 桥接",openCodexDashboard:"打开 Codex Dashboard",status:"状态",profiles:"配置",createNewProfile:"创建新配置",createNewProvider:"创建新提供商",createNewMcpServer:"创建新 MCP 服务器",defaultProvider:"默认提供商",useDefault:"使用默认值",useGlobalProvider:"使用全局提供商",useProviderDefault:"使用提供商默认值",quickFillWarning:"快速填充内容仅供参考,保存前请仔细检查。",thisFileUpstreamOwned:"此文件由 Codex CLI 上游维护。",notes:"备注",approvalPolicy:"审批策略",sandboxMode:"沙盒模式",reasoningEffort:"推理强度",useGlobalEffort:"使用全局强度",reasoningEffortCapitalized:"推理强度",thinkingBudgetTokens:"思考预算 Token",modelContextWindow:"模型上下文窗口",autoCompactTokenLimit:"自动压缩 Token 上限",toolOutputTokenLimit:"工具输出 Token 上限",webSearch:"网页搜索",personality:"人格设定",model:"模型",rawOnly:"仅原始",trusted:"受信任",untrusted:"不受信任",noProjectTrustEntries:"没有已保存的项目信任条目。",codexNativeRecipe:"已保存原生 Codex 配方",gptContextCap:"GPT-5.4 上下文上限",usageLimitCost:"用量上限成本超过 272K",longContextOverride:"长上下文覆盖",counts2x:"计数 2 倍",normalUsageWindow:"常规使用窗口",useCodexDefault:"使用 Codex 默认值",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"默认目标 CLI",executionChain:"执行链",targetPath:"当前目标路径",userConfig:"用户配置",configYaml:"config.yaml",flow:"工作流",docsTab:"文档",features:"功能",featuresDesc:"切换 CCS 可安全管理的 Codex 功能开关。",configOnlyFlags:"仅配置文件中的现有开关",configOnlyFlagsDesc:"这些功能键已存在于你的 `config.toml` 中,因此 CCS 可以显示它们,而不必宣称自己覆盖了完整目录。",existing:"已存在",nonBooleanForm:"该值以非布尔形式保存。如果需要编辑,请使用原始 TOML。",discoveredFromFile:"这是从当前文件中发现的,而不是来自 CCS 内置目录。",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"启用子代理协作工具。",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"使用基于 PTY 的统一 exec 工具。",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"复用 shell 环境快照。",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"启用自由格式 apply_patch 编辑。",featureJsReplLabel:"JS REPL",featureJsReplDesc:"启用基于 Node 的 JavaScript REPL。",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"收集 Codex 运行时指标。",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"保持机器在运行期间不休眠。",featureFastModeLabel:"Fast mode",featureFastModeDesc:"允许使用快速服务层路径。",featureAppsLabel:"Apps",featureAppsDesc:"启用 ChatGPT Apps 和连接器支持。",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"将符合条件的审批交给 guardian 流程处理。",howCodexWorks:"Codex 在 CCS 中的工作方式",nativeConfigLabel:"原生配置:",nativeConfigDesc:"ccs-codex 和 ccsx 会使用你保存的默认值启动原生 Codex。",transientOverridesLabel:"临时覆盖:",transientOverridesDesc:"ccsxp 会保持原生 Codex,只额外加上 cliproxy provider 覆盖;ccs codex --target codex 仍然是显式的 CCS 托管桥接。",cliproxyDefaultLabel:"CLIProxy 默认:",cliproxyDefaultDesc:'如果你想让普通的 codex 走 CLIProxy,请设置 model_provider = "cliproxy",并加入下面的配方。',runtimeInstall:"运行时安装",detected:"已检测到",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",versionLabel:"版本",nativeAliases:"原生别名",ccsProviderShortcut:"Cliproxy 快捷方式",configOverrideSupport:"--config 覆盖支持",available:"可用",missing:"缺失",cliproxyNativeCodex:"由 CLIProxy 支持的原生 Codex",builtInLabel:"内置:",builtInCcsxpDesc:"使用 ccsxp 通过 cliproxy provider 快捷方式启动原生 Codex。",managedBridgeLabel:"托管桥接:",managedBridgeDesc:"如果你想显式走更严格的 CCS 托管路由,请使用 ccs codex --target codex。",nativeRecipeLabel:"原生:",nativeRecipeDesc:"按下面的配方配置,即可让 codex 直接走 CLIProxy。",saveProviderNamedCliproxy:"保存一个名为 cliproxy 的 provider,并填入上面的 base URL 与 env key。",inTopLevelSetDefault:"在顶层设置中,将 Default provider 设为 cliproxy。",exportCliproxyApiKey:"在启动原生 Codex 之前,在 shell 中导出 CLIPROXY_API_KEY。",noConfigOverrides:"这个 Codex 版本仍然可以走纯原生路径,但在检测到的二进制支持 --config 覆盖之前,ccsxp 和显式的 CCS 托管 Codex 桥接都不可用。",configFile:"配置文件",path:"路径",resolved:"已解析",size:"大小",lastModified:"最后修改",tomlWarning:"TOML 警告",readWarning:"读取警告",currentUserLayerSummary:"当前用户层摘要",activeProfile:"当前激活的配置",notSet:"未设置",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"已存在的用户层键",nativeShortAlias:"原生短别名",ccsCodexShortcut:"CCS Codex 快捷方式",explicitProviderRoute:"显式 provider 路径",runtimeVsProvider:"运行时与 provider 的区别",honorsSavedNativeConfig:"遵循已保存的原生用户配置",usesTransientOverrides:"使用临时覆盖",unavailableNoConfig:"不可用(当前 Codex 版本缺少 --config 支持)。",yes:"是",no:"否",warningsTitle:"警告",auth:{terminalOnlyTooltip:"在终端使用 ccsx auth switch <name> 或 ccsx auth remove <name>。",terminalOnlyTooltipRich:"在终端使用 <code>ccsx auth switch &lt;name&gt;</code> 或 <code>ccsx auth remove &lt;name&gt;</code>。",activeSourceBadge:"{{source}}",statusOk:"正常",statusInvalid:"[!] 认证无效",loading:"正在加载认证配置...",loadError:"[!] 加载 codex-auth 配置失败。",emptyRegistry:"[i] 没有 codex-auth 配置。运行 ccsx auth create <name> 创建一个。",emptyRegistryRich:"[i] 没有 codex-auth 配置。运行 <code>ccsx auth create &lt;name&gt;</code> 创建一个。",legacyCodexHome:"Codex 将使用默认 ~/.codex 位置。",legacyCodexHomeRich:"Codex 将使用默认 <code>~/.codex</code> 位置。",legacyMode:"[i] 没有活动配置。正在使用 ~/.codex(旧模式)。在终端运行 ccsx auth switch <name> 激活一个。",legacyModeRich:"[i] 没有活动配置。正在使用 <code>~/.codex</code>(旧模式)。在终端运行 <code>ccsx auth switch &lt;name&gt;</code> 激活一个。",externalCodexHome:"[i] $CODEX_HOME 外部设置为 {{path}}。本会话未使用配置注册表。",externalCodexHomeRich:"[i] <code>$CODEX_HOME</code> 外部设置为 <code>{{path}}</code>。本会话未使用配置注册表。",activeProfile:"活动配置:",unknownProfile:"(未知)",planLabel:"套餐:",switchAction:"切换",removeAction:"移除",sourceDefault:"默认",sourceEnv:"$CCS_CODEX_PROFILE",sourceExplicitCodexHome:"$CODEX_HOME",col:{name:"名称",email:"邮箱",plan:"套餐",lastUsed:"上次使用",status:"状态",actions:"操作"}}},droidSettings:{quickControls:"快捷控制",reasoningControls:"推理控制",thinkingBudget:"思考预算",anthropicOnly:"仅 Anthropic 模型",byokCustomModels:"BYOK 自定义模型"},rawJsonSettingsEditor:{title:"原始设置编辑器"},copilotConfigForm:{copilotConfiguration:"Copilot 配置",deprecatedModels:"检测到已弃用的 Copilot 模型",failedLoadStatus:"加载状态失败",useWithClaudeCode:"通过 Claude Code 使用你的 GitHub Copilot 订阅",githubCopilotControls:"GitHub Copilot 在上游控制提示词/上下文限制。",provider:"提供商",filePath:"文件路径",status:"状态",enabled:"已启用",disabled:"已禁用",loadingEditor:"加载编辑器中...",modelMapping:"模型映射",quickUsage:"快速使用",noPremiumUsage:"无高级用量"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"所有系统正常",machineChecks:"机器检查"},analyticsCards:{cacheCost:"缓存成本",hitRate:"命中率",inputOutputRatio:"输入/输出比",noCacheData:"暂无缓存数据",noModelData:"暂无模型数据",noSessionData:"暂无会话数据",noTokenData:"暂无 Token 数据",totalCost:"总成本",totalTokens:"总 Token 数",usageInsights:"使用洞察"},dateRangeFilter:{pickADate:"选择日期"},logsConfig:{level:"级别",message:"消息",source:"来源",time:"时间",proc:"进程",open:"打开",run:"运行",refreshEntries:"刷新条目"},logsDetailPanel:{details:"详情"},logsFilters:{filters:"筛选"},logsOverviewCards:{overview:"概览"},logsPageSkeleton:{loadingLogs:"加载日志中..."},monitoringErrorLogs:{logContent:"日志内容"},analyticsPages:{chartsGrid:"图表",costByModel:"按模型成本"},toasts:{profileCreated:"配置创建成功",profileUpdated:"配置更新成功",profileDeleted:"配置删除成功",orphanProfilesComplete:"孤立配置注册完成",profileCopied:"配置复制成功",profileImported:"配置导入成功",authRequired:"{{provider}} 授权需要认证",authSuccess:"{{provider}} 认证成功!",authFailed:"{{provider}} 认证失败",deviceCodeExpired:"验证码已过期,请重试。",codeCopied:"验证码已复制到剪贴板",failedCopy:"复制验证码失败",configSaved:"配置保存成功",configSaveFailed:"保存失败:{{error}}",invalidYaml:"YAML 无效,无法保存",configUpdatedExternally:"配置已被外部更新",settingsFileUpdated:"设置文件已更新",accountsUpdated:"账号已更新",noProfilesToSync:"没有可同步的配置",syncFailed:"同步失败:{{error}}",sessionAffinityUpdated:"会话粘性已{{state}}。",providerAuthSuccess:"{{provider}} 认证成功",providerDeviceCodeInCallback:"提供商在回调模式中返回了设备码流程",providerAuthTimeout:"认证超时,请重试。",providerAccountRegistrationFailed:"已认证账号无法注册",providerLostStatusEndpoint:"与认证状态端点失去连接",providerUnknown:"未知提供商:{{provider}}",providerStartOAuthFailed:"启动 OAuth 失败",providerCallbackFailed:"回调提交失败",providerSubmitCallbackFailed:"提交回调失败",loggingConfigSaved:"日志配置已保存。",loggingConfigSaveFailed:"保存日志配置失败。",unifiedConfigUpdated:"配置更新成功",migrationPreviewComplete:"迁移预览完成",migrationComplete:"迁移成功",migrationFailed:"迁移失败",rollbackComplete:"回滚成功",rollbackFailed:"回滚失败",defaultAccountSet:"默认账号已设为「{{name}}」",defaultAccountReset:"默认账号已重置为 CCS",accountDeleted:"账号「{{name}}」已删除",contextUpdated:"已将「{{name}}」的上下文更新为 {{summary}}",legacyConfirmError:'账号「{{name}}」需要显式确认。请在该账号上使用"编辑历史同步"。',legacyConfirmFailed:"旧版账号「{{name}}」确认失败:{{error}}",legacyConfirmSuccess_one:"{{count}} 个旧版账号已确认",legacyConfirmSuccess_other:"{{count}} 个旧版账号已确认",legacyConfirmPartial:"已确认 {{updated}} 个旧版账号,但有 {{failed}} 个更新失败。账号状态已刷新。",legacyConfirmAllFailed:"确认 {{failed}} 个旧版账号失败。账号状态已刷新。",noLegacyAccounts:"没有需要确认的旧版账号",routingStrategySet:"路由策略已设为 {{strategy}}",variantCreated:"变体创建成功",variantUpdated:"变体更新成功",variantDeleted:"变体删除成功",defaultAccountUpdated:"默认账号已更新",accountRemoved:"账号已移除",accountPaused:"账号已暂停",accountResumed:"账号已恢复",accountAdded:"已为 {{provider}} 添加账号",kiroImported:"已导入 Kiro 账号:{{name}}",kiroTokenImported:"Kiro token 已导入",modelUpdated:"模型已更新",presetSaved:"预设「{{name}}」已保存",presetDeleted:"预设已删除",cliproxyAlreadyRunning:"CLIProxy 已在运行",cliproxyStarted:"CLIProxy 启动成功",cliproxyStartFailed:"CLIProxy 启动失败",cliproxyStopped:"CLIProxy 已停止",cliproxyStopFailed:"CLIProxy 停止失败",presetApplied:"已应用「{{name}}」预设",presetAppliedCustom:"已应用自定义预设",settingsSavedWithAdjustments:"设置已保存(含模型调整)",settingsSaved:"设置已保存",failedSaveSettings:"保存设置失败",codexRefreshFailed:"刷新 Codex 快照失败。原始编辑已保留。",codexRefreshError:"刷新 Codex 快照失败。",codexFixToml:"请先修复 TOML 再保存。",codexSaved:"已保存 Codex config.toml。",codexChangedExternally:"config.toml 已被外部修改,请刷新后重试。",codexSaveFailed:"保存 Codex config.toml 失败。",codexUpdateFailed:"更新 Codex 配置失败。",noOrphanProfiles:"未发现孤立配置",profilesRegistered:"已注册 {{count}} 个配置{{skipped}}",destinationEmpty:"目标配置名称不能为空",profileExportDownloaded:"配置导出已下载",profileImportFailed:"导入配置包失败"},providerConfig:{defaultDeviceCodeInstruction:"请在浏览器中完成授权。",trackLabel:"分组",sectionCoreLabel:"核心 / 原始后端",sectionCoreHint:"默认且始终可用的提供商线路",sectionPlusLabel:"Plus 扩展 / 社区维护",sectionPlusHint:"仍然受支持,但目前与默认后端分开显示",plusTrackNote:"需要可选的 Plus 后端;当前这条线路由社区维护。"},profileEditorSections:{imageAnalysis:"图片分析",loadingImageSettings:"加载图片设置中...",skipPermissionPrompts:"启动时跳过权限提示",useNativeImageReading:"使用原生图片读取",skipTransformer:"跳过转换器",friendlyUi:"友好界面",info:"信息"},imageAnalysisStatus:{sectionTitle:"图片",openSettings:"打开设置",useNativeImageReading:"使用原生图片读取",refreshingPreview:"刷新预览中",savedStatus:"已保存状态",livePreview:"实时预览",disabledGlobally:"全局已禁用",targetBypassesHook:"{{target}} 绕过了 hook",nativeImageReading:"原生图片读取",setupNeeded:"需要设置",needsAuth:"需要认证",needsProxy:"需要代理",nativeFallback:"原生回退",transformerReady:"转换器就绪",badgeDisabled:"已禁用",badgeBypassed:"已绕过",badgeNative:"原生",badgeSetup:"需设置",badgeAuth:"认证",badgeProxy:"代理",badgeReady:"就绪",capabilityVerified:"已验证",capabilityUnknown:"未知",toggleSummaryNativeCapable:"{{model}} 支持图片,CCS 将在此跳过转换器。",toggleSummaryNativeModel:"CCS 将对 {{model}} 优先使用原生读取。",toggleSummaryNativeDefault:"CCS 将对此配置优先使用原生图片读取。",toggleSummaryNativeFileAccess:"此配置当前仍使用原生文件访问。",toggleSummaryInactiveTarget:"当前选择 {{target}} 时,已保存的 Claude 端图片路由不生效。",toggleSummaryTransformerRoute:"转换器路由:{{backend}}{{modelSuffix}}。",noteDisabledGlobally:"图片功能在 CCS 设置中被全局禁用。",noteTargetBypassesHook:"当前目标 {{target}} 绕过了 Claude Read hook。",notePersistHook:"请先持久化配置 hook,然后才能在此使用转换器路由。",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"新",integration:"OpenRouter 集成"},openrouterBanner:{accessModels:"通过 OpenRouter 访问 {{count}}+ 模型",add:"添加"},openrouterModelPicker:{searchModels:"搜索模型",newestModels:"最新模型"},openrouterPromoCard:{title:"OpenRouter",description:"通过一个 API 端点访问数百个模型。"},profileCard:{profile:"配置",openRouter:"OpenRouter 配置",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code(默认)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS 配置"},profileDeck:{profiles:"配置",failedToLoad:"加载配置失败:{{message}}",noProfiles:"尚未配置。创建你的第一个配置以开始。"},profilesTable:{name:"名称",provider:"提供商",model:"模型",target:"目标",lastModified:"最后修改",actions:"操作",edit:"编辑"},profileCreateDialog:{createProfile:"创建配置",appliedModelToTiers:"已将「{{model}}」应用到所有模型档位",profileCreated:"配置「{{name}}」已创建",failedCreate:"创建配置失败",chooseProviderHint:"选择提供商预设,或配置自定义 API 端点。",basicInformation:"基本信息",modelConfiguration:"模型配置",usedInCli:"CLI 中使用:",apiBaseUrl:"API Base URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"从 {{name}} 预填。可按需调整。",optionalForPreset:"{{name}} 的可选项。留空使用原生 Anthropic 认证。",endpointHint:"接受 OpenAI 兼容和 Anthropic 请求的端点",optional:"(可选)",apiKeyOptionalPlaceholder:"可选 - 仅在启用认证时需要",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"仅在本地端点启用了认证时才需要",defaultTargetCli:"默认目标 CLI",modelMapping:"模型映射",modelMappingDesc:"将 Claude Code 档位(Opus/Sonnet/Haiku)映射到提供商支持的模型。",searchModelsPlaceholder:"输入搜索(例如:opus、sonnet、gpt-4o)...",noModelsFound:"未找到匹配「{{query}}」的模型",loadingModels:"加载模型中...",defaultModel:"默认模型",sonnetMapping:"Sonnet 映射",opusMapping:"Opus 映射",haikuMapping:"Haiku 映射",sonnetMappingPlaceholder:"例如:gpt-4o、claude-sonnet-4",opusMappingPlaceholder:"例如:o1、claude-opus-4.5",haikuMappingPlaceholder:"例如:gpt-4o-mini、claude-3.5-haiku",free:"免费"},profileDialogLegacy:{editProfile:"编辑配置"},supportEntryCard:{actionRequired:"待处理"},settingsPage:{title:"设置",loading:"加载中...",failedLoad:"加载设置失败。",tabs:{web:"网页",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份",channels:"频道",imageAnalysis:"图片"},websearchSection:{title:"网页搜索",description:"CLI 网页搜索配置。"},thinkingSection:{title:"思考",description:"为支持的模型配置扩展思考/推理。",directOverride:"直接覆盖",youType:"你输入:",ccsAdds:"CCS 添加:",executionChain:"执行链",primaryBackends:"主要后端",legacyCliFallbacks:"旧版 CLI 回退",managedPayload:"托管载荷",sharedTargetMetadata:"共享目标元数据",ideTargetMetadata:"IDE 目标元数据",ideSettingsPath:"IDE 设置路径",ideHost:"IDE 主机",resolvedBinding:"已解析绑定",bindingName:"绑定名称",inSync:"已同步",currentTargetPath:"当前目标路径",warnings:"告警",notes:"备注",workspacePresets:"工作区预设",draft:"草稿",advanced:"高级",recommended:"推荐设置流程",configureModelFirst:"请先配置模型"},proxySection:{title:"代理",loadingImageSettings:"加载图片设置中..."},channelsSection:{title:"官方渠道",description:"查看和管理官方发布渠道。"},imageAnalysisSection:{title:"图片分析",description:"配置图片分析设置。",loading:"加载图片设置中..."},browserSection:{title:"浏览器",description:"CCS 中托管浏览器自动化的主设置入口。",primaryTitle:"Settings > Browser 是主要的浏览器设置界面。",primaryDescription:"在这里配置 Claude Browser Attach 和 Codex Browser Tools,然后按下方指引启动或验证每条路径。",readiness:"就绪状态",nextStep:"下一步",technicalDetails:"技术细节",diagnostics:"诊断信息",evalMode:{label:"browser_eval 权限",options:{disabled:"禁用",readonly:"只读",readwrite:"可读写"}},actions:{saveClaude:"保存 Claude 设置",saveCodex:"保存 Codex 设置",testConnection:"测试连接",copyLaunchCommand:"复制启动命令"},messages:{statusRefreshed:"浏览器状态已刷新",launchCommandCopied:"启动命令已复制"},claude:{title:"Claude Browser Attach",description:"将 Claude 目标会话附加到启用了远程调试的 Chrome 会话。",enabledLabel:"启用 Claude Browser Attach",enabledDescription:"启用后,CCS 会为 Claude 目标会话准备托管浏览器 MCP 运行时。",userDataDir:"Chrome 用户数据目录",userDataDirHint:"建议使用单独的 Chrome 配置目录,避免自动化状态污染日常浏览器。",devtoolsPort:"DevTools 端口",devtoolsPortHint:"必须与 Chrome attach 模式实际启动时使用的端口一致。",devtoolsPortInvalid:"请输入 1 到 65535 之间的有效端口。",effectivePath:"当前生效的 attach 路径",recommendedPath:"推荐路径",managedRuntime:"托管浏览器运行时",evalModeHint:"控制 Claude Browser Attach 中 browser_eval 的权限。只读仅允许读取,读写还允许页面侧修改。",overrideMessage:"当前存在来自 {{source}} 的环境变量覆盖。移除该覆盖后,Dashboard 配置将重新成为唯一来源。",launchGuidance:"启动指引",launchGuidanceHint:"使用远程调试启动 Chrome,如有需要再重新执行 Test connection。"},codex:{title:"Codex Browser Tools",description:"控制 Codex 目标会话中的托管 Playwright MCP 浏览器路径。",enabledLabel:"启用 Codex Browser Tools",enabledDescription:"保持开启可让 Browser 页面成为 Codex 浏览器工具的主设置入口。",serverName:"托管服务名称",overrideSupport:"配置覆盖支持",overrideSupported:"支持",overrideUnsupported:"不支持",binary:"检测到的 Codex 可执行文件",notDetected:"未检测到",evalModeHint:"为保持 Browser 设置页一致性而保存该配置。Phase 1 中,browser_eval 的实际限制主要作用于 Claude Browser Attach。"}}},codexPage:{title:"Codex",controlCenter:"控制中心",overview:"概览",docs:"文档",authProfiles:"认证配置",nativeRuntime:"原生运行时",ccsProvider:"CCS 提供商",setup:"安装"},apiPage:{title:"API 配置",subtitle:"管理你的 API 配置和端点。"},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension 集成设置。",claudeAuth:"Claude 认证",status:"状态",targetMetadata:"IDE 目标元数据"},sharedPageV2:{title:"共享",subtitle:"共享数据管理。"},homePageV2:{title:"首页",logsMoved:"日志已移至专用工作区",profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康"},analyticsPageV2:{title:"分析",subtitle:"使用分析与洞察。"},logsPageV2:{title:"日志",subtitle:"查看和管理系统日志。"},healthPageV2:{title:"健康",subtitle:"系统健康监控。"},aiProvidersPage:{title:"AI 提供商",subtitle:"管理 AI 提供商配置。",unableToLoad:"无法加载 AI 提供商"}}},vi:{translation:{locale:{en:"Tiếng Anh","zh-CN":"Tiếng Trung giản thể",vi:"Tiếng Việt",ja:"Tiếng Nhật",ko:"Tiếng Hàn"},layout:{languageSwitcher:"Ngôn ngữ"},nav:{general:"Chung",home:"Trang chủ",analytics:"Phân tích",identityAccess:"Nhận dạng & Quyền truy cập",apiProfiles:"Hồ sơ API",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Tổng quan",controlPanel:"Bảng điều khiển",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Tài khoản",allAccounts:"Tất cả tài khoản",sharedData:"Dữ liệu dùng chung",compatibleClis:"Tương thích",deprecated:"Đã ngừng ưu tiên",factoryDroid:"Factory Droid",system:"Hệ thống",health:"Sức khỏe",settings:"Cài đặt",openrouterTooltip:"Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama",logs:"Nhật ký"},home:{profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe",configurationRequired:"Cần cấu hình"},auth:{dashboardTitle:"Bảng điều khiển CCS",protectedAccessLabel:"Truy cập được bảo vệ",remoteGuardLabel:"Lớp bảo vệ truy cập từ xa",loading:"Đang kiểm tra quyền truy cập bảng điều khiển…",loginDescription:"Dùng tên người dùng và mật khẩu đã được cấu hình trên máy host để truy cập bảng điều khiển.",username:"Tên người dùng",password:"Mật khẩu",usernamePlaceholder:"Nhập tên người dùng",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",loginFailed:"Đăng nhập không thành công",lightMode:"Sáng",darkMode:"Tối",noDefaultCredentials:"CCS không có sẵn tài khoản hay mật khẩu mặc định.",credentialsHint:"Thông tin đăng nhập được tạo bằng `ccs config auth setup` trên máy CCS host. Với Docker, phải chạy lệnh đó bên trong container.",remoteSetupTitle:"Truy cập từ xa cần thiết lập xác thực",remoteSetupDescription:"Bảng điều khiển này đang được mở từ một địa chỉ không phải localhost, nhưng phiên bản CCS này chưa bật dashboard auth.",incompleteSetupDescription:"Dashboard auth đã được bật nhưng cấu hình vẫn chưa hoàn tất. Hãy hoàn thành cấu hình cho phiên bản CCS này trước khi đăng nhập.",safetyNoteRemote:"Quản trị từ xa sẽ tiếp tục bị khóa cho tới khi chủ máy CCS host bật dashboard auth.",safetyNoteLocal:"Nếu bạn đang ngồi ngay trên máy đó, đường localhost vẫn là cách đơn giản nhất để vào.",safetyNoteSession:"Sau khi đăng nhập thành công, phiên HTTP-only sẽ chỉ có hiệu lực trên đúng máy chủ dashboard này.",hostStepTitle:"Trên máy CCS host",hostStepDescription:"Tạo hoặc bật lại thông tin đăng nhập cho dashboard, rồi mở lại trang này từ thiết bị từ xa.",dockerStepDescription:"Nếu dùng Docker, hãy chạy lệnh này bên trong container đang chạy:",localStepTitle:"Nếu đây là máy của bạn",localStepDescription:"Hãy mở URL localhost mà `ccs config` in ra, thay vì địa chỉ LAN hoặc Tailscale.",showPassword:"Hiện mật khẩu",hidePassword:"Ẩn mật khẩu"},commonToast:{apiKeyRequired:"Cần có khóa API",accountAddedPresetFailed:"Đã thêm tài khoản nhưng không áp dụng được preset mặc định",settingsCopied:"Đã sao chép cài đặt vào bảng nhớ tạm",enterPresetName:"Vui lòng nhập tên preset để lưu",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",copyCodeFailed:"Không sao chép được mã",appliedModelAllTiers:"Đã áp dụng mô hình cho tất cả các tier",settingsSaved:"Đã lưu cài đặt",defaultTargetUpdated:"Đã cập nhật mục tiêu mặc định",failedUpdateDefaultTarget:"Không cập nhật được mục tiêu mặc định thành {{target}}{{suffix}}",resourcesUpdated:"Đã cập nhật tài nguyên dùng chung"},profileDialog:{editTitle:"Chỉnh sửa hồ sơ",createTitle:"Tạo hồ sơ API",name:"Tên",namePlaceholder:"my-api",baseUrl:"URL cơ sở",baseUrlPlaceholder:"https://api.example.com",apiKey:"Khóa API",defaultModel:"Mô hình mặc định (ANTHROPIC_MODEL)",defaultModelHint:"Để trống để sử dụng: {{model}}",modelMappingTitle:"Ánh xạ mô hình (Opus/Sonnet/Haiku)",modelMappingDesc:"Cấu hình ID mô hình riêng cho từng tier. Hữu ích với API proxy định tuyến từng loại mô hình đến backend khác nhau.",opusModel:"Mô hình Opus (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Mô hình Sonnet (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Mô hình Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Hủy bỏ",saving:"Đang lưu...",update:"Cập nhật",create:"Tạo"},modelTierMapping:{title:"Ánh xạ tầng mô hình",advanced:"Nâng cao",description:"Định cấu hình các mô hình khác nhau cho các cấp độ opus/sonnet/haiku của Claude Code.",autoSuggest:"Tự động đề xuất dựa trên {{provider}}",opusPlaceholder:"vd: anthropic/claude-opus-4",sonnetPlaceholder:"ví dụ: anthropic/claude-sonnet-4",haikuPlaceholder:"vd: anthropic/claude-3.5-haiku",footer:"Các biến này thiết lập ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"nhạy cảm",none:"Không có biến môi trường nào được cấu hình.",noneHint:"Thêm biến bằng ô nhập bên dưới hoặc chỉnh sửa trực tiếp JSON.",addVariable:"Thêm biến môi trường",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"giá trị"},setupVariant:{using:"Sử dụng:",variantNameRequired:"Tên biến thể runtime *",variantNamePlaceholder:"ví dụ: my-gemini, g3, flash",invokeHintPrefix:"Chạy bằng biến thể này:",model:"Mô hình",modelPlaceholder:"ví dụ: gemini-2.5-pro, claude-opus-4-5",choosePresetInstead:"Hoặc chọn từ preset có sẵn",selectModel:"Chọn mô hình",customModelName:"Tên mô hình tùy chỉnh...",enterAnyModel:"Nhập bất kỳ tên mô hình nào được CLIProxy hỗ trợ",defaultModel:"Mặc định: {{model}}",providerDefault:"mặc định theo nhà cung cấp",back:"Quay lại",skip:"Bỏ qua",creating:"Đang tạo...",createVariant:"Tạo biến thể",skipHint:"Bỏ qua nếu thiết lập tài khoản là đủ và không cần biến thể runtime riêng"},customPresetDialog:{title:"Preset tùy chỉnh",presetNameOptional:"Tên preset (tùy chọn)",presetNamePlaceholder:"ví dụ: Preset tùy chỉnh của tôi",codexTipPrefix:"Mẹo Codex: hậu tố",codexTipSuffix:"nỗ lực ghim. Các mô hình không có hậu tố sử dụng cài đặt Tư duy.",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không yêu cầu cấp mô hình cụ thể",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Đối với các nhiệm vụ lý luận phức tạp",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Cân bằng giữa tốc độ và khả năng",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Phản hồi nhanh cho các tác vụ đơn giản",cancel:"Hủy bỏ",savePreset:"Lưu preset",applyPreset:"Áp dụng cài sẵn",deletePreset:"Xóa cài sẵn"},componentModelSelector:{selectModel:"Chọn mô hình",availableModelsCount:"Mô hình khả dụng ({{count}})",preview:"Xem trước"},searchableSelect:{searchModels:"Tìm mô hình...",noResults:"Không tìm thấy kết quả phù hợp."},copilotSettings:{enableCopilot:"Bật Copilot",enableCopilotDesc:"Cho phép sử dụng đăng ký GitHub Copilot",basicSettings:"Cài đặt cơ bản",accountType:"Loại tài khoản",accountTypeIndividual:"Cá nhân",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Giới hạn tỷ lệ",rateLimitSeconds:"Giới hạn tốc độ (giây)",noLimit:"Không giới hạn",waitOnRateLimit:"Chờ giới hạn tỷ lệ",waitOnRateLimitDesc:"Chờ thay vì lỗi khi đạt đến giới hạn",daemonSettings:"Cài đặt Daemon",autoStartDaemon:"Daemon tự động khởi động",autoStartDaemonDesc:"Bắt đầu copilot-api khi sử dụng hồ sơ"},providerModelSelector:{selectModel:"Chọn mô hình",noModelsForProvider:"Không có mô hình nào cho nhà cung cấp này",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Gói miễn phí",paidTier:"Gói trả phí",modelKnownIssues:"Mô hình này có vấn đề đã biết",viewIssueDetails:"Xem chi tiết vấn đề",modelDeprecated:"Mô hình này không được dùng nữa",recommended:"Đề xuất",allModelsCount:"Tất cả mô hình ({{count}})",noModelsAvailable:"Không có mô hình khả dụng",shadowed:"Bị che khuất",prefixOnly:"Chỉ tiền tố",current:"Hiện tại",currentValue:"Giá trị hiện tại",preferredPinnedModel:"Mô hình ghim ưu tiên:",pinnedRouteStatus:"Trạng thái tuyến ghim:",pinnedModelNotAdvertised:"Mô hình ghim hiện không được proxy quảng bá: {{model}}",codexReasoningVariants:"Biến thể lý luận",codexFastVariants:"Biến thể nhanh"},createAuthProfileDialog:{title:"Tạo tài khoản mới",description:"Hồ sơ xác thực yêu cầu đăng nhập Claude CLI. Chạy lệnh dưới đây trong terminal của bạn. Bạn có thể chỉnh sửa chế độ đồng bộ hóa, nhóm và độ liên tục sau này từ bảng Tài khoản.",profileName:"Tên hồ sơ",profileNamePlaceholder:"ví dụ: công việc, cá nhân, khách hàng",invalidProfileName:"Tên phải bắt đầu bằng một chữ cái và chỉ chứa các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới.",enableSharedHistory:"Bật đồng bộ hóa lịch sử chia sẻ với các tài khoản xác thực ccs khác",historySyncGroupOptional:"Nhóm đồng bộ hóa lịch sử (tùy chọn)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Để trống để sử dụng nhóm chia sẻ mặc định. Dấu cách được chuẩn hóa thành dấu gạch ngang.",deeperContinuity:"Nâng cao: chế độ liên tục sâu hơn",deeperContinuityHint:"Thêm đồng bộ cho session-env, file-history, shell-snapshots và todos. Thông tin xác thực vẫn tách biệt.",invalidContextGroup:"Nhóm phải bắt đầu bằng một chữ cái và chỉ sử dụng các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới (tối đa {{max}} ký tự).",command:"Lệnh",commandFallback:"ccs auth create <name>",afterRunPrefix:"Sau khi chạy lệnh:",afterRunStep1:"Hoàn tất đăng nhập Claude trong trình duyệt của bạn",afterRunStep2:"Quay lại đây và làm mới để xem tài khoản mới",poolingHint:"Muốn dùng định tuyến Claude OAuth dạng pool? Dùng CLIProxy Claude pool từ nút hành động ở trang Tài khoản.",close:"Đóng",copied:"Đã sao chép!",copyCommand:"Sao chép lệnh"},accountRouteGuide:{title:"Lộ trình hai tài khoản khuyến nghị",description:"Dùng account profile riêng để giữ token tách biệt. Chỉ bật history sync khi cả hai tài khoản cần thấy cùng continuity cục bộ.",status:{empty:"tạo tài khoản",isolated:"đã sẵn sàng tách biệt",shared:"chia sẻ context project",deeper:"deeper sync sẵn sàng",mixed:"thiết lập hỗn hợp"},cards:{isolated:{title:"Token vẫn tách biệt",desc:"Mỗi tài khoản ccs auth có Claude config, login và credential riêng. Cài đặt sync không bao giờ copy token."},select:{title:"Bạn chọn tài khoản cần dùng",desc:"Chạy ccs work hoặc ccs personal để chọn rõ tài khoản. Chỉ đặt Default khi plain ccs nên đi theo một tài khoản."},settings:{title:"Settings đi theo root",desc:"Tài khoản không bare link settings.json qua CCS shared state tới ~/.claude/settings.json. ccs auth show sẽ xác nhận."},sync:{title:"History sync là tùy chọn",desc:"Cả hai tài khoản cần Shared mode và cùng group. Deeper sync thêm các artifact continuity cục bộ."}},commands:{isolated:"Dùng tài khoản tách biệt",sync:"Chia sẻ lịch sử tùy chọn",syncDesc:'Dùng cùng group, ví dụ "{{group}}", trên cả hai tài khoản khi muốn chia sẻ lịch sử cục bộ.'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Khác"},cliproxyOverviewComponents:{availableModels:"Mô hình khả dụng",noModelsAvailable:"Không có mô hình khả dụng",startSessionHint:"Bắt đầu phiên CLIProxy để tải danh sách mô hình khả dụng",totalCount:"tổng cộng {{count}}",availableThroughGroupedByProvider:"Các mô hình khả dụng qua {{backendLabel}}, được nhóm theo nhà cung cấp",moreCount:"+{{count}} thêm"},categorizedModelSelector:{selectModel:"Chọn mô hình",noModelsAvailable:"Không có mô hình khả dụng",modelPlaceholder:"Mô hình..."},openrouterQuickStart:{recommended:"Đề xuất",title:"Bắt đầu với OpenRouter",description:"Truy cập các mô hình {{modelCountLabel}} từ OpenAI, Anthropic, Google, Meta, v.v. - tất cả đều thông qua một API.",featureOneApi:"Một API cho mọi nhà cung cấp",profileSummaryCount:"{{count}} hồ sơ",profileSummaryCount_other:"{{count}} hồ sơ",profileSummaryEmpty:"Chất lượng cao + kiểm soát cục bộ",summaryBadgeDefaultQuality:"Mặc định chất lượng tốt nhất",summaryBadgeLocalLane:"Dùng local khi đúng bài toán",summaryExistingTitle:"Chọn hồ sơ hoặc thêm một lane mới",summaryEmptyTitle:"Chọn lane hồ sơ đầu tiên của bạn",summaryExistingDescription:"Bạn đã có {{count}} hồ sơ trong workspace này. Hãy giữ các nhà cung cấp chất lượng cao cho công việc code nghiêm túc, và chỉ thêm runtime local khi cần quyền riêng tư, chi phí thấp hoặc làm việc offline.",summaryExistingDescription_other:"Bạn đã có {{count}} hồ sơ trong workspace này. Hãy giữ các nhà cung cấp chất lượng cao cho công việc code nghiêm túc, và chỉ thêm runtime local khi cần quyền riêng tư, chi phí thấp hoặc làm việc offline.",summaryEmptyDescription:"Chọn lane phù hợp với công việc. Nhà cung cấp premium vẫn là mặc định cho độ tin cậy khi code; runtime local phù hợp hơn cho quyền riêng tư, batch rẻ và thử nghiệm.",qualityLanesTitle:"Lane chất lượng cao",qualityLaneHighlightDefaultQuality:"Lane mặc định tốt nhất cho các tác vụ code quan trọng",alibabaLaneDescription:"Hồ sơ coding trực tiếp mạnh mẽ khi bạn muốn một lane premium riêng ngoài catalog OpenRouter.",alibabaLaneHighlightQuality:"Phù hợp khi bạn cần chất lượng premium với endpoint riêng",localRuntimesTitle:"Runtime local",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"Tốt nhất cho prompt riêng tư, dọn dẹp local và batch transform chi phí thấp",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"Tốt nhất cho thiết lập GGUF tùy biến và workflow local tự host nâng cao",localDetectedModels:"Đã phát hiện {{count}} mô hình local",localDetectedModels_other:"Đã phát hiện {{count}} mô hình local",localNoModelsDetected:"Chưa phát hiện mô hình local nào",localWaitingServer:"Đang chờ máy chủ local và danh sách mô hình",localRuntimeCheckingBadge:"Đang kiểm tra",localRuntimeReadyBadge:"Sẵn sàng",localRuntimeNeedsModelBadge:"Thiếu mô hình",localRuntimeOfflineBadge:"Ngoại tuyến",localRuntimeCheckingDescription:"Đang kiểm tra trạng thái runtime local trước khi hiển thị hướng dẫn thiết lập.",localRuntimeReadyDescription:"Phù hợp nhất cho prompt riêng tư, workflow offline và batch transform rẻ hơn.",localRuntimeNeedsModelDescription:"Runtime đã chạy, nhưng mô hình local được khuyến nghị vẫn cần được tải hoặc nạp.",localRuntimeOfflineDescription:"Lane này phù hợp cho công việc nhạy cảm về riêng tư, transform local giá rẻ và phiên offline.",localRuntimeCheckingFooter:"Đang kiểm tra runtime local...",localRuntimeReadyFooter:"Endpoint sẵn sàng tại {{endpoint}}",localRuntimeMissingModelFooter:"Chạy `{{command}}` để hoàn tất thiết lập local.",localRuntimeOfflineFooter:"Chạy `{{command}}` để đưa endpoint local lên.",localRuntimeSetupAction:"Thiết lập {{label}}",localRuntimeUseAction:"Dùng {{label}}",localRuntimeFinishAction:"Hoàn tất thiết lập {{label}}",runtimeProviderBadge:"Thiết lập nhà cung cấp runtime",runtimeProviderTitle:"Mở AI Providers",runtimeProviderManagedDescription:"Dùng mục này khi bạn cần connector do CLIProxy quản lý, secret nhà cung cấp và điều khiển routing nâng cao.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex và các connector tương thích OpenAI",runtimeProviderFeatureSecrets:"Khóa dùng chung tách biệt khỏi từng API Profile",runtimeProviderFooter:"Phù hợp nhất khi nhiều hồ sơ cần dùng chung một cấu hình nhà cung cấp.",createOpenRouterProfile:"Tạo hồ sơ OpenRouter",getApiKeyAt:"Nhận khóa API của bạn tại",createCustomProfile:"Tạo hồ sơ API tùy chỉnh"},alibabaCodingPlanQuickStart:{recommended:"Đề xuất",title:"Dùng thử Alibaba Coding Plan",description:"Sử dụng Alibaba Cloud Coding Plan qua endpoint tương thích Anthropic cho tác vụ lập trình.",featureEndpoint:"Endpoint tương thích Anthropic",featureKeyFormat:"Khóa API sk-sp chuyên dụng",createAlibabaProfile:"Tạo hồ sơ Alibaba Coding Plan",readGuideAt:"Xem hướng dẫn tại"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan qua endpoint Anthropic",add:"Thêm"},credentialHealth:{title:"Tình trạng thông tin xác thực",ready:"Sẵn sàng",noCredentialsConfigured:"Không có thông tin xác thực nào được định cấu hình. Sử dụng các nút đăng nhập ở trên để xác thực.",neverUsed:"Chưa bao giờ sử dụng",justNow:"Vừa rồi",unknown:"Không xác định",daysAgo:"{{count}} ngày trước",hoursAgo:"{{count}} giờ trước",minutesAgo:"{{count}} phút trước"},proxyStatusWidget:{justNow:"vừa xong",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",syncReady:"Sẵn sàng đồng bộ hóa",noConfig:"Không có cấu hình",remoteProxy:"Proxy từ xa",active:"Đang hoạt động",trafficAutoRouted:"Lưu lượng truy cập tự động được định tuyến đến máy chủ từ xa",tooltipSync:"Đồng bộ hóa hồ sơ với CLIProxy",tooltipRestart:"Khởi động lại",tooltipStop:"Dừng lại",tooltipClose:"Đóng",tooltipVersionSettings:"Cài đặt phiên bản",versionManagement:"Quản lý phiên bản",selectVersionPlaceholder:"Chọn phiên bản để cài đặt...",stable:"(ổn định)",install:"Cài đặt",versionsAboveUnstable:"Các phiên bản trên {{version}} có vấn đề đã biết",versionsKnownIssues:"Phiên bản {{version}} có vấn đề đã biết",lastChecked:"Đã kiểm tra lần cuối {{time}}",notRunning:"Không chạy",start:"Bắt đầu",port:"Cổng {{port}}",sessionCount:"{{count}} phiên",sessionCount_other:"{{count}} phiên",installFaultyTitle:"Cài đặt phiên bản có lỗi đã biết?",installFaultyDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này nằm trong dải lỗi đã biết <strong>{{range}}</strong>.",installFaultyWarning:"Phiên bản này có lỗi đã biết và có thể cài đặt thất bại hoặc làm proxy ở trạng thái xấu.",installUnstableTitle:"Cài đặt phiên bản không ổn định?",installUnstableDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này cao hơn phiên bản ổn định tối đa <strong>v{{maxStable}}</strong>.",installUnstableWarning:"Phiên bản này đã biết có vấn đề về độ ổn định và có thể gây ra hành vi không mong muốn.",installUnstableConfirm:"Bạn có chắc chắn muốn tiếp tục không?",cancel:"Hủy bỏ",installAnyway:"Vẫn cài đặt",clickToDowngrade:"Bấm để hạ cấp",clickToUpdate:"Bấm để cập nhật"},syncStatusCard:{profileSync:"Đồng bộ hồ sơ",ready:"Sẵn sàng",noConfig:"Không có cấu hình",syncsProfilesDesc:"Đồng bộ hóa cấu hình API với cấu hình CLIProxy cục bộ",runDoctorHint:"Chạy <code>ccs doctor --fix</code> để tạo cấu hình.",details:"Chi tiết",syncNow:"Đồng bộ ngay"},syncDialog:{title:"Đồng bộ hóa hồ sơ với CLIProxy cục bộ",description:"Đồng bộ hóa cấu hình API CCS của bạn với CLIProxy config.yaml cục bộ.",noProfiles:"Không có profile nào để đồng bộ.",createProfilesFirst:"Trước tiên hãy tạo hồ sơ API bằng tab Hồ sơ.",modelLabel:"Mô hình:",ready:"Sẵn sàng",profilesToSync_one:"{{count}} hồ sơ để đồng bộ hóa",profilesToSync_other:"{{count}} hồ sơ cần đồng bộ hóa",cancel:"Hủy bỏ",syncing:"Đang đồng bộ hóa...",synced:"Đã đồng bộ hóa!",syncNow:"Đồng bộ ngay"},errorLogs:{title:"Nhật ký lỗi",failedRequests_one:"{{count}} yêu cầu thất bại",failedRequests_other:"{{count}} yêu cầu thất bại",cliproxyDiagnostics:"Chẩn đoán CLIProxy",showingCount:"Hiển thị 50 trong số {{total}} nhật ký",selectLog:"Chọn nhật ký để xem chi tiết",failedLoadContent:"Không tải được nội dung nhật ký",copyAbsolutePath:"Sao chép đường dẫn tuyệt đối",copyRawContent:"Sao chép nội dung nhật ký thô",tabOverview:"Tổng quan",tabHeaders:"Tiêu đề",tabRequest:"Yêu cầu",tabResponse:"Phản hồi",tabRaw:"Raw",modelLabel:"Mô hình:",quotaResetsIn:"Quota sẽ được đặt lại sau",method:"Phương thức",provider:"Nhà cung cấp",version:"Phiên bản",endpoint:"Điểm cuối",url:"URL",timestamp:"Dấu thời gian",na:"không áp dụng",noHeaders:"Không có tiêu đề nào",noRequestBody:"Không có nội dung yêu cầu",noResponseBody:"Không có nội dung phản hồi",rateLimitedMsg:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch. Mô hình {{model}} đã hết quota.",rateLimitedMsgNoModel:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch.",authFailedMsg:"Xác thực không thành công. Xác thực lại thông qua Cài đặt CLIProxy hoặc kiểm tra khóa API.",notFoundMsg:"Không tìm thấy điểm cuối. Điểm cuối này có thể không tồn tại trên nhà cung cấp này.",serverErrorMsg:"Lỗi máy chủ từ upstream. Hãy thử lại sau hoặc kiểm tra trang trạng thái của nhà cung cấp.",timeoutMsg:"Yêu cầu hết thời gian chờ. Kiểm tra kết nối mạng hoặc tăng timeout.",unknown:"không rõ"},editAccountContext:{title:"Chỉnh sửa đồng bộ hóa lịch sử",description:'Định cấu hình cách "{{name}}" chia sẻ lịch sử và tính liên tục với các tài khoản xác thực ccs khác.',syncMode:"Chế độ đồng bộ",selectContextMode:"Chọn chế độ ngữ cảnh",isolatedOption:"tách biệt (không đồng bộ)",sharedOption:"chia sẻ (đã bật đồng bộ)",sharedModeHint:"Chế độ chia sẻ sử dụng lại ngữ cảnh không gian làm việc cho các tài khoản trong cùng một nhóm đồng bộ lịch sử.",isolatedModeHint:"Chế độ biệt lập giúp tài khoản này tách biệt hoàn toàn với các tài khoản xác thực ccs khác.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",groupPlaceholder:"mặc định",groupHint:"Chuẩn hóa thành chữ thường (dấu cách trở thành dấu gạch ngang). Được phép: chữ cái, số, _ , - (tối đa {{max}} ký tự).",invalidGroup:"Nhập tên nhóm hợp lệ bắt đầu bằng một chữ cái.",continuityDepth:"Độ sâu liên tục",selectContinuityDepth:"Chọn độ sâu liên tục",standardOption:"tiêu chuẩn (chỉ đồng bộ project)",deeperOption:"tính liên tục sâu hơn (nâng cao)",deeperHint:"Chế độ nâng cao cũng đồng bộ hóa phiên-env, lịch sử tệp, ảnh chụp nhanh shell và todos.",standardHint:"Chế độ tiêu chuẩn chỉ đồng bộ hóa bối cảnh không gian làm việc của dự án.",credentialsIsolated:"Thông tin xác thực và .anthropic vẫn được tách riêng cho mỗi tài khoản ở tất cả các chế độ.",implicationTitle:"Sau khi lưu sẽ như thế nào",isolatedImplication:"Tài khoản này sẽ tiếp tục tách biệt. Tài khoản khác sẽ không thể resume trạng thái continuity của nó.",sameGroupRule:'Các tài khoản phải dùng cùng nhóm "{{group}}" thì mới chia sẻ continuity cho nhau.',noSameGroupPeer:"Hiện chưa có tài khoản nào khác dùng nhóm này.",sameGroupPeerCount_one:"{{count}} tài khoản khác đã dùng nhóm này.",sameGroupPeerCount_other:"{{count}} tài khoản khác đã dùng nhóm này.",deeperReady_one:"{{count}} tài khoản cùng nhóm đã bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.",deeperReady_other:"{{count}} tài khoản cùng nhóm đã bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.",deeperNeedsPeers:"Tài khoản này đã bật deeper continuity, nhưng tài khoản khác trong cùng nhóm vẫn cần bật deeper continuity để hỗ trợ resume xuyên tài khoản tốt hơn.",standardWarning:"Chế độ shared tiêu chuẩn chỉ phù hợp cho ngữ cảnh project. Nếu người dùng mong resume xuyên tài khoản, cả hai tài khoản nên bật deeper continuity.",resumeOriginalWarning:"Nếu cuộc trò chuyện cũ quan trọng, hãy resume nó từ tài khoản gốc trước khi đổi cấu hình.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},historySyncLearningMap:{title:"Cách đồng bộ hóa lịch sử hoạt động",description:"Tách biệt -> Chia sẻ -> Sâu hơn. Dùng Sync trên từng dòng để áp dụng thay đổi.",learningMap:"Bản đồ học tập",isolated:"Tách biệt",shared:"Chia sẻ",deeper:"Sâu hơn",cliproxyManaged_one:"{{count}} Tài khoản nhóm CLIProxy Claude được quản lý trong trang Action Center / CLIProxy.",cliproxyManaged_other:"{{count}} Tài khoản CLIProxy Claude pool được quản lý trong trang Action Center / CLIProxy.",showDetails:"Hiển thị chi tiết: nhóm, chuyển đổi và chính sách kế thừa",modeSwitch:"Chuyển đổi chế độ",modeSwitchDesc:"Hộp thoại đồng bộ hóa cho phép người dùng di chuyển giữa cách ly/chia sẻ và chọn tính liên tục sâu hơn.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",historySyncGroupDesc:"Cùng một nhóm nghĩa là chia sẻ cùng bối cảnh project. Nếu để trống sẽ dùng nhóm mặc định.",sameGroupRule:"Hiện tại, các tài khoản chỉ chia sẻ continuity khi cả hai đều ở chế độ shared và dùng cùng một nhóm.",deeperRecommendation:'Nhóm "{{group}}" đã được chia sẻ, nhưng deeper continuity vẫn là lựa chọn an toàn hơn nếu người dùng mong resume xuyên tài khoản.',partialGroup:'Nhóm "{{group}}" đã ổn, nhưng các tài khoản hoặc nhóm khác vẫn cần hoàn thiện cấu hình cùng nhóm hoặc deeper continuity.',readyGroup:'Nhóm "{{group}}" đã có nhiều tài khoản bật deeper continuity. Đây là thiết lập handoff mạnh nhất hiện có.',legacyConfirmation_one:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng.",legacyConfirmation_other:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng."},continuityReadiness:{title:"Kiểm tra resume xuyên tài khoản",description:"Dùng thẻ này để biết còn thiếu gì trước khi người dùng chuyển tài khoản.",state:{single:"một tài khoản",isolated:"resume tắt","shared-alone":"đã shared nhưng chưa đủ","shared-standard":"chỉ project",partial:"mới sẵn sàng một phần",ready:"handoff mạnh đã sẵn sàng"},metrics:{isolated:"Tách biệt",sharedPeers:"Có bạn cùng nhóm",deeperReady:"Deeper sẵn sàng"},messages:{single:{title:"Hiện chỉ có một auth account.",description:"Cross-account handoff chưa áp dụng. Hãy thêm một auth account khác trước khi cấu hình shared continuity."},isolated:{title:"Hiện tại cross-account resume đang tắt.",description:"Tất cả tài khoản đang hiển thị đều ở chế độ isolated, nên phiên được tạo trong một tài khoản sẽ ở lại tài khoản đó."},"shared-alone":{title:"Đã có shared mode, nhưng chưa có nhóm nào có bạn cùng nhóm.",description_one:"{{count}} shared account vẫn đang chờ một tài khoản khác vào cùng nhóm.",description_other:"{{count}} shared accounts vẫn đang chờ một tài khoản khác vào cùng nhóm."},"shared-standard":{title:'Nhóm "{{group}}" đang chia sẻ ngữ cảnh project nhưng chưa ghép deeper continuity.',description:"Người dùng có thể mong nhiều hơn việc chia sẻ project. Hãy bật deeper continuity trên cả hai tài khoản trong nhóm này để có handoff mạnh hơn."},partial:{title:"Một nhóm đã sẵn sàng, nhưng cấu hình tổng thể vẫn còn lẫn lộn.",description:"Ít nhất một nhóm đã dùng deeper continuity, nhưng các tài khoản khác vẫn còn isolated, ở một mình trong nhóm shared, hoặc chưa bật deeper continuity."},ready:{title:'Nhóm "{{group}}" đã có thiết lập continuity mạnh nhất hiện có.',description:"Nhiều tài khoản trong nhóm này đã bật deeper continuity. Việc resume thực tế vẫn phụ thuộc vào dữ liệu mà Claude lưu ở upstream."}},stepsTitle:"Người dùng nên làm gì tiếp theo",steps:{syncBoth:"Mở Sync trên cả hai tài khoản, không chỉ tài khoản bạn sắp chuyển sang.",sameGroup:'Dùng cùng một History Sync Group trên cả hai tài khoản. "{{group}}" là nhóm được đề xuất hiện tại.',enableDeeper:"Nếu người dùng mong resume xuyên tài khoản thay vì chỉ chia sẻ project, hãy bật deeper continuity trên cả hai tài khoản.",resumeOriginal:"Nếu cuộc trò chuyện gốc quan trọng, hãy resume nó từ tài khoản gốc trước khi đổi cài đặt continuity."},singleSteps:{addAccount:"Hãy tạo thêm một ccs auth account thứ hai trước khi lên kế hoạch handoff xuyên tài khoản.",sameGroupLater:"Khi tài khoản thứ hai đã sẵn sàng, đặt cả hai vào cùng một History Sync Group.",enableDeeperLater:"Nếu sau này người dùng sẽ mong resume xuyên tài khoản, hãy bật deeper continuity trên cả hai tài khoản.",resumeOriginal:"Cho đến khi tài khoản thứ hai sẵn sàng, các cuộc trò chuyện quan trọng vẫn nên được resume từ tài khoản gốc."}},continuityOverview:{plainLaneTitle:"Plain ccs đang dùng một lane resume khác",plainLaneDescription:"Plain ccs hiện resume từ {{lane}}, không phải lane của tài khoản này. Hãy khôi phục lane gốc trước khi đổi cài đặt sync.",setDefaultHint:"Nếu muốn plain ccs theo một tài khoản trong các phiên sau, hãy dùng hành động Set Default trên dòng tài khoản đó.",recommendBadge:"Đề xuất {{group}}",partialBadge:"Đồng bộ một phần {{group}}",lane:{native:"Claude gốc (~/.claude)",accountDefault:"tài khoản {{name}}",accountInherited:"tài khoản {{name}} qua continuity inheritance",profileDefault:"profile mặc định {{name}} qua lane Claude gốc"}},accountsTable:{name:"Tên",type:"Kiểu",defaultBadge:"mặc định",created:"Ngày tạo",lastUsed:"Được sử dụng lần cuối",historySync:"Đồng bộ hóa lịch sử",sharedResources:"Tài nguyên",actions:"Hành động",syncTitle:"Chỉnh sửa chế độ đồng bộ, nhóm và độ sâu liên tục",resourcesTitle:"Chỉnh sửa kế thừa tài nguyên dùng chung",confirmLegacyTitle:"Xác nhận chế độ hiện tại của tài khoản cũ này là rõ ràng",sync:"Đồng bộ hóa",confirm:"Xác nhận",active:"Đang hoạt động",setDefault:"Đặt mặc định",deleteAccount:"Xóa tài khoản",cannotDeleteDefault:"Không thể xóa tài khoản mặc định",noAccounts:"Không tìm thấy tài khoản xác thực CCS nào. Sử dụng ccs auth create để thêm tài khoản.",resetToDefault:"Đặt lại về mặc định CCS",deleteDialogTitle:"Xóa tài khoản",deleteDialogDesc:'Bạn có chắc chắn muốn xóa tài khoản "{{name}}" không? Thao tác này sẽ xóa hồ sơ và tất cả dữ liệu phiên của nó. Không thể hoàn tác hành động này.',cancel:"Hủy bỏ",delete:"Xóa",sharedGroupStandard:"chia sẻ ({{group}}, tiêu chuẩn)",sharedGroupDeeper:"chia sẻ ({{group}}, sâu hơn)",sharedGroupLegacy:"chia sẻ ({{group}}, kế thừa tiêu chuẩn)",isolatedLegacy:"tách biệt (mặc định cũ)",isolated:"tách biệt",resourcesShared:"dùng chung",resourcesProfileLocal:"cục bộ hồ sơ",noSameGroupPeer:"Chưa có tài khoản cùng nhóm",sameGroupPeerCount_one:"{{count}} tài khoản cùng nhóm",sameGroupPeerCount_other:"{{count}} tài khoản cùng nhóm",legacyReview:"Hãy xem lại và xác nhận trạng thái suy ra này.",noHandoff:"Resume xuyên tài khoản vẫn sẽ quay về tài khoản gốc.",badges:{shared:"Chia sẻ",deeper:"Sâu hơn",legacy:"Kế thừa",isolated:"Tách biệt",profileLocal:"Cục bộ"}},addAccountDialog:{title:"Thêm tài khoản {{displayName}}",descKiro:"Chọn phương thức xác thực Kiro, sau đó xác thực qua trình duyệt hoặc nhập từ Kiro IDE.",descDeviceCode:"Nhấp vào Xác thực. Mã xác minh sẽ xuất hiện để bạn nhập vào trang web của nhà cung cấp.",descOauth:"Nhấp vào Xác thực để nhận URL OAuth. Mở nó trong bất kỳ trình duyệt nào để đăng nhập.",powerUserEnabled:"Đã bật chế độ power user",powerUserSkipped:"Chế độ power user trong Cài đặt > Proxy đang bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Bạn tự chịu hoàn toàn rủi ro OAuth/tài khoản.",powerUserLoadFailed:"Không thể tải cài đặt chế độ power user. Hãy kiểm tra Cài đặt > Proxy rồi thử lại.",powerUserLoading:"Đang tải cài đặt an toàn cho chế độ power user. Vui lòng đợi một chút rồi thử lại.",powerUserUnavailableRetry:"Chế độ power user hiện không khả dụng. Hãy hoàn tất bước an toàn bắt buộc của nhà cung cấp rồi thử lại.",authMethod:"Phương thức xác thực",selectKiroAuthMethod:"Chọn phương thức xác thực Kiro",gitlabAuthMethod:"Phương thức xác thực GitLab",selectGitlabAuthMethod:"Chọn phương thức xác thực GitLab",gitlabAuthOAuth:"OAuth trên trình duyệt",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"Dùng OAuth trên trình duyệt cho gitlab.com, hoặc PAT cho GitLab tự lưu trữ và môi trường do quản trị viên quản lý.",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"Tùy chọn. Để trống cho gitlab.com, hoặc nhập URL GitLab tự lưu trữ của bạn.",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"Token phải có ít nhất các scope",gitlabPatRequired:"PAT login yêu cầu GitLab Personal Access Token.",nicknameRequired:"Biệt danh (bắt buộc)",nicknameOptional:"Biệt danh (tùy chọn)",nicknamePlaceholder:"ví dụ: công việc, cá nhân",nicknameRequiredHint:"Bắt buộc với nhà cung cấp này. Dùng tên thân thiện duy nhất (ví dụ: work, personal).",nicknameOptionalHint:"Tên thân thiện để nhận biết tài khoản này. Để trống để dùng mã nhận dạng an toàn do hệ thống tạo.",waitingForAuth:"Đang chờ xác thực...",deviceCodeHint:"Hộp thoại mã xác minh sẽ sớm xuất hiện. Nhập mã trên trang web của nhà cung cấp.",browserHint:"Hoàn tất xác thực trong trình duyệt của bạn. Hộp thoại này sẽ tự động đóng lại.",openUrlLabel:"Mở URL này trong bất kỳ trình duyệt nào để đăng nhập:",copied:"Đã sao chép",copy:"Sao chép",open:"Mở",popupBlocked:"Cửa sổ bật lên bị chặn. Sao chép URL ở trên và mở thủ công trong trình duyệt của bạn.",redirectPasteLabel:"Chuyển hướng không hoạt động? Dán URL gọi lại:",callbackPlaceholder:"Dán URL chuyển hướng vào đây...",submitCallback:"Gửi cuộc gọi lại",submitting:"Đang gửi...",preparingUrl:"Đang chuẩn bị URL đăng nhập...",cancel:"Hủy bỏ",importingToken:"Đang nhập token từ Kiro IDE...",authenticate:"Xác thực",importFromIde:"Nhập từ IDE",importing:"Đang nhập..."},flowViz:{backToProviders:"Quay lại nhà cung cấp",showDetails:"Hiển thị chi tiết",hideDetails:"Ẩn chi tiết",showPausedAccounts:"Hiện tạm dừng ({{count}})",hidePausedAccounts:"Ẩn tạm dừng ({{count}})",visibleTotalRequests:"Yêu cầu hiển thị",visibleAccounts:"Tài khoản hiển thị",excludingPausedAccounts:"Đang loại trừ {{count}} tài khoản tạm dừng",resetLayout:"Đặt lại bố cục",provider:"Nhà cung cấp",totalRequests:"Tổng số yêu cầu",accounts:"Tài khoản",connectionTimeline:"Dòng thời gian kết nối",noRecentConnections:"Không có kết nối gần đây"},quickStats:{totalRequests:"Tổng số yêu cầu",successRate:"Tỷ lệ thành công",totalTokens:"Tổng số token",activeModels:"Mô hình hoạt động"},authMonitor:{accounts:"Tài khoản",accountsCount:"{{count}} tài khoản",success:"Thành công",failed:"Thất bại",successRate:"Tỷ lệ thành công"},accountCard:{resumeAccount:"Tiếp tục tài khoản",pauseAccount:"Tạm dừng tài khoản",quotaLoading:"Hạn ngạch...",quota:"hạn ngạch",quotaUnavailable:"Thông tin quota chưa khả dụng",reauthNeeded:"Cần xác thực lại",failureLabelReauth:"Xác thực lại",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"Không có quyền",failureLabelRetry:"Thử lại",failureLabelReconnect:"Kết nối lại",failureLabelTemporary:"Tạm thời",failureLabelUnavailable:"Chưa khả dụng",failureHintReauth:"Chạy lại luồng xác thực của tài khoản này để làm mới quyền truy cập.",failureHintWorkspace:"Chuyển tài khoản này về workspace còn hoạt động rồi xóa và thêm lại.",failureHintNoAccess:"Tài khoản này không thể truy cập endpoint quota của nhà cung cấp.",failureHintRetry:"Đợi một chút rồi thử lại yêu cầu quota.",failureHintReconnect:"Xóa tài khoản cũ rồi xác thực lại.",failureHintTemporary:"Có vẻ đây là lỗi tạm thời. Hãy thử lại sau.",removeAndReadd:"Xóa và thêm lại tài khoản",autoRefreshFailed:"Tự động làm mới không thành công"},antigravityChecklist:{title:"Trách nhiệm OAuth Antigravity",subtitle:"Hoàn thành tất cả 4 bước trước khi bạn có thể xác thực.",mandatory:"Bắt buộc",completion:"Hoàn thành",stepsCount:"{{current}}/4 bước"},accountSafetyWarning:{title:"Cảnh báo an toàn tài khoản OAuth",subtitle:"Vấn đề #509 · Rủi ro Gemini + AGY OAuth",firstLine:"Issue #509 ghi nhận các trường hợp bị đình chỉ/cấm liên quan đến ccs agy và việc dùng chung tài khoản giữa ccs gemini và ccs agy.",secondLine:"Chỉ tiếp tục nếu bạn chấp nhận hoàn toàn trách nhiệm về OAuth và rủi ro truy cập tài khoản.",issueLabel:"Đọc vấn đề #509",proxySettingsLabel:"Điều khiển Gemini + AGY: Cài đặt > Proxy"},cliproxyDialog:{name:"Tên",provider:"Nhà cung cấp",account:"Tài khoản",accountOptional:"Tài khoản (tùy chọn)",model:"Mô hình",modelOptional:"Mô hình (tùy chọn)",defaultTarget:"Mục tiêu mặc định",defaultTier:"Cấp mặc định",tierConfig:"Cấu hình cấp độ",selectProvider:"Chọn nhà cung cấp...",useDefaultAccount:"Sử dụng tài khoản mặc định",defaultSuffix:"(mặc định)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Hủy bỏ",create:"Tạo",creating:"Đang tạo...",saveChanges:"Lưu thay đổi",saving:"Đang lưu...",placeholderName:"Gemini của tôi",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Chỉnh sửa biến thể tổng hợp: {{name}}",editSingleTitle:"Chỉnh sửa biến thể: {{name}}"},profileEditor:{profileInfo:"Thông tin hồ sơ",profileName:"Tên hồ sơ",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",runWithProfile:"Chạy với hồ sơ",runOnDroid:"Chạy trên Droid",runOnDroidWithFlag:"Chạy trên Droid (--target)",droidAliasExplicit:"Bí danh Droid (rõ ràng)",overrideToClaude:"Ghi đè lên Claude",overrideToClaudeExplicit:"Ghi đè lên Claude (rõ ràng)",targetHintPreferredAlias:"Bí danh rõ ràng nên dùng:",targetHintClaudeDefault:"Lệnh mặc định:",targetHintLegacyAlias:"Lối tắt cũ vẫn dùng được:",targetHintOverride:"Bạn vẫn có thể ghi đè mỗi lần chạy bằng",setAsDefault:"Đặt làm mặc định",provider:"Nhà cung cấp",custom:"Tùy chỉnh",providerChooserHint:"Bắt đầu với preset, sau đó bạn vẫn có thể chỉnh URL, API key và ánh xạ mô hình.",featuredProviders:"Nhà cung cấp nổi bật",scrollHint:"Có thể cuộn ngang trên màn hình hẹp",customEndpoint:"Endpoint tùy chỉnh",morePresets:"Thêm preset",customEndpointDescription:"Bắt đầu với URL tương thích Anthropic trống và tự cấu hình mọi thứ."},settings:{sectionLoadFailed:"Không tải được phần",unknownError:"Đã xảy ra lỗi không xác định",reloadPage:"Tải lại trang",refresh:"Làm mới",copy:"Sao chép",copied:"Đã sao chép",saved:"Đã lưu",loading:"Đang tải...",configFileNotFound:"Không tìm thấy tập tin cấu hình"},settingsTabs:{browser:"Trình duyệt",web:"Web",image:"Hình ảnh",channels:"Kênh",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu"},settingsAuth:{failedFetchTokens:"Không thể tải token xác thực",failedSaveTokens:"Không thể lưu token",tokensUpdated:"Đã cập nhật token. Khởi động lại CLIProxy để áp dụng.",failedRegenerate:"Không thể tạo lại bí mật",secretRegenerated:"Bí mật quản lý mới được tạo. Khởi động lại CLIProxy để áp dụng.",failedReset:"Không thể đặt lại token",tokensReset:"Token đã được đặt lại về mặc định. Khởi động lại CLIProxy để áp dụng.",description:"Cấu hình token xác thực CLIProxy. Các thay đổi yêu cầu khởi động lại CLIProxy.",apiKey:"Khóa API",custom:"Tùy chỉnh",apiKeyDesc:"Được Claude Code dùng để xác thực qua CLIProxy",apiKeyPlaceholder:"Khóa API",managementSecret:"Bí mật quản lý",managementSecretDesc:"Được bảng điều khiển CCS sử dụng để truy cập API quản lý CLIProxy",managementSecretPlaceholder:"Bí mật quản lý",generateSecret:"Tạo bí mật an toàn mới",resetDefaults:"Đặt lại về mặc định",resetDesc:"Đặt lại cả khóa API và bí mật quản lý về giá trị mặc định.",saving:"Đang lưu...",save:"Lưu"},settingsGlobalEnv:{description:"Biến môi trường được áp dụng cho tất cả hồ sơ không dùng Claude subscription (gemini, codex, agy, ghcp, v.v.)",enabled:"Đã bật Env toàn cầu",disabled:"Env toàn cầu bị vô hiệu hóa",enabledDesc:"Biến Env sẽ được áp dụng cho các hồ sơ bên thứ ba",disabledDesc:"Biến Env sẽ không được áp dụng",envVars:"Biến môi trường",noneConfigured:"Không có biến môi trường nào được cấu hình",addNew:"Thêm biến mới",keyName:"KEY_NAME",value:"giá trị",add:"Thêm",quickAdd:"Thêm nhanh các biến phổ biến",allConfigured:"Tất cả biến phổ biến đã được cấu hình"},settingsBackups:{failedFetch:"Không tìm nạp được bản sao lưu",failedRestore:"Không thể khôi phục bản sao lưu",restoreSuccess:"Đã khôi phục bản sao lưu thành công",title:"Sao lưu cài đặt",description:"Khôi phục các phiên bản trước của tệp settings.json của bạn. Bản sao lưu được tạo tự động khi cài đặt được sửa đổi.",none:"Không có bản sao lưu nào",noneHint:"Bản sao lưu sẽ xuất hiện ở đây khi bạn sửa đổi cài đặt",latest:"Mới nhất",restoring:"Đang khôi phục...",restore:"Khôi phục",restoreConfirmTitle:"Khôi phục bản sao lưu?",restoreConfirmPrefix:"Điều này sẽ thay thế cài đặt hiện tại của bạn bằng bản sao lưu từ",restoreConfirmSuffix:"Không thể hoàn tác hành động này.",cancel:"Hủy bỏ"},settingsWebsearch:{description:"Tìm kiếm trên web dựa trên CLI cho hồ sơ của bên thứ ba (gemini, codex, agy, v.v.)",enabled:"Đã bật Tìm kiếm trên web",disabled:"Tìm kiếm trên web bị vô hiệu hóa",checking:"Đang kiểm tra trạng thái...",providers:"Nhà cung cấp",noneConfigured:"Không có nhà cung cấp nào được cấu hình",noneConfiguredHint:"Cài công cụ CLI để bật các nhà cung cấp WebSearch",checkProviders:"Kiểm tra các nhà cung cấp",installed:"đã cài đặt",notInstalled:"chưa được cài đặt",model:"Mô hình:",howInstall:"Cách cài đặt {{name}} CLI",installGlobally:"Cài đặt trên toàn cầu",requiresKey:"(cần khóa API xAI)",freeTier:"(Có sẵn cấp MIỄN PHÍ)",viewDocs:"Xem tài liệu"},settingsProxy:{failedLoadAgyMode:"Không thể tải chế độ power user",failedUpdateAgyMode:"Không thể cập nhật chế độ power user",failedVerifyAgyMode:"Không thể xác minh trạng thái lưu của chế độ power user",notPersistedAgyMode:"Chế độ power user chưa được lưu bền vững. Cấu hình có thể đã bị tiến trình khác sửa.",agyModeEnabled:"Đã bật chế độ power user.",agyModeDisabled:"Đã tắt chế độ power user.",typePhraseToContinue:'Nhập "{{value}}" để tiếp tục.',description:"Định cấu hình kết nối {{backend}} cục bộ hoặc từ xa cho cấu hình dựa trên proxy",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Trạng thái phiên bản",connectionMode:"Chế độ kết nối",local:"Cục bộ",remote:"Từ xa",localDesc:"Chạy nhị phân {{backend}} trên máy này",remoteDesc:"Kết nối với máy chủ {{backend}} từ xa",backendBinary:"Tệp thực thi backend",stopProxyToSwitch:"Dừng proxy đang chạy trong Trạng thái phiên bản trước khi chuyển backend.",default:"Mặc định",plusDesc:"Nhánh tùy chọn cho các nhà cung cấp bổ sung. Vẫn được hỗ trợ nhưng hiện do cộng đồng duy trì thay vì upstream.",originalDesc:"Backend mặc định, luôn sẵn sàng cho nhóm nhà cung cấp cốt lõi.",plusFallbackNotice:"Nhánh nhà cung cấp Plus chưa bị khai tử, nhưng CLIProxy cục bộ vẫn quay về backend gốc cho tới khi đường dẫn fork được duy trì được bật lại.",variantsIncompatible:"Các biến thể plus-extra hiện có ({{providers}}) sẽ không chạy trên backend gốc. Có thể giữ lại để tham chiếu, nhưng hãy chuyển sang Plus trước khi dùng.",safety:"An toàn",agyModeTitle:"Chế độ power user Antigravity + Gemini",agyModeDesc:"Bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ xác nhận của Gemini trên dashboard.",agyWarning:"Chỉ bật nếu bạn hiểu rõ rủi ro bị đình chỉ/cấm OAuth (#509). CCS không chịu trách nhiệm khi mất tài khoản.",finalConfirm:"Xác nhận cuối cùng",finalConfirmDesc:"Việc bật tính năng này sẽ bỏ qua các điểm kiểm tra an toàn AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Xem lại vấn đề #509 và nhập cụm từ chính xác để tiếp tục.",step1:"Bước 1",readIssue:"Đọc vấn đề #509",step2:"Bước 2",typePrefix:"Nhập",typeSuffix:"để kích hoạt.",typePhraseAria:"Nhập I ACCEPT RISK để bật chế độ power user Antigravity + Gemini",exactPhrase:"Phải nhập chính xác cụm từ.",enableAgyMode:"Bật chế độ power user Antigravity + Gemini",toggleAgyMode:"Chuyển đổi chế độ power user Antigravity + Gemini",fallbackSettings:"Cài đặt dự phòng",enableFallback:"Cho phép dự phòng về cục bộ",enableFallbackDesc:"Sử dụng proxy cục bộ nếu không thể truy cập được từ xa",autoStartLocal:"Tự động khởi động proxy cục bộ",autoStartLocalDesc:"Tự động khởi động proxy cục bộ khi dự phòng",advanced:"Nâng cao",debugMode:"Chế độ gỡ lỗi",debugModeDesc:"Bật chẩn đoán dành cho nhà phát triển trong bảng điều khiển trình duyệt",debugModeEnabled:"Đã bật chế độ gỡ lỗi. Kiểm tra bảng điều khiển trình duyệt để biết nhật ký chi tiết.",localProxy:"Proxy cục bộ",port:"Cổng",autoStart:"Tự động khởi động",localAutoStartDesc:"Tự động khởi động proxy cục bộ khi cần",remoteConfigTitle:"Cấu hình máy chủ từ xa",host:"Host",hostPlaceholder:"192.168.1.100 hoặc proxy.example.com",defaultPort:"mặc định {{value}}",portPlaceholder:"Để trống để dùng {{value}}",protocol:"Giao thức",http:"HTTP",https:"HTTPS",apiKeyOptional:"Khóa API (tùy chọn)",apiKeyPlaceholder:"Đối với điểm cuối API /v1/*",apiKeyDesc:"Dùng cho các yêu cầu API đến /v1/chat/completions",managementKeyOptional:"Khóa quản lý (tùy chọn)",managementKeyPlaceholder:"Đối với điểm cuối /v0/management/*",managementKeyDesc:"Dùng cho API quản lý dashboard. Nếu bỏ trống sẽ dùng Khóa API.",testing:"Đang thử nghiệm...",testConnection:"Kiểm tra kết nối",connectedLatency:"Đã kết nối ({{value}}ms)",connectionFailed:"Kết nối không thành công",invalidPortOrEmpty:"Cổng phải là số nguyên từ 1 đến 65535 hoặc để trống theo mặc định",invalidLocalPort:"Cổng cục bộ phải là số nguyên từ 1 đến 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Định cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",supportedProviders:"Nhà cung cấp được hỗ trợ",modeTitle:"Chế độ Thinking",modeAutoDesc:"Tự động thiết lập tư duy dựa trên tầng mô hình",modeOffDesc:"Vô hiệu hóa suy nghĩ mở rộng",modeManualDesc:"Đặt mức ghi đè liên tục hoặc sử dụng cờ CLI mỗi lần chạy",tierDefaults:"Mặc định cấp độ",tierDefaultsDesc:"Mức độ tư duy mặc định cho từng tầng mô hình khi ở chế độ tự động.",persistentOverride:"Ghi đè liên tục",persistentOverrideDesc:"Áp dụng cho tất cả các buổi. Cờ CLI vẫn được ưu tiên.",enterCustomBudget:"Nhập ngân sách tùy chỉnh",apply:"Áp dụng",providerOverrides:"Ghi đè nhà cung cấp ({{count}})",providerOverridesDesc:"Ghi đè mặc định cấp độ cho các nhà cung cấp cụ thể. Thêm khóa nhà cung cấp tùy chỉnh nếu cần.",addProviderPlaceholder:"Thêm khóa nhà cung cấp (ví dụ: qwen)",showWarnings:"Hiển thị cảnh báo",showWarningsDesc:"Hiển thị cảnh báo khi các giá trị suy nghĩ bị hạn chế hoặc điều chỉnh",cliEnvOverride:"Ghi đè CLI & Env",supportLine1Prefix:"Ngân sách suy nghĩ:",supportLine1Suffix:"(dựa trên token)",supportLine2Prefix:"Nỗ lực lý luận:",supportLine2SuffixPrefix:"(hậu tố hoặc ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Hậu tố Codex cố định mức effort (ví dụ ",supportLine3Suffix:"); model không hậu tố sẽ dùng chế độ Thinking."},analytics:{title:"Phân tích",noDailyUsage:"Không có dữ liệu sử dụng cho hôm nay",noUsageData:"Không có dữ liệu sử dụng",subtitle:"Theo dõi việc sử dụng và thông tin chi tiết",month:"Tháng",allTime:"Tất cả thời gian",updated:"Đã cập nhật {{value}}"},analyticsSummary:{totalTokens:"Tổng số token",totalTokensSubtitle:"{{input}} vào / {{output}} ra",totalCost:"Tổng chi phí",totalCostSubtitle:"trung bình ${{value}}/ngày",cacheTokens:"Token bộ đệm",cacheTokensSubtitle:"${{cost}} ({{percent}}% chi phí)",inputCost:"Chi phí đầu vào",outputCost:"Chi phí đầu ra",tokensSubtitle:"{{value}} token"},apiProfiles:{title:"Hồ sơ API",sidebarTitle:"Hồ sơ API",sidebarSubtitle:"API cao cấp, runtime cục bộ, endpoint tùy chỉnh",new:"Mới",searchPlaceholder:"Tìm kiếm hồ sơ...",loadingProfiles:"Đang tải hồ sơ...",failedLoadTitle:"Không tải được hồ sơ",failedLoadDesc:"Không thể tìm nạp hồ sơ API. Vui lòng thử lại.",retry:"Thử lại",noProfilesYet:"Chưa có hồ sơ API nào",noProfilesDesc:"Tạo hồ sơ đầu tiên của bạn để kết nối với các điểm cuối API tùy chỉnh",createProfile:"Tạo hồ sơ",noProfileMatch:'Không có hồ sơ nào khớp với "{{query}}"',profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",configuredCount:"{{count}} đã cấu hình",deleteProfileTitle:"Xóa hồ sơ",deleteProfileDesc:'Bạn có chắc chắn muốn xóa "{{name}}" không? Thao tác này sẽ xóa tệp cài đặt và không thể hoàn tác.',delete:"Xóa",unsavedChangesTitle:"Những thay đổi chưa được lưu",unsavedChangesDesc:'Bạn có những thay đổi chưa được lưu trong "{{current}}". Hủy và chuyển sang "{{next}}"?',discardSwitch:"Loại bỏ và chuyển đổi",noOrphansFound:"Không tìm thấy cấu hình hồ sơ mồ côi",confirmRegisterOrphans:"Đã tìm thấy {{total}} tệp cấu hình hồ sơ mồ côi, trong đó {{valid}} tệp sẵn sàng đăng ký. Đăng ký ngay?",registeredWithSkipped:" (bỏ qua {{count}})",registeredProfiles:"Đã đăng ký {{count}} hồ sơ",copyPrompt:'Sao chép "{{name}}" sang tên hồ sơ mới nào?',destinationEmpty:"Tên hồ sơ đích không được để trống",exportRedacted:"Bản xuất đã được che token. Dùng luồng include-secrets trong CLI nếu cần.",exportDownloaded:"Đã tải xuống bản xuất hồ sơ",importFailed:"Không nhập được gói hồ sơ",discoverOrphans:"Phát hiện hồ sơ mồ côi",importProfileBundle:"Nhập gói hồ sơ"},accountsPage:{title:"Tài khoản",managePrefix:"Quản lý",manageSuffix:"tài khoản và nhóm đồng bộ từ một nơi.",mobileManageSuffix:"tính liên tục cho mỗi tài khoản.",primaryActions:"Hành động chính",createAccount:"Tạo tài khoản",authClaudeInPool:"Xác thực Claude trong Pool",openClaudePoolSettings:"Mở cài đặt Claude pool",openCliProxyClaudePool:"Mở CLIProxy Claude Pool",migrationFollowup:"Theo dõi sau di chuyển",legacyContextPending:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContextPending_other:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContinuityPending:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",legacyContinuityPending_other:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",confirmingLegacy:"Đang xác nhận chính sách kế thừa...",confirmLegacy:"Xác nhận chính sách kế thừa ({{count}})",noLegacyFollowup:"Không có hoạt động theo dõi kế thừa nào đang chờ xử lý.",continuityGuide:"Hướng dẫn liên tục",expandWhenNeeded:"Chỉ mở rộng khi cần thiết.",sharedStandard:"Tiêu chuẩn chung",sharedStandardDesc:"Chỉ đồng bộ hóa không gian làm việc của dự án. Mặc định tốt nhất cho hầu hết các đội.",sharedDeeper:"Chia sẻ sâu hơn",sharedDeeperDesc:"Đồng bộ thêm session-env, file-history, shell-snapshots và todos. Nên dùng khi người dùng mong resume xuyên tài khoản.",sharedDeeperPrefix:"Thêm",isolated:"Tách biệt",isolatedDesc:"Không có liên kết. Tốt nhất cho sự tách biệt nghiêm ngặt.",quickCommands:"Lệnh nhanh",quickCommandsDesc:"Sao chép và chạy trong terminal.",workspaceBadge:"Không gian làm việc `ccs auth`",historySyncBadge:"Kiểm soát đồng bộ hóa lịch sử",resourcesBadge:"Kiểm soát tài nguyên dùng chung",resourcesShared:"Dùng chung",resourcesProfileLocal:"Cục bộ hồ sơ",authAccounts:"Tài khoản xác thực",tableScopePrefix:"Bảng này được cố ý đặt trong phạm vi",tableScopeMiddle:"tài khoản. Sử dụng",tableScopeSuffix:"để thay đổi chế độ/nhóm/độ sâu.",accountMatrix:"Ma trận tài khoản",sharedTotalDesc:"Tổng số tài khoản chia sẻ: {{count}}. Bao gồm thao tác Sync và xác nhận kế thừa.",loadingAccounts:"Đang tải tài khoản..."},health:{justNow:"vừa xong",secondsAgo:"{{count}} giây trước",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",systemHealth:"Tình trạng hệ thống",build:"bản dựng {{version}}",lastScan:"Lần quét cuối cùng:",autoRefresh:"Tự động làm mới:",refresh:"Làm mới",checks:"Kiểm tra",version:"Phiên bản",platform:"Nền tảng",liveMonitoring:"Giám sát trực tiếp đang hoạt động",copied:"Đã sao chép vào bảng nhớ tạm",refreshing:"Đang làm mới kiểm tra trạng thái...",fix:"Sửa chữa",applyFix:"Áp dụng bản sửa lỗi",healthLabel:"trạng thái"},updates:{actionRequired:"Hành động bắt buộc",done:"Xong",all:"Tất cả",inboxTitle:"Trung tâm cập nhật",inboxSubtitle:"Tập trung vào các hành động, sau đó đánh dấu các cập nhật đã hoàn tất hoặc bị loại bỏ.",needsAction:"Cần hành động",doneCount:"Xong",searchPlaceholder:"Tìm kiếm hành động hoặc lệnh",noNotices:"Không có thông báo nào khớp với chế độ xem này.",noUpdates:"Hiện không có bản cập nhật nào.",published:"Đã xuất bản {{date}}",markDone:"Đánh dấu hoàn tất",dismiss:"Ẩn",reopen:"Mở lại",doNext:"Làm tiếp theo",impactedIntegrations:"Tích hợp bị ảnh hưởng",impactedDesc:"Các khu vực liên quan dựa trên phạm vi cập nhật và định tuyến.",whyMatters:"Tại sao nó quan trọng",whyMattersDesc:"Chỉ ngữ cảnh ngắn, không có ghi chú phát hành trên tường văn bản.",open:"Mở",progressNeedsAction:"Cần hành động",progressInReview:"Đang xem xét",progressDone:"Xong",progressDismissed:"Bị loại bỏ",statusNew:"Mới",statusStable:"Ổn định",statusPlanned:"Đã lên kế hoạch",dashboard:"Trang tổng quan",cliUsage:"Cách sử dụng CLI"},cliproxyPage:{connected:"Đã kết nối",notConnected:"Chưa kết nối",variant:"Biến thể",parentNotConnected:"Profile gốc chưa kết nối",viaProvider:"qua {{provider}}",emptyTitle:"Trình quản lý hồ sơ CCS",emptyDesc:"Quản lý xác thực OAuth, tùy chọn tài khoản và chọn mô hình cho nhà cung cấp CLIProxy. Cấu hình cách CCS định tuyến yêu cầu đến các backend AI khác nhau.",emptyControlPanelPrefix:"Để biết số liệu thống kê sử dụng trực tiếp và theo dõi thời gian thực, hãy truy cập",controlPanel:"Bảng điều khiển",quickSetup:"Thiết lập nhanh",addAccount:"Thêm tài khoản",advancedVariant:"Biến thể nâng cao",setupActionsHint:"Thêm tài khoản tại đây. Chỉ tạo biến thể khi cần runtime/profile riêng.",accountManagement:"Quản lý tài khoản cấp CCS",providers:"Nhà cung cấp",variants:"Biến thể",providerCount:"{{count}} nhà cung cấp",providerCount_other:"{{count}} nhà cung cấp",connectedCount:"{{count}} đã kết nối",variantDisplay:"{{name}} (biến thể {{provider}})"},copilotPage:{title:"Copilot",subtitle:"Cầu nối tương thích GitHub Copilot đã ngừng ưu tiên",deprecatedBadge:"Đã ngừng ưu tiên",deprecationTitle:"Cầu nối tương thích đã ngừng ưu tiên",deprecationItem1:"GitHub Copilot bắt đầu tính phí theo mức dùng từ 2026-06-01",deprecationItem2:"Thiết lập cục bộ hiện có vẫn được giữ cho tương thích",deprecationItem3:"Thiết lập mới nên dùng Codex hoặc nhà cung cấp còn hoạt động",setup:"Cài đặt",auth:"Xác thực",daemon:"Daemon",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"API được thiết kế ngược - có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Việc sử dụng quá mức có thể gây ra hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",yes:"Có",no:"Không",installed:"Đã cài đặt",missing:"Thiếu",integration:"Tích hợp",enabled:"Đã bật",disabled:"Đã tắt",github:"GitHub",connected:"Đã kết nối",notConnected:"Chưa kết nối",authenticate:"Xác thực",authenticating:"Đang xác thực...",status:"Trạng thái",running:"Đang chạy",stopped:"Đã dừng",port:"Cổng",stopping:"Đang dừng...",stop:"Dừng lại",starting:"Đang bắt đầu...",start:"Bắt đầu",installing:"Đang cài đặt...",installCopilotApi:"Cài đặt copilot-api",proxy:"Proxy",active:"Đang hoạt động",inactive:"Không hoạt động"},cursorPage:{title:"Cursor",beta:"Beta",deprecated:"Đã ngừng ưu tiên",subtitle:"Cầu nối cục bộ đã bị ngừng ưu tiên cho các thiết lập Cursor cũ",unofficialTitle:"Cầu nối cũ đã bị ngừng ưu tiên - hãy dùng Cursor qua CLIProxy",unofficialItem1:"Đường dẫn được hỗ trợ: xác thực và quản lý tài khoản Cursor qua CLIProxy",unofficialItem2:"Cầu nối cục bộ reverse-engineered này chỉ còn dành cho các thiết lập cũ",unofficialItem3:"CCS không bảo hành và không chịu trách nhiệm cho đường dẫn cũ này",supportedPathTitle:"Đường dẫn được hỗ trợ",supportedPathDesc:"Hãy dùng xác thực và quản lý tài khoản Cursor qua CLIProxy cho các thiết lập mới. Chỉ giữ cầu nối cũ bên dưới nếu bạn vẫn phụ thuộc vào luồng daemon cục bộ trước đây.",startCliproxyAuth:"Bắt đầu xác thực Cursor qua CLIProxy",openCliproxyCursor:"Mở Cursor trong CLIProxy",integration:"Tích hợp",authentication:"Xác thực",daemon:"Daemon",enabled:"Đã bật",disabled:"Đã tắt",expired:"Hết hạn",connected:"Đã kết nối",notConnected:"Chưa kết nối",running:"Đang chạy",stopped:"Đã dừng",actions:"Hành động cũ",disableIntegration:"Vô hiệu hóa tích hợp",enableIntegration:"Kích hoạt tích hợp",autoDetectAuth:"Tự dò IDE cũ",manualAuthImport:"Nhập thủ công kiểu cũ",stopDaemon:"Dừng Daemon",startDaemon:"Khởi động Daemon",port:"Cổng",configuration:"Cấu hình Cursor",lastModified:"Sửa đổi lần cuối:",neverSaved:"Chưa bao giờ lưu",saving:"Đang lưu...",save:"Lưu",modelConfig:"Cấu hình mô hình",settings:"Cài đặt",info:"Thông tin",presets:"Cài đặt sẵn",presetsDesc:"Áp dụng ánh xạ mô hình được cấu hình sẵn",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Định cấu hình mô hình nào sẽ sử dụng cho từng tầng",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không chỉ định tier cụ thể.",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Lý luận phức tạp và phản hồi chất lượng cao nhất.",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Khối lượng công việc mã hóa chung và trò chuyện hàng ngày.",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Đường dẫn yêu cầu nhẹ, độ trễ thấp.",runtimeSettings:"Cài đặt thời gian chạy",autoStartDaemon:"Daemon tự động khởi động",autoStartDesc:"Tự động khởi động daemon Cursor khi dùng tích hợp.",ghostMode:"Chế độ ma",ghostModeDesc:"Gửi x-ghost-mode để giảm telemetry.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",availableModels:"Mô hình khả dụng",loadingModels:"Đang tải mô hình...",noModels:"Chưa có siêu dữ liệu mô hình nào. Bắt đầu daemon và làm mới.",default:"Mặc định",rawConfiguration:"Cấu hình thô (JSON)",manualImportTitle:"Nhập xác thực Cursor thủ công",manualImportDesc:"Cung cấp access token và machine ID của Cursor nếu không tự phát hiện được.",accessToken:"Access token",accessTokenPlaceholder:"Dán access token của Cursor",machineId:"ID máy",machineIdPlaceholder:"Hex 32 ký tự (UUID không có dấu gạch nối)",cancel:"Hủy bỏ",import:"Nhập",selectModel:"Chọn mô hình",useDefaultModel:"Sử dụng mô hình mặc định",availableModelCount:"Mô hình khả dụng ({{count}})",invalidPort:"Cổng phải là số nguyên từ 1 đến 65535",defaultModelRequired:"Mô hình mặc định là bắt buộc",savedConfig:"Đã lưu cấu hình Cursor và ánh xạ mô hình",failedSaveConfig:"Không lưu được cấu hình",modelsLoadingWait:"Mô hình vẫn đang tải. Vui lòng đợi trước khi áp dụng preset.",noModelsAvailable:"Chưa có mô hình nào. Hãy khởi động daemon rồi làm mới.",appliedCodexPreset:"Đã áp dụng preset Codex GPT-5.3",appliedClaudePreset:"Đã áp dụng preset Claude 4.6",appliedGeminiPreset:"Đã áp dụng preset Gemini 3",integrationEnabled:"Đã bật tích hợp Cursor",integrationDisabled:"Đã tắt tích hợp Cursor",failedUpdateIntegration:"Không cập nhật được trạng thái tích hợp",credentialsImported:"Đã nhập thông tin xác thực Cursor",autoDetectFailed:"Tự động phát hiện không thành công",manualRequired:"Cần token và machine ID",manualImportFailed:"Nhập thủ công không thành công",failedStartDaemon:"Không thể khởi động daemon",daemonStarted:"Đã khởi động daemon",daemonStartedWithPid:"Daemon đã khởi động (PID: {{pid}})",failedStopDaemon:"Không thể dừng daemon",daemonStopped:"Đã dừng daemon",rawLoading:"Cài đặt thô vẫn đang tải. Vui lòng đợi và thử lại.",invalidJson:"JSON không hợp lệ",rawSaved:"Đã lưu cài đặt thô",rawChanged:"Cài đặt thô đã thay đổi bên ngoài. Làm mới và thử lại.",failedSaveRaw:"Không lưu được cài đặt thô",savedAll:"Đã lưu cấu hình Cursor",liveProbe:"Kiểm tra trực tiếp",runLiveProbe:"Chạy kiểm tra trực tiếp",rerunLiveProbe:"Chạy lại kiểm tra trực tiếp",probing:"Đang kiểm tra...",probeNotRun:"Chưa chạy kiểm tra",probeLocalReadinessHint:"Các kiểm tra sẵn sàng cục bộ có thể đạt, nhưng luồng chạy thực tế vẫn có thể lỗi. Hãy dùng kiểm tra trực tiếp để xác minh toàn bộ đường đi của Cursor.",probeStage:"Giai đoạn",probeHttpStatus:"Trạng thái HTTP",probeDuration:"Thời lượng",probeModel:"Mô hình",probeMessage:"Thông điệp",probeSucceeded:"Kiểm tra thành công",probeFailed:"Kiểm tra thất bại",probeSaveFirst:"Hãy lưu hoặc bỏ các thay đổi Cursor trước khi chạy kiểm tra trực tiếp",refreshStatus:"Làm mới trạng thái Cursor",refreshConfiguration:"Làm mới cấu hình Cursor"},droidPage:{loadingDiagnostics:"Đang tải chẩn đoán Droid...",failedDiagnostics:"Không tải được chẩn đoán Droid.",overview:"Tổng quan",byok:"BYOK",docs:"Tài liệu",runtimeInstall:"Thời gian chạy và cài đặt",status:"Trạng thái",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn nhị phân",installDirectory:"Thư mục cài đặt",version:"Phiên bản",overridePath:"Ghi đè (CCS_DROID_PATH)",configFiles:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã giải quyết",size:"Kích cỡ",lastModified:"Sửa đổi lần cuối",parseWarning:"Cảnh báo phân tích cú pháp: {{value}}",readWarning:"Đọc cảnh báo: {{value}}",warnings:"Cảnh báo",byokSummary:"Tóm tắt BYOK",activeModelSelector:"Bộ chọn mô hình hoạt động",customModels:"Mô hình tùy chỉnh",ccsManaged:"do CCS quản lý",userManaged:"Do người dùng quản lý",malformedEntries:"Mục nhập không đúng định dạng",providers:"Nhà cung cấp",none:"không có",customModelsTitle:"Mô hình tùy chỉnh",modelName:"Tên/model",provider:"Nhà cung cấp",baseUrl:"URL cơ sở",noCustomModels:"Không có mô hình tùy chỉnh",docsAlignedNotes:"Ghi chú được căn chỉnh trong Tài liệu",factoryDocs:"Tài liệu Factory",providerFactCheckDocs:"Tài liệu kiểm tra thực tế của nhà cung cấp",providerValues:"Giá trị của nhà cung cấp: {{value}}",settingsHierarchy:"Phân cấp cài đặt: {{value}}",settingsTitle:"Cài đặt BYOK của Droid",fixJsonBeforeQuickSettings:"Sửa cú pháp JSON trước khi sử dụng các điều khiển cài đặt nhanh.",fixJsonBeforeReasoning:"Sửa cú pháp JSON trước khi cập nhật cài đặt lý luận BYOK.",unableUpdateReasoning:"Không thể cập nhật cài đặt lý luận mô hình BYOK đã chọn.",fixJsonBeforeBudget:"Sửa cú pháp JSON trước khi cập nhật ngân sách tư duy.",anthropicOnlyBudget:"Ngân sách tư duy chỉ có sẵn cho các mô hình BYOK của Anthropic.",invalidJson:"JSON không hợp lệ: {{value}}",saved:"Đã lưu cài đặt Droid",changedExternally:"Cài đặt Droid đã thay đổi bên ngoài. Làm mới và thử lại.",failedSave:"Không lưu được cài đặt Droid"},sharedPage:{commands:"Lệnh",skills:"Kỹ năng",agents:"Agent",plugins:"Plugin",settings:"Cài đặt",title:"Tài nguyên dùng chung",subtitle:"Lệnh, kỹ năng, agent, plugin và cấu hình được chia sẻ giữa các tài khoản",totalShared:"Tổng số mục dùng chung",visible:"Hiển thị",markdownDetail:"Chế độ xem chi tiết Markdown",registryDetail:"Chế độ xem chi tiết registry",maskedSettingsDetail:"Chế độ xem cài đặt đã ẩn nhạy cảm",filterPrefix:"Lọc:",configurationRequired:"Cần cấu hình",countsUnavailable:"Không có số liệu",retryCounts:"Số lần thử lại",filterPlaceholder:"Lọc {{tab}} theo tên, mô tả hoặc đường dẫn",showing:"Đang hiển thị {{visible}} trong số {{total}} {{tab}}",showingQuery:'cho "{{query}}"',refreshing:"(đang làm mới...)",loadingShared:"Đang tải {{tab}} dùng chung...",failedLoadShared:"Không tải được danh sách {{tab}} dùng chung",retry:"Thử lại",noSharedFound:"Không tìm thấy {{tab}} dùng chung. Chạy `ccs sync` hoặc thêm mục trong thư mục dùng chung của bạn.",noPluginsFound:"Chưa cài plugin dùng chung. Tệp registry plugin và thư mục cache sẽ bị ẩn cho đến khi có plugin thật.",noMatch:'Không có {{tab}} khớp với "{{query}}".',selectOne:"Chọn {{tab}} để xem toàn bộ nội dung.",pathLabel:"Đường dẫn",resolvedSource:"Nguồn đã giải quyết",loadingMarkdown:"Đang tải nội dung Markdown...",loadingSettings:"Đang tải nội dung cài đặt...",failedLoadContent:"Không tải được nội dung",retryContent:"Thử lại nội dung",noMarkdown:"Không có nội dung Markdown khả dụng.",settingsTitle:"settings.json",settingsDescription:"Tệp này chứa cài đặt dùng chung được liên kết qua mọi tài khoản ở chế độ shared.",settingsPath:"Đường dẫn cài đặt dùng chung",settingsActive:"Đang hoạt động",settingsInactive:"Không tìm thấy",resourcePolicies:"Chính sách tài nguyên",resourcePoliciesDescription:"Tài khoản shared kế thừa hub này. Tài khoản profile-local giữ lệnh, kỹ năng, agent, plugin và cài đặt riêng.",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} khác"},editAccountSharedResources:{title:"Chỉnh sửa tài nguyên dùng chung",description:'Cấu hình cách "{{name}}" kế thừa lệnh, kỹ năng và cài đặt từ thư mục dùng chung của CCS.',resourceMode:"Chế độ tài nguyên",selectResourceMode:"Chọn chế độ tài nguyên",sharedOption:"Dùng chung",sharedHint:"Kế thừa lệnh, kỹ năng và agent từ thư mục dùng chung.",profileLocalOption:"Cục bộ hồ sơ",profileLocalHint:"Sử dụng tài nguyên cô lập trong thư mục riêng của tài khoản.",implicationTitle:"Sau khi lưu sẽ ra sao",sharedImplication:"Tài khoản này sẽ thấy mọi công cụ và cấu hình trong trung tâm tài nguyên dùng chung.",profileLocalImplication:"Tài khoản này sẽ không thấy các công cụ dùng chung. Nó vẫn cô lập hoàn toàn để phục vụ bảo mật hoặc kiểm thử.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},heroSection:{title:"CCS Config",subtitle:"Bảng điều khiển Claude Code Switch"},hubFooter:{logs:"Nhật ký",settings:"Cài đặt",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"Chuyển đổi giao diện"},ccsLogo:{alt:"Logo CCS",text:"CCS Config"},claudekitBadge:{title:"Được vận hành bởi ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Được vận hành bởi",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"Hiện giá trị nhạy cảm",maskSensitive:"Ẩn giá trị nhạy cảm",valid:"{{language}} hợp lệ",readOnly:"(Chỉ đọc)"},commandBuilder:{title:"Trình tạo lệnh",searchPlaceholder:"Gõ hoặc chọn lệnh...",copy:"Sao chép",run:"Chạy",cmdConfig:"Mở giao diện cấu hình",cmdCreateProfile:"Tạo hồ sơ mới",cmdSwitchProfile:"Chuyển sang hồ sơ",cmdDoctor:"Kiểm tra sức khỏe hệ thống",cmdListProviders:"Liệt kê nhà cung cấp CLIProxy",cmdAddProvider:"Thêm nhà cung cấp CLIProxy"},confirmDialog:{confirm:"Xác nhận",cancel:"Hủy"},connectionIndicator:{connected:"Đã kết nối",connecting:"Đang kết nối...",disconnected:"Đã ngắt kết nối",reconnecting:"Đang kết nối lại..."},docsLink:{title:"Xem tài liệu"},githubLink:{title:"Báo cáo vấn đề trên GitHub"},globalEnvIndicator:{injectedCount_one:"{{count}} biến env toàn cục sẽ được áp dụng khi chạy",injectedCount_other:"{{count}} biến env toàn cục sẽ được áp dụng khi chạy",overriddenCount:"({{count}} bị ghi đè bởi hồ sơ)",skippedLabel:"Đã bỏ qua (hồ sơ đã định nghĩa):",configureInSettings:"Cấu hình trong Cài đặt"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"Dashboard từ xa đang ở chế độ chỉ đọc vì dashboard auth đang bị tắt cho phiên bản CCS này. Hãy bật lại trên máy CCS host; với Docker, việc đó phải được thực hiện bên trong container đang chạy.",remoteReadonlyAuthDisabledShort:"Dashboard từ xa chỉ đọc cho đến khi dashboard auth được bật lại cho phiên bản CCS này.",remoteReadonlySetupLong:"Dashboard từ xa chỉ đọc cho đến khi bạn chạy ccs config auth setup cho phiên bản CCS này. Với Docker, hãy chạy lệnh đó bên trong container.",remoteReadonlySetupShort:"Dashboard từ xa chỉ đọc cho đến khi auth được cấu hình cho phiên bản CCS này.",localLong:"Dashboard này chạy cục bộ. Toàn bộ dữ liệu nằm trên máy của bạn.",localShort:"Dashboard cục bộ - dữ liệu nằm trên thiết bị của bạn.",dismiss:"Bỏ qua thông báo"},privacyToggle:{modeOn:"Chế độ riêng tư BẬT - Nhấp để hiện dữ liệu",modeOff:"Chế độ riêng tư TẮT - Nhấp để ẩn dữ liệu"},projectSelectionDialog:{title:"Chọn dự án Google Cloud",description:"Chọn dự án để dùng cho xác thực {{provider}}.",autoSelectCountdown:"(Tự động chọn mặc định sau {{count}}s)",default:"Mặc định",allProjects:"Tất cả dự án",allProjectsDescription:"Thêm tất cả {{count}} dự án đã liệt kê",useDefault:"Dùng mặc định",selecting:"Đang chọn...",confirmSelection:"Xác nhận lựa chọn",codeCopied:"Đã sao chép mã",copyVerificationCode:"Sao chép mã xác minh"},quickCommands:{title:"Lệnh nhanh",startDefault:"Khởi chạy mặc định",startDefaultDesc:"Chạy Claude với hồ sơ mặc định",glmProfile:"Hồ sơ GLM",glmProfileDesc:"Chuyển sang mô hình GLM",healthCheck:"Kiểm tra sức khỏe",healthCheckDesc:"Chạy chẩn đoán hệ thống",delegateTask:"Giao việc",delegateTaskDesc:"Giao việc cho hồ sơ GLM"},quotaTooltip:{loadingQuota:"Đang tải quota...",failedLoadQuota:"Không tải được quota",modelQuotas:"Hạn ngạch mô hình:",rateLimits:"Giới hạn tốc độ:",plan:"Gói: {{plan}}",quotaSnapshots:"Ảnh chụp hạn ngạch:",unlimited:"Không giới hạn",remaining:"Còn {{remaining}}/{{entitlement}}",tier:"Tier",tierId:"Tier ID",state:"Trạng thái",credits:"Credits",modelQuotasLower:"Hạn ngạch mô hình:",allBucketsReport:"Tất cả bucket báo cáo {{tokenType}}",requestsRemaining:"Còn {{count}} yêu cầu",inputTokensRemaining:"Còn {{count}} token đầu vào",outputTokensRemaining:"Còn {{count}} token đầu ra",amountRemaining:"Còn {{count}}",fiveHourLimit:"Giới hạn dùng 5 giờ",weeklyLimit:"Giới hạn dùng hàng tuần",weeklyOpus:"Dùng hàng tuần (Opus)",weeklySonnet:"Dùng hàng tuần (Sonnet)",weeklyOAuthApps:"Dùng hàng tuần (OAuth apps)",weeklyCowork:"Dùng hàng tuần (Cowork)",extraUsage:"Lượt dùng thêm",premiumInteractions:"Tương tác Premium",chat:"Chat",completions:"Hoàn thành",resets:"Reset lúc {{time}}",fiveHourResets:"Reset 5h lúc {{time}}",weeklyResets:"Reset hàng tuần lúc {{time}}"},utils:{codeReview5h:"Đánh giá mã (5h)",codeReviewWeekly:"Đánh giá mã (hàng tuần)",codeReview:"Đánh giá mã",codexAdditional5h:"{{name}} (5h)",codexAdditionalWeekly:"{{name}} (hàng tuần)",codexAdditional:"{{name}}"},sponsorButton:{title:"Tài trợ dự án này trên GitHub",sponsor:"Tài trợ"},valueMetrics:{apiCostSaved:"Chi phí API tiết kiệm",tokensSaved:"Token tiết kiệm",queriesFaster:"Truy vấn nhanh hơn",errorsReduced:"Lỗi giảm",vsLastMonth:"so với tháng trước",throughCaching:"thông qua cache",averageSpeedup:"tăng tốc trung bình",withRetryLogic:"với logic thử lại",performanceMetrics:"Chỉ số hiệu suất",monthlySummary:"Tổng kết hàng tháng",totalSaved:"Tổng tiết kiệm",tokensProcessed:"Token đã xử lý",queriesHandled:"Truy vấn đã xử lý",uptime:"Thời gian hoạt động"},updatesSpotlight:{openUpdatesCenter:"Mở Trung tâm cập nhật"},deviceCodeDialog:{authorize:"Xác thực {{provider}}",enterCodeAtPage:"Nhập mã bên dưới tại trang xác thực.",expiresIn:"(Hết hạn sau {{time}})",codeExpired:"(Mã đã hết hạn)",copied:"Đã sao chép!",copyCode:"Sao chép mã",waitingForAuth:"Đang chờ xác thực...",openVerificationPage:"Mở trang xác minh",openProviderPage:"Mở {{provider}}",copyCodeAria:"Sao chép mã xác minh",codeCopiedAria:"Đã sao chép mã"},settingsDialog:{editProfile:"Chỉnh sửa hồ sơ: {{name}}",description:"Cấu hình biến môi trường và cài đặt cho hồ sơ này.",loadingSettings:"Đang tải cài đặt...",envTab:"Môi trường",rawJsonTab:"JSON thô",generalTab:"Chung",noEnvVars:"Không có biến môi trường nào được cấu hình.",noEnvVarsHint:"Thêm biến trong tệp settings.json của bạn.",loadingEditor:"Đang tải trình soạn thảo...",profileInfo:"Thông tin hồ sơ",profileInfoDesc:"Chi tiết về tệp cấu hình này.",path:"Đường dẫn",lastModified:"Sửa đổi lần cuối",cancel:"Hủy",saving:"Đang lưu...",saveChanges:"Lưu thay đổi",conflictTitle:"Tệp đã bị thay đổi bên ngoài",conflictDesc:"Tệp cài đặt này đã bị thay đổi bởi một tiến trình khác. Ghi đè thay đổi của bạn hay hủy?",overwrite:"Ghi đè",invalidJson:"JSON không hợp lệ",failedSave:"Không lưu được"},setupWizard:{title:"Thiết lập biến thể nâng cao",stepProviderDesc:"Chọn nhà cung cấp cho biến thể runtime",stepAuthDesc:"Xác thực với nhà cung cấp",stepAccountDesc:"Chọn tài khoản để sử dụng",stepVariantDesc:"Tùy chọn: tạo biến thể runtime tùy chỉnh",stepSuccessDesc:"Thiết lập hoàn tất!",authStep:{authenticateWith:"Xác thực với {{provider}} để thêm tài khoản",authenticating:"Đang xác thực...",authenticateInBrowser:"Xác thực trong trình duyệt",completeOAuth:"Hoàn tất luồng OAuth trong trình duyệt...",orUseTerminal:"Hoặc dùng terminal",runCommandHint:"Chạy lệnh này trong terminal:",back:"Quay lại",checking:"Đang kiểm tra...",refreshStatus:"Làm mới trạng thái"},accountStep:{selectAccount:"Chọn tài khoản ({{count}})",defaultAccount:"Tài khoản mặc định",or:"Hoặc",addNewAccount:"Thêm tài khoản mới",addNewAccountDesc:"Xác thực với một tài khoản khác",back:"Quay lại"},variantStep:{back:"Quay lại",skip:"Bỏ qua"},successStep:{title:"Biến thể đã được tạo!",subtitle:"Biến thể tùy chỉnh đã sẵn sàng để sử dụng",usage:"Cách dùng:",done:"Xong"}},accountSurfaceCard:{business:"Biz",free:"Miễn phí",personal:"Cá nhân",variant:"Biến thể"},accountIdentity:{business:"Doanh nghiệp",personal:"Cá nhân",free:"Miễn phí",team:"Nhóm",plus:"Plus",pro:"Pro",workspace:"Không gian {{id}}"},accountCardStats:{notUsedYet:"Chưa sử dụng"},accountQuotaPanel:{weekly:"Hàng tuần",loadingQuota:"Đang tải quota..."},userMenu:{signedInAs:"Đăng nhập sebagai {{username}}"},authMonitorLive:{live:"TRỰC TIẾP",accountMonitor:"Theo dõi tài khoản",updated:"Cập nhật lúc {{time}}",updatedNow:"Vừa cập nhật",requestsLabel:"req",stats:"Thống kê",successRate:"Tỷ lệ thành công",missingProjectId:"Thiếu Project ID",noActivity:"không hoạt động"},providerCard:{missingProjectIdAria:"Thiếu Project ID"},loginPage:{showPassword:"Hiện mật khẩu",hidePassword:"Ẩn mật khẩu"},cliproxyStatsOverview:{sessionStatistics:"Thống kê phiên",realTimeMetrics:"Chỉ số thời gian thực từ {{backend}}",offline:"Ngoại tuyến",running:"Đang chạy",noActiveSession:"Không có phiên hoạt động",noActiveSessionHint:"Bắt đầu phiên CLIProxy bằng ccs gemini, ccs codex hoặc ccs agy để xem thống kê thời gian thực.",failedLoadStats:"Không tải được thống kê",totalRequests:"Tổng yêu cầu",successCount:"{{count}} thành công",successRate:"Tỷ lệ thành công",totalTokens:"Tổng token",estimatedCost:"~${{cost}} ước tính",modelsUsed:"Mô hình đã dùng",modelUsageDistribution:"Phân bố sử dụng mô hình",requestCount:"{{count}} yêu cầu"},cliproxyTable:{name:"Tên",provider:"Nhà cung cấp",model:"Mô hình",account:"Tài khoản",status:"Trạng thái",default:"Mặc định",actions:"Hành động"},cliproxyTabs:{overview:"Tổng quan",variants:"Biến thể",aiProviders:"AI Providers",controlPanel:"Bảng điều khiển"},cliproxyHeader:{ccsLevelAccountManagement:"Quản lý tài khoản cấp CCS",cliproxyNotAvailable:"CLIProxy không khả dụng",cliproxyControlPanel:"Bảng điều khiển CLIProxy",noVariants:"Không tìm thấy biến thể CLIProxy nào.",addAccountToStart:"Thêm tài khoản để bắt đầu"},routingGuidance:{roundRobin:"Round-robin phân bổ đều lượt dùng.",fillFirst:"Fill-first giữ tài khoản dự phòng cho đến khi cần thiết.",routingStrategy:"Chiến lược định tuyến",optionalRouting:"Định tuyến tùy chọn",sessionAffinity:"Ghim phiên",sessionAffinityOn:"Bật",sessionAffinityOff:"Tắt",sessionAffinityEnabled:"bật",sessionAffinityDisabled:"tắt",enableSessionAffinity:"Bật ghim phiên",disableSessionAffinity:"Tắt ghim phiên",sessionAffinityUnavailable:"Ghim phiên không khả dụng",localOnly:"Chỉ cục bộ",localOnlySetting:"Thiết lập chỉ cục bộ",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"Giữ một cuộc hội thoại trên cùng một tài khoản khi có thể. CLIProxy ưu tiên mã phiên hoặc luồng mà client gửi rõ ràng; nếu không có, nó sẽ dùng metadata của request hoặc lịch sử prompt mở đầu để suy ra khóa ổn định.",sessionRecognitionTitle:"Nhận diện phiên",sessionRecognitionDescription:"CCS không cam kết một thứ tự ưu tiên chung cho mọi backend. Trên thực tế, backend upstream thường ưu tiên session hoặc thread id tường minh, rồi mới fallback sang metadata và cuối cùng là hàm băm của lịch sử prompt mở đầu."},extendedContext:{extendedContext:"Ngữ cảnh mở rộng"},cliproxyConfig:{unsavedChanges:"Thay đổi chưa lưu",original:"Gốc",modified:"Đã sửa đổi",reviewChanges:"Xem lại thay đổi",loadingEditor:"Đang tải trình soạn thảo..."},providerEditor:{provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",modelMapping:"Ánh xạ mô hình",status:"Trạng thái",loadingSettings:"Đang tải cài đặt...",loadingEditor:"Đang tải trình soạn thảo...",accounts:"Tài khoản",addAccount:"Thêm tài khoản",noAccountsConnected:"Chưa kết nối tài khoản nào",addAccountToStart:"Thêm tài khoản để bắt đầu",gcpProjectIdReadonly:"GCP Project ID (chỉ đọc)",projectIdNA:"Project ID: N/A",missingProjectId:"Thiếu Project ID",missingProjectIdHint:"Điều này có thể gây lỗi. Xóa tài khoản và thêm lại để lấy Project ID.",useIncognito:"Dùng ẩn danh",aliases:"Bí danh",current:"Hiện tại",currentValue:"Giá trị hiện tại",composite:"tổng hợp",defaultLabel:"mặc định",requiredSetup:"Cài đặt cần thiết",connectorName:"Tên connector",proxyUrl:"URL proxy",proxyUrlSet:"Đã đặt URL proxy",excludedModels:"Mô hình loại trừ",headers:"Headers",secret:"Secret",prefix:"Tiền tố",modelMappings:"Ánh xạ mô hình",baseUri:"URL cơ sở",apiKeys:"Khóa API",presets:"Áp dụng ánh xạ mô hình đã cấu hình sẵn",createVariant:"Tạo biến thể CLIProxy",agyDenylist:"Danh sách loại trừ Antigravity: Claude Opus 4.5 và Claude Sonnet 4.5 đã bị loại bỏ."},providerEditorAccountItem:{modelsUsed:"Mô hình đã dùng"},bulkActionBar:{applyPreset:"Áp dụng preset"},modelConfigSection:{defaultModel:"Mô hình mặc định"},rawEditorSection:{rawConfig:"Cấu hình thô"},providerEditorHeader:{connectorName:"Tên connector"},aiProvidersFamilyRail:{current:"Hiện tại"},aiProvidersEntryCard:{apiKeys:"Khóa API"},aiProvidersEntryDialog:{connectorName:"Tên connector",baseUri:"URL cơ sở",proxyUrl:"URL proxy",secret:"Secret",prefix:"Tiền tố",excludedModels:"Mô hình loại trừ",headers:"Headers",modelMappings:"Ánh xạ mô hình",requiredSetup:"Cài đặt cần thiết",optionalRouting:"Định tuyến tùy chọn"},codex:{controlCenter:"Trung tâm điều khiển",overview:"Tổng quan",docs:"Tài liệu",nativeCodexRuntime:"Codex Runtime gốc",ccsCodexProvider:"Lối tắt cliproxy / cầu nối được quản lý",codexDocs:"Tài liệu Codex",supportedFlows:"Các luồng được hỗ trợ",twoSupportedPaths:"Hai đường dẫn được hỗ trợ:",nativeLabel:"Gốc:",nativeDesc:"Codex là target runtime hạng nhất trong CCS v1.",ccsBridge:"CCS Bridge",apiProfilesDefault:"API profiles mặc định dùng Claude hoặc Droid.",recommendedSetupFlow:"Luồng thiết lập khuyến nghị",fastestPath:"Đường dẫn nhanh nhất",officialChannels:"Kênh chính thức",codexCli:"Codex CLI",openNativeCodex:"Mở Codex gốc",runBuiltInCodex:"Chạy Codex gốc với lối tắt cliproxy",runBuiltInCodexExplicit:"Chạy rõ ràng cầu nối Codex do CCS quản lý",openCodexDashboard:"Mở dashboard Codex",status:"Trạng thái",profiles:"Hồ sơ",createNewProfile:"Tạo hồ sơ mới",createNewProvider:"Tạo nhà cung cấp mới",createNewMcpServer:"Tạo MCP server mới",defaultProvider:"Nhà cung cấp mặc định",useDefault:"Dùng mặc định",useGlobalProvider:"Dùng nhà cung cấp toàn cục",useProviderDefault:"Dùng mặc định của nhà cung cấp",quickFillWarning:"Chỉ điền nhanh. Hãy xem lại trước khi lưu.",thisFileUpstreamOwned:"Tệp này thuộc sở hữu của Codex CLI upstream.",notes:"Ghi chú",approvalPolicy:"Chính sách phê duyệt",sandboxMode:"Chế độ sandbox",reasoningEffort:"Mức nỗ lực lý luận",useGlobalEffort:"Dùng mức toàn cục",reasoningEffortCapitalized:"Mức nỗ lực lý luận",thinkingBudgetTokens:"Token ngân sách tư duy",modelContextWindow:"Cửa sổ ngữ cảnh mô hình",autoCompactTokenLimit:"Giới hạn token tự động nén",toolOutputTokenLimit:"Giới hạn token đầu ra tool",webSearch:"Tìm kiếm web",personality:"Tính cách",model:"Mô hình",rawOnly:"Chỉ thô",trusted:"đã tin cậy",untrusted:"chưa tin cậy",noProjectTrustEntries:"Không có mục tin cậy dự án nào được lưu.",codexNativeRecipe:"Đã lưu công thức Codex gốc",gptContextCap:"Giới hạn ngữ cảnh GPT-5.4",usageLimitCost:"Chi phí vượt mức 272K",longContextOverride:"Ghi đè ngữ cảnh dài",counts2x:"Tính 2x",normalUsageWindow:"Cửa sổ sử dụng bình thường",useCodexDefault:"Dùng mặc định Codex",stdio:"stdio",streamableHttp:"streamable-http",responses:"phản hồi",defaultTargetCli:"CLI mục tiêu mặc định",executionChain:"Chuỗi thực thi",targetPath:"Đường dẫn mục tiêu hiện tại",userConfig:"Cấu hình người dùng",configYaml:"config.yaml",flow:"Luồng",docsTab:"Tài liệu",features:"Tính năng",featuresDesc:"Bật/tắt các cờ tính năng Codex mà CCS có thể quản lý an toàn.",configOnlyFlags:"Cờ chỉ có trong cấu hình",configOnlyFlagsDesc:"Các khóa này đã tồn tại trong `config.toml`, nên CCS có thể hiển thị chúng mà không cần tuyên bố bao phủ toàn bộ danh mục.",existing:"đã có",nonBooleanForm:"Giá trị đang được lưu ở dạng không phải boolean. Hãy dùng TOML thô nếu bạn muốn chỉnh sửa.",discoveredFromFile:"Được phát hiện từ tệp hiện tại thay vì từ danh mục tích hợp của CCS.",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"Bật các công cụ cộng tác giữa subagent.",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"Dùng công cụ exec hợp nhất dựa trên PTY.",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"Tái sử dụng snapshot môi trường shell.",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"Bật chỉnh sửa apply_patch dạng tự do.",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Bật JavaScript REPL dựa trên Node.",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Thu thập chỉ số runtime của Codex.",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"Giữ máy không ngủ khi đang hoạt động.",featureFastModeLabel:"Fast mode",featureFastModeDesc:"Cho phép dùng đường dẫn fast service tier.",featureAppsLabel:"Apps",featureAppsDesc:"Bật hỗ trợ ChatGPT Apps và connectors.",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"Đưa các phê duyệt phù hợp qua luồng guardian.",howCodexWorks:"Codex hoạt động trong CCS như thế nào",nativeConfigLabel:"Cấu hình gốc:",nativeConfigDesc:"ccs-codex và ccsx khởi chạy Codex gốc bằng các mặc định bạn đã lưu.",transientOverridesLabel:"Ghi đè tạm thời:",transientOverridesDesc:"ccsxp vẫn chạy Codex gốc và chỉ thêm ghi đè provider cliproxy; ccs codex --target codex vẫn là cầu nối CCS được quản lý rõ ràng.",cliproxyDefaultLabel:"Mặc định CLIProxy:",cliproxyDefaultDesc:'Để lệnh codex thông thường đi qua CLIProxy, hãy đặt model_provider = "cliproxy" và dùng công thức bên dưới.',runtimeInstall:"Cài đặt runtime",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn binary",installDirectory:"Thư mục cài đặt",versionLabel:"Phiên bản",nativeAliases:"Bí danh gốc",ccsProviderShortcut:"Lối tắt cliproxy",configOverrideSupport:"Hỗ trợ ghi đè --config",available:"Có sẵn",missing:"Thiếu",cliproxyNativeCodex:"Codex gốc dùng CLIProxy",builtInLabel:"Tích hợp:",builtInCcsxpDesc:"Dùng ccsxp để chạy Codex gốc với lối tắt provider cliproxy.",managedBridgeLabel:"Cầu nối được quản lý:",managedBridgeDesc:"Dùng ccs codex --target codex khi bạn muốn tuyến CCS được quản lý chặt hơn một cách tường minh.",nativeRecipeLabel:"Gốc:",nativeRecipeDesc:"Cấu hình công thức bên dưới để dùng CLIProxy trực tiếp với codex.",saveProviderNamedCliproxy:"Lưu một provider tên cliproxy với base URL và env key ở trên.",inTopLevelSetDefault:"Trong Top-level settings, đặt Default provider là cliproxy.",exportCliproxyApiKey:"Xuất CLIPROXY_API_KEY trong shell trước khi chạy Codex gốc.",noConfigOverrides:"Bản Codex này vẫn có thể dùng đường gốc thuần, nhưng ccsxp và cầu nối Codex do CCS quản lý rõ ràng sẽ chưa dùng được cho đến khi binary hỗ trợ ghi đè --config.",configFile:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã phân giải",size:"Kích thước",lastModified:"Sửa đổi lần cuối",tomlWarning:"Cảnh báo TOML",readWarning:"Cảnh báo đọc",currentUserLayerSummary:"Tóm tắt lớp người dùng hiện tại",activeProfile:"Hồ sơ đang dùng",notSet:"Chưa đặt",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"Các khóa lớp người dùng hiện có",nativeShortAlias:"Bí danh gốc ngắn",ccsCodexShortcut:"Lối tắt CCS Codex",explicitProviderRoute:"Tuyến provider tường minh",runtimeVsProvider:"Runtime so với provider",honorsSavedNativeConfig:"Tuân theo cấu hình gốc đã lưu",usesTransientOverrides:"Dùng ghi đè tạm thời",unavailableNoConfig:"Không khả dụng (bản Codex này thiếu hỗ trợ --config).",yes:"Có",no:"Không",warningsTitle:"Cảnh báo",auth:{terminalOnlyTooltip:"Dùng ccsx auth switch <name> hoặc ccsx auth remove <name> trong terminal.",terminalOnlyTooltipRich:"Dùng <code>ccsx auth switch &lt;name&gt;</code> hoặc <code>ccsx auth remove &lt;name&gt;</code> trong terminal.",activeSourceBadge:"{{source}}",statusOk:"OK",statusInvalid:"[!] auth không hợp lệ",loading:"Đang tải hồ sơ auth...",loadError:"[!] Không tải được hồ sơ codex-auth.",emptyRegistry:"[i] Chưa có hồ sơ codex-auth. Chạy ccsx auth create <name> để tạo.",emptyRegistryRich:"[i] Chưa có hồ sơ codex-auth. Chạy <code>ccsx auth create &lt;name&gt;</code> để tạo.",legacyCodexHome:"Codex sẽ dùng vị trí mặc định ~/.codex.",legacyCodexHomeRich:"Codex sẽ dùng vị trí mặc định <code>~/.codex</code>.",legacyMode:"[i] Chưa có hồ sơ active. Đang dùng ~/.codex (legacy). Chạy ccsx auth switch <name> trong terminal để kích hoạt.",legacyModeRich:"[i] Chưa có hồ sơ active. Đang dùng <code>~/.codex</code> (legacy). Chạy <code>ccsx auth switch &lt;name&gt;</code> trong terminal để kích hoạt.",externalCodexHome:"[i] $CODEX_HOME được đặt bên ngoài là {{path}}. Registry hồ sơ không dùng trong phiên này.",externalCodexHomeRich:"[i] <code>$CODEX_HOME</code> được đặt bên ngoài là <code>{{path}}</code>. Registry hồ sơ không dùng trong phiên này.",activeProfile:"Hồ sơ active:",unknownProfile:"(không rõ)",planLabel:"Gói:",switchAction:"Chuyển",removeAction:"Xóa",sourceDefault:"mặc định",sourceEnv:"$CCS_CODEX_PROFILE",sourceExplicitCodexHome:"$CODEX_HOME",col:{name:"Tên",email:"Email",plan:"Gói",lastUsed:"Dùng lần cuối",status:"Trạng thái",actions:"Thao tác"}}},droidSettings:{quickControls:"Điều khiển nhanh",reasoningControls:"Điều khiển lý luận",thinkingBudget:"Ngân sách tư duy",anthropicOnly:"Chỉ mô hình Anthropic",byokCustomModels:"Mô hình tùy chỉnh BYOK"},rawJsonSettingsEditor:{title:"Trình soạn thảo cài đặt thô"},copilotConfigForm:{copilotConfiguration:"Cấu hình Copilot",deprecatedModels:"Phát hiện mô hình Copilot đã lỗi thời",failedLoadStatus:"Không tải được trạng thái",useWithClaudeCode:"Dùng đăng ký GitHub Copilot với Claude Code",githubCopilotControls:"GitHub Copilot kiểm soát giới hạn prompt/ngữ cảnh ở upstream.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",status:"Trạng thái",enabled:"Đã bật",disabled:"Đã tắt",loadingEditor:"Đang tải trình soạn thảo...",modelMapping:"Ánh xạ mô hình",quickUsage:"Sử dụng nhanh",noPremiumUsage:"Không có số liệu sử dụng premium"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"Tất cả hệ thống hoạt động bình thường",machineChecks:"Kiểm tra máy"},analyticsCards:{cacheCost:"Chi phí cache",hitRate:"Tỷ lệ trúng",inputOutputRatio:"Tỷ lệ Đầu vào/Đầu ra",noCacheData:"Không có dữ liệu cache",noModelData:"Không có dữ liệu mô hình",noSessionData:"Không có dữ liệu phiên",noTokenData:"Không có dữ liệu token",totalCost:"Tổng chi phí",totalTokens:"Tổng token",usageInsights:"Phân tích sử dụng"},dateRangeFilter:{pickADate:"Chọn ngày"},logsConfig:{level:"Mức",message:"Thông điệp",source:"Nguồn",time:"Thời gian",proc:"Tiến trình",open:"Mở",run:"Chạy",refreshEntries:"Làm mới mục"},logsDetailPanel:{details:"Chi tiết"},logsFilters:{filters:"Bộ lọc"},logsOverviewCards:{overview:"Tổng quan"},logsPageSkeleton:{loadingLogs:"Đang tải nhật ký..."},monitoringErrorLogs:{logContent:"Nội dung nhật ký"},analyticsPages:{chartsGrid:"Biểu đồ",costByModel:"Chi phí theo mô hình"},toasts:{profileCreated:"Đã tạo hồ sơ thành công",profileUpdated:"Đã cập nhật hồ sơ thành công",profileDeleted:"Đã xóa hồ sơ thành công",orphanProfilesComplete:"Hoàn tất đăng ký hồ sơ mồ côi",profileCopied:"Đã sao chép hồ sơ thành công",profileImported:"Đã nhập hồ sơ thành công",authRequired:"Yêu cầu xác thực {{provider}}",authSuccess:"Xác thực {{provider}} thành công!",authFailed:"Xác thực {{provider}} thất bại",deviceCodeExpired:"Mã thiết bị đã hết hạn. Vui lòng thử lại.",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",failedCopy:"Không sao chép được mã",configSaved:"Đã lưu cấu hình thành công",configSaveFailed:"Lưu thất bại: {{error}}",invalidYaml:"Không thể lưu YAML không hợp lệ",configUpdatedExternally:"Cấu hình đã được cập nhật bên ngoài",settingsFileUpdated:"Tệp cài đặt đã được cập nhật",accountsUpdated:"Tài khoản đã được cập nhật",noProfilesToSync:"Không có hồ sơ để đồng bộ",syncFailed:"Đồng bộ thất bại: {{error}}",sessionAffinityUpdated:"Ghim phiên đã {{state}}.",providerAuthSuccess:"Xác thực {{provider}} thành công",providerDeviceCodeInCallback:"Nhà cung cấp trả về Device Code flow trong chế độ callback",providerAuthTimeout:"Đã hết thời gian xác thực. Vui lòng thử lại.",providerAccountRegistrationFailed:"Không thể đăng ký tài khoản đã xác thực",providerLostStatusEndpoint:"Mất kết nối với điểm cuối trạng thái xác thực",providerUnknown:"Nhà cung cấp không xác định: {{provider}}",providerStartOAuthFailed:"Không thể bắt đầu OAuth",providerCallbackFailed:"Gửi callback thất bại",providerSubmitCallbackFailed:"Không thể gửi callback",loggingConfigSaved:"Đã lưu cấu hình ghi nhật ký.",loggingConfigSaveFailed:"Không lưu được cấu hình ghi nhật ký.",unifiedConfigUpdated:"Đã cập nhật cấu hình thành công",migrationPreviewComplete:"Xem trước di chuyển hoàn tất",migrationComplete:"Di chuyển hoàn tất thành công",migrationFailed:"Di chuyển thất bại",rollbackComplete:"Khôi phục hoàn tất thành công",rollbackFailed:"Khôi phục thất bại",defaultAccountSet:'Tài khoản mặc định đã đặt thành "{{name}}"',defaultAccountReset:"Tài khoản mặc định đã đặt lại về CCS",accountDeleted:'Đã xóa tài khoản "{{name}}"',contextUpdated:'Đã cập nhật ngữ cảnh "{{name}}" thành {{summary}}',legacyConfirmError:'Tài khoản "{{name}}" cần xác nhận rõ ràng. Dùng Chỉnh sửa Đồng bộ lịch sử trên tài khoản này.',legacyConfirmFailed:'Tài khoản cũ "{{name}}" xác nhận thất bại: {{error}}',legacyConfirmSuccess_one:"Đã xác nhận {{count}} tài khoản cũ",legacyConfirmSuccess_other:"Đã xác nhận {{count}} tài khoản cũ",legacyConfirmPartial:"Đã xác nhận {{updated}} tài khoản cũ, nhưng {{failed}} lần cập nhật thất bại. Trạng thái tài khoản đã được làm mới.",legacyConfirmAllFailed:"Không thể xác nhận {{failed}} tài khoản cũ. Trạng thái tài khoản đã được làm mới.",noLegacyAccounts:"Không có tài khoản cũ nào cần xác nhận",routingStrategySet:"Chiến lược định tuyến đã đặt thành {{strategy}}",variantCreated:"Đã tạo biến thể thành công",variantUpdated:"Đã cập nhật biến thể thành công",variantDeleted:"Đã xóa biến thể thành công",defaultAccountUpdated:"Đã cập nhật tài khoản mặc định",accountRemoved:"Đã xóa tài khoản",accountPaused:"Đã tạm dừng tài khoản",accountResumed:"Đã tiếp tục tài khoản",accountAdded:"Đã thêm tài khoản cho {{provider}}",kiroImported:"Đã nhập tài khoản Kiro: {{name}}",kiroTokenImported:"Đã nhập token Kiro",modelUpdated:"Đã cập nhật mô hình",presetSaved:'Đã lưu preset "{{name}}"',presetDeleted:"Đã xóa preset",cliproxyAlreadyRunning:"CLIProxy đã đang chạy",cliproxyStarted:"CLIProxy đã khởi động thành công",cliproxyStartFailed:"Không khởi động được CLIProxy",cliproxyStopped:"Đã dừng CLIProxy",cliproxyStopFailed:"Không dừng được CLIProxy",presetApplied:'Đã áp dụng preset "{{name}}"',presetAppliedCustom:"Đã áp dụng preset tùy chỉnh",settingsSavedWithAdjustments:"Cài đặt đã lưu với điều chỉnh mô hình",settingsSaved:"Đã lưu cài đặt",failedSaveSettings:"Không lưu được cài đặt",codexRefreshFailed:"Không làm mới được snapshot Codex. Các chỉnh sửa thô đã được giữ.",codexRefreshError:"Không làm mới được snapshot Codex.",codexFixToml:"Sửa TOML trước khi lưu.",codexSaved:"Đã lưu Codex config.toml.",codexChangedExternally:"config.toml đã thay đổi bên ngoài. Làm mới và thử lại.",codexSaveFailed:"Không lưu được Codex config.toml.",codexUpdateFailed:"Không cập nhật được cấu hình Codex.",noOrphanProfiles:"Không tìm thấy cài đặt hồ sơ mồ côi",profilesRegistered:"Đã đăng ký {{count}} hồ sơ{{skipped}}",destinationEmpty:"Tên hồ sơ đích không được để trống",profileExportDownloaded:"Đã tải xuống xuất hồ sơ",profileImportFailed:"Không nhập được gói hồ sơ"},providerConfig:{defaultDeviceCodeInstruction:"Hoàn tất việc cấp quyền trong trình duyệt của bạn.",trackLabel:"Nhóm",sectionCoreLabel:"Core / backend gốc",sectionCoreHint:"Nhóm nhà cung cấp mặc định, luôn sẵn sàng",sectionPlusLabel:"Plus extras / cộng đồng duy trì",sectionPlusHint:"Vẫn được hỗ trợ nhưng hiện được tách khỏi backend mặc định",plusTrackNote:"Cần backend Plus tùy chọn; hiện tại nhánh này do cộng đồng duy trì."},profileEditorSections:{imageAnalysis:"Phân tích hình ảnh",loadingImageSettings:"Đang tải cài đặt hình ảnh...",skipPermissionPrompts:"Bỏ qua nhắc quyền khi khởi chạy",useNativeImageReading:"Dùng đọc hình ảnh gốc",skipTransformer:"Bỏ qua transformer",friendlyUi:"Giao diện thân thiện",info:"Thông tin"},imageAnalysisStatus:{sectionTitle:"Hình ảnh",openSettings:"Mở Cài đặt",useNativeImageReading:"Dùng đọc hình ảnh gốc",refreshingPreview:"Đang làm mới xem trước",savedStatus:"Trạng thái đã lưu",livePreview:"Xem trước trực tiếp",disabledGlobally:"Đã tắt toàn cục",targetBypassesHook:"{{target}} bỏ qua hook",nativeImageReading:"Đọc hình ảnh gốc",setupNeeded:"Cần thiết lập",needsAuth:"Cần xác thực",needsProxy:"Cần proxy",nativeFallback:"Dự phòng gốc",transformerReady:"Transformer sẵn sàng",badgeDisabled:"Đã tắt",badgeBypassed:"Đã bỏ qua",badgeNative:"Gốc",badgeSetup:"Thiết lập",badgeAuth:"Xác thực",badgeProxy:"Proxy",badgeReady:"Sẵn sàng",capabilityVerified:"Đã xác minh",capabilityUnknown:"Không xác định",toggleSummaryNativeCapable:"{{model}} có vẻ hỗ trợ hình ảnh. CCS sẽ bỏ qua transformer ở đây.",toggleSummaryNativeModel:"CCS sẽ ưu tiên đọc gốc cho {{model}}.",toggleSummaryNativeDefault:"CCS sẽ ưu tiên đọc hình ảnh gốc cho hồ sơ này.",toggleSummaryNativeFileAccess:"Hồ sơ này hiện đang dùng truy cập tệp gốc.",toggleSummaryInactiveTarget:"Định tuyến hình ảnh phía Claude đã lưu không hoạt động khi {{target}} đang được chọn.",toggleSummaryTransformerRoute:"Tuyến transformer: {{backend}}{{modelSuffix}}.",noteDisabledGlobally:"Hình ảnh đã bị tắt toàn cục trong cài đặt CCS.",noteTargetBypassesHook:"Mục tiêu hiện tại {{target}} bỏ qua Claude Read hook.",notePersistHook:"Persist hook hồ sơ trước khi tuyến transformer có thể chạy ở đây.",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"MỚI",integration:"Tích hợp OpenRouter"},openrouterBanner:{accessModels:"Truy cập {{count}}+ mô hình qua OpenRouter",add:"Thêm"},openrouterModelPicker:{searchModels:"Tìm kiếm mô hình",newestModels:"Mô hình mới nhất"},openrouterPromoCard:{title:"OpenRouter",description:"Truy cập hàng trăm mô hình qua một API endpoint."},profileCard:{profile:"Hồ sơ",openRouter:"Hồ sơ OpenRouter",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code (mặc định)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"Hồ sơ CCS"},profileDeck:{profiles:"Hồ sơ",failedToLoad:"Không tải được hồ sơ: {{message}}",noProfiles:"Chưa có hồ sơ nào. Tạo hồ sơ đầu tiên để bắt đầu."},profilesTable:{name:"Tên",provider:"Nhà cung cấp",model:"Mô hình",target:"Mục tiêu",lastModified:"Sửa đổi lần cuối",actions:"Hành động",edit:"Chỉnh sửa"},profileCreateDialog:{createProfile:"Tạo hồ sơ",appliedModelToTiers:'Đã áp dụng "{{model}}" cho tất cả tier mô hình',profileCreated:'Đã tạo hồ sơ "{{name}}"',failedCreate:"Không tạo được hồ sơ",chooseProviderHint:"Chọn preset nhà cung cấp hoặc cấu hình API endpoint tùy chỉnh.",basicInformation:"Thông tin cơ bản",modelConfiguration:"Cấu hình mô hình",usedInCli:"Dùng trong CLI:",apiBaseUrl:"URL cơ sở API",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"Điền sẵn từ {{name}}. Bạn có thể tùy chỉnh nếu cần.",optionalForPreset:"Tùy chọn cho {{name}}. Để trống để dùng xác thực Anthropic gốc.",endpointHint:"Endpoint chấp nhận yêu cầu tương thích OpenAI và Anthropic",optional:"(tùy chọn)",apiKeyOptionalPlaceholder:"Tùy chọn - chỉ khi bật xác thực",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"Chỉ cần khi endpoint cục bộ bật xác thực",defaultTargetCli:"CLI mục tiêu mặc định",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Ánh xạ các tier Claude Code (Opus/Sonnet/Haiku) sang mô hình được nhà cung cấp hỗ trợ.",searchModelsPlaceholder:"Gõ để tìm (vd: opus, sonnet, gpt-4o)...",noModelsFound:'Không tìm thấy mô hình cho "{{query}}"',loadingModels:"Đang tải mô hình...",defaultModel:"Mô hình mặc định",sonnetMapping:"Ánh xạ Sonnet",opusMapping:"Ánh xạ Opus",haikuMapping:"Ánh xạ Haiku",sonnetMappingPlaceholder:"vd: gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"vd: o1, claude-opus-4.5",haikuMappingPlaceholder:"vd: gpt-4o-mini, claude-3.5-haiku",free:"Miễn phí"},profileDialogLegacy:{editProfile:"Chỉnh sửa hồ sơ"},supportEntryCard:{actionRequired:"Cần hành động"},settingsPage:{title:"Cài đặt",loading:"Đang tải...",failedLoad:"Không tải được cài đặt.",tabs:{web:"Web",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu",channels:"Kênh",imageAnalysis:"Hình ảnh"},websearchSection:{title:"Tìm kiếm Web",description:"Cấu hình tìm kiếm web dựa trên CLI."},thinkingSection:{title:"Tư duy",description:"Cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",directOverride:"Ghi đè trực tiếp",youType:"Bạn gõ:",ccsAdds:"CCS thêm:",executionChain:"Chuỗi thực thi",primaryBackends:"Backend chính",legacyCliFallbacks:"Fallback CLI cũ",managedPayload:"Payload được quản lý",sharedTargetMetadata:"Metadata mục tiêu dùng chung",ideTargetMetadata:"Metadata mục tiêu IDE",ideSettingsPath:"Đường dẫn cài đặt IDE",ideHost:"Host IDE",resolvedBinding:"Binding đã giải quyết",bindingName:"Tên binding",inSync:"Đồng bộ",currentTargetPath:"Đường dẫn mục tiêu hiện tại",warnings:"Cảnh báo",notes:"Ghi chú",workspacePresets:"Preset workspace",draft:"Bản nháp",advanced:"Nâng cao",recommended:"Luồng thiết lập khuyến nghị",configureModelFirst:"Cấu hình mô hình trước"},proxySection:{title:"Proxy",loadingImageSettings:"Đang tải cài đặt hình ảnh..."},channelsSection:{title:"Kênh chính thức",description:"Xem và quản lý các kênh phát hành chính thức."},imageAnalysisSection:{title:"Phân tích hình ảnh",description:"Cấu hình cài đặt phân tích hình ảnh.",loading:"Đang tải cài đặt hình ảnh..."},browserSection:{title:"Trình duyệt",description:"Bề mặt thiết lập chính cho tự động hóa trình duyệt được CCS quản lý.",primaryTitle:"Settings > Browser là nơi thiết lập trình duyệt chính.",primaryDescription:"Cấu hình Claude Browser Attach và Codex Browser Tools tại đây, rồi dùng hướng dẫn bên dưới để khởi chạy hoặc kiểm tra từng luồng.",readiness:"Trạng thái sẵn sàng",nextStep:"Bước tiếp theo",technicalDetails:"Chi tiết kỹ thuật",diagnostics:"Chẩn đoán",evalMode:{label:"Quyền browser_eval",options:{disabled:"Tắt",readonly:"Chỉ đọc",readwrite:"Đọc/ghi"}},actions:{saveClaude:"Lưu cấu hình Claude",saveCodex:"Lưu cấu hình Codex",testConnection:"Kiểm tra kết nối",copyLaunchCommand:"Sao chép lệnh khởi chạy"},messages:{statusRefreshed:"Đã làm mới trạng thái trình duyệt",launchCommandCopied:"Đã sao chép lệnh khởi chạy"},claude:{title:"Claude Browser Attach",description:"Gắn các phiên chạy Claude-target vào một phiên Chrome có bật remote debugging.",enabledLabel:"Bật Claude Browser Attach",enabledDescription:"Khi bật, CCS sẽ chuẩn bị runtime MCP trình duyệt được quản lý cho các phiên chạy Claude-target.",userDataDir:"Thư mục dữ liệu người dùng Chrome",userDataDirHint:"Nên dùng thư mục profile Chrome riêng để trạng thái attach được tách khỏi trình duyệt hằng ngày.",devtoolsPort:"Cổng DevTools",devtoolsPortHint:"Phải khớp với cổng thực tế dùng khi khởi chạy Chrome trong attach mode.",devtoolsPortInvalid:"Nhập cổng hợp lệ trong khoảng 1 đến 65535.",effectivePath:"Đường dẫn attach đang có hiệu lực",recommendedPath:"Đường dẫn khuyến nghị",managedRuntime:"Runtime trình duyệt được quản lý",evalModeHint:"Điều khiển quyền browser_eval cho Claude Browser Attach. Chỉ đọc cho phép quan sát; đọc/ghi cũng cho phép thay đổi phía trang.",overrideMessage:"Hiện có override môi trường từ {{source}}. Khi bỏ override này, Dashboard sẽ lại là nguồn cấu hình chính.",launchGuidance:"Hướng dẫn khởi chạy",launchGuidanceHint:"Khởi chạy Chrome với remote debugging, rồi chạy lại Test connection nếu cần."},codex:{title:"Codex Browser Tools",description:"Điều khiển đường dẫn trình duyệt Playwright MCP được quản lý cho các phiên chạy Codex-target.",enabledLabel:"Bật Codex Browser Tools",enabledDescription:"Giữ bật để trang Browser là nơi cấu hình chính cho công cụ trình duyệt của Codex.",serverName:"Tên dịch vụ được quản lý",overrideSupport:"Hỗ trợ config override",overrideSupported:"Được hỗ trợ",overrideUnsupported:"Không được hỗ trợ",binary:"Binary Codex được phát hiện",notDetected:"Không phát hiện",evalModeHint:"Được lưu để giữ tương thích giao diện Browser settings. Ở Phase 1, việc áp dụng hạn chế browser_eval chủ yếu diễn ra trên Claude Browser Attach."}}},codexPage:{title:"Codex",controlCenter:"Trung tâm điều khiển",overview:"Tổng quan",docs:"Tài liệu",authProfiles:"Hồ sơ auth",nativeRuntime:"Runtime gốc",ccsProvider:"CCS Provider",setup:"Thiết lập"},apiPage:{title:"Hồ sơ API",subtitle:"Quản lý hồ sơ API và các endpoint."},claudeExtensionPage:{title:"Claude Extension",subtitle:"Cài đặt tích hợp Claude Extension.",claudeAuth:"Xác thực Claude",status:"Trạng thái",targetMetadata:"Metadata mục tiêu IDE"},sharedPageV2:{title:"Dùng chung",subtitle:"Quản lý dữ liệu dùng chung."},homePageV2:{title:"Trang chủ",logsMoved:"Nhật ký đã chuyển sang workspace riêng",profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe"},analyticsPageV2:{title:"Phân tích",subtitle:"Phân tích sử dụng và thông tin chi tiết."},logsPageV2:{title:"Nhật ký",subtitle:"Xem và quản lý nhật ký hệ thống."},healthPageV2:{title:"Sức khỏe",subtitle:"Giám sát sức khỏe hệ thống."},aiProvidersPage:{title:"AI Providers",subtitle:"Quản lý cấu hình AI providers.",unableToLoad:"Không thể tải AI Providers"}}},ja:{translation:{locale:{en:"英語","zh-CN":"簡体字中国語",vi:"ベトナム語",ja:"日本語",ko:"韓国語"},layout:{languageSwitcher:"言語"},nav:{general:"全般",home:"ホーム",analytics:"分析",identityAccess:"認証とアクセス",apiProfiles:"API プロファイル",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概要",controlPanel:"コントロールパネル",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"アカウント",allAccounts:"すべてのアカウント",sharedData:"共有データ",compatibleClis:"互換",deprecated:"非推奨",factoryDroid:"Factory Droid",system:"システム",health:"ヘルス",logs:"ログ",settings:"設定",openrouterTooltip:"注目: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"プロファイル",cliproxy:"CLIProxy",accounts:"アカウント",health:"ヘルス",configurationRequired:"設定が必要"},auth:{dashboardTitle:"CCS Dashboard",protectedAccessLabel:"保護されたアクセス",remoteGuardLabel:"リモートアクセス保護",loading:"ダッシュボードのアクセス状態を確認しています…",loginDescription:"ホストで設定されたユーザー名とパスワードを使ってダッシュボードにアクセスしてください。",username:"ユーザー名",password:"パスワード",usernamePlaceholder:"ユーザー名を入力",passwordPlaceholder:"パスワードを入力",signIn:"サインイン",signingIn:"サインイン中...",loginFailed:"ログインに失敗しました",lightMode:"ライト",darkMode:"ダーク",noDefaultCredentials:"CCS にデフォルトの認証情報はありません。",credentialsHint:"認証情報は CCS ホスト上で `ccs config auth setup` を実行して作成します。Docker では、そのコマンドをコンテナ内で実行する必要があります。",remoteSetupTitle:"リモートアクセスには認証設定が必要です",remoteSetupDescription:"このダッシュボードはローカル以外のアドレスから開かれていますが、この CCS インスタンスではダッシュボード認証がまだ有効になっていません。",incompleteSetupDescription:"ダッシュボード認証は有効ですが、設定が未完了です。この CCS インスタンスの設定を完了してからサインインしてください。",safetyNoteRemote:"CCS ホスト管理者がダッシュボード認証を有効にするまで、リモート管理はロックされたままです。",safetyNoteLocal:"同じマシン上にいる場合は、localhost の URL を使うのが最も簡単です。",safetyNoteSession:"サインインに成功すると、このダッシュボードホストに限定された HTTP-only セッションが作成されます。",hostStepTitle:"CCS ホスト側で行うこと",hostStepDescription:"ダッシュボード認証情報を作成または再有効化してから、このページをリモート端末で開き直してください。",dockerStepDescription:"Docker の場合は、実行中のコンテナ内で次を実行してください:",localStepTitle:"もしこのマシンを使っているなら",localStepDescription:"`ccs config` が表示する localhost の URL を使い、LAN や Tailscale のアドレスは避けてください。",showPassword:"パスワードを表示",hidePassword:"パスワードを隠す"},commonToast:{apiKeyRequired:"API キーは必須です",accountAddedPresetFailed:"アカウントは追加されましたが、デフォルトプリセットの適用に失敗しました",settingsCopied:"設定をクリップボードにコピーしました",enterPresetName:"保存するプリセット名を入力してください",codeCopied:"コードをクリップボードにコピーしました",copyCodeFailed:"コードのコピーに失敗しました",appliedModelAllTiers:"すべてのティアにモデルを適用しました",settingsSaved:"設定を保存しました",defaultTargetUpdated:"デフォルトターゲットを更新しました",failedUpdateDefaultTarget:"デフォルトターゲットを {{target}}{{suffix}} に更新できませんでした",resourcesUpdated:"共有リソースを更新しました"},profileDialog:{editTitle:"プロファイルを編集",createTitle:"API プロファイルを作成",name:"名前",namePlaceholder:"my-api",baseUrl:"ベース URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API キー",defaultModel:"デフォルトモデル (ANTHROPIC_MODEL)",defaultModelHint:"空欄の場合は {{model}} を使用",modelMappingTitle:"モデルマッピング (Opus/Sonnet/Haiku)",modelMappingDesc:"各ティアに異なるモデル ID を設定します。異なるモデル種別を別バックエンドへ振り分ける API プロキシで便利です。",opusModel:"Opus モデル (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet モデル (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku モデル (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"キャンセル",saving:"保存中...",update:"更新",create:"作成"},modelTierMapping:{title:"モデルティアマッピング",advanced:"詳細",description:"Claude Code の opus/sonnet/haiku ティアごとに別のモデルを設定します。",autoSuggest:"{{provider}} に基づいて自動提案",opusPlaceholder:"例: anthropic/claude-opus-4",sonnetPlaceholder:"例: anthropic/claude-sonnet-4",haikuPlaceholder:"例: anthropic/claude-3.5-haiku",footer:"これにより ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL を設定します。"},envEditor:{sensitive:"機密",none:"環境変数は設定されていません。",noneHint:"下の入力から追加するか、JSON を直接編集してください。",addVariable:"環境変数を追加",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"値"},setupVariant:{using:"使用中:",variantNameRequired:"ランタイムバリアント名 *",variantNamePlaceholder:"例: my-gemini, g3, flash",invokeHintPrefix:"このバリアントで実行:",model:"モデル",modelPlaceholder:"例: gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"代わりにプリセットから選択",selectModel:"モデルを選択",customModelName:"カスタムモデル名...",enterAnyModel:"CLIProxy がサポートする任意のモデル名を入力",defaultModel:"デフォルト: {{model}}",providerDefault:"プロバイダーのデフォルト",back:"戻る",skip:"スキップ",creating:"作成中...",createVariant:"バリアントを作成",skipHint:"アカウント設定だけで十分で、別ランタイムバリアントが不要な場合はスキップできます"},customPresetDialog:{title:"カスタムプリセット",presetNameOptional:"プリセット名 (任意)",presetNamePlaceholder:"例: My Custom Config",codexTipPrefix:"Codex のヒント: サフィックス",codexTipSuffix:"で推論強度を固定できます。サフィックスなしのモデルは思考設定を使います。",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使用",opusModel:"Opus (最上位)",opusModelDesc:"複雑な推論タスク向け",sonnetModel:"Sonnet (バランス)",sonnetModelDesc:"速度と性能のバランス",haikuModel:"Haiku (高速)",haikuModelDesc:"単純なタスクにすばやく応答",cancel:"キャンセル",savePreset:"プリセットを保存",applyPreset:"プリセットを適用",deletePreset:"プリセットを削除"},componentModelSelector:{selectModel:"モデルを選択",availableModelsCount:"利用可能なモデル ({{count}})",preview:"プレビュー"},searchableSelect:{searchModels:"モデルを検索...",noResults:"一致する結果がありません。"},copilotSettings:{enableCopilot:"Copilot を有効化",enableCopilotDesc:"GitHub Copilot サブスクリプションを利用できるようにします",basicSettings:"基本設定",accountType:"アカウント種別",accountTypeIndividual:"個人",accountTypeBusiness:"ビジネス",accountTypeEnterprise:"エンタープライズ",rateLimiting:"レート制限",rateLimitSeconds:"レート制限 (秒)",noLimit:"制限なし",waitOnRateLimit:"レート制限時に待機",waitOnRateLimitDesc:"制限到達時にエラーではなく待機します",daemonSettings:"デーモン設定",autoStartDaemon:"デーモンを自動起動",autoStartDaemonDesc:"プロファイル使用時に copilot-api を起動します"},providerModelSelector:{selectModel:"モデルを選択",noModelsForProvider:"このプロバイダーで利用可能なモデルはありません",broken:"問題あり",deprecated:"非推奨",paid:"有料",freeTier:"無料ティア",paidTier:"有料ティア",modelKnownIssues:"このモデルには既知の問題があります",viewIssueDetails:"問題の詳細を見る",modelDeprecated:"このモデルは非推奨です",recommended:"推奨",allModelsCount:"すべてのモデル ({{count}})",noModelsAvailable:"利用可能なモデルはありません",shadowed:"シャドウ済み",prefixOnly:"プレフィックスのみ",current:"現在",currentValue:"現在の値",preferredPinnedModel:"優先ピンモデル:",pinnedRouteStatus:"ピンルートの状態:",pinnedModelNotAdvertised:"ピンモデルは現在プロキシから通知されていません: {{model}}",codexReasoningVariants:"推論バリアント",codexFastVariants:"高速バリアント"},createAuthProfileDialog:{title:"新しいアカウントを作成",description:"認証プロファイルには Claude CLI へのログインが必要です。以下のコマンドをターミナルで実行してください。同期モード、グループ、継続性の深さは後でアカウント一覧から編集できます。",profileName:"プロファイル名",profileNamePlaceholder:"例: work, personal, client",invalidProfileName:"名前は英字で始め、英数字、ハイフン、アンダースコアのみ使用できます。",enableSharedHistory:"他の ccs 認証アカウントとの共有履歴同期を有効にする",historySyncGroupOptional:"履歴同期グループ (任意)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"空欄の場合はデフォルトの共有グループを使用します。スペースはハイフンに正規化されます。",deeperContinuity:"詳細: より深い継続性モード",deeperContinuityHint:"session-env、file-history、shell-snapshots、todos の同期も追加します。認証情報は分離されたままです。",invalidContextGroup:"グループは英字で始め、英数字、ハイフン、アンダースコアのみ使用できます (最大 {{max}} 文字)。",command:"コマンド",commandFallback:"ccs auth create <name>",afterRunPrefix:"コマンド実行後:",afterRunStep1:"ブラウザで Claude のログインを完了します",afterRunStep2:"ここに戻って更新し、新しいアカウントを確認します",poolingHint:"Claude OAuth のプールルーティングを使う場合は、アカウントページのアクションボタンから CLIProxy Claude Pool を利用してください。",close:"閉じる",copied:"コピーしました!",copyCommand:"コマンドをコピー"},accountRouteGuide:{title:"推奨される 2 アカウント構成",description:"トークンを分離するため、別々の account profile を使います。両方のアカウントで同じローカル継続性を見たい場合だけ履歴同期を有効にします。",status:{empty:"アカウントを作成",isolated:"分離準備済み",shared:"プロジェクト文脈を共有",deeper:"拡張同期準備済み",mixed:"混在設定"},cards:{isolated:{title:"トークンは分離されたまま",desc:"各 ccs auth アカウントは専用の Claude 設定、ログイン、認証情報を持ちます。同期設定でトークンはコピーされません。"},select:{title:"使うアカウントを選ぶ",desc:"ccs work または ccs personal を実行して明示的に選びます。通常の ccs を特定アカウントに合わせたい場合だけ既定を設定します。"},settings:{title:"設定はルートに追従",desc:"非 bare アカウントは CCS shared state 経由で settings.json を ~/.claude/settings.json にリンクします。ccs auth show で確認できます。"},sync:{title:"履歴同期は任意",desc:"両方のアカウントで共有モードと同じグループが必要です。拡張同期では追加のローカル継続性ファイルも共有します。"}},commands:{isolated:"分離アカウントの使用",sync:"任意の共有履歴",syncDesc:'ローカル履歴を共有したい場合は、両方のアカウントで "{{group}}" など同じグループを使ってください。'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"その他"},cliproxyOverviewComponents:{availableModels:"利用可能なモデル",noModelsAvailable:"利用可能なモデルはありません",startSessionHint:"利用可能なモデルを取得するには CLIProxy セッションを開始してください",totalCount:"合計 {{count}}",availableThroughGroupedByProvider:"{{backendLabel}} 経由で利用可能なモデルをプロバイダー別に表示",moreCount:"+{{count}} 件"},categorizedModelSelector:{selectModel:"モデルを選択",noModelsAvailable:"利用可能なモデルはありません",modelPlaceholder:"モデル..."},openrouterQuickStart:{recommended:"推奨",title:"OpenRouter から始める",description:"OpenAI、Anthropic、Google、Meta などの {{modelCountLabel}} モデルを、1 つの API で利用できます。",featureOneApi:"1 つの API で全プロバイダー",profileSummaryCount:"{{count}} 件のプロファイル",profileSummaryCount_other:"{{count}} 件のプロファイル",profileSummaryEmpty:"高品質 + ローカル制御",summaryBadgeDefaultQuality:"既定で最高品質",summaryBadgeLocalLane:"タスクに合うときだけ local を使う",summaryExistingTitle:"プロファイルを選ぶか、新しいレーンを追加",summaryEmptyTitle:"最初のプロファイルレーンを選択",summaryExistingDescription:"このワークスペースには既に {{count}} 件のプロファイルがあります。重要なコーディング作業には高品質プロバイダーを使い、プライバシー・コスト・オフライン要件があるときだけローカルランタイムを追加してください。",summaryExistingDescription_other:"このワークスペースには既に {{count}} 件のプロファイルがあります。重要なコーディング作業には高品質プロバイダーを使い、プライバシー・コスト・オフライン要件があるときだけローカルランタイムを追加してください。",summaryEmptyDescription:"作業に合うレーンを選んでください。Premium プロバイダーは信頼性の高いコーディング向けの既定値で、ローカルランタイムはプライバシー、低コスト変換、実験向けです。",qualityLanesTitle:"高品質レーン",qualityLaneHighlightDefaultQuality:"重要なコーディング作業向けの既定ベストレーン",alibabaLaneDescription:"OpenRouter カタログの外で、専用の premium コーディングレーンが欲しいときに強い直接接続プロファイルです。",alibabaLaneHighlightQuality:"専用エンドポイントで premium 品質が必要なときに最適",localRuntimesTitle:"ローカルランタイム",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"プライベートなプロンプト、ローカル整理、低コストの一括変換に最適",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"カスタム GGUF 構成や高度なセルフホスト型ローカルワークフローに最適",localDetectedModels:"{{count}} 件のローカルモデルを検出",localDetectedModels_other:"{{count}} 件のローカルモデルを検出",localNoModelsDetected:"ローカルモデルはまだ検出されていません",localWaitingServer:"ローカルサーバーとモデル一覧を待機中",localRuntimeCheckingBadge:"確認中",localRuntimeReadyBadge:"準備完了",localRuntimeNeedsModelBadge:"モデルが必要",localRuntimeOfflineBadge:"オフライン",localRuntimeCheckingDescription:"セットアップ案内を表示する前に、ローカルランタイムの状態を確認しています。",localRuntimeReadyDescription:"プライベートなプロンプト、オフライン作業、より安価な一括変換に適しています。",localRuntimeNeedsModelDescription:"ランタイムは起動していますが、推奨ローカルモデルの取得または読み込みがまだ必要です。",localRuntimeOfflineDescription:"このレーンは、プライバシー重視の作業、安価なローカル変換、オフラインセッションに向いています。",localRuntimeCheckingFooter:"ローカルランタイムを確認しています...",localRuntimeReadyFooter:"{{endpoint}} でエンドポイント準備完了",localRuntimeMissingModelFooter:"ローカルセットアップを完了するには `{{command}}` を実行してください。",localRuntimeOfflineFooter:"ローカルエンドポイントを起動するには `{{command}}` を実行してください。",localRuntimeSetupAction:"{{label}} をセットアップ",localRuntimeUseAction:"{{label}} を使う",localRuntimeFinishAction:"{{label}} のセットアップを完了",runtimeProviderBadge:"ランタイムプロバイダー設定",runtimeProviderTitle:"AI Providers を開く",runtimeProviderManagedDescription:"CLIProxy 管理のコネクタ、プロバイダーシークレット、高度なルーティング制御が必要なときに使います。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex、OpenAI 互換コネクタ",runtimeProviderFeatureSecrets:"共有シークレットを個別の API プロファイルから切り離して管理",runtimeProviderFooter:"複数のプロファイルで 1 つのプロバイダー設定を共有したい場合に最適です。",createOpenRouterProfile:"OpenRouter プロファイルを作成",getApiKeyAt:"API キー取得:",createCustomProfile:"カスタム API プロファイルを作成"},alibabaCodingPlanQuickStart:{recommended:"推奨",title:"Alibaba Coding Plan を試す",description:"コーディング用途向けに、Anthropic 互換エンドポイント経由で Alibaba Cloud Coding Plan を利用します。",featureEndpoint:"Anthropic 互換エンドポイント",featureKeyFormat:"専用の sk-sp API キー",createAlibabaProfile:"Alibaba Coding Plan プロファイルを作成",readGuideAt:"セットアップガイド:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Anthropic エンドポイント経由の Model Studio Coding Plan",add:"追加"},credentialHealth:{title:"認証情報の状態",ready:"準備完了",noCredentialsConfigured:"認証情報が未設定です。上のログインボタンから認証してください。",neverUsed:"未使用",justNow:"たった今",unknown:"不明",daysAgo:"{{count}}日前",hoursAgo:"{{count}}時間前",minutesAgo:"{{count}}分前"},proxyStatusWidget:{justNow:"たった今",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",syncReady:"同期準備完了",noConfig:"設定なし",remoteProxy:"リモートプロキシ",active:"稼働中",trafficAutoRouted:"トラフィックは自動でリモートサーバーにルーティングされます",tooltipSync:"CLIProxy にプロファイルを同期",tooltipRestart:"再起動",tooltipStop:"停止",tooltipClose:"閉じる",tooltipVersionSettings:"バージョン設定",versionManagement:"バージョン管理",selectVersionPlaceholder:"インストールするバージョンを選択...",stable:"(安定版)",install:"インストール",versionsAboveUnstable:"{{version}} より新しいバージョンには既知の問題があります",versionsKnownIssues:"バージョン {{version}} には既知の問題があります",lastChecked:"最終確認: {{time}}",notRunning:"停止中",start:"起動",port:"ポート {{port}}",sessionCount:"{{count}} セッション",sessionCount_other:"{{count}} セッション",installFaultyTitle:"既知の問題があるバージョンをインストールしますか?",installFaultyDesc:"既知の不具合範囲 <strong>{{range}}</strong> に含まれる <strong>v{{version}}</strong> をインストールしようとしています。",installFaultyWarning:"このバージョンには既知のバグがあり、失敗したりプロキシが不安定になる可能性があります。",installUnstableTitle:"不安定なバージョンをインストールしますか?",installUnstableDesc:"最大安定版 <strong>v{{maxStable}}</strong> を上回る <strong>v{{version}}</strong> をインストールしようとしています。",installUnstableWarning:"このバージョンには安定性の問題があり、予期しない動作を引き起こす可能性があります。",installUnstableConfirm:"このまま続行しますか?",cancel:"キャンセル",installAnyway:"このままインストール",clickToDowngrade:"クリックしてダウングレード",clickToUpdate:"クリックして更新"},syncStatusCard:{profileSync:"プロファイル同期",ready:"準備完了",noConfig:"設定なし",syncsProfilesDesc:"API プロファイルをローカルの CLIProxy 設定に同期します",runDoctorHint:"設定を生成するには <code>ccs doctor --fix</code> を実行してください。",details:"詳細",syncNow:"今すぐ同期"},syncDialog:{title:"プロファイルをローカル CLIProxy に同期",description:"CCS の API プロファイルをローカルの CLIProxy config.yaml に同期します。",noProfiles:"同期するプロファイルがありません。",createProfilesFirst:"先にプロファイルタブで API プロファイルを作成してください。",modelLabel:"モデル:",ready:"準備完了",profilesToSync_one:"{{count}} 件のプロファイルを同期",profilesToSync_other:"{{count}} 件のプロファイルを同期",cancel:"キャンセル",syncing:"同期中...",synced:"同期完了",syncNow:"今すぐ同期"},errorLogs:{title:"エラーログ",failedRequests_one:"{{count}} 件の失敗したリクエスト",failedRequests_other:"{{count}} 件の失敗したリクエスト",cliproxyDiagnostics:"CLIProxy 診断",showingCount:"{{total}} 件中 50 件のログを表示",selectLog:"詳細を表示するログを選択してください",failedLoadContent:"ログ内容の読み込みに失敗しました",copyAbsolutePath:"絶対パスをコピー",copyRawContent:"生のログ内容をコピー",tabOverview:"概要",tabHeaders:"ヘッダー",tabRequest:"リクエスト",tabResponse:"レスポンス",tabRaw:"生データ",modelLabel:"モデル:",quotaResetsIn:"クォータのリセットまで ",method:"メソッド",provider:"プロバイダー",version:"バージョン",endpoint:"エンドポイント",url:"URL",timestamp:"タイムスタンプ",na:"該当なし",noHeaders:"利用可能なヘッダーはありません",noRequestBody:"リクエストボディなし",noResponseBody:"レスポンスボディなし",rateLimitedMsg:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。モデル {{model}} のクォータは上限に達しています。",rateLimitedMsgNoModel:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。",authFailedMsg:"認証に失敗しました。CLIProxy 設定で再認証するか、API キーを確認してください。",notFoundMsg:"エンドポイントが見つかりません。このプロバイダーには存在しない可能性があります。",serverErrorMsg:"上流サーバーでエラーが発生しました。後でもう一度試すか、プロバイダーのステータスページを確認してください。",timeoutMsg:"リクエストがタイムアウトしました。ネットワーク接続を確認するか、タイムアウト設定を延長してください。",unknown:"不明"},editAccountContext:{title:"履歴同期の設定",description:'"{{name}}" が他の CCS auth アカウントと履歴や継続性を共有する方法を設定します。',syncMode:"同期モード",selectContextMode:"コンテキストモードを選択",isolatedOption:"分離(同期なし)",sharedOption:"共有(同期あり)",sharedModeHint:"共有モードでは、同じ履歴同期グループ内のアカウントでワークスペースコンテキストを再利用します。",isolatedModeHint:"分離モードでは、このアカウントを他の CCS auth アカウントから完全に切り離します。",historySyncGroup:"履歴同期グループ",groupPlaceholder:"default",groupHint:"小文字に正規化されます(スペースはダッシュに変換)。使用可能: 英字、数字、_、-(最大 {{max}} 文字)。",invalidGroup:"英字で始まる有効なグループ名を入力してください。",continuityDepth:"継続性レベル",selectContinuityDepth:"継続性レベルを選択",standardOption:"標準(プロジェクトのみ)",deeperOption:"拡張継続性(上級者向け)",deeperHint:"上級モードでは、session-env、file-history、shell-snapshots、todos も同期します。",standardHint:"標準モードでは、プロジェクトのワークスペースコンテキストのみ同期します。",credentialsIsolated:"どのモードでも、認証情報と .anthropic はアカウントごとに分離されます。",implicationTitle:"保存後の挙動",isolatedImplication:"このアカウントは分離されたままです。他のアカウントからこの継続状態を再開できません。",sameGroupRule:"アカウント同士で継続性を共有するには、両方が同じグループ「{{group}}」を使う必要があります。",noSameGroupPeer:"現在このグループを使っている他のアカウントはありません。",sameGroupPeerCount_one:"このグループを使う他のアカウントが {{count}} 件あります。",sameGroupPeerCount_other:"このグループを使う他のアカウントが {{count}} 件あります。",deeperReady_one:"同じグループの {{count}} 件のアカウントがすでに拡張継続性を使っています。これは現状で最も強い引き継ぎ設定です。",deeperReady_other:"同じグループの {{count}} 件のアカウントがすでに拡張継続性を使っています。これは現状で最も強い引き継ぎ設定です。",deeperNeedsPeers:"このアカウントでは拡張継続性が有効ですが、同じグループの他アカウントでも拡張継続性を有効にしないと、アカウント間再開の期待には十分ではありません。",standardWarning:"標準共有はプロジェクト文脈向けです。アカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginalWarning:"古い会話が重要なら、設定を変える前に元のアカウントで再開してください。",cancel:"キャンセル",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"履歴同期の仕組み",description:"分離 -> 共有 -> 拡張共有。変更は各行の「同期」から行います。",learningMap:"概要図",isolated:"分離",shared:"共有",deeper:"拡張共有",cliproxyManaged_one:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",cliproxyManaged_other:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",showDetails:"詳細を表示: グループ、切り替え、レガシーポリシー",modeSwitch:"モード切り替え",modeSwitchDesc:"「同期」ダイアログでは、分離/共有の切り替えと、より深い継続性の選択ができます。",historySyncGroup:"履歴同期グループ",historySyncGroupDesc:"同じグループのアカウントは、同じプロジェクトのコンテキストレーンを共有します。未設定時は default を使います。",sameGroupRule:"現在、継続性を共有できるのは、両方のアカウントが共有モードかつ同じグループを使っている場合だけです。",deeperRecommendation:"グループ「{{group}}」は共有されていますが、アカウント間再開を期待するなら拡張継続性も有効にする方が安全です。",partialGroup:"グループ「{{group}}」は良い状態ですが、他のアカウントやグループでは同グループ設定や拡張継続性がまだ不足しています。",readyGroup:"グループ「{{group}}」では複数アカウントで拡張継続性が有効です。これは現状で最も強い引き継ぎ設定です。",legacyConfirmation_one:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。",legacyConfirmation_other:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。"},continuityReadiness:{title:"アカウント間再開チェック",description:"アカウントを切り替える前に、何が不足しているかをこのカードで確認できます。",state:{single:"単一アカウント",isolated:"再開オフ","shared-alone":"共有だが未完成","shared-standard":"プロジェクトのみ",partial:"一部のみ準備完了",ready:"強い引き継ぎ準備完了"},metrics:{isolated:"分離",sharedPeers:"同グループあり",deeperReady:"拡張準備完了"},messages:{single:{title:"現在は auth アカウントが 1 つだけです。",description:"アカウント間の引き継ぎはまだ関係ありません。共有継続性を設定する前に、もう 1 つ auth アカウントを追加してください。"},isolated:{title:"現在、アカウント間再開はオフです。",description:"表示中のアカウントはすべて分離モードのため、あるアカウントで作成したセッションはそのアカウントに残ります。"},"shared-alone":{title:"共有モードはありますが、どのグループにも相手がいません。",description_one:"{{count}} 件の共有アカウントが、同じグループに入る別アカウントを待っています。",description_other:"{{count}} 件の共有アカウントが、同じグループに入る別アカウントを待っています。"},"shared-standard":{title:"グループ「{{group}}」はプロジェクト文脈を共有していますが、拡張継続性のペアがまだありません。",description:"ユーザーはプロジェクト共有以上を期待する可能性があります。より強い引き継ぎのため、このグループ内の両アカウントで拡張継続性を有効にしてください。"},partial:{title:"1 つのグループは準備できていますが、全体の設定はまだ混在しています。",description:"少なくとも 1 つのグループでは拡張継続性が使われていますが、他のアカウントはまだ分離状態、共有グループ内で単独、または拡張継続性が未設定です。"},ready:{title:"グループ「{{group}}」は現状で最も強い継続性設定になっています。",description:"このグループでは複数アカウントがすでに拡張継続性を使っています。実際に再開できるかどうかは、Claude が上流で何を保存しているかにも依存します。"}},stepsTitle:"次にユーザーがやるべきこと",steps:{syncBoth:"切り替え先のアカウントだけでなく、両方のアカウントで「同期」を開いてください。",sameGroup:"両方のアカウントで同じ履歴同期グループを使ってください。現在の推奨グループは「{{group}}」です。",enableDeeper:"プロジェクト共有だけでなくアカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginal:"元の会話が重要なら、継続性設定を変える前に元のアカウントで再開してください。"},singleSteps:{addAccount:"アカウント間引き継ぎを考える前に、まず 2 つ目の ccs auth アカウントを作成してください。",sameGroupLater:"2 つ目のアカウントができたら、両方を同じ履歴同期グループに入れてください。",enableDeeperLater:"将来アカウント間再開を期待するなら、両方のアカウントで拡張継続性を有効にしてください。",resumeOriginal:"2 つ目のアカウントが整うまでは、重要な会話は元のアカウントから再開し続けてください。"}},continuityOverview:{plainLaneTitle:"通常の ccs は別の再開レーンを使っています",plainLaneDescription:"通常の ccs は現在 {{lane}} から再開しており、このアカウントのレーンではありません。同期設定を変える前に元のレーンを先に復旧してください。",setDefaultHint:"今後の通常の ccs を特定のアカウントに合わせたい場合は、その行の「既定に設定」を使ってください。",recommendBadge:"推奨 {{group}}",partialBadge:"部分同期 {{group}}",lane:{native:"ネイティブ Claude(~/.claude)",accountDefault:"アカウント {{name}}",accountInherited:"継続性継承によるアカウント {{name}}",profileDefault:"既定プロファイル {{name}}(ネイティブ Claude レーン)"}},accountsTable:{name:"名前",type:"種別",defaultBadge:"既定",created:"作成日",lastUsed:"最終使用",historySync:"履歴同期",sharedResources:"リソース",actions:"操作",syncTitle:"同期モード、グループ、継続性レベルを編集",resourcesTitle:"共有リソースの継承を編集",confirmLegacyTitle:"このレガシーアカウントの現在のモードを明示的に確定する",sync:"同期",confirm:"確定",active:"有効",setDefault:"既定に設定",deleteAccount:"アカウントを削除",cannotDeleteDefault:"既定のアカウントは削除できません",noAccounts:"CCS auth アカウントが見つかりません。追加するには ccs auth create を使ってください。",resetToDefault:"CCS の既定値に戻す",deleteDialogTitle:"アカウントを削除",deleteDialogDesc:'アカウント "{{name}}" を削除しますか? この操作でプロファイルと関連するすべてのセッションデータが削除されます。この操作は元に戻せません。',cancel:"キャンセル",delete:"削除",sharedGroupStandard:"共有({{group}}、標準)",sharedGroupDeeper:"共有({{group}}、拡張)",sharedGroupLegacy:"共有({{group}}、標準・レガシー)",isolatedLegacy:"分離(旧既定値)",isolated:"分離",resourcesShared:"共有",resourcesProfileLocal:"プロファイルローカル",noSameGroupPeer:"同じグループの相手がまだいません",sameGroupPeerCount_one:"{{count}} 件の同グループアカウント",sameGroupPeerCount_other:"{{count}} 件の同グループアカウント",legacyReview:"この推定された既定状態を確認して明示的に確定してください。",noHandoff:"アカウント間再開は元のアカウントに残ります。",badges:{shared:"共有",deeper:"拡張",legacy:"レガシー",isolated:"分離",profileLocal:"ローカル"}},addAccountDialog:{title:"{{displayName}} アカウントを追加",descKiro:"Kiro の認証方法を選び、ブラウザーで認証するか Kiro IDE からインポートしてください。",descDeviceCode:"認証をクリックすると、プロバイダーのサイトで入力する確認コードが表示されます。",descOauth:"認証をクリックすると OAuth URL を取得します。任意のブラウザーで開いてサインインしてください。",powerUserEnabled:"上級者モードが有効です",powerUserSkipped:"設定 > プロキシのパワーユーザーモードにより、AGY の責任確認チェックと Gemini ダッシュボードのリスク文言入力をスキップしています。OAuth / アカウントに関するリスクはすべて自己責任です。",powerUserLoadFailed:"パワーユーザーモード設定を読み込めませんでした。設定 > プロキシを確認してから再試行してください。",powerUserLoading:"パワーユーザーモードの安全設定を読み込み中です。少し待ってから再試行してください。",powerUserUnavailableRetry:"パワーユーザーモードは利用できません。必要なプロバイダーの安全確認を完了してから再試行してください。",authMethod:"認証方法",selectKiroAuthMethod:"Kiro の認証方法を選択",gitlabAuthMethod:"GitLab 認証方法",selectGitlabAuthMethod:"GitLab 認証方法を選択",gitlabAuthOAuth:"ブラウザー OAuth",gitlabAuthPat:"Personal Access Token",gitlabAuthHint:"gitlab.com ではブラウザー OAuth を使い、自前ホストや管理者運用環境では PAT を使ってください。",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"任意です。gitlab.com を使う場合は空欄のままにし、自前ホストの場合はベース URL を指定してください。",gitlabPat:"Personal Access Token",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"トークンには少なくとも次のスコープが必要です:",gitlabPatRequired:"PAT ログインには GitLab Personal Access Token が必要です。",nicknameRequired:"ニックネーム(必須)",nicknameOptional:"ニックネーム(任意)",nicknamePlaceholder:"例: work, personal",nicknameRequiredHint:"このプロバイダーでは必須です。重複しないわかりやすい名前を付けてください(例: work, personal)。",nicknameOptionalHint:"このアカウントを識別しやすい名前です。空欄の場合は安全な識別子を自動生成します。",waitingForAuth:"認証を待機中...",deviceCodeHint:"確認コードのダイアログがまもなく表示されます。プロバイダーのサイトでコードを入力してください。",browserHint:"ブラウザーで認証を完了してください。このダイアログは自動で閉じます。",openUrlLabel:"サインインするには、この URL を任意のブラウザーで開いてください:",copied:"コピー済み",copy:"コピー",open:"開く",popupBlocked:"ポップアップがブロックされました。上の URL をコピーして、ブラウザーで手動で開いてください。",redirectPasteLabel:"リダイレクトが機能しない場合は、コールバック URL を貼り付けてください:",callbackPlaceholder:"リダイレクト URL をここに貼り付け...",submitCallback:"コールバックを送信",submitting:"送信中...",preparingUrl:"サインイン URL を準備中...",cancel:"キャンセル",importingToken:"Kiro IDE からトークンをインポート中...",authenticate:"認証",importFromIde:"IDE からインポート",importing:"インポート中..."},flowViz:{backToProviders:"プロバイダーに戻る",showDetails:"詳細を表示",hideDetails:"詳細を隠す",showPausedAccounts:"一時停止を表示 ({{count}})",hidePausedAccounts:"一時停止を非表示 ({{count}})",visibleTotalRequests:"表示中のリクエスト",visibleAccounts:"表示中のアカウント",excludingPausedAccounts:"一時停止 {{count}} 件を除外中",resetLayout:"レイアウトをリセット",provider:"プロバイダー",totalRequests:"総リクエスト数",accounts:"アカウント",connectionTimeline:"接続タイムライン",noRecentConnections:"最近の接続はありません"},quickStats:{totalRequests:"総リクエスト数",successRate:"成功率",totalTokens:"総トークン数",activeModels:"アクティブなモデル"},authMonitor:{accounts:"アカウント",accountsCount:"{{count}} アカウント",success:"成功",failed:"失敗",successRate:"成功率"},accountCard:{resumeAccount:"アカウントを再開",pauseAccount:"アカウントを一時停止",quotaLoading:"クォータ...",quota:"クォータ",quotaUnavailable:"クォータ上限を取得できません",reauthNeeded:"再認証が必要",failureLabelReauth:"再認証",failureLabelWorkspace:"ワークスペース",failureLabelNoAccess:"アクセス不可",failureLabelRetry:"再試行",failureLabelReconnect:"再接続",failureLabelTemporary:"一時的",failureLabelUnavailable:"利用不可",failureHintReauth:"このアカウントの認証フローをもう一度実行して更新してください。",failureHintWorkspace:"このアカウントをアクティブなワークスペースに戻してから、削除して再追加してください。",failureHintNoAccess:"このアカウントでは、プロバイダーのクォータエンドポイントにアクセスできません。",failureHintRetry:"しばらく待ってから、クォータリクエストを再試行してください。",failureHintReconnect:"古いアカウントを削除し、再度認証してください。",failureHintTemporary:"一時的な問題のようです。後でもう一度試してください。",removeAndReadd:"削除して再追加",autoRefreshFailed:"自動更新に失敗しました"},antigravityChecklist:{title:"Antigravity OAuth の責任確認",subtitle:"認証する前に 4 ステップすべて完了してください。",mandatory:"必須",completion:"完了状況",stepsCount:"{{current}}/4 ステップ"},accountSafetyWarning:{title:"OAuth アカウント安全性の警告",subtitle:"Issue #509 · Gemini + AGY OAuth リスク",firstLine:"Issue #509 では、CCS AGY と、CCS Gemini と CCS AGY 間での共有アカウント利用に関連する停止・BAN 報告がまとめられています。",secondLine:"OAuth とアカウントアクセスのリスクをすべて自己責任で負う場合のみ続行してください。",issueLabel:"Issue #509 を読む",proxySettingsLabel:"Gemini + AGY の設定: 設定 > プロキシ"},cliproxyDialog:{name:"名前",provider:"プロバイダー",account:"アカウント",accountOptional:"アカウント(任意)",model:"モデル",modelOptional:"モデル(任意)",defaultTarget:"デフォルトターゲット",defaultTier:"デフォルトティア",tierConfig:"ティア設定",selectProvider:"プロバイダーを選択...",useDefaultAccount:"デフォルトのアカウントを使用",defaultSuffix:"(デフォルト)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"キャンセル",create:"作成",creating:"作成中...",saveChanges:"変更を保存",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"複合バリアントを編集: {{name}}",editSingleTitle:"単一バリアントを編集: {{name}}"},profileEditor:{profileInfo:"プロファイル情報",profileName:"プロファイル名",filePath:"ファイルパス",lastModified:"最終更新",defaultTarget:"デフォルトターゲット",quickUsage:"クイック実行",runWithProfile:"このプロファイルで実行",runOnDroid:"Droid で実行",runOnDroidWithFlag:"--target で Droid 実行",droidAliasExplicit:"Droid エイリアス(明示)",overrideToClaude:"Claude に切り替え",overrideToClaudeExplicit:"Claude に切り替え(明示)",targetHintPreferredAlias:"推奨の明示エイリアス:",targetHintClaudeDefault:"デフォルトコマンド:",targetHintLegacyAlias:"従来ショートカットも利用可能:",targetHintOverride:"実行ごとに次でも上書きできます",setAsDefault:"デフォルトに設定",provider:"プロバイダー",custom:"カスタム",providerChooserHint:"まずプリセットを選び、その後で URL、API Key、モデルマッピングを調整できます。",featuredProviders:"注目のプロバイダー",scrollHint:"画面が狭い場合は横にスクロールできます",customEndpoint:"カスタムエンドポイント",morePresets:"その他のプリセット",customEndpointDescription:"空の Anthropic 互換 URL から始め、すべて手動で設定します。"},settings:{sectionLoadFailed:"セクションの読み込みに失敗しました",unknownError:"不明なエラーが発生しました",reloadPage:"ページを再読み込み",refresh:"更新",copy:"コピー",copied:"コピーしました",saved:"保存しました",loading:"読み込み中...",configFileNotFound:"設定ファイルが見つかりません"},settingsTabs:{browser:"ブラウザ",web:"Web検索",image:"画像",channels:"チャンネル",env:"環境変数",think:"思考",proxy:"プロキシ",auth:"認証",backup:"バックアップ"},settingsAuth:{failedFetchTokens:"認証トークンの取得に失敗しました",failedSaveTokens:"トークンの保存に失敗しました",tokensUpdated:"トークンを更新しました。反映するには CLIProxy を再起動してください。",failedRegenerate:"シークレットの再生成に失敗しました",secretRegenerated:"新しい Management Secret を生成しました。反映するには CLIProxy を再起動してください。",failedReset:"トークンのリセットに失敗しました",tokensReset:"トークンをデフォルトに戻しました。反映するには CLIProxy を再起動してください。",description:"CLIProxy の認証トークンを設定します。変更を反映するには CLIProxy の再起動が必要です。",apiKey:"API Key",custom:"カスタム",apiKeyDesc:"Claude Code が CLIProxy への認証に使用します",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"CCS ダッシュボードが CLIProxy の管理 API にアクセスするために使用します",managementSecretPlaceholder:"Management secret",generateSecret:"新しい安全なシークレットを生成",resetDefaults:"デフォルトに戻す",resetDesc:"API Key と Management Secret の両方をデフォルト値に戻します。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"Claude 以外のサブスクリプション型プロファイル(gemini、codex、agy、ghcp など)に注入する環境変数",enabled:"グローバル環境変数を有効化",disabled:"グローバル環境変数を無効化",enabledDesc:"環境変数をサードパーティープロファイルに注入します",disabledDesc:"環境変数は注入されません",envVars:"環境変数",noneConfigured:"環境変数は未設定です",addNew:"変数を追加",keyName:"KEY_NAME",value:"値",add:"追加",quickAdd:"よく使う変数を追加",allConfigured:"主要な変数はすべて設定済みです"},settingsBackups:{failedFetch:"バックアップの取得に失敗しました",failedRestore:"バックアップの復元に失敗しました",restoreSuccess:"バックアップを復元しました",title:"設定バックアップ",description:"settings.json の以前のバージョンを復元します。設定を変更するとバックアップが自動作成されます。",none:"利用できるバックアップはありません",noneHint:"設定を変更すると、ここにバックアップが表示されます",latest:"最新",restoring:"復元中...",restore:"復元",restoreConfirmTitle:"バックアップを復元しますか?",restoreConfirmPrefix:"現在の設定を次のバックアップで置き換えます:",restoreConfirmSuffix:"この操作は元に戻せません。",cancel:"キャンセル"},settingsWebsearch:{description:"サードパーティープロファイル(gemini、codex、agy など)向けの CLI ベース Web 検索",enabled:"WebSearch を有効化",disabled:"WebSearch を無効化",checking:"状態を確認中...",providers:"プロバイダー",noneConfigured:"プロバイダーが設定されていません",noneConfiguredHint:"Web 検索プロバイダーを有効にするには CLI ツールをインストールしてください",checkProviders:"プロバイダーを確認",installed:"インストール済み",notInstalled:"未インストール",model:"モデル:",howInstall:"{{name}} CLI のインストール方法",installGlobally:"グローバルにインストール",requiresKey:"(xAI API Key が必要)",freeTier:"(無料枠あり)",viewDocs:"ドキュメントを見る"},settingsProxy:{failedLoadAgyMode:"パワーユーザーモードの読み込みに失敗しました",failedUpdateAgyMode:"パワーユーザーモードの更新に失敗しました",failedVerifyAgyMode:"パワーユーザーモードの永続化確認に失敗しました",notPersistedAgyMode:"パワーユーザーモードが保存されませんでした。別のプロセスが設定を変更した可能性があります。",agyModeEnabled:"パワーユーザーモードを有効にしました。",agyModeDisabled:"パワーユーザーモードを無効にしました。",typePhraseToContinue:"続行するには「{{value}}」と入力してください。",description:"プロキシベースのプロファイル用に、ローカルまたはリモートの {{backend}} 接続を設定します",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"インスタンス状態",connectionMode:"接続モード",local:"ローカル",remote:"リモート",localDesc:"このマシンで {{backend}} バイナリを実行します",remoteDesc:"リモートの {{backend}} サーバーに接続します",backendBinary:"バックエンドバイナリ",stopProxyToSwitch:"バックエンドを切り替える前に、インスタンス状態から実行中のプロキシを停止してください。",default:"デフォルト",plusDesc:"追加プロバイダー向けのオプショントラックです。引き続きサポートされていますが、現在は upstream ではなくコミュニティ保守です。",originalDesc:"コアプロバイダートラック向けの既定かつ常時利用可能な backend。",plusFallbackNotice:"Plus プロバイダートラックは廃止ではありませんが、保守中の fork が戻るまではローカル CLIProxy は引き続きオリジナル backend にフォールバックします。",variantsIncompatible:"既存の plus-extra バリアント({{providers}})はオリジナル backend では動作しません。参照用に残すことはできますが、使用前に Plus へ切り替えてください。",safety:"安全設定",agyModeTitle:"Antigravity + Gemini パワーユーザーモード",agyModeDesc:"アカウント追加画面の AGY 責任確認チェックと、Gemini ダッシュボードの入力確認をスキップします。",agyWarning:"OAuth の停止/BAN リスクパターン (#509) を十分理解している場合にのみ使用してください。CCS はアカウント喪失の責任を負いません。",finalConfirm:"最終確認",finalConfirmDesc:"有効にすると、ダッシュボード / CLI の AGY 安全チェックと Gemini ダッシュボードのリスク文言確認をスキップします。続行する前に issue #509 を確認し、正確なフレーズを入力してください。",step1:"ステップ 1",readIssue:"Issue #509 を読む",step2:"ステップ 2",typePrefix:"有効にするには",typeSuffix:"と入力してください。",typePhraseAria:"Antigravity + Gemini パワーユーザーモードを有効にするには I ACCEPT RISK と入力してください",exactPhrase:"完全一致で入力してください。",enableAgyMode:"Antigravity + Gemini パワーユーザーモードを有効にする",toggleAgyMode:"Antigravity + Gemini パワーユーザーモードを切り替え",fallbackSettings:"フォールバック設定",enableFallback:"ローカルへのフォールバックを有効化",enableFallbackDesc:"リモートに接続できない場合はローカルプロキシを使用します",autoStartLocal:"ローカルプロキシを自動起動",autoStartLocalDesc:"フォールバック時にローカルプロキシを自動で起動します",advanced:"詳細設定",debugMode:"デバッグモード",debugModeDesc:"ブラウザコンソールで開発者向け診断を有効にします",debugModeEnabled:"デバッグモードを有効にしました。詳細ログはブラウザコンソールを確認してください。",localProxy:"ローカルプロキシ",port:"ポート",autoStart:"自動起動",localAutoStartDesc:"必要になったらローカルプロキシを自動起動します",remoteConfigTitle:"リモートサーバー設定",host:"ホスト",hostPlaceholder:"192.168.1.100 または proxy.example.com",defaultPort:"デフォルト: {{value}}",portPlaceholder:"{{value}} を使う場合は空欄",protocol:"プロトコル",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(任意)",apiKeyPlaceholder:"/v1/* API エンドポイント用",apiKeyDesc:"/v1/chat/completions への API リクエストで使用します",managementKeyOptional:"Management Key(任意)",managementKeyPlaceholder:"/v0/management/* エンドポイント用",managementKeyDesc:"ダッシュボードの管理 API で使用します。未設定の場合は API Key を使用します。",testing:"テスト中...",testConnection:"接続をテスト",connectedLatency:"接続済み({{value}}ms)",connectionFailed:"接続に失敗しました",invalidPortOrEmpty:"ポートは 1〜65535 の整数で入力するか、デフォルトを使う場合は空欄にしてください",invalidLocalPort:"ローカルポートは 1〜65535 の整数で指定してください",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"対応モデルの高度な思考 / 推論設定を行います。",supportedProviders:"対応プロバイダー",modeTitle:"思考モード",modeAutoDesc:"モデルのティアに応じて思考レベルを自動設定します",modeOffDesc:"高度な思考を無効化します",modeManualDesc:"永続的な上書きレベルを設定するか、実行ごとに CLI フラグを使います",tierDefaults:"ティア別デフォルト",tierDefaultsDesc:"自動モード時に各モデルティアへ適用する既定の思考レベルです。",persistentOverride:"永続オーバーライド",persistentOverrideDesc:"すべてのセッションに適用されます。CLI フラグが優先されます。",enterCustomBudget:"カスタム予算を入力",apply:"適用",providerOverrides:"プロバイダー別オーバーライド({{count}})",providerOverridesDesc:"特定のプロバイダーに対してティア別デフォルトを上書きします。必要に応じてカスタムのプロバイダーキーを追加してください。",addProviderPlaceholder:"プロバイダーキーを追加(例: qwen)",showWarnings:"警告を表示",showWarningsDesc:"思考値が制限または調整された場合に警告を表示します",cliEnvOverride:"CLI / 環境変数の上書き",supportLine1Prefix:"思考予算:",supportLine1Suffix:"(トークンベース)",supportLine2Prefix:"推論強度:",supportLine2SuffixPrefix:"(サフィックス、または ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex のサフィックスは推論強度を固定します(例: ",supportLine3Suffix:")。サフィックスなしのモデルは思考モードを使います。"},analytics:{title:"分析",noDailyUsage:"本日の使用データはありません",noUsageData:"利用可能な使用データはありません",subtitle:"利用状況とインサイトを確認",month:"月",allTime:"全期間",updated:"最終更新: {{value}}"},analyticsSummary:{totalTokens:"総トークン数",totalTokensSubtitle:"入力 {{input}} / 出力 {{output}}",totalCost:"総コスト",totalCostSubtitle:"1日平均 ${{value}}",cacheTokens:"キャッシュトークン",cacheTokensSubtitle:"${{cost}}(コストの{{percent}}%)",inputCost:"入力コスト",outputCost:"出力コスト",tokensSubtitle:"{{value}} トークン"},apiProfiles:{title:"API プロファイル",sidebarTitle:"API プロファイル",sidebarSubtitle:"プレミアム API、ローカルランタイム、カスタムエンドポイント",new:"新規",searchPlaceholder:"プロファイルを検索...",loadingProfiles:"プロファイルを読み込み中...",failedLoadTitle:"プロファイルを読み込めませんでした",failedLoadDesc:"API プロファイルを取得できませんでした。もう一度お試しください。",retry:"再試行",noProfilesYet:"API プロファイルがまだありません",noProfilesDesc:"最初のプロファイルを作成して、カスタム API エンドポイントに接続します",createProfile:"プロファイルを作成",noProfileMatch:'"{{query}}" に一致するプロファイルはありません',profileCount:"{{count}} 件のプロファイル",profileCount_other:"{{count}} 件のプロファイル",configuredCount:"{{count}} 件設定済み",deleteProfileTitle:"プロファイルを削除",deleteProfileDesc:'"{{name}}" を削除しますか?設定ファイルも削除され、この操作は元に戻せません。',delete:"削除",unsavedChangesTitle:"未保存の変更",unsavedChangesDesc:'"{{current}}" に未保存の変更があります。破棄して "{{next}}" に切り替えますか?',discardSwitch:"破棄して切り替え",noOrphansFound:"孤立したプロファイル設定は見つかりませんでした",confirmRegisterOrphans:"{{total}} 件の孤立したプロファイル設定ファイルが見つかりました。うち {{valid}} 件は登録可能です。今すぐ登録しますか?",registeredWithSkipped:"({{count}} 件スキップ)",registeredProfiles:"{{count}} 件のプロファイルを登録しました",copyPrompt:"「{{name}}」をどの新しいプロファイル名にコピーしますか?",destinationEmpty:"コピー先のプロファイル名は空にできません",exportRedacted:"トークンをマスクした状態でエクスポートしました。必要なら CLI の include-secrets フローを使ってください。",exportDownloaded:"プロファイルのエクスポートをダウンロードしました",importFailed:"プロファイルバンドルをインポートできませんでした",discoverOrphans:"孤立プロファイルを検出",importProfileBundle:"プロファイルバンドルをインポート"},accountsPage:{title:"アカウント",managePrefix:"一つの画面で",manageSuffix:"のアカウント管理とプール導線をまとめて扱えます。",mobileManageSuffix:"の継続性設定をまとめて管理できます。",primaryActions:"主要アクション",createAccount:"アカウントを作成",authClaudeInPool:"Pool で Claude を認証",openClaudePoolSettings:"Claude Pool の設定を開く",openCliProxyClaudePool:"CLIProxy Claude Pool を開く",migrationFollowup:"移行フォローアップ",legacyContextPending:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContextPending_other:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContinuityPending:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",legacyContinuityPending_other:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",confirmingLegacy:"レガシーポリシーを確認中...",confirmLegacy:"レガシーポリシーを確認({{count}})",noLegacyFollowup:"保留中のレガシーフォローアップはありません。",continuityGuide:"継続性ガイド",expandWhenNeeded:"必要なときだけ展開。",sharedStandard:"共有標準",sharedStandardDesc:"プロジェクトワークスペースの同期のみ。ほとんどのチームに最適な既定値です。",sharedDeeper:"共有拡張",sharedDeeperDesc:"session-env、file-history、shell-snapshots、todos も同期します。アカウント間再開を期待するなら推奨です。",sharedDeeperPrefix:"追加で",isolated:"分離",isolatedDesc:"リンクなし。厳密な分離に最適です。",quickCommands:"クイックコマンド",quickCommandsDesc:"コピーしてターミナルで実行します。",workspaceBadge:"ccs auth ワークスペース",historySyncBadge:"履歴同期設定",resourcesBadge:"共有リソース設定",resourcesShared:"共有",resourcesProfileLocal:"プロファイルローカル",authAccounts:"認証アカウント",tableScopePrefix:"この表では",tableScopeMiddle:"のアカウントのみを表示します。モード/グループ/継続性の変更は",tableScopeSuffix:"を使ってください。",accountMatrix:"アカウント一覧",sharedTotalDesc:"共有アカウント合計: {{count}}。ここから同期設定とレガシー確認を行えます。",loadingAccounts:"アカウントを読み込み中..."},health:{justNow:"たった今",secondsAgo:"{{count}}秒前",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",systemHealth:"システムヘルス",build:"ビルド {{version}}",lastScan:"最終スキャン:",autoRefresh:"自動更新:",refresh:"更新",checks:"チェック",version:"バージョン",platform:"プラットフォーム",liveMonitoring:"ライブ監視中",copied:"クリップボードにコピーしました",refreshing:"ヘルスチェックを更新中...",fix:"修正",applyFix:"修正を適用",healthLabel:"ヘルス"},updates:{actionRequired:"対応が必要",done:"完了",all:"すべて",inboxTitle:"更新センター",inboxSubtitle:"対応を優先し、その後で完了または非表示にします。",needsAction:"要対応",doneCount:"完了",searchPlaceholder:"対応内容またはコマンドを検索",noNotices:"このビューに一致する通知はありません。",noUpdates:"利用可能な更新はありません。",published:"{{date}} 公開",markDone:"完了にする",dismiss:"非表示",reopen:"再表示",doNext:"次にやる",impactedIntegrations:"影響を受ける連携",impactedDesc:"更新範囲とルーティングに基づく関連領域です。",whyMatters:"重要な理由",whyMattersDesc:"長文のリリースノートではなく、要点だけを表示します。",open:"開く",progressNeedsAction:"要対応",progressInReview:"確認中",progressDone:"完了",progressDismissed:"非表示",statusNew:"新着",statusStable:"安定",statusPlanned:"予定",dashboard:"ダッシュボード",cliUsage:"CLI利用状況"},cliproxyPage:{connected:"接続済み",notConnected:"未接続",variant:"バリアント",parentNotConnected:"親が未接続",viaProvider:"{{provider}} 経由",emptyTitle:"CCS プロファイルマネージャー",emptyDesc:"CLIProxy プロバイダー向けの OAuth 認証、アカウント設定、モデル選択を管理します。CCS が各 AI バックエンドへのリクエストをどうルーティングするかを設定できます。",emptyControlPanelPrefix:"ライブ利用統計とリアルタイム監視は",controlPanel:"コントロールパネルで確認できます",quickSetup:"クイックセットアップ",addAccount:"アカウントを追加",advancedVariant:"高度なバリアント",setupActionsHint:"ここでアカウントを追加します。別ランタイム/プロファイルが必要な場合のみバリアントを作成します。",accountManagement:"CCSレベルのアカウント管理",providers:"プロバイダー",variants:"バリアント",providerCount:"{{count}} 件のプロバイダー",providerCount_other:"{{count}} 件のプロバイダー",connectedCount:"{{count}} 件接続済み",variantDisplay:"{{name}}({{provider}} バリアント)"},copilotPage:{title:"Copilot",subtitle:"非推奨の GitHub Copilot 互換ブリッジ",deprecatedBadge:"非推奨",deprecationTitle:"非推奨の互換ブリッジ",deprecationItem1:"GitHub Copilot の従量課金は 2026-06-01 に開始されます",deprecationItem2:"既存のローカル設定は互換用として引き続き利用できます",deprecationItem3:"新規設定では Codex または他の有効なプロバイダーを優先してください",setup:"セットアップ",auth:"認証",daemon:"デーモン",unofficialTitle:"非公式API: 自己責任で利用してください",unofficialItem1:"リバースエンジニアリングされたAPIのため、いつでも動かなくなる可能性があります",unofficialItem2:"過度な利用でアカウントに制限がかかる可能性があります",unofficialItem3:"CCSは保証も責任も負いません",yes:"はい",no:"いいえ",installed:"インストール済み",missing:"未インストール",integration:"連携",enabled:"有効",disabled:"無効",github:"GitHub",connected:"接続済み",notConnected:"未接続",authenticate:"認証する",authenticating:"認証中...",status:"ステータス",running:"稼働中",stopped:"停止",port:"ポート",stopping:"停止中...",stop:"停止",starting:"起動中...",start:"起動",installing:"インストール中...",installCopilotApi:"copilot-api をインストール",proxy:"プロキシ",active:"有効",inactive:"無効"},cursorPage:{title:"Cursor",beta:"ベータ",deprecated:"非推奨",subtitle:"旧 Cursor セットアップ向けの非推奨ローカルブリッジ",unofficialTitle:"レガシーブリッジは非推奨です。CLIProxy 管理の Cursor を優先してください",unofficialItem1:"推奨パス: CLIProxy で Cursor の認証とアカウント管理を行う",unofficialItem2:"このリバースエンジニアリングされたローカルブリッジは、既存セットアップ向けの互換用です",unofficialItem3:"このレガシーパスについて CCS は保証も責任も負いません",supportedPathTitle:"推奨パス",supportedPathDesc:"新しいセットアップでは、CLIProxy 管理の Cursor 認証とアカウント管理を使ってください。旧来のローカルデーモンに依存している場合のみ、下のレガシーブリッジを使い続けてください。",startCliproxyAuth:"CLIProxy で Cursor 認証を開始",openCliproxyCursor:"CLIProxy の Cursor を開く",integration:"連携",authentication:"認証",daemon:"デーモン",enabled:"有効",disabled:"無効",expired:"期限切れ",connected:"接続済み",notConnected:"未接続",running:"稼働中",stopped:"停止中",actions:"レガシー操作",disableIntegration:"連携を無効化",enableIntegration:"連携を有効化",autoDetectAuth:"旧 IDE から自動検出",manualAuthImport:"旧方式で手動インポート",stopDaemon:"デーモンを停止",startDaemon:"デーモンを起動",port:"ポート",configuration:"Cursor設定",lastModified:"最終更新:",neverSaved:"未保存",saving:"保存中...",save:"保存",modelConfig:"モデル設定",settings:"設定",info:"情報",presets:"プリセット",presetsDesc:"事前設定済みのモデルマッピングを適用します",modelMapping:"モデルマッピング",modelMappingDesc:"各ティアで使うモデルを設定します",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使われます。",opusModel:"Opus(最高性能)",opusModelDesc:"複雑な推論と最高品質の応答向け。",sonnetModel:"Sonnet(バランス)",sonnetModelDesc:"一般的なコーディングや日常的なチャット向け。",haikuModel:"Haiku(高速)",haikuModelDesc:"低レイテンシで軽量なリクエスト向け。",runtimeSettings:"ランタイム設定",autoStartDaemon:"デーモンを自動起動",autoStartDesc:"連携使用時にCursorデーモンを自動で起動します。",ghostMode:"ゴーストモード",ghostModeDesc:"テレメトリ削減のため x-ghost-mode を要求します。",provider:"プロバイダー",filePath:"ファイルパス",availableModels:"利用可能なモデル",loadingModels:"モデルを読み込み中...",noModels:"モデルメタデータはまだありません。デーモンを起動して更新してください。",default:"デフォルト",rawConfiguration:"生の設定(JSON)",manualImportTitle:"Cursor 認証情報の手動インポート",manualImportDesc:"自動検出できない場合は、CursorのアクセストークンとマシンIDを入力してください。",accessToken:"アクセストークン",accessTokenPlaceholder:"Cursorのアクセストークンを貼り付け",machineId:"マシンID",machineIdPlaceholder:"32文字の16進数(ハイフンなしUUID)",cancel:"キャンセル",import:"インポート",selectModel:"モデルを選択",useDefaultModel:"デフォルトモデルを使用",availableModelCount:"利用可能なモデル({{count}})",invalidPort:"ポートは1から65535の整数で指定してください",defaultModelRequired:"デフォルトモデルは必須です",savedConfig:"Cursor設定とモデルマッピングを保存しました",failedSaveConfig:"設定の保存に失敗しました",modelsLoadingWait:"モデルの読み込み中です。プリセットの適用前にしばらくお待ちください。",noModelsAvailable:"まだ利用可能なモデルがありません。先にデーモンを起動して更新してください。",appliedCodexPreset:"GPT-5.3 Codexプリセットを適用しました",appliedClaudePreset:"Claude 4.6プリセットを適用しました",appliedGeminiPreset:"Gemini 3プリセットを適用しました",integrationEnabled:"Cursor連携を有効化しました",integrationDisabled:"Cursor連携を無効化しました",failedUpdateIntegration:"連携状態の更新に失敗しました",credentialsImported:"Cursor認証情報をインポートしました",autoDetectFailed:"自動検出に失敗しました",manualRequired:"トークンとマシンIDは必須です",manualImportFailed:"手動インポートに失敗しました",failedStartDaemon:"デーモンの起動に失敗しました",daemonStarted:"デーモンを起動しました",daemonStartedWithPid:"デーモンを起動しました(PID: {{pid}})",failedStopDaemon:"デーモンの停止に失敗しました",daemonStopped:"デーモンを停止しました",rawLoading:"生の設定をまだ読み込み中です。しばらく待ってから再試行してください。",invalidJson:"JSONが不正です",rawSaved:"生の設定を保存しました",rawChanged:"生の設定が外部で変更されました。更新して再試行してください。",failedSaveRaw:"生の設定の保存に失敗しました",savedAll:"Cursor設定を保存しました",liveProbe:"ライブプローブ",runLiveProbe:"ライブプローブを実行",rerunLiveProbe:"ライブプローブを再実行",probing:"プローブを実行中...",probeNotRun:"まだプローブを実行していません",probeLocalReadinessHint:"ローカルの準備チェックが通っても、実際のランタイム経路は失敗する場合があります。ライブプローブで Cursor の完全な経路を確認してください。",probeStage:"段階",probeHttpStatus:"HTTP ステータス",probeDuration:"所要時間",probeModel:"モデル",probeMessage:"メッセージ",probeSucceeded:"プローブ成功",probeFailed:"プローブ失敗",probeSaveFirst:"ライブプローブを実行する前に Cursor の変更を保存するか破棄してください",refreshStatus:"Cursor の状態を更新",refreshConfiguration:"Cursor の設定を更新"},droidPage:{loadingDiagnostics:"Droid診断を読み込み中...",failedDiagnostics:"Droid診断の読み込みに失敗しました。",overview:"概要",byok:"BYOK",docs:"ドキュメント",runtimeInstall:"ランタイムとインストール",status:"状態",detected:"検出済み",notFound:"未検出",detectionSource:"検出元",binaryPath:"バイナリパス",installDirectory:"インストール先",version:"バージョン",overridePath:"オーバーライド(CCS_DROID_PATH)",configFiles:"設定ファイル",path:"パス",resolved:"解決先",size:"サイズ",lastModified:"最終更新",parseWarning:"解析警告: {{value}}",readWarning:"読み取り警告: {{value}}",warnings:"警告",byokSummary:"BYOK概要",activeModelSelector:"現在のモデルセレクター",customModels:"カスタムモデル",ccsManaged:"CCS管理",userManaged:"ユーザー管理",malformedEntries:"不正なエントリ",providers:"プロバイダー",none:"なし",customModelsTitle:"カスタムモデル",modelName:"名前 / モデル",provider:"プロバイダー",baseUrl:"ベース URL",noCustomModels:"カスタムモデルはありません",docsAlignedNotes:"ドキュメント整合メモ",factoryDocs:"Factory Docs",providerFactCheckDocs:"プロバイダー検証ドキュメント",providerValues:"プロバイダー値: {{value}}",settingsHierarchy:"設定階層: {{value}}",settingsTitle:"Droid BYOK 設定",fixJsonBeforeQuickSettings:"クイック設定を使う前に JSON 構文を修正してください。",fixJsonBeforeReasoning:"BYOK 推論設定を更新する前に JSON 構文を修正してください。",unableUpdateReasoning:"選択した BYOK モデルの推論設定を更新できません。",fixJsonBeforeBudget:"思考予算を更新する前に JSON 構文を修正してください。",anthropicOnlyBudget:"思考予算は Anthropic の BYOK モデルでのみ利用できます。",invalidJson:"JSON が不正です: {{value}}",saved:"Droid 設定を保存しました",changedExternally:"Droid 設定が外部で変更されました。更新して再試行してください。",failedSave:"Droid 設定の保存に失敗しました"},sharedPage:{commands:"コマンド",skills:"スキル",agents:"エージェント",plugins:"プラグイン",settings:"設定",title:"共有リソース",subtitle:"アカウント間で共有されるコマンド、スキル、エージェント、プラグイン、設定",totalShared:"共有数",visible:"表示中",markdownDetail:"Markdown詳細ビュー",registryDetail:"レジストリ詳細ビュー",maskedSettingsDetail:"マスク済み設定ビュー",filterPrefix:"フィルター:",configurationRequired:"設定が必要です",countsUnavailable:"件数を取得できません",retryCounts:"件数を再取得",filterPlaceholder:"{{tab}}を名前、説明、パスで絞り込み",showing:"{{visible}} / {{total}} 件の{{tab}}を表示",showingQuery:"(「{{query}}」で絞り込み)",refreshing:"(更新中...)",loadingShared:"共有{{tab}}を読み込み中...",failedLoadShared:"共有{{tab}}の読み込みに失敗しました",retry:"再試行",noSharedFound:"共有{{tab}}が見つかりません。`ccs sync` を実行するか、共有ディレクトリに項目を追加してください。",noPluginsFound:"共有プラグインはインストールされていません。実際のプラグインが存在するまで、プラグインレジストリとキャッシュフォルダーは非表示になります。",noMatch:"{{tab}}で「{{query}}」に一致するものはありません。",selectOne:"内容を表示する{{tab}}を選択してください。",pathLabel:"パス",resolvedSource:"解決後ソース",loadingMarkdown:"Markdownコンテンツを読み込み中...",loadingSettings:"設定内容を読み込み中...",failedLoadContent:"コンテンツの読み込みに失敗しました",retryContent:"再読み込み",noMarkdown:"Markdownコンテンツはありません。",settingsTitle:"settings.json",settingsDescription:"このファイルには shared モードの全アカウントにリンクされる共有設定が含まれます。",settingsPath:"共有設定パス",settingsActive:"有効",settingsInactive:"未検出",resourcePolicies:"リソースポリシー",resourcePoliciesDescription:"shared のアカウントはこのハブを継承します。profile-local のアカウントはコマンド、スキル、エージェント、プラグイン、設定を分離します。",sharedAccounts:"{{count}} shared",profileLocalAccounts:"{{count}} profile-local",moreProfileLocalAccounts:"+{{count}} 件"},accountCardStats:{notUsedYet:"未使用"},accountQuotaPanel:{weekly:"週間",loadingQuota:"クォータを読み込み中..."},accountSurfaceCard:{business:"ビジネス",free:"無料",personal:"個人",variant:"バリアント"},accountIdentity:{business:"ビジネス",personal:"個人",free:"無料",team:"チーム",plus:"Plus",pro:"Pro",workspace:"ワークスペース {{id}}"},aiProvidersEntryCard:{apiKeys:"API Keys"},aiProvidersEntryDialog:{connectorName:"コネクタ名",baseUri:"ベース URL",proxyUrl:"プロキシ URL",secret:"シークレット",prefix:"プレフィックス",excludedModels:"除外モデル",headers:"ヘッダー",modelMappings:"モデルマッピング",requiredSetup:"必要なセットアップ",optionalRouting:"オプションのルーティング"},aiProvidersFamilyRail:{current:"現在"},aiProvidersPage:{title:"AI プロバイダー",subtitle:"AI プロバイダーの設定を管理します。",unableToLoad:"AI プロバイダーを読み込めませんでした"},analyticsCards:{cacheCost:"キャッシュコスト",hitRate:"ヒット率",inputOutputRatio:"入力/出力比",noCacheData:"キャッシュデータがありません",noModelData:"モデルデータがありません",noSessionData:"セッションデータがありません",noTokenData:"トークンデータがありません",totalCost:"合計コスト",totalTokens:"合計トークン",usageInsights:"利用インサイト"},analyticsPageV2:{title:"分析",subtitle:"利用分析とインサイト。"},analyticsPages:{chartsGrid:"チャート",costByModel:"モデル別コスト"},apiPage:{title:"API プロファイル",subtitle:"API プロファイルとエンドポイントを管理します。"},authMonitorLive:{live:"ライブ",accountMonitor:"アカウントモニター",updated:"{{time}} に更新",updatedNow:"たった今更新",requestsLabel:"件",stats:"統計",successRate:"成功率",missingProjectId:"プロジェクト ID がありません",noActivity:"アクティビティなし"},bulkActionBar:{applyPreset:"プリセットを適用"},ccsLogo:{alt:"CCS ロゴ",text:"CCS Config"},claudeExtensionPage:{title:"Claude Extension",subtitle:"Claude Extension の連携設定。",claudeAuth:"Claude 認証",status:"ステータス",targetMetadata:"IDE ターゲットメタデータ"},claudekitBadge:{title:"Powered by ClaudeKit Framework",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},cliproxyConfig:{unsavedChanges:"未保存の変更",original:"変更前",modified:"変更後",reviewChanges:"変更を確認",loadingEditor:"エディターを読み込み中..."},cliproxyHeader:{ccsLevelAccountManagement:"CCS レベルのアカウント管理",cliproxyNotAvailable:"CLIProxy は利用できません",cliproxyControlPanel:"CLIProxy コントロールパネル",noVariants:"CLIProxy バリアントが見つかりません。",addAccountToStart:"アカウントを追加して開始"},cliproxyStatsOverview:{sessionStatistics:"セッション統計",realTimeMetrics:"{{backend}} からのリアルタイム利用指標",offline:"オフライン",running:"稼働中",noActiveSession:"アクティブなセッションなし",noActiveSessionHint:"リアルタイム統計を表示するには、ccs gemini、ccs codex、または ccs agy で CLIProxy セッションを開始してください。",failedLoadStats:"統計の読み込みに失敗しました",totalRequests:"総リクエスト数",successCount:"{{count}} 件成功",successRate:"成功率",totalTokens:"総トークン数",estimatedCost:"推定約 ${{cost}}",modelsUsed:"使用モデル",modelUsageDistribution:"モデル別利用分布",requestCount:"{{count}} リクエスト"},cliproxyTable:{name:"名前",provider:"プロバイダー",model:"モデル",account:"アカウント",status:"ステータス",default:"デフォルト",actions:"操作"},cliproxyTabs:{overview:"概要",variants:"バリアント",aiProviders:"AI プロバイダー",controlPanel:"コントロールパネル"},codeEditor:{revealSensitive:"機密値を表示",maskSensitive:"機密値を隠す",valid:"有効な {{language}}",readOnly:"(読み取り専用)"},codex:{controlCenter:"コントロールセンター",overview:"概要",docs:"ドキュメント",nativeCodexRuntime:"ネイティブ Codex ランタイム",ccsCodexProvider:"cliproxy ショートカット / 管理ブリッジ",codexDocs:"Codex ドキュメント",supportedFlows:"対応フロー",twoSupportedPaths:"2つのサポートパス:",nativeLabel:"ネイティブ:",nativeDesc:"Codex は CCS v1 でファーストクラスのランタイム専用ターゲットです。",ccsBridge:"CCS Bridge",apiProfilesDefault:"API プロファイルのデフォルトは引き続き Claude または Droid です。",recommendedSetupFlow:"推奨セットアップフロー",fastestPath:"最速パス",officialChannels:"公式チャンネル",codexCli:"Codex CLI",openNativeCodex:"ネイティブ Codex を開く",runBuiltInCodex:"cliproxy ショートカット付きでネイティブ Codex を実行",runBuiltInCodexExplicit:"CCS 管理 Codex ブリッジを明示的に実行",openCodexDashboard:"Codex ダッシュボードを開く",status:"ステータス",profiles:"プロファイル",createNewProfile:"新しいプロファイルを作成",createNewProvider:"新しいプロバイダーを作成",createNewMcpServer:"新しい MCP サーバーを作成",defaultProvider:"デフォルトプロバイダー",useDefault:"デフォルトを使用",useGlobalProvider:"グローバルプロバイダーを使用",useProviderDefault:"プロバイダーのデフォルトを使用",quickFillWarning:"クイック入力のみです。保存前に確認してください。",thisFileUpstreamOwned:"このファイルは Codex CLI の上流管理対象です。",notes:"メモ",approvalPolicy:"承認ポリシー",sandboxMode:"サンドボックスモード",reasoningEffort:"推論強度",useGlobalEffort:"グローバル設定を使用",reasoningEffortCapitalized:"推論強度",thinkingBudgetTokens:"思考予算トークン",modelContextWindow:"モデルコンテキストウィンドウ",autoCompactTokenLimit:"自動圧縮トークン上限",toolOutputTokenLimit:"ツール出力トークン上限",webSearch:"Web 検索",personality:"パーソナリティ",model:"モデル",rawOnly:"Raw のみ",trusted:"信頼済み",untrusted:"未信頼",noProjectTrustEntries:"明示的なプロジェクト信頼エントリはありません。",codexNativeRecipe:"ネイティブ Codex レシピを保存しました",gptContextCap:"GPT-5.4 コンテキスト上限",usageLimitCost:"272K 超過時の利用制限コスト",longContextOverride:"長文コンテキストオーバーライド",counts2x:"2倍カウント",normalUsageWindow:"通常利用ウィンドウ",useCodexDefault:"Codex のデフォルトを使用",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"デフォルトターゲット CLI",executionChain:"実行チェーン",targetPath:"現在のターゲットパス",userConfig:"ユーザー設定",configYaml:"config.yaml",flow:"フロー",docsTab:"ドキュメント",features:"機能",featuresDesc:"CCS が安全に管理できる Codex の機能フラグを切り替えます。",configOnlyFlags:"設定ファイル内のみの既存フラグ",configOnlyFlagsDesc:"これらのキーはすでに `config.toml` に存在するため、CCS は完全なカタログ対応を主張せずに表示できます。",existing:"既存",nonBooleanForm:"非 boolean 形式で保存されています。編集する場合は Raw TOML を使用してください。",discoveredFromFile:"CCS の内蔵カタログではなく現在のファイルから検出されました。",featureMultiAgentLabel:"Multi-agent",featureMultiAgentDesc:"subagent 連携ツールを有効にします。",featureUnifiedExecLabel:"Unified exec",featureUnifiedExecDesc:"PTY ベースの unified exec ツールを使用します。",featureShellSnapshotLabel:"Shell snapshot",featureShellSnapshotDesc:"shell 環境スナップショットを再利用します。",featureApplyPatchLabel:"Apply patch",featureApplyPatchDesc:"自由形式の apply_patch 編集を有効にします。",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Node ベースの JavaScript REPL を有効にします。",featureRuntimeMetricsLabel:"Runtime metrics",featureRuntimeMetricsDesc:"Codex のランタイム指標を収集します。",featurePreventIdleSleepLabel:"Prevent idle sleep",featurePreventIdleSleepDesc:"動作中にマシンがスリープしないようにします。",featureFastModeLabel:"Fast mode",featureFastModeDesc:"高速サービス階層パスを許可します。",featureAppsLabel:"Apps",featureAppsDesc:"ChatGPT Apps と connector のサポートを有効にします。",featureSmartApprovalsLabel:"Smart approvals",featureSmartApprovalsDesc:"対象となる承認を guardian フローに回します。",howCodexWorks:"CCS での Codex の動作",nativeConfigLabel:"ネイティブ設定:",nativeConfigDesc:"ccs-codex と ccsx は保存済みデフォルトでネイティブ Codex を起動します。",transientOverridesLabel:"一時オーバーライド:",transientOverridesDesc:"ccsxp はネイティブ Codex のまま cliproxy プロバイダー上書きだけを追加し、ccs codex --target codex は明示的な CCS 管理ブリッジのままです。",cliproxyDefaultLabel:"CLIProxy デフォルト:",cliproxyDefaultDesc:'通常の codex を CLIProxy 経由にするには、model_provider = "cliproxy" を設定し、下のレシピを追加します。',runtimeInstall:"ランタイムのインストール",detected:"検出済み",notFound:"見つかりません",detectionSource:"検出元",binaryPath:"バイナリパス",installDirectory:"インストール先",versionLabel:"バージョン",nativeAliases:"ネイティブ別名",ccsProviderShortcut:"cliproxy ショートカット",configOverrideSupport:"--config オーバーライド対応",available:"利用可能",missing:"不足",cliproxyNativeCodex:"CLIProxy 経由のネイティブ Codex",builtInLabel:"内蔵:",builtInCcsxpDesc:"ccsxp を使うと、cliproxy プロバイダーショートカット付きでネイティブ Codex を起動します。",managedBridgeLabel:"管理ブリッジ:",managedBridgeDesc:"より厳格な CCS 管理ルートを明示的に使いたい場合は ccs codex --target codex を使います。",nativeRecipeLabel:"ネイティブ:",nativeRecipeDesc:"下のレシピを設定すると codex を直接 CLIProxy 経由で利用できます。",saveProviderNamedCliproxy:"上の base URL と env key を使って cliproxy という名前の provider を保存します。",inTopLevelSetDefault:"Top-level settings で Default provider を cliproxy に設定します。",exportCliproxyApiKey:"ネイティブ Codex を起動する前に shell で CLIPROXY_API_KEY を export してください。",noConfigOverrides:"この Codex ビルドでも純粋なネイティブパスは使えますが、検出された Codex バイナリが --config オーバーライドに対応するまで、ccsxp と明示的な CCS 管理 Codex ブリッジは利用できません。",configFile:"設定ファイル",path:"パス",resolved:"解決先",size:"サイズ",lastModified:"最終更新",tomlWarning:"TOML 警告",readWarning:"読み込み警告",currentUserLayerSummary:"現在のユーザーレイヤー概要",activeProfile:"アクティブプロファイル",notSet:"未設定",providersCount:"providers: {{count}}",profilesCount:"profiles: {{count}}",enabledFeaturesCount:"enabled features: {{count}}",mcpServersCount:"mcp servers: {{count}}",userLayerKeysPresent:"現在存在するユーザーレイヤーキー",nativeShortAlias:"ネイティブ短縮エイリアス",ccsCodexShortcut:"CCS Codex ショートカット",explicitProviderRoute:"明示的な provider ルート",runtimeVsProvider:"ランタイムと provider の違い",honorsSavedNativeConfig:"保存済みのネイティブ設定を尊重",usesTransientOverrides:"一時オーバーライドを使用",unavailableNoConfig:"利用不可(この Codex ビルドには --config サポートがありません)。",yes:"はい",no:"いいえ",warningsTitle:"警告",auth:{terminalOnlyTooltip:"ターミナルで ccsx auth switch <name> または ccsx auth remove <name> を使用します。",terminalOnlyTooltipRich:"ターミナルで <code>ccsx auth switch &lt;name&gt;</code> または <code>ccsx auth remove &lt;name&gt;</code> を使用します。",activeSourceBadge:"{{source}}",statusOk:"OK",statusInvalid:"[!] 認証が無効",loading:"認証プロファイルを読み込み中...",loadError:"[!] codex-auth プロファイルの読み込みに失敗しました。",emptyRegistry:"[i] codex-auth プロファイルがありません。ccsx auth create <name> を実行して作成します。",emptyRegistryRich:"[i] codex-auth プロファイルがありません。<code>ccsx auth create &lt;name&gt;</code> を実行して作成します。",legacyCodexHome:"Codex はデフォルトの ~/.codex を使用します。",legacyCodexHomeRich:"Codex はデフォルトの <code>~/.codex</code> を使用します。",legacyMode:"[i] アクティブなプロファイルがありません。~/.codex(レガシー)を使用中です。ターミナルで ccsx auth switch <name> を実行して有効化します。",legacyModeRich:"[i] アクティブなプロファイルがありません。<code>~/.codex</code>(レガシー)を使用中です。ターミナルで <code>ccsx auth switch &lt;name&gt;</code> を実行して有効化します。",externalCodexHome:"[i] $CODEX_HOME は外部で {{path}} に設定されています。このセッションではプロファイル registry は使われません。",externalCodexHomeRich:"[i] <code>$CODEX_HOME</code> は外部で <code>{{path}}</code> に設定されています。このセッションではプロファイル registry は使われません。",activeProfile:"アクティブプロファイル:",unknownProfile:"(不明)",planLabel:"プラン:",switchAction:"切り替え",removeAction:"削除",sourceDefault:"デフォルト",sourceEnv:"$CCS_CODEX_PROFILE",sourceExplicitCodexHome:"$CODEX_HOME",col:{name:"名前",email:"メール",plan:"プラン",lastUsed:"最終使用",status:"ステータス",actions:"操作"}}},codexPage:{title:"Codex",controlCenter:"コントロールセンター",overview:"概要",docs:"ドキュメント",authProfiles:"認証プロファイル",nativeRuntime:"ネイティブランタイム",ccsProvider:"CCS プロバイダー",setup:"セットアップ"},commandBuilder:{title:"コマンドビルダー",searchPlaceholder:"コマンドを入力または選択...",copy:"コピー",run:"実行",cmdConfig:"設定画面を開く",cmdCreateProfile:"新しいプロファイルを作成",cmdSwitchProfile:"プロファイルを切り替え",cmdDoctor:"システムヘルスチェック",cmdListProviders:"利用可能な CLIProxy プロバイダーを一覧表示",cmdAddProvider:"CLIProxy プロバイダーを追加"},confirmDialog:{confirm:"確認",cancel:"キャンセル"},connectionIndicator:{connected:"接続済み",connecting:"接続中...",disconnected:"切断",reconnecting:"再接続中..."},copilotConfigForm:{copilotConfiguration:"Copilot 設定",deprecatedModels:"非推奨の Copilot モデルが検出されました",failedLoadStatus:"ステータスの読み込みに失敗しました",useWithClaudeCode:"GitHub Copilot サブスクリプションを Claude Code で利用する",githubCopilotControls:"GitHub Copilot はプロンプト/コンテキストの制限を上流で管理しています。",provider:"プロバイダー",filePath:"ファイルパス",status:"ステータス",enabled:"有効",disabled:"無効",loadingEditor:"エディターを読み込み中...",modelMapping:"モデルマッピング",quickUsage:"クイック実行",noPremiumUsage:"プレミアム利用回数なし"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},dateRangeFilter:{pickADate:"日付を選択"},deviceCodeDialog:{authorize:"{{provider}} を認証",enterCodeAtPage:"認証ページで下のコードを入力してください。",expiresIn:"({{time}} 後に期限切れ)",codeExpired:"(コードの有効期限が切れました)",copied:"コピーしました!",copyCode:"コードをコピー",waitingForAuth:"認証を待機中...",openVerificationPage:"認証ページを開く",openProviderPage:"{{provider}} を開く",copyCodeAria:"確認コードをコピー",codeCopiedAria:"コードをコピーしました"},docsLink:{title:"ドキュメントを表示"},droidSettings:{quickControls:"クイックコントロール",reasoningControls:"推論コントロール",thinkingBudget:"思考予算",anthropicOnly:"Anthropic モデルのみ",byokCustomModels:"BYOK カスタムモデル"},extendedContext:{extendedContext:"拡張コンテキスト"},githubLink:{title:"GitHub で問題を報告"},globalEnvIndicator:{injectedCount_one:"{{count}} 件のグローバル環境変数が実行時に注入されます",injectedCount_other:"{{count}} 件のグローバル環境変数が実行時に注入されます",overriddenCount:"({{count}} 件はプロファイルで上書き)",skippedLabel:"スキップ(プロファイルで既に定義済み):",configureInSettings:"設定で構成"},healthCard:{allSystemsNominal:"すべてのシステムが正常です",machineChecks:"マシンチェック"},healthPageV2:{title:"ヘルス",subtitle:"システムヘルスの監視。"},editAccountSharedResources:{title:"共有リソースを編集",description:"CCS 共有ディレクトリのコマンド、スキル、設定を「{{name}}」がどのように継承するかを設定します。",resourceMode:"リソースモード",selectResourceMode:"リソースモードを選択",sharedOption:"共有",sharedHint:"共有ディレクトリからコマンド、スキル、エージェントを継承します。",profileLocalOption:"プロファイルローカル",profileLocalHint:"このアカウント専用ディレクトリの分離されたリソースを使用します。",implicationTitle:"保存するとどうなるか",sharedImplication:"このアカウントは共有リソースハブにあるすべてのツールと設定を参照します。",profileLocalImplication:"このアカウントは共有ツールを参照しません。セキュリティやテスト目的のため完全に分離されたままです。",cancel:"キャンセル",save:"保存",saving:"保存中..."},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch Dashboard"},homePageV2:{title:"ホーム",logsMoved:"ログは専用ワークスペースに移動しました",profiles:"プロファイル",cliproxy:"CLIProxy",accounts:"アカウント",health:"ヘルス"},hubFooter:{logs:"ログ",settings:"設定",github:"GitHub",copyright:"© {{year}} kaitranntt"},imageAnalysisStatus:{sectionTitle:"画像",openSettings:"設定を開く",useNativeImageReading:"ネイティブ画像読み取りを使用",refreshingPreview:"プレビューを更新中",savedStatus:"保存済みステータス",livePreview:"ライブプレビュー",disabledGlobally:"グローバルで無効",targetBypassesHook:"{{target}} はフックをバイパスします",nativeImageReading:"ネイティブ画像読み取り",setupNeeded:"セットアップが必要",needsAuth:"認証が必要",needsProxy:"プロキシが必要",nativeFallback:"ネイティブフォールバック",transformerReady:"トランスフォーマー準備完了",badgeDisabled:"無効",badgeBypassed:"バイパス中",badgeNative:"ネイティブ",badgeSetup:"セットアップ",badgeAuth:"認証",badgeProxy:"プロキシ",badgeReady:"準備完了",capabilityVerified:"検証済み",capabilityUnknown:"不明",toggleSummaryNativeCapable:"{{model}} は画像対応のようです。CCS はここではトランスフォーマーをバイパスします。",toggleSummaryNativeModel:"CCS は {{model}} でネイティブ読み取りを優先します。",toggleSummaryNativeDefault:"CCS はこのプロファイルでネイティブ画像読み取りを優先します。",toggleSummaryNativeFileAccess:"このプロファイルは現在ネイティブファイルアクセスのままです。",toggleSummaryInactiveTarget:"{{target}} が選択されている間は、保存済みの Claude 側画像ルーティングは無効です。",toggleSummaryTransformerRoute:"トランスフォーマールート: {{backend}}{{modelSuffix}}。",noteDisabledGlobally:"画像は CCS 設定でグローバルに無効になっています。",noteTargetBypassesHook:"現在のターゲット {{target}} は Claude Read フックをバイパスします。",notePersistHook:"トランスフォーマールーティングをここで有効にする前に、プロファイルフックを保存してください。",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"この CCS インスタンスでダッシュボード認証が無効になっているため、リモートダッシュボードは読み取り専用です。CCS ホスト側で再度有効にしてください。Docker では、実行中のコンテナ内で行う必要があります。",remoteReadonlyAuthDisabledShort:"この CCS インスタンスでダッシュボード認証が再有効化されるまで、リモートダッシュボードは読み取り専用です。",remoteReadonlySetupLong:"この CCS インスタンスで ccs config auth setup を実行するまで、リモートダッシュボードは読み取り専用です。Docker では、そのコマンドをコンテナ内で実行してください。",remoteReadonlySetupShort:"この CCS インスタンスの認証が設定されるまで、リモートダッシュボードは読み取り専用です。",localLong:"このダッシュボードはローカルで動作しています。データはすべてお使いのマシンに残ります。",localShort:"ローカルダッシュボード - データはお使いのデバイスに保存されます。",dismiss:"免責事項を閉じる"},loginPage:{showPassword:"パスワードを表示",hidePassword:"パスワードを隠す"},logsConfig:{level:"レベル",message:"メッセージ",source:"ソース",time:"時刻",proc:"プロセス",open:"開く",run:"実行",refreshEntries:"エントリを更新"},logsDetailPanel:{details:"詳細"},logsFilters:{filters:"フィルター"},logsOverviewCards:{overview:"概要"},logsPageSkeleton:{loadingLogs:"ログを読み込み中..."},logsPageV2:{title:"ログ",subtitle:"システムログの表示と管理。"},modelConfigSection:{defaultModel:"デフォルトモデル"},monitoringErrorLogs:{logContent:"ログ内容"},openrouterBadge:{new:"NEW",integration:"OpenRouter 連携"},openrouterBanner:{accessModels:"OpenRouter で {{count}}+ のモデルにアクセス",add:"追加"},openrouterModelPicker:{searchModels:"モデルを検索",newestModels:"最新モデル"},openrouterPromoCard:{title:"OpenRouter",description:"1つの API エンドポイントで数百のモデルにアクセス。"},privacyToggle:{modeOn:"プライバシーモード ON - クリックしてデータを表示",modeOff:"プライバシーモード OFF - クリックしてデータを隠す"},profileCard:{profile:"プロファイル",openRouter:"OpenRouter プロファイル",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code(デフォルト)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS プロファイル"},profileCreateDialog:{createProfile:"プロファイルを作成",appliedModelToTiers:"すべてのモデルティアに「{{model}}」を適用しました",profileCreated:"プロファイル「{{name}}」を作成しました",failedCreate:"プロファイルの作成に失敗しました",chooseProviderHint:"プロバイダーのプリセットを選ぶか、カスタム API エンドポイントを設定してください。",basicInformation:"基本情報",modelConfiguration:"モデル設定",usedInCli:"CLI での使用:",apiBaseUrl:"API ベース URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"{{name}} から自動入力されています。必要に応じて変更できます。",optionalForPreset:"{{name}} では任意です。空欄の場合はネイティブの Anthropic 認証を使用します。",endpointHint:"OpenAI 互換および Anthropic リクエストを受け付けるエンドポイント",optional:"(任意)",apiKeyOptionalPlaceholder:"任意 - 認証が有効な場合のみ",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"ローカルエンドポイントで認証が有効な場合のみ必要です",defaultTargetCli:"デフォルトターゲット CLI",modelMapping:"モデルマッピング",modelMappingDesc:"Claude Code のティア(Opus/Sonnet/Haiku)をプロバイダー対応モデルにマッピングします。",searchModelsPlaceholder:"検索(例: opus, sonnet, gpt-4o)...",noModelsFound:"「{{query}}」に一致するモデルが見つかりません",loadingModels:"モデルを読み込み中...",defaultModel:"デフォルトモデル",sonnetMapping:"Sonnet マッピング",opusMapping:"Opus マッピング",haikuMapping:"Haiku マッピング",sonnetMappingPlaceholder:"例: gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"例: o1, claude-opus-4.5",haikuMappingPlaceholder:"例: gpt-4o-mini, claude-3.5-haiku",free:"無料"},profileDeck:{profiles:"プロファイル",failedToLoad:"プロファイルの読み込みに失敗しました: {{message}}",noProfiles:"プロファイルが設定されていません。最初のプロファイルを作成して始めましょう。"},profileDialogLegacy:{editProfile:"プロファイルを編集"},profileEditorSections:{imageAnalysis:"画像分析",loadingImageSettings:"画像設定を読み込み中...",skipPermissionPrompts:"起動時に権限プロンプトをスキップ",useNativeImageReading:"ネイティブ画像読み取りを使用",skipTransformer:"トランスフォーマーをスキップ",friendlyUi:"フレンドリー UI",info:"情報"},profilesTable:{name:"名前",provider:"プロバイダー",model:"モデル",target:"ターゲット",lastModified:"最終更新",actions:"操作",edit:"編集"},projectSelectionDialog:{title:"Google Cloud プロジェクトを選択",description:"{{provider}} の認証に使用するプロジェクトを選択してください。",autoSelectCountdown:"({{count}}秒後にデフォルトを自動選択)",default:"デフォルト",allProjects:"全プロジェクト",allProjectsDescription:"リスト内の {{count}} プロジェクトをすべてオンボード",useDefault:"デフォルトを使用",selecting:"選択中...",confirmSelection:"選択を確認",codeCopied:"コードをコピーしました",copyVerificationCode:"確認コードをコピー"},providerCard:{missingProjectIdAria:"プロジェクト ID がありません"},providerEditor:{provider:"プロバイダー",filePath:"ファイルパス",lastModified:"最終更新",defaultTarget:"デフォルトターゲット",quickUsage:"クイック実行",modelMapping:"モデルマッピング",status:"ステータス",loadingSettings:"設定を読み込み中...",loadingEditor:"エディターを読み込み中...",accounts:"アカウント",addAccount:"アカウントを追加",noAccountsConnected:"接続されたアカウントなし",addAccountToStart:"アカウントを追加して開始",gcpProjectIdReadonly:"GCP プロジェクト ID(読み取り専用)",projectIdNA:"プロジェクト ID: N/A",missingProjectId:"プロジェクト ID がありません",missingProjectIdHint:"エラーの原因になる可能性があります。アカウントを削除して再追加し、プロジェクト ID を取得してください。",useIncognito:"シークレットモードを使用",aliases:"エイリアス",current:"現在",currentValue:"現在の値",composite:"複合",defaultLabel:"デフォルト",requiredSetup:"必要なセットアップ",connectorName:"コネクタ名",proxyUrl:"プロキシ URL",proxyUrlSet:"プロキシ URL 設定済み",excludedModels:"除外モデル",headers:"ヘッダー",secret:"シークレット",prefix:"プレフィックス",modelMappings:"モデルマッピング",baseUri:"ベース URL",apiKeys:"API Keys",presets:"事前設定済みのモデルマッピングを適用",createVariant:"CLIProxy バリアントを作成",agyDenylist:"Antigravity ブロックリスト: Claude Opus 4.5 と Claude Sonnet 4.5 は非推奨です。"},providerEditorAccountItem:{modelsUsed:"使用モデル"},providerEditorHeader:{connectorName:"コネクタ名"},quickCommands:{title:"クイックコマンド",startDefault:"デフォルトで起動",startDefaultDesc:"デフォルトプロファイルで Claude を起動",glmProfile:"GLM プロファイル",glmProfileDesc:"GLM モデルに切り替え",healthCheck:"ヘルスチェック",healthCheckDesc:"システム診断を実行",delegateTask:"タスクを委譲",delegateTaskDesc:"GLM プロファイルに委譲"},quotaTooltip:{loadingQuota:"クォータを読み込み中...",failedLoadQuota:"クォータの読み込みに失敗しました",modelQuotas:"モデルクォータ:",rateLimits:"レート制限:",plan:"プラン: {{plan}}",quotaSnapshots:"クォータスナップショット:",unlimited:"無制限",remaining:"残り {{remaining}}/{{entitlement}}",tier:"ティア",tierId:"ティア ID",state:"状態",credits:"クレジット",modelQuotasLower:"モデルクォータ:",allBucketsReport:"全バケットが {{tokenType}} を報告",requestsRemaining:"残り {{count}} リクエスト",inputTokensRemaining:"残り {{count}} 入力トークン",outputTokensRemaining:"残り {{count}} 出力トークン",amountRemaining:"残り {{count}}",fiveHourLimit:"5時間利用制限",weeklyLimit:"週間利用制限",weeklyOpus:"週間利用(Opus)",weeklySonnet:"週間利用(Sonnet)",weeklyOAuthApps:"週間利用(OAuth アプリ)",weeklyCowork:"週間利用(Cowork)",extraUsage:"追加利用",premiumInteractions:"プレミアムインタラクション",chat:"チャット",completions:"補完",resets:"{{time}} にリセット",fiveHourResets:"5時間リセット {{time}}",weeklyResets:"週間リセット {{time}}"},utils:{codeReview5h:"コードレビュー(5時間)",codeReviewWeekly:"コードレビュー(週次)",codeReview:"コードレビュー",codexAdditional5h:"{{name}}(5時間)",codexAdditionalWeekly:"{{name}}(週次)",codexAdditional:"{{name}}"},rawEditorSection:{rawConfig:"Raw 設定"},rawJsonSettingsEditor:{title:"Raw 設定エディター"},routingGuidance:{roundRobin:"ラウンドロビンで利用を分散します。",fillFirst:"Fill first は、バックアップアカウントが必要になるまで待機させます。",routingStrategy:"ルーティング戦略",optionalRouting:"オプションのルーティング",sessionAffinity:"セッション固定",sessionAffinityOn:"オン",sessionAffinityOff:"オフ",sessionAffinityEnabled:"有効",sessionAffinityDisabled:"無効",enableSessionAffinity:"セッション固定を有効化",disableSessionAffinity:"セッション固定を無効化",sessionAffinityUnavailable:"セッション固定は利用できません",localOnly:"ローカルのみ",localOnlySetting:"ローカル専用設定",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"可能な場合は 1 つの会話を同じアカウントに固定します。CLIProxy はクライアントが明示的に送るセッション ID やスレッド ID を優先し、それがない場合はリクエストのメタデータや冒頭プロンプト履歴から安定キーを推定します。",sessionRecognitionTitle:"セッション認識",sessionRecognitionDescription:"CCS はすべてのバックエンドで同一の優先順位を保証しません。一般に上流バックエンドは明示的なセッション / スレッド ID を優先し、その後にメタデータ、最後に冒頭プロンプト履歴のハッシュへフォールバックします。"},settingsDialog:{editProfile:"プロファイルを編集: {{name}}",description:"このプロファイルの環境変数と設定を構成します。",loadingSettings:"設定を読み込み中...",envTab:"環境変数",rawJsonTab:"Raw JSON",generalTab:"全般",noEnvVars:"環境変数は設定されていません。",noEnvVarsHint:"settings.json ファイルで変数を追加してください。",loadingEditor:"エディターを読み込み中...",profileInfo:"プロファイル情報",profileInfoDesc:"この設定ファイルの詳細情報。",path:"パス",lastModified:"最終更新",cancel:"キャンセル",saving:"保存中...",saveChanges:"変更を保存",conflictTitle:"ファイルが外部で変更されました",conflictDesc:"この設定ファイルは別のプロセスで変更されました。変更で上書きしますか?それとも破棄しますか?",overwrite:"上書き",invalidJson:"無効な JSON です",failedSave:"保存に失敗しました"},settingsPage:{title:"設定",loading:"読み込み中...",failedLoad:"設定の読み込みに失敗しました。",tabs:{web:"Web",env:"環境変数",think:"思考",proxy:"プロキシ",auth:"認証",backup:"バックアップ",channels:"チャンネル",imageAnalysis:"画像"},websearchSection:{title:"Web 検索",description:"CLI ベースの Web 検索設定。"},thinkingSection:{title:"思考",description:"対応モデルの高度な思考 / 推論設定。",directOverride:"直接上書き",youType:"入力:",ccsAdds:"CCS が追加:",executionChain:"実行チェーン",primaryBackends:"プライマリバックエンド",legacyCliFallbacks:"レガシー CLI フォールバック",managedPayload:"管理対象ペイロード",sharedTargetMetadata:"共有ターゲットメタデータ",ideTargetMetadata:"IDE ターゲットメタデータ",ideSettingsPath:"IDE 設定パス",ideHost:"IDE ホスト",resolvedBinding:"解決済みバインディング",bindingName:"バインディング名",inSync:"同期済み",currentTargetPath:"現在のターゲットパス",warnings:"警告",notes:"メモ",workspacePresets:"ワークスペースプリセット",draft:"下書き",advanced:"詳細設定",recommended:"推奨セットアップフロー",configureModelFirst:"先にモデルを設定してください"},proxySection:{title:"プロキシ",loadingImageSettings:"画像設定を読み込み中..."},channelsSection:{title:"公式チャンネル",description:"公式リリースチャンネルを表示・管理。"},imageAnalysisSection:{title:"画像分析",description:"画像分析の設定。",loading:"画像設定を読み込み中..."},browserSection:{title:"ブラウザ",description:"CCS が管理するブラウザ自動化の主要な設定画面です。",primaryTitle:"Settings > Browser がブラウザ設定の主入口です。",primaryDescription:"ここで Claude Browser Attach と Codex Browser Tools を設定し、各レーンの起動や確認は下の案内を使ってください。",readiness:"準備状況",nextStep:"次の手順",technicalDetails:"技術的な詳細",diagnostics:"診断情報",evalMode:{label:"browser_eval 権限",options:{disabled:"無効",readonly:"読み取り専用",readwrite:"読み書き可"}},actions:{saveClaude:"Claude 設定を保存",saveCodex:"Codex 設定を保存",testConnection:"接続を確認",copyLaunchCommand:"起動コマンドをコピー"},messages:{statusRefreshed:"ブラウザ状態を更新しました",launchCommandCopied:"起動コマンドをコピーしました"},claude:{title:"Claude Browser Attach",description:"リモートデバッグを有効にした Chrome セッションへ Claude-target の起動を接続します。",enabledLabel:"Claude Browser Attach を有効にする",enabledDescription:"有効にすると、CCS は Claude-target 起動向けに管理済みブラウザ MCP ランタイムを準備します。",userDataDir:"Chrome ユーザーデータディレクトリ",userDataDirHint:"日常利用のブラウザと状態を分離するため、専用の Chrome プロファイルディレクトリを使うことを推奨します。",devtoolsPort:"DevTools ポート",devtoolsPortHint:"Chrome を attach モードで起動したときに使う実際のポートと一致させてください。",devtoolsPortInvalid:"1 から 65535 の有効なポート番号を入力してください。",effectivePath:"現在有効な attach パス",recommendedPath:"推奨パス",managedRuntime:"管理済みブラウザランタイム",evalModeHint:"Claude Browser Attach における browser_eval の権限を制御します。読み取り専用は参照のみ、読み書き可はページ側の変更も許可します。",overrideMessage:"{{source}} から環境変数オーバーライドが有効です。これを外すと Dashboard の設定が再び主ソースになります。",launchGuidance:"起動ガイダンス",launchGuidanceHint:"リモートデバッグ付きで Chrome を起動し、必要なら Test connection を再実行してください。"},codex:{title:"Codex Browser Tools",description:"Codex-target 起動向けの管理済み Playwright MCP ブラウザパスを制御します。",enabledLabel:"Codex Browser Tools を有効にする",enabledDescription:"有効のままにすると、Browser ページが Codex ブラウザツールの主設定画面になります。",serverName:"管理対象サーバー名",overrideSupport:"config override 対応",overrideSupported:"対応",overrideUnsupported:"非対応",binary:"検出された Codex バイナリ",notDetected:"未検出",evalModeHint:"Browser 設定画面の整合性のために保存されます。Phase 1 では browser_eval の制御は主に Claude Browser Attach に適用されます。"}}},setupWizard:{title:"高度なバリアント設定",stepProviderDesc:"ランタイムバリアント用のプロバイダーを選択",stepAuthDesc:"プロバイダーで認証",stepAccountDesc:"使用するアカウントを選択",stepVariantDesc:"任意: カスタムランタイムバリアントを作成",stepSuccessDesc:"セットアップ完了!",authStep:{authenticateWith:"{{provider}} で認証してアカウントを追加",authenticating:"認証中...",authenticateInBrowser:"ブラウザーで認証",completeOAuth:"ブラウザーで OAuth フローを完了してください...",orUseTerminal:"またはターミナルを使用",runCommandHint:"ターミナルで次のコマンドを実行:",back:"戻る",checking:"確認中...",refreshStatus:"ステータスを更新"},accountStep:{selectAccount:"アカウントを選択({{count}})",defaultAccount:"デフォルトアカウント",or:"または",addNewAccount:"新しいアカウントを追加",addNewAccountDesc:"別のアカウントで認証",back:"戻る"},variantStep:{back:"戻る",skip:"スキップ"},successStep:{title:"バリアントを作成しました!",subtitle:"カスタムバリアントが使用可能です",usage:"使用方法:",done:"完了"}},sharedPageV2:{title:"共有",subtitle:"共有データ管理。"},sponsorButton:{title:"GitHub でこのプロジェクトをスポンサー",sponsor:"スポンサー"},supportEntryCard:{actionRequired:"対応が必要"},themeToggle:{srLabel:"テーマを切り替え"},toasts:{profileCreated:"プロファイルを作成しました",profileUpdated:"プロファイルを更新しました",profileDeleted:"プロファイルを削除しました",orphanProfilesComplete:"孤立プロファイルの登録が完了しました",profileCopied:"プロファイルをコピーしました",profileImported:"プロファイルをインポートしました",authRequired:"{{provider}} の認証が必要です",authSuccess:"{{provider}} の認証に成功しました!",authFailed:"{{provider}} の認証に失敗しました",deviceCodeExpired:"デバイスコードの有効期限が切れました。もう一度お試しください。",codeCopied:"コードをクリップボードにコピーしました",failedCopy:"コードのコピーに失敗しました",configSaved:"設定を保存しました",configSaveFailed:"保存に失敗しました: {{error}}",invalidYaml:"無効な YAML は保存できません",configUpdatedExternally:"設定が外部で更新されました",settingsFileUpdated:"設定ファイルが更新されました",accountsUpdated:"アカウントを更新しました",noProfilesToSync:"同期するプロファイルがありません",syncFailed:"同期に失敗しました: {{error}}",sessionAffinityUpdated:"セッション固定を{{state}}にしました。",providerAuthSuccess:"{{provider}} の認証に成功しました",providerDeviceCodeInCallback:"コールバックモードでプロバイダーがデバイスコードフローを返しました",providerAuthTimeout:"認証がタイムアウトしました。もう一度お試しください。",providerAccountRegistrationFailed:"認証済みアカウントを登録できませんでした",providerLostStatusEndpoint:"認証ステータスエンドポイントとの接続が失われました",providerUnknown:"不明なプロバイダーです: {{provider}}",providerStartOAuthFailed:"OAuth を開始できませんでした",providerCallbackFailed:"コールバック送信に失敗しました",providerSubmitCallbackFailed:"コールバックを送信できませんでした",loggingConfigSaved:"ログ設定を保存しました。",loggingConfigSaveFailed:"ログ設定の保存に失敗しました。",unifiedConfigUpdated:"設定を更新しました",migrationPreviewComplete:"移行プレビューが完了しました",migrationComplete:"移行が完了しました",migrationFailed:"移行に失敗しました",rollbackComplete:"ロールバックが完了しました",rollbackFailed:"ロールバックに失敗しました",defaultAccountSet:"デフォルトアカウントを「{{name}}」に設定しました",defaultAccountReset:"デフォルトアカウントを CCS に戻しました",accountDeleted:"アカウント「{{name}}」を削除しました",contextUpdated:"「{{name}}」のコンテキストを {{summary}} に更新しました",legacyConfirmError:"アカウント「{{name}}」は明示的な確認が必要です。このアカウントの「履歴同期を編集」を使用してください。",legacyConfirmFailed:"レガシーアカウント「{{name}}」の確認に失敗しました: {{error}}",legacyConfirmSuccess_one:"{{count}} 件のレガシーアカウントを確認しました",legacyConfirmSuccess_other:"{{count}} 件のレガシーアカウントを確認しました",legacyConfirmPartial:"{{updated}} 件のレガシーアカウントを確認しましたが、{{failed}} 件の更新に失敗しました。アカウント状態を再取得しました。",legacyConfirmAllFailed:"{{failed}} 件のレガシーアカウントの確認に失敗しました。アカウント状態を再取得しました。",noLegacyAccounts:"確認が必要なレガシーアカウントはありません",routingStrategySet:"ルーティング戦略を {{strategy}} に設定しました",variantCreated:"バリアントを作成しました",variantUpdated:"バリアントを更新しました",variantDeleted:"バリアントを削除しました",defaultAccountUpdated:"デフォルトアカウントを更新しました",accountRemoved:"アカウントを削除しました",accountPaused:"アカウントを一時停止しました",accountResumed:"アカウントを再開しました",accountAdded:"{{provider}} のアカウントを追加しました",kiroImported:"Kiro アカウントをインポートしました: {{name}}",kiroTokenImported:"Kiro トークンをインポートしました",modelUpdated:"モデルを更新しました",presetSaved:"プリセット「{{name}}」を保存しました",presetDeleted:"プリセットを削除しました",cliproxyAlreadyRunning:"CLIProxy はすでに稼働していました",cliproxyStarted:"CLIProxy を起動しました",cliproxyStartFailed:"CLIProxy の起動に失敗しました",cliproxyStopped:"CLIProxy を停止しました",cliproxyStopFailed:"CLIProxy の停止に失敗しました",presetApplied:"プリセット「{{name}}」を適用しました",presetAppliedCustom:"カスタムプリセットを適用しました",settingsSavedWithAdjustments:"設定を保存しました(モデル調整あり)",settingsSaved:"設定を保存しました",failedSaveSettings:"設定の保存に失敗しました",codexRefreshFailed:"Codex スナップショットの更新に失敗しました。Raw 編集は保持されました。",codexRefreshError:"Codex スナップショットの更新に失敗しました。",codexFixToml:"保存する前に TOML を修正してください。",codexSaved:"Codex config.toml を保存しました。",codexChangedExternally:"config.toml が外部で変更されました。更新して再試行してください。",codexSaveFailed:"Codex config.toml の保存に失敗しました。",codexUpdateFailed:"Codex 設定の更新に失敗しました。",noOrphanProfiles:"孤立プロファイル設定は見つかりませんでした",profilesRegistered:"{{count}} 件のプロファイルを登録しました{{skipped}}",destinationEmpty:"送信先プロファイル名は空にできません",profileExportDownloaded:"プロファイルエクスポートをダウンロードしました",profileImportFailed:"プロファイルバンドルのインポートに失敗しました"},providerConfig:{defaultDeviceCodeInstruction:"ブラウザーで認証を完了してください。",trackLabel:"トラック",sectionCoreLabel:"コア / オリジナル backend",sectionCoreHint:"既定で常に利用できるプロバイダートラック",sectionPlusLabel:"Plus 拡張 / コミュニティ保守",sectionPlusHint:"引き続きサポートされていますが、当面は既定の backend から分離されています",plusTrackNote:"このトラックはオプションの Plus backend が必要で、現在はコミュニティ保守です。"},updatesSpotlight:{openUpdatesCenter:"更新センターを開く"},userMenu:{signedInAs:"{{username}} としてサインイン中"},valueMetrics:{apiCostSaved:"API コスト削減",tokensSaved:"節約トークン",queriesFaster:"高速化されたクエリ",errorsReduced:"削減されたエラー",vsLastMonth:"前月比",throughCaching:"キャッシュによる",averageSpeedup:"平均高速化",withRetryLogic:"リトライロジックによる",performanceMetrics:"パフォーマンス指標",monthlySummary:"月間サマリー",totalSaved:"合計節約額",tokensProcessed:"処理トークン数",queriesHandled:"処理クエリ数",uptime:"稼働時間"}}},ko:{translation:{locale:{en:"영어","zh-CN":"중국어 간체",vi:"베트남어",ja:"일본어",ko:"한국어"},layout:{languageSwitcher:"언어"},nav:{general:"일반",home:"홈",analytics:"분석",identityAccess:"ID 및 액세스",apiProfiles:"프로필",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"개요",controlPanel:"제어판",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude 확장",accounts:"계정",allAccounts:"모든 계정",sharedData:"공유 리소스",compatibleClis:"호환",deprecated:"지원 중단",factoryDroid:"Factory Droid",system:"시스템",health:"헬스",logs:"로그",settings:"설정",openrouterTooltip:"추천: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"프로필",cliproxy:"CLIProxy",accounts:"계정",health:"헬스",configurationRequired:"구성이 필요합니다"},auth:{dashboardTitle:"CCS 대시보드",protectedAccessLabel:"보호된 액세스",remoteGuardLabel:"원격 액세스 가드",loading:"대시보드 액세스 확인 중…",loginDescription:"이 CCS 인스턴스에 구성된 사용자 이름과 비밀번호로 대시보드에 액세스하십시오.",username:"사용자 이름",password:"비밀번호",usernamePlaceholder:"사용자 이름 입력",passwordPlaceholder:"비밀번호 입력",signIn:"로그인",signingIn:"로그인 중...",loginFailed:"로그인 실패",lightMode:"라이트",darkMode:"다크",noDefaultCredentials:"CCS는 기본 자격 증명을 제공하지 않습니다.",credentialsHint:"자격 증명은 CCS 호스트에서 `ccs config auth setup`으로 생성됩니다. Docker 배포의 경우 컨테이너 내부에서 해당 명령을 실행해야 합니다.",remoteSetupTitle:"원격 액세스에는 인증 설정이 필요합니다",remoteSetupDescription:"이 대시보드는 비로컬 주소에서 열렸지만, 이 CCS 인스턴스에는 아직 대시보드 인증이 활성화되어 있지 않습니다.",incompleteSetupDescription:"대시보드 인증이 활성화되어 있지만 설정이 완료되지 않았습니다. 로그인 전에 이 CCS 인스턴스의 구성을 완료하십시오.",safetyNoteRemote:"CCS 호스트 소유자가 대시보드 인증을 활성화할 때까지 원격 관리는 잠금 상태로 유지됩니다.",safetyNoteLocal:"동일한 머신에 있다면 localhost URL이 가장 간단한 접근 방법입니다.",safetyNoteSession:"로그인이 성공하면 이 대시보드 호스트로 범위가 지정된 HTTP 전용 세션이 생성됩니다.",hostStepTitle:"CCS 호스트에서",hostStepDescription:"대시보드 자격 증명을 생성하거나 다시 활성화한 후, 원격 디바이스에서 이 페이지를 다시 여십시오.",dockerStepDescription:"Docker 배포입니까? 실행 중인 컨테이너 내부에서 설정을 실행하십시오:",localStepTitle:"이 머신이 본인의 것이라면",localStepDescription:"LAN 또는 Tailscale 주소 대신 `ccs config`가 출력하는 localhost URL을 여십시오.",showPassword:"비밀번호 표시",hidePassword:"비밀번호 숨기기"},commonToast:{apiKeyRequired:"API 키가 필요합니다",accountAddedPresetFailed:"계정이 추가되었지만 기본 프리셋 적용에 실패했습니다",settingsCopied:"설정이 클립보드에 복사되었습니다",enterPresetName:"저장할 프리셋 이름을 입력하십시오",codeCopied:"코드가 클립보드에 복사되었습니다",copyCodeFailed:"코드 복사에 실패했습니다",appliedModelAllTiers:"모델을 모든 티어에 적용했습니다",settingsSaved:"설정이 저장되었습니다",defaultTargetUpdated:"기본 대상이 업데이트되었습니다",failedUpdateDefaultTarget:"기본 대상을 {{target}}{{suffix}}(으)로 업데이트하지 못했습니다",resourcesUpdated:"공유 리소스가 업데이트되었습니다"},profileDialog:{editTitle:"프로필 편집",createTitle:"API 프로필 생성",name:"이름",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API 키",defaultModel:"기본 모델 (ANTHROPIC_MODEL)",defaultModelHint:"비워두면 다음을 사용합니다: {{model}}",modelMappingTitle:"모델 매핑 (Opus/Sonnet/Haiku)",modelMappingDesc:"각 티어에 다른 모델 ID를 구성합니다. 다양한 모델 유형을 서로 다른 백엔드로 라우팅하는 API 프록시에 유용합니다.",opusModel:"Opus 모델 (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 모델 (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 모델 (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"취소",saving:"저장 중...",update:"업데이트",create:"생성"},modelTierMapping:{title:"모델 티어 매핑",advanced:"고급",description:"Claude Code의 opus/sonnet/haiku 티어에 대해 서로 다른 모델을 구성합니다.",autoSuggest:"{{provider}} 기반 자동 추천",opusPlaceholder:"예: anthropic/claude-opus-4",sonnetPlaceholder:"예: anthropic/claude-sonnet-4",haikuPlaceholder:"예: anthropic/claude-3.5-haiku",footer:"이들은 ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL을 설정합니다."},envEditor:{sensitive:"민감",none:"환경 변수가 구성되지 않았습니다.",noneHint:"아래 입력란을 사용하여 변수를 추가하거나 JSON을 직접 편집하십시오.",addVariable:"환경 변수 추가",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"값"},setupVariant:{using:"사용 중:",variantNameRequired:"런타임 변형 이름 *",variantNamePlaceholder:"예: my-gemini, g3, flash",invokeHintPrefix:"이 변형으로 실행:",model:"모델",modelPlaceholder:"예: gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"대신 프리셋에서 선택",selectModel:"모델 선택",customModelName:"사용자 정의 모델 이름...",enterAnyModel:"CLIProxy가 지원하는 모델 이름을 입력하십시오",defaultModel:"기본값: {{model}}",providerDefault:"프로바이더 기본값",back:"뒤로",skip:"건너뛰기",creating:"생성 중...",createVariant:"변형 생성",skipHint:"계정 설정으로 충분하고 별도의 런타임 변형이 필요하지 않으면 건너뛰십시오"},customPresetDialog:{title:"사용자 정의 프리셋",presetNameOptional:"프리셋 이름 (선택)",presetNamePlaceholder:"예: My Custom Config",codexTipPrefix:"Codex 팁: 접미사",codexTipSuffix:"는 작업 강도를 고정합니다. 접미사가 없는 모델은 Thinking 설정을 사용합니다.",defaultModel:"기본 모델",defaultModelDesc:"특정 티어가 요청되지 않을 때 사용됩니다",opusModel:"Opus (가장 강력)",opusModelDesc:"복잡한 추론 작업용",sonnetModel:"Sonnet (균형)",sonnetModelDesc:"속도와 성능의 균형",haikuModel:"Haiku (빠름)",haikuModelDesc:"간단한 작업에 대한 빠른 응답",cancel:"취소",savePreset:"프리셋 저장",applyPreset:"프리셋 적용",deletePreset:"프리셋 삭제"},componentModelSelector:{selectModel:"모델 선택",availableModelsCount:"사용 가능한 모델 ({{count}})",preview:"미리보기"},searchableSelect:{searchModels:"모델 검색...",noResults:"결과를 찾을 수 없습니다."},copilotSettings:{enableCopilot:"Copilot 사용",enableCopilotDesc:"GitHub Copilot 구독 사용 허용",basicSettings:"기본 설정",accountType:"계정 유형",accountTypeIndividual:"개인",accountTypeBusiness:"비즈니스",accountTypeEnterprise:"엔터프라이즈",rateLimiting:"속도 제한",rateLimitSeconds:"속도 제한 (초)",noLimit:"제한 없음",waitOnRateLimit:"속도 제한 시 대기",waitOnRateLimitDesc:"한도 도달 시 오류 대신 대기",daemonSettings:"데몬 설정",autoStartDaemon:"데몬 자동 시작",autoStartDaemonDesc:"프로필 사용 시 copilot-api 시작"},providerModelSelector:{selectModel:"모델 선택",noModelsForProvider:"이 프로바이더에 사용 가능한 모델이 없습니다",broken:"손상됨",deprecated:"지원 중단",paid:"유료",freeTier:"무료 티어",paidTier:"유료 티어",modelKnownIssues:"이 모델에는 알려진 문제가 있습니다",viewIssueDetails:"이슈 상세 보기",modelDeprecated:"이 모델은 지원이 중단되었습니다",recommended:"추천",allModelsCount:"모든 모델 ({{count}})",noModelsAvailable:"사용 가능한 모델이 없습니다",shadowed:"가려짐",prefixOnly:"접두사 전용",current:"현재",currentValue:"현재 값",preferredPinnedModel:"선호하는 고정 모델:",pinnedRouteStatus:"고정된 라우트 상태:",pinnedModelNotAdvertised:"고정된 모델이 현재 프록시에서 알리지 않고 있습니다: {{model}}",codexReasoningVariants:"추론 변형",codexFastVariants:"빠른 변형"},createAuthProfileDialog:{title:"새 계정 생성",description:"인증 프로필에는 Claude CLI 로그인이 필요합니다. 터미널에서 아래 명령을 실행하십시오. 동기화 모드, 그룹, 연속성 깊이는 나중에 계정 테이블에서 편집할 수 있습니다.",profileName:"프로필 이름",profileNamePlaceholder:"예: work, personal, client",invalidProfileName:"이름은 문자로 시작해야 하며 문자, 숫자, 대시 또는 밑줄만 포함할 수 있습니다.",enableSharedHistory:"다른 ccs auth 계정과 공유 기록 동기화 활성화",historySyncGroupOptional:"기록 동기화 그룹 (선택)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"기본 공유 그룹을 사용하려면 비워두십시오. 공백은 대시로 정규화됩니다.",deeperContinuity:"고급: 심층 연속성 모드",deeperContinuityHint:"session-env, file-history, shell-snapshots, todos에 대한 동기화를 추가합니다. 자격 증명은 분리된 상태로 유지됩니다.",invalidContextGroup:"그룹은 문자로 시작하고 문자, 숫자, 대시, 밑줄만 사용해야 합니다 (최대 {{max}}자).",command:"명령",commandFallback:"ccs auth create <name>",afterRunPrefix:"명령 실행 후:",afterRunStep1:"브라우저에서 Claude 로그인을 완료하십시오",afterRunStep2:"여기로 돌아와서 새로 고침하여 새 계정을 확인하십시오",poolingHint:"풀링된 Claude OAuth 라우팅을 선호하십니까? 계정 페이지 작업 버튼에서 CLIProxy Claude 풀을 사용하십시오.",close:"닫기",copied:"복사됨!",copyCommand:"명령 복사"},accountRouteGuide:{title:"추천 2계정 라우트",description:"토큰 격리를 위해 별도의 계정 프로필을 사용하십시오. 두 계정이 동일한 로컬 연속성을 봐야 할 때만 기록 동기화를 켜십시오.",status:{empty:"계정 생성",isolated:"격리 준비됨",shared:"공유 프로젝트 컨텍스트",deeper:"심층 동기화 준비됨",mixed:"혼합 설정"},cards:{isolated:{title:"토큰은 분리된 상태로 유지",desc:"각 ccs auth 계정은 자체 Claude 구성, 로그인, 자격 증명을 소유합니다. 동기화 설정은 토큰을 복사하지 않습니다."},select:{title:"계정을 선택하십시오",desc:"명시적 사용을 위해 ccs work 또는 ccs personal을 실행하십시오. 단순한 ccs가 하나의 계정을 따라야 할 때만 기본값을 설정하십시오."},settings:{title:"설정은 루트를 따름",desc:"비-bare 계정은 CCS 공유 상태를 통해 settings.json을 ~/.claude/settings.json에 연결합니다. ccs auth show로 확인하십시오."},sync:{title:"기록 동기화는 옵트인",desc:"두 계정 모두 Shared 모드와 동일한 그룹이 필요합니다. 심층 동기화는 추가 로컬 연속성 아티팩트를 추가합니다."}},commands:{isolated:"격리된 계정 사용",sync:"선택적 공유 기록",syncDesc:'두 계정에서 로컬 기록을 공유하려면 동일한 그룹(예: "{{group}}")을 사용하십시오.'}},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"기타"},cliproxyOverviewComponents:{availableModels:"사용 가능한 모델",noModelsAvailable:"사용 가능한 모델이 없습니다",startSessionHint:"사용 가능한 모델을 가져오려면 CLIProxy 세션을 시작하십시오",totalCount:"총 {{count}}개",availableThroughGroupedByProvider:"{{backendLabel}}을(를) 통해 사용 가능한 모델, 프로바이더별 그룹화",moreCount:"+{{count}}개 더"},categorizedModelSelector:{selectModel:"모델 선택",noModelsAvailable:"사용 가능한 모델이 없습니다",modelPlaceholder:"모델..."},openrouterQuickStart:{recommended:"추천",title:"OpenRouter로 시작",description:"OpenAI, Anthropic, Google, Meta 등의 {{modelCountLabel}}개 모델에 단일 API로 액세스하십시오.",featureOneApi:"하나의 API, 모든 프로바이더",profileSummaryCount:"프로필 {{count}}개",profileSummaryCount_other:"프로필 {{count}}개",profileSummaryEmpty:"프리미엄 품질 + 로컬 제어",summaryBadgeDefaultQuality:"기본적으로 최고의 품질",summaryBadgeLocalLane:"작업에 적합할 때 로컬 레인",summaryExistingTitle:"프로필을 선택하거나 다른 레인 추가",summaryEmptyTitle:"첫 번째 프로필 레인 선택",summaryExistingDescription:"이 워크스페이스에 이미 {{count}}개의 프로필이 있습니다. 본격적인 코딩에는 프리미엄 품질의 프로바이더를 유지하고, 개인 정보 보호, 비용 또는 오프라인 작업이 중요할 때는 로컬 런타임을 추가하십시오.",summaryExistingDescription_other:"이 워크스페이스에 이미 {{count}}개의 프로필이 있습니다. 본격적인 코딩에는 프리미엄 품질의 프로바이더를 유지하고, 개인 정보 보호, 비용 또는 오프라인 작업이 중요할 때는 로컬 런타임을 추가하십시오.",summaryEmptyDescription:"작업에 맞는 레인을 선택하십시오. 안정적인 코딩에는 프리미엄 프로바이더가 기본값으로 유지됩니다. 로컬 런타임은 개인 정보 보호, 저렴한 변환, 실험에 가장 적합합니다.",qualityLanesTitle:"최고 품질 레인",qualityLaneHighlightDefaultQuality:"고품질 코딩에 가장 적합한 기본 레인",alibabaLaneDescription:"OpenRouter 카탈로그 외부의 전용 프리미엄 레인을 원할 때의 강력한 직접 코딩 프로필.",alibabaLaneHighlightQuality:"전용 엔드포인트로 프리미엄 품질을 원할 때 적합",localRuntimesTitle:"로컬 런타임",localOllamaTitle:"Ollama + Gemma 4",localOllamaLabel:"Ollama",localOllamaHighlight:"비공개 프롬프트, 로컬 정리, 저렴한 배치 변환에 가장 적합",localLlamacppTitle:"llama.cpp",localLlamacppLabel:"llama.cpp",localLlamacppHighlight:"사용자 정의 GGUF 설정 및 고급 자체 호스팅 로컬 워크플로에 가장 적합",localDetectedModels:"로컬 모델 {{count}}개 감지됨",localDetectedModels_other:"로컬 모델 {{count}}개 감지됨",localNoModelsDetected:"아직 로컬 모델이 감지되지 않았습니다",localWaitingServer:"로컬 서버 및 모델 목록 대기 중",localRuntimeCheckingBadge:"확인 중",localRuntimeReadyBadge:"준비됨",localRuntimeNeedsModelBadge:"모델 필요",localRuntimeOfflineBadge:"오프라인",localRuntimeCheckingDescription:"설정 안내를 표시하기 전에 로컬 런타임 상태를 확인하고 있습니다.",localRuntimeReadyDescription:"비공개 프롬프트, 오프라인 워크플로, 저렴한 배치 변환에 가장 적합합니다.",localRuntimeNeedsModelDescription:"런타임은 실행 중이지만 추천 로컬 모델을 아직 가져오거나 로드해야 합니다.",localRuntimeOfflineDescription:"개인 정보 보호가 민감한 작업, 저렴한 로컬 변환, 오프라인 세션에 이 레인을 사용하십시오.",localRuntimeCheckingFooter:"로컬 런타임 확인 중...",localRuntimeReadyFooter:"{{endpoint}}에서 엔드포인트 준비됨",localRuntimeMissingModelFooter:"로컬 설정을 완료하려면 `{{command}}`을(를) 실행하십시오.",localRuntimeOfflineFooter:"로컬 엔드포인트를 온라인으로 전환하려면 `{{command}}`을(를) 실행하십시오.",localRuntimeSetupAction:"{{label}} 설정",localRuntimeUseAction:"{{label}} 사용",localRuntimeFinishAction:"{{label}} 설정 완료",runtimeProviderBadge:"런타임 프로바이더 설정",runtimeProviderTitle:"AI 프로바이더 열기",runtimeProviderManagedDescription:"CLIProxy 관리 커넥터, 프로바이더 시크릿, 고급 라우팅 제어가 필요할 때 사용하십시오.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex 및 OpenAI 호환 커넥터",runtimeProviderFeatureSecrets:"공유 시크릿이 개별 API 프로필 외부에 유지됩니다",runtimeProviderFooter:"여러 프로필이 하나의 프로바이더 구성을 공유해야 할 때 가장 적합합니다.",createOpenRouterProfile:"OpenRouter 프로필 생성",getApiKeyAt:"API 키 받기:",createCustomProfile:"사용자 정의 API 프로필 생성"},alibabaCodingPlanQuickStart:{recommended:"추천",title:"Alibaba Coding Plan 사용해보기",description:"코딩 워크로드에 Anthropic 호환 엔드포인트를 통해 Alibaba Cloud Coding Plan을 사용하십시오.",featureEndpoint:"Anthropic 호환 엔드포인트",featureKeyFormat:"전용 sk-sp API 키",createAlibabaProfile:"Alibaba Coding Plan 프로필 생성",readGuideAt:"설정 가이드 읽기:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Anthropic 엔드포인트를 통한 Model Studio Coding Plan",add:"추가"},credentialHealth:{title:"자격 증명 상태",ready:"준비됨",noCredentialsConfigured:"구성된 자격 증명이 없습니다. 위의 로그인 버튼을 사용하여 인증하십시오.",neverUsed:"사용 안 함",justNow:"방금 전",unknown:"알 수 없음",daysAgo:"{{count}}일 전",hoursAgo:"{{count}}시간 전",minutesAgo:"{{count}}분 전"},proxyStatusWidget:{justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",syncReady:"동기화 준비됨",noConfig:"구성 없음",remoteProxy:"원격 프록시",active:"활성",trafficAutoRouted:"트래픽이 원격 서버로 자동 라우팅됨",tooltipSync:"CLIProxy로 프로필 동기화",tooltipRestart:"다시 시작",tooltipStop:"중지",tooltipClose:"닫기",tooltipVersionSettings:"버전 설정",versionManagement:"버전 관리",selectVersionPlaceholder:"설치할 버전 선택...",stable:"(안정)",install:"설치",versionsAboveUnstable:"{{version}} 이상 버전에는 알려진 문제가 있습니다",versionsKnownIssues:"{{version}} 버전에는 알려진 문제가 있습니다",lastChecked:"마지막 확인 {{time}}",notRunning:"실행 중이 아님",start:"시작",port:"포트 {{port}}",sessionCount:"세션 {{count}}개",sessionCount_other:"세션 {{count}}개",installFaultyTitle:"알려진 문제가 있는 버전을 설치하시겠습니까?",installFaultyDesc:"알려진 결함 범위 <strong>{{range}}</strong>에 해당하는 <strong>v{{version}}</strong>을(를) 설치하려고 합니다.",installFaultyWarning:"이 버전에는 알려진 버그가 있어 실패하거나 프록시를 좋지 않은 상태로 만들 수 있습니다.",installUnstableTitle:"불안정한 버전을 설치하시겠습니까?",installUnstableDesc:"최대 안정 버전 <strong>v{{maxStable}}</strong>보다 높은 <strong>v{{version}}</strong>을(를) 설치하려고 합니다.",installUnstableWarning:"이 버전에는 알려진 안정성 문제가 있어 예기치 않은 동작을 유발할 수 있습니다.",installUnstableConfirm:"계속 진행하시겠습니까?",cancel:"취소",installAnyway:"그래도 설치",clickToDowngrade:"다운그레이드하려면 클릭",clickToUpdate:"업데이트하려면 클릭"},syncStatusCard:{profileSync:"프로필 동기화",ready:"준비됨",noConfig:"구성 없음",syncsProfilesDesc:"API 프로필을 로컬 CLIProxy 구성으로 동기화",runDoctorHint:"구성을 생성하려면 <code>ccs doctor --fix</code>를 실행하십시오.",details:"상세",syncNow:"지금 동기화"},syncDialog:{title:"로컬 CLIProxy로 프로필 동기화",description:"CCS API 프로필을 로컬 CLIProxy config.yaml로 동기화합니다.",noProfiles:"동기화할 프로필이 구성되지 않았습니다.",createProfilesFirst:"프로필 탭에서 먼저 API 프로필을 생성하십시오.",modelLabel:"모델:",ready:"준비됨",profilesToSync_one:"동기화할 프로필 {{count}}개",profilesToSync_other:"동기화할 프로필 {{count}}개",cancel:"취소",syncing:"동기화 중...",synced:"동기화 완료!",syncNow:"지금 동기화"},errorLogs:{title:"오류 로그",failedRequests_one:"실패한 요청 {{count}}개",failedRequests_other:"실패한 요청 {{count}}개",cliproxyDiagnostics:"CLIProxy 진단",showingCount:"총 {{total}}개 로그 중 50개 표시",selectLog:"상세 정보를 보려면 로그를 선택하십시오",failedLoadContent:"로그 콘텐츠를 로드하지 못했습니다",copyAbsolutePath:"절대 경로 복사",copyRawContent:"원시 로그 콘텐츠 복사",tabOverview:"개요",tabHeaders:"헤더",tabRequest:"요청",tabResponse:"응답",tabRaw:"원시",modelLabel:"모델:",quotaResetsIn:"쿼터 초기화: ",method:"메서드",provider:"프로바이더",version:"버전",endpoint:"엔드포인트",url:"URL",timestamp:"타임스탬프",na:"N/A",noHeaders:"사용 가능한 헤더가 없습니다",noRequestBody:"요청 본문 없음",noResponseBody:"응답 본문 없음",rateLimitedMsg:"속도 제한. 다른 계정으로 전환하거나 쿼터 초기화를 기다리십시오. 모델 {{model}}이(가) 쿼터를 소진했습니다.",rateLimitedMsgNoModel:"속도 제한. 다른 계정으로 전환하거나 쿼터 초기화를 기다리십시오.",authFailedMsg:"인증 실패. CLIProxy 설정을 통해 재인증하거나 API 키를 확인하십시오.",notFoundMsg:"엔드포인트를 찾을 수 없습니다. 이 엔드포인트는 이 프로바이더에 존재하지 않을 수 있습니다.",serverErrorMsg:"업스트림 서버 오류. 나중에 다시 시도하거나 프로바이더 상태 페이지를 확인하십시오.",timeoutMsg:"요청 시간 초과. 네트워크 연결을 확인하거나 시간 초과 설정을 늘리십시오.",unknown:"알 수 없음"},editAccountContext:{title:"기록 동기화 편집",description:'"{{name}}"이(가) 다른 ccs auth 계정과 기록 및 연속성을 공유하는 방법을 구성합니다.',syncMode:"동기화 모드",selectContextMode:"컨텍스트 모드 선택",isolatedOption:"격리",sharedOption:"공유",sharedModeHint:"동일한 기록 그룹의 계정 간에 워크스페이스 컨텍스트를 재사용합니다.",isolatedModeHint:"이 계정을 다른 ccs auth 계정과 완전히 분리된 상태로 유지합니다.",historySyncGroup:"기록 동기화 그룹",groupPlaceholder:"default",groupHint:"소문자로 정규화됩니다(공백은 대시로 변환). 허용: 문자, 숫자, _, - (최대 {{max}}자).",invalidGroup:"문자로 시작하는 유효한 그룹 이름을 입력하십시오.",continuityDepth:"연속성 깊이",selectContinuityDepth:"연속성 깊이 선택",standardOption:"표준",deeperOption:"심층",deeperHint:"포괄적인 session-env, file-history, shell-snapshots, todos를 동기화합니다.",standardHint:"표준 모드는 프로젝트 워크스페이스 컨텍스트만 동기화합니다.",credentialsIsolated:"자격 증명 및 .anthropic은 모든 모드에서 계정별로 격리됩니다.",implicationTitle:"저장 후 의미",isolatedImplication:"이 계정은 분리된 상태로 유지됩니다. 다른 계정은 이 계정의 연속성 상태를 재개할 수 없습니다.",sameGroupRule:'계정이 서로 연속성을 공유하려면 먼저 동일한 그룹 "{{group}}"을(를) 사용해야 합니다.',noSameGroupPeer:"현재 이 그룹을 공유하는 다른 계정이 없습니다.",sameGroupPeerCount_one:"이미 이 그룹을 공유하는 다른 계정이 {{count}}개 있습니다.",sameGroupPeerCount_other:"이미 이 그룹을 공유하는 다른 계정이 {{count}}개 있습니다.",deeperReady_one:"동일 그룹 계정 {{count}}개가 이미 심층 연속성을 사용 중입니다. 이는 사용 가능한 가장 강력한 핸드오프 설정입니다.",deeperReady_other:"동일 그룹 계정 {{count}}개가 이미 심층 연속성을 사용 중입니다. 이는 사용 가능한 가장 강력한 핸드오프 설정입니다.",deeperNeedsPeers:"여기에 심층 연속성이 활성화되어 있지만, 더 강력한 계정 간 재개를 기대하려면 이 그룹의 다른 계정에도 심층 연속성이 필요합니다.",standardWarning:"표준 공유 모드는 프로젝트 컨텍스트에만 적합합니다. 두 계정 모두 심층 연속성을 사용할 때 계정 간 재개 기대치가 더 강합니다.",resumeOriginalWarning:"이전 대화가 중요한 경우, 설정을 변경하기 전에 원래 계정에서 재개하십시오.",cancel:"취소",save:"저장",saving:"저장 중..."},historySyncLearningMap:{title:"기록 동기화 작동 방식",description:"격리 -> 공유 -> 심층. 계정 간 재개에는 두 계정 모두에 동일한 그룹이 필요합니다.",learningMap:"학습 맵",isolated:"격리",shared:"공유",deeper:"심층",cliproxyManaged_one:"CLIProxy Claude 풀 계정 {{count}}개가 Action Center / CLIProxy 페이지에서 관리됩니다.",cliproxyManaged_other:"CLIProxy Claude 풀 계정 {{count}}개가 Action Center / CLIProxy 페이지에서 관리됩니다.",showDetails:"상세 보기: 그룹, 전환, 레거시 정책",modeSwitch:"모드 전환",modeSwitchDesc:"각 계정에서 동기화를 사용하여 격리/공유 간을 이동하고 심층 연속성을 선택하십시오.",historySyncGroup:"기록 동기화 그룹",historySyncGroupDesc:"계정이 연속성을 공유하기 전에 동일한 그룹이 필요합니다. 기본 폴백은 default입니다.",sameGroupRule:"현재 계정은 동일한 그룹에서 공유 상태일 때만 연속성을 공유합니다.",deeperRecommendation:'그룹 "{{group}}"이(가) 공유되어 있지만, 사용자가 계정 간 재개를 기대하는 경우 심층 연속성이 더 안전한 선택입니다.',partialGroup:'그룹 "{{group}}"은 양호한 상태이지만, 다른 계정이나 그룹은 여전히 동일 그룹 또는 심층 설정이 필요합니다.',readyGroup:'그룹 "{{group}}"은 이미 여러 계정에서 심층 연속성을 사용하고 있습니다. 이는 사용 가능한 가장 강력한 핸드오프 설정입니다.',legacyConfirmation_one:"레거시 계정 {{count}}개가 아직 명시적 확인을 필요로 합니다.",legacyConfirmation_other:"레거시 계정 {{count}}개가 아직 명시적 확인을 필요로 합니다."},continuityReadiness:{title:"계정 간 재개 확인",description:"사용자가 계정을 전환하기 전에 누락된 것이 무엇인지 보려면 이 카드를 사용하십시오.",state:{single:"단일 계정",isolated:"재개 꺼짐","shared-alone":"공유되었지만 미완료","shared-standard":"프로젝트만",partial:"부분적으로 준비됨",ready:"더 강력한 핸드오프 준비됨"},metrics:{isolated:"격리",sharedPeers:"피어와 공유",deeperReady:"심층 준비됨"},messages:{single:{title:"인증 계정이 하나만 구성되어 있습니다.",description:"아직 계정 간 핸드오프가 적용되지 않습니다. 공유 연속성을 구성하기 전에 다른 인증 계정을 추가하십시오."},isolated:{title:"현재 계정 간 재개가 꺼져 있습니다.",description:"표시되는 모든 계정이 격리되어 있으므로 한 계정에서 생성된 세션은 해당 계정에 머무릅니다."},"shared-alone":{title:"공유 모드가 존재하지만 아직 어떤 그룹에도 피어가 없습니다.",description_one:"공유 계정 {{count}}개가 동일 그룹의 다른 계정을 여전히 기다리고 있습니다.",description_other:"공유 계정 {{count}}개가 동일 그룹의 다른 계정을 여전히 기다리고 있습니다."},"shared-standard":{title:'그룹 "{{group}}"은 프로젝트 컨텍스트를 공유하지만 심층 연속성이 아직 페어링되지 않았습니다.',description:"사용자는 프로젝트 공유 이상을 기대할 수 있습니다. 더 강력한 핸드오프 기대치를 위해 이 그룹의 두 계정 모두에서 심층 연속성을 활성화하십시오."},partial:{title:"한 그룹은 준비되었지만 전체 설정은 여전히 혼합 상태입니다.",description:"적어도 한 그룹은 이미 심층 연속성을 사용 중이지만, 다른 계정은 여전히 격리되어 있거나 공유 그룹에 혼자 있거나 심층 연속성이 누락되었습니다."},ready:{title:'그룹 "{{group}}"이(가) 사용 가능한 가장 강력한 연속성 설정을 갖추고 있습니다.',description:"이 그룹의 여러 계정에서 이미 심층 연속성을 사용 중입니다. 재개 동작은 여전히 Claude가 업스트림에 저장하는 내용에 따라 달라집니다."}},stepsTitle:"사용자가 다음에 해야 할 작업",steps:{syncBoth:"전환하려는 계정뿐만 아니라 두 계정 모두에서 동기화를 여십시오.",sameGroup:'두 계정에서 동일한 기록 동기화 그룹을 사용하십시오. "{{group}}"이(가) 현재 추천 그룹입니다.',enableDeeper:"프로젝트 전용 공유 대신 계정 간 재개를 기대하는 사용자라면 두 계정 모두에서 심층 연속성을 켜십시오.",resumeOriginal:"원래 대화가 중요한 경우, 연속성 설정을 변경하기 전에 원래 계정에서 재개하십시오."},singleSteps:{addAccount:"계정 간 핸드오프를 계획하기 전에 두 번째 ccs auth 계정을 생성하십시오.",sameGroupLater:"해당 두 번째 계정이 존재하면, 두 계정 모두 동일한 기록 동기화 그룹에 두십시오.",enableDeeperLater:"사용자가 프로젝트 전용 공유 대신 계정 간 재개를 기대한다면, 두 계정 모두에서 심층 연속성을 활성화하십시오.",resumeOriginal:"원래 대화가 중요한 경우, 두 번째 계정이 준비될 때까지 원래 계정에서 계속 재개하십시오."}},continuityOverview:{plainLaneTitle:"단순 ccs가 다른 재개 레인을 사용 중입니다",plainLaneDescription:"단순 ccs는 현재 이 계정 레인이 아닌 {{lane}}에서 재개합니다. 동기화 설정을 변경하기 전에 먼저 원래 레인을 복구하십시오.",setDefaultHint:"향후 세션에서 단순 ccs가 따라야 할 계정에 기본값 설정 작업을 사용하십시오.",recommendBadge:"추천 {{group}}",partialBadge:"부분 동기화 {{group}}",lane:{native:"네이티브 Claude (~/.claude)",accountDefault:"계정 {{name}}",accountInherited:"연속성 상속을 통한 계정 {{name}}",profileDefault:"네이티브 Claude 레인을 통한 기본 프로필 {{name}}"}},accountsTable:{name:"이름",type:"유형",defaultBadge:"기본값",created:"생성됨",lastUsed:"마지막 사용",historySync:"기록 동기화",sharedResources:"리소스",actions:"작업",syncTitle:"동기화 모드, 그룹, 연속성 깊이 편집",resourcesTitle:"공유 리소스 상속 편집",confirmLegacyTitle:"이 레거시 계정의 현재 모드를 명시적으로 확인",sync:"동기화",confirm:"확인",active:"활성",setDefault:"기본값으로 설정",deleteAccount:"계정 삭제",cannotDeleteDefault:"기본 계정을 삭제할 수 없습니다",noAccounts:"CCS auth 계정을 찾을 수 없습니다. ccs auth create로 계정을 추가하십시오.",resetToDefault:"CCS 기본값으로 재설정",deleteDialogTitle:"계정 삭제",deleteDialogDesc:'"{{name}}" 계정을 삭제하시겠습니까? 이렇게 하면 프로필과 모든 세션 데이터가 제거됩니다. 이 작업은 취소할 수 없습니다.',cancel:"취소",delete:"삭제",sharedGroupStandard:"공유 ({{group}}, 프로젝트 전용)",sharedGroupDeeper:"공유 ({{group}}, 심층 연속성)",sharedGroupLegacy:"공유 ({{group}}, 프로젝트 전용, 레거시)",isolatedLegacy:"격리 (레거시 기본값)",isolated:"격리",resourcesShared:"공유",resourcesProfileLocal:"프로필 로컬",noSameGroupPeer:"아직 동일 그룹 피어가 없습니다",sameGroupPeerCount_one:"동일 그룹 피어 {{count}}개",sameGroupPeerCount_other:"동일 그룹 피어 {{count}}개",legacyReview:"이 추론된 기본값을 검토하고 확인하십시오.",noHandoff:"계정 간 재개는 원래 계정에 머무릅니다.",badges:{shared:"공유",deeper:"심층",legacy:"레거시",isolated:"격리",profileLocal:"로컬"}},addAccountDialog:{title:"{{displayName}} 계정 추가",descKiro:"Kiro 인증 방법을 선택한 다음, 브라우저로 인증하거나 Kiro IDE에서 가져오십시오.",descDeviceCode:"인증을 클릭하십시오. 프로바이더 웹사이트에서 입력할 검증 코드가 표시됩니다.",descOauth:"인증을 클릭하여 OAuth URL을 받으십시오. 아무 브라우저에서나 열어 로그인하십시오.",powerUserEnabled:"파워 유저 모드 활성화됨",powerUserSkipped:"설정 > 프록시 파워 유저 모드가 AGY 책임 체크리스트와 Gemini 대시보드 위험 문구를 건너뛰고 있습니다. OAuth/계정 위험에 대한 전적인 책임을 수락합니다.",powerUserLoadFailed:"파워 유저 모드 설정을 로드하지 못했습니다. 설정 > 프록시를 확인하고 다시 시도하십시오.",powerUserLoading:"파워 유저 안전 설정을 로드 중입니다. 잠시 기다린 후 다시 시도하십시오.",powerUserUnavailableRetry:"파워 유저 모드를 사용할 수 없습니다. 필요한 프로바이더 안전 단계를 완료하고 다시 시도하십시오.",authMethod:"인증 방법",selectKiroAuthMethod:"Kiro 인증 방법 선택",gitlabAuthMethod:"GitLab 인증 방법",selectGitlabAuthMethod:"GitLab 인증 방법 선택",gitlabAuthOAuth:"브라우저 OAuth",gitlabAuthPat:"개인 액세스 토큰",gitlabAuthHint:"gitlab.com에는 브라우저 OAuth를, 자체 호스팅 및 관리자 관리 설정에는 PAT를 사용하십시오.",gitlabUrl:"GitLab URL",gitlabUrlPlaceholder:"https://gitlab.com",gitlabUrlHint:"선택 사항. gitlab.com의 경우 비워두거나 자체 호스팅 GitLab base URL을 설정하십시오.",gitlabPat:"개인 액세스 토큰",gitlabPatPlaceholder:"glpat-...",gitlabPatHint:"토큰에는 최소한 다음이 포함되어야 합니다",gitlabPatRequired:"PAT 로그인에는 GitLab 개인 액세스 토큰이 필요합니다.",nicknameRequired:"닉네임 (필수)",nicknameOptional:"닉네임 (선택)",nicknamePlaceholder:"예: work, personal",nicknameRequiredHint:"이 프로바이더에 필요합니다. 고유한 친숙한 이름을 사용하십시오(예: work, personal).",nicknameOptionalHint:"이 계정을 식별할 친숙한 이름입니다. 안전한 생성된 식별자를 사용하려면 비워두십시오.",waitingForAuth:"인증 대기 중...",deviceCodeHint:"검증 코드 대화 상자가 곧 나타납니다. 프로바이더 웹사이트에 코드를 입력하십시오.",browserHint:"브라우저에서 인증을 완료하십시오. 이 대화 상자는 자동으로 닫힙니다.",openUrlLabel:"아무 브라우저에서나 이 URL을 열어 로그인하십시오:",copied:"복사됨",copy:"복사",open:"열기",popupBlocked:"팝업이 차단되었습니다. 위 URL을 복사하여 브라우저에서 수동으로 여십시오.",redirectPasteLabel:"리디렉션이 작동하지 않았습니까? 콜백 URL을 붙여넣으십시오:",callbackPlaceholder:"리디렉션 URL을 여기에 붙여넣으십시오...",submitCallback:"콜백 제출",submitting:"제출 중...",preparingUrl:"로그인 URL 준비 중...",cancel:"취소",importingToken:"Kiro IDE에서 토큰을 가져오는 중...",authenticate:"인증",importFromIde:"IDE에서 가져오기",importing:"가져오는 중..."},flowViz:{backToProviders:"프로바이더로 돌아가기",showDetails:"상세 표시",hideDetails:"상세 숨기기",showPausedAccounts:"일시 중지 표시 ({{count}})",hidePausedAccounts:"일시 중지 숨기기 ({{count}})",visibleTotalRequests:"표시되는 요청",visibleAccounts:"표시되는 계정",excludingPausedAccounts:"일시 중지된 {{count}}개 제외",resetLayout:"레이아웃 재설정",provider:"프로바이더",totalRequests:"총 요청",accounts:"계정",connectionTimeline:"연결 타임라인",noRecentConnections:"최근 연결 없음"},quickStats:{totalRequests:"총 요청",successRate:"성공률",totalTokens:"총 토큰",activeModels:"활성 모델"},authMonitor:{accounts:"계정",accountsCount:"계정 {{count}}개",success:"성공",failed:"실패",successRate:"성공률"},accountCard:{resumeAccount:"계정 재개",pauseAccount:"계정 일시 중지",quotaLoading:"쿼터...",quota:"쿼터",quotaUnavailable:"쿼터 한도 사용 불가",reauthNeeded:"재인증 필요",failureLabelReauth:"재인증",failureLabelWorkspace:"워크스페이스",failureLabelNoAccess:"액세스 없음",failureLabelRetry:"재시도",failureLabelReconnect:"재연결",failureLabelTemporary:"일시적",failureLabelUnavailable:"사용 불가",failureHintReauth:"인증 흐름을 다시 실행하여 이 계정을 새로 고치십시오.",failureHintWorkspace:"이 계정을 활성 워크스페이스로 다시 이동한 다음, 제거하고 다시 추가하십시오.",failureHintNoAccess:"이 계정은 프로바이더 쿼터 엔드포인트에 액세스할 수 없습니다.",failureHintRetry:"잠시 후 쿼터 요청을 다시 시도하십시오.",failureHintReconnect:"오래된 계정을 제거하고 다시 인증하십시오.",failureHintTemporary:"나중에 다시 시도하십시오. 일시적인 것으로 보입니다.",removeAndReadd:"계정 제거 후 다시 추가",autoRefreshFailed:"자동 새로 고침 실패"},antigravityChecklist:{title:"Antigravity OAuth 책임",subtitle:"인증하기 전에 4단계를 모두 완료하십시오.",mandatory:"필수",completion:"완료",stepsCount:"{{current}}/4 단계"},accountSafetyWarning:{title:"OAuth 계정 안전 경고",subtitle:"이슈 #509 · Gemini + AGY OAuth 위험",firstLine:"이슈 #509는 ccs agy와 ccs gemini 및 ccs agy 간의 계정 공유 사용과 관련된 정지/차단 보고를 문서화합니다.",secondLine:"OAuth 및 계정 액세스 위험에 대한 전적인 책임을 수락하는 경우에만 계속하십시오.",issueLabel:"이슈 #509 읽기",proxySettingsLabel:"Gemini + AGY 제어: 설정 > 프록시"},cliproxyDialog:{name:"이름",provider:"프로바이더",account:"계정",accountOptional:"계정 (선택)",model:"모델",modelOptional:"모델 (선택)",defaultTarget:"기본 대상",defaultTier:"기본 티어",tierConfig:"티어 구성",selectProvider:"프로바이더 선택...",useDefaultAccount:"기본 계정 사용",defaultSuffix:"(기본값)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"취소",create:"생성",creating:"생성 중...",saveChanges:"변경 사항 저장",saving:"저장 중...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"복합 변형 편집: {{name}}",editSingleTitle:"단일 변형 편집: {{name}}"},profileEditor:{profileInfo:"프로필 정보",profileName:"프로필 이름",filePath:"파일 경로",lastModified:"마지막 수정",defaultTarget:"기본 대상",quickUsage:"빠른 사용",runWithProfile:"프로필로 실행",runOnDroid:"Droid에서 실행",runOnDroidWithFlag:"Droid에서 실행 (--target)",droidAliasExplicit:"Droid 별칭 (명시적)",overrideToClaude:"Claude로 재정의",overrideToClaudeExplicit:"Claude로 재정의 (명시적)",targetHintPreferredAlias:"선호하는 명시적 별칭:",targetHintClaudeDefault:"기본 명령:",targetHintLegacyAlias:"레거시 단축키도 여전히 작동합니다:",targetHintOverride:"각 실행을 다음으로 재정의할 수도 있습니다",setAsDefault:"기본값으로 설정",provider:"프로바이더",custom:"사용자 정의",providerChooserHint:"프리셋으로 시작한 다음, 필요에 따라 URL, API 키 또는 모델 매핑을 조정하십시오.",featuredProviders:"추천 프로바이더",scrollHint:"화면이 좁으면 스크롤하십시오",customEndpoint:"사용자 정의 엔드포인트",morePresets:"더 많은 프리셋",customEndpointDescription:"빈 Anthropic 호환 URL에서 시작하여 모든 것을 수동으로 구성하십시오."},settings:{sectionLoadFailed:"섹션을 로드하지 못했습니다",unknownError:"알 수 없는 오류가 발생했습니다",reloadPage:"페이지 다시 로드",refresh:"새로 고침",copy:"복사",copied:"복사됨",saved:"저장됨",loading:"로드 중...",configFileNotFound:"구성 파일을 찾을 수 없습니다"},settingsTabs:{browser:"브라우저",web:"웹",image:"이미지",channels:"채널",env:"환경 변수",think:"사고",proxy:"프록시",auth:"인증",backup:"백업"},settingsAuth:{failedFetchTokens:"인증 토큰을 가져오지 못했습니다",failedSaveTokens:"토큰을 저장하지 못했습니다",tokensUpdated:"토큰이 업데이트되었습니다. 적용하려면 CLIProxy를 다시 시작하십시오.",failedRegenerate:"시크릿 재생성에 실패했습니다",secretRegenerated:"새 관리 시크릿이 생성되었습니다. 적용하려면 CLIProxy를 다시 시작하십시오.",failedReset:"토큰 재설정에 실패했습니다",tokensReset:"토큰이 기본값으로 재설정되었습니다. 적용하려면 CLIProxy를 다시 시작하십시오.",description:"CLIProxy 인증 토큰을 구성합니다. 변경 사항은 CLIProxy 재시작이 필요합니다.",apiKey:"API 키",custom:"사용자 정의",apiKeyDesc:"Claude Code가 CLIProxy로 인증할 때 사용됩니다",apiKeyPlaceholder:"API 키",managementSecret:"관리 시크릿",managementSecretDesc:"CCS 대시보드가 CLIProxy 관리 API에 액세스할 때 사용됩니다",managementSecretPlaceholder:"관리 시크릿",generateSecret:"새 보안 시크릿 생성",resetDefaults:"기본값으로 재설정",resetDesc:"API 키와 관리 시크릿을 모두 기본값으로 재설정합니다.",saving:"저장 중...",save:"저장"},settingsGlobalEnv:{description:"Claude 구독이 아닌 모든 프로필(gemini, codex, agy, ghcp 등)에 주입되는 환경 변수",enabled:"글로벌 환경 변수 활성화됨",disabled:"글로벌 환경 변수 비활성화됨",enabledDesc:"환경 변수가 타사 프로필에 주입됩니다",disabledDesc:"환경 변수가 주입되지 않습니다",envVars:"환경 변수",noneConfigured:"구성된 환경 변수가 없습니다",addNew:"새 변수 추가",keyName:"KEY_NAME",value:"값",add:"추가",quickAdd:"공통 변수 빠른 추가",allConfigured:"모든 공통 변수가 구성되었습니다"},settingsBackups:{failedFetch:"백업을 가져오지 못했습니다",failedRestore:"백업 복원에 실패했습니다",restoreSuccess:"백업이 성공적으로 복원되었습니다",title:"설정 백업",description:"settings.json 파일의 이전 버전을 복원합니다. 설정이 수정될 때 백업이 자동으로 생성됩니다.",none:"사용 가능한 백업이 없습니다",noneHint:"설정을 수정하면 여기에 백업이 표시됩니다",latest:"최신",restoring:"복원 중...",restore:"복원",restoreConfirmTitle:"백업을 복원하시겠습니까?",restoreConfirmPrefix:"현재 설정을 다음 백업으로 교체합니다",restoreConfirmSuffix:"이 작업은 취소할 수 없습니다.",cancel:"취소"},settingsWebsearch:{description:"타사 프로필(gemini, codex, agy 등)을 위한 CLI 기반 웹 검색",enabled:"WebSearch 활성화됨",disabled:"WebSearch 비활성화됨",checking:"상태 확인 중...",providers:"프로바이더",noneConfigured:"구성된 프로바이더가 없습니다",noneConfiguredHint:"웹 검색 프로바이더를 활성화하려면 CLI 도구를 설치하십시오",checkProviders:"프로바이더 확인",installed:"설치됨",notInstalled:"설치되지 않음",model:"모델:",howInstall:"{{name}} CLI 설치 방법",installGlobally:"전역 설치",requiresKey:"(xAI API 키 필요)",freeTier:"(무료 티어 사용 가능)",viewDocs:"문서 보기"},settingsProxy:{failedLoadAgyMode:"파워 유저 모드를 로드하지 못했습니다",failedUpdateAgyMode:"파워 유저 모드를 업데이트하지 못했습니다",failedVerifyAgyMode:"파워 유저 모드 지속성을 확인하지 못했습니다",notPersistedAgyMode:"파워 유저 모드가 지속되지 않았습니다. 다른 프로세스가 구성을 수정했을 수 있습니다.",agyModeEnabled:"파워 유저 모드가 활성화되었습니다.",agyModeDisabled:"파워 유저 모드가 비활성화되었습니다.",typePhraseToContinue:'계속하려면 "{{value}}"을(를) 입력하십시오.',description:"프록시 기반 프로필을 위한 로컬 또는 원격 {{backend}} 연결을 구성합니다",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"인스턴스 상태",connectionMode:"연결 모드",local:"로컬",remote:"원격",localDesc:"이 머신에서 {{backend}} 바이너리 실행",remoteDesc:"원격 {{backend}} 서버에 연결",backendBinary:"백엔드 바이너리",stopProxyToSwitch:"백엔드를 전환하려면 인스턴스 상태에서 실행 중인 프록시를 중지하십시오.",default:"기본값",plusDesc:"추가 프로바이더를 위한 선택적 트랙. 여전히 지원되지만 현재 업스트림이 아닌 커뮤니티가 유지 관리합니다.",originalDesc:"코어 프로바이더 트랙용 기본, 항상 사용 가능한 백엔드.",plusFallbackNotice:"Plus 프로바이더 트랙은 지원이 중단되지 않았지만, 유지 관리되는 포크 경로가 복원되는 동안 로컬 CLIProxy는 여전히 원래 백엔드로 폴백됩니다.",variantsIncompatible:"기존 plus-extra 변형({{providers}})은 원래 백엔드에서 실행되지 않습니다. 참조용으로 표시된 상태로 유지하되, 사용하기 전에 Plus로 전환하십시오.",safety:"안전",agyModeTitle:"Antigravity + Gemini 파워 유저 모드",agyModeDesc:"AGY 책임 체크리스트와 Gemini 대시보드 입력 확인을 건너뜁니다.",agyWarning:"OAuth 정지/차단 위험 패턴(#509)을 완전히 이해하는 경우에만 사용하십시오. CCS는 계정 손실에 대한 책임을 지지 않습니다.",finalConfirm:"최종 확인 필요",finalConfirmDesc:"이를 활성화하면 AGY 안전 체크포인트와 Gemini 대시보드 위험 문구 게이트를 건너뜁니다. 이슈 #509를 검토하고 정확한 문구를 입력하여 진행하십시오.",step1:"1단계",readIssue:"이슈 #509 읽기",step2:"2단계",typePrefix:"입력",typeSuffix:"하여 활성화하십시오.",typePhraseAria:"Antigravity + Gemini 파워 유저 모드를 활성화하려면 I ACCEPT RISK를 입력하십시오",exactPhrase:"정확한 문구가 필요합니다.",enableAgyMode:"Antigravity + Gemini 파워 유저 모드 활성화",toggleAgyMode:"Antigravity + Gemini 파워 유저 모드 전환",fallbackSettings:"폴백 설정",enableFallback:"로컬로 폴백 활성화",enableFallbackDesc:"원격에 도달할 수 없으면 로컬 프록시 사용",autoStartLocal:"로컬 프록시 자동 시작",autoStartLocalDesc:"폴백 시 로컬 프록시 자동 시작",advanced:"고급",debugMode:"디버그 모드",debugModeDesc:"브라우저 콘솔에서 개발자 진단 활성화",debugModeEnabled:"디버그 모드가 활성화되었습니다. 자세한 로그는 브라우저 콘솔을 확인하십시오.",localProxy:"로컬 프록시",port:"포트",autoStart:"자동 시작",localAutoStartDesc:"필요할 때 로컬 프록시 자동 시작",remoteConfigTitle:"원격 서버 구성",host:"호스트",hostPlaceholder:"192.168.1.100 또는 proxy.example.com",defaultPort:"기본값: {{value}}",portPlaceholder:"기본값을 사용하려면 {{value}}을(를) 비워두십시오",protocol:"프로토콜",http:"HTTP",https:"HTTPS",apiKeyOptional:"API 키 (선택)",apiKeyPlaceholder:"/v1/* API 엔드포인트용",apiKeyDesc:"/v1/chat/completions에 대한 API 요청에 사용됩니다",managementKeyOptional:"관리 키 (선택)",managementKeyPlaceholder:"/v0/management/* 엔드포인트용",managementKeyDesc:"대시보드 관리 API에 사용됩니다. 설정되지 않으면 API 키로 폴백합니다.",testing:"테스트 중...",testConnection:"연결 테스트",connectedLatency:"연결됨 ({{value}}ms)",connectionFailed:"연결 실패",invalidPortOrEmpty:"포트는 1에서 65535 사이의 정수이거나 기본값을 위해 비워두어야 합니다",invalidLocalPort:"로컬 포트는 1에서 65535 사이의 정수여야 합니다",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"지원되는 모델에 대해 확장 사고/추론을 구성합니다.",supportedProviders:"지원되는 프로바이더",modeTitle:"사고 모드",modeAutoDesc:"모델 티어에 따라 자동으로 사고 설정",modeOffDesc:"확장 사고 비활성화",modeManualDesc:"지속적인 재정의 수준을 설정하거나 실행별 CLI 플래그 사용",tierDefaults:"티어 기본값",tierDefaultsDesc:"자동 모드에서 각 모델 티어의 기본 사고 수준입니다.",persistentOverride:"지속적 재정의",persistentOverrideDesc:"모든 세션에 적용됩니다. CLI 플래그가 여전히 우선합니다.",enterCustomBudget:"사용자 정의 예산 입력",apply:"적용",providerOverrides:"프로바이더 재정의 ({{count}})",providerOverridesDesc:"특정 프로바이더에 대한 티어 기본값을 재정의합니다. 필요에 따라 사용자 정의 프로바이더 키를 추가하십시오.",addProviderPlaceholder:"프로바이더 키 추가 (예: qwen)",showWarnings:"경고 표시",showWarningsDesc:"사고 값이 클램프되거나 조정될 때 경고 표시",cliEnvOverride:"CLI 및 환경 변수 재정의",supportLine1Prefix:"사고 예산:",supportLine1Suffix:"(토큰 기반)",supportLine2Prefix:"추론 강도:",supportLine2SuffixPrefix:"(접미사 또는 ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex 접미사는 강도를 고정합니다 (예: ",supportLine3Suffix:"); 접미사가 없는 모델은 Thinking 모드를 사용합니다."},analytics:{title:"분석",noDailyUsage:"오늘 사용 데이터 없음",noUsageData:"사용 가능한 사용 데이터 없음",subtitle:"사용량 및 인사이트 추적",month:"월",allTime:"전체 기간",updated:"업데이트됨 {{value}}"},analyticsSummary:{totalTokens:"총 토큰",totalTokensSubtitle:"입력 {{input}} / 출력 {{output}}",totalCost:"총 비용",totalCostSubtitle:"평균 ${{value}}/일",cacheTokens:"캐시 토큰",cacheTokensSubtitle:"${{cost}} (비용의 {{percent}}%)",inputCost:"입력 비용",outputCost:"출력 비용",tokensSubtitle:"{{value}} 토큰"},apiProfiles:{title:"프로필",sidebarTitle:"API 프로필",sidebarSubtitle:"프리미엄 API, 로컬 런타임, 사용자 정의 엔드포인트",new:"새로 만들기",searchPlaceholder:"프로필 검색...",loadingProfiles:"프로필 로드 중...",failedLoadTitle:"프로필을 로드하지 못했습니다",failedLoadDesc:"API 프로필을 가져올 수 없습니다. 다시 시도하십시오.",retry:"재시도",noProfilesYet:"아직 API 프로필이 없습니다",noProfilesDesc:"사용자 정의 API 엔드포인트에 연결하려면 첫 번째 프로필을 생성하십시오",createProfile:"프로필 생성",noProfileMatch:'"{{query}}"과(와) 일치하는 프로필이 없습니다',profileCount:"프로필 {{count}}개",profileCount_other:"프로필 {{count}}개",configuredCount:"구성됨 {{count}}개",deleteProfileTitle:"프로필 삭제",deleteProfileDesc:'"{{name}}"을(를) 삭제하시겠습니까? 이렇게 하면 설정 파일이 제거되며 취소할 수 없습니다.',delete:"삭제",unsavedChangesTitle:"저장되지 않은 변경 사항",unsavedChangesDesc:'"{{current}}"에 저장되지 않은 변경 사항이 있습니다. 폐기하고 "{{next}}"(으)로 전환하시겠습니까?',discardSwitch:"폐기 후 전환",noOrphansFound:"고아 프로필 설정을 찾을 수 없습니다",confirmRegisterOrphans:"{{total}}개의 고아 프로필 설정 파일을 찾았으며, 그 중 {{valid}}개를 등록할 준비가 되었습니다. 지금 등록하시겠습니까?",registeredWithSkipped:" ({{count}}개 건너뜀)",registeredProfiles:"프로필 {{count}}개 등록됨",copyPrompt:'"{{name}}"을(를) 어떤 새 프로필 이름으로 복사하시겠습니까?',destinationEmpty:"대상 프로필 이름은 비어 있을 수 없습니다",exportRedacted:"편집된 토큰으로 내보내기를 생성했습니다. 필요한 경우 CLI의 include-secrets 흐름을 사용하십시오.",exportDownloaded:"프로필 내보내기가 다운로드되었습니다",importFailed:"프로필 번들을 가져오지 못했습니다",discoverOrphans:"고아 프로필 검색",importProfileBundle:"프로필 번들 가져오기"},accountsPage:{title:"계정",managePrefix:"관리",manageSuffix:"계정과 풀 온보딩을 하나의 패널에서.",mobileManageSuffix:"계정별 연속성.",primaryActions:"주요 작업",createAccount:"계정 생성",authClaudeInPool:"풀에서 Claude 인증",openClaudePoolSettings:"Claude 풀 설정 열기",openCliProxyClaudePool:"CLIProxy Claude 풀 열기",migrationFollowup:"마이그레이션 후속 조치",legacyContextPending:"계정 {{count}}개가 아직 첫 모드 확인이 필요합니다.",legacyContextPending_other:"계정 {{count}}개가 아직 첫 모드 확인이 필요합니다.",legacyContinuityPending:"공유 계정 {{count}}개가 표준 레거시 연속성 깊이로 남아 있습니다.",legacyContinuityPending_other:"공유 계정 {{count}}개가 표준 레거시 연속성 깊이로 남아 있습니다.",confirmingLegacy:"레거시 정책 확인 중...",confirmLegacy:"레거시 정책 확인 ({{count}})",noLegacyFollowup:"대기 중인 레거시 후속 조치가 없습니다.",continuityGuide:"연속성 가이드",expandWhenNeeded:"필요할 때만 확장하십시오.",sharedStandard:"공유 표준",sharedStandardDesc:"공유 워크스페이스만. 핸드오프를 기대하기 전에 두 계정을 동일한 그룹에 두십시오.",sharedDeeper:"공유 심층",sharedDeeperPrefix:"추가",sharedDeeperDesc:"session-env, file-history, shell-snapshots, todos를 추가합니다. 사용자가 계정 간 재개를 기대할 때 권장됩니다.",isolated:"격리",isolatedDesc:"연결 없음. 대화는 원래 계정에 머무릅니다.",quickCommands:"빠른 명령",quickCommandsDesc:"터미널에 복사하여 실행하십시오.",workspaceBadge:"ccs auth 워크스페이스",historySyncBadge:"기록 및 재개 제어",resourcesBadge:"공유 리소스 제어",resourcesShared:"공유",resourcesProfileLocal:"프로필 로컬",authAccounts:"인증 계정",tableScopePrefix:"이 테이블은 의도적으로",tableScopeMiddle:"계정으로 범위가 지정되어 있습니다. 모드/그룹/깊이 변경에는",tableScopeSuffix:"을(를) 사용하십시오.",accountMatrix:"계정 매트릭스",sharedTotalDesc:"공유 총합: {{count}}. 작업에는 동기화 설정 및 레거시 확인이 포함됩니다.",loadingAccounts:"계정 로드 중..."},health:{justNow:"방금 전",secondsAgo:"{{count}}초 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",systemHealth:"시스템 헬스",build:"빌드 {{version}}",lastScan:"마지막 스캔:",autoRefresh:"자동 새로 고침:",refresh:"새로 고침",checks:"검사",version:"버전",platform:"플랫폼",liveMonitoring:"실시간 모니터링 활성",copied:"클립보드에 복사되었습니다",refreshing:"헬스 검사 새로 고침 중...",fix:"수정",applyFix:"수정 적용",healthLabel:"헬스"},updates:{actionRequired:"작업 필요",done:"완료",all:"전체",inboxTitle:"업데이트 센터",inboxSubtitle:"작업에 집중한 다음 업데이트를 완료 또는 해제로 표시하십시오.",needsAction:"작업 필요",doneCount:"완료",searchPlaceholder:"작업 또는 명령 검색",noNotices:"이 보기와 일치하는 알림이 없습니다.",noUpdates:"사용 가능한 업데이트가 없습니다.",published:"게시됨 {{date}}",markDone:"완료로 표시",dismiss:"해제",reopen:"다시 열기",doNext:"다음 작업",impactedIntegrations:"영향받는 통합",impactedDesc:"업데이트 범위 및 라우팅에 따른 관련 영역.",whyMatters:"왜 중요한가",whyMattersDesc:"짧은 컨텍스트만, 긴 릴리스 노트는 없습니다.",open:"열기",progressNeedsAction:"작업 필요",progressInReview:"검토 중",progressDone:"완료",progressDismissed:"해제됨",statusNew:"신규",statusStable:"안정",statusPlanned:"계획됨",dashboard:"대시보드",cliUsage:"CLI 사용"},cliproxyPage:{connected:"연결됨",notConnected:"연결되지 않음",variant:"변형",parentNotConnected:"상위가 연결되지 않음",viaProvider:"{{provider}}을(를) 통해",emptyTitle:"CCS 프로필 관리자",emptyDesc:"CLIProxy 프로바이더에 대한 OAuth 인증, 계정 환경설정 및 모델 선택을 관리합니다. CCS가 다양한 AI 백엔드로 요청을 라우팅하는 방법을 구성합니다.",emptyControlPanelPrefix:"실시간 사용 통계 및 실시간 모니터링을 보려면 다음을 방문하십시오:",controlPanel:"제어판",quickSetup:"빠른 설정",addAccount:"계정 추가",advancedVariant:"고급 변형",setupActionsHint:"여기에 계정을 추가하십시오. 별도의 런타임/프로필이 필요할 때만 변형을 생성하십시오.",accountManagement:"CCS 레벨 계정 관리",providers:"프로바이더",variants:"변형",providerCount:"프로바이더 {{count}}개",providerCount_other:"프로바이더 {{count}}개",connectedCount:"연결됨 {{count}}개",variantDisplay:"{{name}} ({{provider}} 변형)"},copilotPage:{title:"Copilot",subtitle:"지원 중단된 GitHub Copilot 호환성 브리지",deprecatedBadge:"지원 중단",deprecationTitle:"지원 중단된 호환성 브리지",deprecationItem1:"GitHub 사용량 기반 Copilot 청구는 2026년 6월 1일에 시작됩니다",deprecationItem2:"기존 로컬 설정은 호환성을 위해 계속 사용할 수 있습니다",deprecationItem3:"새 작업에는 Codex 또는 다른 활성 프로바이더를 사용하십시오",setup:"설정",auth:"인증",daemon:"데몬",unofficialTitle:"비공식 API - 본인 책임 하에 사용",unofficialItem1:"리버스 엔지니어링된 API - 언제든지 중단될 수 있습니다",unofficialItem2:"과도한 사용은 계정 제한을 유발할 수 있습니다",unofficialItem3:"CCS의 보증 또는 책임 없음",yes:"예",no:"아니요",installed:"설치됨",missing:"없음",integration:"통합",enabled:"활성화됨",disabled:"비활성화됨",github:"GitHub",connected:"연결됨",notConnected:"연결되지 않음",authenticate:"인증",authenticating:"인증 중...",status:"상태",running:"실행 중",stopped:"중지됨",port:"포트",stopping:"중지 중...",stop:"중지",starting:"시작 중...",start:"시작",installing:"설치 중...",installCopilotApi:"copilot-api 설치",proxy:"프록시",active:"활성",inactive:"비활성"},cursorPage:{title:"Cursor",beta:"베타",deprecated:"지원 중단",subtitle:"레거시 Cursor 설정을 위한 지원 중단된 로컬 브리지",unofficialTitle:"지원 중단된 레거시 브리지 - CLIProxy 기반 Cursor 사용 권장",unofficialItem1:"지원되는 경로: CLIProxy 기반 Cursor 인증 및 계정 관리",unofficialItem2:"이 리버스 엔지니어링된 로컬 브리지는 기존 설정용으로만 유지됩니다",unofficialItem3:"CCS는 이 레거시 경로에 대한 보증을 제공하지 않습니다",supportedPathTitle:"지원되는 경로",supportedPathDesc:"새 설정에는 CLIProxy 기반 Cursor 인증 및 계정 관리를 사용하십시오. 이전 로컬 데몬 흐름에 여전히 의존하는 경우에만 아래의 레거시 브리지를 유지하십시오.",startCliproxyAuth:"CLIProxy Cursor 인증 시작",openCliproxyCursor:"CLIProxy Cursor 열기",integration:"통합",authentication:"인증",daemon:"데몬",enabled:"활성화됨",disabled:"비활성화됨",expired:"만료됨",connected:"연결됨",notConnected:"연결되지 않음",running:"실행 중",stopped:"중지됨",actions:"레거시 작업",disableIntegration:"통합 비활성화",enableIntegration:"통합 활성화",autoDetectAuth:"레거시 IDE 자동 감지",manualAuthImport:"레거시 수동 가져오기",stopDaemon:"데몬 중지",startDaemon:"데몬 시작",port:"포트",configuration:"Cursor 구성",lastModified:"마지막 수정:",neverSaved:"저장된 적 없음",saving:"저장 중...",save:"저장",modelConfig:"모델 구성",settings:"설정",info:"정보",presets:"프리셋",presetsDesc:"사전 구성된 모델 매핑 적용",modelMapping:"모델 매핑",modelMappingDesc:"각 티어에 사용할 모델 구성",defaultModel:"기본 모델",defaultModelDesc:"특정 티어가 요청되지 않을 때 사용됩니다.",opusModel:"Opus (가장 강력)",opusModelDesc:"복잡한 추론 및 최고 품질의 응답.",sonnetModel:"Sonnet (균형)",sonnetModelDesc:"일반 코딩 및 일상적인 채팅 워크로드.",haikuModel:"Haiku (빠름)",haikuModelDesc:"저지연 및 경량 요청 경로.",runtimeSettings:"런타임 설정",autoStartDaemon:"데몬 자동 시작",autoStartDesc:"통합이 사용될 때 Cursor 데몬 자동 시작.",ghostMode:"고스트 모드",ghostModeDesc:"원격 측정을 줄이기 위해 x-ghost-mode 요청.",provider:"프로바이더",filePath:"파일 경로",availableModels:"사용 가능한 모델",loadingModels:"모델 로드 중...",noModels:"아직 사용 가능한 모델 메타데이터가 없습니다. 데몬을 시작하고 새로 고치십시오.",default:"기본값",rawConfiguration:"원시 구성 (JSON)",manualImportTitle:"수동 Cursor 인증 가져오기",manualImportDesc:"자동 감지를 사용할 수 없는 경우 Cursor 액세스 토큰과 머신 ID를 제공하십시오.",accessToken:"액세스 토큰",accessTokenPlaceholder:"Cursor 액세스 토큰 붙여넣기",machineId:"머신 ID",machineIdPlaceholder:"32자 16진수 (하이픈 없는 UUID)",cancel:"취소",import:"가져오기",selectModel:"모델 선택",useDefaultModel:"기본 모델 사용",availableModelCount:"사용 가능한 모델 ({{count}})",invalidPort:"포트는 1에서 65535 사이의 정수여야 합니다",defaultModelRequired:"기본 모델이 필요합니다",savedConfig:"Cursor 구성 및 모델 매핑이 저장되었습니다",failedSaveConfig:"구성을 저장하지 못했습니다",modelsLoadingWait:"모델이 아직 로드 중입니다. 프리셋을 적용하기 전에 기다리십시오.",noModelsAvailable:"아직 사용 가능한 모델이 없습니다. 먼저 데몬을 시작하고 새로 고치십시오.",appliedCodexPreset:"GPT-5.3 Codex 프리셋 적용됨",appliedClaudePreset:"Claude 4.6 프리셋 적용됨",appliedGeminiPreset:"Gemini 3 프리셋 적용됨",integrationEnabled:"Cursor 통합 활성화됨",integrationDisabled:"Cursor 통합 비활성화됨",failedUpdateIntegration:"통합 상태 업데이트에 실패했습니다",credentialsImported:"Cursor 자격 증명을 가져왔습니다",autoDetectFailed:"자동 감지 실패",manualRequired:"토큰과 머신 ID가 필요합니다",manualImportFailed:"수동 가져오기 실패",failedStartDaemon:"데몬을 시작하지 못했습니다",daemonStarted:"데몬이 시작되었습니다",daemonStartedWithPid:"데몬이 시작되었습니다 (PID: {{pid}})",failedStopDaemon:"데몬을 중지하지 못했습니다",daemonStopped:"데몬이 중지되었습니다",rawLoading:"원시 설정이 아직 로드 중입니다. 기다린 후 다시 시도하십시오.",invalidJson:"잘못된 JSON",rawSaved:"원시 설정이 저장되었습니다",rawChanged:"원시 설정이 외부에서 변경되었습니다. 새로 고침 후 다시 시도하십시오.",failedSaveRaw:"원시 설정을 저장하지 못했습니다",savedAll:"Cursor 구성이 저장되었습니다",liveProbe:"라이브 프로브",runLiveProbe:"라이브 프로브 실행",rerunLiveProbe:"라이브 프로브 다시 실행",probing:"프로브 실행 중...",probeNotRun:"프로브가 아직 실행되지 않음",probeLocalReadinessHint:"로컬 준비 검사는 통과할 수 있지만 라이브 런타임 액세스는 여전히 실패할 수 있습니다. 전체 Cursor 경로를 확인하려면 라이브 프로브를 사용하십시오.",probeStage:"단계",probeHttpStatus:"HTTP 상태",probeDuration:"기간",probeModel:"모델",probeMessage:"메시지",probeSucceeded:"프로브 성공",probeFailed:"프로브 실패",probeSaveFirst:"라이브 프로브를 실행하기 전에 Cursor 변경 사항을 저장하거나 폐기하십시오",refreshStatus:"Cursor 상태 새로 고침",refreshConfiguration:"Cursor 구성 새로 고침"},droidPage:{loadingDiagnostics:"Droid 진단 로드 중...",failedDiagnostics:"Droid 진단을 로드하지 못했습니다.",overview:"개요",byok:"BYOK",docs:"문서",runtimeInstall:"런타임 및 설치",status:"상태",detected:"감지됨",notFound:"찾을 수 없음",detectionSource:"감지 소스",binaryPath:"바이너리 경로",installDirectory:"설치 디렉터리",version:"버전",overridePath:"재정의 (CCS_DROID_PATH)",configFiles:"구성 파일",path:"경로",resolved:"해결됨",size:"크기",lastModified:"마지막 수정",parseWarning:"구문 분석 경고: {{value}}",readWarning:"읽기 경고: {{value}}",warnings:"경고",byokSummary:"BYOK 요약",activeModelSelector:"활성 모델 선택기",customModels:"사용자 정의 모델",ccsManaged:"CCS 관리",userManaged:"사용자 관리",malformedEntries:"형식이 잘못된 항목",providers:"프로바이더",none:"없음",customModelsTitle:"사용자 정의 모델",modelName:"이름 / 모델",provider:"프로바이더",baseUrl:"Base URL",noCustomModels:"사용자 정의 모델 없음",docsAlignedNotes:"문서 정렬 노트",factoryDocs:"Factory 문서",providerFactCheckDocs:"프로바이더 팩트 체크 문서",providerValues:"프로바이더 값: {{value}}",settingsHierarchy:"설정 계층: {{value}}",settingsTitle:"Droid BYOK 설정",fixJsonBeforeQuickSettings:"빠른 설정 컨트롤을 사용하기 전에 JSON 구문을 수정하십시오.",fixJsonBeforeReasoning:"BYOK 추론 설정을 업데이트하기 전에 JSON 구문을 수정하십시오.",unableUpdateReasoning:"선택한 BYOK 모델 추론 설정을 업데이트할 수 없습니다.",fixJsonBeforeBudget:"사고 예산을 업데이트하기 전에 JSON 구문을 수정하십시오.",anthropicOnlyBudget:"사고 예산은 Anthropic BYOK 모델에만 사용할 수 있습니다.",invalidJson:"잘못된 JSON: {{value}}",saved:"Droid 설정이 저장되었습니다",changedExternally:"Droid 설정이 외부에서 변경되었습니다. 새로 고침 후 다시 시도하십시오.",failedSave:"Droid 설정을 저장하지 못했습니다"},sharedPage:{commands:"명령",skills:"스킬",agents:"에이전트",plugins:"플러그인",settings:"설정",title:"공유 리소스",subtitle:"계정 간에 공유되는 명령, 스킬, 에이전트, 플러그인 및 구성",totalShared:"총 리소스",visible:"표시됨",markdownDetail:"마크다운 상세 보기",registryDetail:"레지스트리 상세 보기",maskedSettingsDetail:"마스킹된 설정 보기",filterPrefix:"필터:",configurationRequired:"구성이 필요합니다",countsUnavailable:"개수 사용 불가",retryCounts:"개수 재시도",filterPlaceholder:"이름, 설명 또는 경로로 {{tab}} 필터링",showing:"총 {{total}}개 {{tab}} 중 {{visible}}개 표시",showingQuery:' "{{query}}"에 대해',refreshing:" (새로 고침 중...)",loadingShared:"공유 {{tab}} 로드 중...",failedLoadShared:"공유 {{tab}}을(를) 로드하지 못했습니다",retry:"재시도",noSharedFound:"공유 {{tab}}을(를) 찾을 수 없습니다. `ccs sync`를 실행하거나 공유 디렉터리에 항목을 추가하십시오.",noPluginsFound:"설치된 공유 플러그인이 없습니다. 실제 플러그인이 있을 때까지 플러그인 레지스트리 파일과 캐시 폴더는 숨겨집니다.",noMatch:'"{{query}}"과(와) 일치하는 {{tab}}이(가) 없습니다.',selectOne:"전체 내용을 보려면 {{tab}}을(를) 선택하십시오.",pathLabel:"경로",resolvedSource:"해결된 소스",loadingMarkdown:"마크다운 콘텐츠 로드 중...",loadingSettings:"설정 콘텐츠 로드 중...",failedLoadContent:"콘텐츠를 로드하지 못했습니다",retryContent:"콘텐츠 재시도",noMarkdown:"사용 가능한 마크다운 콘텐츠가 없습니다.",settingsTitle:"settings.json",settingsDescription:"이 파일에는 모든 공유 모드 계정 간에 연결된 공유 설정이 포함되어 있습니다.",settingsPath:"공유 설정 경로",settingsActive:"활성",settingsInactive:"찾을 수 없음",resourcePolicies:"리소스 정책",resourcePoliciesDescription:"공유로 표시된 계정은 이 허브를 상속합니다. 프로필 로컬 계정은 별도의 명령, 스킬, 에이전트, 플러그인 및 설정을 유지합니다.",sharedAccounts:"공유 {{count}}개",profileLocalAccounts:"프로필 로컬 {{count}}개",moreProfileLocalAccounts:"+{{count}}개 더"},editAccountSharedResources:{title:"공유 리소스 편집",description:'"{{name}}"이(가) CCS 공유 디렉터리에서 명령, 스킬 및 설정을 상속하는 방법을 구성합니다.',resourceMode:"리소스 모드",selectResourceMode:"리소스 모드 선택",sharedOption:"공유",sharedHint:"공유 디렉터리에서 명령, 스킬, 에이전트를 상속합니다.",profileLocalOption:"프로필 로컬",profileLocalHint:"계정의 비공개 디렉터리에서 격리된 리소스를 사용합니다.",implicationTitle:"의미",sharedImplication:"이 계정은 공유 리소스 허브의 모든 도구와 구성을 볼 수 있습니다.",profileLocalImplication:"이 계정은 공유 도구를 볼 수 없습니다. 보안 또는 테스트를 위해 완전히 격리된 상태로 유지됩니다.",cancel:"취소",save:"저장",saving:"저장 중..."},heroSection:{title:"CCS Config",subtitle:"Claude Code Switch 대시보드"},hubFooter:{logs:"로그",settings:"설정",github:"GitHub",copyright:"© {{year}} kaitranntt"},themeToggle:{srLabel:"테마 전환"},ccsLogo:{alt:"CCS 로고",text:"CCS Config"},claudekitBadge:{title:"ClaudeKit 프레임워크 기반",alt:"ClaudeKit",poweredBy:"Powered by",claudekit:"ClaudeKit"},codeEditor:{revealSensitive:"민감한 값 표시",maskSensitive:"민감한 값 마스킹",valid:"유효한 {{language}}",readOnly:"(읽기 전용)"},commandBuilder:{title:"명령 빌더",searchPlaceholder:"명령을 입력하거나 선택...",copy:"복사",run:"실행",cmdConfig:"구성 인터페이스 열기",cmdCreateProfile:"새 프로필 생성",cmdSwitchProfile:"프로필로 전환",cmdDoctor:"시스템 헬스 확인",cmdListProviders:"사용 가능한 CLIProxy 프로바이더 나열",cmdAddProvider:"CLIProxy 프로바이더 추가"},confirmDialog:{confirm:"확인",cancel:"취소"},connectionIndicator:{connected:"연결됨",connecting:"연결 중...",disconnected:"연결 끊김",reconnecting:"재연결 중..."},docsLink:{title:"문서 보기"},githubLink:{title:"GitHub에서 이슈 보고"},globalEnvIndicator:{injectedCount_one:"런타임에 글로벌 환경 변수 {{count}}개가 주입됩니다",injectedCount_other:"런타임에 글로벌 환경 변수 {{count}}개가 주입됩니다",overriddenCount:"(프로필에 의해 {{count}}개 재정의됨)",skippedLabel:"건너뜀 (프로필이 이미 정의함):",configureInSettings:"설정에서 구성"},localhostDisclaimer:{remoteReadonlyAuthDisabledLong:"이 CCS 인스턴스의 대시보드 인증이 현재 비활성화되어 있기 때문에 원격 대시보드 액세스는 읽기 전용입니다. CCS 호스트에서 다시 활성화하십시오. Docker 배포는 실행 중인 컨테이너 내부에서 수행해야 합니다.",remoteReadonlyAuthDisabledShort:"이 CCS 인스턴스에 대시보드 인증이 다시 활성화될 때까지 원격 대시보드는 읽기 전용입니다.",remoteReadonlySetupLong:"이 CCS 인스턴스에 대해 ccs config auth setup을 실행할 때까지 원격 대시보드 액세스는 읽기 전용입니다. Docker 배포는 컨테이너 내부에서 실행해야 합니다.",remoteReadonlySetupShort:"이 CCS 인스턴스에 인증이 구성될 때까지 원격 대시보드는 읽기 전용입니다.",localLong:"이 대시보드는 로컬에서 실행됩니다. 모든 데이터는 사용자의 머신에 머무릅니다.",localShort:"로컬 대시보드 - 데이터는 디바이스에 머무릅니다.",dismiss:"면책 조항 해제"},privacyToggle:{modeOn:"개인 정보 보호 모드 켜짐 - 데이터를 표시하려면 클릭",modeOff:"개인 정보 보호 모드 꺼짐 - 데이터를 숨기려면 클릭"},projectSelectionDialog:{title:"Google Cloud 프로젝트 선택",description:"{{provider}} 인증에 사용할 프로젝트를 선택하십시오.",autoSelectCountdown:"({{count}}초 후 기본값 자동 선택)",default:"기본값",allProjects:"모든 프로젝트",allProjectsDescription:"나열된 모든 프로젝트 {{count}}개 온보딩",useDefault:"기본값 사용",selecting:"선택 중...",confirmSelection:"선택 확인",codeCopied:"코드 복사됨",copyVerificationCode:"검증 코드 복사"},quickCommands:{title:"빠른 명령",startDefault:"기본값 시작",startDefaultDesc:"기본 프로필로 Claude 실행",glmProfile:"GLM 프로필",glmProfileDesc:"GLM 모델로 전환",healthCheck:"헬스 체크",healthCheckDesc:"시스템 진단 실행",delegateTask:"작업 위임",delegateTaskDesc:"GLM 프로필에 위임"},quotaTooltip:{loadingQuota:"쿼터 로드 중...",failedLoadQuota:"쿼터를 로드하지 못했습니다",modelQuotas:"모델 쿼터:",rateLimits:"속도 제한:",plan:"플랜: {{plan}}",quotaSnapshots:"쿼터 스냅샷:",unlimited:"무제한",remaining:"{{remaining}}/{{entitlement}} 남음",tier:"티어",tierId:"티어 ID",state:"상태",credits:"크레딧",modelQuotasLower:"모델 쿼터:",allBucketsReport:"모든 버킷이 {{tokenType}} 보고",requestsRemaining:"요청 {{count}}개 남음",inputTokensRemaining:"입력 토큰 {{count}}개 남음",outputTokensRemaining:"출력 토큰 {{count}}개 남음",amountRemaining:"{{count}} 남음",fiveHourLimit:"5시간 사용 한도",weeklyLimit:"주간 사용 한도",weeklyOpus:"주간 사용 (Opus)",weeklySonnet:"주간 사용 (Sonnet)",weeklyOAuthApps:"주간 사용 (OAuth 앱)",weeklyCowork:"주간 사용 (Cowork)",extraUsage:"추가 사용량",premiumInteractions:"프리미엄 상호 작용",chat:"채팅",completions:"완료",resets:"{{time}}에 재설정",fiveHourResets:"{{time}}에 5시간 재설정",weeklyResets:"{{time}}에 주간 재설정"},utils:{codeReview5h:"코드 리뷰 (5시간)",codeReviewWeekly:"코드 리뷰 (주간)",codeReview:"코드 리뷰",codexAdditional5h:"{{name}} (5시간)",codexAdditionalWeekly:"{{name}} (주간)",codexAdditional:"{{name}}"},sponsorButton:{title:"GitHub에서 이 프로젝트 후원",sponsor:"후원"},valueMetrics:{apiCostSaved:"절약된 API 비용",tokensSaved:"절약된 토큰",queriesFaster:"쿼리 가속",errorsReduced:"오류 감소",vsLastMonth:"지난 달 대비",throughCaching:"캐싱을 통해",averageSpeedup:"평균 가속",withRetryLogic:"재시도 로직 포함",performanceMetrics:"성능 지표",monthlySummary:"월간 요약",totalSaved:"총 절약",tokensProcessed:"처리된 토큰",queriesHandled:"처리된 쿼리",uptime:"가동 시간"},updatesSpotlight:{openUpdatesCenter:"업데이트 센터 열기"},deviceCodeDialog:{authorize:"{{provider}} 인증",enterCodeAtPage:"인증 페이지에서 아래 코드를 입력하십시오.",expiresIn:"({{time}} 후 만료)",codeExpired:"(코드 만료됨)",copied:"복사됨!",copyCode:"코드 복사",waitingForAuth:"인증 대기 중...",openVerificationPage:"검증 페이지 열기",openProviderPage:"{{provider}} 열기",copyCodeAria:"검증 코드 복사",codeCopiedAria:"코드 복사됨"},settingsDialog:{editProfile:"프로필 편집: {{name}}",description:"이 프로필의 환경 변수 및 설정을 구성합니다.",loadingSettings:"설정 로드 중...",envTab:"환경 변수",rawJsonTab:"원시 JSON",generalTab:"일반",noEnvVars:"구성된 환경 변수가 없습니다.",noEnvVarsHint:"settings.json 파일에 변수를 추가하십시오.",loadingEditor:"편집기 로드 중...",profileInfo:"프로필 정보",profileInfoDesc:"이 구성 파일에 대한 세부 정보.",path:"경로",lastModified:"마지막 수정",cancel:"취소",saving:"저장 중...",saveChanges:"변경 사항 저장",conflictTitle:"파일이 외부에서 수정됨",conflictDesc:"이 설정 파일이 다른 프로세스에 의해 수정되었습니다. 변경 사항으로 덮어쓰시겠습니까, 폐기하시겠습니까?",overwrite:"덮어쓰기",invalidJson:"잘못된 JSON",failedSave:"저장 실패"},setupWizard:{title:"고급 변형 설정",stepProviderDesc:"런타임 변형을 위한 프로바이더 선택",stepAuthDesc:"프로바이더로 인증",stepAccountDesc:"사용할 계정 선택",stepVariantDesc:"선택 사항: 사용자 정의 런타임 변형 생성",stepSuccessDesc:"설정 완료!",authStep:{authenticateWith:"계정을 추가하려면 {{provider}}로 인증하십시오",authenticating:"인증 중...",authenticateInBrowser:"브라우저에서 인증",completeOAuth:"브라우저에서 OAuth 흐름을 완료하십시오...",orUseTerminal:"또는 터미널 사용",runCommandHint:"터미널에서 이 명령을 실행하십시오:",back:"뒤로",checking:"확인 중...",refreshStatus:"상태 새로 고침"},accountStep:{selectAccount:"계정 선택 ({{count}})",defaultAccount:"기본 계정",or:"또는",addNewAccount:"새 계정 추가",addNewAccountDesc:"다른 계정으로 인증",back:"뒤로"},variantStep:{back:"뒤로",skip:"건너뛰기"},successStep:{title:"변형이 생성되었습니다!",subtitle:"사용자 정의 변형을 사용할 준비가 되었습니다",usage:"사용법:",done:"완료"}},accountSurfaceCard:{business:"비즈",free:"무료",personal:"개인",variant:"변형"},accountIdentity:{business:"비즈니스",personal:"개인",free:"무료",team:"팀",plus:"Plus",pro:"Pro",workspace:"워크스페이스 {{id}}"},accountCardStats:{notUsedYet:"아직 사용되지 않음"},accountQuotaPanel:{weekly:"주간",loadingQuota:"쿼터 로드 중..."},userMenu:{signedInAs:"{{username}}(으)로 로그인됨"},authMonitorLive:{live:"실시간",accountMonitor:"계정 모니터",updated:"업데이트됨 {{time}}",updatedNow:"방금 업데이트됨",requestsLabel:"요청",stats:"통계",successRate:"성공률",missingProjectId:"프로젝트 ID 누락",noActivity:"활동 없음"},providerCard:{missingProjectIdAria:"프로젝트 ID 누락"},loginPage:{showPassword:"비밀번호 표시",hidePassword:"비밀번호 숨기기"},cliproxyStatsOverview:{sessionStatistics:"세션 통계",realTimeMetrics:"{{backend}}의 실시간 사용 지표",offline:"오프라인",running:"실행 중",noActiveSession:"활성 세션 없음",noActiveSessionHint:"실시간 통계를 보려면 ccs gemini, ccs codex 또는 ccs agy를 사용하여 CLIProxy 세션을 시작하십시오.",failedLoadStats:"통계를 로드하지 못했습니다",totalRequests:"총 요청",successCount:"성공 {{count}}개",successRate:"성공률",totalTokens:"총 토큰",estimatedCost:"~${{cost}} 추정",modelsUsed:"사용된 모델",modelUsageDistribution:"모델 사용 분포",requestCount:"요청 {{count}}개"},cliproxyTable:{name:"이름",provider:"프로바이더",model:"모델",account:"계정",status:"상태",default:"기본값",actions:"작업"},cliproxyTabs:{overview:"개요",variants:"변형",aiProviders:"AI 프로바이더",controlPanel:"제어판"},cliproxyHeader:{ccsLevelAccountManagement:"CCS 레벨 계정 관리",cliproxyNotAvailable:"CLIProxy를 사용할 수 없음",cliproxyControlPanel:"CLIProxy 제어판",noVariants:"CLIProxy 변형을 찾을 수 없습니다.",addAccountToStart:"시작하려면 계정을 추가하십시오"},routingGuidance:{roundRobin:"라운드 로빈은 사용량을 분산합니다.",fillFirst:"먼저 채우기는 필요할 때까지 백업 계정을 차갑게 유지합니다.",routingStrategy:"라우팅 전략",optionalRouting:"선택적 라우팅",sessionAffinity:"세션 어피니티",sessionAffinityOn:"켜짐",sessionAffinityOff:"꺼짐",sessionAffinityEnabled:"활성화됨",sessionAffinityDisabled:"비활성화됨",enableSessionAffinity:"세션 어피니티 활성화",disableSessionAffinity:"세션 어피니티 비활성화",sessionAffinityUnavailable:"세션 어피니티 사용 불가",localOnly:"로컬 전용",localOnlySetting:"로컬 전용 설정",ttlBadge:"TTL {{ttl}}",sessionAffinityDescription:"가능한 경우 한 대화를 동일한 계정에 고정합니다. CLIProxy는 클라이언트가 보낼 때 명시적 세션 또는 스레드 식별자를 선호한 다음, 안정적인 키를 추론해야 할 때 요청 메타데이터 또는 시작 프롬프트 기록으로 폴백합니다.",sessionRecognitionTitle:"세션 인식",sessionRecognitionDescription:"CCS는 여기서 보편적인 우선순위를 약속하지 않습니다. 실제로 업스트림 백엔드는 명시적 세션 또는 스레드 ID를 먼저 선호한 다음, 메타데이터 필드로 폴백하고 최종적으로 시작 프롬프트 기록 기반 해시로 폴백합니다."},extendedContext:{extendedContext:"확장 컨텍스트"},cliproxyConfig:{unsavedChanges:"저장되지 않은 변경 사항",original:"원본",modified:"수정됨",reviewChanges:"변경 사항 검토",loadingEditor:"편집기 로드 중..."},providerEditor:{provider:"프로바이더",filePath:"파일 경로",lastModified:"마지막 수정",defaultTarget:"기본 대상",quickUsage:"빠른 사용",modelMapping:"모델 매핑",status:"상태",loadingSettings:"설정 로드 중...",loadingEditor:"편집기 로드 중...",accounts:"계정",addAccount:"계정 추가",noAccountsConnected:"연결된 계정 없음",addAccountToStart:"시작하려면 계정을 추가하십시오",gcpProjectIdReadonly:"GCP 프로젝트 ID (읽기 전용)",projectIdNA:"프로젝트 ID: N/A",missingProjectId:"프로젝트 ID 누락",missingProjectIdHint:"이로 인해 오류가 발생할 수 있습니다. 프로젝트 ID를 가져오려면 계정을 제거하고 다시 추가하십시오.",useIncognito:"시크릿 사용",aliases:"별칭",current:"현재",currentValue:"현재 값",composite:"복합",defaultLabel:"기본값",requiredSetup:"필수 설정",connectorName:"커넥터 이름",proxyUrl:"프록시 URL",proxyUrlSet:"프록시 URL 설정됨",excludedModels:"제외된 모델",headers:"헤더",secret:"시크릿",prefix:"접두사",modelMappings:"모델 매핑",baseUri:"Base URL",apiKeys:"API 키",presets:"사전 구성된 모델 매핑 적용",createVariant:"CLIProxy 변형 생성",agyDenylist:"Antigravity 거부 목록: Claude Opus 4.5 및 Claude Sonnet 4.5는 지원 중단되었습니다."},providerEditorAccountItem:{modelsUsed:"사용된 모델"},bulkActionBar:{applyPreset:"프리셋 적용"},modelConfigSection:{defaultModel:"기본 모델"},rawEditorSection:{rawConfig:"원시 구성"},providerEditorHeader:{connectorName:"커넥터 이름"},aiProvidersFamilyRail:{current:"현재"},aiProvidersEntryCard:{apiKeys:"API 키"},aiProvidersEntryDialog:{connectorName:"커넥터 이름",baseUri:"Base URL",proxyUrl:"프록시 URL",secret:"시크릿",prefix:"접두사",excludedModels:"제외된 모델",headers:"헤더",modelMappings:"모델 매핑",requiredSetup:"필수 설정",optionalRouting:"선택적 라우팅"},codex:{controlCenter:"제어 센터",overview:"개요",docs:"문서",nativeCodexRuntime:"네이티브 Codex 런타임",ccsCodexProvider:"Cliproxy 단축키 / 관리 브리지",codexDocs:"Codex 문서",howCodexWorks:"CCS에서 Codex 작동 방식",supportedFlows:"지원되는 흐름",twoSupportedPaths:"지원되는 두 가지 경로:",nativeLabel:"네이티브:",nativeDesc:"Codex는 CCS v1의 일급 런타임 전용 대상입니다.",nativeConfigLabel:"네이티브 구성:",nativeConfigDesc:"ccs-codex 및 ccsx는 저장된 기본값으로 네이티브 Codex를 시작합니다.",transientOverridesLabel:"일시적 재정의:",transientOverridesDesc:"ccsxp는 네이티브 Codex에 머물면서 cliproxy 프로바이더 재정의를 앞에 추가합니다; ccs codex --target codex는 명시적 CCS 관리 브리지로 유지됩니다.",cliproxyDefaultLabel:"CLIProxy 기본값:",cliproxyDefaultDesc:'단순한 codex가 CLIProxy를 사용하도록 하려면, model_provider = "cliproxy"로 설정하고 아래 레시피를 추가하십시오.',ccsBridge:"CCS 브리지",apiProfilesDefault:"API 프로필은 계속 Claude 또는 Droid를 기본으로 합니다.",runtimeInstall:"런타임 설치",detected:"감지됨",notFound:"찾을 수 없음",detectionSource:"감지 소스",binaryPath:"바이너리 경로",installDirectory:"설치 디렉터리",versionLabel:"버전",nativeAliases:"네이티브 별칭",ccsProviderShortcut:"Cliproxy 단축키",configOverrideSupport:"--config 재정의 지원",available:"사용 가능",missing:"없음",cliproxyNativeCodex:"CLIProxy 기반 네이티브 Codex",builtInLabel:"내장:",builtInCcsxpDesc:"cliproxy 프로바이더 단축키를 사용하는 네이티브 Codex에는 ccsxp를 사용하십시오.",managedBridgeLabel:"관리 브리지:",managedBridgeDesc:"더 엄격한 CCS 관리 라우트를 명시적으로 원할 때 ccs codex --target codex를 사용하십시오.",nativeRecipeLabel:"네이티브:",nativeRecipeDesc:"codex로 CLIProxy를 직접 사용하려면 아래 레시피를 구성하십시오.",saveProviderNamedCliproxy:"위의 base URL과 환경 변수 키로 cliproxy라는 이름의 프로바이더를 저장하십시오.",inTopLevelSetDefault:"최상위 설정에서 기본 프로바이더를 cliproxy로 설정하십시오.",exportCliproxyApiKey:"네이티브 Codex를 시작하기 전에 셸에서 CLIPROXY_API_KEY를 내보내십시오.",noConfigOverrides:"이 Codex 빌드는 여전히 일반 네이티브 경로를 사용할 수 있지만, 감지된 Codex 바이너리가 --config 재정의를 노출할 때까지 ccsxp 및 명시적 CCS 관리 Codex 브리지는 사용할 수 없습니다.",configFile:"구성 파일",path:"경로",resolved:"해결됨",size:"크기",lastModified:"마지막 수정",tomlWarning:"TOML 경고",readWarning:"읽기 경고",currentUserLayerSummary:"현재 사용자 레이어 요약",activeProfile:"활성 프로필",notSet:"설정되지 않음",providersCount:"프로바이더: {{count}}",profilesCount:"프로필: {{count}}",enabledFeaturesCount:"활성화된 기능: {{count}}",mcpServersCount:"MCP 서버: {{count}}",userLayerKeysPresent:"사용자 레이어 키 존재",recommendedSetupFlow:"권장 설정 흐름",fastestPath:"가장 빠른 경로",officialChannels:"공식 채널",codexCli:"Codex CLI",openNativeCodex:"네이티브 Codex 열기",runBuiltInCodex:"cliproxy 단축키로 네이티브 Codex 실행",runBuiltInCodexExplicit:"CCS 관리 Codex 브리지를 명시적으로 실행",openCodexDashboard:"Codex 대시보드 열기",nativeShortAlias:"네이티브 짧은 별칭",ccsCodexShortcut:"Cliproxy 단축키",explicitProviderRoute:"관리 브리지 라우트",status:"상태",profiles:"프로필",createNewProfile:"새 프로필 생성",createNewProvider:"새 프로바이더 생성",createNewMcpServer:"새 MCP 서버 생성",defaultProvider:"기본 프로바이더",useDefault:"기본값 사용",useGlobalProvider:"글로벌 프로바이더 사용",useProviderDefault:"프로바이더 기본값 사용",quickFillWarning:"빠른 채우기 전용. 저장하기 전에 검토하십시오.",thisFileUpstreamOwned:"이 파일은 Codex CLI에 의해 업스트림 소유됩니다.",notes:"노트",approvalPolicy:"승인 정책",sandboxMode:"샌드박스 모드",reasoningEffort:"추론 강도",useGlobalEffort:"글로벌 강도 사용",reasoningEffortCapitalized:"추론 강도",thinkingBudgetTokens:"사고 예산 토큰",modelContextWindow:"모델 컨텍스트 윈도우",autoCompactTokenLimit:"자동 압축 토큰 한도",toolOutputTokenLimit:"도구 출력 토큰 한도",webSearch:"웹 검색",personality:"개성",model:"모델",rawOnly:"원시 전용",trusted:"신뢰됨",untrusted:"신뢰되지 않음",noProjectTrustEntries:"저장된 명시적 프로젝트 신뢰 항목이 없습니다.",codexNativeRecipe:"저장된 네이티브 Codex 레시피",runtimeVsProvider:"런타임 vs 프로바이더",honorsSavedNativeConfig:"저장된 네이티브 사용자 구성을 따름",usesTransientOverrides:"일시적 재정의 사용",unavailableNoConfig:"사용 불가 (Codex 빌드에 --config 지원 부족).",gptContextCap:"GPT-5.4 컨텍스트 상한",usageLimitCost:"272K 초과 사용 한도 비용",longContextOverride:"긴 컨텍스트 재정의",counts2x:"2배 카운트",normalUsageWindow:"정상 사용 윈도우",useCodexDefault:"Codex 기본값 사용",stdio:"stdio",streamableHttp:"streamable-http",responses:"responses",defaultTargetCli:"기본 대상 CLI",executionChain:"실행 체인",targetPath:"현재 대상 경로",userConfig:"사용자 구성",configYaml:"config.yaml",flow:"흐름",docsTab:"문서",yes:"예",no:"아니요",warningsTitle:"경고",features:"기능",featuresDesc:"CCS가 안전하게 관리할 수 있는 지원되는 Codex 기능 플래그를 전환합니다.",configOnlyFlags:"기존 구성 전용 플래그",configOnlyFlagsDesc:"이러한 기능 키는 이미 `config.toml`에 존재하므로 CCS는 전체 카탈로그 범위를 주장하지 않고 표시할 수 있습니다.",existing:"기존",nonBooleanForm:"비-부울 형식으로 저장되었습니다. 편집하려면 원시 TOML을 사용하십시오.",discoveredFromFile:"CCS 내장 카탈로그가 아닌 현재 파일에서 발견되었습니다.",featureMultiAgentLabel:"멀티 에이전트",featureMultiAgentDesc:"서브 에이전트 협업 도구를 활성화합니다.",featureUnifiedExecLabel:"통합 실행",featureUnifiedExecDesc:"PTY 기반 통합 실행 도구를 사용합니다.",featureShellSnapshotLabel:"셸 스냅샷",featureShellSnapshotDesc:"셸 환경 스냅샷을 재사용합니다.",featureApplyPatchLabel:"패치 적용",featureApplyPatchDesc:"자유 형식 apply_patch 편집을 활성화합니다.",featureJsReplLabel:"JS REPL",featureJsReplDesc:"Node 기반 JavaScript REPL을 활성화합니다.",featureRuntimeMetricsLabel:"런타임 메트릭",featureRuntimeMetricsDesc:"Codex 런타임 메트릭을 수집합니다.",featurePreventIdleSleepLabel:"유휴 절전 방지",featurePreventIdleSleepDesc:"활성 상태에서 머신을 깨어 있게 유지합니다.",featureFastModeLabel:"빠른 모드",featureFastModeDesc:"빠른 서비스 티어 경로를 허용합니다.",featureAppsLabel:"앱",featureAppsDesc:"ChatGPT 앱 및 커넥터 지원을 활성화합니다.",featureSmartApprovalsLabel:"스마트 승인",featureSmartApprovalsDesc:"가디언 흐름을 통해 적격 승인을 라우팅합니다.",auth:{terminalOnlyTooltip:"터미널에서 ccsx auth switch <name> 또는 ccsx auth remove <name>을 사용하세요.",terminalOnlyTooltipRich:"터미널에서 <code>ccsx auth switch &lt;name&gt;</code> 또는 <code>ccsx auth remove &lt;name&gt;</code>을 사용하세요.",activeSourceBadge:"{{source}}",statusOk:"OK",statusInvalid:"[!] 인증이 유효하지 않음",loading:"인증 프로필 로드 중...",loadError:"[!] codex-auth 프로필을 로드하지 못했습니다.",emptyRegistry:"[i] codex-auth 프로필이 없습니다. ccsx auth create <name>을 실행해 생성하세요.",emptyRegistryRich:"[i] codex-auth 프로필이 없습니다. <code>ccsx auth create &lt;name&gt;</code>을 실행해 생성하세요.",legacyCodexHome:"Codex는 기본 ~/.codex 위치를 사용합니다.",legacyCodexHomeRich:"Codex는 기본 <code>~/.codex</code> 위치를 사용합니다.",legacyMode:"[i] 활성 프로필이 없습니다. ~/.codex(레거시)를 사용 중입니다. 터미널에서 ccsx auth switch <name>을 실행해 활성화하세요.",legacyModeRich:"[i] 활성 프로필이 없습니다. <code>~/.codex</code>(레거시)를 사용 중입니다. 터미널에서 <code>ccsx auth switch &lt;name&gt;</code>을 실행해 활성화하세요.",externalCodexHome:"[i] $CODEX_HOME이 외부에서 {{path}}로 설정되었습니다. 이 세션에서는 프로필 registry를 사용하지 않습니다.",externalCodexHomeRich:"[i] <code>$CODEX_HOME</code>이 외부에서 <code>{{path}}</code>로 설정되었습니다. 이 세션에서는 프로필 registry를 사용하지 않습니다.",activeProfile:"활성 프로필:",unknownProfile:"(알 수 없음)",planLabel:"플랜:",switchAction:"전환",removeAction:"제거",sourceDefault:"기본값",sourceEnv:"$CCS_CODEX_PROFILE",sourceExplicitCodexHome:"$CODEX_HOME",col:{name:"이름",email:"이메일",plan:"플랜",lastUsed:"마지막 사용",status:"상태",actions:"작업"}}},droidSettings:{quickControls:"빠른 제어",reasoningControls:"추론 제어",thinkingBudget:"사고 예산",anthropicOnly:"Anthropic 모델만",byokCustomModels:"BYOK 사용자 정의 모델"},rawJsonSettingsEditor:{title:"원시 설정 편집기"},copilotConfigForm:{copilotConfiguration:"Copilot 구성",deprecatedModels:"지원 중단된 Copilot 모델이 감지되었습니다",failedLoadStatus:"상태를 로드하지 못했습니다",useWithClaudeCode:"GitHub Copilot 구독을 Claude Code와 함께 사용",githubCopilotControls:"GitHub Copilot이 업스트림에서 프롬프트/컨텍스트 한도를 제어합니다.",provider:"프로바이더",filePath:"파일 경로",status:"상태",enabled:"활성화됨",disabled:"비활성화됨",loadingEditor:"편집기 로드 중...",modelMapping:"모델 매핑",quickUsage:"빠른 사용",noPremiumUsage:"프리미엄 사용량 개수 없음"},copilotPresets:{gpt5Codex:"GPT-5.3 Codex",claude46:"Claude 4.6",gemini3:"Gemini 3"},healthCard:{allSystemsNominal:"모든 시스템 정상",machineChecks:"머신 검사"},analyticsCards:{cacheCost:"캐시 비용",hitRate:"적중률",inputOutputRatio:"입력/출력 비율",noCacheData:"사용 가능한 캐시 데이터가 없습니다",noModelData:"사용 가능한 모델 데이터가 없습니다",noSessionData:"사용 가능한 세션 데이터가 없습니다",noTokenData:"사용 가능한 토큰 데이터가 없습니다",totalCost:"총 비용",totalTokens:"총 토큰",usageInsights:"사용 인사이트"},dateRangeFilter:{pickADate:"날짜 선택"},logsConfig:{level:"수준",message:"메시지",source:"소스",time:"시간",proc:"프로세스",open:"열기",run:"실행",refreshEntries:"항목 새로 고침"},logsDetailPanel:{details:"상세"},logsFilters:{filters:"필터"},logsOverviewCards:{overview:"개요"},logsPageSkeleton:{loadingLogs:"로그 로드 중..."},monitoringErrorLogs:{logContent:"로그 내용"},analyticsPages:{chartsGrid:"차트",costByModel:"모델별 비용"},toasts:{profileCreated:"프로필이 성공적으로 생성되었습니다",profileUpdated:"프로필이 성공적으로 업데이트되었습니다",profileDeleted:"프로필이 성공적으로 삭제되었습니다",orphanProfilesComplete:"고아 프로필 등록이 완료되었습니다",profileCopied:"프로필이 성공적으로 복사되었습니다",profileImported:"프로필을 성공적으로 가져왔습니다",authRequired:"{{provider}} 인증이 필요합니다",authSuccess:"{{provider}} 인증 성공!",authFailed:"{{provider}} 인증 실패",deviceCodeExpired:"디바이스 코드가 만료되었습니다. 다시 시도하십시오.",codeCopied:"코드가 클립보드에 복사되었습니다",failedCopy:"코드 복사에 실패했습니다",configSaved:"구성이 성공적으로 저장되었습니다",configSaveFailed:"저장 실패: {{error}}",invalidYaml:"잘못된 YAML을 저장할 수 없습니다",configUpdatedExternally:"구성이 외부에서 업데이트되었습니다",settingsFileUpdated:"설정 파일이 업데이트되었습니다",accountsUpdated:"계정이 업데이트되었습니다",noProfilesToSync:"동기화할 프로필이 없습니다",syncFailed:"동기화 실패: {{error}}",sessionAffinityUpdated:"세션 어피니티 {{state}}.",providerAuthSuccess:"{{provider}} 인증 성공",providerDeviceCodeInCallback:"프로바이더가 콜백 모드에서 디바이스 코드 흐름을 반환했습니다",providerAuthTimeout:"인증 시간이 초과되었습니다. 다시 시도하십시오.",providerAccountRegistrationFailed:"인증된 계정을 등록할 수 없습니다",providerLostStatusEndpoint:"인증 상태 엔드포인트와의 연결이 끊겼습니다",providerUnknown:"알 수 없는 프로바이더: {{provider}}",providerStartOAuthFailed:"OAuth 시작에 실패했습니다",providerCallbackFailed:"콜백 제출에 실패했습니다",providerSubmitCallbackFailed:"콜백 제출에 실패했습니다",loggingConfigSaved:"로깅 구성이 저장되었습니다.",loggingConfigSaveFailed:"로깅 구성을 저장하지 못했습니다.",unifiedConfigUpdated:"구성이 성공적으로 업데이트되었습니다",migrationPreviewComplete:"마이그레이션 미리보기가 완료되었습니다",migrationComplete:"마이그레이션이 성공적으로 완료되었습니다",migrationFailed:"마이그레이션 실패",rollbackComplete:"롤백이 성공적으로 완료되었습니다",rollbackFailed:"롤백 실패",defaultAccountSet:'기본 계정이 "{{name}}"(으)로 설정되었습니다',defaultAccountReset:"기본 계정이 CCS로 재설정되었습니다",accountDeleted:'"{{name}}" 계정이 삭제되었습니다',contextUpdated:'"{{name}}" 컨텍스트가 {{summary}}(으)로 업데이트되었습니다',legacyConfirmError:'"{{name}}" 계정에 명시적 확인이 필요합니다. 이 계정에서 기록 동기화 편집을 사용하십시오.',legacyConfirmFailed:'레거시 계정 "{{name}}" 확인 실패: {{error}}',legacyConfirmSuccess_one:"레거시 계정 {{count}}개 확인됨",legacyConfirmSuccess_other:"레거시 계정 {{count}}개 확인됨",legacyConfirmPartial:"레거시 계정 {{updated}}개를 확인했지만 {{failed}}개의 업데이트가 실패했습니다. 계정 상태를 새로 고쳤습니다.",legacyConfirmAllFailed:"레거시 계정 {{failed}}개를 확인하지 못했습니다. 계정 상태를 새로 고쳤습니다.",noLegacyAccounts:"확인이 필요한 레거시 계정이 없습니다",routingStrategySet:"라우팅 전략이 {{strategy}}(으)로 설정되었습니다",variantCreated:"변형이 성공적으로 생성되었습니다",variantUpdated:"변형이 성공적으로 업데이트되었습니다",variantDeleted:"변형이 성공적으로 삭제되었습니다",defaultAccountUpdated:"기본 계정이 업데이트되었습니다",accountRemoved:"계정이 제거되었습니다",accountPaused:"계정이 일시 중지되었습니다",accountResumed:"계정이 재개되었습니다",accountAdded:"{{provider}}에 대한 계정이 추가되었습니다",kiroImported:"Kiro 계정을 가져왔습니다: {{name}}",kiroTokenImported:"Kiro 토큰을 가져왔습니다",modelUpdated:"모델이 업데이트되었습니다",presetSaved:'프리셋 "{{name}}"이(가) 저장되었습니다',presetDeleted:"프리셋이 삭제되었습니다",cliproxyAlreadyRunning:"CLIProxy가 이미 실행 중이었습니다",cliproxyStarted:"CLIProxy가 성공적으로 시작되었습니다",cliproxyStartFailed:"CLIProxy 시작에 실패했습니다",cliproxyStopped:"CLIProxy가 중지되었습니다",cliproxyStopFailed:"CLIProxy 중지에 실패했습니다",presetApplied:'"{{name}}" 프리셋이 적용되었습니다',presetAppliedCustom:"사용자 정의 프리셋이 적용되었습니다",settingsSavedWithAdjustments:"모델 조정과 함께 설정이 저장되었습니다",settingsSaved:"설정이 저장되었습니다",failedSaveSettings:"설정을 저장하지 못했습니다",codexRefreshFailed:"Codex 스냅샷을 새로 고치지 못했습니다. 원시 편집은 유지되었습니다.",codexRefreshError:"Codex 스냅샷을 새로 고치지 못했습니다.",codexFixToml:"저장하기 전에 TOML을 수정하십시오.",codexSaved:"Codex config.toml이 저장되었습니다.",codexChangedExternally:"config.toml이 외부에서 변경되었습니다. 새로 고침 후 다시 시도하십시오.",codexSaveFailed:"Codex config.toml을 저장하지 못했습니다.",codexUpdateFailed:"Codex 구성을 업데이트하지 못했습니다.",noOrphanProfiles:"고아 프로필 설정을 찾을 수 없습니다",profilesRegistered:"프로필 {{count}}개 등록됨{{skipped}}",destinationEmpty:"대상 프로필 이름은 비어 있을 수 없습니다",profileExportDownloaded:"프로필 내보내기가 다운로드되었습니다",profileImportFailed:"프로필 번들을 가져오지 못했습니다"},providerConfig:{defaultDeviceCodeInstruction:"브라우저에서 인증을 완료하십시오.",trackLabel:"트랙",sectionCoreLabel:"코어 / 원래 백엔드",sectionCoreHint:"기본, 항상 사용 가능한 프로바이더 트랙",sectionPlusLabel:"Plus 추가 / 커뮤니티 유지 관리",sectionPlusHint:"여전히 지원되지만 현재 기본 백엔드에서 분리됨",plusTrackNote:"해당 트랙이 커뮤니티가 유지 관리하는 동안 선택적 Plus 백엔드가 필요합니다."},profileEditorSections:{imageAnalysis:"이미지 분석",loadingImageSettings:"이미지 설정 로드 중...",skipPermissionPrompts:"시작 시 권한 프롬프트 건너뛰기",useNativeImageReading:"네이티브 이미지 읽기 사용",skipTransformer:"트랜스포머 건너뛰기",friendlyUi:"친숙한 UI",info:"정보"},imageAnalysisStatus:{sectionTitle:"이미지",openSettings:"설정 열기",useNativeImageReading:"네이티브 이미지 읽기 사용",refreshingPreview:"미리보기 새로 고침 중",savedStatus:"저장된 상태",livePreview:"실시간 미리보기",disabledGlobally:"전역적으로 비활성화됨",targetBypassesHook:"{{target}}이(가) 후크를 우회합니다",nativeImageReading:"네이티브 이미지 읽기",setupNeeded:"설정 필요",needsAuth:"인증 필요",needsProxy:"프록시 필요",nativeFallback:"네이티브 폴백",transformerReady:"트랜스포머 준비됨",badgeDisabled:"비활성화됨",badgeBypassed:"우회됨",badgeNative:"네이티브",badgeSetup:"설정",badgeAuth:"인증",badgeProxy:"프록시",badgeReady:"준비됨",capabilityVerified:"확인됨",capabilityUnknown:"알 수 없음",toggleSummaryNativeCapable:"{{model}}이(가) 이미지를 지원하는 것으로 보입니다. CCS는 여기서 트랜스포머를 우회합니다.",toggleSummaryNativeModel:"CCS는 {{model}}에 대해 네이티브 읽기를 선호합니다.",toggleSummaryNativeDefault:"CCS는 이 프로필에 대해 네이티브 이미지 읽기를 선호합니다.",toggleSummaryNativeFileAccess:"이 프로필은 현재 네이티브 파일 액세스를 유지합니다.",toggleSummaryInactiveTarget:"{{target}}이(가) 선택된 동안 저장된 Claude 측 이미지 라우팅이 비활성 상태입니다.",toggleSummaryTransformerRoute:"트랜스포머 라우트: {{backend}}{{modelSuffix}}.",noteDisabledGlobally:"CCS 설정에서 이미지가 전역적으로 비활성화되어 있습니다.",noteTargetBypassesHook:"현재 대상 {{target}}이(가) Claude Read 후크를 우회합니다.",notePersistHook:"여기서 트랜스포머 라우팅이 실행되기 전에 프로필 후크를 유지하십시오.",targetLabel:{claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"}},openrouterBadge:{new:"신규",integration:"OpenRouter 통합"},openrouterBanner:{accessModels:"OpenRouter를 통해 {{count}}+ 모델 액세스",add:"추가"},openrouterModelPicker:{searchModels:"모델 검색",newestModels:"최신 모델"},openrouterPromoCard:{title:"OpenRouter",description:"하나의 API 엔드포인트에서 수백 개의 모델에 액세스하십시오."},profileCard:{profile:"프로필",openRouter:"OpenRouter 프로필",claudeCode:"Claude Code",claudeCodeDefault:"Claude Code (기본값)",factoryDroid:"Factory Droid",codexCli:"Codex CLI",ccsProfile:"CCS 프로필"},profileDeck:{profiles:"프로필",failedToLoad:"프로필 로드 실패: {{message}}",noProfiles:"구성된 프로필이 없습니다. 시작하려면 첫 번째 프로필을 생성하십시오."},profilesTable:{name:"이름",provider:"프로바이더",model:"모델",target:"대상",lastModified:"마지막 수정",actions:"작업",edit:"편집"},profileCreateDialog:{createProfile:"프로필 생성",appliedModelToTiers:'"{{model}}"을(를) 모든 모델 티어에 적용했습니다',profileCreated:'프로필 "{{name}}"이(가) 생성되었습니다',failedCreate:"프로필 생성에 실패했습니다",chooseProviderHint:"프로바이더 프리셋을 선택하거나 사용자 정의 API 엔드포인트를 구성하십시오.",basicInformation:"기본 정보",modelConfiguration:"모델 구성",usedInCli:"CLI에서 사용:",apiBaseUrl:"API Base URL",baseUrlPlaceholder:"https://api.example.com/v1",prefilledFromPreset:"{{name}}에서 미리 채워졌습니다. 필요에 따라 사용자 정의할 수 있습니다.",optionalForPreset:"{{name}}에 대해 선택 사항입니다. 네이티브 Anthropic 인증을 사용하려면 비워두십시오.",endpointHint:"OpenAI 호환 및 Anthropic 요청을 수락하는 엔드포인트",optional:"(선택)",apiKeyOptionalPlaceholder:"선택 사항 - 인증이 활성화된 경우에만",apiKeyPlaceholder:"sk-...",apiKeyOptionalHint:"로컬 엔드포인트에 인증이 활성화된 경우에만 필요합니다",defaultTargetCli:"기본 대상 CLI",modelMapping:"모델 매핑",modelMappingDesc:"Claude Code 티어 (Opus/Sonnet/Haiku)를 프로바이더가 지원하는 모델에 매핑합니다.",searchModelsPlaceholder:"검색하려면 입력하십시오 (예: opus, sonnet, gpt-4o)...",noModelsFound:'"{{query}}"에 대한 모델을 찾을 수 없습니다',loadingModels:"모델 로드 중...",defaultModel:"기본 모델",sonnetMapping:"Sonnet 매핑",opusMapping:"Opus 매핑",haikuMapping:"Haiku 매핑",sonnetMappingPlaceholder:"예: gpt-4o, claude-sonnet-4",opusMappingPlaceholder:"예: o1, claude-opus-4.5",haikuMappingPlaceholder:"예: gpt-4o-mini, claude-3.5-haiku",free:"무료"},profileDialogLegacy:{editProfile:"프로필 편집"},supportEntryCard:{actionRequired:"작업 필요"},settingsPage:{title:"설정",loading:"로드 중...",failedLoad:"설정을 로드하지 못했습니다.",tabs:{web:"웹",env:"환경 변수",think:"사고",proxy:"프록시",auth:"인증",backup:"백업",channels:"채널",imageAnalysis:"이미지"},websearchSection:{title:"웹 검색",description:"CLI 기반 웹 검색 구성."},thinkingSection:{title:"사고",description:"지원되는 모델에 대해 확장 사고/추론을 구성합니다.",directOverride:"직접 재정의",youType:"입력:",ccsAdds:"CCS 추가:",executionChain:"실행 체인",primaryBackends:"주요 백엔드",legacyCliFallbacks:"레거시 CLI 폴백",managedPayload:"관리 페이로드",sharedTargetMetadata:"공유 대상 메타데이터",ideTargetMetadata:"IDE 대상 메타데이터",ideSettingsPath:"IDE 설정 경로",ideHost:"IDE 호스트",resolvedBinding:"해결된 바인딩",bindingName:"바인딩 이름",inSync:"동기화됨",currentTargetPath:"현재 대상 경로",warnings:"경고",notes:"노트",workspacePresets:"워크스페이스 프리셋",draft:"초안",advanced:"고급",recommended:"권장 설정 흐름",configureModelFirst:"먼저 모델을 구성하십시오"},proxySection:{title:"프록시",loadingImageSettings:"이미지 설정 로드 중..."},channelsSection:{title:"공식 채널",description:"공식 릴리스 채널을 보고 관리합니다."},imageAnalysisSection:{title:"이미지 분석",description:"이미지 분석 설정을 구성합니다.",loading:"이미지 설정 로드 중..."},browserSection:{title:"브라우저",description:"CCS에서 관리되는 브라우저 자동화의 기본 설정 표면.",primaryTitle:"설정 > 브라우저는 기본 브라우저 설정 표면입니다.",primaryDescription:"여기에서 Claude Browser Attach 및 Codex Browser Tools를 구성한 다음 아래 안내를 사용하여 각 레인을 시작하거나 확인하십시오.",readiness:"준비 상태",nextStep:"다음 단계",technicalDetails:"기술 세부 정보",diagnostics:"진단",evalMode:{label:"browser_eval 액세스",options:{disabled:"비활성화됨",readonly:"읽기 전용",readwrite:"읽기/쓰기"}},actions:{saveClaude:"Claude 설정 저장",saveCodex:"Codex 설정 저장",testConnection:"연결 테스트",copyLaunchCommand:"시작 명령 복사"},messages:{statusRefreshed:"브라우저 상태가 새로 고쳐졌습니다",launchCommandCopied:"시작 명령이 복사되었습니다"},claude:{title:"Claude Browser Attach",description:"원격 디버깅이 활성화된 관리 Chrome 세션에 Claude 대상 시작을 연결합니다.",enabledLabel:"Claude Browser Attach 활성화",enabledDescription:"활성화되면, CCS는 Claude 대상 시작을 위해 관리되는 브라우저 MCP 런타임을 준비합니다.",userDataDir:"Chrome 사용자 데이터 디렉터리",userDataDirHint:"연결 모드 상태가 일상 브라우저와 격리되도록 전용 Chrome 프로필 디렉터리를 사용하십시오.",devtoolsPort:"DevTools 포트",devtoolsPortHint:"연결 모드에서 Chrome을 시작할 때 동일한 포트를 사용하십시오.",devtoolsPortInvalid:"1에서 65535 사이의 유효한 포트를 입력하십시오.",effectivePath:"유효 연결 경로",recommendedPath:"권장 경로",managedRuntime:"관리 브라우저 런타임",evalModeHint:"Claude Browser Attach에 대한 browser_eval 액세스를 제어합니다. 읽기 전용은 검사를 허용하고, 읽기/쓰기는 페이지 측 변형도 허용합니다.",overrideMessage:"{{source}}에서 현재 환경 재정의가 활성 상태입니다. 해당 재정의가 제거되면 이 대시보드가 진실의 출처로 유지됩니다.",launchGuidance:"시작 안내",launchGuidanceHint:"원격 디버깅이 활성화된 Chrome을 시작한 다음, 필요한 경우 연결 테스트를 다시 실행하십시오."},codex:{title:"Codex Browser Tools",description:"Codex 대상 시작을 위한 관리 Playwright MCP 재정의 경로를 제어합니다.",enabledLabel:"Codex Browser Tools 활성화",enabledDescription:"Codex 브라우저 도구의 일급 설정 표면으로 브라우저 페이지를 만들려면 이 기능을 켜두십시오.",serverName:"관리 서버 이름",overrideSupport:"구성 재정의 지원",overrideSupported:"지원됨",overrideUnsupported:"지원되지 않음",binary:"감지된 Codex 바이너리",notDetected:"감지되지 않음",evalModeHint:"브라우저 설정 패리티를 위해 저장되었습니다. Phase 1에서는 browser_eval 적용이 주로 Claude Browser Attach에 적용됩니다."}}},codexPage:{title:"Codex",controlCenter:"제어 센터",overview:"개요",docs:"문서",authProfiles:"인증 프로필",nativeRuntime:"네이티브 런타임",ccsProvider:"CCS 프로바이더",setup:"설정"},apiPage:{title:"API 프로필",subtitle:"API 프로필 및 엔드포인트를 관리합니다."},claudeExtensionPage:{title:"Claude 확장",subtitle:"Claude 확장 통합 설정.",claudeAuth:"Claude 인증",status:"상태",targetMetadata:"IDE 대상 메타데이터"},sharedPageV2:{title:"공유",subtitle:"공유 데이터 관리."},homePageV2:{title:"홈",logsMoved:"로그가 전용 워크스페이스로 이동되었습니다",profiles:"프로필",cliproxy:"CLIProxy",accounts:"계정",health:"헬스"},analyticsPageV2:{title:"분석",subtitle:"사용량 분석 및 인사이트."},logsPageV2:{title:"로그",subtitle:"시스템 로그를 보고 관리합니다."},healthPageV2:{title:"헬스",subtitle:"시스템 헬스 모니터링."},aiProvidersPage:{title:"AI 프로바이더",subtitle:"AI 프로바이더 구성을 관리합니다.",unableToLoad:"AI 프로바이더를 로드할 수 없습니다"}}}};re.isInitialized||re.use(AI).init({resources:BI,lng:II(),fallbackLng:"en",interpolation:{escapeValue:!1}});const HI={theme:"system",setTheme:()=>null,isDark:!1},OP=A.createContext(HI);function _I({children:n,defaultTheme:e="system",storageKey:t="vite-ui-theme"}){const[i,o]=A.useState(()=>localStorage.getItem(t)||e),[a,r]=A.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);A.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: dark)"),g=m=>{r(m.matches)};return f.addEventListener("change",g),()=>f.removeEventListener("change",g)},[]);const c=i==="dark"||i==="system"&&a;A.useEffect(()=>{const f=window.document.documentElement;f.classList.remove("light","dark"),f.classList.add(c?"dark":"light")},[c]);const d={theme:i,setTheme:f=>{localStorage.setItem(t,f),o(f)},isDark:c};return p.jsx(OP.Provider,{value:d,children:n})}const TP=A.createContext(null),Ok="ccs-privacy-mode";function UI({children:n}){const[e,t]=A.useState(()=>typeof window<"u"?localStorage.getItem(Ok)==="true":!1);A.useEffect(()=>{localStorage.setItem(Ok,String(e))},[e]);const i=A.useCallback(()=>t(a=>!a),[]),o=A.useMemo(()=>({privacyMode:e,togglePrivacyMode:i}),[e,i]);return p.jsx(TP.Provider,{value:o,children:n})}function kb(){const n=A.useContext(TP);if(!n)throw new Error("usePrivacy must be used within a PrivacyProvider");return n}const MP="blur-[4px] select-none hover:blur-none transition-all duration-200",zI="/api/auth";async function wb(n,e){const t=await fetch(`${zI}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...e});if(!t.ok){const i=await t.json().catch(()=>({error:"Unknown error"}));throw new Error(i.error||t.statusText)}return t.json()}function FI(){return wb("/check")}function qI(n,e){return wb("/login",{method:"POST",body:JSON.stringify({username:n,password:e})})}function GI(){return wb("/logout",{method:"POST"})}const NP=A.createContext(null);function KI({children:n}){const[e,t]=A.useState(!1),[i,o]=A.useState(!1),[a,r]=A.useState(null),[c,d]=A.useState(!0),[f,g]=A.useState(!1),[m,x]=A.useState(!1),[v,C]=A.useState(!1),[k,w]=A.useState("login");A.useEffect(()=>{FI().then(T=>{t(T.authRequired),o(T.authenticated),r(T.username),g(T.authEnabled),x(T.authConfigured),C(T.isLocalAccess),w(T.accessMode)}).catch(()=>{t(!0),o(!1),g(!0),x(!0),C(!1),w("login")}).finally(()=>d(!1))},[]);const D=A.useCallback(async(T,L)=>{const N=await qI(T,L);o(!0),r(N.username)},[]),O=A.useCallback(async()=>{await GI(),o(!1),r(null)},[]),M=A.useMemo(()=>({authRequired:e,isAuthenticated:i,username:a,loading:c,authEnabled:f,authConfigured:m,isLocalAccess:v,accessMode:k,login:D,logout:O}),[e,i,a,c,f,m,v,k,D,O]);return p.jsx(NP.Provider,{value:M,children:n})}function Jh(){const n=A.useContext(NP);if(!n)throw new Error("useAuth must be used within an AuthProvider");return n}function VI(){const{authRequired:n,isAuthenticated:e,loading:t}=Jh(),i=Kh();return t?p.jsx("div",{className:"flex h-screen items-center justify-center",children:p.jsx(hi,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?e?p.jsx(ey,{}):p.jsx(iP,{to:"/login",state:{from:i},replace:!0}):p.jsx(ey,{})}const im=768;function WI(){const[n,e]=A.useState(void 0);return A.useEffect(()=>{const t=window.matchMedia(`(max-width: ${im-1}px)`),i=()=>{e(window.innerWidth<im)};return t.addEventListener("change",i),e(window.innerWidth<im),()=>t.removeEventListener("change",i)},[]),!!n}const LP=A.createContext(null);function Zh(){const n=A.useContext(LP);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function q(...n){return XE(JE(n))}function Sr(n){if(!Number.isFinite(n))return"0";const e=Math.max(0,Math.min(100,n));return`${Math.round(e)}`}const Tk=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Ln={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function _9(n){let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return Tk[(e>>>0)%Tk.length]}function ay(n){if(!n)return null;try{const e=new Date(n),t=new Date,i=e.getTime()-t.getTime();if(i<=0)return"soon";const o=Math.floor(i/(1e3*60*60));if(o>=24)return e.toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});const a=Math.floor(i%(1e3*60*60)/(1e3*60));return o>0?`in ${o}h ${a}m`:`in ${a}m`}catch{return null}}function Ab(n){return n.filter(e=>{const t=(e.displayName||e.name||"").toLowerCase();return t.includes("claude")||t.includes("gpt")})}function QI(n){if(n.length===0)return null;const e=Ab(n);if(e.length===0)return 0;const t=e.map(i=>i.percentage).filter(i=>typeof i=="number"&&isFinite(i));return t.length===0?0:Math.min(...t)}function YI(n){if(n.length===0)return null;const e=Ab(n);return e.length===0?null:e.reduce((t,i)=>i.resetTime?t?new Date(i.resetTime)<new Date(t)?i.resetTime:t:i.resetTime:t,null)}const $I=/claude-(?:opus|sonnet)-4(?:[.-])5(?:-thinking)?(?=(?:$|[^a-z0-9]))/i;function U9(n){return $I.test((n||"").trim())}const XI=[{name:"claude-opus-4-6-thinking",displayName:"Claude Opus 4.6 (Thinking)"},{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function JI(n){const e=n.toLowerCase();return e.includes("claude")||e.includes("gpt")?"primary":e.includes("gemini 3")||e.includes("gemini-3")?"gemini-3":e.includes("gemini 2")||e.includes("gemini-2")?"gemini-2":"other"}function ZI(n){if(n.length===0)return[];const e=Ab(n),t=[];if(e.length===0)for(const o of XI)t.push({name:o.name,displayName:o.displayName,percentage:0,tier:"primary",exhausted:!0});for(const o of n){const a=o.displayName||o.name,r=JI(a);t.push({name:o.name,displayName:a,percentage:o.percentage,tier:r,exhausted:r==="primary"&&o.percentage===0})}const i=["primary","gemini-3","gemini-2","other"];return t.sort((o,a)=>{const r=i.indexOf(o.tier)-i.indexOf(a.tier);return r!==0?r:o.displayName.localeCompare(a.displayName)})}function ej(n){const e=new Map;for(const t of n){const i=e.get(t.tier)||[];i.push(t),e.set(t.tier,i)}return e}function kr(n){if(typeof n=="object"&&n!==null){const e=n;return e.category==="additional"&&e.cadence?e.cadence==="weekly"?"additional-weekly":"additional-5h":e.category==="code-review"&&e.cadence?e.cadence==="weekly"?"code-review-weekly":"code-review-5h":e.category==="usage"&&e.cadence?e.cadence==="weekly"?"usage-weekly":"usage-5h":Mk(e.label)}return Mk(n)}function Mk(n){const e=(n||"").toLowerCase(),t=e.includes("code review")||e.includes("code_review"),i=e.includes("primary"),o=e.includes("secondary");return t?i?"code-review-5h":o?"code-review-weekly":"code-review":i?"usage-5h":o?"usage-weekly":"unknown"}function tj(n){const e=(n||"").trim();if(!e)return"";const t=e.replace(/^GPT-[\d.]+-Codex-/i,"");return t!==e&&t.length>0?`Codex ${t}`:e}function nj(n,e){if(kr(n)==="code-review-weekly")return"weekly";const i=n.resetAfterSeconds;if(typeof i!="number"||!isFinite(i)||i<=0)return null;const o=e.find(d=>kr(d)==="usage-5h"&&typeof d.resetAfterSeconds=="number"&&isFinite(d.resetAfterSeconds)&&d.resetAfterSeconds>0),a=e.find(d=>kr(d)==="usage-weekly"&&typeof d.resetAfterSeconds=="number"&&isFinite(d.resetAfterSeconds)&&d.resetAfterSeconds>0);if(!o||!a)return null;const r=Math.abs(i-o.resetAfterSeconds);return Math.abs(i-a.resetAfterSeconds)<=r?"weekly":"5h"}function ij(n,e=[]){const t=typeof n=="string"?n:n.label,i=typeof n=="string"?{label:t,resetAfterSeconds:null}:{label:t,resetAfterSeconds:n.resetAfterSeconds,category:n.category,cadence:n.cadence,featureLabel:n.featureLabel},o=e.length>0?e:[i];switch(kr(i)){case"usage-5h":return re.t("quotaTooltip.fiveHourLimit");case"usage-weekly":return re.t("quotaTooltip.weeklyLimit");case"code-review-5h":case"code-review-weekly":case"code-review":{const a=nj(i,o);return a==="5h"?re.t("utils.codeReview5h"):a==="weekly"?re.t("utils.codeReviewWeekly"):re.t("utils.codeReview")}case"additional-5h":case"additional-weekly":{const r=tj(i.featureLabel??"")||t,c=kr(i);return c==="additional-5h"?re.t("utils.codexAdditional5h",{name:r}):c==="additional-weekly"?re.t("utils.codexAdditionalWeekly",{name:r}):re.t("utils.codexAdditional",{name:r})}case"unknown":return t}}function ef(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],additionalWindows:[],unknownWindows:[]};let e=null,t=null;const i=[],o=[],a=[],r=[];if(n.some(d=>!!d.category))for(const d of n)d.category==="usage"?(d.cadence==="5h"&&!e?e=d:d.cadence==="weekly"&&!t&&(t=d),r.push(d)):d.category==="code-review"?i.push(d):d.category==="additional"?o.push(d):(a.push(d),r.push(d));else for(const d of n)switch(kr(d.label)){case"usage-5h":e||(e=d),r.push(d);break;case"usage-weekly":t||(t=d),r.push(d);break;case"code-review-5h":case"code-review-weekly":case"code-review":i.push(d);break;case"additional-5h":case"additional-weekly":o.push(d);break;case"unknown":a.push(d),r.push(d);break}if((!e||!t)&&r.length>0){const d=r.filter(f=>typeof f.resetAfterSeconds=="number"&&f.resetAfterSeconds>=0).sort((f,g)=>(f.resetAfterSeconds||0)-(g.resetAfterSeconds||0));e||(e=d[0]||r[0]||null),t||(t=d.length>1?d[d.length-1]:r.find(f=>f!==e)||null)}return{fiveHourWindow:e,weeklyWindow:t,codeReviewWindows:i,additionalWindows:o,unknownWindows:a}}function oj(n){if(!n||n.length===0)return null;const{fiveHourWindow:e,weeklyWindow:t}=ef(n),i=[e,t].filter((r,c,d)=>!!r&&d.indexOf(r)===c),a=(i.length>0?i:n).map(r=>r.remainingPercent);return Math.min(...a)}function sj(n){if(!n||n.length===0)return null;const{fiveHourWindow:e,weeklyWindow:t}=ef(n),i=[e,t].filter((r,c,d)=>!!r&&d.indexOf(r)===c),a=(i.length>0?i:n).map(r=>r.resetAt).filter(r=>r!==null);return a.length===0?null:a.sort()[0]}function aj(n){if(!n.success)return null;const e=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(i=>!!i);if(e.length>0)return Math.min(...e.map(i=>i.remainingPercent));const t=n.windows.filter(i=>i.rateLimitType!=="overage");return t.length>0?Math.min(...t.map(i=>i.remainingPercent)):null}function rj(n){if(!n.success)return null;const e=[n.coreUsage?.fiveHour?.resetAt,n.coreUsage?.weekly?.resetAt].filter(i=>!!i);if(e.length>0)return e.sort()[0];const t=n.windows.filter(i=>i.rateLimitType!=="overage").map(i=>i.resetAt).filter(i=>i!==null);return t.length===0?null:t.sort()[0]}function lj(n){if(!n||n.length===0)return null;const e=n.map(t=>t.remainingPercent);return Math.min(...e)}function cj(n){if(!n||n.length===0)return null;const e=n.map(t=>t.resetTime).filter(t=>t!==null);return e.length===0?null:e.sort()[0]}function uj(n){if(!n)return null;const e=[n.premiumInteractions,n.chat,n.completions].filter(t=>t.reported!==!1).map(t=>t.unlimited?100:t.percentRemaining).filter(t=>typeof t=="number"&&isFinite(t));return e.length===0?null:Math.min(...e)}function Vi(n){return typeof n=="object"&&n!==null}function fa(n){return typeof n=="number"&&Number.isFinite(n)}function Pb(n){if(!Vi(n))return!1;const e=n.models;return typeof n.success=="boolean"&&Array.isArray(e)}function tf(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.windows)||!("planType"in e)?!1:e.windows.every(t=>Vi(t)&&typeof t.label=="string"&&fa(t.usedPercent)&&fa(t.remainingPercent))}function nf(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.windows)||"planType"in e?!1:e.windows.every(t=>Vi(t)&&typeof t.rateLimitType=="string"&&fa(t.remainingPercent)&&typeof t.status=="string")}function Db(n){if(!Vi(n))return!1;const e=n;return typeof e.success!="boolean"||!Array.isArray(e.buckets)?!1:e.buckets.every(t=>Vi(t)&&typeof t.id=="string"&&fa(t.remainingFraction)&&fa(t.remainingPercent)&&Array.isArray(t.modelIds))}function Ob(n){if(!Vi(n))return!1;const e=n,t=e.snapshots;return typeof e.success!="boolean"||!Vi(t)?!1:["premiumInteractions","chat","completions"].every(o=>{const a=t[o];return Vi(a)&&fa(a.percentRemaining)&&fa(a.percentUsed)})}function dj(n){const e=[];return typeof n.httpStatus=="number"&&e.push(`HTTP ${n.httpStatus}`),typeof n.errorCode=="string"&&n.errorCode.trim()&&e.push(n.errorCode.trim()),e.length>0?e.join(" | "):null}function hj(n,e,t){const i=n.errorDetail?.trim()||null;if(!i)return null;const o=i.toLowerCase();return o===e.toLowerCase()||t&&o===t.toLowerCase()?null:i}function Tb(n){if(!n||n.success)return null;const e=n.error?.trim()||"Quota information unavailable",t=n.actionHint?.trim()||null,i=n.errorCode?.trim().toLowerCase()||"",o=dj(n),a=hj(n,e,o),r=e.toLowerCase(),c="entitlement"in n?n.entitlement:void 0;return n.errorCode==="capacity_exhausted"||c?.capacityState==="capacity_exhausted"||r.includes("no capacity available")||r.includes("capacity exhausted")?{label:"Capacity",summary:e,actionHint:t||"Retry later or switch to another model. This is a temporary provider capacity issue.",technicalDetail:o,rawDetail:a,tone:"warning"}:n.needsReauth||i==="token_expired"||i==="reauth_required"||r.includes("token expired")||r.includes("re-authenticate")||r.includes("reauth")||r.includes("expired or invalid")?{label:re.t("accountCard.failureLabelReauth"),summary:e,actionHint:t||re.t("accountCard.failureHintReauth"),technicalDetail:o,rawDetail:a,tone:"warning"}:i==="deactivated_workspace"||n.httpStatus===402||r.includes("workspace deactivated")||r.includes("payment or workspace access required")?{label:re.t("accountCard.failureLabelWorkspace"),summary:e,actionHint:t||re.t("accountCard.failureHintWorkspace"),technicalDetail:o,rawDetail:a,tone:"warning"}:c?.accessState==="not_entitled"||n.isForbidden||n.httpStatus===403||i==="quota_api_forbidden"||r.includes("forbidden")?{label:re.t("accountCard.failureLabelNoAccess"),summary:e,actionHint:t||re.t("accountCard.failureHintNoAccess"),technicalDetail:o,rawDetail:a,tone:"muted"}:n.httpStatus===429||i==="rate_limited"||r.includes("rate limited")?{label:re.t("accountCard.failureLabelRetry"),summary:e,actionHint:t||re.t("accountCard.failureHintRetry"),technicalDetail:o,rawDetail:a,tone:"warning"}:i==="auth_file_missing"||i==="missing_account_id"||r.includes("auth file not found")||r.includes("missing chatgpt-account-id")?{label:re.t("accountCard.failureLabelReconnect"),summary:e,actionHint:t||re.t("accountCard.failureHintReconnect"),technicalDetail:o,rawDetail:a,tone:"muted"}:n.retryable||i==="network_timeout"||i==="network_error"||i==="provider_unavailable"||r.includes("timeout")||r.includes("network")||r.includes("fetch failed")||r.includes("service unavailable")?{label:re.t("accountCard.failureLabelTemporary"),summary:e,actionHint:t||re.t("accountCard.failureHintTemporary"),technicalDetail:o,rawDetail:a,tone:"warning"}:{label:re.t("accountCard.failureLabelUnavailable"),summary:e,actionHint:t,technicalDetail:o,rawDetail:a,tone:"muted"}}function RP(n,e){if(!e?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Pb(e)?QI(e.models):null;case"codex":return tf(e)?oj(e.windows):null;case"claude":case"anthropic":return nf(e)?aj(e):null;case"gemini":return Db(e)?lj(e.buckets):null;case"ghcp":case"github-copilot":return Ob(e)?uj(e.snapshots):null;default:return null}}function EP(n,e){if(!e?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Pb(e)?YI(e.models):null;case"codex":return tf(e)?sj(e.windows):null;case"claude":case"anthropic":return nf(e)?rj(e):null;case"gemini":return Db(e)?cj(e.buckets):null;case"ghcp":case"github-copilot":return Ob(e)?e.quotaResetDate:null;default:return null}}const Xd=$h("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function mt({className:n,variant:e,size:t,asChild:i=!1,...o}){const a=i?Gh:"button";return p.jsx(a,{"data-slot":"button",className:q(Xd({variant:e,size:t,className:n})),...o})}function ji({className:n,type:e,...t}){return p.jsx("input",{type:e,"data-slot":"input",className:q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...t})}function fj({...n}){return p.jsx(jA,{"data-slot":"sheet",...n})}function pj({...n}){return p.jsx(zA,{"data-slot":"sheet-portal",...n})}function gj({className:n,...e}){return p.jsx(FA,{"data-slot":"sheet-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function mj({className:n,children:e,side:t="right",...i}){return p.jsxs(pj,{children:[p.jsx(gj,{}),p.jsxs(BA,{"data-slot":"sheet-content",className:q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",t==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",t==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",t==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",t==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...i,children:[e,p.jsxs(HA,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[p.jsx(Gr,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yj({className:n,...e}){return p.jsx("div",{"data-slot":"sheet-header",className:q("flex flex-col gap-1.5 p-4",n),...e})}function bj({className:n,...e}){return p.jsx(_A,{"data-slot":"sheet-title",className:q("text-foreground font-semibold",n),...e})}function xj({className:n,...e}){return p.jsx(UA,{"data-slot":"sheet-description",className:q("text-muted-foreground text-sm",n),...e})}function tt({className:n,...e}){return p.jsx("div",{"data-slot":"skeleton",className:q("relative overflow-hidden bg-muted/50 before:absolute before:inset-0 before:-translate-x-full","before:bg-gradient-to-r before:from-transparent before:via-muted/30 before:to-transparent","before:animate-[shimmer_2s_infinite_ease-out] rounded-md",n),...e})}function pa({delayDuration:n=0,...e}){return p.jsx(NR,{"data-slot":"tooltip-provider",delayDuration:n,...e})}function To({...n}){return p.jsx(pa,{children:p.jsx(LR,{"data-slot":"tooltip",...n})})}function Mo({...n}){return p.jsx(RR,{"data-slot":"tooltip-trigger",...n})}function No({className:n,sideOffset:e=6,children:t,...i}){return p.jsx(ER,{children:p.jsxs(IR,{"data-slot":"tooltip-content",sideOffset:e,className:q("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit max-w-[calc(100vw-2rem)] origin-(--radix-tooltip-content-transform-origin) rounded-lg border border-border/70 bg-popover px-3 py-2 text-left text-xs leading-relaxed text-popover-foreground shadow-xl shadow-black/10",n),...i,children:[t,p.jsx(jR,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 fill-popover stroke-border stroke-[0.75px]"})]})})}const vj="sidebar_state",Cj=3600*24*7,Sj="16rem",kj="18rem",wj="3rem",Aj="b";function Pj({defaultOpen:n=!0,open:e,onOpenChange:t,className:i,style:o,children:a,...r}){const c=WI(),[d,f]=A.useState(!1),[g,m]=A.useState(n),x=e??g,v=A.useCallback(D=>{const O=typeof D=="function"?D(x):D;t?t(O):m(O),document.cookie=`${vj}=${O}; path=/; max-age=${Cj}`},[t,x]),C=A.useCallback(()=>c?f(D=>!D):v(D=>!D),[c,v,f]);A.useEffect(()=>{const D=O=>{O.key===Aj&&(O.metaKey||O.ctrlKey)&&(O.preventDefault(),C())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[C]);const k=x?"expanded":"collapsed",w=A.useMemo(()=>({state:k,open:x,setOpen:v,isMobile:c,openMobile:d,setOpenMobile:f,toggleSidebar:C}),[k,x,v,c,d,f,C]);return p.jsx(LP.Provider,{value:w,children:p.jsx(pa,{delayDuration:0,children:p.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Sj,"--sidebar-width-icon":wj,...o},className:q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",i),...r,children:a})})})}function Dj({side:n="left",variant:e="sidebar",collapsible:t="offcanvas",className:i,children:o,...a}){const{isMobile:r,state:c,openMobile:d,setOpenMobile:f}=Zh();return t==="none"?p.jsx("div",{"data-slot":"sidebar",className:q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...a,children:o}):r?p.jsx(fj,{open:d,onOpenChange:f,...a,children:p.jsxs(mj,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":kj},side:n,children:[p.jsxs(yj,{className:"sr-only",children:[p.jsx(bj,{children:"Sidebar"}),p.jsx(xj,{children:"Displays the mobile sidebar."})]}),p.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):p.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?t:"","data-variant":e,"data-side":n,"data-slot":"sidebar",children:[p.jsx("div",{"data-slot":"sidebar-gap",className:q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),p.jsx("div",{"data-slot":"sidebar-container",className:q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...a,children:p.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Oj({className:n,onClick:e,...t}){const{toggleSidebar:i}=Zh();return p.jsxs(mt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:q("size-7",n),onClick:o=>{e?.(o),i()},...t,children:[p.jsx(yE,{}),p.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Tj({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:q("flex flex-col gap-2 p-2",n),...e})}function Mj({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:q("flex flex-col gap-2 p-2",n),...e})}function Nj({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...e})}function Lj({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:q("relative flex w-full min-w-0 flex-col p-2",n),...e})}function Rj({className:n,asChild:e=!1,...t}){const i=e?Gh:"div";return p.jsx(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:q("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",n),...t})}function Ej({className:n,...e}){return p.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:q("w-full text-sm",n),...e})}function Ij({className:n,...e}){return p.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:q("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...e})}function jj({className:n,...e}){return p.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:q("group/menu-item relative",n),...e})}const Bj=$h("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Nk({asChild:n=!1,isActive:e=!1,variant:t="default",size:i="default",tooltip:o,className:a,...r}){const c=n?Gh:"button",{isMobile:d,state:f}=Zh(),g=p.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":e,className:q(Bj({variant:t,size:i}),a),...r});return o?(typeof o=="string"&&(o={children:o}),p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:g}),p.jsx(No,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):g}function Hj({className:n,...e}){return p.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:q("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",n),...e})}function _j({className:n,...e}){return p.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:q("group/menu-sub-item relative",n),...e})}function Uj({asChild:n=!1,size:e="md",isActive:t=!1,className:i,...o}){const a=n?Gh:"a";return p.jsx(a,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":t,className:q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...o})}const zj={sm:24,md:32,lg:48};function IP({size:n="md",className:e,showText:t=!0}){const{t:i}=Ce(),o=zj[n];return p.jsxs("div",{className:q("flex items-center gap-2",e),children:[p.jsx("img",{src:"/logo/ccs-logo-256.png",alt:i("ccsLogo.alt"),width:o,height:o,className:"rounded"}),t&&p.jsx("span",{className:"font-bold text-lg",children:i("ccsLogo.text")})]})}const kd="/api",jP="CONFLICT";class z9 extends Error{code=jP;constructor(e="Resource modified externally"){super(e),this.name="ApiConflictError"}}function F9(n){return n instanceof Error&&"code"in n&&n.code===jP}function $l(n){return n?/^https?:\/\//i.test(n)||n===kd||n.startsWith(`${kd}/`)?n:`${kd}${n.startsWith("/")?n:`/${n}`}`:kd}async function Fj(n){const e=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,t=await n.text();if(!t)return e;try{const i=JSON.parse(t);return i.error?.trim()?i.error:i.message?.trim()?i.message:e}catch{return t.trim()||e}}async function ce(n,e){const t=await fetch($l(n),{headers:{"Content-Type":"application/json"},...e});if(!t.ok)throw new Error(await Fj(t));if(t.status===204)return;if((t.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await t.json();const o=await t.text();if(o)try{return JSON.parse(o)}catch{return o}}const Ue={profiles:{list:()=>ce("/profiles"),getLocalRuntimeReadiness:()=>ce("/profiles/local-runtime-readiness"),create:n=>ce("/profiles",{method:"POST",body:JSON.stringify(n)}),update:(n,e)=>ce(`/profiles/${n}`,{method:"PUT",body:JSON.stringify(e)}),delete:n=>ce(`/profiles/${n}`,{method:"DELETE"}),discoverOrphans:()=>ce("/profiles/orphans"),registerOrphans:n=>ce("/profiles/orphans/register",{method:"POST",body:JSON.stringify(n)}),copy:(n,e)=>ce(`/profiles/${n}/copy`,{method:"POST",body:JSON.stringify(e)}),export:(n,e=!1)=>ce(`/profiles/${n}/export`,{method:"POST",body:JSON.stringify({includeSecrets:e})}),import:n=>ce("/profiles/import",{method:"POST",body:JSON.stringify(n)})},imageAnalysis:{get:()=>ce("/image-analysis"),update:n=>ce("/image-analysis",{method:"PUT",body:JSON.stringify(n)})},browser:{get:()=>ce("/browser"),getStatus:()=>ce("/browser/status"),update:n=>ce("/browser",{method:"PUT",body:JSON.stringify(n)})},logs:{getConfig:()=>ce("/logs/config"),updateConfig:n=>ce("/logs/config",{method:"PUT",body:JSON.stringify(n)}),getSources:()=>ce("/logs/sources"),getEntries:({source:n,level:e,search:t,limit:i}={})=>{const o=new URLSearchParams;n&&o.set("source",n),e&&o.set("level",e),t&&o.set("search",t),typeof i=="number"&&o.set("limit",String(i));const a=o.toString();return ce(`/logs/entries${a?`?${a}`:""}`)}},cliproxy:{list:()=>ce("/cliproxy"),getAuthStatus:()=>ce("/cliproxy/auth"),create:n=>ce("/cliproxy",{method:"POST",body:JSON.stringify(n)}),update:(n,e)=>ce(`/cliproxy/${n}`,{method:"PUT",body:JSON.stringify(e)}),delete:n=>ce(`/cliproxy/${n}`,{method:"DELETE"}),proxyStatus:()=>ce("/cliproxy/proxy-status"),proxyStart:()=>ce("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>ce("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>ce("/cliproxy/update-check"),versions:()=>ce("/cliproxy/versions"),install:(n,e)=>ce("/cliproxy/install",{method:"POST",body:JSON.stringify({version:n,force:e})}),restart:()=>ce("/cliproxy/restart",{method:"POST"}),stats:()=>ce("/cliproxy/usage"),catalog:()=>ce("/cliproxy/catalog"),models:()=>ce("/cliproxy/models"),updateModel:(n,e)=>ce(`/cliproxy/models/${n}`,{method:"PUT",body:JSON.stringify({model:e})}),getRoutingStrategy:()=>ce("/cliproxy/routing/strategy"),updateRoutingStrategy:n=>ce("/cliproxy/routing/strategy",{method:"PUT",body:JSON.stringify({value:n})}),getSessionAffinity:()=>ce("/cliproxy/routing/session-affinity"),updateSessionAffinity:n=>ce("/cliproxy/routing/session-affinity",{method:"PUT",body:JSON.stringify(n)}),aiProviders:{list:()=>ce("/cliproxy/ai-providers"),create:(n,e)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(e)}),update:(n,e,t)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),delete:(n,e)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(e)}`,{method:"DELETE"})},getConfigYaml:async()=>{const n=await fetch($l("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const e=await fetch($l("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to save config"}));throw new Error(t.error||"Failed to save config")}},getAuthFiles:()=>ce("/cliproxy/auth-files"),getAuthFile:async n=>{const e=await fetch($l(`/cliproxy/auth-files/download?name=${encodeURIComponent(n)}`));if(!e.ok)throw new Error("Failed to load auth file");return e.text()},accounts:{list:()=>ce("/cliproxy/auth/accounts"),listByProvider:n=>ce(`/cliproxy/auth/accounts/${n}`),setDefault:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/default`,{method:"POST",body:JSON.stringify({accountId:e})}),remove:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}`,{method:"DELETE"}),pause:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}/pause`,{method:"POST"}),resume:(n,e)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(e)}/resume`,{method:"POST"}),solo:(n,e)=>ce("/accounts/solo",{method:"POST",body:JSON.stringify({provider:n,accountId:e})}),bulkPause:(n,e)=>ce("/accounts/bulk-pause",{method:"POST",body:JSON.stringify({provider:n,accountIds:e})}),bulkResume:(n,e)=>ce("/accounts/bulk-resume",{method:"POST",body:JSON.stringify({provider:n,accountIds:e})})},auth:{start:(n,e)=>ce(`/cliproxy/auth/${n}/start`,{method:"POST",body:JSON.stringify({nickname:e})}),cancel:n=>ce(`/cliproxy/auth/${n}/cancel`,{method:"POST"}),kiroImport:()=>ce("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>ce("/cliproxy/error-logs"),getContent:async n=>{const e=await fetch($l(`/cliproxy/error-logs/${encodeURIComponent(n)}`));if(!e.ok)throw new Error("Failed to load error log");return e.text()}}},accounts:{list:()=>ce("/accounts"),setDefault:n=>ce("/accounts/default",{method:"POST",body:JSON.stringify({name:n})}),resetDefault:()=>ce("/accounts/reset-default",{method:"DELETE"}),delete:n=>ce(`/accounts/${n}`,{method:"DELETE"}),updateContext:(n,e)=>ce(`/accounts/${encodeURIComponent(n)}/context`,{method:"PUT",body:JSON.stringify(e)}),updateSharedResources:(n,e)=>ce(`/accounts/${encodeURIComponent(n)}/shared-resources`,{method:"PUT",body:JSON.stringify(e)})},config:{format:()=>ce("/config/format"),get:()=>ce("/config"),update:n=>ce("/config",{method:"PUT",body:JSON.stringify(n)}),migrate:(n=!1)=>ce(`/config/migrate?dryRun=${n}`,{method:"POST"}),rollback:n=>ce("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:n})})},presets:{list:n=>ce(`/settings/${n}/presets`),create:(n,e)=>ce(`/settings/${n}/presets`,{method:"POST",body:JSON.stringify(e)}),delete:(n,e)=>ce(`/settings/${n}/presets/${encodeURIComponent(e)}`,{method:"DELETE"})},cliproxyServer:{get:()=>ce("/cliproxy-server"),update:n=>ce("/cliproxy-server",{method:"PUT",body:JSON.stringify(n)}),getBackend:()=>ce("/cliproxy-server/backend"),updateBackend:(n,e=!1)=>ce("/cliproxy-server/backend",{method:"PUT",body:JSON.stringify({backend:n,force:e})}),test:n=>ce("/cliproxy-server/test",{method:"POST",body:JSON.stringify(n)})},quota:{get:(n,e)=>ce(`/cliproxy/quota/${n}/${encodeURIComponent(e)}`),getCodex:n=>ce(`/cliproxy/quota/codex/${encodeURIComponent(n)}`),getClaude:n=>ce(`/cliproxy/quota/claude/${encodeURIComponent(n)}`),getGemini:n=>ce(`/cliproxy/quota/gemini/${encodeURIComponent(n)}`)}};function qj(n){n.invalidateQueries({queryKey:["cliproxy-catalog"]}),n.invalidateQueries({queryKey:["cliproxy-models"]}),n.invalidateQueries({queryKey:["cliproxy-session-affinity"]})}function Io(n){n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),qj(n)}function q9(){return jt({queryKey:["cliproxy"],queryFn:()=>Ue.cliproxy.list()})}function Gj(){return jt({queryKey:["cliproxy-auth"],queryFn:()=>Ue.cliproxy.getAuthStatus()})}function G9(){return jt({queryKey:["cliproxy-catalog"],queryFn:()=>Ue.cliproxy.catalog(),staleTime:3e4,retry:1})}function K9(){return jt({queryKey:["cliproxy-routing"],queryFn:()=>Ue.cliproxy.getRoutingStrategy()})}function V9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.updateRoutingStrategy(t),onSuccess:t=>{n.invalidateQueries({queryKey:["cliproxy-routing"]}),fe.success(t.message||e("toasts.routingStrategySet",{strategy:t.strategy}))},onError:t=>{fe.error(t.message)}})}function W9(){return jt({queryKey:["cliproxy-session-affinity"],queryFn:()=>Ue.cliproxy.getSessionAffinity()})}function Q9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.updateSessionAffinity(t),onSuccess:t=>{n.setQueryData(["cliproxy-session-affinity"],t),n.invalidateQueries({queryKey:["cliproxy-session-affinity"]});const i=t.enabled?e("routingGuidance.sessionAffinityEnabled"):e("routingGuidance.sessionAffinityDisabled");fe.success(t.message||e("toasts.sessionAffinityUpdated",{state:i.toLowerCase()}))},onError:t=>{fe.error(t.message)}})}function Y9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.create(t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),fe.success(e("toasts.variantCreated"))},onError:t=>{fe.error(t.message)}})}function $9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.cliproxy.delete(t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),fe.success(e("toasts.variantDeleted"))},onError:t=>{fe.error(t.message)}})}function X9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.setDefault(t,i),onSuccess:()=>{Io(n),fe.success(e("toasts.defaultAccountUpdated"))},onError:t=>{fe.error(t.message)}})}function J9(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.remove(t,i),onSuccess:()=>{Io(n),fe.success(e("toasts.accountRemoved"))},onError:t=>{fe.error(t.message)}})}function Kj(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.pause(t,i),onSuccess:()=>{Io(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(e("toasts.accountPaused"))},onError:t=>{fe.error(t.message)}})}function Vj(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,accountId:i})=>Ue.cliproxy.accounts.resume(t,i),onSuccess:()=>{Io(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(e("toasts.accountResumed"))},onError:t=>{fe.error(t.message)}})}function Z9(){const n=bt();return ft({mutationFn:({provider:e,accountId:t})=>Ue.cliproxy.accounts.solo(e,t),onSuccess:e=>{Io(n),n.invalidateQueries({queryKey:["cliproxy-stats"]});const t=e.paused.length;fe.success(`Solo mode: paused ${t} other account${t!==1?"s":""}`)},onError:e=>{fe.error(e.message)}})}function Wj(){const n=bt();return ft({mutationFn:({provider:e,accountIds:t})=>Ue.cliproxy.accounts.bulkPause(e,t),onSuccess:e=>{Io(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(`Paused ${e.succeeded.length} account${e.succeeded.length!==1?"s":""}`),e.failed.length>0&&fe.warning(`${e.failed.length} account${e.failed.length!==1?"s":""} failed to pause`)},onError:e=>{fe.error(e.message)}})}function Qj(){const n=bt();return ft({mutationFn:({provider:e,accountIds:t})=>Ue.cliproxy.accounts.bulkResume(e,t),onSuccess:e=>{Io(n),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success(`Resumed ${e.succeeded.length} account${e.succeeded.length!==1?"s":""}`),e.failed.length>0&&fe.warning(`${e.failed.length} account${e.failed.length!==1?"s":""} failed to resume`)},onError:e=>{fe.error(e.message)}})}function eW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({provider:t,nickname:i})=>Ue.cliproxy.auth.start(t,i),onSuccess:(t,i)=>{Io(n),fe.success(e("toasts.accountAdded",{provider:i.provider}))},onError:t=>{fe.error(t.message)}})}function tW(){return ft({mutationFn:n=>Ue.cliproxy.auth.cancel(n),onError:n=>{fe.error(n.message)}})}function nW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.auth.kiroImport(),onSuccess:t=>{Io(n),t.account?fe.success(e("toasts.kiroImported",{name:t.account.email||t.account.id})):fe.success(e("toasts.kiroTokenImported"))},onError:t=>{fe.error(t.message)}})}function iW(){return jt({queryKey:["cliproxy-models"],queryFn:()=>Ue.cliproxy.models()})}function oW(n){return jt({queryKey:["presets",n],queryFn:()=>Ue.presets.list(n),enabled:!!n})}function sW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({profile:t,data:i})=>Ue.presets.create(t,i),onSuccess:(t,i)=>{n.invalidateQueries({queryKey:["presets",i.profile]}),fe.success(e("toasts.presetSaved",{name:i.data.name}))},onError:t=>{fe.error(t.message)}})}function aW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({profile:t,name:i})=>Ue.presets.delete(t,i),onSuccess:(t,i)=>{n.invalidateQueries({queryKey:["presets",i.profile]}),fe.success(e("toasts.presetDeleted"))},onError:t=>{fe.error(t.message)}})}function rW(){return jt({queryKey:["proxy-status"],queryFn:()=>Ue.cliproxy.proxyStatus(),refetchInterval:3e4})}function lW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.proxyStart(),onSuccess:t=>{n.invalidateQueries({queryKey:["proxy-status"]}),t.alreadyRunning?fe.info(e("toasts.cliproxyAlreadyRunning")):t.started?fe.success(e("toasts.cliproxyStarted")):fe.error(t.error||e("toasts.cliproxyStartFailed"))},onError:t=>{fe.error(t.message)}})}function cW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:()=>Ue.cliproxy.proxyStop(),onSuccess:t=>{n.invalidateQueries({queryKey:["proxy-status"]}),t.stopped?fe.success(`CLIProxy stopped${t.sessionCount?` (${t.sessionCount} session(s) disconnected)`:""}`):fe.error(t.error||e("toasts.cliproxyStopFailed"))},onError:t=>{fe.error(t.message)}})}function Yj(){return jt({queryKey:["cliproxy-update-check"],queryFn:()=>Ue.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!1,retry:!1})}function uW(){const n=bt();return ft({mutationKey:["update-backend"],mutationFn:({backend:e,force:t=!1})=>Ue.cliproxyServer.updateBackend(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-update-check"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-versions"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-server-config"],refetchType:"all"}),n.invalidateQueries({queryKey:["proxy-status"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),fe.success("Backend updated")},onError:e=>{e.message.includes("Proxy is running")?fe.error("Stop the proxy first to change backend"):fe.error(e.message)}})}function dW(){return jt({queryKey:["cliproxy-versions"],queryFn:()=>Ue.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!1,retry:!1})}function hW(){const n=bt();return ft({mutationFn:({version:e,force:t})=>Ue.cliproxy.install(e,t),onSuccess:e=>{e.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),e.success?fe.success(e.message||`Installed v${e.version}`):fe.error(e.error||"Installation failed"))},onError:e=>{fe.error(e.message)}})}function fW(){const n=bt();return ft({mutationFn:()=>Ue.cliproxy.restart(),onSuccess:e=>{n.invalidateQueries({queryKey:["proxy-status"]}),e.success?fe.success(`Proxy restarted on port ${e.port}`):fe.error(e.error||"Restart failed")},onError:e=>{fe.error(e.message)}})}const $j=BR,Xj=_R,Jj=HR;function Zj(n){return[{title:n("nav.general"),items:[{path:"/",icon:bE,label:n("nav.home")},{path:"/analytics",icon:xE,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:ty,label:n("nav.apiProfiles"),badge:{icons:["/icons/openrouter.svg","/assets/providers/alibabacloud-color.svg","/icons/ollama.svg"]}},{path:"/cliproxy",icon:sP,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/ai-providers",icon:ty,label:"AI Providers"},{path:"/cliproxy/control-panel",icon:vE,label:n("nav.controlPanel")}]},{path:"/accounts",icon:rP,label:n("nav.accounts"),isCollapsible:!0,children:[{path:"/accounts",label:n("nav.allAccounts")},{path:"/shared",icon:aP,label:n("nav.sharedData")}]}]},{title:n("nav.compatibleClis"),items:[{path:"/claude-extension",icon:CE,label:n("nav.claudeExtension")},{path:"/codex",iconSrc:"/assets/sidebar/codex.svg",label:"Codex CLI"},{path:"/droid",icon:SE,label:n("nav.factoryDroid")}]},{title:n("nav.deprecated"),items:[{path:"/copilot",icon:lP,label:`${n("nav.githubCopilot")} (${n("nav.deprecated")})`},{path:"/legacy/cursor",iconSrc:"/assets/sidebar/cursor.svg",label:`${n("nav.cursorIde")} (Legacy)`}]},{title:n("nav.system"),items:[{path:"/health",icon:bc,label:n("nav.health")},{path:"/logs",icon:cP,label:n("nav.logs")},{path:"/settings",icon:kE,label:n("nav.settings")}]}]}function e5(){const{t:n}=Ce(),e=Kh(),t=yb(),{state:i}=Zh(),{data:o}=Yj(),a=Zj(n),r=o?.backendLabel??"CLIProxy",c=x=>x.path==="/cliproxy"?r:x.label,d=x=>e.pathname===x,f=x=>x.some(v=>d(v.path)||e.pathname.startsWith(v.path+"/")),g=x=>x.path==="/accounts"?"/shared":x.path,m=x=>{if(x.iconSrc)return p.jsx("img",{src:x.iconSrc,alt:"",className:"w-4 h-4 object-contain"});if(x.icon){const v=x.icon;return p.jsx(v,{className:"w-4 h-4"})}return null};return p.jsxs(Dj,{collapsible:"icon",children:[p.jsx(Tj,{className:"h-12 flex items-center justify-center",children:p.jsx(IP,{size:"sm",showText:i==="expanded"})}),p.jsx(Nj,{children:a.map((x,v)=>p.jsxs(Lj,{children:[x.title&&p.jsx(Rj,{children:x.title}),p.jsx(Ej,{children:p.jsx(Ij,{children:x.items.map(C=>p.jsx(jj,{children:C.isCollapsible&&C.children?p.jsxs($j,{defaultOpen:f(C.children)||d(C.path),className:"group/collapsible",children:[p.jsx(Xj,{asChild:!0,children:p.jsxs(Nk,{tooltip:c(C),isActive:f(C.children),onClick:()=>t(g(C)),children:[m(C),p.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:c(C)}),p.jsx(Vh,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),p.jsx(Jj,{children:p.jsx(Hj,{children:C.children.map(k=>p.jsx(_j,{children:p.jsx(Uj,{asChild:!0,isActive:d(k.path),children:p.jsx(uh,{to:k.path,children:p.jsx("span",{children:k.label})})})},k.path))})})]}):p.jsx(Nk,{asChild:!0,isActive:d(C.path),tooltip:c(C),children:p.jsxs(uh,{to:C.path,children:[m(C),p.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:c(C)}),C.badge&&p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs("span",{className:q("group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors",d(C.path)?"bg-white/92 border border-white/65 shadow-sm":"bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30"),children:[(C.badge.icons&&C.badge.icons.length>0?C.badge.icons:C.badge.icon?[C.badge.icon]:[]).map(k=>p.jsx("span",{className:q("inline-flex h-4 w-4 items-center justify-center rounded-[3px] border",d(C.path)?"bg-white border-black/10":"bg-background/80 border-border/40 group-hover/menu-item:bg-white/90"),children:p.jsx("img",{src:k,alt:"",className:"h-3 w-3 object-contain"})},k)),C.badge.text&&p.jsx("span",{className:"hidden sm:inline",children:C.badge.text})]})}),p.jsx(No,{side:"right",children:p.jsx("p",{children:n("nav.openrouterTooltip")})})]})]})})},C.path))})})]},x.title||v))}),p.jsx(Mj,{className:"p-4 border-t flex items-center justify-center",children:p.jsx(Oj,{})})]})}const Mb=()=>{const n=A.useContext(OP);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function t5(){const{theme:n,setTheme:e}=Mb(),{t}=Ce();return p.jsxs(mt,{variant:"ghost",size:"icon",onClick:()=>e(n==="dark"?"light":"dark"),children:[p.jsx(uP,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),p.jsx(dP,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),p.jsx("span",{className:"sr-only",children:t("themeToggle.srLabel")})]})}function n5(){const{privacyMode:n,togglePrivacyMode:e}=kb(),{t}=Ce();return p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(mt,{variant:"ghost",size:"icon",onClick:e,className:q("h-8 w-8 transition-colors",n&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:n?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})}),p.jsx(No,{children:p.jsx("p",{children:t(n?"privacyToggle.modeOn":"privacyToggle.modeOff")})})]})}const i5="https://github.com/kaitranntt/ccs/issues";function o5(){const{t:n}=Ce();return p.jsx(mt,{variant:"ghost",size:"icon",asChild:!0,title:n("githubLink.title"),children:p.jsx("a",{href:i5,target:"_blank",rel:"noopener noreferrer",children:p.jsx(lP,{className:"w-4 h-4"})})})}const s5="https://docs.ccs.kaitran.ca";function a5(){const{t:n}=Ce();return p.jsx(mt,{variant:"ghost",size:"icon",asChild:!0,title:n("docsLink.title"),children:p.jsx("a",{href:s5,target:"_blank",rel:"noopener noreferrer",children:p.jsx(wE,{className:"w-4 h-4"})})})}function r5(){const{t:n}=Ce(),[e,t]=A.useState("disconnected"),[i,o]=A.useState(!1),a=A.useRef(null),r=bt(),c=A.useRef(0),d=5,f=A.useRef(null),g=A.useRef(()=>{}),m=A.useCallback(C=>{switch(C.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":r.invalidateQueries({queryKey:["profiles"]}),r.invalidateQueries({queryKey:["cliproxy"]}),fe.info(n("toasts.configUpdatedExternally"));break;case"settings-changed":r.invalidateQueries({queryKey:["profiles"]}),fe.info(n("toasts.settingsFileUpdated"));break;case"profiles-changed":r.invalidateQueries({queryKey:["accounts"]}),fe.info(n("toasts.accountsUpdated"));break;case"proxy-status-changed":r.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${C.type}`)}},[r,n]),x=A.useCallback(()=>{if(a.current?.readyState===WebSocket.OPEN)return;t("connecting");const C=window.location.protocol==="https:"?"wss:":"ws:",k=new WebSocket(`${C}//${window.location.host}/ws`);a.current=k,k.onopen=()=>{t("connected"),o(!1),c.current=0,console.log("[WS] Connected")},k.onmessage=w=>{try{const D=JSON.parse(w.data);m(D),window.dispatchEvent(new CustomEvent("ws-message",{detail:D}))}catch{console.log("[WS] Invalid message")}},k.onclose=()=>{if(t("disconnected"),a.current=null,c.current<d){o(!0);const w=Math.min(1e3*Math.pow(2,c.current),3e4);c.current++,console.log(`[WS] Reconnecting in ${w}ms (attempt ${c.current})`),f.current=setTimeout(()=>{g.current()},w)}else o(!1)},k.onerror=()=>{console.log("[WS] Connection error")}},[m]);g.current=x;const v=A.useCallback(()=>{c.current=d,o(!1),f.current&&(clearTimeout(f.current),f.current=null),a.current?.close()},[]);return A.useEffect(()=>(g.current(),()=>v()),[]),A.useEffect(()=>{const C=setInterval(()=>{a.current?.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(C)},[]),A.useMemo(()=>({status:e,isReconnecting:i,connect:x,disconnect:v}),[e,i,x,v])}function l5(){const{status:n,isReconnecting:e}=r5(),{t}=Ce(),o={connected:{icon:PE,color:"text-green-600",label:t("connectionIndicator.connected"),animate:!1},connecting:{icon:xc,color:"text-yellow-500",label:t("connectionIndicator.connecting"),animate:!0},disconnected:{icon:e?xc:AE,color:e?"text-amber-500":"text-red-500",label:t(e?"connectionIndicator.reconnecting":"connectionIndicator.disconnected"),animate:e}}[n],a=o.icon;return p.jsxs("div",{className:`flex items-center gap-1 text-sm ${o.color}`,children:[p.jsx(a,{className:`w-4 h-4 ${o.animate?"animate-spin":""}`}),p.jsx("span",{className:"hidden sm:inline",children:o.label})]})}function c5(){const[n,e]=A.useState(!1),{authEnabled:t,authConfigured:i,isLocalAccess:o,loading:a}=Jh(),{t:r}=Ce(),c=!o&&!t;if(n&&!c||a)return null;const d=c?"w-full border-t border-amber-200 bg-amber-50 px-4 py-2 text-amber-900 transition-colors duration-200 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200":"w-full border-t border-yellow-200 bg-yellow-50 px-4 py-2 text-yellow-800 transition-colors duration-200 dark:border-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-200",f=c?"text-amber-600 hover:bg-amber-100 hover:text-amber-800 dark:text-amber-400 dark:hover:bg-amber-800/30":"text-yellow-600 hover:bg-yellow-100 hover:text-yellow-800 dark:text-yellow-400 dark:hover:bg-yellow-800/30",g=c?p.jsx(p.Fragment,{children:i?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.remoteReadonlyAuthDisabledLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.remoteReadonlyAuthDisabledShort")})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.remoteReadonlySetupLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.remoteReadonlySetupShort")})]})}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"hidden sm:inline",children:r("localhostDisclaimer.localLong")}),p.jsx("span",{className:"sm:hidden",children:r("localhostDisclaimer.localShort")})]});return p.jsx("div",{className:d,children:p.jsxs("div",{className:"flex items-center justify-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx(DE,{className:"w-4 h-4 flex-shrink-0"}),g]}),c?null:p.jsx("button",{onClick:()=>e(!0),className:`flex-shrink-0 rounded p-1 transition-colors ${f}`,"aria-label":r("localhostDisclaimer.dismiss"),children:p.jsx(Gr,{className:"w-4 h-4"})})]})})}const u5="https://claudekit.cc?ref=HMNKXOHN";function d5(){const{t:n}=Ce();return p.jsxs("a",{href:u5,target:"_blank",rel:"noopener noreferrer",className:q("group inline-flex items-center gap-2 px-3 py-1.5 rounded-lg","bg-accent/10 border-2 border-accent/40","hover:bg-accent hover:border-accent","transition-all duration-200 shadow-sm hover:shadow-md"),title:n("claudekitBadge.title"),children:[p.jsx("img",{src:"/logos/claudekit-logo.png",alt:n("claudekitBadge.alt"),className:"w-5 h-5"}),p.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[p.jsx("span",{className:q("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:n("claudekitBadge.poweredBy")}),p.jsx("span",{className:q("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:n("claudekitBadge.claudekit")})]})]})}const h5="https://github.com/sponsors/kaitranntt";function f5(){const{t:n}=Ce();return p.jsxs("a",{href:h5,target:"_blank",rel:"noopener noreferrer",className:q("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg","bg-pink-500/10 border-2 border-pink-500/40","hover:bg-pink-400 hover:border-pink-400","transition-all duration-200 shadow-sm hover:shadow-md"),title:n("sponsorButton.title"),children:[p.jsx(OE,{className:q("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),p.jsx("span",{className:q("text-xs font-bold text-pink-600 dark:text-pink-300","group-hover:text-white dark:group-hover:text-white","transition-colors"),children:n("sponsorButton.sponsor")})]})}function Nb({...n}){return p.jsx(jA,{"data-slot":"dialog",...n})}function p5({...n}){return p.jsx(zA,{"data-slot":"dialog-portal",...n})}function g5({className:n,...e}){return p.jsx(FA,{"data-slot":"dialog-overlay",className:q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...e})}function Lb({className:n,children:e,showCloseButton:t=!0,...i}){return p.jsxs(p5,{"data-slot":"dialog-portal",children:[p.jsx(g5,{}),p.jsxs(BA,{"data-slot":"dialog-content",className:q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...i,children:[e,t&&p.jsxs(HA,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(Gr,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Rb({className:n,...e}){return p.jsx("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",n),...e})}function m5({className:n,...e}){return p.jsx("div",{"data-slot":"dialog-footer",className:q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...e})}function Eb({className:n,...e}){return p.jsx(_A,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold",n),...e})}function Ib({className:n,...e}){return p.jsx(UA,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",n),...e})}function y5({open:n,onClose:e,sessionId:t,provider:i,projects:o,defaultProjectId:a,supportsAll:r,onSelect:c,timeoutSeconds:d=30}){const[f,g]=A.useState(a),[m,x]=A.useState(!1),[v,C]=A.useState(d),{t:k}=Ce();A.useEffect(()=>{if(!n){C(d);return}const O=setInterval(()=>{C(M=>M<=1?(clearInterval(O),w(!0),0):M-1)},1e3);return()=>clearInterval(O)},[n,d]),A.useEffect(()=>{n&&(g(a),x(!1),C(d))},[n,a,d]);const w=async(O=!1)=>{if(!m){x(!0);try{await c(O?"":f),e()}catch(M){console.error("Failed to submit project selection:",M);try{await c("")}catch{}e()}}},D=i.charAt(0).toUpperCase()+i.slice(1);return p.jsx(Nb,{open:n,onOpenChange:O=>!O&&!m&&e(),children:p.jsxs(Lb,{className:"sm:max-w-lg",children:[p.jsxs(Rb,{children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(aP,{className:"w-5 h-5"}),k("projectSelectionDialog.title")]}),p.jsxs(Ib,{children:[k("projectSelectionDialog.description",{provider:D}),v>0&&p.jsx("span",{className:"text-muted-foreground ml-1",children:k("projectSelectionDialog.autoSelectCountdown",{count:v})})]})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsxs("div",{className:"space-y-2",children:[o.map(O=>p.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${f===O.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!m&&g(O.id),children:[f===O.id?p.jsx($S,{className:"w-5 h-5 text-primary"}):p.jsx(XS,{className:"w-5 h-5 text-muted-foreground"}),p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-medium",children:O.name}),p.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:O.id})]}),O.id===a&&p.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:k("projectSelectionDialog.default")})]},O.id)),r&&p.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${f==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!m&&g("ALL"),children:[f==="ALL"?p.jsx($S,{className:"w-5 h-5 text-primary"}):p.jsx(XS,{className:"w-5 h-5 text-muted-foreground"}),p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-medium",children:k("projectSelectionDialog.allProjects")}),p.jsx("div",{className:"text-sm text-muted-foreground",children:k("projectSelectionDialog.allProjectsDescription",{count:o.length})})]})]})]}),p.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[p.jsx(mt,{variant:"ghost",onClick:()=>w(!0),disabled:m,children:k("projectSelectionDialog.useDefault")}),p.jsx(mt,{onClick:()=>w(!1),disabled:m,children:m?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"w-4 h-4 mr-2 animate-spin"}),k("projectSelectionDialog.selecting")]}):p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-2"}),k("projectSelectionDialog.confirmSelection")]})})]})]})]})})}const Er={gemini:{displayName:"Google Gemini",description:"Gemini Pro/Flash models",oauthFlow:"authorization_code",callbackPort:8085,callbackProviderName:"gemini",authUrlProviderName:"gemini-cli",refreshOwnership:"cliproxy",authFilePrefixes:["gemini-","google-"],tokenTypeValues:["gemini"],aliases:["gemini-cli"]},codex:{displayName:"OpenAI Codex",description:"GPT-4 and codex models",oauthFlow:"authorization_code",callbackPort:1455,callbackProviderName:"codex",authUrlProviderName:"codex",refreshOwnership:"cliproxy",authFilePrefixes:["codex-","openai-"],tokenTypeValues:["codex"],aliases:[]},agy:{displayName:"Antigravity",description:"Antigravity AI models",oauthFlow:"authorization_code",callbackPort:51121,callbackProviderName:"antigravity",authUrlProviderName:"antigravity",refreshOwnership:"cliproxy",authFilePrefixes:["antigravity-","agy-"],tokenTypeValues:["antigravity"],aliases:["antigravity"]},qwen:{displayName:"Alibaba Qwen",description:"Qwen Code models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"qwen",authUrlProviderName:"qwen",refreshOwnership:"cliproxy",authFilePrefixes:["qwen-"],tokenTypeValues:["qwen"],aliases:[]},iflow:{displayName:"iFlow",description:"iFlow AI models",oauthFlow:"authorization_code",callbackPort:11451,callbackProviderName:"iflow",authUrlProviderName:"iflow",refreshOwnership:"cliproxy",authFilePrefixes:["iflow-"],tokenTypeValues:["iflow"],aliases:[]},kiro:{displayName:"Kiro (AWS)",description:"AWS CodeWhisperer models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kiro",authUrlProviderName:"kiro",refreshOwnership:"cliproxy",authFilePrefixes:["kiro-","aws-","codewhisperer-"],tokenTypeValues:["kiro","codewhisperer"],aliases:["codewhisperer"]},ghcp:{displayName:"GitHub Copilot (OAuth)",description:"Deprecated GitHub Copilot compatibility via OAuth",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"copilot",authUrlProviderName:"github",refreshOwnership:"cliproxy",authFilePrefixes:["github-copilot-","copilot-","gh-"],tokenTypeValues:["github-copilot","copilot"],aliases:["github-copilot","copilot"]},claude:{displayName:"Claude (Anthropic)",description:"Claude Opus/Sonnet models",oauthFlow:"authorization_code",callbackPort:54545,callbackProviderName:"anthropic",authUrlProviderName:"anthropic",refreshOwnership:"unsupported",authFilePrefixes:["claude-","anthropic-"],tokenTypeValues:["claude","anthropic"],aliases:["anthropic"]},kimi:{displayName:"Kimi (Moonshot)",description:"Moonshot AI K2/K2.5 models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kimi",authUrlProviderName:"kimi",refreshOwnership:"cliproxy",authFilePrefixes:["kimi-"],tokenTypeValues:["kimi"],aliases:["moonshot"]},cursor:{displayName:"Cursor",description:"Cursor browser-authenticated provider",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"cursor",authUrlProviderName:"cursor",refreshOwnership:"cliproxy",authFilePrefixes:["cursor.","cursor-"],tokenTypeValues:["cursor"],aliases:[]},gitlab:{displayName:"GitLab Duo",description:"GitLab Duo with OAuth or PAT auth",oauthFlow:"authorization_code",callbackPort:17171,callbackProviderName:"gitlab",authUrlProviderName:"gitlab",refreshOwnership:"cliproxy",authFilePrefixes:["gitlab-"],tokenTypeValues:["gitlab"],aliases:["gitlab-duo"]},codebuddy:{displayName:"CodeBuddy (Tencent)",description:"Tencent CodeBuddy AI assistant",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"codebuddy",authUrlProviderName:"codebuddy",refreshOwnership:"cliproxy",authFilePrefixes:["codebuddy-"],tokenTypeValues:["codebuddy"],aliases:["tencent"]},kilo:{displayName:"Kilo AI",description:"Kilo AI coding assistant",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kilo",authUrlProviderName:"kilo",refreshOwnership:"unsupported",authFilePrefixes:["kilo-"],tokenTypeValues:["kilo"],aliases:[]}},jb=Object.freeze(Object.keys(Er)),b5=Object.freeze(["cursor"]),x5=new Set(b5),ry=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(ry);const v5=Object.freeze([...ry,...ry.flatMap(n=>Er[n].aliases),"all"].filter((n,e,t)=>t.indexOf(n)===e));v5.join(", ");new Set(jb);function C5(n=Er){const e=new Map,t=Object.keys(n),i=(o,a)=>{const r=o.trim().toLowerCase();if(!r)return;const c=e.get(r);if(c&&c!==a)throw new Error(`Provider alias collision for "${r}": ${c} and ${a}`);e.set(r,a)};for(const o of t){i(o,o);for(const a of n[o].aliases)i(a,o)}return e}C5();function S5(n){return jb.filter(e=>Er[e].oauthFlow===n)}function k5(n){return x5.has(n)}function w5(){return S5("device_code").filter(n=>!k5(n))}const A5=["kiro","ghcp","cursor","gitlab","codebuddy","kilo"],Yc=jb,Bb=new Set(A5),P5=Object.freeze(Yc.filter(n=>!Bb.has(n))),D5=Object.freeze(Yc.filter(n=>Bb.has(n))),BP=Object.freeze([{id:"core",labelKey:"providerConfig.sectionCoreLabel",hintKey:"providerConfig.sectionCoreHint",providers:P5},{id:"plus-extra",labelKey:"providerConfig.sectionPlusLabel",hintKey:"providerConfig.sectionPlusHint",providers:D5}]);function Ca(n){return Yc.includes(n)}function fi(n){return typeof n=="string"?n.trim().toLowerCase():""}const O5=["openai","vertex"];function HP(n){return Ca(n)}function of(n){return HP(n)||O5.includes(n)}const _P=Object.freeze(Object.fromEntries(Yc.map(n=>[n,{displayName:Er[n].displayName,description:Er[n].description}]))),T5={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/codex-color.svg",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",cursor:"/assets/sidebar/cursor.svg",gitlab:"/assets/providers/gitlab.svg",codebuddy:"/assets/providers/codebuddy.png",kilo:"/assets/providers/kilo.png",ghcp:"/assets/providers/copilot.svg",claude:"/assets/providers/claude.svg",kimi:"/assets/providers/kimi.svg",openai:"/assets/providers/openai.svg",vertex:"/assets/providers/vertex.svg"},Lk={textClass:"text-gray-600",letter:"?"},M5={gemini:{textClass:"text-blue-600",letter:"G"},claude:{textClass:"text-orange-600",letter:"C"},codex:{textClass:"text-emerald-600",letter:"X"},agy:{textClass:"text-violet-600",letter:"A"},qwen:{textClass:"text-cyan-600",letter:"Q"},iflow:{textClass:"text-indigo-600",letter:"i"},kiro:{textClass:"text-teal-600",letter:"K"},cursor:{textClass:"text-slate-900",letter:"C"},gitlab:{textClass:"text-orange-600",letter:"G"},codebuddy:{textClass:"text-blue-600",letter:"B"},kilo:{textClass:"text-rose-600",letter:"K"},ghcp:{textClass:"text-green-600",letter:"C"},kimi:{textClass:"text-orange-500",letter:"K"},openai:{textClass:"text-slate-900",letter:"O"},vertex:{textClass:"text-blue-600",letter:"V"}},N5=new Set(["kimi"]),L5=new Set(["codex"]);function pW(n){switch(n){case"gemini-api-key":return"gemini";case"codex-api-key":return"codex";case"claude-api-key":return"claude";case"vertex-api-key":return"vertex";case"openai-compatibility":return"openai"}}function gW(n){return n.split(`
11
+ `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{const t=e.indexOf("=");if(t===-1)return{name:e.trim(),alias:""};const i=e.slice(0,t).trim(),o=e.slice(t+1).trim();return o?{name:o,alias:i}:{name:i,alias:""}}).filter(e=>e.name.length>0||e.alias.length>0)}function mW(n){return n.split(`
12
+ `).map((e,t)=>({line:e.trim(),lineNumber:t+1})).filter(({line:e})=>e.length>0&&e.includes("=")).flatMap(({line:e,lineNumber:t})=>{const i=e.indexOf("="),o=e.slice(0,i).trim(),a=e.slice(i+1).trim();return o&&a?[]:[`Line ${t}: use requested=upstream or a plain model name.`]})}function yW(n){return(n||[]).map(e=>{const t=e.alias?.trim()||"",i=e.name?.trim()||"";return t?`${t}=${i}`:i}).join(`
13
+ `)}function bW(n){return n.alias.trim()||n.name.trim()}function UP(n){const e=fi(n);if(of(e))return T5[e]}function R5(n){const e=fi(n);return of(e)?M5[e]:{...Lk,letter:e[0]?.toUpperCase()||Lk.letter}}function E5(n){const e=fi(n);return of(e)&&N5.has(e)}function I5(n){const e=fi(n);return of(e)&&L5.has(e)}const Hb={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",openai:"#111827",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",cursor:"#111827",gitlab:"#FC6D26",codebuddy:"#2563EB",kilo:"#E11D48",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},j5={...Object.fromEntries(Yc.map(n=>[n,_P[n].displayName])),openai:"OpenAI",vertex:"Vertex AI"};function _b(n){const e=fi(n);return e?j5[e]||re.t("toasts.providerUnknown",{provider:e}):re.t("toasts.providerUnknown",{provider:"unknown"})}function Rk(n){const e=fi(n);return Ca(e)&&Bb.has(e)}function xW(n){const e=fi(n);return Ca(e)&&BP.find(t=>t.providers.includes(e))||null}function vW(n){return n?n.tiers?Object.values(n.tiers).some(e=>Rk(e?.provider)):Rk(n.provider):!1}function CW(n,e){return BP.map(t=>({...t,items:n.filter(i=>{const o=fi(e(i));return Ca(o)&&t.providers.includes(o)})})).filter(t=>t.items.length>0)}function B5(n){const e=fi(n);return HP(e)?_P[e].description:""}const H5=[...w5()],_5=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),U5=Object.freeze({ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access.",kiro:"Sign in with your selected Kiro auth provider to continue.",kimi:"Sign in with your Kimi account and finish the device authorization."});function SW(n){const e=fi(n);return Ca(e)&&H5.includes(e)}function Jd(n){const e=fi(n);return e?Ca(e)?_5[e]||_b(e):re.t("toasts.providerUnknown",{provider:e}):re.t("toasts.providerUnknown",{provider:"unknown"})}function z5(n){const e=fi(n);return Ca(e)&&U5[e]||re.t("providerConfig.defaultDeviceCodeInstruction")}const F5=["authcode","device"],ly="authcode",kW="aws",Ek=[{id:"aws",label:"AWS Builder ID (Recommended)",description:"Device code flow for AWS organizations and Builder ID accounts.",flowType:"device_code",startEndpoint:"start"},{id:"aws-authcode",label:"AWS Builder ID (Auth Code)",description:"Authorization code flow via CLI binary.",flowType:"authorization_code",startEndpoint:"start"},{id:"google",label:"Google OAuth",description:"Social OAuth flow with callback URL support.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"github",label:"GitHub OAuth",description:"Social OAuth flow via management API callback.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"idc",label:"AWS Identity Center (IDC)",description:"Use your organization start URL with auth code or device flow.",flowType:"authorization_code",startEndpoint:"start"}];function q5(n){return F5.includes(n)}function G5(n){if(!n)return ly;const e=n.trim().toLowerCase();return q5(e)?e:ly}function wW(n){return Ek.find(t=>t.id===n)||Ek[0]}function AW(n,e=ly){return n==="aws"||n==="idc"&&G5(e)==="device"?"device_code":"authorization_code"}function PW(n){return n==="google"||n==="github"?"start-url":"start"}function DW(n){return n==="google"||n==="github"}function K5({open:n,onClose:e,sessionId:t,provider:i,userCode:o,verificationUrl:a,expiresAt:r}){const[c,d]=A.useState(!1),[f,g]=A.useState(null);A.useEffect(()=>{if(!n)return;let O=null;const M=()=>{const T=Math.max(0,Math.floor((r-Date.now())/1e3));g(T),T===0&&O&&(clearInterval(O),O=null)};return M(),O=setInterval(M,1e3),()=>{O&&clearInterval(O)}},[n,r]);const m=A.useCallback(async()=>{try{await navigator.clipboard.writeText(o),d(!0),fe.success(re.t("commonToast.codeCopied")),setTimeout(()=>d(!1),2e3)}catch{fe.error(re.t("commonToast.copyCodeFailed"))}},[o]),x=A.useCallback(()=>{window.open(a,"_blank","noopener,noreferrer")},[a]),v=Jd(i),C=z5(i),k=v==="Unknown provider"?re.t("deviceCodeDialog.openVerificationPage"):re.t("deviceCodeDialog.openProviderPage",{provider:v.split(" ")[0]}),w=O=>{const M=Math.floor(O/60),T=O%60;return`${M}:${T.toString().padStart(2,"0")}`},D=f===0;return p.jsx(Nb,{open:n,onOpenChange:O=>!O&&e(),children:p.jsxs(Lb,{className:"sm:max-w-md","data-session-id":t,children:[p.jsxs(Rb,{children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(bb,{className:"w-5 h-5"}),re.t("deviceCodeDialog.authorize",{provider:v})]}),p.jsxs(Ib,{children:[re.t("deviceCodeDialog.enterCodeAtPage"),f!==null&&f>0&&p.jsx("span",{className:"text-muted-foreground ml-1",children:re.t("deviceCodeDialog.expiresIn",{time:w(f)})}),D&&p.jsx("span",{className:"text-destructive ml-1 font-medium",children:re.t("deviceCodeDialog.codeExpired")})]})]}),p.jsxs("div",{className:"space-y-6 py-4",children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:p.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:o})}),p.jsx(mt,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:m,"aria-label":c?re.t("deviceCodeDialog.codeCopiedAria"):re.t("deviceCodeDialog.copyCodeAria"),children:c?p.jsx(Lr,{className:"h-4 w-4 text-green-500"}):p.jsx(dh,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"text-sm text-muted-foreground text-center",children:p.jsx("p",{children:C})}),p.jsxs("div",{className:"flex flex-col gap-3",children:[p.jsxs(mt,{onClick:x,className:"w-full",children:[p.jsx(hP,{className:"w-4 h-4 mr-2"}),k]}),p.jsx(mt,{variant:"outline",onClick:m,className:"w-full",children:c?p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-2 text-green-500"}),re.t("deviceCodeDialog.copied")]}):p.jsxs(p.Fragment,{children:[p.jsx(dh,{className:"w-4 h-4 mr-2"}),re.t("deviceCodeDialog.copyCode")]})})]}),p.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[p.jsx(hi,{className:"h-4 w-4 animate-spin"}),p.jsx("span",{children:re.t("deviceCodeDialog.waitingForAuth")})]})]})]})})}function V5({...n}){return p.jsx(UR,{"data-slot":"dropdown-menu",...n})}function W5({...n}){return p.jsx(zR,{"data-slot":"dropdown-menu-trigger",...n})}function Q5({className:n,sideOffset:e=4,...t}){return p.jsx(FR,{children:p.jsx(qR,{"data-slot":"dropdown-menu-content",sideOffset:e,className:q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",n),...t})})}function Y5({className:n,inset:e,variant:t="default",...i}){return p.jsx(GR,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i})}function $5(){const{authRequired:n,isAuthenticated:e,username:t,logout:i}=Jh();if(!n||!e)return null;const o=async()=>{await i()};return p.jsxs(V5,{children:[p.jsx(W5,{asChild:!0,children:p.jsxs(mt,{variant:"ghost",size:"sm",className:"gap-2",children:[p.jsx(fP,{className:"h-4 w-4"}),p.jsx("span",{className:"hidden sm:inline",children:t})]})}),p.jsx(Q5,{align:"end",children:p.jsxs(Y5,{onClick:o,className:"gap-2 text-destructive",children:[p.jsx(TE,{className:"h-4 w-4"}),"Sign Out"]})})]})}const zP=$R,FP=XR,Ub=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs(qA,{ref:i,className:q("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...t,children:[e,p.jsx(KR,{asChild:!0,children:p.jsx(Wh,{className:"h-4 w-4 opacity-50"})})]}));Ub.displayName=qA.displayName;const qP=A.forwardRef(({className:n,...e},t)=>p.jsx(GA,{ref:t,className:q("flex cursor-default items-center justify-center py-1",n),...e,children:p.jsx(xb,{className:"h-4 w-4"})}));qP.displayName=GA.displayName;const GP=A.forwardRef(({className:n,...e},t)=>p.jsx(KA,{ref:t,className:q("flex cursor-default items-center justify-center py-1",n),...e,children:p.jsx(Wh,{className:"h-4 w-4"})}));GP.displayName=KA.displayName;const zb=A.forwardRef(({className:n,children:e,position:t="popper",...i},o)=>p.jsx(VR,{children:p.jsxs(VA,{ref:o,className:q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...i,children:[p.jsx(qP,{}),p.jsx(WR,{className:q("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),p.jsx(GP,{})]})}));zb.displayName=VA.displayName;const X5=A.forwardRef(({className:n,...e},t)=>p.jsx(WA,{ref:t,className:q("px-2 py-1.5 text-sm font-semibold",n),...e}));X5.displayName=WA.displayName;const ac=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs(QA,{ref:i,className:q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[p.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(QR,{children:p.jsx(Lr,{className:"h-4 w-4"})})}),p.jsx(YR,{children:e})]}));ac.displayName=QA.displayName;const J5=A.forwardRef(({className:n,...e},t)=>p.jsx(YA,{ref:t,className:q("-mx-1 my-1 h-px bg-muted",n),...e}));J5.displayName=YA.displayName;function Z5(){const{t:n,i18n:e}=Ce(),t=Qc(e.resolvedLanguage??e.language??"en"),i=o=>{const a=jI(o);e.changeLanguage(a)};return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(pP,{className:"h-4 w-4 text-muted-foreground"}),p.jsxs(zP,{value:t,onValueChange:i,children:[p.jsx(Ub,{className:"h-8 w-[150px]",children:p.jsx(FP,{placeholder:n("layout.languageSwitcher")})}),p.jsx(zb,{children:EI.map(o=>p.jsx(ac,{value:o,children:n(`locale.${o}`)},o))})]})]})}function eB(){const[n,e]=A.useState({isOpen:!1,prompt:null});A.useEffect(()=>{const o=a=>{const r=a.detail;r.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",r.sessionId),e({isOpen:!0,prompt:{sessionId:r.sessionId,provider:r.provider,projects:r.projects,defaultProjectId:r.defaultProjectId,supportsAll:r.supportsAll}})):r.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",r.sessionId),e(c=>c.prompt?.sessionId===r.sessionId?{isOpen:!1,prompt:null}:c)):r.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",r.sessionId),e(c=>c.prompt?.sessionId===r.sessionId?{isOpen:!1,prompt:null}:c))};return window.addEventListener("ws-message",o),()=>{window.removeEventListener("ws-message",o)}},[]);const t=A.useCallback(async o=>{if(!n.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${n.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:o})})).ok)throw new Error("Failed to submit project selection")},[n.prompt]),i=A.useCallback(()=>{e({isOpen:!1,prompt:null})},[]);return A.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,onSelect:t,onClose:i}),[n.isOpen,n.prompt,t,i])}function tB(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function nB(){const{t:n}=Ce(),[e,t]=A.useState({isOpen:!1,prompt:null,error:null});A.useEffect(()=>{const r=c=>{const d=c.detail;if(d.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",d.sessionId);const f=tB(d.provider),g=Jd(f);fe.info(n("toasts.authRequired",{provider:g})),t({isOpen:!0,prompt:{sessionId:d.sessionId,provider:f,userCode:d.userCode,verificationUrl:d.verificationUrl,expiresAt:d.expiresAt},error:null})}else d.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",d.sessionId),t(f=>{if(f.prompt&&f.prompt.sessionId===d.sessionId){const g=Jd(f.prompt.provider);return fe.success(n("toasts.authSuccess",{provider:g})),{isOpen:!1,prompt:null,error:null}}return f})):d.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",d.sessionId,d.error),t(f=>{if(f.prompt&&f.prompt.sessionId===d.sessionId){const g=Jd(f.prompt.provider);return fe.error(n("toasts.authFailed",{provider:g})),{isOpen:!1,prompt:null,error:d.error}}return f})):d.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",d.sessionId),t(f=>f.prompt?.sessionId===d.sessionId?(fe.error(n("toasts.deviceCodeExpired")),{isOpen:!1,prompt:null,error:"Device code expired"}):f))};return window.addEventListener("ws-message",r),()=>{window.removeEventListener("ws-message",r)}},[n]);const i=A.useCallback(()=>{t({isOpen:!1,prompt:null,error:null})},[]),o=A.useCallback(()=>{e.prompt?.verificationUrl&&window.open(e.prompt.verificationUrl,"_blank","noopener,noreferrer")},[e.prompt]),a=A.useCallback(async()=>{if(e.prompt?.userCode)try{await navigator.clipboard.writeText(e.prompt.userCode),fe.success(n("toasts.codeCopied"))}catch{fe.error(n("toasts.failedCopy"))}},[e.prompt,n]);return A.useMemo(()=>({isOpen:e.isOpen,prompt:e.prompt,error:e.error,onClose:i,onOpenUrl:o,onCopyCode:a}),[e.isOpen,e.prompt,e.error,i,o,a])}const iB="ccs-dashboard:last-route";function oB(n,e="",t=""){try{localStorage.setItem(iB,`${n}${e}${t}`)}catch{}}function sB(){return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsx(tt,{className:"h-8 w-48"}),p.jsx(tt,{className:"h-64 w-full"})]})}function aB(){const n=Kh(),{isOpen:e,prompt:t,onSelect:i,onClose:o}=eB(),a=nB();return A.useEffect(()=>{oB(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),p.jsxs(Pj,{children:[p.jsx(e5,{}),p.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[p.jsxs("header",{className:"flex h-14 items-center justify-between px-6 border-b shrink-0 bg-background shadow-sm z-20",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(d5,{}),p.jsx(f5,{})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(l5,{}),p.jsx(Z5,{}),p.jsx(a5,{}),p.jsx(o5,{}),p.jsx(n5,{}),p.jsx(t5,{}),p.jsx($5,{})]})]}),p.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:p.jsx(A.Suspense,{fallback:p.jsx(sB,{}),children:p.jsx(ey,{})})}),p.jsx(c5,{})]}),t&&p.jsx(y5,{open:e,onClose:o,sessionId:t.sessionId,provider:t.provider,projects:t.projects,defaultProjectId:t.defaultProjectId,supportsAll:t.supportsAll,onSelect:i}),a.prompt&&p.jsx(K5,{open:a.isOpen,onClose:a.onClose,sessionId:a.prompt.sessionId,provider:a.prompt.provider,userCode:a.prompt.userCode,verificationUrl:a.prompt.verificationUrl,expiresAt:a.prompt.expiresAt})]})}const rB=$h("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qt({className:n,variant:e,...t}){return p.jsx("div",{className:q(rB({variant:e}),n),...t})}function lB({version:n}){const{t:e}=Ce();return p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx(IP,{size:"lg",showText:!1}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("h1",{className:"text-2xl font-bold",children:e("heroSection.title")}),n&&p.jsxs(Qt,{variant:"outline",className:"font-mono text-xs",children:["v",n]})]}),p.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:e("heroSection.subtitle")})]})]})}const cB=100,Ik=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function uB(n){return Ik[n%Ik.length]}function cy(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function dB(n){const t=new Date().getTime()-n.getTime(),i=Math.floor(t/6e4);if(i<1)return"now";if(i<60)return`${i}m`;const o=Math.floor(i/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function hB(n){const e=[],t=Date.now(),i=n.reduce((o,a)=>{const r=a.lastUsedAt?new Date(a.lastUsedAt).getTime():t;return Math.max(o,isNaN(r)?t:r)},t);return n.forEach(o=>{const a=new Date(i),r=(c,d)=>{for(let f=0;f<c;f++){const g=Math.floor(Math.random()*24*60*60*1e3*(f/(c||1))),m=new Date(a.getTime()-g),x=Math.floor((Math.random()-.5)*10*60*1e3);m.setTime(m.getTime()+x);const v=new Date;m>v&&m.setTime(v.getTime()),e.push({id:`${o.id}-${d}-${f}`,timestamp:m,accountEmail:o.email,status:d,latencyMs:d==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};r(o.successCount,"success"),r(o.failureCount,"failed")}),e.sort((o,a)=>a.timestamp.getTime()-o.timestamp.getTime())}function fB({containerRef:n,svgRef:e,accounts:t}){if(!n.current||!e.current)return[];const i=n.current,a=e.current.getBoundingClientRect(),r=i.querySelector("[data-provider-node]");if(!r)return[];const c=r.getBoundingClientRect(),d=[];return t.forEach((f,g)=>{const m=i.querySelector(`[data-account-index="${g}"]`);if(!m)return;const x=m.getBoundingClientRect(),v=m.getAttribute("data-zone")||"left";let C,k,w,D;switch(v){case"right":C=x.left-a.left,k=x.top+x.height/2-a.top,w=c.right-a.left,D=c.top+c.height/2-a.top;break;case"top":C=x.left+x.width/2-a.left,k=x.bottom-a.top,w=c.left+c.width/2-a.left,D=c.top-a.top;break;case"bottom":C=x.left+x.width/2-a.left,k=x.top-a.top,w=c.left+c.width/2-a.left,D=c.bottom-a.top;break;default:C=x.right-a.left,k=x.top+x.height/2-a.top,w=c.left-a.left,D=c.top+c.height/2-a.top}let O,M,T,L;v==="top"||v==="bottom"?(O=C,M=k+(D-k)*.5,T=w,L=D-(D-k)*.5):(O=C+(w-C)*.5,M=k,T=w-(w-C)*.5,L=D),d.push(`M ${C} ${k} C ${O} ${M}, ${T} ${L}, ${w} ${D}`)}),d}function pB(n){const e=n.length;if(e<=2)return{leftAccounts:n,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(e<=4){const i=Math.ceil(e/2);return{leftAccounts:n.slice(0,i),rightAccounts:n.slice(i),topAccounts:[],bottomAccounts:[]}}if(e<=8){const i=Math.ceil(e/3);return{leftAccounts:n.slice(0,i),rightAccounts:n.slice(i,i*2),topAccounts:n.slice(i*2),bottomAccounts:[]}}const t=Math.ceil(e/4);return{leftAccounts:n.slice(0,t),rightAccounts:n.slice(t,t*2),topAccounts:n.slice(t*2,t*3),bottomAccounts:n.slice(t*3)}}function gB(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function mB({storageKey:n,onDrag:e}){const[t,i]=A.useState(null),o=A.useRef(null),a=A.useRef(!1),r=A.useCallback(()=>{try{const C=localStorage.getItem(n);if(C)return JSON.parse(C)}catch{}return{}},[n]),[c,d]=A.useState(()=>r());A.useEffect(()=>{Object.keys(c).length>0&&localStorage.setItem(n,JSON.stringify(c))},[c,n]);const f=A.useCallback(()=>{d({}),localStorage.removeItem(n)},[n]),g=A.useCallback((C,k)=>{k.preventDefault(),k.stopPropagation(),k.target.setPointerCapture(k.pointerId);const w=c[C]||{x:0,y:0};o.current={x:k.clientX,y:k.clientY,offsetX:w.x,offsetY:w.y},a.current=!1,i(C)},[c]),m=A.useCallback(C=>{if(!t||!o.current)return;const k=o.current,w=C.clientX-k.x,D=C.clientY-k.y;(Math.abs(w)>3||Math.abs(D)>3)&&(a.current=!0),d(O=>({...O,[t]:{x:k.offsetX+w,y:k.offsetY+D}})),e&&requestAnimationFrame(e)},[t,e]),x=A.useCallback(()=>{i(null),o.current=null},[]);return{dragOffsets:c,draggingId:t,didDragRef:a,handlePointerDown:g,handlePointerMove:m,handlePointerUp:x,getOffset:C=>c[C]||{x:0,y:0},resetPositions:f,hasCustomPositions:Object.keys(c).length>0}}function yB(n){let e=0,t=0;return Object.values(n).forEach(i=>{e=Math.min(e,i.y),t=Math.max(t,i.y)}),{paddingTop:Math.max(0,-e),paddingBottom:Math.max(0,t),extraHeight:Math.max(0,Math.abs(e),Math.abs(t))*2}}function bB(n){const[e,t]=A.useState(new Set),i=A.useRef({});return A.useEffect(()=>{const o=new Set,a={};if(n.forEach(r=>{const c=r.successCount+r.failureCount;a[r.id]=c;const d=i.current[r.id];d!==void 0&&c>d&&o.add(r.id)}),i.current=a,o.size>0){t(o);const r=setTimeout(()=>t(new Set),2e3);return()=>clearTimeout(r)}},[n]),e}function xB({events:n,privacyMode:e}){const{t}=Ce();return n.length===0?p.jsx("div",{className:"h-full flex items-center justify-center rounded-xl bg-muted/20 dark:bg-zinc-900/40 border border-border/30 dark:border-white/[0.05]",children:p.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:t("flowViz.noRecentConnections")})}):p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[p.jsx(bc,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:t("flowViz.connectionTimeline")})]}),p.jsx("div",{className:q("flex-1 rounded-xl p-4 overflow-y-auto","bg-muted/20 dark:bg-zinc-900/40 backdrop-blur-sm","border border-border/30 dark:border-white/[0.05]"),children:p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),p.jsx("div",{className:"space-y-3",children:n.map(i=>{const o=i.status==="success"?Ln.success:i.status==="failed"?Ln.failed:Ln.degraded;return p.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[p.jsx("div",{className:q("relative z-10 w-3.5 h-3.5 rounded-full flex-shrink-0 mt-0.5","ring-2 ring-background dark:ring-zinc-950"),style:{backgroundColor:o}}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:q("text-[10px] font-mono text-foreground truncate",e&&MP),children:cy(i.accountEmail)}),p.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:dB(i.timestamp)})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[p.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:o},children:i.status}),i.latencyMs&&p.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[i.latencyMs,"ms"]})]})]})]},i.id)})})]})})]})}const vB=new Set(["free"]),CB=new Set(["plus","pro"]),SB=new Set(["team"]);function jk(n){return n.trim().replace(/^[^a-z0-9]+|[^a-z0-9]+$/gi,"").replace(/[^a-z0-9._-]+/gi,"-").replace(/-+/g,"-").toLowerCase()}function mr(n){const e=n.trim().toLowerCase();if(!e)return"";switch(e){case"team":return re.t("accountIdentity.team");case"free":return re.t("accountIdentity.free");case"plus":return re.t("accountIdentity.plus");case"pro":return re.t("accountIdentity.pro");default:return/^[a-f0-9]{8}$/i.test(e)?e:e.split(/[._-]+/).filter(Boolean).map(t=>t[0]?.toUpperCase()+t.slice(1)).join(" ")}}function KP(n){const e=n.split("#")[0]?.trim();return e&&e.includes("@")?e:null}function kB(n,e){if(!e)return null;const t=`${e}#`;return n.startsWith(t)?n.slice(t.length):null}function wB(n,e){if(!n||!e)return null;const i=(n.split(/[\\/]/).pop()??n).replace(/\.json$/i,"");if(!i.toLowerCase().startsWith("codex-"))return null;const o=i.indexOf("-"),a=o>0&&!i.slice(0,o).includes("@")?i.slice(o+1):i,r=a.toLowerCase().indexOf(e.toLowerCase());if(r===-1)return null;const c=jk(a.slice(0,r)),d=jk(a.slice(r+e.length)),f=[c,d].filter(Boolean);return f.length>0?f.join("-"):null}function AB(n){const e=n.find(i=>/^[a-f0-9]{8}$/i.test(i));if(e)return{detailLabel:re.t("accountIdentity.workspace",{id:e.toLowerCase()}),compactDetailLabel:e.toLowerCase()};const t=n.map(mr).filter(Boolean).join(" · ");return{detailLabel:t||null,compactDetailLabel:t||null}}function Bk(n){return n.map(mr).filter(Boolean).join(" · ")||null}function PB(n,e,t){const i=e?.trim()||KP(n)||void 0;return wB(t,i)??kB(n,i)}function Fb(n,e,t){const i=e?.trim()||KP(n)||n,o=PB(n,i,t);if(!o)return{email:i,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const a=o.split("-").filter(Boolean);if(a.length===0)return{email:i,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const r=a[a.length-1]?.toLowerCase();if(r&&SB.has(r)){const d=AB(a.slice(0,-1)),f=[re.t("accountIdentity.business"),d.detailLabel].filter(Boolean).join(" · ");return{email:i,audience:"business",audienceLabel:re.t("accountIdentity.business"),detailLabel:d.detailLabel,compactDetailLabel:d.compactDetailLabel,inlineLabel:f}}if(r&&vB.has(r)){const d=Bk(a.slice(0,-1)),f=[re.t("accountIdentity.free"),d].filter(Boolean).join(" · ");return{email:i,audience:"free",audienceLabel:re.t("accountIdentity.free"),detailLabel:d,compactDetailLabel:d,inlineLabel:f}}if(r&&CB.has(r)){const d=[mr(r),Bk(a.slice(0,-1))].filter(Boolean).join(" · "),f=[re.t("accountIdentity.personal"),d].filter(Boolean).join(" · ");return{email:i,audience:"personal",audienceLabel:re.t("accountIdentity.personal"),detailLabel:d||mr(r),compactDetailLabel:d||mr(r),inlineLabel:f}}const c=a.map(mr).filter(Boolean).join(" · ");return{email:i,audience:"unknown",audienceLabel:null,detailLabel:c||null,compactDetailLabel:c||null,inlineLabel:c||null}}function qb(n){return n.audience==="business"?{audience:"business",label:re.t("accountIdentity.business")}:n.audience==="free"?{audience:"free",label:re.t("accountIdentity.free")}:n.audience==="personal"?{audience:"personal",label:n.compactDetailLabel??n.detailLabel??re.t("accountIdentity.personal")}:{audience:"unknown",label:null}}function DB(n,e,t){const i=Fb(n,e,t);return i.inlineLabel?`${i.email} (${i.inlineLabel})`:i.email}const Qs="text-red-700 dark:text-red-400";function OB(n){if(!n)return null;const e=n.split(/[\s_-]+/g).map(t=>t.trim()).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1));return e.length>0?e.join(" "):n}function TB(n){if(!n)return null;try{const e=new Date(n);return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return null}}function MB(n,e,t){switch(n){case"five_hour":return t("quotaTooltip.fiveHourLimit");case"seven_day":return t("quotaTooltip.weeklyLimit");case"seven_day_opus":return t("quotaTooltip.weeklyOpus");case"seven_day_sonnet":return t("quotaTooltip.weeklySonnet");case"seven_day_oauth_apps":return t("quotaTooltip.weeklyOAuthApps");case"seven_day_cowork":return t("quotaTooltip.weeklyCowork");case"overage":return t("quotaTooltip.extraUsage");default:return e}}function Hk(n){if(!n)return null;switch(n.trim().toLowerCase()){case"requests":return"Requests";case"input":return"Input tokens";case"output":return"Output tokens";default:return n.split(/[\s_-]+/g).map(e=>e.trim()).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}}function NB(n){switch(n){case"Gemini Flash Lite Series":return"Flash Lite";case"Gemini Flash Series":return"Flash";case"Gemini Pro Series":return"Pro";default:return n}}function LB(n){const e=Array.from(new Set((n||[]).filter(Boolean)));return e.length>0?e.join(", "):null}function RB(n,e,t){if(n==null)return null;const i=n.toLocaleString();switch(e?.trim().toLowerCase()){case"requests":return t("quotaTooltip.requestsRemaining",{count:i});case"input":return t("quotaTooltip.inputTokensRemaining",{count:i});case"output":return t("quotaTooltip.outputTokensRemaining",{count:i});default:return t("quotaTooltip.amountRemaining",{count:i})}}function _k(n,e){if(!n)return null;const t=[];return n.rawTierLabel?t.push({label:e("quotaTooltip.tier"),value:n.rawTierLabel}):n.normalizedTier!=="unknown"&&t.push({label:e("quotaTooltip.tier"),value:n.normalizedTier}),n.rawTierId&&t.push({label:e("quotaTooltip.tierId"),value:n.rawTierId}),(n.accessState!=="entitled"||n.capacityState!=="available")&&t.push({label:e("quotaTooltip.state"),value:`${n.accessState.replaceAll("_"," ")} / ${n.capacityState.replaceAll("_"," ")}`}),t.length===0?null:t.map(i=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:i.label}),p.jsx("span",{className:"font-mono",children:i.value})]},i.label))}function uy({quota:n,resetTime:e}){const{t}=Ce();if(!n)return p.jsx("p",{className:"text-xs text-muted-foreground",children:t("quotaTooltip.loadingQuota")});if(!n.success){const i=Tb(n),o=i?.tone==="destructive"?"text-destructive":i?.tone==="warning"?"text-amber-700 dark:text-amber-300":"text-foreground";return p.jsxs("div",{className:"max-w-sm space-y-2 text-xs",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:q("font-semibold tracking-tight",o),children:i?.label||n.error||t("quotaTooltip.failedLoadQuota")}),p.jsx("p",{className:"leading-relaxed text-foreground/90",children:i?.summary||n.error})]}),i?.actionHint&&p.jsx("div",{className:"rounded-md border border-border/70 bg-muted/35 px-2.5 py-2 text-foreground/80",children:i.actionHint}),i?.technicalDetail&&p.jsx("div",{className:"rounded-md border border-border/60 bg-muted/25 px-2 py-1.5 font-mono text-[11px] text-foreground/75",children:i.technicalDetail}),i?.rawDetail&&p.jsx("pre",{className:"max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border/70 bg-muted/55 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-foreground/85",children:i.rawDetail})]})}if(Pb(n)){const i=ZI(n.models||[]),o=ej(i),a=["primary","gemini-3","gemini-2","other"];return p.jsxs("div",{className:"text-xs space-y-1.5",children:[_k(n.entitlement,t),p.jsx("p",{className:"font-medium",children:t("quotaTooltip.modelQuotas")}),a.map((r,c)=>{const d=o.get(r);if(!d||d.length===0)return null;const f=a.slice(0,c).every(g=>!o.get(g)?.length);return p.jsxs("div",{children:[!f&&p.jsx("div",{className:"my-1 border-t border-border/40"}),d.map(g=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q("truncate",g.exhausted&&Qs),children:g.displayName}),p.jsxs("span",{className:q("font-mono",g.exhausted&&Qs),children:[g.percentage,"%"]})]},g.name))]},r)}),p.jsx(Zd,{resetTime:e})]})}if(tf(n)){const{fiveHourWindow:i,weeklyWindow:o,codeReviewWindows:a,additionalWindows:r,unknownWindows:c}=ef(n.windows),d=n.coreUsage?.fiveHour?.resetAt??i?.resetAt??null,f=n.coreUsage?.weekly?.resetAt??o?.resetAt??null,g=[i,o,...a,...r,...c].filter(m=>!!m).filter((m,x,v)=>v.findIndex(C=>C.label===m.label&&C.resetAt===m.resetAt)===x);return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.rateLimits")}),n.planType&&p.jsx("p",{className:"text-muted-foreground",children:t("quotaTooltip.plan",{plan:n.planType})}),g.map((m,x)=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(m.remainingPercent<20&&Qs),children:ij(m,g)}),p.jsxs("span",{className:"font-mono",children:[m.remainingPercent,"%"]})]},`${m.label}-${m.resetAt??"no-reset"}-${x}`)),p.jsx(Uk,{fiveHourResetTime:d,weeklyResetTime:f,fallbackResetTime:e})]})}if(nf(n)){const i=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(d=>!!d).map(d=>({rateLimitType:d.rateLimitType,label:d.label,remainingPercent:d.remainingPercent,resetAt:d.resetAt,status:d.status})),o=n.windows.map(d=>({rateLimitType:d.rateLimitType,label:d.label,remainingPercent:d.remainingPercent,resetAt:d.resetAt,status:d.status})),a=[...i,...o].filter((d,f,g)=>g.findIndex(m=>m.rateLimitType===d.rateLimitType&&m.resetAt===d.resetAt&&m.status===d.status)===f),r=n.coreUsage?.fiveHour?.resetAt??n.windows.find(d=>d.rateLimitType==="five_hour")?.resetAt??null,c=n.coreUsage?.weekly?.resetAt??n.windows.find(d=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(d.rateLimitType))?.resetAt??null;return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.rateLimits")}),a.map((d,f)=>p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(d.remainingPercent<20&&Qs),children:MB(d.rateLimitType,d.label,t)}),p.jsxs("span",{className:"font-mono",children:[d.remainingPercent,"%"]})]},`${d.rateLimitType}-${d.resetAt??"no-reset"}-${d.status}-${f}`)),p.jsx(Uk,{fiveHourResetTime:r,weeklyResetTime:c,fallbackResetTime:e})]})}if(Db(n)){const i=n.buckets.some(c=>!!c.resetTime),o=!!n.entitlement?.rawTierLabel||n.entitlement?.normalizedTier!=="unknown",a=Array.from(new Set(n.buckets.map(c=>Hk(c.tokenType)).filter(c=>!!c))),r=a.length===1?a[0]:null;return p.jsxs("div",{className:"text-xs space-y-1.5",children:[_k(n.entitlement,t),!o&&n.tierLabel&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:t("quotaTooltip.tier")}),p.jsx("span",{className:"font-mono",children:n.tierLabel})]}),n.creditBalance!==null&&n.creditBalance!==void 0&&p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:"text-muted-foreground",children:t("quotaTooltip.credits")}),p.jsx("span",{className:"font-mono",children:n.creditBalance.toLocaleString()})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.modelQuotasLower")}),r&&p.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("quotaTooltip.allBucketsReport",{tokenType:r})})]}),n.buckets.map(c=>{const d=r?null:Hk(c.tokenType),f=LB(c.modelIds),g=RB(c.remainingAmount,c.tokenType,t);return p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsxs("div",{className:"min-w-0 space-y-0.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:q(c.remainingPercent<20&&Qs),children:NB(c.label)}),d&&p.jsx("span",{className:"rounded border border-border/60 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:d})]}),f&&p.jsx("div",{className:"break-words text-[11px] text-muted-foreground",children:f})]}),p.jsxs("span",{className:"shrink-0 font-mono",children:[c.remainingPercent,"%"]})]}),(g||c.resetTime)&&p.jsxs("div",{className:"flex justify-between gap-4 text-[11px] text-muted-foreground",children:[p.jsx("span",{children:g??""}),p.jsx("span",{children:TB(c.resetTime)??""})]})]},c.id)}),!i&&p.jsx(Zd,{resetTime:e})]})}if(Ob(n)){const i=[{label:t("quotaTooltip.premiumInteractions"),snapshot:n.snapshots.premiumInteractions},{label:t("quotaTooltip.chat"),snapshot:n.snapshots.chat},{label:t("quotaTooltip.completions"),snapshot:n.snapshots.completions}].filter(({snapshot:r})=>r.reported!==!1),o=n.quotaResetDate??e,a=OB(n.planType);return p.jsxs("div",{className:"text-xs space-y-1.5",children:[p.jsx("p",{className:"font-medium",children:t("quotaTooltip.quotaSnapshots")}),a&&p.jsx("p",{className:"text-muted-foreground",children:t("quotaTooltip.plan",{plan:a})}),i.map(({label:r,snapshot:c})=>{const d=c.percentRemaining<20;return p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex justify-between gap-4",children:[p.jsx("span",{className:q(d&&Qs),children:r}),p.jsx("span",{className:q("font-mono",d&&Qs),children:c.unlimited?t("quotaTooltip.unlimited"):`${Sr(c.percentRemaining)}%`})]}),!c.unlimited&&p.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("quotaTooltip.remaining",{remaining:c.remaining,entitlement:c.entitlement})})]},r)}),p.jsx(Zd,{resetTime:o})]})}return null}function Zd({resetTime:n}){const{t:e}=Ce();return n?p.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/60 pt-1",children:[p.jsx(Rr,{className:"h-3 w-3 text-sky-600 dark:text-sky-300"}),p.jsx("span",{className:"font-medium text-sky-600 dark:text-sky-300",children:e("quotaTooltip.resets",{time:ay(n)})})]}):null}function Uk({fiveHourResetTime:n,weeklyResetTime:e,fallbackResetTime:t}){const{t:i}=Ce(),o=!!n||!!e;return!o&&!t?null:p.jsxs("div",{className:"space-y-1 border-t border-border/60 pt-1",children:[n&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Rr,{className:"h-3 w-3 text-sky-600 dark:text-sky-300"}),p.jsx("span",{className:"font-medium text-sky-600 dark:text-sky-300",children:i("quotaTooltip.fiveHourResets",{time:ay(n)})})]}),e&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Rr,{className:"h-3 w-3 text-indigo-600 dark:text-indigo-300"}),p.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-300",children:i("quotaTooltip.weeklyResets",{time:ay(e)})})]}),!o&&t&&p.jsx(Zd,{resetTime:t})]})}const Xl=A.forwardRef(({className:n,value:e=0,max:t=100,indicatorClassName:i,...o},a)=>{const r=Math.min(Math.max(e/t*100,0),100);return p.jsx("div",{ref:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,className:q("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...o,children:p.jsx("div",{className:q("h-full transition-all",i||"bg-primary"),style:{width:`${r}%`}})})});Xl.displayName="Progress";function om(n){const e=Math.max(0,Math.min(100,n));return e<=20?"bg-destructive":e<=50?"bg-yellow-500":"bg-green-500"}function zk(n){const e=Math.max(0,Math.min(100,n));return e<=20?"text-red-600 dark:text-red-400":e<=50?"text-amber-600 dark:text-amber-400":"text-emerald-600 dark:text-emerald-400"}function Fk(n){return Number(Sr(n))}function qk(n){if(!n)return"";try{const e=new Date(n),t=Date.now()-e.getTime();if(t<0)return"just now";const i=Math.floor(t/(1e3*60)),o=Math.floor(t/(1e3*60*60)),a=Math.floor(t/(1e3*60*60*24));return a>0?`${a}d ago`:o>0?`${o}h ago`:i>0?`${i}m ago`:"just now"}catch{return""}}function EB(n){if(!n)return!1;try{return Date.now()-new Date(n).getTime()<3600*1e3}catch{return!1}}function IB({provider:n,quota:e,quotaLoading:t,runtimeLastUsed:i,mode:o,className:a}){const{t:r}=Ce(),c=n.toLowerCase(),d=c==="codex",f=c==="claude"||c==="anthropic",g=RP(n,e),m=EP(n,e),x=g!==null?Sr(g):null,v=x!==null?Number(x):null,C=Tb(e),k=C?.label==="Reauth"?bb:C?.tone==="warning"?Qi:vc,w=d&&e&&tf(e)?ef(e.windows):null,O=d?[{id:"five-hour",label:r("quotaTooltip.fiveHourLimit"),compactLabel:"5h",value:w?.fiveHourWindow?.remainingPercent??null},{id:"weekly",label:r("quotaTooltip.weeklyLimit"),compactLabel:"Week",value:w?.weeklyWindow?.remainingPercent??null}].filter(T=>T.value!==null):f&&e&&nf(e)?[{id:"five-hour",label:r("quotaTooltip.fiveHourLimit"),compactLabel:"5h",value:e.coreUsage?.fiveHour?.remainingPercent??e.windows.find(T=>T.rateLimitType==="five_hour")?.remainingPercent??null},{id:"weekly",label:r("quotaTooltip.weeklyLimit"),compactLabel:"Week",value:e.coreUsage?.weekly?.remainingPercent??e.windows.find(T=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(T.rateLimitType))?.remainingPercent??null}].filter(T=>T.value!==null):[];if(t)return p.jsxs("div",{className:q("flex items-center gap-1.5 text-xs text-muted-foreground",a),children:[p.jsx(hi,{className:"w-3 h-3 animate-spin"}),p.jsx("span",{children:r(o==="compact"?"accountCard.quotaLoading":"accountQuotaPanel.loadingQuota")})]});if(v!==null)return p.jsx("div",{className:q(o==="compact"?"px-0.5":"",a),children:p.jsx(pa,{children:p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:o==="compact"?p.jsx("div",{className:"cursor-help",children:O.length>0?p.jsx("div",{className:"space-y-1",children:O.map(T=>p.jsxs("div",{className:"grid grid-cols-[2rem_minmax(0,1fr)_2rem] items-center gap-x-1 text-[7px]",children:[p.jsx("span",{className:"font-semibold uppercase leading-none text-muted-foreground/75",children:T.compactLabel}),p.jsx(Xl,{value:Fk(T.value),"aria-label":`${T.compactLabel} quota`,className:"h-1.5",indicatorClassName:om(T.value)}),p.jsxs("span",{className:q("text-right font-mono text-[10px] font-bold leading-none",zk(T.value)),children:[Sr(T.value),"%"]})]},T.id))}):p.jsxs("div",{className:"space-y-0.5",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:r("accountCard.quota")}),p.jsxs("span",{className:q("text-[10px] font-mono font-bold",v>50?"text-emerald-600 dark:text-emerald-400":v>20?"text-amber-500":"text-red-500"),children:[x,"%"]})]}),p.jsx(Xl,{value:v,"aria-label":"Quota",className:"h-1",indicatorClassName:v>50?"bg-emerald-500":v>20?"bg-amber-500":"bg-red-500"})]})}):p.jsxs("div",{className:"space-y-1.5 cursor-help",children:[p.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:EB(i)?p.jsxs(p.Fragment,{children:[p.jsx(Wc,{className:"w-3 h-3 text-emerald-500"}),p.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Active ·"," ",qk(i)]})]}):i?p.jsxs(p.Fragment,{children:[p.jsx(Rr,{className:"w-3 h-3 text-muted-foreground"}),p.jsxs("span",{className:"text-muted-foreground",children:["Last used"," ",qk(i)]})]}):p.jsxs(p.Fragment,{children:[p.jsx(JS,{className:"w-3 h-3 text-muted-foreground"}),p.jsx("span",{className:"text-muted-foreground",children:r("accountCardStats.notUsedYet")})]})}),O.length>0?p.jsx("div",{className:"space-y-2",children:O.map(T=>p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 text-[10px]",children:[p.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:T.label}),p.jsxs("span",{className:q("shrink-0 font-mono font-semibold",zk(T.value)),children:[Sr(T.value),"%"]})]}),p.jsx(Xl,{value:Fk(T.value),"aria-label":`${T.label} quota`,className:"h-2",indicatorClassName:om(T.value)})]},T.id))}):p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Xl,{value:Math.max(0,Math.min(100,v)),"aria-label":"Quota",className:"h-2 flex-1",indicatorClassName:om(v)}),p.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[x,"%"]})]})]})}),p.jsx(No,{side:o==="compact"?"top":"bottom",className:"sm:max-w-sm",children:p.jsx(uy,{quota:e,resetTime:m})})]})})});if(e?.success)return o==="compact"?p.jsx("div",{className:q("text-[8px] text-muted-foreground/60",a),children:r("accountCard.quotaUnavailable")}):p.jsx("div",{className:a,children:p.jsxs(Qt,{variant:"outline",className:"text-[10px] h-5 px-2 gap-1 border-muted-foreground/50 text-muted-foreground",children:[p.jsx(JS,{className:"w-3 h-3"}),r("accountCard.quotaUnavailable")]})});if(!C)return null;const M=C.tone==="warning"?"text-amber-600 dark:text-amber-400 border-amber-500/50":C.tone==="destructive"?"text-destructive border-destructive/50":"text-muted-foreground/70 border-muted-foreground/50";return p.jsx(pa,{children:p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:o==="compact"?p.jsxs("div",{className:q("flex items-center gap-1 text-[8px]",M,a),children:[p.jsx(k,{className:"w-2.5 h-2.5"}),p.jsx("span",{children:C.label})]}):p.jsx("div",{className:a,children:p.jsxs(Qt,{variant:"outline",className:q("text-[10px] h-5 px-2 gap-1",M),children:[p.jsx(k,{className:"w-3 h-3"}),C.label]})})}),p.jsx(No,{side:o==="compact"?"top":"bottom",className:"sm:max-w-sm",children:p.jsx(uy,{quota:e,resetTime:m})})]})})}function sm(n){return n==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":n==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":n==="personal"?"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"}function jB(n){return n==="ultra"?"bg-violet-500/15 text-violet-600 dark:bg-violet-500/25 dark:text-violet-300":"bg-yellow-500/15 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-400"}function BB(n,e){return n==="business"?e("accountSurfaceCard.business"):n==="free"?e("accountSurfaceCard.free"):n==="personal"?e("accountSurfaceCard.personal"):"?"}function Gk(n){return n==="business"?"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:border-sky-400/30 dark:bg-sky-500/15 dark:text-sky-200":n==="free"?"border-slate-300/70 bg-slate-100/80 text-slate-700 dark:border-slate-500/40 dark:bg-slate-700/30 dark:text-slate-200":n==="personal"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-200":"border-border/60 bg-muted/60 text-muted-foreground"}function HB(n,e){if(e&&"entitlement"in e){const t=e.entitlement?.normalizedTier;if(t&&t!=="unknown")return t}return n}function _B(n){return!n||!("planType"in n)||!n.planType?{audience:"unknown",label:null}:n.planType==="team"?{audience:"business",label:"Business"}:n.planType==="free"?{audience:"free",label:"Free"}:n.planType==="plus"?{audience:"personal",label:"Plus"}:n.planType==="pro"?{audience:"personal",label:"Pro"}:{audience:"unknown",label:null}}function UB(n,e){return e.label?e.label==="Business"||e.label==="Plus"||e.label==="Pro"?e:e.label==="Free"&&n.label&&n.label!=="Free"?n:e:n}function zB({mode:n,provider:e,accountId:t,email:i,displayEmail:o,tokenFile:a,tier:r,isDefault:c,paused:d,privacyMode:f,showQuota:g,quota:m,quotaLoading:x,runtimeLastUsed:v,beforeIdentity:C,headerEnd:k,compactMetaBadges:w,bodySlot:D,footerSlot:O,quotaInsetClassName:M,className:T}){const{t:L}=Ce(),N=Fb(t,i,a),I=o||N.email||t,K=e.toLowerCase(),U=HB(r,m),z=K==="codex"?UB(qb(N),_B(m)):null,X=(K==="agy"||K==="antigravity"||K==="gemini")&&U&&U!=="unknown"&&U!=="free",_=n==="compact",V=p.jsxs(p.Fragment,{children:[X&&p.jsx("span",{className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",jB(U)),children:U}),K==="codex"?z?.label&&p.jsx("span",{title:z.label,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md border shrink-0",Gk(z.audience)),children:z.label}):N.audienceLabel&&p.jsx("span",{title:N.audienceLabel,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",sm(N.audience)),children:BB(N.audience,L)}),K!=="codex"&&N.compactDetailLabel&&p.jsx("span",{title:N.detailLabel??N.compactDetailLabel,className:q("text-[8px] font-semibold px-1.5 py-0.5 rounded-md border shrink-0",Gk(N.audience)),children:N.compactDetailLabel}),d&&p.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]});return p.jsxs("div",{className:q("flex flex-col gap-2",T),children:[p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsxs("div",{className:q("flex min-w-0 flex-1",_?"gap-2":"gap-3"),children:[C,!_&&p.jsxs("div",{className:"relative shrink-0",children:[p.jsx("div",{className:q("flex items-center justify-center w-8 h-8 rounded-full",c?"bg-primary/10":"bg-muted"),children:p.jsx(fP,{className:"w-4 h-4"})}),X&&p.jsx("span",{className:q("absolute -bottom-0.5 -right-0.5 text-[7px] font-bold uppercase px-1 py-px rounded ring-1 ring-background",U==="ultra"?"bg-violet-500/20 text-violet-600 dark:bg-violet-500/30 dark:text-violet-300":"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/25 dark:text-yellow-400"),children:U==="ultra"?"U":"P"})]}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:q("flex items-center min-w-0",_?"gap-1.5":"gap-2 flex-wrap"),children:[p.jsx("span",{title:I,className:q(_?"flex-1 min-w-0 text-xs font-semibold tracking-tight truncate leading-none":"font-medium text-sm truncate",f&&MP),children:I}),_&&(w??V),!_&&K==="codex"&&z?.label&&p.jsx(Qt,{variant:"outline",className:q("text-[10px] h-4 px-1.5 border-transparent",sm(z.audience)),children:z.label}),!_&&K!=="codex"&&N.audienceLabel&&p.jsx(Qt,{variant:"outline",className:q("text-[10px] h-4 px-1.5 border-transparent",sm(N.audience)),children:N.audienceLabel}),!_&&K!=="codex"&&N.detailLabel&&p.jsx(Qt,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:N.detailLabel}),!_&&c&&p.jsxs(Qt,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[p.jsx(ME,{className:"w-2.5 h-2.5 fill-current"}),"Default"]}),!_&&d&&p.jsxs(Qt,{variant:"outline",className:"text-[10px] h-4 px-1.5 border-yellow-500 text-yellow-600",children:[p.jsx(gP,{className:"w-2 h-2 mr-0.5"}),"Paused"]})]}),D&&p.jsx("div",{className:"mt-1",children:D})]})]}),k&&p.jsx("div",{className:q("flex items-center shrink-0",_?"gap-0.5":"gap-1"),children:k})]}),O,g&&p.jsx(IB,{provider:e,quota:m,quotaLoading:x,runtimeLastUsed:v,mode:n,className:M})]})}async function FB(){const n=await fetch("/api/cliproxy/stats");if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to fetch stats")}return n.json()}async function qB(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function GB(){return jt({queryKey:["cliproxy-status"],queryFn:qB,refetchInterval:1e4,retry:1})}function KB(n=!0){return jt({queryKey:["cliproxy-stats"],queryFn:FB,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function VB(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const t=await n.json();throw new Error(t.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function WB(n){const e=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(n)}`);if(!e.ok)throw new Error("Failed to fetch error log content");return e.text()}function QB(n=!0){return jt({queryKey:["cliproxy-error-logs"],queryFn:VB,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function YB(n){return jt({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?WB(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const VP=["agy","codex","claude","gemini","ghcp"],$B={antigravity:"agy",anthropic:"claude","gemini-cli":"gemini",copilot:"ghcp","github-copilot":"ghcp"};function WP(n){const e=n.trim().toLowerCase();return e?VP.includes(e)?e:$B[e]??null:null}async function Kk(n,e){const t=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(e)}`);if(!t.ok){let i="Failed to fetch quota";try{i=(await t.json()).message||i}catch{}throw new Error(i)}return t.json()}async function XB(n){const e=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Codex quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function JB(n){const e=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Claude quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function ZB(n){const e=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch Gemini quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}async function eH(n){const e=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!e.ok){let t="Failed to fetch GitHub Copilot quota";try{t=(await e.json()).message||t}catch{}throw new Error(t)}return e.json()}function QP(n,e,t=!0){const i=WP(n);return{queryKey:["account-quota",i??n,e],queryFn:()=>tH(i??n,e),enabled:t&&!!i&&!!e,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}async function tH(n,e){const t=WP(n);if(!t)return Kk(n,e);switch(t){case"codex":return XB(e);case"claude":return JB(e);case"gemini":return ZB(e);case"ghcp":return eH(e);default:return Kk(n,e)}}function nH(n,e,t=!0){return jt(QP(n,e,t))}function iH(n,e=!0){return pE({queries:n.map(t=>QP(t.provider,t.accountId,e))})}function oH({success:n,failure:e,showDetails:t}){const{t:i}=Ce(),o=n+e,a=o>0?n/o*100:100;return p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:i("authMonitorLive.successRate")}),p.jsxs("span",{className:q("text-sm font-mono font-bold leading-none mt-0.5",a===100?"text-emerald-600 dark:text-emerald-400":a>=90?"text-amber-500":"text-red-500"),children:[Math.round(a),"%"]})]}),p.jsxs("div",{className:"flex flex-col items-end",children:[p.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),p.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:o.toLocaleString()})]})]}),p.jsxs("div",{className:q("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",t?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[p.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/10",children:[p.jsx(Wc,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),p.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:n})]}),p.jsxs("div",{className:q("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",e>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[p.jsx(vb,{className:q("w-2.5 h-2.5",e>0?"text-red-500":"text-muted-foreground")}),p.jsx("span",{className:q("text-[10px] font-mono font-bold",e>0?"text-red-500":"text-muted-foreground"),children:e})]})]})]})}const sH=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],aH={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},rH={left:"top-1/2 -right-1.5 -translate-y-1/2",right:"top-1/2 -left-1.5 -translate-y-1/2",top:"left-1/2 -bottom-1.5 -translate-x-1/2",bottom:"left-1/2 -top-1.5 -translate-x-1/2"};function lH(n,e){switch(n){case"left":return{borderLeftColor:e};case"right":return{borderRightColor:e};case"top":return{borderTopColor:e};case"bottom":return{borderBottomColor:e}}}function cH(n){return n>50?"bg-emerald-500":n>20?"bg-amber-500":"bg-red-500"}function YP(n){if(!n||typeof n!="object"||!("planType"in n))return{audience:"unknown",label:null};const e=n.planType;return typeof e!="string"||e.trim().length===0?{audience:"unknown",label:null}:e==="team"?{audience:"business",label:"Business"}:e==="free"?{audience:"free",label:"Free"}:e==="plus"?{audience:"personal",label:"Plus"}:e==="pro"?{audience:"personal",label:"Pro"}:{audience:"unknown",label:null}}function $P(n,e){return e.label?e.label==="Business"||e.label==="Plus"||e.label==="Pro"?e:e.label==="Free"&&n.label&&n.label!=="Free"?n:e:n}function XP(n,e){return $P(qb({audience:n.audience,detailLabel:n.detailLabel??null,compactDetailLabel:n.compactDetailLabel??null}),YP(e)).label}function uH(n,e){return $P(qb({audience:n.audience,detailLabel:n.detailLabel??null,compactDetailLabel:n.compactDetailLabel??null}),YP(e)).audience}function JP(n,e){return XP(n,e)}function ZP(n){return n==="business"?"Business":n==="free"?"Free":n==="personal"?"Personal":null}function eD(n,e){return uH(n,e)}function Vk(n,e){return XP(n,e)||n.inlineLabel||null}function tD(n,e){const t=eD(n,e),i=JP(n,e);return t==="business"?"Biz":t==="free"?i??"Free":t==="personal"?i??"Pers":(i?.trim()||ZP(t))?.[0]?.toUpperCase()??"?"}function dH(n,e){const t=new Set(n.map(o=>o.audience));if(!n.some((o,a)=>!!(JP(o,e[a])||ZP(eD(o,e[a]))))&&n.length===2&&t.size===2&&t.has("business")&&t.has("personal"))return"B|P";if(n.length===1){const[o]=n;return tD(o,e[0])}return null}function hH({account:n,zone:e,originalIndex:t,isHovered:i,isDragging:o,offset:a,showDetails:r,privacyMode:c,onMouseEnter:d,onMouseLeave:f,onPointerDown:g,onPointerMove:m,onPointerUp:x,onPauseToggle:v,isPausingAccount:C}){const{t:k}=Ce(),w=aH[e],D=lH(e,n.color),O=rH[e],M=n.provider.toLowerCase(),T=VP.includes(M)||sH.includes(M),L=(n.variants?.length??0)>1,{data:N,isLoading:I}=nH(M,n.id,T&&!L),K=iH((n.variants??[]).map(oe=>({provider:n.provider,accountId:oe.id})),T&&L),U=L?n.variants??[]:[],z=U.map((oe,B)=>K[B]?.data),X=dH(U,z),_=L?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"inline-flex shrink-0 items-center overflow-hidden rounded-md border border-border/60 bg-muted/60 shadow-sm shadow-black/5 dark:bg-zinc-900/80",title:U.map((oe,B)=>Vk(oe,z[B])??k("accountSurfaceCard.variant")).join(" • "),children:X?p.jsx("span",{className:"inline-flex min-w-[2.2rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none text-foreground/80",children:X}):U.map((oe,B)=>p.jsx("span",{className:q("inline-flex min-w-[1.9rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none",B>0&&"border-l border-border/50",oe.audience==="business"?"bg-sky-500/12 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":oe.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":oe.audience==="personal"?"bg-emerald-500/12 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:tD(oe,z[B])},oe.id))}),n.paused&&p.jsx("span",{className:"text-[7px] font-bold uppercase tracking-wide px-1 py-px rounded shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]}):void 0,V=L&&T?(n.variants??[]).map((oe,B)=>{const Z=K[B],se=Z?.data,Y=RP(n.provider,se),ae=EP(n.provider,se),de=Y!==null?Sr(Y):null,be=de!==null?Number(de):null,te=Tb(se),le=Vk(oe,se)??cy(oe.email);return p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs("div",{className:"space-y-0.5 cursor-help",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 text-[8px]",children:[p.jsx("span",{className:"text-muted-foreground/80 truncate",children:le}),p.jsx("span",{className:"font-mono text-foreground/80 shrink-0",children:Z?.isLoading?k("accountCard.quotaLoading"):be!==null?`${de}%`:te?.label||k("accountCard.quotaUnavailable")})]}),be!==null&&p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:p.jsx("div",{className:q("h-full rounded-full transition-all",cH(be)),style:{width:`${be}%`}})})]})}),p.jsx(No,{side:"top",className:"sm:max-w-sm",children:p.jsx(uy,{quota:se,resetTime:ae})})]},oe.id)}):null,ie=p.jsxs(p.Fragment,{children:[v&&p.jsx(pa,{children:p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(mt,{variant:"ghost",size:"icon",className:q("h-4 w-4 shrink-0 transition-all rounded-full",n.paused?"bg-amber-500/20 hover:bg-amber-500/30":"hover:bg-muted"),onClick:oe=>{oe.stopPropagation(),v(n.memberIds??[n.id],!n.paused)},disabled:C,children:C?p.jsx(hi,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?p.jsx(NE,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"}):p.jsx(gP,{className:"w-2.5 h-2.5 text-muted-foreground/50 hover:text-foreground"})})}),p.jsx(No,{side:"top",className:"text-xs",children:n.paused?k("accountCard.resumeAccount"):k("accountCard.pauseAccount")})]})}),p.jsx(Qh,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]});return p.jsxs("div",{"data-account-index":t,"data-zone":e,onMouseEnter:d,onMouseLeave:f,onPointerDown:g,onPointerMove:m,onPointerUp:x,onPointerCancel:x,className:q("group/card relative rounded-lg p-3 w-44 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]",w,"select-none touch-none",i&&"bg-muted/50 dark:bg-zinc-800/60",o&&"cursor-grabbing shadow-xl scale-105 z-50",n.paused&&"opacity-60"),style:{...D,transform:`translate(${a.x}px, ${a.y}px)${o?" scale(1.05)":""}`},children:[p.jsx(zB,{mode:"compact",provider:n.provider,accountId:n.id,email:n.email,displayEmail:cy(n.email),tokenFile:n.tokenFile,tier:n.tier,isDefault:n.isDefault,paused:n.paused,privacyMode:c,showQuota:T&&!L,quota:N,quotaLoading:I,runtimeLastUsed:n.lastUsedAt,headerEnd:ie,compactMetaBadges:_,footerSlot:p.jsxs(p.Fragment,{children:[p.jsx(oH,{success:n.successCount,failure:n.failureCount,showDetails:r}),V&&p.jsx("div",{className:"mt-2 px-0.5 space-y-1",children:V})]})}),p.jsx("div",{className:q("absolute w-3 h-3 rounded-full transform z-20 transition-colors border","bg-muted dark:bg-zinc-800 border-border dark:border-zinc-600",O,i&&"bg-foreground dark:bg-white border-transparent")})]})}function Gb({provider:n,className:e,size:t=18,withBackground:i=!1}){const o=n.toLowerCase(),a=UP(n),r=Hb[o]||"#6b7280",c=i?Math.floor(t*.65):t,d=a?p.jsx("img",{src:a,alt:`${n} icon`,width:c,height:c,className:"shrink-0 object-contain"}):p.jsx("span",{className:"font-bold",style:{color:r,fontSize:c*.6},children:n.charAt(0).toUpperCase()});if(i)return p.jsx("div",{className:q("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",e),style:{width:t,height:t},children:d});if(a)return p.jsx("img",{src:a,alt:`${n} icon`,width:t,height:t,className:q("shrink-0 rounded-sm object-contain",e)});const f=r;return p.jsx("div",{className:q("shrink-0 rounded-full flex items-center justify-center text-white font-bold",e),style:{width:t,height:t,backgroundColor:f,fontSize:t*.5},children:n.charAt(0).toUpperCase()})}function fH({providerData:n,providerColor:e,totalRequests:t,maxRequests:i,showVisibleMetrics:o=!1,hiddenPausedCount:a=0,isDragging:r,offset:c,hoveredAccount:d,hasRightAccounts:f,hasTopAccounts:g,hasBottomAccounts:m,onPointerDown:x,onPointerMove:v,onPointerUp:C}){const{t:k}=Ce(),{accounts:w}=n,D=Math.max(1,i*Math.max(1,w.length));return p.jsxs("div",{"data-provider-node":!0,onPointerDown:x,onPointerMove:v,onPointerUp:C,onPointerCancel:C,className:q("group relative w-full rounded-xl p-4 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border-2 border-border/50 dark:border-white/[0.08]",!r&&"animate-subtle-float animate-border-glow","select-none touch-none",d!==null&&"scale-[1.02]",r&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${e}60`,borderColor:d!==null?`${e}80`:void 0,transform:`translate(${c.x}px, ${c.y}px)${r?" scale(1.05)":""}`},children:[p.jsx(Qh,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),p.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${e}30`}}),p.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),f&&p.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),g&&p.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),m&&p.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:e,boxShadow:"0 0 0 4px var(--background)"}}),p.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[p.jsx("div",{className:"animate-icon-breathe",children:p.jsx(Gb,{provider:n.provider,size:36,withBackground:!0})}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),p.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:k("flowViz.provider")})]})]}),p.jsxs("div",{className:"space-y-2 relative z-10",children:[p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:k(o?"flowViz.visibleTotalRequests":"flowViz.totalRequests")}),p.jsx("span",{className:"text-foreground font-mono",children:t.toLocaleString()})]}),p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:k(o?"flowViz.visibleAccounts":"flowViz.accounts")}),p.jsx("span",{className:"text-foreground font-mono",children:w.length})]}),p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:p.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,t/D*100)}%`,backgroundColor:e}})}),o&&a>0&&p.jsx("div",{className:"text-[10px] text-muted-foreground",children:k("flowViz.excludingPausedAccounts",{count:a})})]})]})}function pH({paths:n,accounts:e,maxRequests:t,hoveredAccount:i,pulsingAccounts:o}){return p.jsxs(p.Fragment,{children:[p.jsx("defs",{children:p.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[p.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),p.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((a,r)=>{const c=e[r];if(!c)return null;const d=c.successCount+c.failureCount,f=Math.max(2,d/t*10),g=i===r,m=i!==null&&i!==r,x=o.has(c.id),v=uB(r);return p.jsxs("g",{children:[p.jsx("path",{d:a,fill:"none",stroke:v,strokeWidth:f,strokeOpacity:g?.8:m?.15:.4,strokeLinecap:"round",filter:g?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),x&&p.jsxs(p.Fragment,{children:[p.jsx("path",{d:a,fill:"none",stroke:c.color,strokeWidth:f*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),p.jsx("circle",{r:6,fill:c.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${a}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},r)})]})}function gH({onBack:n,showDetails:e,onToggleDetails:t,showPausedAccounts:i,pausedAccountsCount:o,onTogglePausedAccounts:a,hasCustomPositions:r,onResetPositions:c}){const{t:d}=Ce();return p.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[n?p.jsxs("button",{onClick:n,className:"group flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md hover:bg-muted/50 border border-transparent hover:border-border/50",children:[p.jsx(Vh,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),p.jsx("span",{children:d("flowViz.backToProviders")})]}):p.jsx("div",{}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{onClick:t,className:q("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",e?"bg-primary text-primary-foreground border-primary hover:bg-primary/90":"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50"),children:[e?p.jsx(Kc,{className:"w-3.5 h-3.5"}):p.jsx(Vc,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:d(e?"flowViz.hideDetails":"flowViz.showDetails")})]}),o>0&&p.jsxs("button",{onClick:a,className:q("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",i?"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50":"bg-amber-500/15 text-amber-700 border-amber-500/40 hover:bg-amber-500/20 dark:bg-amber-500/20 dark:text-amber-300 dark:border-amber-500/30"),children:[p.jsx(LE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:i?d("flowViz.hidePausedAccounts",{count:o}):d("flowViz.showPausedAccounts",{count:o})})]}),r&&p.jsxs("button",{onClick:c,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md border border-border/60 hover:border-border bg-background hover:bg-muted/50 shadow-sm",children:[p.jsx(RE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:d("flowViz.resetLayout")})]})]})]})}const Wk="ccs-auth-monitor-show-paused";function mH({providerData:n,onBack:e,onPauseToggle:t,isPausingAccount:i}){const o=A.useRef(null),a=A.useRef(null),[r,c]=A.useState(null),[d,f]=A.useState(!1),[g,m]=A.useState(()=>{if(typeof window<"u"){const Te=localStorage.getItem(Wk);return Te!==null?Te==="true":!0}return!0}),[x,v]=A.useState([]),{privacyMode:C}=kb(),{accounts:k}=n,w=A.useMemo(()=>k.filter(Te=>Te.paused).length,[k]),D=A.useMemo(()=>g?k:k.filter(Te=>!Te.paused),[k,g]),O=A.useMemo(()=>new Set(D.map(Te=>Te.id)),[D]),M=Math.max(...D.map(Te=>Te.successCount+Te.failureCount),1),T=D.reduce((Te,Ye)=>Te+Ye.successCount+Ye.failureCount,0),L=A.useMemo(()=>({...n,accounts:D,totalRequests:T}),[n,D,T]),N=A.useCallback(()=>{const Te=fB({containerRef:o,svgRef:a,accounts:D});v(Te)},[D]),I=`ccs-flow-positions-${n.provider}`,{dragOffsets:K,draggingId:U,handlePointerDown:z,handlePointerMove:X,handlePointerUp:_,getOffset:V,resetPositions:ie,hasCustomPositions:oe}=mB({storageKey:I,onDrag:N}),B=A.useMemo(()=>Object.fromEntries(Object.entries(K).filter(([Te])=>Te==="provider"||O.has(Te))),[K,O]),Z=yB(B),se=Object.keys(B).length>0,Y=bB(D),ae=A.useMemo(()=>hB(D).slice(0,cB),[D]);A.useEffect(()=>{const Te=setTimeout(N,50);return window.addEventListener("resize",N),()=>{clearTimeout(Te),window.removeEventListener("resize",N)}},[N]),A.useEffect(()=>{const Te=setTimeout(N,10);return()=>clearTimeout(Te)},[K,N]),A.useEffect(()=>{const Te=Date.now(),Ye=350,it=()=>{N(),Date.now()-Te<Ye&&requestAnimationFrame(it)};requestAnimationFrame(it)},[d,N]);const de=Hb[n.provider.toLowerCase()]||"#6b7280",be=A.useMemo(()=>pB(D),[D]),{leftAccounts:te,rightAccounts:le,topAccounts:xe,bottomAccounts:Se}=be,ye=le.length>0,Oe=xe.length>0,je=Se.length>0,nt=A.useMemo(()=>gB(D.length),[D.length]),Pt=(Te,Ye)=>Te.map(it=>{const ln=D.findIndex(Sn=>Sn.id===it.id);return p.jsx(hH,{account:it,zone:Ye,originalIndex:ln,isHovered:r===ln,isDragging:U===it.id,offset:V(it.id),showDetails:d,privacyMode:C,onMouseEnter:()=>c(ln),onMouseLeave:()=>c(null),onPointerDown:Sn=>z(it.id,Sn),onPointerMove:X,onPointerUp:_,onPauseToggle:t,isPausingAccount:i},it.id)});return p.jsxs("div",{className:"flex flex-col",ref:o,children:[p.jsx(gH,{onBack:e,showDetails:d,onToggleDetails:()=>f(!d),showPausedAccounts:g,pausedAccountsCount:w,onTogglePausedAccounts:()=>{c(null);const Te=!g;m(Te),typeof window<"u"&&localStorage.setItem(Wk,String(Te))},hasCustomPositions:oe&&se,onResetPositions:ie}),p.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[p.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+Z.paddingTop}px`,paddingBottom:`${24+Z.paddingBottom}px`,minHeight:`${320+Z.extraHeight}px`},children:[p.jsx("svg",{ref:a,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:p.jsx(pH,{paths:x,accounts:D,maxRequests:M,hoveredAccount:r,pulsingAccounts:Y})}),Oe&&p.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:Pt(xe,"top")}),p.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[p.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Pt(te,"left")}),p.jsx("div",{className:q("z-10 flex items-center flex-shrink-0",nt),children:p.jsx(fH,{providerData:L,providerColor:de,totalRequests:T,maxRequests:M,showVisibleMetrics:!g&&w>0,hiddenPausedCount:g?0:w,isDragging:U==="provider",offset:V("provider"),hoveredAccount:r,hasRightAccounts:ye,hasTopAccounts:Oe,hasBottomAccounts:je,onPointerDown:Te=>z("provider",Te),onPointerMove:X,onPointerUp:_})}),ye&&p.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Pt(le,"right")})]}),je&&p.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:Pt(Se,"bottom")})]}),p.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:p.jsx("div",{className:"absolute inset-0",children:p.jsx(xB,{events:ae,privacyMode:C})})})]})]})}function yH(n,e){return`${n.trim().toLowerCase()}:${e.trim()}`}function bH(n,e){const t=Array.from(new Set([e.id,e.email].filter(i=>!!i?.trim())));for(const i of t){const o=yH(e.provider,i),a=n?.accountStats?.[o]??n?.accountStats?.[i];if(a)return a}}const Qk={business:0,personal:1,free:2,unknown:3};function xH(n,e){return e?n?new Date(e).getTime()>new Date(n).getTime()?e:n:e:n}function vH(n,e){const t=Fb(n.id,n.email,n.tokenFile),i=bH(e,n);return{id:n.id,email:t.email||n.email||n.id,tokenFile:n.tokenFile,isDefault:n.isDefault,successCount:i?.successCount??0,failureCount:i?.failureCount??0,lastUsedAt:i?.lastUsedAt??n.lastUsedAt,paused:n.paused,tier:n.tier,audience:t.audience,audienceLabel:t.audienceLabel,detailLabel:t.detailLabel,compactDetailLabel:t.compactDetailLabel,inlineLabel:t.inlineLabel}}function CH(n){return[...n].sort((e,t)=>{const i=Qk[e.audience]-Qk[t.audience];if(i!==0)return i;const o=e.inlineLabel??e.audienceLabel??e.detailLabel??e.id,a=t.inlineLabel??t.audienceLabel??t.detailLabel??t.id;return o.localeCompare(a)})}function SH(n,e){const t=new Map,i=new Map;for(const o of n){const a=vH(o,e),c=o.provider.toLowerCase()==="codex"?`${o.provider}:${a.email}`:o.id;t.has(c)||t.set(c,[]),t.get(c)?.push(a),i.set(o.id,o)}return Array.from(t.entries()).map(([o,a])=>{if(a.length===1){const[f]=a,g=i.get(f.id);return{id:f.id,email:f.email,tokenFile:f.tokenFile,provider:g?.provider??"codex",isDefault:f.isDefault,successCount:f.successCount,failureCount:f.failureCount,lastUsedAt:f.lastUsedAt,paused:f.paused,tier:f.tier,projectId:g?.projectId}}const r=CH(a),c=r[0]?.email??o,d=i.get(r[0]?.id??"")?.provider??"codex";return{id:o,email:c,tokenFile:r[0]?.tokenFile??"",provider:d,isDefault:r.some(f=>f.isDefault),successCount:r.reduce((f,g)=>f+g.successCount,0),failureCount:r.reduce((f,g)=>f+g.failureCount,0),lastUsedAt:r.reduce((f,g)=>xH(f,g.lastUsedAt),void 0),paused:r.every(f=>!!f.paused),memberIds:r.map(f=>f.id),variants:r}})}function nD(n,e){const t=n+e;return t===0?100:Math.round(n/t*100)}const Yk=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function kH(){const{data:n,isLoading:e,error:t}=Gj(),{data:i,isLoading:o,dataUpdatedAt:a}=KB(),[r,c]=A.useState("");A.useEffect(()=>{if(!a)return;const C=()=>{const w=Math.floor((Date.now()-a)/1e3);w<60?c(`${w}s ago`):c(`${Math.floor(w/60)}m ago`)};C();const k=setInterval(C,1e3);return()=>clearInterval(k)},[a]);const{accounts:d,totalSuccess:f,totalFailure:g,totalRequests:m,providerStats:x}=A.useMemo(()=>{if(!n?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const C=[],k=new Map;let w=0,D=0,O=0;n.authStatus.forEach(T=>{const L=T.provider;k.has(L)||k.set(L,{success:0,failure:0,accounts:[]});const N=k.get(L);if(!N)return;const I=(T.accounts??[]).map(K=>({...K,provider:K.provider||T.provider}));SH(I,i).forEach(K=>{w+=K.successCount,D+=K.failureCount,N.success+=K.successCount,N.failure+=K.failureCount;const U={id:K.id,email:K.email,tokenFile:K.tokenFile,provider:T.provider,displayName:T.displayName,isDefault:K.isDefault,successCount:K.successCount,failureCount:K.failureCount,lastUsedAt:K.lastUsedAt,color:Yk[O%Yk.length],projectId:K.projectId,paused:K.paused,tier:K.tier,memberIds:K.memberIds,variants:K.variants};C.push(U),N.accounts.push(U),O++})});const M=[];return k.forEach((T,L)=>{T.accounts.length!==0&&M.push({provider:L,displayName:_b(L),totalRequests:T.success+T.failure,successCount:T.success,failureCount:T.failure,accountCount:T.accounts.length,accounts:T.accounts})}),M.sort((T,L)=>L.totalRequests-T.totalRequests),{accounts:C,totalSuccess:w,totalFailure:D,totalRequests:w+D,providerStats:M}},[n?.authStatus,i]),v=m>0?Math.round(f/m*100):100;return{accounts:d,totalSuccess:f,totalFailure:g,totalRequests:m,providerStats:x,overallSuccessRate:v,isLoading:e||o,error:t??null,timeSinceUpdate:r}}function wH(){return p.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[p.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Ln.success}}),p.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Ln.success}}),p.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Ln.success}})]})}function AH({success:n,failure:e}){const{t}=Ce();return n===0&&e===0?p.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:t("authMonitorLive.noActivity")}):p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx(Wc,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),p.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:n.toLocaleString()})]}),e>0&&p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx(vb,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),p.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:e.toLocaleString()})]})]})}function PH({stats:n,isHovered:e,privacyMode:t,onSelect:i,onMouseEnter:o,onMouseLeave:a}){const{t:r}=Ce(),c=nD(n.successCount,n.failureCount),d=Hb[n.provider.toLowerCase()]||"#6b7280";return p.jsxs("button",{onClick:i,onMouseEnter:o,onMouseLeave:a,className:q("group relative rounded-xl p-4 text-left transition-all duration-300","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]","hover:border-opacity-50 hover:scale-[1.02] hover:shadow-lg",e&&"ring-1"),style:{borderColor:e?d:void 0,"--ring-color":d},children:[p.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[p.jsx(Gb,{provider:n.provider,size:36,withBackground:!0}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),p.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[n.accountCount," account",n.accountCount!==1?"s":""]})]}),p.jsx(Vh,{className:q("w-4 h-4 ml-auto text-muted-foreground transition-all",e?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex justify-between items-center text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:r("authMonitorLive.stats")}),p.jsx(AH,{success:n.successCount,failure:n.failureCount})]}),p.jsxs("div",{className:"flex justify-between text-xs",children:[p.jsx("span",{className:"text-muted-foreground",children:r("authMonitorLive.successRate")}),p.jsxs("span",{className:"font-mono font-semibold",style:{color:c===100?Ln.success:c>=95?Ln.degraded:Ln.failed},children:[c,"%"]})]}),p.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:p.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,backgroundColor:d}})})]}),p.jsxs("div",{className:"flex gap-1 mt-3 items-center",children:[n.accounts.slice(0,5).map(f=>{const g=n.provider==="agy"&&!f.projectId;return p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:q("w-2 h-2 rounded-full",f.paused&&"opacity-50"),style:{backgroundColor:f.color},title:t?"••••••":DB(f.id,f.email,f.tokenFile)}),g&&p.jsx(pa,{children:p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsx(Qi,{className:"absolute -top-1 -right-1 w-2.5 h-2.5 text-amber-500","aria-label":r("providerCard.missingProjectIdAria")})}),p.jsx(No,{side:"top",className:"text-xs",children:"Missing Project ID - re-add account to fix"})]})})]},f.id)}),n.accounts.length>5&&p.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",n.accounts.length-5]})]})]})}function wd({icon:n,label:e,value:t,color:i}){return p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 dark:bg-zinc-900/50 border border-border/50 dark:border-white/[0.06]",children:[p.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:i?`${i}15`:"var(--muted)",color:i||"var(--muted-foreground)"},children:n}),p.jsxs("div",{children:[p.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:e}),p.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:i||"var(--foreground)"},children:t})]})]})}const am="auth-monitor-selected-provider";function DH(){const{t:n}=Ce(),{accounts:e,totalSuccess:t,totalFailure:i,totalRequests:o,providerStats:a,overallSuccessRate:r,isLoading:c,error:d,timeSinceUpdate:f}=kH(),{privacyMode:g}=kb(),[m,x]=A.useState(()=>typeof window<"u"?localStorage.getItem(am):null),v=_=>{x(_),_?localStorage.setItem(am,_):localStorage.removeItem(am)},C=A.useMemo(()=>m&&a.some(_=>_.provider===m)?m:null,[m,a]),[k,w]=A.useState(null),D=Kj(),O=Vj(),M=Wj(),T=Qj(),L=C?a.find(_=>_.provider===C):null,N=L?.accountCount??e.length,I=L?.successCount??t,K=L?.failureCount??i,U=L?.totalRequests??o,z=L?nD(L.successCount,L.failureCount):r,X=(_,V)=>{if(!C||D.isPending||O.isPending||M.isPending||T.isPending)return;if(_.length>1){V?M.mutate({provider:C,accountIds:_}):T.mutate({provider:C,accountIds:_});return}const[ie]=_;ie&&(V?D.mutate({provider:C,accountId:ie}):O.mutate({provider:C,accountId:ie}))};return c?p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(_=>p.jsx(tt,{className:"h-16 flex-1 rounded-lg"},_))}),p.jsx(tt,{className:"h-48 w-full rounded-lg"})]})]}):d||e.length===0?null:p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-gradient-to-r from-emerald-500/5 via-transparent to-transparent dark:from-emerald-500/10",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(wH,{}),p.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:n("authMonitorLive.live")}),p.jsx("span",{className:"text-[10px] text-muted-foreground",children:n("authMonitorLive.accountMonitor")})]}),p.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(EE,{className:"w-3 h-3 animate-pulse"}),p.jsx("span",{children:f?n("authMonitorLive.updated",{time:f}):n("authMonitorLive.updatedNow")})]}),p.jsx("span",{className:"text-muted-foreground/50",children:"|"}),p.jsx("span",{children:n("authMonitor.accountsCount",{count:N})}),p.jsxs("span",{className:"font-mono",children:[U.toLocaleString()," ",n("authMonitorLive.requestsLabel")]})]})]}),p.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[p.jsx(wd,{icon:p.jsx(bc,{className:"w-4 h-4"}),label:n("authMonitor.accounts"),value:N,color:"var(--accent)"}),p.jsx(wd,{icon:p.jsx(Wc,{className:"w-4 h-4"}),label:n("authMonitor.success"),value:I.toLocaleString(),color:Ln.success}),p.jsx(wd,{icon:p.jsx(vb,{className:"w-4 h-4"}),label:n("authMonitor.failed"),value:K.toLocaleString(),color:K>0?Ln.failed:void 0}),p.jsx(wd,{icon:p.jsx(bc,{className:"w-4 h-4"}),label:n("authMonitor.successRate"),value:`${z}%`,color:z===100?Ln.success:z>=95?Ln.degraded:Ln.failed})]}),p.jsx("div",{className:"relative overflow-hidden",children:L?p.jsx(mH,{providerData:L,onBack:()=>v(null),onPauseToggle:X,isPausingAccount:D.isPending||O.isPending||M.isPending||T.isPending}):p.jsxs("div",{className:"p-6",children:[p.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),p.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(_=>p.jsx(PH,{stats:_,isHovered:k===_.provider,privacyMode:g,onSelect:()=>v(_.provider),onMouseEnter:()=>w(_.provider),onMouseLeave:()=>w(null)},_.provider))})]})})]})}const sf=A.createContext(null);sf.displayName="PanelGroupContext";const Mt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Kb=10,la=A.useLayoutEffect,$k=uE.useId,OH=typeof $k=="function"?$k:()=>null;let TH=0;function Vb(n=null){const e=OH(),t=A.useRef(n||e||null);return t.current===null&&(t.current=""+TH++),n??t.current}function iD({children:n,className:e="",collapsedSize:t,collapsible:i,defaultSize:o,forwardedRef:a,id:r,maxSize:c,minSize:d,onCollapse:f,onExpand:g,onResize:m,order:x,style:v,tagName:C="div",...k}){const w=A.useContext(sf);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:D,expandPanel:O,getPanelSize:M,getPanelStyle:T,groupId:L,isPanelCollapsed:N,reevaluatePanelConstraints:I,registerPanel:K,resizePanel:U,unregisterPanel:z}=w,X=Vb(r),_=A.useRef({callbacks:{onCollapse:f,onExpand:g,onResize:m},constraints:{collapsedSize:t,collapsible:i,defaultSize:o,maxSize:c,minSize:d},id:X,idIsFromProps:r!==void 0,order:x});A.useRef({didLogMissingDefaultSizeWarning:!1}),la(()=>{const{callbacks:ie,constraints:oe}=_.current,B={...oe};_.current.id=X,_.current.idIsFromProps=r!==void 0,_.current.order=x,ie.onCollapse=f,ie.onExpand=g,ie.onResize=m,oe.collapsedSize=t,oe.collapsible=i,oe.defaultSize=o,oe.maxSize=c,oe.minSize=d,(B.collapsedSize!==oe.collapsedSize||B.collapsible!==oe.collapsible||B.maxSize!==oe.maxSize||B.minSize!==oe.minSize)&&I(_.current,B)}),la(()=>{const ie=_.current;return K(ie),()=>{z(ie)}},[x,X,K,z]),A.useImperativeHandle(a,()=>({collapse:()=>{D(_.current)},expand:ie=>{O(_.current,ie)},getId(){return X},getSize(){return M(_.current)},isCollapsed(){return N(_.current)},isExpanded(){return!N(_.current)},resize:ie=>{U(_.current,ie)}}),[D,O,M,N,X,U]);const V=T(_.current,o);return A.createElement(C,{...k,children:n,className:e,id:X,style:{...V,...v},[Mt.groupId]:L,[Mt.panel]:"",[Mt.panelCollapsible]:i||void 0,[Mt.panelId]:X,[Mt.panelSize]:parseFloat(""+V.flexGrow).toFixed(1)})}const Sc=A.forwardRef((n,e)=>A.createElement(iD,{...n,forwardedRef:e}));iD.displayName="Panel";Sc.displayName="forwardRef(Panel)";let dy=null,eh=-1,ds=null;function MH(n,e,t){const i=(e&lD)!==0,o=(e&cD)!==0,a=(e&uD)!==0,r=(e&dD)!==0;if(e){if(i)return a?"se-resize":r?"ne-resize":"e-resize";if(o)return a?"sw-resize":r?"nw-resize":"w-resize";if(a)return"s-resize";if(r)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function NH(){ds!==null&&(document.head.removeChild(ds),dy=null,ds=null,eh=-1)}function rm(n,e,t){var i,o;const a=MH(n,e);if(dy!==a){if(dy=a,ds===null&&(ds=document.createElement("style"),document.head.appendChild(ds)),eh>=0){var r;(r=ds.sheet)===null||r===void 0||r.removeRule(eh)}eh=(i=(o=ds.sheet)===null||o===void 0?void 0:o.insertRule(`*{cursor: ${a} !important;}`))!==null&&i!==void 0?i:-1}}function oD(n){return n.type==="keydown"}function sD(n){return n.type.startsWith("pointer")}function aD(n){return n.type.startsWith("mouse")}function af(n){if(sD(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(aD(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function LH(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function RH(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function EH(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:Zk(n),b:Zk(e)};let i;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),i=n;Be(i,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Jk(Xk(t.a)),b:Jk(Xk(t.b))};if(o.a===o.b){const a=i.childNodes,r={a:t.a.at(-1),b:t.b.at(-1)};let c=a.length;for(;c--;){const d=a[c];if(d===r.a)return 1;if(d===r.b)return-1}}return Math.sign(o.a-o.b)}const IH=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function jH(n){var e;const t=getComputedStyle((e=rD(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function BH(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||jH(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||IH.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Xk(n){let e=n.length;for(;e--;){const t=n[e];if(Be(t,"Missing node"),BH(t))return t}return null}function Jk(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Zk(n){const e=[];for(;n;)e.push(n),n=rD(n);return e}function rD(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const lD=1,cD=2,uD=4,dD=8,HH=LH()==="coarse";let ki=[],wr=!1,hs=new Map,rf=new Map;const kc=new Set;function _H(n,e,t,i,o){var a;const{ownerDocument:r}=e,c={direction:t,element:e,hitAreaMargins:i,setResizeHandlerState:o},d=(a=hs.get(r))!==null&&a!==void 0?a:0;return hs.set(r,d+1),kc.add(c),gh(),function(){var g;rf.delete(n),kc.delete(c);const m=(g=hs.get(r))!==null&&g!==void 0?g:1;if(hs.set(r,m-1),gh(),m===1&&hs.delete(r),ki.includes(c)){const x=ki.indexOf(c);x>=0&&ki.splice(x,1),lf(),o("up",!0,null)}}}function UH(n){const{target:e}=n,{x:t,y:i}=af(n);wr=!0,Wb({target:e,x:t,y:i}),gh(),ki.length>0&&(mh("down",n),lf(),n.preventDefault(),hD(e)||n.stopImmediatePropagation())}function lm(n){const{x:e,y:t}=af(n);if(wr&&n.type!=="pointerleave"&&n.buttons===0&&(wr=!1,mh("up",n)),!wr){const{target:i}=n;Wb({target:i,x:e,y:t})}mh("move",n),lf(),ki.length>0&&n.preventDefault()}function cm(n){const{target:e}=n,{x:t,y:i}=af(n);rf.clear(),wr=!1,ki.length>0&&(n.preventDefault(),hD(e)||n.stopImmediatePropagation()),mh("up",n),Wb({target:e,x:t,y:i}),lf(),gh()}function hD(n){let e=n;for(;e;){if(e.hasAttribute(Mt.resizeHandle))return!0;e=e.parentElement}return!1}function Wb({target:n,x:e,y:t}){ki.splice(0);let i=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(i=n),kc.forEach(o=>{const{element:a,hitAreaMargins:r}=o,c=a.getBoundingClientRect(),{bottom:d,left:f,right:g,top:m}=c,x=HH?r.coarse:r.fine;if(e>=f-x&&e<=g+x&&t>=m-x&&t<=d+x){if(i!==null&&document.contains(i)&&a!==i&&!a.contains(i)&&!i.contains(a)&&EH(i,a)>0){let C=i,k=!1;for(;C&&!C.contains(a);){if(RH(C.getBoundingClientRect(),c)){k=!0;break}C=C.parentElement}if(k)return}ki.push(o)}})}function um(n,e){rf.set(n,e)}function lf(){let n=!1,e=!1;ki.forEach(i=>{const{direction:o}=i;o==="horizontal"?n=!0:e=!0});let t=0;rf.forEach(i=>{t|=i}),n&&e?rm("intersection",t):n?rm("horizontal",t):e?rm("vertical",t):NH()}let dm;function gh(){var n;(n=dm)===null||n===void 0||n.abort(),dm=new AbortController;const e={capture:!0,signal:dm.signal};kc.size&&(wr?(ki.length>0&&hs.forEach((t,i)=>{const{body:o}=i;t>0&&(o.addEventListener("contextmenu",cm,e),o.addEventListener("pointerleave",lm,e),o.addEventListener("pointermove",lm,e))}),hs.forEach((t,i)=>{const{body:o}=i;o.addEventListener("pointerup",cm,e),o.addEventListener("pointercancel",cm,e)})):hs.forEach((t,i)=>{const{body:o}=i;t>0&&(o.addEventListener("pointerdown",UH,e),o.addEventListener("pointermove",lm,e))}))}function mh(n,e){kc.forEach(t=>{const{setResizeHandlerState:i}=t,o=ki.includes(t);i(n,o,e)})}function zH(){const[n,e]=A.useState(0);return A.useCallback(()=>e(t=>t+1),[])}function Be(n,e){if(!n)throw console.error(e),Error(e)}function ga(n,e,t=Kb){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function So(n,e,t=Kb){return ga(n,e,t)===0}function Vn(n,e,t){return ga(n,e,t)===0}function FH(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],a=e[i];if(!Vn(o,a,t))return!1}return!0}function yr({panelConstraints:n,panelIndex:e,size:t}){const i=n[e];Be(i!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:a,maxSize:r=100,minSize:c=0}=i;if(ga(t,c)<0)if(a){const d=(o+c)/2;ga(t,d)<0?t=o:t=c}else t=c;return t=Math.min(r,t),t=parseFloat(t.toFixed(Kb)),t}function Jl({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:i,prevLayout:o,trigger:a}){if(Vn(n,0))return e;const r=[...e],[c,d]=i;Be(c!=null,"Invalid first pivot index"),Be(d!=null,"Invalid second pivot index");let f=0;if(a==="keyboard"){{const m=n<0?d:c,x=t[m];Be(x,`Panel constraints not found for index ${m}`);const{collapsedSize:v=0,collapsible:C,minSize:k=0}=x;if(C){const w=e[m];if(Be(w!=null,`Previous layout not found for panel index ${m}`),Vn(w,v)){const D=k-w;ga(D,Math.abs(n))>0&&(n=n<0?0-D:D)}}}{const m=n<0?c:d,x=t[m];Be(x,`No panel constraints found for index ${m}`);const{collapsedSize:v=0,collapsible:C,minSize:k=0}=x;if(C){const w=e[m];if(Be(w!=null,`Previous layout not found for panel index ${m}`),Vn(w,k)){const D=w-v;ga(D,Math.abs(n))>0&&(n=n<0?0-D:D)}}}}{const m=n<0?1:-1;let x=n<0?d:c,v=0;for(;;){const k=e[x];Be(k!=null,`Previous layout not found for panel index ${x}`);const D=yr({panelConstraints:t,panelIndex:x,size:100})-k;if(v+=D,x+=m,x<0||x>=t.length)break}const C=Math.min(Math.abs(n),Math.abs(v));n=n<0?0-C:C}{let x=n<0?c:d;for(;x>=0&&x<t.length;){const v=Math.abs(n)-Math.abs(f),C=e[x];Be(C!=null,`Previous layout not found for panel index ${x}`);const k=C-v,w=yr({panelConstraints:t,panelIndex:x,size:k});if(!Vn(C,w)&&(f+=C-w,r[x]=w,f.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?x--:x++}}if(FH(o,r))return o;{const m=n<0?d:c,x=e[m];Be(x!=null,`Previous layout not found for panel index ${m}`);const v=x+f,C=yr({panelConstraints:t,panelIndex:m,size:v});if(r[m]=C,!Vn(C,v)){let k=v-C,D=n<0?d:c;for(;D>=0&&D<t.length;){const O=r[D];Be(O!=null,`Previous layout not found for panel index ${D}`);const M=O+k,T=yr({panelConstraints:t,panelIndex:D,size:M});if(Vn(O,T)||(k-=T-O,r[D]=T),Vn(k,0))break;n>0?D--:D++}}}const g=r.reduce((m,x)=>x+m,0);return Vn(g,100)?r:o}function qH({layout:n,panelsArray:e,pivotIndices:t}){let i=0,o=100,a=0,r=0;const c=t[0];Be(c!=null,"No pivot index found"),e.forEach((m,x)=>{const{constraints:v}=m,{maxSize:C=100,minSize:k=0}=v;x===c?(i=k,o=C):(a+=k,r+=C)});const d=Math.min(o,100-a),f=Math.max(i,100-r),g=n[c];return{valueMax:d,valueMin:f,valueNow:g}}function wc(n,e=document){return Array.from(e.querySelectorAll(`[${Mt.resizeHandleId}][data-panel-group-id="${n}"]`))}function fD(n,e,t=document){const o=wc(n,t).findIndex(a=>a.getAttribute(Mt.resizeHandleId)===e);return o??null}function pD(n,e,t){const i=fD(n,e,t);return i!=null?[i,i+1]:[-1,-1]}function GH(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function gD(n,e=document){if(GH(e)&&e.dataset.panelGroupId==n)return e;const t=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return t||null}function cf(n,e=document){const t=e.querySelector(`[${Mt.resizeHandleId}="${n}"]`);return t||null}function KH(n,e,t,i=document){var o,a,r,c;const d=cf(e,i),f=wc(n,i),g=d?f.indexOf(d):-1,m=(o=(a=t[g])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,x=(r=(c=t[g+1])===null||c===void 0?void 0:c.id)!==null&&r!==void 0?r:null;return[m,x]}function VH({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:i,panelDataArray:o,panelGroupElement:a,setLayout:r}){A.useRef({didWarnAboutMissingResizeHandle:!1}),la(()=>{if(!a)return;const c=wc(t,a);for(let d=0;d<o.length-1;d++){const{valueMax:f,valueMin:g,valueNow:m}=qH({layout:i,panelsArray:o,pivotIndices:[d,d+1]}),x=c[d];if(x!=null){const v=o[d];Be(v,`No panel data found for index "${d}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(f)),x.setAttribute("aria-valuemin",""+Math.round(g)),x.setAttribute("aria-valuenow",m!=null?""+Math.round(m):"")}}return()=>{c.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[t,i,o,a]),A.useEffect(()=>{if(!a)return;const c=e.current;Be(c,"Eager values not found");const{panelDataArray:d}=c,f=gD(t,a);Be(f!=null,`No group found for id "${t}"`);const g=wc(t,a);Be(g,`No resize handles found for group id "${t}"`);const m=g.map(x=>{const v=x.getAttribute(Mt.resizeHandleId);Be(v,"Resize handle element has no handle id attribute");const[C,k]=KH(t,v,d,a);if(C==null||k==null)return()=>{};const w=D=>{if(!D.defaultPrevented)switch(D.key){case"Enter":{D.preventDefault();const O=d.findIndex(M=>M.id===C);if(O>=0){const M=d[O];Be(M,`No panel data found for index ${O}`);const T=i[O],{collapsedSize:L=0,collapsible:N,minSize:I=0}=M.constraints;if(T!=null&&N){const K=Jl({delta:Vn(T,L)?I-L:L-T,initialLayout:i,panelConstraints:d.map(U=>U.constraints),pivotIndices:pD(t,v,a),prevLayout:i,trigger:"keyboard"});i!==K&&r(K)}}break}}};return x.addEventListener("keydown",w),()=>{x.removeEventListener("keydown",w)}});return()=>{m.forEach(x=>x())}},[a,n,e,t,i,o,r])}function ew(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function mD(n,e){const t=n==="horizontal",{x:i,y:o}=af(e);return t?i:o}function WH(n,e,t,i,o){const a=t==="horizontal",r=cf(e,o);Be(r,`No resize handle element found for id "${e}"`);const c=r.getAttribute(Mt.groupId);Be(c,"Resize handle element has no group id attribute");let{initialCursorPosition:d}=i;const f=mD(t,n),g=gD(c,o);Be(g,`No group element found for id "${c}"`);const m=g.getBoundingClientRect(),x=a?m.width:m.height;return(f-d)/x*100}function QH(n,e,t,i,o,a){if(oD(n)){const r=t==="horizontal";let c=0;n.shiftKey?c=100:o!=null?c=o:c=10;let d=0;switch(n.key){case"ArrowDown":d=r?0:c;break;case"ArrowLeft":d=r?-c:0;break;case"ArrowRight":d=r?c:0;break;case"ArrowUp":d=r?0:-c;break;case"End":d=100;break;case"Home":d=-100;break}return d}else return i==null?0:WH(n,e,t,i,a)}function YH({panelDataArray:n}){const e=Array(n.length),t=n.map(a=>a.constraints);let i=0,o=100;for(let a=0;a<n.length;a++){const r=t[a];Be(r,`Panel constraints not found for index ${a}`);const{defaultSize:c}=r;c!=null&&(i++,e[a]=c,o-=c)}for(let a=0;a<n.length;a++){const r=t[a];Be(r,`Panel constraints not found for index ${a}`);const{defaultSize:c}=r;if(c!=null)continue;const d=n.length-i,f=o/d;i++,e[a]=f,o-=f}return e}function ur(n,e,t){e.forEach((i,o)=>{const a=n[o];Be(a,`Panel data not found for index ${o}`);const{callbacks:r,constraints:c,id:d}=a,{collapsedSize:f=0,collapsible:g}=c,m=t[d];if(m==null||i!==m){t[d]=i;const{onCollapse:x,onExpand:v,onResize:C}=r;C&&C(i,m),g&&(x||v)&&(v&&(m==null||So(m,f))&&!So(i,f)&&v(),x&&(m==null||!So(m,f))&&So(i,f)&&x())}})}function Ad(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function $H({defaultSize:n,dragState:e,layout:t,panelData:i,panelIndex:o,precision:a=3}){const r=t[o];let c;return r==null?c=n!=null?n.toFixed(a):"1":i.length===1?c="1":c=r.toFixed(a),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function XH(n,e=10){let t=null;return(...o)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...o)},e)}}function tw(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function yD(n){return`react-resizable-panels:${n}`}function bD(n){return n.map(e=>{const{constraints:t,id:i,idIsFromProps:o,order:a}=e;return o?i:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function xD(n,e){try{const t=yD(n),i=e.getItem(t);if(i){const o=JSON.parse(i);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function JH(n,e,t){var i,o;const a=(i=xD(n,t))!==null&&i!==void 0?i:{},r=bD(e);return(o=a[r])!==null&&o!==void 0?o:null}function ZH(n,e,t,i,o){var a;const r=yD(n),c=bD(e),d=(a=xD(n,o))!==null&&a!==void 0?a:{};d[c]={expandToSizes:Object.fromEntries(t.entries()),layout:i};try{o.setItem(r,JSON.stringify(d))}catch(f){console.error(f)}}function nw({layout:n,panelConstraints:e}){const t=[...n],i=t.reduce((a,r)=>a+r,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(a=>`${a}%`).join(", ")}`);if(!Vn(i,100)&&t.length>0)for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=100/i*r;t[a]=c}let o=0;for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=yr({panelConstraints:e,panelIndex:a,size:r});r!=c&&(o+=r-c,t[a]=c)}if(!Vn(o,0))for(let a=0;a<e.length;a++){const r=t[a];Be(r!=null,`No layout data found for index ${a}`);const c=r+o,d=yr({panelConstraints:e,panelIndex:a,size:c});if(r!==d&&(o-=d-r,t[a]=d,Vn(o,0)))break}return t}const e3=100,Zl={getItem:n=>(tw(Zl),Zl.getItem(n)),setItem:(n,e)=>{tw(Zl),Zl.setItem(n,e)}},iw={};function vD({autoSaveId:n=null,children:e,className:t="",direction:i,forwardedRef:o,id:a=null,onLayout:r=null,keyboardResizeBy:c=null,storage:d=Zl,style:f,tagName:g="div",...m}){const x=Vb(a),v=A.useRef(null),[C,k]=A.useState(null),[w,D]=A.useState([]),O=zH(),M=A.useRef({}),T=A.useRef(new Map),L=A.useRef(0),N=A.useRef({autoSaveId:n,direction:i,dragState:C,id:x,keyboardResizeBy:c,onLayout:r,storage:d}),I=A.useRef({layout:w,panelDataArray:[],panelDataArrayChanged:!1});A.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),A.useImperativeHandle(o,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:te}=I.current;return te},setLayout:te=>{const{onLayout:le}=N.current,{layout:xe,panelDataArray:Se}=I.current,ye=nw({layout:te,panelConstraints:Se.map(Oe=>Oe.constraints)});ew(xe,ye)||(D(ye),I.current.layout=ye,le&&le(ye),ur(Se,ye,M.current))}}),[]),la(()=>{N.current.autoSaveId=n,N.current.direction=i,N.current.dragState=C,N.current.id=x,N.current.onLayout=r,N.current.storage=d}),VH({committedValuesRef:N,eagerValuesRef:I,groupId:x,layout:w,panelDataArray:I.current.panelDataArray,setLayout:D,panelGroupElement:v.current}),A.useEffect(()=>{const{panelDataArray:te}=I.current;if(n){if(w.length===0||w.length!==te.length)return;let le=iw[n];le==null&&(le=XH(ZH,e3),iw[n]=le);const xe=[...te],Se=new Map(T.current);le(n,xe,Se,w,d)}},[n,w,d]),A.useEffect(()=>{});const K=A.useCallback(te=>{const{onLayout:le}=N.current,{layout:xe,panelDataArray:Se}=I.current;if(te.constraints.collapsible){const ye=Se.map(Pt=>Pt.constraints),{collapsedSize:Oe=0,panelSize:je,pivotIndices:nt}=Ys(Se,te,xe);if(Be(je!=null,`Panel size not found for panel "${te.id}"`),!So(je,Oe)){T.current.set(te.id,je);const Te=dr(Se,te)===Se.length-1?je-Oe:Oe-je,Ye=Jl({delta:Te,initialLayout:xe,panelConstraints:ye,pivotIndices:nt,prevLayout:xe,trigger:"imperative-api"});Ad(xe,Ye)||(D(Ye),I.current.layout=Ye,le&&le(Ye),ur(Se,Ye,M.current))}}},[]),U=A.useCallback((te,le)=>{const{onLayout:xe}=N.current,{layout:Se,panelDataArray:ye}=I.current;if(te.constraints.collapsible){const Oe=ye.map(it=>it.constraints),{collapsedSize:je=0,panelSize:nt=0,minSize:Pt=0,pivotIndices:Te}=Ys(ye,te,Se),Ye=le??Pt;if(So(nt,je)){const it=T.current.get(te.id),ln=it!=null&&it>=Ye?it:Ye,As=dr(ye,te)===ye.length-1?nt-ln:ln-nt,zt=Jl({delta:As,initialLayout:Se,panelConstraints:Oe,pivotIndices:Te,prevLayout:Se,trigger:"imperative-api"});Ad(Se,zt)||(D(zt),I.current.layout=zt,xe&&xe(zt),ur(ye,zt,M.current))}}},[]),z=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=I.current,{panelSize:Se}=Ys(xe,te,le);return Be(Se!=null,`Panel size not found for panel "${te.id}"`),Se},[]),X=A.useCallback((te,le)=>{const{panelDataArray:xe}=I.current,Se=dr(xe,te);return $H({defaultSize:le,dragState:C,layout:w,panelData:xe,panelIndex:Se})},[C,w]),_=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=I.current,{collapsedSize:Se=0,collapsible:ye,panelSize:Oe}=Ys(xe,te,le);return Be(Oe!=null,`Panel size not found for panel "${te.id}"`),ye===!0&&So(Oe,Se)},[]),V=A.useCallback(te=>{const{layout:le,panelDataArray:xe}=I.current,{collapsedSize:Se=0,collapsible:ye,panelSize:Oe}=Ys(xe,te,le);return Be(Oe!=null,`Panel size not found for panel "${te.id}"`),!ye||ga(Oe,Se)>0},[]),ie=A.useCallback(te=>{const{panelDataArray:le}=I.current;le.push(te),le.sort((xe,Se)=>{const ye=xe.order,Oe=Se.order;return ye==null&&Oe==null?0:ye==null?-1:Oe==null?1:ye-Oe}),I.current.panelDataArrayChanged=!0,O()},[O]);la(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:te,onLayout:le,storage:xe}=N.current,{layout:Se,panelDataArray:ye}=I.current;let Oe=null;if(te){const nt=JH(te,ye,xe);nt&&(T.current=new Map(Object.entries(nt.expandToSizes)),Oe=nt.layout)}Oe==null&&(Oe=YH({panelDataArray:ye}));const je=nw({layout:Oe,panelConstraints:ye.map(nt=>nt.constraints)});ew(Se,je)||(D(je),I.current.layout=je,le&&le(je),ur(ye,je,M.current))}}),la(()=>{const te=I.current;return()=>{te.layout=[]}},[]);const oe=A.useCallback(te=>{let le=!1;const xe=v.current;return xe&&window.getComputedStyle(xe,null).getPropertyValue("direction")==="rtl"&&(le=!0),function(ye){ye.preventDefault();const Oe=v.current;if(!Oe)return()=>null;const{direction:je,dragState:nt,id:Pt,keyboardResizeBy:Te,onLayout:Ye}=N.current,{layout:it,panelDataArray:ln}=I.current,{initialLayout:Sn}=nt??{},As=pD(Pt,te,Oe);let zt=QH(ye,te,je,nt,Te,Oe);const Bo=je==="horizontal";Bo&&le&&(zt=-zt);const Ps=ln.map(wa=>wa.constraints),gi=Jl({delta:zt,initialLayout:Sn??it,panelConstraints:Ps,pivotIndices:As,prevLayout:it,trigger:oD(ye)?"keyboard":"mouse-or-touch"}),ka=!Ad(it,gi);(sD(ye)||aD(ye))&&L.current!=zt&&(L.current=zt,!ka&&zt!==0?Bo?um(te,zt<0?lD:cD):um(te,zt<0?uD:dD):um(te,0)),ka&&(D(gi),I.current.layout=gi,Ye&&Ye(gi),ur(ln,gi,M.current))}},[]),B=A.useCallback((te,le)=>{const{onLayout:xe}=N.current,{layout:Se,panelDataArray:ye}=I.current,Oe=ye.map(it=>it.constraints),{panelSize:je,pivotIndices:nt}=Ys(ye,te,Se);Be(je!=null,`Panel size not found for panel "${te.id}"`);const Te=dr(ye,te)===ye.length-1?je-le:le-je,Ye=Jl({delta:Te,initialLayout:Se,panelConstraints:Oe,pivotIndices:nt,prevLayout:Se,trigger:"imperative-api"});Ad(Se,Ye)||(D(Ye),I.current.layout=Ye,xe&&xe(Ye),ur(ye,Ye,M.current))},[]),Z=A.useCallback((te,le)=>{const{layout:xe,panelDataArray:Se}=I.current,{collapsedSize:ye=0,collapsible:Oe}=le,{collapsedSize:je=0,collapsible:nt,maxSize:Pt=100,minSize:Te=0}=te.constraints,{panelSize:Ye}=Ys(Se,te,xe);Ye!=null&&(Oe&&nt&&So(Ye,ye)?So(ye,je)||B(te,je):Ye<Te?B(te,Te):Ye>Pt&&B(te,Pt))},[B]),se=A.useCallback((te,le)=>{const{direction:xe}=N.current,{layout:Se}=I.current;if(!v.current)return;const ye=cf(te,v.current);Be(ye,`Drag handle element not found for id "${te}"`);const Oe=mD(xe,le);k({dragHandleId:te,dragHandleRect:ye.getBoundingClientRect(),initialCursorPosition:Oe,initialLayout:Se})},[]),Y=A.useCallback(()=>{k(null)},[]),ae=A.useCallback(te=>{const{panelDataArray:le}=I.current,xe=dr(le,te);xe>=0&&(le.splice(xe,1),delete M.current[te.id],I.current.panelDataArrayChanged=!0,O())},[O]),de=A.useMemo(()=>({collapsePanel:K,direction:i,dragState:C,expandPanel:U,getPanelSize:z,getPanelStyle:X,groupId:x,isPanelCollapsed:_,isPanelExpanded:V,reevaluatePanelConstraints:Z,registerPanel:ie,registerResizeHandle:oe,resizePanel:B,startDragging:se,stopDragging:Y,unregisterPanel:ae,panelGroupElement:v.current}),[K,C,i,U,z,X,x,_,V,Z,ie,oe,B,se,Y,ae]),be={display:"flex",flexDirection:i==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return A.createElement(sf.Provider,{value:de},A.createElement(g,{...m,children:e,className:t,id:a,ref:v,style:{...be,...f},[Mt.group]:"",[Mt.groupDirection]:i,[Mt.groupId]:x}))}const Qb=A.forwardRef((n,e)=>A.createElement(vD,{...n,forwardedRef:e}));vD.displayName="PanelGroup";Qb.displayName="forwardRef(PanelGroup)";function dr(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Ys(n,e,t){const i=dr(n,e),a=i===n.length-1?[i-1,i]:[i,i+1],r=t[i];return{...e.constraints,panelSize:r,pivotIndices:a}}function t3({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:i}){A.useEffect(()=>{if(n||t==null||i==null)return;const o=cf(e,i);if(o==null)return;const a=r=>{if(!r.defaultPrevented)switch(r.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{r.preventDefault(),t(r);break}case"F6":{r.preventDefault();const c=o.getAttribute(Mt.groupId);Be(c,`No group element found for id "${c}"`);const d=wc(c,i),f=fD(c,e,i);Be(f!==null,`No resize element found for id "${e}"`);const g=r.shiftKey?f>0?f-1:d.length-1:f+1<d.length?f+1:0;d[g].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[i,n,e,t])}function Yb({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:i,id:o,onBlur:a,onClick:r,onDragging:c,onFocus:d,onPointerDown:f,onPointerUp:g,style:m={},tabIndex:x=0,tagName:v="div",...C}){var k,w;const D=A.useRef(null),O=A.useRef({onClick:r,onDragging:c,onPointerDown:f,onPointerUp:g});A.useEffect(()=>{O.current.onClick=r,O.current.onDragging=c,O.current.onPointerDown=f,O.current.onPointerUp=g});const M=A.useContext(sf);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:T,groupId:L,registerResizeHandle:N,startDragging:I,stopDragging:K,panelGroupElement:U}=M,z=Vb(o),[X,_]=A.useState("inactive"),[V,ie]=A.useState(!1),[oe,B]=A.useState(null),Z=A.useRef({state:X});la(()=>{Z.current.state=X}),A.useEffect(()=>{if(t)B(null);else{const de=N(z);B(()=>de)}},[t,z,N]);const se=(k=i?.coarse)!==null&&k!==void 0?k:15,Y=(w=i?.fine)!==null&&w!==void 0?w:5;A.useEffect(()=>{if(t||oe==null)return;const de=D.current;Be(de,"Element ref not attached");let be=!1;return _H(z,de,T,{coarse:se,fine:Y},(le,xe,Se)=>{if(!xe){_("inactive");return}switch(le){case"down":{_("drag"),be=!1,Be(Se,'Expected event to be defined for "down" action'),I(z,Se);const{onDragging:ye,onPointerDown:Oe}=O.current;ye?.(!0),Oe?.();break}case"move":{const{state:ye}=Z.current;be=!0,ye!=="drag"&&_("hover"),Be(Se,'Expected event to be defined for "move" action'),oe(Se);break}case"up":{_("hover"),K();const{onClick:ye,onDragging:Oe,onPointerUp:je}=O.current;Oe?.(!1),je?.(),be||ye?.();break}}})},[se,T,t,Y,N,z,oe,I,K]),t3({disabled:t,handleId:z,resizeHandler:oe,panelGroupElement:U});const ae={touchAction:"none",userSelect:"none"};return A.createElement(v,{...C,children:n,className:e,id:o,onBlur:()=>{ie(!1),a?.()},onFocus:()=>{ie(!0),d?.()},ref:D,role:"separator",style:{...ae,...m},tabIndex:x,[Mt.groupDirection]:T,[Mt.groupId]:L,[Mt.resizeHandle]:"",[Mt.resizeHandleActive]:X==="drag"?"pointer":V?"keyboard":void 0,[Mt.resizeHandleEnabled]:!t,[Mt.resizeHandleId]:z,[Mt.resizeHandleState]:X})}Yb.displayName="PanelResizeHandle";const Kr=A.forwardRef(({className:n,children:e,...t},i)=>p.jsxs($A,{ref:i,className:q("relative overflow-hidden",n),...t,children:[p.jsx(JR,{className:"h-full w-full rounded-[inherit]",children:e}),p.jsx(CD,{}),p.jsx(ZR,{})]}));Kr.displayName=$A.displayName;const CD=A.forwardRef(({className:n,orientation:e="vertical",...t},i)=>p.jsx(XA,{ref:i,orientation:e,className:q("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...t,children:p.jsx(eE,{className:"relative flex-1 rounded-full bg-border"})}));CD.displayName=XA.displayName;function n3(n){const e={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},t=n.match(/error-api-provider-([^-]+)-/);t&&(e.provider=t[1]);const i=n.match(/error-api-provider-[^-]+-(.+?)-\d{4}-\d{2}-\d{2}T/);i&&(e.endpoint=i[1].replace(/-/g,"/"));const o=n.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(o){const a=o[1],r=`${a.slice(0,10)}T${a.slice(11,13)}:${a.slice(13,15)}:${a.slice(15,17)}`;e.timestamp=new Date(r)}return e}function i3(n){const e={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown",model:null,quotaResetDelay:null,quotaResetTimestamp:null},t=n.split(/^===\s*(.+?)\s*===$/m);let i="";for(let o=0;o<t.length;o++){const a=t[o].trim();if(a==="REQUEST INFO"){i="request_info";continue}else if(a==="HEADERS"){i="headers";continue}else if(a==="REQUEST BODY"){i="request_body";continue}else if(a==="API RESPONSE"){i="";continue}else if(a==="RESPONSE"){i="response";continue}switch(i){case"request_info":o3(a,e);break;case"headers":e.requestHeaders=s3(a);break;case"request_body":e.requestBody=a;break;case"response":a3(a,e);break}}return r3(e),e}function o3(n,e){const t=n.split(`
14
+ `);for(const i of t){const[o,...a]=i.split(":"),r=a.join(":").trim();switch(o?.trim()?.toLowerCase()){case"version":e.version=r;break;case"url":e.url=r;break;case"method":e.method=r;break;case"timestamp":e.timestamp=r;break}}}function s3(n){const e={},t=n.split(`
15
+ `);for(const i of t){const o=i.indexOf(":");if(o>0){const a=i.slice(0,o).trim(),r=i.slice(o+1).trim();a&&(e[a]=r)}}return e}function a3(n,e){const t=n.split(`
16
+ `);let i=!1;const o=[];for(const a of t){if(a.startsWith("Status:")){const c=a.replace("Status:","").trim().split(/\s+/);e.statusCode=parseInt(c[0],10)||0,e.statusText=c.slice(1).join(" ")||u3(e.statusCode);continue}if(a.trim()===""&&!i){i=!0;continue}if(i)o.push(a);else{const r=a.indexOf(":");if(r>0){const c=a.slice(0,r).trim(),d=a.slice(r+1).trim();c&&(e.responseHeaders[c]=d)}}}e.responseBody=o.join(`
17
+ `).trim()}function r3(n){const e=n.url.match(/\/api\/provider\/([^/]+)/);e&&(n.provider=e[1]);const t=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);t&&(n.endpoint=t[1]),n.isClientError=n.statusCode>=400&&n.statusCode<500,n.isServerError=n.statusCode>=500,n.statusCode===429?n.errorType="rate_limit":n.statusCode===401||n.statusCode===403?n.errorType="auth":n.statusCode===404?n.errorType="not_found":n.statusCode>=500?n.errorType="server":(n.statusCode===408||n.statusCode===504)&&(n.errorType="timeout"),l3(n),n.statusCode===429&&c3(n)}function l3(n){if(n.requestBody)try{const e=JSON.parse(n.requestBody);typeof e.model=="string"&&(n.model=e.model)}catch{}}function c3(n){if(n.responseBody)try{const e=JSON.parse(n.responseBody),t=hy(e);t!==null&&(n.quotaResetDelay=t);const i=fy(e);i&&(n.quotaResetTimestamp=i)}catch{}}function hy(n){if(typeof n!="object"||n===null)return null;const e=n;if("quotaResetDelay"in e){const t=e.quotaResetDelay;if(typeof t=="number")return t;if(typeof t=="string"){const i=t.match(/^(\d+)s?$/);if(i)return parseInt(i[1],10)}}if("error"in e&&typeof e.error=="object"){const t=hy(e.error);if(t!==null)return t}if("details"in e&&Array.isArray(e.details))for(const t of e.details){const i=hy(t);if(i!==null)return i}return null}function fy(n){if(typeof n!="object"||n===null)return null;const e=n;for(const t of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(t in e&&typeof e[t]=="string")return e[t];if("error"in e&&typeof e.error=="object"){const t=fy(e.error);if(t)return t}if("details"in e&&Array.isArray(e.details))for(const t of e.details){const i=fy(t);if(i)return i}return null}function u3(n){return{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",408:"Request Timeout",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[n]||""}function d3(n,e){const t=Sb(),i=Date.now(),o=n*1e3,a=i-o,r=Math.floor(a/1e3),c=Math.floor(r/60),d=Math.floor(c/60),f=Math.floor(d/24);if(r<60){const m=t==="zh-CN",x=t==="vi";return m?"刚刚":x?"vừa xong":"just now"}if(c<60){const m=t==="zh-CN",x=t==="vi";return m?`${c} 分钟前`:x?`${c} phút trước`:`${c}m ago`}if(d<24){const m=t==="zh-CN",x=t==="vi";return m?`${d} 小时前`:x?`${d} giờ trước`:`${d}h ago`}if(f<7){const m=t==="zh-CN",x=t==="vi";return m?`${f} 天前`:x?`${f} ngày trước`:`${f}d ago`}return new Date(o).toLocaleDateString(t,{month:"short",day:"numeric"})}function h3(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function f3(n,e){const t=Sb();return t==="zh-CN"?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}[n]||"错误":t==="vi"?{rate_limit:"Quá giới hạn",auth:"Lỗi xác thực",not_found:"Không tìm thấy",server:"Lỗi máy chủ",timeout:"Hết thời gian chờ",unknown:"Lỗi"}[n]||"Lỗi":{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[n]||"Error"}function p3(n){if(n===null||n<=0)return null;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;const e=Math.floor(n/3600),t=Math.floor(n%3600/60);return t>0?`${e}h ${t}m`:`${e}h`}function g3(n,e){if(!n)return null;const t=Sb(),i=t==="zh-CN",o=t==="vi";try{const a=new Date(n),r=new Date,c=a.getTime()-r.getTime();if(c<=0)return i?"现在":o?"bây giờ":"now";const d=Math.floor(c/1e3);if(d<60)return i?`${d}秒`:o?`${d} giây`:`${d}s`;if(d<3600){const m=Math.floor(d/60);return i?`${m}分钟`:o?`${m} phút`:`${m}m`}const f=Math.floor(d/3600),g=Math.floor(d%3600/60);return i?g>0?`${f}小时 ${g}分钟`:`${f}小时`:o?g>0?`${f} giờ ${g} phút`:`${f} giờ`:g>0?`${f}h ${g}m`:`${f}h`}catch{return null}}function m3(n){return n?n===429?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":n>=500?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":n>=400?"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400":"bg-gray-100 text-gray-600":"bg-gray-100 text-gray-600"}function y3(n){return n||""}function b3({name:n,size:e,modified:t,isSelected:i,onClick:o,statusCode:a,model:r}){const c=A.useMemo(()=>n3(n),[n]),d=A.useMemo(()=>y3(r),[r]);return p.jsxs("button",{onClick:o,className:q("w-full px-2.5 py-2 flex items-center gap-2 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",i?"bg-muted/50 border-l-red-500":"border-l-transparent"),children:[p.jsx("span",{className:q("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",m3(a)),children:a||"???"}),p.jsx(Gb,{provider:c.provider,size:18,withBackground:!0,className:"shrink-0"}),p.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[p.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:c.endpoint||"unknown"}),d&&p.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:d,children:d}),p.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/60",children:[p.jsx(Rr,{className:"w-2.5 h-2.5"}),p.jsx("span",{children:d3(t)})]})]})]})}function ow({value:n,className:e,variant:t="outline",size:i="icon",label:o="Copy to clipboard"}){const[a,r]=A.useState(!1),c=()=>{navigator.clipboard.writeText(n),r(!0),setTimeout(()=>r(!1),2e3)};return p.jsx(pa,{children:p.jsxs(To,{children:[p.jsx(Mo,{asChild:!0,children:p.jsxs(mt,{size:i,variant:t,className:q("relative z-10 text-muted-foreground hover:text-foreground",e),onClick:d=>{d.stopPropagation(),c()},children:[a?p.jsx(Lr,{className:"h-3.5 w-3.5 text-green-500"}):p.jsx(dh,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"sr-only",children:o})]})}),p.jsx(No,{children:p.jsx("p",{children:a?"Copied!":o})})]})})}function ql({active:n,onClick:e,children:t,icon:i}){return p.jsxs("button",{onClick:e,className:q("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",n?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[i&&p.jsx(i,{className:"w-3.5 h-3.5"}),t]})}function SD({code:n}){const e=h3(n);return p.jsx("span",{className:q("inline-flex items-center justify-center min-w-[36px] px-2 py-0.5 rounded text-xs font-bold","bg-current/10 border border-current/20",e),children:n})}function x3({parsed:n}){const{t:e}=Ce(),t=p3(n.quotaResetDelay)||g3(n.quotaResetTimestamp),i=e("errorLogs.na");return p.jsx(Kr,{className:"h-full",children:p.jsxs("div",{className:"p-4 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(SD,{code:n.statusCode}),p.jsx("span",{className:"text-sm font-medium",children:n.statusText}),p.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:f3(n.errorType)})]}),n.model&&p.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[p.jsx(IE,{className:"w-4 h-4 text-violet-500 shrink-0"}),p.jsxs("div",{className:"text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:e("errorLogs.modelLabel")}),p.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:n.model})]})]}),n.errorType==="rate_limit"&&t&&p.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[p.jsx(Rr,{className:"w-4 h-4 text-amber-500 shrink-0"}),p.jsxs("div",{className:"text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:e("errorLogs.quotaResetsIn")}),p.jsx("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:t})]})]}),p.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.method")}),p.jsx("div",{className:"font-medium",children:n.method||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.provider")}),p.jsx("div",{className:"font-medium",children:n.provider||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.version")}),p.jsx("div",{className:"font-medium",children:n.version||i})]}),p.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[p.jsx("div",{className:"text-muted-foreground mb-1",children:e("errorLogs.endpoint")}),p.jsx("div",{className:"font-medium truncate",title:n.endpoint,children:n.endpoint||i})]})]}),p.jsxs("div",{className:"text-xs",children:[p.jsx("div",{className:"text-muted-foreground mb-1.5",children:e("errorLogs.url")}),p.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:n.url||i})]}),p.jsxs("div",{className:"text-xs",children:[p.jsx("div",{className:"text-muted-foreground mb-1.5",children:e("errorLogs.timestamp")}),p.jsx("div",{className:"font-mono",children:n.timestamp||i})]}),n.errorType!=="unknown"&&p.jsxs("div",{className:q("flex items-start gap-3 p-3 rounded text-xs",n.errorType==="rate_limit"?"bg-amber-500/10 border border-amber-500/20":n.errorType==="auth"?"bg-red-500/10 border border-red-500/20":"bg-blue-500/10 border border-blue-500/20"),children:[n.errorType==="rate_limit"?p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}):n.errorType==="auth"?p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-red-500 shrink-0"}):p.jsx(Yh,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),p.jsxs("div",{className:q("leading-relaxed",n.errorType==="rate_limit"?"text-amber-600 dark:text-amber-400":n.errorType==="auth"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),children:[n.errorType==="rate_limit"&&(n.model?e("errorLogs.rateLimitedMsg",{model:n.model}):e("errorLogs.rateLimitedMsgNoModel")),n.errorType==="auth"&&e("errorLogs.authFailedMsg"),n.errorType==="not_found"&&e("errorLogs.notFoundMsg"),n.errorType==="server"&&e("errorLogs.serverErrorMsg"),n.errorType==="timeout"&&e("errorLogs.timeoutMsg")]})]})]})})}function v3({headers:n}){const{t:e}=Ce(),t=Object.entries(n);return t.length===0?p.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:e("errorLogs.noHeaders")}):p.jsx(Kr,{className:"h-full",children:p.jsx("div",{className:"p-4 space-y-1",children:t.map(([i,o])=>p.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[p.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[i,":"]}),p.jsx("span",{className:"break-all",children:o})]},i))})})}function sw({content:n,label:e}){const{t}=Ce();if(!n||n.trim()===""){const a=e==="Request"?"errorLogs.noRequestBody":"errorLogs.noResponseBody";return p.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:t(a)})}let i=n,o=!1;try{const a=JSON.parse(n);i=JSON.stringify(a,null,2),o=!0}catch{}return p.jsx(Kr,{className:"h-full",children:p.jsx("pre",{className:q("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",o?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:i})})}function C3({content:n}){return p.jsx(Kr,{className:"h-full",children:p.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:n})})}function S3({name:n,absolutePath:e}){const{t}=Ce(),[i,o]=A.useState("overview"),{data:a,isLoading:r,error:c}=YB(n),d=A.useMemo(()=>a?i3(a):null,[a]);return n?r?p.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[p.jsx(tt,{className:"h-5 w-full"}),p.jsx(tt,{className:"h-5 w-3/4"}),p.jsx(tt,{className:"h-5 w-5/6"}),p.jsx(tt,{className:"h-5 w-2/3"})]}):c||!a||!d?p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsx("p",{className:"text-sm",children:t("errorLogs.failedLoadContent")})}):p.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[p.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[p.jsx(SD,{code:d.statusCode}),p.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[d.provider,"/",d.endpoint||"unknown"]}),n&&p.jsx(ow,{value:e||n,label:t("errorLogs.copyAbsolutePath"),size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),p.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a&&p.jsx(ow,{value:a,label:t("errorLogs.copyRawContent"),variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),p.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:d.method})]})]}),p.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-1 bg-muted/10 shrink-0 overflow-x-auto",children:[p.jsx(ql,{active:i==="overview",onClick:()=>o("overview"),icon:Yh,children:t("errorLogs.tabOverview")}),p.jsx(ql,{active:i==="headers",onClick:()=>o("headers"),icon:BE,children:t("errorLogs.tabHeaders")}),p.jsx(ql,{active:i==="request",onClick:()=>o("request"),icon:mP,children:t("errorLogs.tabRequest")}),p.jsx(ql,{active:i==="response",onClick:()=>o("response"),icon:HE,children:t("errorLogs.tabResponse")}),p.jsx(ql,{active:i==="raw",onClick:()=>o("raw"),icon:_E,children:t("errorLogs.tabRaw")})]}),p.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[i==="overview"&&p.jsx(x3,{parsed:d}),i==="headers"&&p.jsx(v3,{headers:d.requestHeaders}),i==="request"&&p.jsx(sw,{content:d.requestBody,label:t("errorLogs.tabRequest")}),i==="response"&&p.jsx(sw,{content:d.responseBody,label:t("errorLogs.tabResponse")}),i==="raw"&&p.jsx(C3,{content:a})]})]}):p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsxs("div",{className:"text-center space-y-3",children:[p.jsx(jE,{className:"w-10 h-10 mx-auto opacity-40"}),p.jsx("p",{className:"text-sm",children:t("errorLogs.selectLog")})]})})}function k3(){const{t:n}=Ce(),{data:e,isLoading:t}=GB(),{data:i,isLoading:o,error:a}=QB(e?.running??!1),[r,c]=A.useState(500),[d,f]=A.useState(!1),g=A.useRef(null),m=A.useRef(null),x=()=>{m.current&&(clearInterval(m.current),m.current=null)};A.useEffect(()=>{if(!d)return;const T=N=>{const I=g.current;if(!I)return;const U=I.getBoundingClientRect().top+window.scrollY,z=N.pageY-U;c(Math.max(300,z));const _=window.innerHeight-N.clientY,V=15;x(),_<50?m.current=setInterval(()=>{window.scrollBy(0,V)},16):N.clientY<50&&(m.current=setInterval(()=>{window.scrollBy(0,-V)},16))},L=()=>{f(!1),x(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",T),document.addEventListener("mouseup",L),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",L),document.body.style.cursor="default",document.body.style.userSelect="auto",x()}},[d]);const v=T=>{T.preventDefault(),f(!0)},C=A.useMemo(()=>i?.[0]?.name??null,[i]),[k,w]=A.useState(null),D=k??C,O=A.useMemo(()=>!D||!i?void 0:i.find(L=>L.name===D)?.absolutePath,[D,i]);if(t||!e?.running)return null;if(o)return p.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-sm bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm h-[500px]",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(T=>p.jsx(tt,{className:"h-12 w-full rounded-lg"},T))})]});if(!i||i.length===0)return null;const M=i.length;return p.jsxs("div",{ref:g,className:"rounded-xl border border-border overflow-hidden font-mono text-sm text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm flex flex-col shadow-sm transition-[height] duration-0 ease-linear relative group/container",style:{height:r},children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-gradient-to-r from-amber-500/10 via-transparent to-transparent dark:from-amber-500/15 shrink-0",children:[p.jsxs("div",{className:"flex items-center gap-2.5",children:[p.jsx(Qi,{className:"w-4 h-4 text-amber-500"}),p.jsx("span",{className:"text-sm font-semibold tracking-tight",children:n("errorLogs.title")}),p.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:n("errorLogs.failedRequests",{count:M})})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx(UE,{className:"w-3.5 h-3.5"}),p.jsx("span",{children:n("errorLogs.cliproxyDiagnostics")})]})]}),p.jsx("div",{className:"flex-1 min-h-0",children:p.jsxs(Qb,{direction:"horizontal",children:[p.jsx(Sc,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:p.jsxs(Kr,{className:"h-full",children:[p.jsx("div",{className:"divide-y divide-border/50",children:i.slice(0,50).map(T=>p.jsx(b3,{name:T.name,size:T.size,modified:T.modified,isSelected:D===T.name,onClick:()=>w(T.name),statusCode:T.statusCode,model:T.model},T.name))}),i.length>50&&p.jsx("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:n("errorLogs.showingCount",{total:i.length})})]})}),p.jsxs(Yb,{className:"w-[1px] bg-border hover:bg-primary/50 transition-colors flex items-center justify-center group relative z-10 w-2 -ml-1 flex items-center justify-center outline-none",children:[p.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),p.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-8 rounded-sm flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-muted border border-border",children:p.jsx(Qh,{className:"h-4 w-4 text-muted-foreground"})})]}),p.jsx(Sc,{className:"flex flex-col min-w-0 bg-background/50",children:p.jsx(S3,{name:D,absolutePath:O})})]})}),a?p.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:a.message}):p.jsx("div",{className:"h-2 bg-border/10 border-t border-border/30 hover:bg-primary/10 transition-colors cursor-row-resize flex items-center justify-center group/handle shrink-0",onMouseDown:v,children:p.jsx(zE,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const w3=$h("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-900/50 dark:bg-yellow-900/20 dark:text-yellow-200 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-500",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-200 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-500",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-200 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"}},defaultVariants:{variant:"default"}}),rc=A.forwardRef(({className:n,variant:e,...t},i)=>p.jsx("div",{ref:i,role:"alert",className:q(w3({variant:e}),n),...t}));rc.displayName="Alert";const yh=A.forwardRef(({className:n,...e},t)=>p.jsx("h5",{ref:t,className:q("mb-1 font-medium leading-none tracking-tight",n),...e}));yh.displayName="AlertTitle";const lc=A.forwardRef(({className:n,...e},t)=>p.jsx("div",{ref:t,className:q("text-sm [&_p]:leading-relaxed",n),...e}));lc.displayName="AlertDescription";function A3(){return jt({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function kD(n,e){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string"?n.error:e}function wD(n){const e=n.trim();if(!e)return null;try{return JSON.parse(e)}catch{return null}}function P3(n){const e=n.trim().toLowerCase();return e.startsWith("<!doctype html")||e.startsWith("<html")}function D3(n){if(!n||typeof n!="object")return!1;const e=n;return!(typeof e.content!="string"||"contentPath"in e&&typeof e.contentPath!="string")}async function AD(n,e){const t=await n.text(),i=wD(t);if(!n.ok){const o=kD(i,e);throw new Error(o)}if(i===null)throw new Error(e);return i}function O3(){return jt({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return AD(n,"Failed to fetch shared summary")}})}function OW(n){return jt({queryKey:["shared",n],enabled:n!=="settings",queryFn:async()=>{if(n==="settings")return{items:[]};const e=await fetch(`/api/shared/${n}`);return AD(e,`Failed to fetch shared ${n}`)}})}function TW(n,e){return jt({queryKey:["shared",n,"content",e],enabled:typeof e=="string"&&e.length>0,queryFn:async()=>{if(!e)throw new Error("Missing shared item path");const t=new URLSearchParams({type:n,path:e}),i=await fetch(`/api/shared/content?${t.toString()}`),o=await i.text(),a=wD(o);if(!i.ok)throw new Error(kD(a,`Failed to fetch shared ${n} content`));if(D3(a))return{content:a.content,contentPath:typeof a.contentPath=="string"&&a.contentPath.length>0?a.contentPath:e};if(o.trim().length>0){if(P3(o))throw new Error("Shared content endpoint unavailable. Restart `ccs config` and try again.");return{content:o,contentPath:e}}throw new Error(`Failed to fetch shared ${n} content`)}})}const T3={ok:"success",warning:"warning",error:"error"},M3={default:{iconBg:"bg-muted",iconColor:"text-muted-foreground"},success:{iconBg:"bg-green-600/15",iconColor:"text-green-700 dark:text-green-500"},warning:{iconBg:"bg-amber-500/15",iconColor:"text-amber-700 dark:text-amber-400"},error:{iconBg:"bg-red-600/15",iconColor:"text-red-700 dark:text-red-500"},accent:{iconBg:"bg-accent/15",iconColor:"text-accent"}};function Pd({title:n,value:e,icon:t,variant:i="default",onClick:o}){const a=M3[i];return p.jsxs("button",{onClick:o,className:q("flex items-center gap-3 px-4 py-2.5 rounded-lg border bg-card/50","transition-all hover:bg-card hover:shadow-sm hover:-translate-y-0.5","active:scale-[0.98]"),children:[p.jsx("div",{className:q("flex items-center justify-center w-9 h-9 rounded-md",a.iconBg),children:p.jsx(t,{className:q("w-4 h-4",a.iconColor)})}),p.jsxs("div",{className:"text-left",children:[p.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:n}),p.jsx("p",{className:q("text-lg font-bold font-mono leading-tight",a.iconColor),children:e})]})]})}function N3(){const{t:n}=Ce(),e=yb(),{data:t,isLoading:i}=A3(),{data:o,isLoading:a}=O3();if(i||a)return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx(tt,{className:"h-12 w-12 rounded-lg"}),p.jsxs("div",{children:[p.jsx(tt,{className:"h-7 w-[180px] mb-2"}),p.jsx(tt,{className:"h-4 w-[220px]"})]})]}),p.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(c=>p.jsx(tt,{className:"h-14 w-28 rounded-lg"},c))})]}),p.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[p.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[p.jsx(tt,{className:"h-4 w-32"}),p.jsx(tt,{className:"h-4 w-20"})]}),p.jsx("div",{className:"px-4 py-3 border-b",children:p.jsx(tt,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(c=>p.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[p.jsx(tt,{className:"w-2.5 h-2.5 rounded-full"}),p.jsx(tt,{className:"h-4 flex-1"}),p.jsx(tt,{className:"h-1.5 w-24 rounded-full"}),p.jsx(tt,{className:"h-4 w-16"})]},c))]})]});const r=t?.health?T3[t.health.status]:void 0;return p.jsxs("div",{className:"p-6 space-y-6",children:[p.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[p.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:p.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),p.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[p.jsx(lB,{version:t?.version}),p.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[p.jsx(Pd,{title:n("home.profiles"),value:t?.profiles??0,icon:ty,variant:"accent",onClick:()=>e("/providers")}),p.jsx(Pd,{title:n("home.cliproxy"),value:t?.cliproxy??0,icon:sP,variant:"accent",onClick:()=>e("/cliproxy")}),p.jsx(Pd,{title:n("home.accounts"),value:t?.accounts??0,icon:rP,variant:"default",onClick:()=>e("/accounts")}),p.jsx(Pd,{title:n("home.health"),value:t?.health?`${t.health.passed}/${t.health.total}`:"-",icon:bc,variant:r,onClick:()=>e("/health")})]})]})]}),o?.symlinkStatus&&!o.symlinkStatus.valid&&p.jsxs(rc,{variant:"warning",children:[p.jsx(Qi,{className:"h-4 w-4"}),p.jsx(yh,{children:n("home.configurationRequired")}),p.jsx(lc,{children:o.symlinkStatus.message})]}),p.jsx(DH,{}),p.jsx("div",{className:"rounded-xl border bg-card/70 p-5",children:p.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx("div",{className:"rounded-xl bg-muted p-2.5",children:p.jsx(cP,{className:"h-5 w-5 text-muted-foreground"})}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("h2",{className:"text-lg font-semibold",children:n("homePageV2.logsMoved")}),p.jsx("p",{className:"max-w-2xl text-sm text-muted-foreground",children:"Use the unified logs page for source-level filtering, structured entry inspection, and retention policy edits without crowding the home dashboard."})]})]}),p.jsxs(mt,{variant:"outline",className:"gap-2",onClick:()=>e("/logs"),children:["Open logs",p.jsx(FE,{className:"h-4 w-4"})]})]})}),p.jsx(k3,{})]})}const PD=tE,$b=A.forwardRef(({className:n,...e},t)=>p.jsx(JA,{ref:t,className:q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));$b.displayName=JA.displayName;const bh=A.forwardRef(({className:n,...e},t)=>p.jsx(ZA,{ref:t,className:q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...e}));bh.displayName=ZA.displayName;const py=A.forwardRef(({className:n,...e},t)=>p.jsx(eP,{ref:t,className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));py.displayName=eP.displayName;function yn({className:n,...e}){return p.jsx(nE,{"data-slot":"label",className:q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...e})}const Xb="ccs:openrouter-models",L3=1440*60*1e3,DD="1";function gy(n){const e=parseFloat(n);return isNaN(e)||e===0?0:e*1e6}function aw(n){const e=gy(n);return e===0?re.t("openrouterUtils.priceFree"):e<.01?re.t("openrouterUtils.priceLessThanCent"):e<1?`$${e.toFixed(2)}`:`$${e.toFixed(e<10?2:0)}`}function R3(n){const e=aw(n.prompt),t=aw(n.completion);return e===re.t("openrouterUtils.priceFree")&&t===re.t("openrouterUtils.priceFree")?re.t("openrouterUtils.priceFree"):`${e}/${t}`}function E3(n){const e=n.id.toLowerCase();return e.startsWith("anthropic/")?"anthropic":e.startsWith("openai/")?"openai":e.startsWith("google/")?"google":e.startsWith("meta-llama/")||e.startsWith("meta/")?"meta":e.startsWith("mistralai/")?"mistral":e.includes(":free")||e.includes("qwen")||e.includes("deepseek")?"opensource":"other"}function I3(n){return{...n,category:E3(n),pricePerMillionPrompt:gy(n.pricing.prompt),pricePerMillionCompletion:gy(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function j3(n,e,t){const i=e.toLowerCase().trim();return n.filter(o=>t?.category&&o.category!==t.category||t?.freeOnly&&!o.isFree||t?.minContext&&o.context_length<t.minContext?!1:i?o.id.toLowerCase().includes(i)||o.name.toLowerCase().includes(i)||o.description?.toLowerCase().includes(i):!0)}function MW(n){return[...n].sort((e,t)=>{if(e.isFree&&!t.isFree)return-1;if(!e.isFree&&t.isFree)return 1;if(!e.isFree&&!t.isFree){if(e.isExacto&&!t.isExacto)return-1;if(!e.isExacto&&t.isExacto)return 1}return e.name.localeCompare(t.name)})}function B3(){try{const n=localStorage.getItem(Xb);if(!n)return null;const e=JSON.parse(n);return e.version!==DD||Date.now()-e.fetchedAt>L3?null:e.models}catch{return null}}function H3(n){try{localStorage.setItem(Xb,JSON.stringify({models:n,fetchedAt:Date.now(),version:DD}))}catch{}}function _3(){localStorage.removeItem(Xb)}function NW(n,e){const[t]=n.split("/");if(!t)return{};const i=e.filter(r=>r.id.startsWith(`${t}/`));if(i.length===0)return{};const o=[...i].sort((r,c)=>c.pricePerMillionPrompt-r.pricePerMillionPrompt),a=Math.ceil(o.length/3);return{opus:o[0]?.id,sonnet:o[Math.min(a,o.length-1)]?.id,haiku:o[o.length-1]?.id}}function U3(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const LW={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},z3={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function F3(n,e=2){const t=[],i=["anthropic","openai","google","meta","mistral","opensource"];for(const o of i){const a=z3[o];if(a.length===0)continue;const c=[...n.filter(d=>a.some(f=>d.id.toLowerCase().startsWith(f)))].sort((d,f)=>(f.created??0)-(d.created??0));t.push(...c.slice(0,e))}return t.sort((o,a)=>(a.created??0)-(o.created??0))}function q3(n){const t=Date.now()/1e3-n;return t<86400?re.t("openrouterUtils.ageToday"):t<172800?re.t("openrouterUtils.ageYesterday"):t<604800?re.t("openrouterUtils.ageDaysAgo",{count:Math.floor(t/86400)}):t<2592e3?re.t("openrouterUtils.ageWeeksAgo",{count:Math.floor(t/604800)}):t<31536e3?re.t("openrouterUtils.ageMonthsAgo",{count:Math.floor(t/2592e3)}):re.t("openrouterUtils.ageYearsAgo",{count:Math.floor(t/31536e3)})}const G3="https://openrouter.ai/api/v1/models",OD=["openrouter-models"],rw=1440*60*1e3;async function K3(){const n=await fetch(G3);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const t=(await n.json()).data;return H3(t),t}function TD(){return jt({queryKey:OD,queryFn:K3,staleTime:rw,gcTime:rw,initialData:()=>B3()??void 0,refetchOnWindowFocus:!1})}function V3(){const n=TD(),e=(n.data??[]).map(I3);return{...n,models:e}}function RW(){const n=bt();return()=>(_3(),n.invalidateQueries({queryKey:OD}))}function EW(){const{data:n,isLoading:e,isError:t}=TD();return{isReady:!!n&&n.length>0,isLoading:e,isError:t,modelCount:n?.length??0}}function Jb({profileEnv:n={}}){const{t:e}=Ce(),[t,i]=A.useState(null),[o,a]=A.useState(!0),[r,c]=A.useState(!1);A.useEffect(()=>{d()},[]);const d=async()=>{try{a(!0);const v=await fetch("/api/global-env");if(!v.ok)throw new Error("Failed to load");const C=await v.json();i(C)}catch{i(null)}finally{a(!1)}};if(o||!t?.enabled)return null;const f=t.env||{},g=Object.keys(f);if(g.length===0)return null;const m=g.filter(v=>!(v in n)),x=g.filter(v=>v in n);return p.jsxs("div",{className:"border-t bg-muted/20",children:[p.jsxs("button",{onClick:()=>c(!r),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[p.jsx(Yh,{className:"w-4 h-4 text-blue-500"}),p.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[e("globalEnvIndicator.injectedCount",{count:m.length}),x.length>0&&p.jsx("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:e("globalEnvIndicator.overriddenCount",{count:x.length})})]}),r?p.jsx(xb,{className:"w-4 h-4 text-muted-foreground"}):p.jsx(Wh,{className:"w-4 h-4 text-muted-foreground"})]}),r&&p.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[m.length>0&&p.jsx("div",{className:"space-y-1",children:m.map(v=>p.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-green-500/10 text-green-700 dark:text-green-400 px-2 py-1 rounded",children:[p.jsx("span",{className:"text-green-500",children:"+"}),p.jsxs("span",{className:"truncate",children:[v,"=",f[v]]})]},v))}),x.length>0&&p.jsxs("div",{className:"space-y-1",children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("globalEnvIndicator.skippedLabel")}),x.map(v=>p.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-amber-500/10 text-amber-700 dark:text-amber-400 px-2 py-1 rounded",children:[p.jsx("span",{className:"text-amber-500",children:"~"}),p.jsx("span",{className:"truncate",children:v})]},v))]}),p.jsx("div",{className:"pt-2 border-t border-border/50",children:p.jsx(mt,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:p.jsxs(uh,{to:"/settings?tab=globalenv",children:[p.jsx(Cb,{className:"w-3.5 h-3.5"}),e("globalEnvIndicator.configureInSettings"),p.jsx(hP,{className:"w-3 h-3 opacity-50"})]})})})]})]})}function W3({className:n,...e}){return p.jsx(iE,{"data-slot":"switch",className:q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...e,children:p.jsx(oE,{"data-slot":"switch-thumb",className:q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Q3(n,e,t){return n(t==="refreshing"?"imageAnalysisStatus.refreshingPreview":t==="invalid"?"imageAnalysisStatus.savedStatus":e==="editor"?"imageAnalysisStatus.livePreview":"imageAnalysisStatus.savedStatus")}function Y3(n,e,t){return e.status==="disabled"?n("imageAnalysisStatus.disabledGlobally"):t!=="claude"?n("imageAnalysisStatus.targetBypassesHook",{target:n(`imageAnalysisStatus.targetLabel.${t}`)}):e.nativeReadPreference?n("imageAnalysisStatus.nativeImageReading"):e.status==="hook-missing"?n("imageAnalysisStatus.setupNeeded"):e.authReadiness==="missing"?n("imageAnalysisStatus.needsAuth"):e.proxyReadiness==="unavailable"?n("imageAnalysisStatus.needsProxy"):e.effectiveRuntimeMode==="native-read"?n("imageAnalysisStatus.nativeFallback"):n("imageAnalysisStatus.transformerReady")}function $3(n,e,t){return e.status==="disabled"?{label:n("imageAnalysisStatus.badgeDisabled"),className:"border-border/80 bg-background/85 text-muted-foreground"}:t!=="claude"?{label:n("imageAnalysisStatus.badgeBypassed"),className:"border-sky-500/25 bg-sky-500/10 text-sky-800 dark:text-sky-200"}:e.nativeReadPreference?{label:n("imageAnalysisStatus.badgeNative"),className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}:e.status==="hook-missing"||e.authReadiness==="missing"?{label:e.status==="hook-missing"?n("imageAnalysisStatus.badgeSetup"):n("imageAnalysisStatus.badgeAuth"),className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:e.proxyReadiness==="unavailable"?{label:n("imageAnalysisStatus.badgeProxy"),className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:{label:n("imageAnalysisStatus.badgeReady"),className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}}function X3(n,e,t){if(e.nativeReadPreference)return e.profileModel&&e.nativeImageCapable?n("imageAnalysisStatus.toggleSummaryNativeCapable",{model:e.profileModel}):e.profileModel?n("imageAnalysisStatus.toggleSummaryNativeModel",{model:e.profileModel}):n("imageAnalysisStatus.toggleSummaryNativeDefault");if(!e.backendDisplayName&&t==="claude")return n("imageAnalysisStatus.toggleSummaryNativeFileAccess");if(!e.backendDisplayName)return n("imageAnalysisStatus.toggleSummaryInactiveTarget",{target:n(`imageAnalysisStatus.targetLabel.${t}`)});const i=e.model?` · ${e.model}`:"";return n("imageAnalysisStatus.toggleSummaryTransformerRoute",{backend:e.backendDisplayName,modelSuffix:i})}function J3(n,e,t){return e.status==="disabled"?n("imageAnalysisStatus.noteDisabledGlobally"):t!=="claude"?n("imageAnalysisStatus.noteTargetBypassesHook",{target:n(`imageAnalysisStatus.targetLabel.${t}`)}):e.nativeReadPreference?e.nativeImageCapable===!0?null:e.nativeImageReason:e.status==="hook-missing"?n("imageAnalysisStatus.notePersistHook"):e.authReadiness==="missing"?e.authReason:e.proxyReadiness==="unavailable"?e.proxyReason:null}function Z3({status:n,target:e="claude",source:t="saved",previewState:i="saved",nativeReadPreferenceOverride:o,onToggleNativeRead:a}){const{t:r}=Ce();if(!n)return p.jsxs("div",{className:"rounded-2xl border bg-muted/20 px-4 py-3","aria-live":"polite",children:[p.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted"}),p.jsx("div",{className:"mt-2 h-3 w-52 animate-pulse rounded bg-muted"})]});const c=o??n.nativeReadPreference,d={...n,nativeReadPreference:c},f=$3(r,d,e),g=J3(r,d,e),m=n.nativeImageCapable?r("imageAnalysisStatus.capabilityVerified"):n.profileModel?r("imageAnalysisStatus.capabilityUnknown"):null;return p.jsxs("section",{className:"rounded-2xl border bg-background/95 px-4 py-3 shadow-sm",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsx("div",{className:"min-w-0",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"inline-flex h-8 w-8 items-center justify-center rounded-xl border border-sky-500/20 bg-sky-500/10 text-sky-700 dark:text-sky-300",children:p.jsx(yP,{className:"h-4 w-4"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("h3",{className:"text-sm font-semibold",children:r("imageAnalysisStatus.sectionTitle")}),p.jsx(Qt,{className:q("h-5 border px-1.5 text-[10px]",f.className),children:f.label})]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:[Q3(r,t,i)," ·"," ",Y3(r,d,e)]})]})]})}),p.jsx(mt,{size:"sm",variant:"outline",className:"h-8 shrink-0",asChild:!0,children:p.jsxs(uh,{to:"/settings?tab=image",children:[r("imageAnalysisStatus.openSettings"),p.jsx(mP,{className:"ml-1 h-3.5 w-3.5"})]})})]}),p.jsx("div",{className:"mt-3 rounded-xl border bg-muted/15 px-3 py-3",children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("div",{className:"text-sm font-medium text-foreground",children:r("imageAnalysisStatus.useNativeImageReading")}),m&&p.jsx(Qt,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:m})]}),p.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:X3(r,d,e)})]}),p.jsx(W3,{checked:c,onCheckedChange:a,disabled:!a,"aria-label":r("imageAnalysisStatus.useNativeImageReading")})]})}),g&&p.jsx("div",{className:"mt-2 rounded-lg border border-border/70 bg-muted/20 px-3 py-2 text-xs leading-5 text-muted-foreground",children:g})]})}const e_=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function IW({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,settings:i,profileTarget:o="claude",imageAnalysisStatus:a,imageAnalysisStatusSource:r="saved",imageAnalysisStatusPreviewState:c="saved",nativeReadPreferenceOverride:d,onToggleNativeRead:f,onChange:g,missingRequiredFields:m=[]}){const{t:x}=Ce(),v=m.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:x("profileEditorSections.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),x("profileEditor.invalidJson")]}),e&&v&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsxs("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:[x("profileEditor.missingFields"),":"]})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:m.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:x("profileEditor.missingFieldsHint")})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(e_,{value:n,onChange:g,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx(Z3,{status:a,target:o,source:r,previewState:c,nativeReadPreferenceOverride:d,onToggleNativeRead:f})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:i?.env})})})]})})}function lw(n,e){try{var t=n()}catch(i){return e(i)}return t&&t.then?t.then(void 0,e):t}function t_(n,e){for(var t={};n.length;){var i=n[0],o=i.code,a=i.message,r=i.path.join(".");if(!t[r])if("unionErrors"in i){var c=i.unionErrors[0].errors[0];t[r]={message:c.message,type:c.code}}else t[r]={message:a,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(g){return g.errors.forEach(function(m){return n.push(m)})}),e){var d=t[r].types,f=d&&d[i.code];t[r]=bP(r,e,t,o,f?[].concat(f,i.message):i.message)}n.shift()}return t}function n_(n,e){for(var t={};n.length;){var i=n[0],o=i.code,a=i.message,r=i.path.join(".");if(!t[r])if(i.code==="invalid_union"&&i.errors.length>0){var c=i.errors[0][0];t[r]={message:c.message,type:c.code}}else t[r]={message:a,type:o};if(i.code==="invalid_union"&&i.errors.forEach(function(g){return g.forEach(function(m){return n.push(m)})}),e){var d=t[r].types,f=d&&d[i.code];t[r]=bP(r,e,t,o,f?[].concat(f,i.message):i.message)}n.shift()}return t}function i_(n,e,t){if(t===void 0&&(t={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(n))return function(i,o,a){try{return Promise.resolve(lw(function(){return Promise.resolve(n[t.mode==="sync"?"parse":"parseAsync"](i,e)).then(function(r){return a.shouldUseNativeValidation&&ik({},a),{errors:{},values:t.raw?Object.assign({},i):r}})},function(r){if((function(c){return Array.isArray(c?.issues)})(r))return{values:{},errors:ok(t_(r.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw r}))}catch(r){return Promise.reject(r)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(n))return function(i,o,a){try{return Promise.resolve(lw(function(){return Promise.resolve((t.mode==="sync"?M2:N2)(n,i,e)).then(function(r){return a.shouldUseNativeValidation&&ik({},a),{errors:{},values:t.raw?Object.assign({},i):r}})},function(r){if((function(c){return c instanceof L2})(r))return{values:{},errors:ok(n_(r.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw r}))}catch(r){return Promise.reject(r)}};throw new Error("Invalid input: not a Zod schema")}const o_={sm:{container:"w-6 h-6",icon:"w-4 h-4",text:"text-xs"},md:{container:"w-8 h-8",icon:"w-5 h-5",text:"text-sm"},lg:{container:"w-12 h-12",icon:"w-8 h-8",text:"text-lg"}};function s_({provider:n,className:e,size:t="md"}){const i=R5(n),o=o_[t],a=UP(n),r=I5(n);return p.jsx("div",{className:q("flex items-center justify-center rounded-md",a&&!r&&(E5(n)?"bg-gray-900 p-1":"bg-white p-1"),o.container,e),children:a?p.jsx("img",{src:a,alt:`${n} logo`,className:q(r?o.container:o.icon,"object-contain")}):p.jsx("span",{className:q("font-semibold",i.textClass,o.text),children:i.letter})})}function jW(){return jt({queryKey:["profiles"],queryFn:()=>Ue.profiles.list()})}function a_(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.create(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileCreated"))},onError:t=>{fe.error(t.message)}})}function BW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.delete(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileDeleted"))},onError:t=>{fe.error(t.message)}})}function HW(){return ft({mutationFn:()=>Ue.profiles.discoverOrphans()})}function _W(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.registerOrphans(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.orphanProfilesComplete"))}})}function UW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:({name:t,data:i})=>Ue.profiles.copy(t,i),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileCopied"))}})}function zW(){return ft({mutationFn:({name:n,includeSecrets:e})=>Ue.profiles.export(n,e??!1)})}function FW(){const n=bt(),{t:e}=Ce();return ft({mutationFn:t=>Ue.profiles.import(t),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),fe.success(e("toasts.profileImported"))}})}const r_="https://openrouter.ai/api/v1",MD=Object.freeze({glmt:"glm",kimi:"km",alibaba:"alibaba-coding-plan",acp:"alibaba-coding-plan",hf:"huggingface"}),ND=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:r_,defaultProfileName:"openrouter",defaultModel:"anthropic/claude-opus-4.5",apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended",requiresApiKey:!0,badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg"},{id:"alibaba-coding-plan",name:"Alibaba Coding Plan",description:"Alibaba Cloud Coding Plan via Anthropic-compatible endpoint",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",defaultProfileName:"albb",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-sp-...",apiKeyHint:"Get your Coding Plan key from Alibaba Cloud Model Studio",category:"recommended",requiresApiKey:!0,badge:"Coding Plan",featured:!0,icon:"/assets/providers/alibabacloud-color.svg"},{id:"ollama",name:"Ollama (Local)",description:"Local open-source models via Ollama (32K+ context)",baseUrl:"http://localhost:11434",defaultProfileName:"ollama",defaultModel:"qwen3-coder",apiKeyPlaceholder:"ollama",apiKeyHint:"Install Ollama from ollama.com - no API key needed for local",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/icons/ollama.svg"},{id:"llamacpp",name:"llama.cpp (Local)",description:"Local inference via llama.cpp (LLaMA models)",baseUrl:"http://127.0.0.1:8080",defaultProfileName:"llamacpp",defaultModel:"llama3-8b",apiKeyPlaceholder:"llamacpp",apiKeyHint:"Run llama.cpp server: ./server --host 0.0.0.0 --port 8080 -m model.gguf",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/assets/providers/llama-cpp.svg"},{id:"anthropic",name:"Anthropic (Direct API)",description:"Use your own Anthropic API key (sk-ant-...)",baseUrl:"",defaultProfileName:"anthropic",defaultModel:"claude-sonnet-4-5-20250929",apiKeyPlaceholder:"sk-ant-api03-...",apiKeyHint:"Get key at console.anthropic.com/settings/keys",category:"recommended",requiresApiKey:!0,badge:"Direct",featured:!0,icon:"/assets/providers/claude.svg"},{id:"huggingface",name:"Hugging Face",description:"Inference Providers router via OpenAI-compatible chat completions",baseUrl:"https://router.huggingface.co/v1",defaultProfileName:"hf",defaultModel:"openai/gpt-oss-120b:fastest",apiKeyPlaceholder:"hf_...",apiKeyHint:"Create a User Access Token at hf.co/settings/tokens",category:"alternative",requiresApiKey:!0,defaultTarget:"droid",badge:"Router"},{id:"glm",name:"GLM",description:"Direct Z.AI Anthropic-compatible API profile",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative",requiresApiKey:!0,badge:"Z.AI",icon:"/icons/zai.svg"},{id:"km",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"km",defaultModel:"kimi-k2-thinking-turbo",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative",requiresApiKey:!0,alwaysThinkingEnabled:!0,badge:"Reasoning",icon:"/icons/kimi.svg"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",defaultModel:"claude-sonnet-4-5",apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative",requiresApiKey:!0,badge:"Azure",icon:"/icons/azure.svg"},{id:"mm",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"mm",defaultModel:"MiniMax-M2.1",apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY_HERE",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative",requiresApiKey:!0,badge:"1M context",icon:"/icons/minimax.svg"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",defaultModel:"deepseek-chat",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative",requiresApiKey:!0,badge:"Reasoning",icon:"/icons/deepseek.svg"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - Qwen3 models (256K-1M context, thinking support)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen-api",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative",requiresApiKey:!0,badge:"Alibaba",icon:"/assets/providers/qwen-color.svg"},{id:"ollama-cloud",name:"Ollama Cloud",description:"Ollama cloud models via direct API (glm-5:cloud, minimax-m2.1:cloud)",baseUrl:"https://ollama.com",defaultProfileName:"ollama-cloud",defaultModel:"glm-5:cloud",apiKeyPlaceholder:"YOUR_OLLAMA_CLOUD_API_KEY",apiKeyHint:"Get your API key at ollama.com",category:"alternative",requiresApiKey:!0,badge:"Cloud",icon:"/icons/ollama.svg"},{id:"novita",name:"Novita AI",description:"Anthropic-compatible API for Claude Code and CCS profiles",baseUrl:"https://api.novita.ai/anthropic",defaultProfileName:"novita",defaultModel:"deepseek/deepseek-v3.2",apiKeyPlaceholder:"YOUR_NOVITA_API_KEY",apiKeyHint:"Get your API key at novita.ai",category:"alternative",requiresApiKey:!0,badge:"Anthropic-compatible",icon:"/icons/novita.svg"}];function LD(n){return{...n,extraEnv:n.extraEnv?{...n.extraEnv}:void 0}}function l_(n){const e=LD(n);return e.extraEnv&&Object.freeze(e.extraEnv),Object.freeze(e)}function c_(n,e){const t=new Set;for(const o of n){const a=o.id.trim().toLowerCase();if(o.id!==a)throw new Error(`Preset ID must be normalized: "${o.id}"`);if(t.has(o.id))throw new Error(`Duplicate preset ID detected: "${o.id}"`);t.add(o.id)}const i=new Set;for(const[o,a]of Object.entries(e)){const r=o.trim().toLowerCase();if(!r)throw new Error("Preset alias keys cannot be empty");if(o!==r)throw new Error(`Preset alias must be normalized: "${o}"`);if(i.has(r))throw new Error(`Duplicate normalized preset alias detected: "${o}"`);if(i.add(r),!t.has(a))throw new Error(`Preset alias "${o}" points to unknown target "${a}"`);if(t.has(r))throw new Error(`Preset alias "${o}" collides with canonical preset ID "${r}"`)}}c_(ND,MD);const u_=Object.freeze(ND.map(l_));function d_(){return u_.map(LD)}function h_(n){const e=n.trim().toLowerCase();return MD[e]||e}const f_=d_(),Zb=Object.freeze(f_.map(n=>({...n})));function p_(n,e){return e||(n?.requiresApiKey===!1?n.apiKeyPlaceholder||n.id:"")}function g_(n){return Zb.filter(e=>e.category===n)}function hm(n){const e=h_(n);return Zb.find(t=>t.id===e)}const m_=ls().refine(n=>n.trim().length===0||ls().url().safeParse(n).success,{message:"Invalid URL format"}),y_=R2({name:ls().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:m_,apiKey:ls(),model:ls().optional(),opusModel:ls().optional(),sonnetModel:ls().optional(),haikuModel:ls().optional(),target:E2(["claude","droid","codex"])}),b_=["/chat/completions","/v1/messages","/messages","/completions"],$s="custom",fm="openrouter",RD=new Set(["ollama","llamacpp"]),pm={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},ED=g_("recommended"),x_=ED.filter(n=>!RD.has(n.id)),v_=ED.filter(n=>RD.has(n.id)),C_=Zb.filter(n=>n.category!=="recommended");function qW({open:n,onOpenChange:e,onSuccess:t,initialMode:i="openrouter"}){const{t:o}=Ce(),a=a_(),[r,c]=A.useState("basic"),[d,f]=A.useState(null),[g,m]=A.useState(!1),[x,v]=A.useState(fm),[C,k]=A.useState(""),{models:w}=V3(),{register:D,handleSubmit:O,formState:{errors:M},control:T,reset:L,setValue:N}=I2({resolver:i_(y_),defaultValues:pm}),I=sk({control:T,name:"baseUrl"}),K=sk({control:T,name:"target"}),U=A.useCallback(Y=>{if(!Y){L(pm);return}L({...pm,name:Y.defaultProfileName,baseUrl:Y.baseUrl,model:Y.defaultModel,opusModel:Y.defaultModel,sonnetModel:Y.defaultModel,haikuModel:Y.defaultModel,target:Y.defaultTarget??"claude"})},[L]),z=A.useMemo(()=>x===$s?null:hm(x)??null,[x]),X=A.useMemo(()=>C.trim()?[...j3(w,C)].sort((ae,de)=>(de.created??0)-(ae.created??0)).slice(0,20):F3(w,2),[w,C]);A.useEffect(()=>{if(n)if(c("basic"),f(null),m(!1),k(""),i==="normal")v($s),U(null);else{const ae=hm(i==="openrouter"?fm:i);if(ae){v(ae.id),U(ae);return}v($s),U(null)}},[n,i,U,L]);const _=Y=>{const ae=hm(Y);if(ae){v(ae.id),U(ae);return}v($s),U(null)},V=Y=>{N("model",Y.id),N("opusModel",Y.id),N("sonnetModel",Y.id),N("haikuModel",Y.id),k(Y.name),fe.success(o("profileCreateDialog.appliedModelToTiers",{model:Y.name}),{duration:2e3})};A.useEffect(()=>{if(I&&x===$s){const ae=I.toLowerCase();for(const de of b_)if(ae.endsWith(de)){const be=I.replace(new RegExp(de+"$","i"),"");f(`URL ends with "${de}" - Claude appends this automatically. You likely want: ${be}`);return}}f(null)},[I,x]);const ie=async Y=>{if(z?.requiresApiKey!==!1&&!Y.apiKey){fe.error(re.t("commonToast.apiKeyRequired"));return}const ae={...Y,apiKey:p_(z,Y.apiKey)};try{await a.mutateAsync(ae),fe.success(o("profileCreateDialog.profileCreated",{name:ae.name})),t(ae.name),e(!1)}catch(de){fe.error(de.message||o("profileCreateDialog.failedCreate"))}},oe=!!M.name||!!M.baseUrl||!!M.apiKey,B=!!M.model||!!M.opusModel||!!M.sonnetModel||!!M.haikuModel,Z=a.isPending,se=z?.id===fm;return p.jsx(Nb,{open:n,onOpenChange:e,children:p.jsxs(Lb,{"data-testid":"profile-create-dialog",className:"h-[calc(100dvh-2rem)] max-h-[900px] gap-0 overflow-hidden p-0 sm:max-w-[700px] !flex !flex-col",children:[p.jsxs(Rb,{className:"shrink-0 border-b p-6 pb-4",children:[p.jsxs(Eb,{className:"flex items-center gap-2",children:[p.jsx(ZS,{className:"w-5 h-5 text-primary"}),o("profileCreateDialog.createProfile")]}),p.jsx(Ib,{children:o("profileCreateDialog.chooseProviderHint")})]}),p.jsxs("form",{onSubmit:O(ie),className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[p.jsx("div",{"data-testid":"profile-create-provider-chooser",className:"max-h-[34dvh] shrink-0 space-y-3 overflow-y-auto overscroll-contain border-b bg-muted/10 px-6 py-3",children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(yn,{className:"text-xs text-muted-foreground",children:o("profileEditor.provider")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileEditor.providerChooserHint")})]}),p.jsx("span",{className:"pt-0.5 text-[11px] text-muted-foreground",children:o("profileEditor.scrollHint")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("profileEditor.featuredProviders")}),p.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:p.jsxs("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:[x_.map(Y=>p.jsx(gm,{preset:Y,isSelected:x===Y.id,onClick:()=>_(Y.id),density:"featured"},Y.id)),p.jsx("div",{className:"mx-1 hidden w-px rounded-full bg-border/70 sm:block"}),p.jsx(S_,{isSelected:x===$s,onClick:()=>_($s)})]})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("profileEditor.morePresets")}),p.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:p.jsx("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:C_.map(Y=>p.jsx(gm,{preset:Y,isSelected:x===Y.id,onClick:()=>_(Y.id),density:"compact"},Y.id))})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:o("openrouterQuickStart.localRuntimesTitle")}),p.jsx("div",{className:"flex flex-wrap gap-2",children:v_.map(Y=>p.jsx(gm,{preset:Y,isSelected:x===Y.id,onClick:()=>_(Y.id),density:"compact"},Y.id))})]})]})}),p.jsxs(PD,{value:r,onValueChange:c,className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[p.jsx("div",{className:"px-6 pt-4",children:p.jsxs($b,{className:"grid w-full grid-cols-2",children:[p.jsxs(bh,{value:"basic",className:"relative",children:[o("profileCreateDialog.basicInformation"),oe&&p.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),p.jsxs(bh,{value:"models",className:"relative",children:[o("profileCreateDialog.modelConfiguration"),B&&p.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),p.jsxs("div",{"data-testid":"profile-create-tab-scroll",className:"flex-1 min-h-0 overflow-y-auto",children:[p.jsxs(py,{value:"basic",className:"p-6 space-y-4 mt-0",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"name",children:[o("profileDialog.name")," ",p.jsx("span",{className:"text-destructive",children:"*"})]}),p.jsx(ji,{id:"name",...D("name"),placeholder:o("profileDialog.namePlaceholder"),className:"font-mono"}),M.name?p.jsx("p",{className:"text-xs text-destructive",children:M.name.message}):p.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("profileCreateDialog.usedInCli")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(yn,{htmlFor:"baseUrl",children:o("profileCreateDialog.apiBaseUrl")}),p.jsx(ji,{id:"baseUrl",...D("baseUrl"),placeholder:o("profileCreateDialog.baseUrlPlaceholder")}),M.baseUrl?p.jsx("p",{className:"text-xs text-destructive",children:M.baseUrl.message}):d?p.jsxs("div",{className:"flex items-start gap-2 text-xs text-yellow-600 bg-yellow-50 dark:bg-yellow-900/20 p-2 rounded",children:[p.jsx(Qi,{className:"w-4 h-4 shrink-0 mt-0.5"}),p.jsx("span",{children:d})]}):z?p.jsx("p",{className:"text-xs text-muted-foreground",children:z.baseUrl?o("profileCreateDialog.prefilledFromPreset",{name:z.name}):o("profileCreateDialog.optionalForPreset",{name:z.name})}):p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileCreateDialog.endpointHint")})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"apiKey",children:[o("profileDialog.apiKey")," ",z?.requiresApiKey!==!1&&p.jsx("span",{className:"text-destructive",children:"*"}),z?.requiresApiKey===!1&&p.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:o("profileCreateDialog.optional")})]}),p.jsxs("div",{className:"relative",children:[p.jsx(ji,{id:"apiKey",type:g?"text":"password",...D("apiKey"),placeholder:z?.requiresApiKey===!1?o("profileCreateDialog.apiKeyOptionalPlaceholder"):z?.apiKeyPlaceholder??o("profileCreateDialog.apiKeyPlaceholder"),className:"pr-10"}),p.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>m(!g),tabIndex:-1,children:g?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})]}),M.apiKey?p.jsx("p",{className:"text-xs text-destructive",children:M.apiKey.message}):z?.requiresApiKey===!1?p.jsx("p",{className:"text-xs text-muted-foreground",children:o("profileCreateDialog.apiKeyOptionalHint")}):z?.apiKeyHint&&p.jsx("p",{className:"text-xs text-muted-foreground",children:z.apiKeyHint})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(yn,{htmlFor:"target",children:o("codex.defaultTargetCli")}),p.jsxs(zP,{value:K,onValueChange:Y=>N("target",Y),children:[p.jsx(Ub,{id:"target",children:p.jsx(FP,{})}),p.jsxs(zb,{children:[p.jsx(ac,{value:"claude",children:o("profileCard.claudeCodeDefault")}),p.jsx(ac,{value:"droid",children:o("profileCard.factoryDroid")}),p.jsx(ac,{value:"codex",children:o("profileCard.codexCli")})]})]}),p.jsxs("p",{className:"text-xs text-muted-foreground",children:[K==="droid"?p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintPreferredAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-droid"}),"."]}):K==="codex"?p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintPreferredAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsx"}),"."]}):p.jsxs(p.Fragment,{children:[o("profileEditor.targetHintClaudeDefault")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs"}),"."]}),K==="droid"?p.jsxs(p.Fragment,{children:[" ",o("profileEditor.targetHintLegacyAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsd"}),"."]}):K==="codex"?p.jsxs(p.Fragment,{children:[" ",o("profileEditor.targetHintLegacyAlias")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-codex"}),"."]}):null," ",o("profileEditor.targetHintOverride")," ",p.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"--target"}),"."]})]})]}),p.jsxs(py,{value:"models",className:"p-6 mt-0 space-y-4",children:[p.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 dark:bg-blue-950/20 text-blue-800 dark:text-blue-300 rounded-md text-sm border border-blue-100 dark:border-blue-900/30",children:[p.jsx(Yh,{className:"w-5 h-5 shrink-0 mt-0.5"}),p.jsxs("div",{children:[p.jsx("p",{className:"font-medium mb-1",children:o("profileCreateDialog.modelMapping")}),p.jsx("p",{className:"text-xs opacity-90",children:o("profileCreateDialog.modelMappingDesc")})]})]}),se&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{children:o("openrouterModelPicker.searchModels")}),p.jsx(ji,{value:C,onChange:Y=>k(Y.target.value),placeholder:o("profileCreateDialog.searchModelsPlaceholder"),onKeyDown:Y=>{Y.key==="Enter"&&X.length>0&&(Y.preventDefault(),V(X[0]))}}),p.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:X.length===0?p.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:C?o("profileCreateDialog.noModelsFound",{query:C}):o("profileCreateDialog.loadingModels")}):p.jsxs("div",{className:"p-1",children:[!C&&p.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[p.jsx(qE,{className:"w-3 h-3 text-accent"}),p.jsx("span",{children:o("openrouterModelPicker.newestModels")})]}),X.map(Y=>p.jsx(k_,{model:Y,onClick:()=>V(Y),showAge:!C},Y.id))]})})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"model",children:[o("profileCreateDialog.defaultModel"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),p.jsx(ji,{id:"model",...D("model"),placeholder:z?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),p.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"sonnetModel",className:"text-sm",children:[o("profileCreateDialog.sonnetMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),p.jsx(ji,{id:"sonnetModel",...D("sonnetModel"),placeholder:o("profileCreateDialog.sonnetMappingPlaceholder"),className:"font-mono text-sm h-9"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"opusModel",className:"text-sm",children:[o("profileCreateDialog.opusMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),p.jsx(ji,{id:"opusModel",...D("opusModel"),placeholder:o("profileCreateDialog.opusMappingPlaceholder"),className:"font-mono text-sm h-9"})]}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsxs(yn,{htmlFor:"haikuModel",className:"text-sm",children:[o("profileCreateDialog.haikuMapping"),p.jsx(Qt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),p.jsx(ji,{id:"haikuModel",...D("haikuModel"),placeholder:o("profileCreateDialog.haikuMappingPlaceholder"),className:"font-mono text-sm h-9"})]})]})]})]})]}),p.jsxs(m5,{"data-testid":"profile-create-footer",className:"shrink-0 border-t bg-muted/10 p-6 pt-4",children:[p.jsx(mt,{type:"button",variant:"outline",onClick:()=>e(!1),children:o("profileDialog.cancel")}),p.jsx(mt,{type:"submit",disabled:Z,className:q(Z&&"opacity-80"),children:Z?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"w-4 h-4 mr-2 animate-spin"}),o("cliproxyDialog.creating")]}):p.jsxs(p.Fragment,{children:[p.jsx(ZS,{className:"w-4 h-4 mr-2"}),o("profileCreateDialog.createProfile")]})})]})]})]})]})})}function gm({preset:n,isSelected:e,onClick:t,density:i="compact"}){const o=n.id==="anthropic",a=i==="featured";return p.jsxs("button",{type:"button",onClick:t,className:q("flex flex-none items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all",a?"h-[68px] w-[236px]":"h-[64px] w-[168px]",e?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-background",children:o?p.jsx(s_,{provider:"claude",size:"md",className:"rounded-lg"}):n.icon?p.jsx("img",{src:n.icon,alt:"",className:"h-5 w-5 object-contain"}):p.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/70 text-xs font-semibold text-foreground/70",children:n.name.charAt(0)})}),p.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"truncate text-[13px] font-semibold leading-tight tracking-[-0.01em]",children:n.name}),n.badge&&a&&p.jsx(Qt,{variant:"secondary",className:"inline-flex bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]}),n.badge&&!a&&p.jsx(Qt,{variant:"secondary",className:"inline-flex w-fit bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]})]})}function S_({isSelected:n,onClick:e}){const{t}=Ce();return p.jsxs("button",{type:"button",onClick:e,className:q("flex h-[68px] w-[236px] flex-none items-center gap-3 rounded-xl border border-dashed px-3 py-2.5 text-left transition-all",n?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-muted-foreground/30 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-dashed border-current/30 bg-muted/70",children:p.jsx(Cb,{className:"h-4 w-4 text-muted-foreground"})}),p.jsx("div",{className:"min-w-0 flex-1",children:p.jsx("div",{className:"text-sm font-semibold leading-tight",children:t("profileEditor.customEndpoint")})})]})}function k_({model:n,onClick:e,showAge:t}){const{t:i}=Ce();return p.jsxs("button",{type:"button",onClick:e,className:"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[p.jsx("span",{className:"flex-1 truncate",children:n.name}),p.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[t&&n.created&&p.jsx(Qt,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:q3(n.created)}),n.isFree?p.jsx(Qt,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:i("profileCreateDialog.free")}):p.jsx("span",{children:R3(n.pricing)}),p.jsx("span",{children:U3(n.context_length)})]})]})}function w_({className:n,...e}){return p.jsx("div",{"data-slot":"card",className:q("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...e})}function A_({className:n,...e}){return p.jsx("div",{"data-slot":"card-header",className:q("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...e})}function P_({className:n,...e}){return p.jsx("div",{"data-slot":"card-title",className:q("leading-none font-semibold",n),...e})}function D_({className:n,...e}){return p.jsx("div",{"data-slot":"card-description",className:q("text-muted-foreground text-sm",n),...e})}function O_({className:n,...e}){return p.jsx("div",{"data-slot":"card-content",className:q("px-6",n),...e})}const ex="[1m]",tx=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL"],T_=new Set(tx);function GW(n){return n.toLowerCase().startsWith("gemini-")}function nx(n){return n.toLowerCase().endsWith(ex.toLowerCase())}function M_(n){return!n||nx(n)?n:`${n}${ex}`}function ID(n){return n&&(nx(n)?n.slice(0,-ex.length):n)}function KW(n){return T_.has(n)}function N_(n){return ID(n.trim()).replace(/\([^)]+\)$/,"")}function VW(n){return tx.some(e=>{const t=n[e];return typeof t=="string"&&nx(t)})}function WW(n,e,t={}){const i={...n};for(const o of tx){const a=i[o];if(typeof a!="string"||a.trim().length===0)continue;const r=N_(a),c=t.supportsExtendedContext?.(r,o)??!0;i[o]=e&&c?M_(a):ID(a)}return i}const L_=["agy","claude","gemini","codex","cursor","gitlab","codebuddy","qwen","kimi","iflow","kilo","kiro"],QW=L_.map(n=>({id:n,name:_b(n),description:B5(n)})),R_=["provider","auth","variant","success"];function YW(n){return n==="account"?1:R_.indexOf(n)}const $W=aE,XW=lE,JW=rE,E_=A.forwardRef(({className:n,align:e="center",sideOffset:t=4,...i},o)=>p.jsx(sE,{children:p.jsx(tP,{ref:o,align:e,sideOffset:t,className:q("z-50 w-80 max-w-[calc(100vw-2rem)] rounded-lg border border-border/70 bg-popover p-4 text-popover-foreground shadow-xl shadow-black/10 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...i})}));E_.displayName=tP.displayName;const I_=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function ZW({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,onRawJsonChange:i,profileEnv:o,missingRequiredFields:a=[]}){const{t:r}=Ce(),c=a.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:r("providerEditor.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),e&&c&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:a.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Apply a preset from Model Config tab or add these fields manually. Without them, Claude Code will fail with 404 errors."})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(I_,{value:n,onChange:i,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:o})})})]})})}let my=[],jD=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?jD:my).push(t=t+n[e])})();function j_(n){if(n<768)return!1;for(let e=0,t=my.length;;){let i=e+t>>1;if(n<my[i])t=i;else if(n>=jD[i])e=i+1;else return!0;if(e==t)return!1}}function cw(n){return n>=127462&&n<=127487}const uw=8205;function B_(n,e,t=!0,i=!0){return(t?BD:H_)(n,e,i)}function BD(n,e,t){if(e==n.length)return e;e&&HD(n.charCodeAt(e))&&_D(n.charCodeAt(e-1))&&e--;let i=mm(n,e);for(e+=dw(i);e<n.length;){let o=mm(n,e);if(i==uw||o==uw||t&&j_(o))e+=dw(o),i=o;else if(cw(o)){let a=0,r=e-2;for(;r>=0&&cw(mm(n,r));)a++,r-=2;if(a%2==0)break;e+=2}else break}return e}function H_(n,e,t){for(;e>0;){let i=BD(n,e-2,t);if(i<e)return i;e--}return 0}function mm(n,e){let t=n.charCodeAt(e);if(!_D(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return HD(i)?(t-55296<<10)+(i-56320)+65536:t}function HD(n){return n>=56320&&n<57344}function _D(n){return n>=55296&&n<56320}function dw(n){return n<65536?1:2}class Je{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Ir(this,e,t);let o=[];return this.decompose(0,e,o,2),i.length&&i.decompose(0,i.length,o,3),this.decompose(t,this.length,o,1),Hi.from(o,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ir(this,e,t);let i=[];return this.decompose(e,t,i,0),Hi.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),o=new cc(this),a=new cc(e);for(let r=t,c=t;;){if(o.next(r),a.next(r),r=0,o.lineBreak!=a.lineBreak||o.done!=a.done||o.value!=a.value)return!1;if(c+=o.value.length,o.done||c>=i)return!0}}iter(e=1){return new cc(this,e)}iterRange(e,t=this.length){return new UD(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let o=this.line(e).from;i=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new zD(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Je.empty:e.length<=32?new It(e):Hi.from(It.split(e,[]))}}class It extends Je{constructor(e,t=__(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,o){for(let a=0;;a++){let r=this.text[a],c=o+r.length;if((t?i:c)>=e)return new U_(o,c,i,r);o=c+1,i++}}decompose(e,t,i,o){let a=e<=0&&t>=this.length?this:new It(hw(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(o&1){let r=i.pop(),c=th(a.text,r.text.slice(),0,a.length);if(c.length<=32)i.push(new It(c,r.length+a.length));else{let d=c.length>>1;i.push(new It(c.slice(0,d)),new It(c.slice(d)))}}else i.push(a)}replace(e,t,i){if(!(i instanceof It))return super.replace(e,t,i);[e,t]=Ir(this,e,t);let o=th(this.text,th(i.text,hw(this.text,0,e)),t),a=this.length+i.length-(t-e);return o.length<=32?new It(o,a):Hi.from(It.split(o,[]),a)}sliceString(e,t=this.length,i=`
18
+ `){[e,t]=Ir(this,e,t);let o="";for(let a=0,r=0;a<=t&&r<this.text.length;r++){let c=this.text[r],d=a+c.length;a>e&&r&&(o+=i),e<d&&t>a&&(o+=c.slice(Math.max(0,e-a),t-a)),a=d+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],o=-1;for(let a of e)i.push(a),o+=a.length+1,i.length==32&&(t.push(new It(i,o)),i=[],o=-1);return o>-1&&t.push(new It(i,o)),t}}class Hi extends Je{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,o){for(let a=0;;a++){let r=this.children[a],c=o+r.length,d=i+r.lines-1;if((t?d:c)>=e)return r.lineInner(e,t,i,o);o=c+1,i=d+1}}decompose(e,t,i,o){for(let a=0,r=0;r<=t&&a<this.children.length;a++){let c=this.children[a],d=r+c.length;if(e<=d&&t>=r){let f=o&((r<=e?1:0)|(d>=t?2:0));r>=e&&d<=t&&!f?i.push(c):c.decompose(e-r,t-r,i,f)}r=d+1}}replace(e,t,i){if([e,t]=Ir(this,e,t),i.lines<this.lines)for(let o=0,a=0;o<this.children.length;o++){let r=this.children[o],c=a+r.length;if(e>=a&&t<=c){let d=r.replace(e-a,t-a,i),f=this.lines-r.lines+d.lines;if(d.lines<f>>4&&d.lines>f>>6){let g=this.children.slice();return g[o]=d,new Hi(g,this.length-(t-e)+i.length)}return super.replace(a,c,d)}a=c+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
19
+ `){[e,t]=Ir(this,e,t);let o="";for(let a=0,r=0;a<this.children.length&&r<=t;a++){let c=this.children[a],d=r+c.length;r>e&&a&&(o+=i),e<d&&t>r&&(o+=c.sliceString(e-r,t-r,i)),r=d+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Hi))return 0;let i=0,[o,a,r,c]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,a+=t){if(o==r||a==c)return i;let d=this.children[o],f=e.children[a];if(d!=f)return i+d.scanIdentical(f,t);i+=d.length+1}}static from(e,t=e.reduce((i,o)=>i+o.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let C of e)C.flatten(v);return new It(v,t)}let o=Math.max(32,i>>5),a=o<<1,r=o>>1,c=[],d=0,f=-1,g=[];function m(v){let C;if(v.lines>a&&v instanceof Hi)for(let k of v.children)m(k);else v.lines>r&&(d>r||!d)?(x(),c.push(v)):v instanceof It&&d&&(C=g[g.length-1])instanceof It&&v.lines+C.lines<=32?(d+=v.lines,f+=v.length+1,g[g.length-1]=new It(C.text.concat(v.text),C.length+1+v.length)):(d+v.lines>o&&x(),d+=v.lines,f+=v.length+1,g.push(v))}function x(){d!=0&&(c.push(g.length==1?g[0]:Hi.from(g,f)),f=-1,d=g.length=0)}for(let v of e)m(v);return x(),c.length==1?c[0]:new Hi(c,t)}}Je.empty=new It([""],0);function __(n){let e=-1;for(let t of n)e+=t.length+1;return e}function th(n,e,t=0,i=1e9){for(let o=0,a=0,r=!0;a<n.length&&o<=i;a++){let c=n[a],d=o+c.length;d>=t&&(d>i&&(c=c.slice(0,i-o)),o<t&&(c=c.slice(t-o)),r?(e[e.length-1]+=c,r=!1):e.push(c)),o=d+1}return e}function hw(n,e,t){return th(n,[""],e,t)}class cc{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof It?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,o=this.nodes[i],a=this.offsets[i],r=a>>1,c=o instanceof It?o.text.length:o.children.length;if(r==(t>0?c:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
20
+ `,this;e--}else if(o instanceof It){let d=o.text[r+(t<0?-1:0)];if(this.offsets[i]+=t,d.length>Math.max(0,e))return this.value=e==0?d:t>0?d.slice(e):d.slice(0,d.length-e),this;e-=d.length}else{let d=o.children[r+(t<0?-1:0)];e>d.length?(e-=d.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(d),this.offsets.push(t>0?1:(d instanceof It?d.text.length:d.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class UD{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new cc(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=i?o:t<0?o.slice(o.length-i):o.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zD{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},cc.prototype[Symbol.iterator]=UD.prototype[Symbol.iterator]=zD.prototype[Symbol.iterator]=function(){return this});class U_{constructor(e,t,i,o){this.from=e,this.to=t,this.number=i,this.text=o}get length(){return this.to-this.from}}function Ir(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function $t(n,e,t=!0,i=!0){return B_(n,e,t,i)}function z_(n){return n>=56320&&n<57344}function F_(n){return n>=55296&&n<56320}function Mn(n,e){let t=n.charCodeAt(e);if(!F_(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return z_(i)?(t-55296<<10)+(i-56320)+65536:t}function ix(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function _i(n){return n<65536?1:2}const yy=/\r\n?|\n/;var xn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(xn||(xn={}));class Wi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,o=0;t<this.sections.length;){let a=this.sections[t++],r=this.sections[t++];r<0?(e(i,o,a),o+=a):o+=r,i+=a}}iterChangedRanges(e,t=!1){by(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?e.push(i,o):e.push(o,i)}return new Wi(e)}composeDesc(e){return this.empty?e:e.empty?this:FD(this,e)}mapDesc(e,t=!1){return e.empty?this:xy(this,e,t)}mapPos(e,t=-1,i=xn.Simple){let o=0,a=0;for(let r=0;r<this.sections.length;){let c=this.sections[r++],d=this.sections[r++],f=o+c;if(d<0){if(f>e)return a+(e-o);a+=c}else{if(i!=xn.Simple&&f>=e&&(i==xn.TrackDel&&o<e&&f>e||i==xn.TrackBefore&&o<e||i==xn.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!c)return e==o||t<0?a:a+d;a+=d}o=f}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return a}touchesRange(e,t=e){for(let i=0,o=0;i<this.sections.length&&o<=t;){let a=this.sections[i++],r=this.sections[i++],c=o+a;if(r>=0&&o<=t&&c>=e)return o<e&&c>t?"cover":!0;o=c}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];e+=(e?" ":"")+i+(o>=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Wi(e)}static create(e){return new Wi(e)}}class qt extends Wi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return by(this,(t,i,o,a,r)=>e=e.replace(o,o+(i-t),r),!1),e}mapDesc(e,t=!1){return xy(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let o=0,a=0;o<t.length;o+=2){let r=t[o],c=t[o+1];if(c>=0){t[o]=c,t[o+1]=r;let d=o>>1;for(;i.length<d;)i.push(Je.empty);i.push(r?e.slice(a,a+r):Je.empty)}a+=r}return new qt(t,i)}compose(e){return this.empty?e:e.empty?this:FD(this,e,!0)}map(e,t=!1){return e.empty?this:xy(this,e,t,!0)}iterChanges(e,t=!1){by(this,e,t)}get desc(){return Wi.create(this.sections)}filter(e){let t=[],i=[],o=[],a=new Ac(this);e:for(let r=0,c=0;;){let d=r==e.length?1e9:e[r++];for(;c<d||c==d&&a.len==0;){if(a.done)break e;let g=Math.min(a.len,d-c);un(o,g,-1);let m=a.ins==-1?-1:a.off==0?a.ins:0;un(t,g,m),m>0&&ps(i,t,a.text),a.forward(g),c+=g}let f=e[r++];for(;c<f;){if(a.done)break e;let g=Math.min(a.len,f-c);un(t,g,-1),un(o,g,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(g),c+=g}}return{changes:new qt(t,i),filtered:Wi.create(o)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],o=this.sections[t+1];o<0?e.push(i):o==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let o=[],a=[],r=0,c=null;function d(g=!1){if(!g&&!o.length)return;r<t&&un(o,t-r,-1);let m=new qt(o,a);c=c?c.compose(m.map(c)):m,o=[],a=[],r=0}function f(g){if(Array.isArray(g))for(let m of g)f(m);else if(g instanceof qt){if(g.length!=t)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${t})`);d(),c=c?c.compose(g.map(c)):g}else{let{from:m,to:x=m,insert:v}=g;if(m>x||m<0||x>t)throw new RangeError(`Invalid change range ${m} to ${x} (in doc of length ${t})`);let C=v?typeof v=="string"?Je.of(v.split(i||yy)):v:Je.empty,k=C.length;if(m==x&&k==0)return;m<r&&d(),m>r&&un(o,m-r,-1),un(o,x-m,k),ps(a,o,C),r=x}}return f(e),d(!c),c}static empty(e){return new qt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let o=0;o<e.length;o++){let a=e[o];if(typeof a=="number")t.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((r,c)=>c&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)t.push(a[0],0);else{for(;i.length<o;)i.push(Je.empty);i[o]=Je.of(a.slice(1)),t.push(a[0],i[o].length)}}}return new qt(t,i)}static createSet(e,t){return new qt(e,t)}}function un(n,e,t,i=!1){if(e==0&&t<=0)return;let o=n.length-2;o>=0&&t<=0&&t==n[o+1]?n[o]+=e:o>=0&&e==0&&n[o]==0?n[o+1]+=t:i?(n[o]+=e,n[o+1]+=t):n.push(e,t)}function ps(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Je.empty);n.push(t)}}function by(n,e,t){let i=n.inserted;for(let o=0,a=0,r=0;r<n.sections.length;){let c=n.sections[r++],d=n.sections[r++];if(d<0)o+=c,a+=c;else{let f=o,g=a,m=Je.empty;for(;f+=c,g+=d,d&&i&&(m=m.append(i[r-2>>1])),!(t||r==n.sections.length||n.sections[r+1]<0);)c=n.sections[r++],d=n.sections[r++];e(o,f,a,g,m),o=f,a=g}}}function xy(n,e,t,i=!1){let o=[],a=i?[]:null,r=new Ac(n),c=new Ac(e);for(let d=-1;;){if(r.done&&c.len||c.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&c.ins==-1){let f=Math.min(r.len,c.len);un(o,f,-1),r.forward(f),c.forward(f)}else if(c.ins>=0&&(r.ins<0||d==r.i||r.off==0&&(c.len<r.len||c.len==r.len&&!t))){let f=c.len;for(un(o,c.ins,-1);f;){let g=Math.min(r.len,f);r.ins>=0&&d<r.i&&r.len<=g&&(un(o,0,r.ins),a&&ps(a,o,r.text),d=r.i),r.forward(g),f-=g}c.next()}else if(r.ins>=0){let f=0,g=r.len;for(;g;)if(c.ins==-1){let m=Math.min(g,c.len);f+=m,g-=m,c.forward(m)}else if(c.ins==0&&c.len<g)g-=c.len,c.next();else break;un(o,f,d<r.i?r.ins:0),a&&d<r.i&&ps(a,o,r.text),d=r.i,r.forward(r.len-g)}else{if(r.done&&c.done)return a?qt.createSet(o,a):Wi.create(o);throw new Error("Mismatched change set lengths")}}}function FD(n,e,t=!1){let i=[],o=t?[]:null,a=new Ac(n),r=new Ac(e);for(let c=!1;;){if(a.done&&r.done)return o?qt.createSet(i,o):Wi.create(i);if(a.ins==0)un(i,a.len,0,c),a.next();else if(r.len==0&&!r.done)un(i,0,r.ins,c),o&&ps(o,i,r.text),r.next();else{if(a.done||r.done)throw new Error("Mismatched change set lengths");{let d=Math.min(a.len2,r.len),f=i.length;if(a.ins==-1){let g=r.ins==-1?-1:r.off?0:r.ins;un(i,d,g,c),o&&g&&ps(o,i,r.text)}else r.ins==-1?(un(i,a.off?0:a.len,d,c),o&&ps(o,i,a.textBit(d))):(un(i,a.off?0:a.len,r.off?0:r.ins,c),o&&!r.off&&ps(o,i,r.text));c=(a.ins>d||r.ins>=0&&r.len>d)&&(c||i.length>f),a.forward2(d),r.forward(d)}}}}class Ac{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Je.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Je.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class na{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,o;return this.empty?i=o=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),i==this.from&&o==this.to?this:new na(i,o,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return J.range(e,t,void 0,void 0,i);let o=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return J.range(this.anchor,o,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(e.anchor,e.head)}static create(e,t,i){return new na(e,t,i)}}class J{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:J.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new J([this.main],0)}addRange(e,t=!0){return J.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,J.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(e.ranges.map(t=>na.fromJSON(t)),e.main)}static single(e,t=e){return new J([J.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,o=0;o<e.length;o++){let a=e[o];if(a.empty?a.from<=i:a.from<i)return J.normalized(e.slice(),t);i=a.to}return new J(e,t)}static cursor(e,t=0,i,o){return na.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(o??16777215)<<6)}static range(e,t,i,o,a){let r=(i??16777215)<<6|(o==null?7:Math.min(6,o));return!a&&e!=t&&(a=t<e?1:-1),t<e?na.create(t,e,48|r):na.create(e,t,(a?a<0?8:16:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((o,a)=>o.from-a.from),t=e.indexOf(i);for(let o=1;o<e.length;o++){let a=e[o],r=e[o-1];if(a.empty?a.from<=r.to:a.from<r.to){let c=r.from,d=Math.max(a.to,r.to);o<=t&&t--,e.splice(--o,2,a.anchor>a.head?J.range(d,c):J.range(c,d))}}return new J(e,t)}}function qD(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ox=0;class pe{constructor(e,t,i,o,a){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=o,this.id=ox++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new pe(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:sx),!!e.static,e.enables)}of(e){return new nh([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nh(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nh(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function sx(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class nh{constructor(e,t,i,o){this.dependencies=e,this.facet=t,this.type=i,this.value=o,this.id=ox++}dynamicSlot(e){var t;let i=this.value,o=this.facet.compareInput,a=this.id,r=e[a]>>1,c=this.type==2,d=!1,f=!1,g=[];for(let m of this.dependencies)m=="doc"?d=!0:m=="selection"?f=!0:(((t=e[m.id])!==null&&t!==void 0?t:1)&1)==0&&g.push(e[m.id]);return{create(m){return m.values[r]=i(m),1},update(m,x){if(d&&x.docChanged||f&&(x.docChanged||x.selection)||vy(m,g)){let v=i(m);if(c?!fw(v,m.values[r],o):!o(v,m.values[r]))return m.values[r]=v,1}return 0},reconfigure:(m,x)=>{let v,C=x.config.address[a];if(C!=null){let k=vh(x,C);if(this.dependencies.every(w=>w instanceof pe?x.facet(w)===m.facet(w):w instanceof hn?x.field(w,!1)==m.field(w,!1):!0)||(c?fw(v=i(m),k,o):o(v=i(m),k)))return m.values[r]=k,0}else v=i(m);return m.values[r]=v,1}}}}function fw(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function vy(n,e){let t=!1;for(let i of e)uc(n,i)&1&&(t=!0);return t}function q_(n,e,t){let i=t.map(d=>n[d.id]),o=t.map(d=>d.type),a=i.filter(d=>!(d&1)),r=n[e.id]>>1;function c(d){let f=[];for(let g=0;g<i.length;g++){let m=vh(d,i[g]);if(o[g]==2)for(let x of m)f.push(x);else f.push(m)}return e.combine(f)}return{create(d){for(let f of i)uc(d,f);return d.values[r]=c(d),1},update(d,f){if(!vy(d,a))return 0;let g=c(d);return e.compare(g,d.values[r])?0:(d.values[r]=g,1)},reconfigure(d,f){let g=vy(d,i),m=f.config.facets[e.id],x=f.facet(e);if(m&&!g&&sx(t,m))return d.values[r]=x,0;let v=c(d);return e.compare(v,x)?(d.values[r]=x,0):(d.values[r]=v,1)}}}const Dd=pe.define({static:!0});class hn{constructor(e,t,i,o,a){this.id=e,this.createF=t,this.updateF=i,this.compareF=o,this.spec=a,this.provides=void 0}static define(e){let t=new hn(ox++,e.create,e.update,e.compare||((i,o)=>i===o),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dd).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,o)=>{let a=i.values[t],r=this.updateF(a,o);return this.compareF(a,r)?0:(i.values[t]=r,1)},reconfigure:(i,o)=>{let a=i.facet(Dd),r=o.facet(Dd),c;return(c=a.find(d=>d.field==this))&&c!=r.find(d=>d.field==this)?(i.values[t]=c.create(i),1):o.config.address[this.id]!=null?(i.values[t]=o.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Dd.of({field:this,create:e})]}get extension(){return this}}const Zs={lowest:4,low:3,default:2,high:1,highest:0};function Gl(n){return e=>new GD(e,n)}const Sa={highest:Gl(Zs.highest),high:Gl(Zs.high),default:Gl(Zs.default),low:Gl(Zs.low),lowest:Gl(Zs.lowest)};class GD{constructor(e,t){this.inner=e,this.prec=t}}class uf{of(e){return new Cy(this,e)}reconfigure(e){return uf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Cy{constructor(e,t){this.compartment=e,this.inner=t}}class xh{constructor(e,t,i,o,a,r){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=o,this.staticValues=a,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let o=[],a=Object.create(null),r=new Map;for(let x of G_(e,t,r))x instanceof hn?o.push(x):(a[x.facet.id]||(a[x.facet.id]=[])).push(x);let c=Object.create(null),d=[],f=[];for(let x of o)c[x.id]=f.length<<1,f.push(v=>x.slot(v));let g=i?.config.facets;for(let x in a){let v=a[x],C=v[0].facet,k=g&&g[x]||[];if(v.every(w=>w.type==0))if(c[C.id]=d.length<<1|1,sx(k,v))d.push(i.facet(C));else{let w=C.combine(v.map(D=>D.value));d.push(i&&C.compare(w,i.facet(C))?i.facet(C):w)}else{for(let w of v)w.type==0?(c[w.id]=d.length<<1|1,d.push(w.value)):(c[w.id]=f.length<<1,f.push(D=>w.dynamicSlot(D)));c[C.id]=f.length<<1,f.push(w=>q_(w,C,v))}}let m=f.map(x=>x(c));return new xh(e,r,m,c,d,a)}}function G_(n,e,t){let i=[[],[],[],[],[]],o=new Map;function a(r,c){let d=o.get(r);if(d!=null){if(d<=c)return;let f=i[d].indexOf(r);f>-1&&i[d].splice(f,1),r instanceof Cy&&t.delete(r.compartment)}if(o.set(r,c),Array.isArray(r))for(let f of r)a(f,c);else if(r instanceof Cy){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(r.compartment)||r.inner;t.set(r.compartment,f),a(f,c)}else if(r instanceof GD)a(r.inner,r.prec);else if(r instanceof hn)i[c].push(r),r.provides&&a(r.provides,c);else if(r instanceof nh)i[c].push(r),r.facet.extensions&&a(r.facet.extensions,Zs.default);else{let f=r.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(f,c)}}return a(n,Zs.default),i.reduce((r,c)=>r.concat(c))}function uc(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let o=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|o}function vh(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const KD=pe.define(),Sy=pe.define({combine:n=>n.some(e=>e),static:!0}),VD=pe.define({combine:n=>n.length?n[0]:void 0,static:!0}),WD=pe.define(),QD=pe.define(),YD=pe.define(),$D=pe.define({combine:n=>n.length?n[0]:!1});class $i{constructor(e,t){this.type=e,this.value=t}static define(){return new K_}}class K_{of(e){return new $i(this,e)}}class V_{constructor(e){this.map=e}of(e){return new Le(this,e)}}class Le{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Le(this.type,t)}is(e){return this.type==e}static define(e={}){return new V_(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let o of e){let a=o.map(t);a&&i.push(a)}return i}}Le.reconfigure=Le.define();Le.appendConfig=Le.define();class Gt{constructor(e,t,i,o,a,r){this.startState=e,this.changes=t,this.selection=i,this.effects=o,this.annotations=a,this.scrollIntoView=r,this._doc=null,this._state=null,i&&qD(i,t.newLength),a.some(c=>c.type==Gt.time)||(this.annotations=a.concat(Gt.time.of(Date.now())))}static create(e,t,i,o,a,r){return new Gt(e,t,i,o,a,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Gt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Gt.time=$i.define();Gt.userEvent=$i.define();Gt.addToHistory=$i.define();Gt.remote=$i.define();function W_(n,e){let t=[];for(let i=0,o=0;;){let a,r;if(i<n.length&&(o==e.length||e[o]>=n[i]))a=n[i++],r=n[i++];else if(o<e.length)a=e[o++],r=e[o++];else return t;!t.length||t[t.length-1]<a?t.push(a,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function XD(n,e,t){var i;let o,a,r;return t?(o=e.changes,a=qt.empty(e.changes.length),r=n.changes.compose(e.changes)):(o=e.changes.map(n.changes),a=n.changes.mapDesc(e.changes,!0),r=n.changes.compose(o)),{changes:r,selection:e.selection?e.selection.map(a):(i=n.selection)===null||i===void 0?void 0:i.map(o),effects:Le.mapEffects(n.effects,o).concat(Le.mapEffects(e.effects,a)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ky(n,e,t){let i=e.selection,o=Ar(e.annotations);return e.userEvent&&(o=o.concat(Gt.userEvent.of(e.userEvent))),{changes:e.changes instanceof qt?e.changes:qt.of(e.changes||[],t,n.facet(VD)),selection:i&&(i instanceof J?i:J.single(i.anchor,i.head)),effects:Ar(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function JD(n,e,t){let i=ky(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(t=!1);let r=!!e[a].sequential;i=XD(i,ky(n,e[a],r?i.changes.newLength:n.doc.length),r)}let o=Gt.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Y_(t?Q_(o):o)}function Q_(n){let e=n.startState,t=!0;for(let o of e.facet(WD)){let a=o(n);if(a===!1){t=!1;break}Array.isArray(a)&&(t=t===!0?a:W_(t,a))}if(t!==!0){let o,a;if(t===!1)a=n.changes.invertedDesc,o=qt.empty(e.doc.length);else{let r=n.changes.filter(t);o=r.changes,a=r.filtered.mapDesc(r.changes).invertedDesc}n=Gt.create(e,o,n.selection&&n.selection.map(a),Le.mapEffects(n.effects,a),n.annotations,n.scrollIntoView)}let i=e.facet(QD);for(let o=i.length-1;o>=0;o--){let a=i[o](n);a instanceof Gt?n=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Gt?n=a[0]:n=JD(e,Ar(a),!1)}return n}function Y_(n){let e=n.startState,t=e.facet(YD),i=n;for(let o=t.length-1;o>=0;o--){let a=t[o](n);a&&Object.keys(a).length&&(i=XD(i,ky(e,a,n.changes.newLength),!0))}return i==n?n:Gt.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const $_=[];function Ar(n){return n==null?$_:Array.isArray(n)?n:[n]}var kt=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(kt||(kt={}));const X_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wy;try{wy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function J_(n){if(wy)return wy.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||X_.test(t)))return!0}return!1}function Z_(n){return e=>{if(!/\S/.test(e))return kt.Space;if(J_(e))return kt.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return kt.Word;return kt.Other}}class Qe{constructor(e,t,i,o,a,r){this.config=e,this.doc=t,this.selection=i,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=a,r&&(r._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)uc(this,c<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return uc(this,i),vh(this,i)}update(...e){return JD(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:o}=t;for(let c of e.effects)c.is(uf.reconfigure)?(t&&(o=new Map,t.compartments.forEach((d,f)=>o.set(f,d)),t=null),o.set(c.value.compartment,c.value.extension)):c.is(Le.reconfigure)?(t=null,i=c.value):c.is(Le.appendConfig)&&(t=null,i=Ar(i).concat(c.value));let a;t?a=e.startState.values.slice():(t=xh.resolve(i,o,this),a=new Qe(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(d,f)=>f.reconfigure(d,this),null).values);let r=e.startState.facet(Sy)?e.newSelection:e.newSelection.asSingle();new Qe(t,e.newDoc,r,a,(c,d)=>d.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:J.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),o=this.changes(i.changes),a=[i.range],r=Ar(i.effects);for(let c=1;c<t.ranges.length;c++){let d=e(t.ranges[c]),f=this.changes(d.changes),g=f.map(o);for(let x=0;x<c;x++)a[x]=a[x].map(g);let m=o.mapDesc(f,!0);a.push(d.range.map(m)),o=o.compose(g),r=Le.mapEffects(r,g).concat(Le.mapEffects(Ar(d.effects),m))}return{changes:o,selection:J.create(a,t.mainIndex),effects:r}}changes(e=[]){return e instanceof qt?e:qt.of(e,this.doc.length,this.facet(Qe.lineSeparator))}toText(e){return Je.of(e.split(this.facet(Qe.lineSeparator)||yy))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(uc(this,t),vh(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let o=e[i];o instanceof hn&&this.config.address[o.id]!=null&&(t[i]=o.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let o=[];if(i){for(let a in i)if(Object.prototype.hasOwnProperty.call(e,a)){let r=i[a],c=e[a];o.push(r.init(d=>r.spec.fromJSON(c,d)))}}return Qe.create({doc:e.doc,selection:J.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=xh.resolve(e.extensions||[],new Map),i=e.doc instanceof Je?e.doc:Je.of((e.doc||"").split(t.staticFacet(Qe.lineSeparator)||yy)),o=e.selection?e.selection instanceof J?e.selection:J.single(e.selection.anchor,e.selection.head):J.single(0);return qD(o,i.length),t.staticFacet(Sy)||(o=o.asSingle()),new Qe(t,i,o,t.dynamicSlots.map(()=>null),(a,r)=>r.create(a),null)}get tabSize(){return this.facet(Qe.tabSize)}get lineBreak(){return this.facet(Qe.lineSeparator)||`
21
+ `}get readOnly(){return this.facet($D)}phrase(e,...t){for(let i of this.facet(Qe.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,o)=>{if(o=="$")return"$";let a=+(o||1);return!a||a>t.length?i:t[a-1]})),e}languageDataAt(e,t,i=-1){let o=[];for(let a of this.facet(KD))for(let r of a(this,t,i))Object.prototype.hasOwnProperty.call(r,e)&&o.push(r[e]);return o}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return Z_(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:o}=this.doc.lineAt(e),a=this.charCategorizer(e),r=e-i,c=e-i;for(;r>0;){let d=$t(t,r,!1);if(a(t.slice(d,r))!=kt.Word)break;r=d}for(;c<o;){let d=$t(t,c);if(a(t.slice(c,d))!=kt.Word)break;c=d}return r==c?null:J.range(r+i,c+i)}}Qe.allowMultipleSelections=Sy;Qe.tabSize=pe.define({combine:n=>n.length?n[0]:4});Qe.lineSeparator=VD;Qe.readOnly=$D;Qe.phrases=pe.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(o=>n[o]==e[o])}});Qe.languageData=KD;Qe.changeFilter=WD;Qe.transactionFilter=QD;Qe.transactionExtender=YD;uf.reconfigure=Le.define();function Xi(n,e,t={}){let i={};for(let o of n)for(let a of Object.keys(o)){let r=o[a],c=i[a];if(c===void 0)i[a]=r;else if(!(c===r||r===void 0))if(Object.hasOwnProperty.call(t,a))i[a]=t[a](c,r);else throw new Error("Config merge conflict for field "+a)}for(let o in e)i[o]===void 0&&(i[o]=e[o]);return i}class ys{eq(e){return this==e}range(e,t=e){return Ay.create(e,t,this)}}ys.prototype.startSide=ys.prototype.endSide=0;ys.prototype.point=!1;ys.prototype.mapMode=xn.TrackDel;function ax(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let Ay=class ZD{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ZD(e,t,i)}};function Py(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class rx{constructor(e,t,i,o){this.from=e,this.to=t,this.value=i,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,o=0){let a=i?this.to:this.from;for(let r=o,c=a.length;;){if(r==c)return r;let d=r+c>>1,f=a[d]-e||(i?this.value[d].endSide:this.value[d].startSide)-t;if(d==r)return f>=0?r:c;f>=0?c=d:r=d+1}}between(e,t,i,o){for(let a=this.findIndex(t,-1e9,!0),r=this.findIndex(i,1e9,!1,a);a<r;a++)if(o(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,t){let i=[],o=[],a=[],r=-1,c=-1;for(let d=0;d<this.value.length;d++){let f=this.value[d],g=this.from[d]+e,m=this.to[d]+e,x,v;if(g==m){let C=t.mapPos(g,f.startSide,f.mapMode);if(C==null||(x=v=C,f.startSide!=f.endSide&&(v=t.mapPos(g,f.endSide),v<x)))continue}else if(x=t.mapPos(g,f.startSide),v=t.mapPos(m,f.endSide),x>v||x==v&&f.startSide>0&&f.endSide<=0)continue;(v-x||f.endSide-f.startSide)<0||(r<0&&(r=x),f.point&&(c=Math.max(c,v-x)),i.push(f),o.push(x-r),a.push(v-r))}return{mapped:i.length?new rx(o,a,i,c):null,pos:r}}}class qe{constructor(e,t,i,o){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=o}static create(e,t,i,o){return new qe(e,t,i,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:o=0,filterTo:a=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(i&&(t=t.slice().sort(Py)),this.isEmpty)return t.length?qe.of(t):this;let c=new eO(this,null,-1).goto(0),d=0,f=[],g=new Yi;for(;c.value||d<t.length;)if(d<t.length&&(c.from-t[d].from||c.startSide-t[d].value.startSide)>=0){let m=t[d++];g.addInner(m.from,m.to,m.value)||f.push(m)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(d==t.length||this.chunkEnd(c.chunkIndex)<t[d].from)&&(!r||o>this.chunkEnd(c.chunkIndex)||a<this.chunkPos[c.chunkIndex])&&g.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!r||o>c.to||a<c.from||r(c.from,c.to,c.value))&&(g.addInner(c.from,c.to,c.value)||f.push(Ay.create(c.from,c.to,c.value))),c.next());return g.finishInner(this.nextLayer.isEmpty&&!f.length?qe.empty:this.nextLayer.update({add:f,filter:r,filterFrom:o,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],o=-1;for(let r=0;r<this.chunk.length;r++){let c=this.chunkPos[r],d=this.chunk[r],f=e.touchesRange(c,c+d.length);if(f===!1)o=Math.max(o,d.maxPoint),t.push(d),i.push(e.mapPos(c));else if(f===!0){let{mapped:g,pos:m}=d.map(c,e);g&&(o=Math.max(o,g.maxPoint),t.push(g),i.push(m))}}let a=this.nextLayer.map(e);return t.length==0?a:new qe(i,t,a||qe.empty,o)}between(e,t,i){if(!this.isEmpty){for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],r=this.chunk[o];if(t>=a&&e<=a+r.length&&r.between(a,e-a,t-a,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Pc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Pc.from(e).goto(t)}static compare(e,t,i,o,a=-1){let r=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=a),c=t.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=a),d=pw(r,c,i),f=new Kl(r,d,a),g=new Kl(c,d,a);i.iterGaps((m,x,v)=>gw(f,m,g,x,v,o)),i.empty&&i.length==0&&gw(f,0,g,0,0,o)}static eq(e,t,i=0,o){o==null&&(o=999999999);let a=e.filter(g=>!g.isEmpty&&t.indexOf(g)<0),r=t.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(a.length!=r.length)return!1;if(!a.length)return!0;let c=pw(a,r),d=new Kl(a,c,0).goto(i),f=new Kl(r,c,0).goto(i);for(;;){if(d.to!=f.to||!Dy(d.active,f.active)||d.point&&(!f.point||!ax(d.point,f.point)))return!1;if(d.to>o)return!0;d.next(),f.next()}}static spans(e,t,i,o,a=-1){let r=new Kl(e,null,a).goto(t),c=t,d=r.openStart;for(;;){let f=Math.min(r.to,i);if(r.point){let g=r.activeForPoint(r.to),m=r.pointFrom<t?g.length+1:r.point.startSide<0?g.length:Math.min(g.length,d);o.point(c,f,r.point,g,m,r.pointRank),d=Math.min(r.openEnd(f),g.length)}else f>c&&(o.span(c,f,r.active,d),d=r.openEnd(f));if(r.to>i)return d+(r.point&&r.to>i?1:0);c=r.to,r.next()}}static of(e,t=!1){let i=new Yi;for(let o of e instanceof Ay?[e]:t?eU(e):e)i.add(o.from,o.to,o.value);return i.finish()}static join(e){if(!e.length)return qe.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let o=e[i];o!=qe.empty;o=o.nextLayer)t=new qe(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}qe.empty=new qe([],[],null,-1);function eU(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(Py(e,i)>0)return n.slice().sort(Py);e=i}return n}qe.empty.nextLayer=qe.empty;class Yi{finishChunk(e){this.chunks.push(new rx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Yi)).add(e,t,i)}addInner(e,t,i){let o=e-this.lastTo||i.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(qe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=qe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function pw(n,e,t){let i=new Map;for(let a of n)for(let r=0;r<a.chunk.length;r++)a.chunk[r].maxPoint<=0&&i.set(a.chunk[r],a.chunkPos[r]);let o=new Set;for(let a of e)for(let r=0;r<a.chunk.length;r++){let c=i.get(a.chunk[r]);c!=null&&(t?t.mapPos(c):c)==a.chunkPos[r]&&!t?.touchesRange(c,c+a.chunk[r].length)&&o.add(a.chunk[r])}return o}class eO{constructor(e,t,i,o=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=o}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let o=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(o)||this.layer.chunkEnd(this.chunkIndex)<e||o.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let o=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<o)&&this.setRangeIndex(o)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Pc{constructor(e){this.heap=e}static from(e,t=null,i=-1){let o=[];for(let a=0;a<e.length;a++)for(let r=e[a];!r.isEmpty;r=r.nextLayer)r.maxPoint>=i&&o.push(new eO(r,t,i,a));return o.length==1?o[0]:new Pc(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ym(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ym(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ym(this.heap,0)}}}function ym(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let o=n[i];if(i+1<n.length&&o.compare(n[i+1])>=0&&(o=n[i+1],i++),t.compare(o)<0)break;n[i]=t,n[e]=o,e=i}}class Kl{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pc.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Od(this.active,e),Od(this.activeTo,e),Od(this.activeRank,e),this.minActive=mw(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:o,rank:a}=this.cursor;for(;t<this.activeRank.length&&(a-this.activeRank[t]||o-this.activeTo[t])>0;)t++;Td(this.active,t,i),Td(this.activeTo,t,o),Td(this.activeRank,t,a),e&&Td(e,t,this.cursor.from),this.minActive=mw(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),i&&Od(i,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let o=i.length-1;o>=0&&i[o]<e;o--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function gw(n,e,t,i,o,a){n.goto(e),t.goto(i);let r=i+o,c=i,d=i-e,f=!!a.boundChange;for(let g=!1;;){let m=n.to+d-t.to,x=m||n.endSide-t.endSide,v=x<0?n.to+d:t.to,C=Math.min(v,r);if(n.point||t.point?(n.point&&t.point&&ax(n.point,t.point)&&Dy(n.activeForPoint(n.to),t.activeForPoint(t.to))||a.comparePoint(c,C,n.point,t.point),g=!1):(g&&a.boundChange(c),C>c&&!Dy(n.active,t.active)&&a.compareRange(c,C,n.active,t.active),f&&C<r&&(m||n.openEnd(v)!=t.openEnd(v))&&(g=!0)),v>r)break;c=v,x<=0&&n.next(),x>=0&&t.next()}}function Dy(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!ax(n[t],e[t]))return!1;return!0}function Od(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function Td(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function mw(n,e){let t=-1,i=1e9;for(let o=0;o<e.length;o++)(e[o]-i||n[o].endSide-n[t].endSide)<0&&(t=o,i=e[o]);return t}function Vr(n,e,t=n.length){let i=0;for(let o=0;o<t&&o<n.length;)n.charCodeAt(o)==9?(i+=e-i%e,o++):(i++,o=$t(n,o));return i}function Oy(n,e,t,i){for(let o=0,a=0;;){if(a>=e)return o;if(o==n.length)break;a+=n.charCodeAt(o)==9?t-a%t:1,o=$t(n,o)}return i===!0?-1:n.length}const Ty="ͼ",yw=typeof Symbol>"u"?"__"+Ty:Symbol.for(Ty),My=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class bs{constructor(e,t){this.rules=[];let{finish:i}=t||{};function o(r){return/^@/.test(r)?[r]:r.split(/,\s*/)}function a(r,c,d,f){let g=[],m=/^@(\w+)\b/.exec(r[0]),x=m&&m[1]=="keyframes";if(m&&c==null)return d.push(r[0]+";");for(let v in c){let C=c[v];if(/&/.test(v))a(v.split(/,\s*/).map(k=>r.map(w=>k.replace(/&/,w))).reduce((k,w)=>k.concat(w)),C,d);else if(C&&typeof C=="object"){if(!m)throw new RangeError("The value of a property ("+v+") should be a primitive value.");a(o(v),C,g,x)}else C!=null&&g.push(v.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+C+";")}(g.length||x)&&d.push((i&&!m&&!f?r.map(i):r).join(", ")+" {"+g.join(" ")+"}")}for(let r in e)a(o(r),e[r],this.rules)}getRules(){return this.rules.join(`
22
+ `)}static newName(){let e=bw[yw]||1;return bw[yw]=e+1,Ty+e.toString(36)}static mount(e,t,i){let o=e[My],a=i&&i.nonce;o?a&&o.setNonce(a):o=new tU(e,a),o.mount(Array.isArray(t)?t:[t],e)}}let xw=new Map;class tU{constructor(e,t){let i=e.ownerDocument||e,o=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let a=xw.get(i);if(a)return e[My]=a;this.sheet=new o.CSSStyleSheet,xw.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[My]=this}mount(e,t){let i=this.sheet,o=0,a=0;for(let r=0;r<e.length;r++){let c=e[r],d=this.modules.indexOf(c);if(d<a&&d>-1&&(this.modules.splice(d,1),a--,d=-1),d==-1){if(this.modules.splice(a++,0,c),i)for(let f=0;f<c.rules.length;f++)i.insertRule(c.rules[f],o++)}else{for(;a<d;)o+=this.modules[a++].rules.length;o+=c.rules.length,a++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let r="";for(let d=0;d<this.modules.length;d++)r+=this.modules[d].getRules()+`
23
+ `;this.styleTag.textContent=r;let c=t.head||t;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var xs={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Dc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nU=typeof navigator<"u"&&/Mac/.test(navigator.platform),iU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)xs[48+an]=xs[96+an]=String(an);for(var an=1;an<=24;an++)xs[an+111]="F"+an;for(var an=65;an<=90;an++)xs[an]=String.fromCharCode(an+32),Dc[an]=String.fromCharCode(an);for(var bm in xs)Dc.hasOwnProperty(bm)||(Dc[bm]=xs[bm]);function oU(n){var e=nU&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iU&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Dc:xs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function dt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];typeof o=="string"?n.setAttribute(i,o):o!=null&&(n[i]=o)}e++}for(;e<arguments.length;e++)tO(n,arguments[e]);return n}function tO(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)tO(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let bn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ny=typeof document<"u"?document:{documentElement:{style:{}}};const Ly=/Edge\/(\d+)/.exec(bn.userAgent),nO=/MSIE \d/.test(bn.userAgent),Ry=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bn.userAgent),df=!!(nO||Ry||Ly),vw=!df&&/gecko\/(\d+)/i.test(bn.userAgent),xm=!df&&/Chrome\/(\d+)/.exec(bn.userAgent),Cw="webkitFontSmoothing"in Ny.documentElement.style,Ey=!df&&/Apple Computer/.test(bn.vendor),Sw=Ey&&(/Mobile\/\w+/.test(bn.userAgent)||bn.maxTouchPoints>2);var ge={mac:Sw||/Mac/.test(bn.platform),windows:/Win/.test(bn.platform),linux:/Linux|X11/.test(bn.platform),ie:df,ie_version:nO?Ny.documentMode||6:Ry?+Ry[1]:Ly?+Ly[1]:0,gecko:vw,gecko_version:vw?+(/Firefox\/(\d+)/.exec(bn.userAgent)||[0,0])[1]:0,chrome:!!xm,chrome_version:xm?+xm[1]:0,ios:Sw,android:/Android\b/.test(bn.userAgent),webkit:Cw,webkit_version:Cw?+(/\bAppleWebKit\/(\d+)/.exec(bn.userAgent)||[0,0])[1]:0,safari:Ey,safari_version:Ey?+(/\bVersion\/(\d+(\.\d+)?)/.exec(bn.userAgent)||[0,0])[1]:0,tabSize:Ny.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function lx(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Ch=Object.create(null);function cx(n,e,t){if(n==e)return!0;n||(n=Ch),e||(e=Ch);let i=Object.keys(n),o=Object.keys(e);if(i.length-0!=o.length-0)return!1;for(let a of i)if(a!=t&&(o.indexOf(a)==-1||n[a]!==e[a]))return!1;return!0}function sU(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function kw(n,e,t){let i=!1;if(e)for(let o in e)t&&o in t||(i=!0,o=="style"?n.style.cssText="":n.removeAttribute(o));if(t)for(let o in t)e&&e[o]==t[o]||(i=!0,o=="style"?n.style.cssText=t[o]:n.setAttribute(o,t[o]));return i}function aU(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class Ji{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var rn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(rn||(rn={}));class Pe extends ys{constructor(e,t,i,o){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=o}get heightRelevant(){return!1}static mark(e){return new $c(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new ma(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,o;if(e.isBlockGap)i=-5e8,o=4e8;else{let{start:a,end:r}=iO(e,t);i=(a?t?-3e8:-1:5e8)-1,o=(r?t?2e8:1:-6e8)+1}return new ma(e,i,o,t,e.widget||null,!0)}static line(e){return new Xc(e)}static set(e,t=!1){return qe.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Pe.none=qe.empty;class $c extends Pe{constructor(e){let{start:t,end:i}=iO(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?lx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ch}eq(e){return this==e||e instanceof $c&&this.tagName==e.tagName&&cx(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$c.prototype.point=!1;class Xc extends Pe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Xc&&this.spec.class==e.spec.class&&cx(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Xc.prototype.mapMode=xn.TrackBefore;Xc.prototype.point=!0;class ma extends Pe{constructor(e,t,i,o,a,r){super(t,i,a,e),this.block=o,this.isReplace=r,this.mapMode=o?t<=0?xn.TrackBefore:xn.TrackAfter:xn.TrackDel}get type(){return this.startSide!=this.endSide?rn.WidgetRange:this.startSide<=0?rn.WidgetBefore:rn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ma&&rU(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ma.prototype.point=!0;function iO(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function rU(n,e){return n==e||!!(n&&e&&n.compare(e))}function Pr(n,e,t,i=0){let o=t.length-1;o>=0&&t[o]+i>=n?t[o]=Math.max(t[o],e):t.push(n,e)}class Oc extends ys{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof Oc&&this.tagName==e.tagName&&cx(this.attributes,e.attributes)}static create(e){return new Oc(e.tagName,e.attributes||Ch,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return qe.of(e,t)}}Oc.prototype.startSide=Oc.prototype.endSide=-1;function Tc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Iy(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function dc(n,e){if(!e.anchorNode)return!1;try{return Iy(n,e.anchorNode)}catch{return!1}}function hc(n){return n.nodeType==3?Nc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function fc(n,e,t,i){return t?ww(n,e,t,i,-1)||ww(n,e,t,i,1):!1}function vs(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Sh(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function ww(n,e,t,i,o){for(;;){if(n==t&&e==i)return!0;if(e==(o<0?0:Lo(n))){if(n.nodeName=="DIV")return!1;let a=n.parentNode;if(!a||a.nodeType!=1)return!1;e=vs(n)+(o<0?0:1),n=a}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=o<0?Lo(n):0}else return!1}}function Lo(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Mc(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function lU(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function oO(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function cU(n,e,t,i,o,a,r,c){let d=n.ownerDocument,f=d.defaultView||window;for(let g=n,m=!1;g&&!m;)if(g.nodeType==1){let x,v=g==d.body,C=1,k=1;if(v)x=lU(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(m=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let O=g.getBoundingClientRect();({scaleX:C,scaleY:k}=oO(g,O)),x={left:O.left,right:O.left+g.clientWidth*C,top:O.top,bottom:O.top+g.clientHeight*k}}let w=0,D=0;if(o=="nearest")e.top<x.top+r?(D=e.top-(x.top+r),t>0&&e.bottom>x.bottom+D&&(D=e.bottom-x.bottom+r)):e.bottom>x.bottom-r&&(D=e.bottom-x.bottom+r,t<0&&e.top-D<x.top&&(D=e.top-(x.top+r)));else{let O=e.bottom-e.top,M=x.bottom-x.top;D=(o=="center"&&O<=M?e.top+O/2-M/2:o=="start"||o=="center"&&t<0?e.top-r:e.bottom-M+r)-x.top}if(i=="nearest"?e.left<x.left+a?(w=e.left-(x.left+a),t>0&&e.right>x.right+w&&(w=e.right-x.right+a)):e.right>x.right-a&&(w=e.right-x.right+a,t<0&&e.left<x.left+w&&(w=e.left-(x.left+a))):w=(i=="center"?e.left+(e.right-e.left)/2-(x.right-x.left)/2:i=="start"==c?e.left-a:e.right-(x.right-x.left)+a)-x.left,w||D)if(v)f.scrollBy(w,D);else{let O=0,M=0;if(D){let T=g.scrollTop;g.scrollTop+=D/k,M=(g.scrollTop-T)*k}if(w){let T=g.scrollLeft;g.scrollLeft+=w/C,O=(g.scrollLeft-T)*C}e={left:e.left-O,top:e.top-M,right:e.right-O,bottom:e.bottom-M},O&&Math.abs(O-w)<1&&(i="nearest"),M&&Math.abs(M-D)<1&&(o="nearest")}if(v)break;(e.top<x.top||e.bottom>x.bottom||e.left<x.left||e.right>x.right)&&(e={left:Math.max(e.left,x.left),right:Math.min(e.right,x.right),top:Math.max(e.top,x.top),bottom:Math.min(e.bottom,x.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function sO(n,e=!0){let t=n.ownerDocument,i=null,o=null;for(let a=n.parentNode;a&&!(a==t.body||(!e||i)&&o);)if(a.nodeType==1)!o&&a.scrollHeight>a.clientHeight&&(o=a),e&&!i&&a.scrollWidth>a.clientWidth&&(i=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:i,y:o}}class uU{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Lo(t):0),i,Math.min(e.focusOffset,i?Lo(i):0))}set(e,t,i,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=o}}let Js=null;ge.safari&&ge.safari_version>=26&&(Js=!1);function aO(n){if(n.setActive)return n.setActive();if(Js)return n.focus(Js);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Js==null?{get preventScroll(){return Js={preventScroll:!0},!0}}:void 0),!Js){Js=!1;for(let t=0;t<e.length;){let i=e[t++],o=e[t++],a=e[t++];i.scrollTop!=o&&(i.scrollTop=o),i.scrollLeft!=a&&(i.scrollLeft=a)}}}let Aw;function Nc(n,e,t=e){let i=Aw||(Aw=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Dr(n,e,t,i){let o={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=i);let a=new KeyboardEvent("keydown",o);a.synthetic=!0,n.dispatchEvent(a);let r=new KeyboardEvent("keyup",o);return r.synthetic=!0,n.dispatchEvent(r),a.defaultPrevented||r.defaultPrevented}function dU(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function hU(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Lo(t));;)if(i){if(t.nodeType!=1)return!1;let o=t.childNodes[i-1];o.contentEditable=="false"?i--:(t=o,i=Lo(t))}else{if(t==n)return!0;i=vs(t),t=t.parentNode}}function rO(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function lO(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=Lo(t)}else if(t.parentNode&&!Sh(t))i=vs(t),t=t.parentNode;else return null}}function cO(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!Sh(t))i=vs(t)+1,t=t.parentNode;else return null}}class Ci{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Ci(e.parentNode,vs(e),t)}static after(e,t){return new Ci(e.parentNode,vs(e)+1,t)}}var yt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(yt||(yt={}));const ya=yt.LTR,ux=yt.RTL;function uO(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const fU=uO("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),pU=uO("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),jy=Object.create(null),Li=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);jy[e]=t,jy[t]=-e}function dO(n){return n<=247?fU[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?pU[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const gU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Fi{get dir(){return this.level%2?ux:ya}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,o){let a=-1;for(let r=0;r<e.length;r++){let c=e[r];if(c.from<=t&&c.to>=t){if(c.level==i)return r;(a<0||(o!=0?o<0?c.from<t:c.to>t:e[a].level>c.level))&&(a=r)}}if(a<0)throw new RangeError("Index out of range");return a}}function hO(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],o=e[t];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!hO(i.inner,o.inner))return!1}return!0}const gt=[];function mU(n,e,t,i,o){for(let a=0;a<=i.length;a++){let r=a?i[a-1].to:e,c=a<i.length?i[a].from:t,d=a?256:o;for(let f=r,g=d,m=d;f<c;f++){let x=dO(n.charCodeAt(f));x==512?x=g:x==8&&m==4&&(x=16),gt[f]=x==4?2:x,x&7&&(m=x),g=x}for(let f=r,g=d,m=d;f<c;f++){let x=gt[f];if(x==128)f<c-1&&g==gt[f+1]&&g&24?x=gt[f]=g:gt[f]=256;else if(x==64){let v=f+1;for(;v<c&&gt[v]==64;)v++;let C=f&&g==8||v<t&&gt[v]==8?m==1?1:8:256;for(let k=f;k<v;k++)gt[k]=C;f=v-1}else x==8&&m==1&&(gt[f]=1);g=x,x&7&&(m=x)}}}function yU(n,e,t,i,o){let a=o==1?2:1;for(let r=0,c=0,d=0;r<=i.length;r++){let f=r?i[r-1].to:e,g=r<i.length?i[r].from:t;for(let m=f,x,v,C;m<g;m++)if(v=jy[x=n.charCodeAt(m)])if(v<0){for(let k=c-3;k>=0;k-=3)if(Li[k+1]==-v){let w=Li[k+2],D=w&2?o:w&4?w&1?a:o:0;D&&(gt[m]=gt[Li[k]]=D),c=k;break}}else{if(Li.length==189)break;Li[c++]=m,Li[c++]=x,Li[c++]=d}else if((C=gt[m])==2||C==1){let k=C==o;d=k?0:1;for(let w=c-3;w>=0;w-=3){let D=Li[w+2];if(D&2)break;if(k)Li[w+2]|=2;else{if(D&4)break;Li[w+2]|=4}}}}}function bU(n,e,t,i){for(let o=0,a=i;o<=t.length;o++){let r=o?t[o-1].to:n,c=o<t.length?t[o].from:e;for(let d=r;d<c;){let f=gt[d];if(f==256){let g=d+1;for(;;)if(g==c){if(o==t.length)break;g=t[o++].to,c=o<t.length?t[o].from:e}else if(gt[g]==256)g++;else break;let m=a==1,x=(g<e?gt[g]:i)==1,v=m==x?m?1:2:i;for(let C=g,k=o,w=k?t[k-1].to:n;C>d;)C==w&&(C=t[--k].from,w=k?t[k-1].to:n),gt[--C]=v;d=g}else a=f,d++}}}function By(n,e,t,i,o,a,r){let c=i%2?2:1;if(i%2==o%2)for(let d=e,f=0;d<t;){let g=!0,m=!1;if(f==a.length||d<a[f].from){let k=gt[d];k!=c&&(g=!1,m=k==16)}let x=!g&&c==1?[]:null,v=g?i:i+1,C=d;e:for(;;)if(f<a.length&&C==a[f].from){if(m)break e;let k=a[f];if(!g)for(let w=k.to,D=f+1;;){if(w==t)break e;if(D<a.length&&a[D].from==w)w=a[D++].to;else{if(gt[w]==c)break e;break}}if(f++,x)x.push(k);else{k.from>d&&r.push(new Fi(d,k.from,v));let w=k.direction==ya!=!(v%2);Hy(n,w?i+1:i,o,k.inner,k.from,k.to,r),d=k.to}C=k.to}else{if(C==t||(g?gt[C]!=c:gt[C]==c))break;C++}x?By(n,d,C,i+1,o,x,r):d<C&&r.push(new Fi(d,C,v)),d=C}else for(let d=t,f=a.length;d>e;){let g=!0,m=!1;if(!f||d>a[f-1].to){let k=gt[d-1];k!=c&&(g=!1,m=k==16)}let x=!g&&c==1?[]:null,v=g?i:i+1,C=d;e:for(;;)if(f&&C==a[f-1].to){if(m)break e;let k=a[--f];if(!g)for(let w=k.from,D=f;;){if(w==e)break e;if(D&&a[D-1].to==w)w=a[--D].from;else{if(gt[w-1]==c)break e;break}}if(x)x.push(k);else{k.to<d&&r.push(new Fi(k.to,d,v));let w=k.direction==ya!=!(v%2);Hy(n,w?i+1:i,o,k.inner,k.from,k.to,r),d=k.from}C=k.from}else{if(C==e||(g?gt[C-1]!=c:gt[C-1]==c))break;C--}x?By(n,C,d,i+1,o,x,r):C<d&&r.push(new Fi(C,d,v)),d=C}}function Hy(n,e,t,i,o,a,r){let c=e%2?2:1;mU(n,o,a,i,c),yU(n,o,a,i,c),bU(o,a,i,c),By(n,o,a,e,t,i,r)}function xU(n,e,t){if(!n)return[new Fi(0,0,e==ux?1:0)];if(e==ya&&!t.length&&!gU.test(n))return fO(n.length);if(t.length)for(;n.length>gt.length;)gt[gt.length]=256;let i=[],o=e==ya?0:1;return Hy(n,o,o,t,0,n.length,i),i}function fO(n){return[new Fi(0,n,0)]}let pO="";function vU(n,e,t,i,o){var a;let r=i.head-n.from,c=Fi.find(e,r,(a=i.bidiLevel)!==null&&a!==void 0?a:-1,i.assoc),d=e[c],f=d.side(o,t);if(r==f){let x=c+=o?1:-1;if(x<0||x>=e.length)return null;d=e[c=x],r=d.side(!o,t),f=d.side(o,t)}let g=$t(n.text,r,d.forward(o,t));(g<d.from||g>d.to)&&(g=f),pO=n.text.slice(Math.min(r,g),Math.max(r,g));let m=c==(o?e.length-1:0)?null:e[c+(o?1:-1)];return m&&g==f&&m.level+(o?0:1)<d.level?J.cursor(m.side(!o,t)+n.from,m.forward(o,t)?1:-1,m.level):J.cursor(g+n.from,d.forward(o,t)?-1:1,d.level)}function CU(n,e,t){for(let i=e;i<t;i++){let o=dO(n.charCodeAt(i));if(o==1)return ya;if(o==2||o==4)return ux}return ya}const gO=pe.define(),mO=pe.define(),yO=pe.define(),bO=pe.define(),_y=pe.define(),xO=pe.define(),vO=pe.define(),dx=pe.define(),hx=pe.define(),CO=pe.define({combine:n=>n.some(e=>e)}),SO=pe.define({combine:n=>n.some(e=>e)}),kO=pe.define();class Or{constructor(e,t,i,o,a,r=!1){this.range=e,this.y=t,this.x=i,this.yMargin=o,this.xMargin=a,this.isSnapshot=r}map(e){return e.empty?this:new Or(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Or(J.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Md=Le.define({map:(n,e)=>n.map(e)}),wO=Le.define();function En(n,e,t){let i=n.facet(bO);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const ko=pe.define({combine:n=>n.length?n[0]:!0});let SU=0;const br=pe.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class At{constructor(e,t,i,o,a){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=o,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(br.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(br.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:o,provide:a,decorations:r}=t||{};return new At(SU++,e,i,o,c=>{let d=[];return r&&d.push(hf.of(f=>{let g=f.plugin(c);return g?r(g):Pe.none})),a&&d.push(a(c)),d})}static fromClass(e,t){return At.define((i,o)=>new e(i,o),t)}}class vm{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(En(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){En(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){En(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const AO=pe.define(),fx=pe.define(),hf=pe.define(),PO=pe.define(),px=pe.define(),Jc=pe.define(),DO=pe.define();function Pw(n,e){let t=n.state.facet(DO);if(!t.length)return t;let i=t.map(a=>a instanceof Function?a(n):a),o=[];return qe.spans(i,e.from,e.to,{point(){},span(a,r,c,d){let f=a-e.from,g=r-e.from,m=o;for(let x=c.length-1;x>=0;x--,d--){let v=c[x].spec.bidiIsolate,C;if(v==null&&(v=CU(e.text,f,g)),d>0&&m.length&&(C=m[m.length-1]).to==f&&C.direction==v)C.to=g,m=C.inner;else{let k={from:f,to:g,direction:v,inner:[]};m.push(k),m=k.inner}}}}),o}const OO=pe.define();function gx(n){let e=0,t=0,i=0,o=0;for(let a of n.state.facet(OO)){let r=a(n);r&&(r.left!=null&&(e=Math.max(e,r.left)),r.right!=null&&(t=Math.max(t,r.right)),r.top!=null&&(i=Math.max(i,r.top)),r.bottom!=null&&(o=Math.max(o,r.bottom)))}return{left:e,right:t,top:i,bottom:o}}const ec=pe.define();class ri{constructor(e,t,i,o){this.fromA=e,this.toA=t,this.fromB=i,this.toB=o}join(e){return new ri(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>i.toA)){if(o.toA<i.fromA)break;i=i.join(o),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let o=0,a=0,r=0;;){let c=o<e.length?e[o].fromB:1e9,d=a<t.length?t[a]:1e9,f=Math.min(c,d);if(f==1e9)break;let g=f+r,m=f,x=g;for(;;)if(a<t.length&&t[a]<=m){let v=t[a+1];a+=2,m=Math.max(m,v);for(let C=o;C<e.length&&e[C].fromB<=m;C++)r=e[C].toA-e[C].toB;x=Math.max(x,v+r)}else if(o<e.length&&e[o].fromB<=m){let v=e[o++];m=Math.max(m,v.toB),x=Math.max(x,v.toA),r=v.toA-v.toB}else break;i.push(new ri(g,x,f,m))}return i}}class kh{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=qt.empty(this.startState.doc.length);for(let a of i)this.changes=this.changes.compose(a.changes);let o=[];this.changes.iterChangedRanges((a,r,c,d)=>o.push(new ri(a,r,c,d))),this.changedRanges=o}static create(e,t,i){return new kh(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const kU=[];class Nt{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return kU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&sU(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let o of this.children){if(o==e)return i;i+=o.length+o.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=vs(this.dom),o=this.length?e>0:t>0;return new Ci(this.parent.dom,i+(o?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof pf)return e;return null}static get(e){return e.cmTile}}class ff extends Nt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,o,a=e?.node==t?e:null,r=0;for(let c of this.children){if(c.sync(e),r+=c.length+c.breakAfter,o=i?i.nextSibling:t.firstChild,a&&o!=c.dom&&(a.written=!0),c.dom.parentNode==t)for(;o&&o!=c.dom;)o=Dw(o);else t.insertBefore(c.dom,o);i=c.dom}for(o=i?i.nextSibling:t.firstChild,a&&o&&(a.written=!0);o;)o=Dw(o);this.length=r}}function Dw(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class pf extends ff{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Nt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,o=0,a=0;;)if(o==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&a++,o=t.pop()}else{let r=i.children[o++];if(r instanceof Do)t.push(o),i=r,o=0;else{let c=a+r.length,d=e(r,a);if(d!==void 0)return d;a=c+r.breakAfter}}}resolveBlock(e,t){let i,o=-1,a,r=-1;if(this.blockTiles((c,d)=>{let f=d+c.length;if(e>=d&&e<=f){if(c.isWidget()&&t>=-1&&t<=1){if(c.flags&32)return!0;c.flags&16&&(i=void 0)}(d<e||e==f&&(t<-1?c.length:c.covers(1)))&&(!i||!c.isWidget()&&i.isWidget())&&(i=c,o=e-d),(f>e||e==d&&(t>1?c.length:c.covers(-1)))&&(!a||!c.isWidget()&&a.isWidget())&&(a=c,r=e-d)}}),!i&&!a)throw new Error("No tile at position "+e);return i&&t<0||!a?{tile:i,offset:o}:{tile:a,offset:r}}}class Do extends ff{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new Do(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class jr extends ff{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let o=new jr(t||document.createElement("div"),e);return(!t||!i)&&(o.flags|=4),o}get domAttrs(){return this.attrs}resolveInline(e,t,i){let o=null,a=-1,r=null,c=-1;function d(g,m){for(let x=0,v=0;x<g.children.length&&v<=m;x++){let C=g.children[x],k=v+C.length;k>=m&&(C.isComposite()?d(C,m-v):(!r||r.isHidden&&(t>0||i&&AU(r,C)))&&(k>m||C.flags&32)?(r=C,c=m-v):(v<m||C.flags&16&&!C.isHidden)&&(o=C,a=m-v)),v=k}}d(this,e);let f=(t<0?o:r)||o||r;return f?{tile:f,offset:f==o?a:c}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):wU(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:o,offset:a}=i;if(this.dom.contains(o.dom))return o.isText()?new Ci(o.dom,Math.min(o.dom.nodeValue.length,a)):o.domPosFor(a,o.flags&16?1:o.flags&32?-1:t);let r=i.tile.parent,c=!1;for(let d of r.children){if(c)return new Ci(d.dom,0);d==i.tile&&(c=!0)}}return new Ci(this.dom,0)}}function wU(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=hc(e);return t[t.length-1]||null}function AU(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Rn extends ff{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Rn(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class ia extends Nt{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let o=e,a=e,r=0;e==0&&t<0||e==i&&t>=0?ge.chrome||ge.gecko||(e?(o--,r=1):a<i&&(a++,r=-1)):t<0?o--:a<i&&a++;let c=Nc(this.dom,o,a).getClientRects();if(!c.length)return null;let d=c[(r?r<0:t>=0)?0:c.length-1];return ge.safari&&!r&&d.width==0&&(d=Array.prototype.find.call(c,f=>f.width)||d),r?Mc(d,r<0):d||null}static of(e,t){let i=new ia(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ba extends Nt{constructor(e,t,i,o){super(e,t,o),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let o=this.widget.coordsAt(this.dom,e,t);if(o)return o;if(i)return Mc(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let a=this.dom.getClientRects(),r=null;if(!a.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let d=c?a.length-1:0;r=a[d],!(e>0?d==0:d==a.length-1||r.top<r.bottom);d+=c?-1:1);return Mc(r,!c)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:e}=this;if(!e)return Je.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,o,a){return a||(a=e.toDOM(t),e.editable||(a.contentEditable="false")),new ba(a,i,e,o)}}class wh extends Nt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Je.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class PU{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:o,index:a,beforeBreak:r,parents:c}=this;for(;e||t>0;)if(o.isComposite())if(r){if(!e)break;i&&i.break(),e--,r=!1}else if(a==o.children.length){if(!e&&!c.length)break;i&&i.leave(o),r=!!o.breakAfter,{tile:o,index:a}=c.pop(),a++}else{let d=o.children[a],f=d.breakAfter;(t>0?d.length<=e:d.length<e)&&(!i||i.skip(d,0,d.length)!==!1||!d.isComposite)?(r=!!f,a++,e-=d.length):(c.push({tile:o,index:a}),o=d,a=0,i&&d.isComposite()&&i.enter(d))}else if(a==o.length)r=!!o.breakAfter,{tile:o,index:a}=c.pop(),a++;else if(e){let d=Math.min(e,o.length-a);i&&i.skip(o,a,a+d),e-=d,a+=d}else break;return this.tile=o,this.index=a,this.beforeBreak=r,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class DU{constructor(e,t,i,o){this.from=e,this.to=t,this.wrapper=i,this.rank=o}}class OU{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,o){var a;this.flushBuffer();let r=this.ensureMarks(t,i),c=r.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let d=r.children[r.children.length-1]=new ia(c.dom,c.text+e);d.parent=r}else r.append(o||ia.of(e,(a=this.cache.find(ia))===null||a===void 0?void 0:a.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?Cm(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let o=i;for(let c=t.marks.length-1;c>=0;c--){let d=t.marks[c],f=o.lastChild;if(f instanceof Rn&&f.mark.eq(d.mark))f.dom!=d.dom&&f.setDOM(Cm(d.dom)),o=f;else{if(this.cache.reused.get(d)){let m=Nt.get(d.dom);m&&m.setDOM(Cm(d.dom))}let g=Rn.of(d.mark,d.dom);o.append(g),o=g}this.cache.reused.set(d,2)}let a=Nt.get(e.text);a&&this.cache.reused.set(a,2);let r=new ia(e.text,e.text.nodeValue);r.flags|=8,this.pos=e.range.toB,o.append(r)}addInlineWidget(e,t,i){let o=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);o||this.flushBuffer();let a=this.ensureMarks(t,i);!o&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=TO);let o=jr.start(e,t||((i=this.cache.find(jr))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=o)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let o=this.curLine;for(let a=e.length-1;a>=0;a--){let r=e[a],c;if(t>0&&(c=o.lastChild)&&c instanceof Rn&&c.mark.eq(r))o=c,t--;else{let d=Rn.of(r,(i=this.cache.find(Rn,f=>f.mark.eq(r)))===null||i===void 0?void 0:i.dom);o.append(d),o=d,t=0}}return o}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Ow(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(ge.ios&&Ow(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Sm,0,32)||new ba(Sm.toDOM(),0,Sm,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,i=new DU(e.from,e.to,e.value,t),o=this.wrappers.length;for(;o>0&&(this.wrappers[o-1].rank-i.rank||this.wrappers[o-1].to-i.to)<0;)o--;this.wrappers.splice(o,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let o=t.lastChild;if(i.from<this.pos&&o instanceof Do&&o.wrapper.eq(i.wrapper))t=o;else{let a=Do.of(i.wrapper,(e=this.cache.find(Do,r=>r.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(a),t=a}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(wh,void 0,1);return i&&(i.flags=t),i||new wh(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class TU{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw new Error("Ran out of text content when drawing inline views");this.text=o;let c=this.textOff=Math.min(e,o.length);return a?null:o.slice(0,c)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const Ah=[ba,jr,ia,Rn,wh,Do,pf];for(let n=0;n<Ah.length;n++)Ah[n].bucket=n;class MU{constructor(e){this.view=e,this.buckets=Ah.map(()=>[]),this.index=Ah.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let o=e.bucket,a=this.buckets[o],r=this.index[o];for(let c=a.length-1;c>=0;c--){let d=(c+r)%a.length,f=a[d];if((!t||t(f))&&!this.reused.has(f))return a.splice(d,1),d<r&&this.index[o]--,this.reused.set(f,i),f}return null}findWidget(e,t,i){let o=this.buckets[0];if(o.length)for(let a=0,r=0;;a++){if(a==o.length){if(r)return null;r=1,a=0}let c=o[a];if(!this.reused.has(c)&&(r==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view,c.widget)))return o.splice(a,1),a<this.index[0]&&this.index[0]--,c.widget==e&&c.length==t&&(c.flags&497)==i?(this.reused.set(c,1),c):(this.reused.set(c,2),new ba(c.dom,t,e,c.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class NU{constructor(e,t,i,o,a){this.view=e,this.decorations=o,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new MU(e),this.text=new TU(e.state.doc),this.builder=new OU(this.cache,new pf(e,e.contentDOM),qe.iter(i)),this.cache.reused.set(t,2),this.old=new PU(t),this.reuseWalker={skip:(r,c,d)=>{if(this.cache.add(r),r.isComposite())return!1},enter:r=>this.cache.add(r),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let o=0,a=0,r=0;;){let c=r<e.length?e[r++]:null,d=c?c.fromA:this.old.root.length;if(d>o){let f=d-o;this.preserve(f,!r,!c),o=d,a+=f}if(!c)break;t&&c.fromA<=t.range.fromA&&c.toA>=t.range.toA?(this.forward(c.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(a,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,c.toA),this.emit(t.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(a,c.toB)),a=c.toB,o=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let o=EU(this.old),a=this.openMarks;this.old.advance(e,i?1:-1,{skip:(r,c,d)=>{if(r.isWidget())if(this.openWidget)this.builder.continueWidget(d-c);else{let f=d>0||c<r.length?ba.of(r.widget,this.view,d-c,r.flags&496,this.cache.maybeReuse(r)):this.cache.reuse(r);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,o,a),a=o.length)}else if(r.isText())this.builder.ensureLine(null),!c&&d==r.length&&!this.cache.reused.has(r)?this.builder.addText(r.text,o,a,this.cache.reuse(r)):(this.cache.add(r),this.builder.addText(r.text.slice(c,d),o,a)),a=o.length;else if(r.isLine())r.flags&=-2,this.cache.reused.set(r,1),this.builder.addLine(r);else if(r instanceof wh)this.cache.add(r);else if(r instanceof Rn)this.builder.ensureLine(null),this.builder.addMark(r,o,a),this.cache.reused.set(r,1),a=o.length;else return!1;this.openWidget=!1},enter:r=>{r.isLine()?this.builder.addLineStart(r.attrs,this.cache.maybeReuse(r)):(this.cache.add(r),r instanceof Rn&&o.unshift(r.mark)),this.openWidget=!1},leave:r=>{r.isLine()?o.length&&(o.length=a=0):r instanceof Rn&&(o.shift(),a=Math.min(a,o.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,o=this.builder,a=0,r=qe.spans(this.decorations,e,t,{point:(c,d,f,g,m,x)=>{if(f instanceof ma){if(this.disallowBlockEffectsFor[x]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(d>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=g.length,m>g.length)o.continueWidget(d-c);else{let v=f.widget||(f.block?Br.block:Br.inline),C=LU(f),k=this.cache.findWidget(v,d-c,C)||ba.of(v,this.view,d-c,C);f.block?(f.startSide>0&&o.addLineStartIfNotCovered(i),o.addBlockWidget(k)):(o.ensureLine(i),o.addInlineWidget(k,g,m))}i=null}else i=RU(i,f);d>c&&this.text.skip(d-c)},span:(c,d,f,g)=>{for(let m=c;m<d;){let x=this.text.next(Math.min(512,d-m));x==null?(o.addLineStartIfNotCovered(i),o.addBreak(),m++):(o.ensureLine(i),o.addText(x,f,m==c?g:f.length),m+=x.length),i=null}}});o.addLineStartIfNotCovered(i),this.openWidget=r>a,this.openMarks=r}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let o=e.parentNode;;o=o.parentNode){let a=Nt.get(o);if(o==this.view.contentDOM)break;a instanceof Rn?t.push(a):a?.isLine()?i=a:a instanceof Do||(o.nodeName=="DIV"&&!i&&o!=this.view.contentDOM?i=new jr(o,TO):i||t.push(Rn.of(new $c({tagName:o.nodeName.toLowerCase(),attributes:aU(o)}),o)))}return{line:i,marks:t}}}function Ow(n,e){let t=i=>{for(let o of i.children)if((e?o.isText():o.length)||t(o))return!0;return!1};return t(n)}function LU(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const TO={class:"cm-line"};function RU(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&lx(t,n),i&&(n.class+=" "+i)),n}function EU(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Rn&&e.push(i.mark)}return e}function Cm(n){let e=Nt.get(n);return e&&e.setDOM(n.cloneNode()),n}class Br extends Ji{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Br.inline=new Br("span");Br.block=new Br("div");const Sm=new class extends Ji{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Tw{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Pe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new pf(e,e.contentDOM),this.updateInner([new ri(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:g,toA:m})=>m<this.minWidthFrom||g>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?o=this.domChanged.newSel.head:!qU(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let a=o>-1?jU(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:m}=this.hasComposition;i=new ri(g,m,e.changes.mapPos(g,-1),e.changes.mapPos(m,1)).addToSet(i.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(ge.ie||ge.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let r=this.decorations,c=this.blockWrappers;this.updateDeco();let d=_U(r,this.decorations,e.changes);d.length&&(i=ri.extendWithRanges(i,d));let f=zU(c,this.blockWrappers,e.changes);return f.length&&(i=ri.extendWithRanges(i,f)),a&&!i.some(g=>g.fromA<=a.range.fromA&&g.toA>=a.range.toA)&&(i=a.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let r=this.tile,c=new NU(this.view,r,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Nt.get(t.text)&&c.cache.reused.set(Nt.get(t.text),2),this.tile=c.run(e,t),Uy(r,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=ge.chrome||ge.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||i.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof km&&o.push(a.dom);i.updateGaps(o)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(wO)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,o=this.view.root.activeElement,a=o==i,r=!a&&!(this.view.state.facet(ko)||i.tabIndex>-1)&&dc(i,this.view.observer.selectionRange)&&!(o&&i.contains(o));if(!(a||t||r))return;let c=this.forceSelection;this.forceSelection=!1;let d=this.view.state.selection.main,f,g;if(d.empty?g=f=this.inlineDOMNearPos(d.anchor,d.assoc||1):(g=this.inlineDOMNearPos(d.head,d.head==d.from?1:-1),f=this.inlineDOMNearPos(d.anchor,d.anchor==d.from?1:-1)),ge.gecko&&d.empty&&!this.hasComposition&&IU(f)){let x=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(x,f.node.childNodes[f.offset]||null)),f=g=new Ci(x,0),c=!0}let m=this.view.observer.selectionRange;(c||!m.focusNode||(!fc(f.node,f.offset,m.anchorNode,m.anchorOffset)||!fc(g.node,g.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,d))&&(this.view.observer.ignore(()=>{ge.android&&ge.chrome&&i.contains(m.focusNode)&&FU(m.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let x=Tc(this.view.root);if(x)if(d.empty){if(ge.gecko){let v=BU(f.node,f.offset);if(v&&v!=3){let C=(v==1?lO:cO)(f.node,f.offset);C&&(f=new Ci(C.node,C.offset))}}x.collapse(f.node,f.offset),d.bidiLevel!=null&&x.caretBidiLevel!==void 0&&(x.caretBidiLevel=d.bidiLevel)}else if(x.extend){x.collapse(f.node,f.offset);try{x.extend(g.node,g.offset)}catch{}}else{let v=document.createRange();d.anchor>d.head&&([f,g]=[g,f]),v.setEnd(g.node,g.offset),v.setStart(f.node,f.offset),x.removeAllRanges(),x.addRange(v)}r&&this.view.root.activeElement==i&&(i.blur(),o&&o.focus())}),this.view.observer.setSelectionRange(f,g)),this.impreciseAnchor=f.precise?null:new Ci(m.anchorNode,m.anchorOffset),this.impreciseHead=g.precise?null:new Ci(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Tc(e.root),{anchorNode:o,anchorOffset:a}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let r=this.lineAt(t.head,t.assoc);if(!r)return;let c=r.posAtStart;if(t.head==c||t.head==c+r.length)return;let d=this.coordsAt(t.head,-1),f=this.coordsAt(t.head,1);if(!d||!f||d.bottom>f.top)return;let g=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(g.node,g.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=t.from&&i.collapse(o,a)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let o=i.posAtStart;if(i.isComposite()){let a;if(e==i.dom)a=i.dom.childNodes[t];else{let r=Lo(e)==0?0:t==0?-1:1;for(;;){let c=e.parentNode;if(c==i.dom)break;r==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?r=-1:r=1),e=c}r<0?a=e:a=e.nextSibling}if(a==i.dom.firstChild)return o;for(;a&&!Nt.get(a);)a=a.nextSibling;if(!a)return o+i.length;for(let r=0,c=o;;r++){let d=i.children[r];if(d.dom==a)return c;c+=d.length+d.breakAfter}}else return i.isText()?e==i.dom?o+t:o+(t?i.length:0):o}domAtPos(e,t){let{tile:i,offset:o}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(o,t)}inlineDOMNearPos(e,t){let i,o=-1,a=!1,r,c=-1,d=!1;return this.tile.blockTiles((f,g)=>{if(f.isWidget()){if(f.flags&32&&g>=e)return!0;f.flags&16&&(a=!0)}else{let m=g+f.length;if(g<=e&&(i=f,o=e-g,a=m<e),m>=e&&!r&&(r=f,c=e-g,d=g>e),g>e&&r)return!0}}),!i&&!r?this.domAtPos(e,t):(a&&r?i=null:d&&i&&(r=null),i&&t<0||!r?i.domIn(o,t):r.domIn(c,t))}coordsAt(e,t){let{tile:i,offset:o}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof km?null:i.coordsInWidget(o,t,!0):i.coordsIn(o,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function o(a,r){if(a.isComposite())for(let c of a.children){if(c.length>=r){let d=o(c,r);if(d)return d}if(r-=c.length,r<0)break}else if(a.isText()&&r<a.length){let c=$t(a.text,r);if(c==r)return null;let d=Nc(a.dom,r,c).getClientRects();for(let f=0;f<d.length;f++){let g=d[f];if(f==d.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return o(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:o}=e,a=this.view.contentDOM.clientWidth,r=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,d=this.view.textDirection==yt.LTR,f=0,g=(m,x,v)=>{for(let C=0;C<m.children.length&&!(x>o);C++){let k=m.children[C],w=x+k.length,D=k.dom.getBoundingClientRect(),{height:O}=D;if(v&&!C&&(f+=D.top-v.top),k instanceof Do)w>i&&g(k,x,D);else if(x>=i&&(f>0&&t.push(-f),t.push(O+f),f=0,r)){let M=k.dom.lastChild,T=M?hc(M):[];if(T.length){let L=T[T.length-1],N=d?L.right-D.left:D.right-L.left;N>c&&(c=N,this.minWidth=a,this.minWidthFrom=x,this.minWidthTo=w)}}v&&C==m.children.length-1&&(f+=v.bottom-D.bottom),x=w+k.breakAfter}};return g(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?yt.RTL:yt.LTR}measureTextSize(){let e=this.tile.blockTiles(r=>{if(r.isLine()&&r.children.length&&r.length<=20){let c=0,d;for(let f of r.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let g=hc(f.dom);if(g.length!=1)return;c+=g[0].width,d=g[0].height}if(c)return{lineHeight:r.dom.getBoundingClientRect().height,charWidth:c/r.length,textHeight:d}}});if(e)return e;let t=document.createElement("div"),i,o,a;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let r=hc(t.firstChild)[0];i=t.getBoundingClientRect().height,o=r&&r.width?r.width/27:7,a=r&&r.height?r.height:i,t.remove()}),{lineHeight:i,charWidth:o,textHeight:a}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,o=0;;o++){let a=o==t.viewports.length?null:t.viewports[o],r=a?a.from-1:this.view.state.doc.length;if(r>i){let c=(t.lineBlockAt(r).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Pe.replace({widget:new km(c),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!a)break;i=a.to+1}return Pe.set(e)}updateDeco(){let e=1,t=this.view.state.facet(hf).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),i=!1,o=this.view.state.facet(px).map((a,r)=>{let c=typeof a=="function";return c&&(i=!0),c?a(this.view):a});for(o.length&&(this.dynamicDecorationMap[e++]=i,t.push(qe.join(o))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(PO).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){var t;if(e.isSnapshot){let g=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=g.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let g of this.view.state.facet(kO))try{if(g(this.view,e.range,e))return!0}catch(m){En(this.view.state,m,"scroll handler")}let{range:i}=e,o=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),a;if(!o)return;!i.empty&&(a=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(o={left:Math.min(o.left,a.left),top:Math.min(o.top,a.top),right:Math.max(o.right,a.right),bottom:Math.max(o.bottom,a.bottom)});let r=gx(this.view),c={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:d,offsetHeight:f}=this.view.scrollDOM;if(cU(this.view.scrollDOM,c,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,d),-d),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==yt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let g=this.view.docView.lineAt(i.head,1);g&&g.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Uy(this.tile)}}function Uy(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)Uy(i,e)}}function IU(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function MO(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=lO(t.focusNode,t.focusOffset),o=cO(t.focusNode,t.focusOffset),a=i||o;if(o&&i&&o.node!=i.node){let c=Nt.get(o.node);if(!c||c.isText()&&c.text!=o.node.nodeValue)a=o;else if(n.docView.lastCompositionAfterCursor){let d=Nt.get(i.node);!d||d.isText()&&d.text!=i.node.nodeValue||(a=o)}}if(n.docView.lastCompositionAfterCursor=a!=i,!a)return null;let r=e-a.offset;return{from:r,to:r+a.node.nodeValue.length,node:a.node}}function jU(n,e,t){let i=MO(n,t);if(!i)return null;let{node:o,from:a,to:r}=i,c=o.nodeValue;if(/[\n\r]/.test(c)||n.state.doc.sliceString(i.from,i.to)!=c)return null;let d=e.invertedDesc;return{range:new ri(d.mapPos(a),d.mapPos(r),a,r),text:o}}function BU(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let HU=class{constructor(){this.changes=[]}compareRange(e,t){Pr(e,t,this.changes)}comparePoint(e,t){Pr(e,t,this.changes)}boundChange(e){Pr(e,e,this.changes)}};function _U(n,e,t){let i=new HU;return qe.compare(n,e,t,i),i.changes}class UU{constructor(){this.changes=[]}compareRange(e,t){Pr(e,t,this.changes)}comparePoint(){}boundChange(e){Pr(e,e,this.changes)}}function zU(n,e,t){let i=new UU;return qe.compare(n,e,t,i),i.changes}function FU(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function qU(n,e){let t=!1;return e&&n.iterChangedRanges((i,o)=>{i<e.to&&o>e.from&&(t=!0)}),t}class km extends Ji{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function GU(n,e,t=1){let i=n.charCategorizer(e),o=n.doc.lineAt(e),a=e-o.from;if(o.length==0)return J.cursor(e);a==0?t=1:a==o.length&&(t=-1);let r=a,c=a;t<0?r=$t(o.text,a,!1):c=$t(o.text,a);let d=i(o.text.slice(r,c));for(;r>0;){let f=$t(o.text,r,!1);if(i(o.text.slice(f,r))!=d)break;r=f}for(;c<o.length;){let f=$t(o.text,c);if(i(o.text.slice(c,f))!=d)break;c=f}return J.range(r+o.from,c+o.from)}function KU(n,e,t,i,o){let a=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let c=n.viewState.heightOracle.textHeight,d=Math.floor((o-t.top-(n.defaultLineHeight-c)*.5)/c);a+=d*n.viewState.heightOracle.lineLength}let r=n.state.sliceDoc(t.from,t.to);return t.from+Oy(r,a,n.state.tabSize)}function zy(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let o;for(let a of i.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!o||a.type==rn.Text&&(o.type!=a.type||(t<0?a.from<e:a.to>e)))&&(o=a)}}return o||i}return i}function VU(n,e,t,i){let o=zy(n,e.head,e.assoc||-1),a=!i||o.type!=rn.Text||!(n.lineWrapping||o.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(a){let r=n.dom.getBoundingClientRect(),c=n.textDirectionAt(o.from),d=n.posAtCoords({x:t==(c==yt.LTR)?r.right-1:r.left+1,y:(a.top+a.bottom)/2});if(d!=null)return J.cursor(d,t?-1:1)}return J.cursor(t?o.to:o.from,t?-1:1)}function Mw(n,e,t,i){let o=n.state.doc.lineAt(e.head),a=n.bidiSpans(o),r=n.textDirectionAt(o.from);for(let c=e,d=null;;){let f=vU(o,a,r,c,t),g=pO;if(!f){if(o.number==(t?n.state.doc.lines:1))return c;g=`
24
+ `,o=n.state.doc.line(o.number+(t?1:-1)),a=n.bidiSpans(o),f=n.visualLineSide(o,!t)}if(d){if(!d(g))return c}else{if(!i)return f;d=i(g)}c=f}}function WU(n,e,t){let i=n.state.charCategorizer(e),o=i(t);return a=>{let r=i(a);return o==kt.Space&&(o=r),o==r}}function QU(n,e,t,i){let o=e.head,a=t?1:-1;if(o==(t?n.state.doc.length:0))return J.cursor(o,e.assoc);let r=e.goalColumn,c,d=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(o,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),g=n.documentTop;if(f)r==null&&(r=f.left-d.left),c=a<0?f.top:f.bottom;else{let C=n.viewState.lineBlockAt(o);r==null&&(r=Math.min(d.right-d.left,n.defaultCharacterWidth*(o-C.from))),c=(a<0?C.top:C.bottom)+g}let m=d.left+r,x=n.viewState.heightOracle.textHeight>>1,v=i??x;for(let C=0;;C+=x){let k=c+(v+C)*a,w=Fy(n,{x:m,y:k},!1,a);if(t?k>d.bottom:k<d.top)return J.cursor(w.pos,w.assoc);let D=n.coordsAtPos(w.pos,w.assoc),O=D?(D.top+D.bottom)/2:0;if(!D||(t?O>c:O<c))return J.cursor(w.pos,w.assoc,void 0,r)}}function pc(n,e,t){for(;;){let i=0;for(let o of n)o.between(e-1,e+1,(a,r,c)=>{if(e>a&&e<r){let d=i||t||(e-a<r-e?-1:1);e=d<0?a:r,i=d}});if(!i)return e}}function NO(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let o=e.ranges[i],a=null;if(o.empty){let r=pc(n,o.from,0);r!=o.from&&(a=J.cursor(r,-1))}else{let r=pc(n,o.from,-1),c=pc(n,o.to,1);(r!=o.from||c!=o.to)&&(a=J.range(o.from==o.anchor?r:c,o.from==o.head?r:c))}a&&(t||(t=e.ranges.slice()),t[i]=a)}return t?J.create(t,e.mainIndex):e}function wm(n,e,t){let i=pc(n.state.facet(Jc).map(o=>o(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:J.cursor(i,i<t.from?1:-1)}class Ui{constructor(e,t){this.pos=e,this.assoc=t}}function Fy(n,e,t,i){let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,{x:r,y:c}=e,d=c-a,f;for(;;){if(d<0)return new Ui(0,1);if(d>n.viewState.docHeight)return new Ui(n.state.doc.length,-1);if(f=n.elementAtHeight(d),i==null)break;if(f.type==rn.Text){if(i<0?f.to<n.viewport.from:f.from>n.viewport.to)break;let x=n.docView.coordsAt(i<0?f.from:f.to,i>0?-1:1);if(x&&(i<0?x.top<=d+a:x.bottom>=d+a))break}let m=n.viewState.heightOracle.textHeight/2;d=i>0?f.bottom+m:f.top-m}if(n.viewport.from>=f.to||n.viewport.to<=f.from){if(t)return null;if(f.type==rn.Text){let m=KU(n,o,f,r,c);return new Ui(m,m==f.from?1:-1)}}if(f.type!=rn.Text)return d<(f.top+f.bottom)/2?new Ui(f.from,1):new Ui(f.to,-1);let g=n.docView.lineAt(f.from,2);return(!g||g.length!=f.length)&&(g=n.docView.lineAt(f.from,-2)),new YU(n,r,c,n.textDirectionAt(f.from)).scanTile(g,f.from)}class YU{constructor(e,t,i,o){this.view=e,this.x=t,this.y=i,this.baseDir=o,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:o}=this.bidiSpansAt(e);return o[Fi.find(o,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:o}=this.bidiSpansAt(e);return o[Fi.find(o,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:o}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+o.from<t)}scan(e,t,i=!1){let o=0,a=e.length-1,r=new Set,c=this.bidiIn(e[0],e[a]),d,f,g=-1,m=1e9,x;e:for(;o<a;){let C=a-o,k=o+a>>1;t:if(r.has(k)){let D=o+Math.floor(Math.random()*C);for(let O=0;O<C;O++){if(!r.has(D)){k=D;break t}D++,D==a&&(D=o)}break e}r.add(k);let w=t(k);if(w)for(let D=0;D<w.length;D++){let O=w[D],M=0;if(!(O.width==0&&w.length>1)){if(O.bottom<this.y)(!d||d.bottom<O.bottom)&&(d=O),M=1;else if(O.top>this.y)(!f||f.top>O.top)&&(f=O),M=-1;else{let T=O.left>this.x?this.x-O.left:O.right<this.x?this.x-O.right:0,L=Math.abs(T);L<m&&(g=k,m=L,x=O),T&&(M=T<0==(this.baseDir==yt.LTR)?-1:1)}M==-1&&(!c||this.baseDirAt(e[k],1))?a=k:M==1&&(!c||this.baseDirAt(e[k+1],-1))&&(o=k+1)}}}if(!x){let C=d&&(!f||this.y-d.bottom<f.top-this.y)?d:f;return this.y=(C.top+C.bottom)/2,this.scan(e,t,!0)}if(m&&!i){let{top:C,bottom:k}=x;if(d&&d.bottom>(C+C+k)/3)return this.y=d.bottom-1,this.scan(e,t,!0);if(f&&f.top<(C+k+k)/3)return this.y=f.top+1,this.scan(e,t,!0)}let v=(c?this.dirAt(e[g],1):this.baseDir)==yt.LTR;return{i:g,after:this.x>(x.left+x.right)/2==v}}scanText(e,t){let i=[];for(let a=0;a<e.length;a=$t(e.text,a))i.push(t+a);i.push(t+e.length);let o=this.scan(i,a=>{let r=i[a]-t,c=i[a+1]-t;return Nc(e.dom,r,c).getClientRects()});return o.after?new Ui(i[o.i+1],-1):new Ui(i[o.i],1)}scanTile(e,t){if(!e.length)return new Ui(t,1);if(e.children.length==1){let c=e.children[0];if(c.isText())return this.scanText(c,t);if(c.isComposite())return this.scanTile(c,t)}let i=[t];for(let c=0,d=t;c<e.children.length;c++)i.push(d+=e.children[c].length);let o=this.scan(i,c=>{let d=e.children[c];return d.flags&48?null:(d.dom.nodeType==1?d.dom:Nc(d.dom,0,d.length)).getClientRects()}),a=e.children[o.i],r=i[o.i];return a.isText()?this.scanText(a,r):a.isComposite()?this.scanTile(a,r):o.after?new Ui(i[o.i+1],-1):new Ui(r,1)}}const hr="￿";class $U{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Qe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hr}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let o=e;;){this.findPointBefore(i,o);let a=this.text.length;this.readNode(o);let r=Nt.get(o),c=o.nextSibling;if(c==t){r?.breakAfter&&!c&&i!=this.view.contentDOM&&this.lineBreak();break}let d=Nt.get(c);(r&&d?r.breakAfter:(r?r.breakAfter:Sh(o))||Sh(c)&&(o.nodeName!="BR"||r?.isWidget())&&this.text.length>a)&&!JU(c,t)&&this.lineBreak(),o=c}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,r=1,c;if(this.lineSeparator?(a=t.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(c=o.exec(t))&&(a=c.index,r=c[0].length),this.append(t.slice(i,a<0?t.length:a)),a<0)break;if(this.lineBreak(),r>1)for(let d of this.points)d.node==e&&d.pos>this.text.length&&(d.pos-=r-1);i=a+r}}readNode(e){let t=Nt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let o=i.iter();!o.next().done;)o.lineBreak?this.lineBreak():this.append(o.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(XU(e,i.node,i.offset)?t:0))}}function XU(n,e,t){for(;;){if(!e||t<Lo(e))return!1;if(e==n)return!0;t=vs(e)+1,e=e.parentNode}}function JU(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=Nt.get(n);if(!i?.isWidget())return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let o=i.overrideDOMText;if(o?.length)return!1}return!0}class Nw{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class ZU{constructor(e,t,i,o){this.typeOver=o,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:a,impreciseAnchor:r}=e.docView,c=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=LO(e.docView.tile,t,i,0))){let d=a||r?[]:t4(e),f=new $U(d,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=n4(d,this.bounds.from)}else{let d=e.observer.selectionRange,f=a&&a.node==d.focusNode&&a.offset==d.focusOffset||!Iy(e.contentDOM,d.focusNode)?c.main.head:e.docView.posFromDOM(d.focusNode,d.focusOffset),g=r&&r.node==d.anchorNode&&r.offset==d.anchorOffset||!Iy(e.contentDOM,d.anchorNode)?c.main.anchor:e.docView.posFromDOM(d.anchorNode,d.anchorOffset),m=e.viewport;if((ge.ios||ge.chrome)&&c.main.empty&&f!=g&&(m.from>0||m.to<e.state.doc.length)){let x=Math.min(f,g),v=Math.max(f,g),C=m.from-x,k=m.to-v;(C==0||C==1||x==0)&&(k==0||k==-1||v==e.state.doc.length)&&(f=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&c.ranges.length>1)this.newSel=c.replaceRange(J.range(g,f));else if(e.lineWrapping&&g==f&&!(c.main.empty&&c.main.head==f)&&e.inputState.lastTouchTime>Date.now()-100){let x=e.coordsAtPos(f,-1),v=0;x&&(v=e.inputState.lastTouchY<=x.bottom?-1:1),this.newSel=J.create([J.cursor(f,v)])}else this.newSel=J.single(g,f)}}}function LO(n,e,t,i){if(n.isComposite()){let o=-1,a=-1,r=-1,c=-1;for(let d=0,f=i,g=i;d<n.children.length;d++){let m=n.children[d],x=f+m.length;if(f<e&&x>t)return LO(m,e,t,f);if(x>=e&&o==-1&&(o=d,a=f),f>t&&m.dom.parentNode==n.dom){r=d,c=g;break}g=x,f=x+m.breakAfter}return{from:a,to:c<0?i+n.length:c,startDOM:(o?n.children[o-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:r<n.children.length&&r>=0?n.children[r].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function RO(n,e){let t,{newSel:i}=e,{state:o}=n,a=o.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:c,to:d}=e.bounds,f=a.from,g=null;(r===8||ge.android&&e.text.length<d-c)&&(f=a.to,g="end");let m=o.doc.sliceString(c,d,hr),x,v;!a.empty&&a.from>=c&&a.to<=d&&(e.typeOver||m!=e.text)&&m.slice(0,a.from-c)==e.text.slice(0,a.from-c)&&m.slice(a.to-c)==e.text.slice(x=e.text.length-(m.length-(a.to-c)))?t={from:a.from,to:a.to,insert:Je.of(e.text.slice(a.from-c,x).split(hr))}:(v=EO(m,e.text,f-c,g))&&(ge.chrome&&r==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==hr+hr&&v.toB--,t={from:c+v.from,to:c+v.toA,insert:Je.of(e.text.slice(v.from,v.toB).split(hr))})}else i&&(!n.hasFocus&&o.facet(ko)||Ph(i,a))&&(i=null);if(!t&&!i)return!1;if((ge.mac||ge.android)&&t&&t.from==t.to&&t.from==a.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=J.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:Je.of([t.insert.toString().replace("."," ")])}):o.doc.lineAt(a.from).to<a.to&&n.docView.lineHasWidget(a.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:a.from,to:a.to,insert:o.toText(n.inputState.insertingText)}:ge.chrome&&t&&t.from==t.to&&t.from==a.head&&t.insert.toString()==`
25
+ `&&n.lineWrapping&&(i&&(i=J.single(i.main.anchor-1,i.main.head-1)),t={from:a.from,to:a.to,insert:Je.of([" "])}),t)return mx(n,t,i,r);if(i&&!Ph(i,a)){let c=!1,d="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(c=!0),d=n.inputState.lastSelectionOrigin,d=="select.pointer"&&(i=NO(o.facet(Jc).map(f=>f(n)),i))),n.dispatch({selection:i,scrollIntoView:c,userEvent:d}),!0}else return!1}function mx(n,e,t,i=-1){if(ge.ios&&n.inputState.flushIOSKey(e))return!0;let o=n.state.selection.main;if(ge.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&n.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Dr(n.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>o.head)&&Dr(n.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&Dr(n.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let r,c=()=>r||(r=e4(n,e,t));return n.state.facet(xO).some(d=>d(n,e.from,e.to,a,c))||n.dispatch(c()),!0}function e4(n,e,t){let i,o=n.state,a=o.selection.main,r=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let d=e.from<a.from?-1:1,f=d<0?a.from:a.to,g=pc(o.facet(Jc).map(m=>m(n)),f,d);e.from==g&&(r=g)}if(r>-1)i={changes:e,selection:J.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let d=a.from<e.from?o.sliceDoc(a.from,e.from):"",f=a.to>e.to?o.sliceDoc(e.to,a.to):"";i=o.replaceSelection(n.state.toText(d+e.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let d=o.changes(e),f=t&&t.main.to<=d.newLength?t.main:void 0;if(o.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let g=n.state.sliceDoc(e.from,e.to),m,x=t&&MO(n,t.main.head);if(x){let C=e.insert.length-(e.to-e.from);m={from:x.from,to:x.to-C}}else m=n.state.doc.lineAt(a.head);let v=a.to-e.to;i=o.changeByRange(C=>{if(C.from==a.from&&C.to==a.to)return{changes:d,range:f||C.map(d)};let k=C.to-v,w=k-g.length;if(n.state.sliceDoc(w,k)!=g||k>=m.from&&w<=m.to)return{range:C};let D=o.changes({from:w,to:k,insert:e.insert}),O=C.to-a.to;return{changes:D,range:f?J.range(Math.max(0,f.anchor+O),Math.max(0,f.head+O)):C.map(D)}})}else i={changes:d,selection:f&&o.selection.replaceRange(f)}}let c="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,c+=".compose",n.inputState.compositionFirstChange&&(c+=".start",n.inputState.compositionFirstChange=!1)),o.update(i,{userEvent:c,scrollIntoView:!0})}function EO(n,e,t,i){let o=Math.min(n.length,e.length),a=0;for(;a<o&&n.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==o&&n.length==e.length)return null;let r=n.length,c=e.length;for(;r>0&&c>0&&n.charCodeAt(r-1)==e.charCodeAt(c-1);)r--,c--;if(i=="end"){let d=Math.max(0,a-Math.min(r,c));t-=r+d-a}if(r<a&&n.length<e.length){let d=t<=a&&t>=r?a-t:0;a-=d,c=a+(c-r),r=a}else if(c<a){let d=t<=a&&t>=c?a-t:0;a-=d,r=a+(r-c),c=a}return{from:a,toA:r,toB:c}}function t4(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:o,focusOffset:a}=n.observer.selectionRange;return t&&(e.push(new Nw(t,i)),(o!=t||a!=i)&&e.push(new Nw(o,a))),e}function n4(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?J.single(t+e,i+e):null}function Ph(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class i4{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ge.safari&&e.contentDOM.addEventListener("input",()=>null),ge.gecko&&b4(e.contentDOM.ownerDocument)}handleEvent(e){!d4(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let o of i.observers)o(this.view,t);for(let o of i.handlers){if(t.defaultPrevented)break;if(o(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=o4(e),i=this.handlers,o=this.view.contentDOM;for(let a in t)if(a!="scroll"){let r=!t[a].handlers.length,c=i[a];c&&r!=!c.handlers.length&&(o.removeEventListener(a,this.handleEvent),c=null),c||o.addEventListener(a,this.handleEvent,{passive:r})}for(let a in i)a!="scroll"&&!t[a]&&o.removeEventListener(a,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&jO.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ge.android&&ge.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ge.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=IO.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||s4.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Dr(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:ge.safari&&!ge.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Lw(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(o){En(t.state,o)}}}function o4(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let o=i.spec,a=o&&o.plugin.domEventHandlers,r=o&&o.plugin.domEventObservers;if(a)for(let c in a){let d=a[c];d&&t(c).handlers.push(Lw(i.value,d))}if(r)for(let c in r){let d=r[c];d&&t(c).observers.push(Lw(i.value,d))}}for(let i in wi)t(i).handlers.push(wi[i]);for(let i in jn)t(i).observers.push(jn[i]);return e}const IO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],s4="dthko",jO=[16,17,18,20,91,92,224,225],Nd=6;function Ld(n){return Math.max(0,n)*.7+8}function a4(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class r4{constructor(e,t,i,o){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=sO(e.contentDOM),this.atoms=e.state.facet(Jc).map(r=>r(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Qe.allowMultipleSelections)&&l4(e,t),this.dragging=u4(e,t)&&_O(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&a4(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,o=0,a=0,r=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:r}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:c}=this.scrollParents.y.getBoundingClientRect());let d=gx(this.view);e.clientX-d.left<=o+Nd?t=-Ld(o-e.clientX):e.clientX+d.right>=r-Nd&&(t=Ld(e.clientX-r)),e.clientY-d.top<=a+Nd?i=-Ld(a-e.clientY):e.clientY+d.bottom>=c-Nd&&(i=Ld(e.clientY-c)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=NO(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function l4(n,e){let t=n.state.facet(gO);return t.length?t[0](e):ge.mac?e.metaKey:e.ctrlKey}function c4(n,e){let t=n.state.facet(mO);return t.length?t[0](e):ge.mac?!e.altKey:!e.ctrlKey}function u4(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Tc(n.root);if(!i||i.rangeCount==0)return!0;let o=i.getRangeAt(0).getClientRects();for(let a=0;a<o.length;a++){let r=o[a];if(r.left<=e.clientX&&r.right>=e.clientX&&r.top<=e.clientY&&r.bottom>=e.clientY)return!0}return!1}function d4(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Nt.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const wi=Object.create(null),jn=Object.create(null),BO=ge.ie&&ge.ie_version<15||ge.ios&&ge.webkit_version<604;function h4(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),HO(n,t.value)},50)}function gf(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function HO(n,e){e=gf(n.state,dx,e);let{state:t}=n,i,o=1,a=t.toText(e),r=a.lines==t.selection.ranges.length;if(qy!=null&&t.selection.ranges.every(d=>d.empty)&&qy==a.toString()){let d=-1;i=t.changeByRange(f=>{let g=t.doc.lineAt(f.from);if(g.from==d)return{range:f};d=g.from;let m=t.toText((r?a.line(o++).text:e)+t.lineBreak);return{changes:{from:g.from,insert:m},range:J.cursor(f.from+m.length)}})}else r?i=t.changeByRange(d=>{let f=a.line(o++);return{changes:{from:d.from,to:d.to,insert:f.text},range:J.cursor(d.from+f.length)}}):i=t.replaceSelection(a);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}jn.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};jn.wheel=jn.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};wi.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);jn.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};jn.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};wi.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(yO))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=p4(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new r4(n,e,t,i)),i&&n.observer.ignore(()=>{aO(n.contentDOM);let a=n.root.activeElement;a&&!a.contains(n.contentDOM)&&a.blur()});let o=n.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function Rw(n,e,t,i){if(i==1)return J.cursor(e,t);if(i==2)return GU(n.state,e,t);{let o=n.docView.lineAt(e,t),a=n.state.doc.lineAt(o?o.posAtEnd:e),r=o?o.posAtStart:a.from,c=o?o.posAtEnd:a.to;return c<n.state.doc.length&&c==a.to&&c++,J.range(r,c)}}const f4=ge.ie&&ge.ie_version<=11;let Ew=null,Iw=0,jw=0;function _O(n){if(!f4)return n.detail;let e=Ew,t=jw;return Ew=n,jw=Date.now(),Iw=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Iw+1)%3:1}function p4(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=_O(e),o=n.state.selection;return{update(a){a.docChanged&&(t.pos=a.changes.mapPos(t.pos),o=o.map(a.changes))},get(a,r,c){let d=n.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),f,g=Rw(n,d.pos,d.assoc,i);if(t.pos!=d.pos&&!r){let m=Rw(n,t.pos,t.assoc,i),x=Math.min(m.from,g.from),v=Math.max(m.to,g.to);g=x<g.from?J.range(x,v,g.assoc):J.range(v,x,g.assoc)}return r?o.replaceRange(o.main.extend(g.from,g.to,g.assoc)):c&&i==1&&o.ranges.length>1&&(f=g4(o,d.pos))?f:c?o.addRange(g):J.create([g])}}}function g4(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:o}=n.ranges[t];if(i<=e&&o>=e)return J.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}wi.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let o=n.docView.tile.nearest(e.target);if(o&&o.isWidget()){let a=o.posAtStart,r=a+o.length;(a>=t.to||r<=t.from)&&(t=J.range(a,r))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",gf(n.state,hx,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};wi.dragend=n=>(n.inputState.draggedContent=null,!1);function Bw(n,e,t,i){if(t=gf(n.state,dx,t),!t)return;let o=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=n.inputState,r=i&&a&&c4(n,e)?{from:a.from,to:a.to}:null,c={from:o,insert:t},d=n.state.changes(r?[r,c]:c);n.focus(),n.dispatch({changes:d,selection:{anchor:d.mapPos(o,-1),head:d.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"}),n.inputState.draggedContent=null}wi.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),o=0,a=()=>{++o==t.length&&Bw(n,e,i.filter(r=>r!=null).join(n.state.lineBreak),!1)};for(let r=0;r<t.length;r++){let c=new FileReader;c.onerror=a,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(i[r]=c.result),a()},c.readAsText(t[r])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Bw(n,e,i,!0),!0}return!1};wi.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=BO?null:e.clipboardData;return t?(HO(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(h4(n),!1)};function m4(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function y4(n){let e=[],t=[],i=!1;for(let o of n.selection.ranges)o.empty||(e.push(n.sliceDoc(o.from,o.to)),t.push(o));if(!e.length){let o=-1;for(let{from:a}of n.selection.ranges){let r=n.doc.lineAt(a);r.number>o&&(e.push(r.text),t.push({from:r.from,to:Math.min(n.doc.length,r.to+1)})),o=r.number}i=!0}return{text:gf(n,hx,e.join(n.lineBreak)),ranges:t,linewise:i}}let qy=null;wi.copy=wi.cut=(n,e)=>{if(!dc(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:o}=y4(n.state);if(!t&&!o)return!1;qy=o?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let a=BO?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",t),!0):(m4(n,t),!1)};const UO=$i.define();function zO(n,e){let t=[];for(let i of n.facet(vO)){let o=i(n,e);o&&t.push(o)}return t.length?n.update({effects:t,annotations:UO.of(!0)}):null}function FO(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=zO(n.state,e);t?n.dispatch(t):n.update([])}},10)}jn.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),FO(n)};jn.blur=n=>{n.observer.clearSelectionRange(),FO(n)};jn.compositionstart=jn.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};jn.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,ge.chrome&&ge.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};jn.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};wi.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let a=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),r=e.getTargetRanges();if(a&&r.length){let c=r[0],d=n.posAtDOM(c.startContainer,c.startOffset),f=n.posAtDOM(c.endContainer,c.endOffset);return mx(n,{from:d,to:f,insert:n.state.toText(a)},null),!0}}let o;if(ge.chrome&&ge.android&&(o=IO.find(a=>a.inputType==e.inputType))&&(n.observer.delayAndroidKey(o.key,o.keyCode),o.key=="Backspace"||o.key=="Delete")){let a=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>a+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return ge.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),ge.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>jn.compositionend(n,e),20),!1};const Hw=new Set;function b4(n){Hw.has(n)||(Hw.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const _w=["pre-wrap","normal","pre-line","break-spaces"];let Hr=!1;function Uw(){Hr=!1}class x4{constructor(e){this.lineWrapping=e,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _w.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let o=e[i];o<0?i++:this.heightSamples[Math.floor(o*10)]||(t=!0,this.heightSamples[Math.floor(o*10)]=!0)}return t}refresh(e,t,i,o,a,r){let c=_w.indexOf(e)>-1,d=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=c;if(this.lineWrapping=c,this.lineHeight=t,this.charWidth=i,this.textHeight=o,this.lineLength=a,d){this.heightSamples={};for(let f=0;f<r.length;f++){let g=r[f];g<0?f++:this.heightSamples[Math.floor(g*10)]=!0}}return d}}class v4{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class vi{constructor(e,t,i,o,a){this.from=e,this.length=t,this.top=i,this.height=o,this._content=a}get type(){return typeof this._content=="number"?rn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ma?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new vi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var xt=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(xt||(xt={}));const ih=.001;class vn{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ih&&(Hr=!0),this.height=e)}replace(e,t,i){return vn.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,o){let a=this,r=i.doc;for(let c=o.length-1;c>=0;c--){let{fromA:d,toA:f,fromB:g,toB:m}=o[c],x=a.lineAt(d,xt.ByPosNoHeight,i.setDoc(t),0,0),v=x.to>=f?x:a.lineAt(f,xt.ByPosNoHeight,i,0,0);for(m+=v.to-f,f=v.to;c>0&&x.from<=o[c-1].toA;)d=o[c-1].fromA,g=o[c-1].fromB,c--,d<x.from&&(x=a.lineAt(d,xt.ByPosNoHeight,i,0,0));g+=x.from-d,d=x.from;let C=yx.build(i.setDoc(r),e,g,m);a=Dh(a,a.replace(d,f,C))}return a.updateHeight(i,0)}static empty(){return new Wn(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,o=0,a=0;for(;;)if(t==i)if(o>a*2){let c=e[t-1];c.break?e.splice(--t,1,c.left,null,c.right):e.splice(--t,1,c.left,c.right),i+=1+c.break,o-=c.size}else if(a>o*2){let c=e[i];c.break?e.splice(i,1,c.left,null,c.right):e.splice(i,1,c.left,c.right),i+=2+c.break,a-=c.size}else break;else if(o<a){let c=e[t++];c&&(o+=c.size)}else{let c=e[--i];c&&(a+=c.size)}let r=0;return e[t-1]==null?(r=1,t--):e[t]==null&&(r=1,i++),new S4(vn.of(e.slice(0,t)),r,vn.of(e.slice(i)))}}function Dh(n,e){return n==e?n:(n.constructor!=e.constructor&&(Hr=!0),e)}vn.prototype.size=1;const C4=Pe.replace({});class qO extends vn{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,o){return this.spaceAbove&&e<i+this.spaceAbove?new vi(o,0,i,this.spaceAbove,C4):this.mainBlock(i,o)}lineAt(e,t,i,o,a){let r=this.mainBlock(o,a);return this.spaceAbove?this.blockAt(0,i,o,a).join(r):r}forEachLine(e,t,i,o,a,r){e<=a+this.length&&t>=a&&r(this.lineAt(0,xt.ByPos,i,o,a))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,o){return o&&o.from<=t&&o.more&&this.setMeasuredHeight(o),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Wn extends qO{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new vi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let o=i[0];return i.length==1&&(o instanceof Wn||o instanceof on&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof on?o=new Wn(o.length,this.height,this.spaceAbove):o.height=this.height,this.outdated||(o.outdated=!1),o):vn.of(i)}updateHeight(e,t=0,i=!1,o){return o&&o.from<=t&&o.more?this.setMeasuredHeight(o):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class on extends vn{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,a=o-i+1,r,c=0;if(e.lineWrapping){let d=Math.min(this.height,e.lineHeight*a);r=d/a,this.length>a+1&&(c=(this.height-d)/(this.length-a-1))}else r=this.height/a;return{firstLine:i,lastLine:o,perLine:r,perChar:c}}blockAt(e,t,i,o){let{firstLine:a,lastLine:r,perLine:c,perChar:d}=this.heightMetrics(t,o);if(t.lineWrapping){let f=o+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),g=t.doc.lineAt(f),m=c+g.length*d,x=Math.max(i,e-m/2);return new vi(g.from,g.length,x,m,0)}else{let f=Math.max(0,Math.min(r-a,Math.floor((e-i)/c))),{from:g,length:m}=t.doc.line(a+f);return new vi(g,m,i+c*f,c,0)}}lineAt(e,t,i,o,a){if(t==xt.ByHeight)return this.blockAt(e,i,o,a);if(t==xt.ByPosNoHeight){let{from:v,to:C}=i.doc.lineAt(e);return new vi(v,C-v,0,0,0)}let{firstLine:r,perLine:c,perChar:d}=this.heightMetrics(i,a),f=i.doc.lineAt(e),g=c+f.length*d,m=f.number-r,x=o+c*m+d*(f.from-a-m);return new vi(f.from,f.length,Math.max(o,Math.min(x,o+this.height-g)),g,0)}forEachLine(e,t,i,o,a,r){e=Math.max(e,a),t=Math.min(t,a+this.length);let{firstLine:c,perLine:d,perChar:f}=this.heightMetrics(i,a);for(let g=e,m=o;g<=t;){let x=i.doc.lineAt(g);if(g==e){let C=x.number-c;m+=d*C+f*(e-a-C)}let v=d+f*x.length;r(new vi(x.from,x.length,m,v,0)),m+=v,g=x.to+1}}replace(e,t,i){let o=this.length-t;if(o>0){let a=i[i.length-1];a instanceof on?i[i.length-1]=new on(a.length+o):i.push(null,new on(o-1))}if(e>0){let a=i[0];a instanceof on?i[0]=new on(e+a.length):i.unshift(new on(e-1),null)}return vn.of(i)}decomposeLeft(e,t){t.push(new on(e-1),null)}decomposeRight(e,t){t.push(null,new on(this.length-e-1))}updateHeight(e,t=0,i=!1,o){let a=t+this.length;if(o&&o.from<=t+this.length&&o.more){let r=[],c=Math.max(t,o.from),d=-1;for(o.from>t&&r.push(new on(o.from-t-1).updateHeight(e,t));c<=a&&o.more;){let g=e.doc.lineAt(c).length;r.length&&r.push(null);let m=o.heights[o.index++],x=0;m<0&&(x=-m,m=o.heights[o.index++]),d==-1?d=m:Math.abs(m-d)>=ih&&(d=-2);let v=new Wn(g,m,x);v.outdated=!1,r.push(v),c+=g+1}c<=a&&r.push(null,new on(a-c).updateHeight(e,c));let f=vn.of(r);return(d<0||Math.abs(f.height-this.height)>=ih||Math.abs(d-this.heightMetrics(e,t).perLine)>=ih)&&(Hr=!0),Dh(this,f)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class S4 extends vn{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,o){let a=i+this.left.height;return e<a?this.left.blockAt(e,t,i,o):this.right.blockAt(e,t,a,o+this.left.length+this.break)}lineAt(e,t,i,o,a){let r=o+this.left.height,c=a+this.left.length+this.break,d=t==xt.ByHeight?e<r:e<c,f=d?this.left.lineAt(e,t,i,o,a):this.right.lineAt(e,t,i,r,c);if(this.break||(d?f.to<c:f.from>c))return f;let g=t==xt.ByPosNoHeight?xt.ByPosNoHeight:xt.ByPos;return d?f.join(this.right.lineAt(c,g,i,r,c)):this.left.lineAt(c,g,i,o,a).join(f)}forEachLine(e,t,i,o,a,r){let c=o+this.left.height,d=a+this.left.length+this.break;if(this.break)e<d&&this.left.forEachLine(e,t,i,o,a,r),t>=d&&this.right.forEachLine(e,t,i,c,d,r);else{let f=this.lineAt(d,xt.ByPos,i,o,a);e<f.from&&this.left.forEachLine(e,f.from-1,i,o,a,r),f.to>=e&&f.from<=t&&r(f),t>f.to&&this.right.forEachLine(f.to+1,t,i,c,d,r)}}replace(e,t,i){let o=this.left.length+this.break;if(t<o)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,i));let a=[];e>0&&this.decomposeLeft(e,a);let r=a.length;for(let c of i)a.push(c);if(e>0&&zw(a,r-1),t<this.length){let c=a.length;this.decomposeRight(t,a),zw(a,c)}return vn.of(a)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,o=i+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<o&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?vn.of(this.break?[e,null,t]:[e,t]):(this.left=Dh(this.left,e),this.right=Dh(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,o){let{left:a,right:r}=this,c=t+a.length+this.break,d=null;return o&&o.from<=t+a.length&&o.more?d=a=a.updateHeight(e,t,i,o):a.updateHeight(e,t,i),o&&o.from<=c+r.length&&o.more?d=r=r.updateHeight(e,c,i,o):r.updateHeight(e,c,i),d?this.balanced(a,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function zw(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof on&&(i=n[e+1])instanceof on&&n.splice(e-1,3,new on(t.length+1+i.length))}const k4=5;class yx{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof Wn?o.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Wn(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let o=i.widget?i.widget.estimatedHeight:0,a=i.widget?i.widget.lineBreaks:0;o<0&&(o=this.oracle.lineHeight);let r=t-e;i.block?this.addBlock(new qO(r,o,i)):(r||a||o>=k4)&&this.addLineDeco(o,a,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Wn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new on(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Wn)return e;let t=new Wn(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let o=this.ensureLine();o.length+=i,o.collapsed+=i,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Wn)&&!this.isCovered?this.nodes.push(new Wn(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let o of this.nodes)o instanceof Wn&&o.updateHeight(this.oracle,i),i+=o?o.length:1;return this.nodes}static build(e,t,i,o){let a=new yx(i,e);return qe.spans(t,i,o,a,0),a.finish(i)}}function w4(n,e,t){let i=new A4;return qe.compare(n,e,t,i,0),i.changes}class A4{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,o){(e<t||i&&i.heightRelevant||o&&o.heightRelevant)&&Pr(e,t,this.changes,5)}}function P4(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,o=i.defaultView||window,a=Math.max(0,t.left),r=Math.min(o.innerWidth,t.right),c=Math.max(0,t.top),d=Math.min(o.innerHeight,t.bottom);for(let f=n.parentNode;f&&f!=i.body;)if(f.nodeType==1){let g=f,m=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&m.overflow!="visible"){let x=g.getBoundingClientRect();a=Math.max(a,x.left),r=Math.min(r,x.right),c=Math.max(c,x.top),d=Math.min(f==n.parentNode?o.innerHeight:d,x.bottom)}f=m.position=="absolute"||m.position=="fixed"?g.offsetParent:g.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:a-t.left,right:Math.max(a,r)-t.left,top:c-(t.top+e),bottom:Math.max(c,d)-(t.top+e)}}function D4(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function O4(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Am{constructor(e,t,i,o){this.from=e,this.to=t,this.size=i,this.displaySize=o}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let o=e[i],a=t[i];if(o.from!=a.from||o.to!=a.to||o.size!=a.size)return!1}return!0}draw(e,t){return Pe.replace({widget:new T4(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class T4 extends Ji{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Fw{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=qw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=yt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(fx).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new x4(i),this.stateDeco=Gw(t),this.heightMap=vn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(t.doc),[new ri(0,0,0,t.doc.length)]);for(let o=0;o<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());o++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Pe.set(this.lineGaps.map(o=>o.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let o=i?t.head:t.anchor;if(!e.some(({from:a,to:r})=>o>=a&&o<=r)){let{from:a,to:r}=this.lineBlockAt(o);e.push(new Rd(a,r))}}return this.viewports=e.sort((i,o)=>i.from-o.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?qw:new bx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(tc(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Gw(this.state);let o=e.changedRanges,a=ri.extendWithRanges(o,w4(i,this.stateDeco,e?e.changes:qt.empty(this.state.doc.length))),r=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Uw(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=r||Hr)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=r);let d=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<d.from||t.range.head>d.to)||!this.viewportIsAppropriate(d))&&(d=this.getViewport(0,t));let f=d.from!=this.viewport.from||d.to!=this.viewport.to;this.viewport=d,e.flags|=this.updateForViewport(),(f||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(SO)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),o=this.heightOracle,a=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?yt.RTL:yt.LTR;let r=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",c=t.getBoundingClientRect(),d=r||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let f=0,g=0;if(c.width&&c.height){let{scaleX:L,scaleY:N}=oO(t,c);(L>.005&&Math.abs(this.scaleX-L)>.005||N>.005&&Math.abs(this.scaleY-N)>.005)&&(this.scaleX=L,this.scaleY=N,f|=16,r=d=!0)}let m=(parseInt(i.paddingTop)||0)*this.scaleY,x=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=x)&&(this.paddingTop=m,this.paddingBottom=x,f|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(d=!0),this.editorWidth=e.scrollDOM.clientWidth,f|=16);let v=sO(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let C=this.getScrollOffset();this.scrollOffset!=C&&(this.scrollAnchorHeight=-1,this.scrollOffset=C),this.scrolledToBottom=rO(this.scrollParent||e.win);let k=(this.printing?O4:P4)(t,this.paddingTop),w=k.top-this.pixelViewport.top,D=k.bottom-this.pixelViewport.bottom;this.pixelViewport=k;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(d=!0)),!this.inView&&!this.scrollTarget&&!D4(e.dom))return 0;let M=c.width;if((this.contentDOMWidth!=M||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,f|=16),d){let L=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(L)&&(r=!0),r||o.lineWrapping&&Math.abs(M-this.contentDOMWidth)>o.charWidth){let{lineHeight:N,charWidth:I,textHeight:K}=e.docView.measureTextSize();r=N>0&&o.refresh(a,N,I,K,Math.max(5,M/I),L),r&&(e.docView.minWidth=0,f|=16)}w>0&&D>0?g=Math.max(w,D):w<0&&D<0&&(g=Math.min(w,D)),Uw();for(let N of this.viewports){let I=N.from==this.viewport.from?L:e.docView.measureVisibleLineHeights(N);this.heightMap=(r?vn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new ri(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,r,new v4(N.from,I))}Hr&&(f|=2)}let T=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),f|=this.updateForViewport()),(f&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,e)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,a=this.heightOracle,{visibleTop:r,visibleBottom:c}=this,d=new Rd(o.lineAt(r-i*1e3,xt.ByHeight,a,0,0).from,o.lineAt(c+(1-i)*1e3,xt.ByHeight,a,0,0).to);if(t){let{head:f}=t.range;if(f<d.from||f>d.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=o.lineAt(f,xt.ByPos,a,0,0),x;t.y=="center"?x=(m.top+m.bottom)/2-g/2:t.y=="start"||t.y=="nearest"&&f<d.from?x=m.top:x=m.bottom-g,d=new Rd(o.lineAt(x-1e3/2,xt.ByHeight,a,0,0).from,o.lineAt(x+g+1e3/2,xt.ByHeight,a,0,0).to)}}return d}mapViewport(e,t){let i=t.mapPos(e.from,-1),o=t.mapPos(e.to,1);return new Rd(this.heightMap.lineAt(i,xt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(o,xt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:o}=this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(t,xt.ByPos,this.heightOracle,0,0),{visibleTop:r,visibleBottom:c}=this;return(e==0||o<=r-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||a>=c+Math.max(10,Math.min(i,250)))&&o>r-2*1e3&&a<c+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let o of e)t.touchesRange(o.from,o.to)||i.push(new Am(t.mapPos(o.from),t.mapPos(o.to),o.size,o.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,o=i?1e4:2e3,a=o>>1,r=o<<1;if(this.defaultTextDirection!=yt.LTR&&!i)return[];let c=[],d=(g,m,x,v)=>{if(m-g<a)return;let C=this.state.selection.main,k=[C.from];C.empty||k.push(C.to);for(let D of k)if(D>g&&D<m){d(g,D-10,x,v),d(D+10,m,x,v);return}let w=N4(e,D=>D.from>=x.from&&D.to<=x.to&&Math.abs(D.from-g)<a&&Math.abs(D.to-m)<a&&!k.some(O=>D.from<O&&D.to>O));if(!w){if(m<x.to&&t&&i&&t.visibleRanges.some(M=>M.from<=m&&M.to>=m)){let M=t.moveToLineBoundary(J.cursor(m),!1,!0).head;M>g&&(m=M)}let D=this.gapSize(x,g,m,v),O=i||D<2e6?D:2e6;w=new Am(g,m,D,O)}c.push(w)},f=g=>{if(g.length<r||g.type!=rn.Text)return;let m=M4(g.from,g.to,this.stateDeco);if(m.total<r)return;let x=this.scrollTarget?this.scrollTarget.range.head:null,v,C;if(i){let k=o/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,D;if(x!=null){let O=Id(m,x),M=((this.visibleBottom-this.visibleTop)/2+k)/g.height;w=O-M,D=O+M}else w=(this.visibleTop-g.top-k)/g.height,D=(this.visibleBottom-g.top+k)/g.height;v=Ed(m,w),C=Ed(m,D)}else{let k=m.total*this.heightOracle.charWidth,w=o*this.heightOracle.charWidth,D=0;if(k>2e6)for(let N of e)N.from>=g.from&&N.from<g.to&&N.size!=N.displaySize&&N.from*this.heightOracle.charWidth+D<this.pixelViewport.left&&(D=N.size-N.displaySize);let O=this.pixelViewport.left+D,M=this.pixelViewport.right+D,T,L;if(x!=null){let N=Id(m,x),I=((M-O)/2+w)/k;T=N-I,L=N+I}else T=(O-w)/k,L=(M+w)/k;v=Ed(m,T),C=Ed(m,L)}v>g.from&&d(g.from,v,g,m),C<g.to&&d(C,g.to,g,m)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(f):f(g);return c}gapSize(e,t,i,o){let a=Id(o,i)-Id(o,t);return this.heightOracle.lineWrapping?e.height*a:o.total*this.heightOracle.charWidth*a}updateLineGaps(e){Am.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Pe.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];qe.spans(t,this.viewport.from,this.viewport.to,{span(a,r){i.push({from:a,to:r})},point(){}},20);let o=0;if(i.length!=this.visibleRanges.length)o=12;else for(let a=0;a<i.length&&!(o&8);a++){let r=this.visibleRanges[a],c=i[a];(r.from!=c.from||r.to!=c.to)&&(o|=4,e&&e.mapPos(r.from,-1)==c.from&&e.mapPos(r.to,1)==c.to||(o|=8))}return this.visibleRanges=i,o}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||tc(this.heightMap.lineAt(e,xt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||tc(this.heightMap.lineAt(this.scaler.fromDOM(e),xt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return tc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Rd{constructor(e,t){this.from=e,this.to=t}}function M4(n,e,t){let i=[],o=n,a=0;return qe.spans(t,n,e,{span(){},point(r,c){r>o&&(i.push({from:o,to:r}),a+=r-o),o=c}},20),o<e&&(i.push({from:o,to:e}),a+=e-o),{total:a,ranges:i}}function Ed({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let o=0;;o++){let{from:a,to:r}=e[o],c=r-a;if(i<=c)return a+i;i-=c}}function Id(n,e){let t=0;for(let{from:i,to:o}of n.ranges){if(e<=o){t+=e-i;break}t+=o-i}return t/n.total}function N4(n,e){for(let t of n)if(e(t))return t}const qw={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Gw(n){let e=n.facet(hf).filter(i=>typeof i!="function"),t=n.facet(px).filter(i=>typeof i!="function");return t.length&&e.push(qe.join(t)),e}class bx{constructor(e,t,i){let o=0,a=0,r=0;this.viewports=i.map(({from:c,to:d})=>{let f=t.lineAt(c,xt.ByPos,e,0,0).top,g=t.lineAt(d,xt.ByPos,e,0,0).bottom;return o+=g-f,{from:c,to:d,top:f,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(t.height-o);for(let c of this.viewports)c.domTop=r+(c.top-a)*this.scale,r=c.domBottom=c.domTop+(c.bottom-c.top),a=c.bottom}toDOM(e){for(let t=0,i=0,o=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.top)return o+(e-i)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);i=a.bottom,o=a.domBottom}}fromDOM(e){for(let t=0,i=0,o=0;;t++){let a=t<this.viewports.length?this.viewports[t]:null;if(!a||e<a.domTop)return i+(e-o)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);i=a.bottom,o=a.domBottom}}eq(e){return e instanceof bx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function tc(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new vi(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(o=>tc(o,e)):n._content)}const jd=pe.define({combine:n=>n.join(" ")}),Gy=pe.define({combine:n=>n.indexOf(!0)>-1}),Ky=bs.newName(),GO=bs.newName(),KO=bs.newName(),VO={"&light":"."+GO,"&dark":"."+KO};function Vy(n,e,t){return new bs(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,o=>{if(o=="&")return n;if(!t||!t[o])throw new RangeError(`Unsupported selector: ${o}`);return t[o]}):n+" "+i}})}const L4=Vy("."+Ky,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},VO),R4={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Pm=ge.ie&&ge.ie_version<=11;class E4{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uU,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(ge.ie&&ge.ie_version<=11||ge.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ge.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ge.chrome&&ge.chrome_version<126)&&(this.editContext=new j4(e),e.state.facet(ko)&&(e.contentDOM.editContext=this.editContext.editContext)),Pm&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,o=this.selectionRange;if(i.state.facet(ko)?i.root.activeElement!=this.dom:!dc(this.dom,o))return;let a=o.anchorNode&&i.docView.tile.nearest(o.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ge.ie&&ge.ie_version<=11||ge.android&&ge.chrome)&&!i.state.selection.main.empty&&o.focusNode&&fc(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Tc(e.root);if(!t)return!1;let i=ge.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&I4(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let o=dc(this.dom,i);return o&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&hU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),o&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,R4),Pm&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Pm&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let o=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&Dr(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(o)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,o=!1;for(let a of e){let r=this.readMutation(a);r&&(r.typeOver&&(o=!0),t==-1?{from:t,to:i}=r:(t=Math.min(r.from,t),i=Math.max(r.to,i)))}return{from:t,to:i,typeOver:o}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),o=this.selectionChanged&&dc(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new ZU(this.view,e,t,i);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,o=RO(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Ph(this.view.state.selection,t.newSel.main))&&this.view.update([]),o}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=Kw(t,e.previousSibling||e.target.previousSibling,-1),o=Kw(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ko)!=e.state.facet(ko)&&(e.view.contentDOM.editContext=e.state.facet(ko)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Kw(n,e,t){for(;e;){let i=Nt.get(e);if(i&&i.parent==n)return i;let o=e.parentNode;e=o!=n.dom?o:t>0?e.nextSibling:e.previousSibling}return null}function Vw(n,e){let t=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,r=n.docView.domAtPos(n.state.selection.main.anchor,1);return fc(r.node,r.offset,o,a)&&([t,i,o,a]=[o,a,t,i]),{anchorNode:t,anchorOffset:i,focusNode:o,focusOffset:a}}function I4(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return Vw(n,o)}let t=null;function i(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Vw(n,t):null}class j4{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let o=e.state.selection.main,{anchor:a,head:r}=o,c=this.toEditorPos(i.updateRangeStart),d=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:c,drifted:!1});let f=d-c>i.text.length;c==this.from&&a<this.from?c=a:d==this.to&&a>this.to&&(d=a);let g=EO(e.state.sliceDoc(c,d),i.text,(f?o.from:o.to)-c,f?"end":null);if(!g){let x=J.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Ph(x,o)||e.dispatch({selection:x,userEvent:"select"});return}let m={from:g.from+c,to:g.toA+c,insert:Je.of(i.text.slice(g.from,g.toB).split(`
26
+ `))};if((ge.mac||ge.android)&&m.from==r-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:c,to:d,insert:Je.of([i.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let x=this.to-this.from+(m.to-m.from+m.insert.length);mx(e,m,J.single(this.toEditorPos(i.selectionStart,x),this.toEditorPos(i.selectionEnd,x)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let o=[],a=null;for(let r=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);r<c;r++){let d=e.coordsForChar(r);a=d&&new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top)||a||new DOMRect,o.push(a)}t.updateCharacterBounds(i.rangeStart,o)},this.handlers.textformatupdate=i=>{let o=[];for(let a of i.getTextFormats()){let r=a.underlineStyle,c=a.underlineThickness;if(!/none/i.test(r)&&!/none/i.test(c)){let d=this.toEditorPos(a.rangeStart),f=this.toEditorPos(a.rangeEnd);if(d<f){let g=`text-decoration: underline ${/^[a-z]/.test(r)?r+" ":r=="Dashed"?"dashed ":r=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;o.push(Pe.mark({attributes:{style:g}}).range(d,f))}}}e.dispatch({effects:wO.of(Pe.set(o))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let o=Tc(i.root);o&&o.rangeCount&&this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,o=this.pendingContextChange;return e.changes.iterChanges((a,r,c,d,f)=>{if(i)return;let g=f.length-(r-a);if(o&&r>=o.to)if(o.from==a&&o.to==r&&o.insert.eq(f)){o=this.pendingContextChange=null,t+=g,this.to+=g;return}else o=null,this.revertPending(e.state);if(a+=t,r+=t,r<=this.from)this.from+=g,this.to+=g;else if(a<this.to){if(a<this.from||r>this.to||this.to-this.from+f.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(r),f.toString()),this.to+=g}t+=g}),o&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(o=>!o.isUserEvent("input.type")&&o.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),o=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=o)&&this.editContext.updateSelection(i,o)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ue{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(o=>o.forEach(a=>i(a,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=e.root||dU(e.parent)||document,this.viewState=new Fw(this,e.state||Qe.create(e)),e.scrollTo&&e.scrollTo.is(Md)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(br).map(o=>new vm(o));for(let o of this.plugins)o.update(this);this.observer=new E4(this),this.inputState=new i4(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Tw(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Gt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,o,a=this.state;for(let x of e){if(x.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=x.state}if(this.destroyed){this.viewState.state=a;return}let r=this.hasFocus,c=0,d=null;e.some(x=>x.annotation(UO))?(this.inputState.notifiedFocused=r,c=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,d=zO(a,r),d||(c=1));let f=this.observer.delayedAndroidKey,g=null;if(f?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(g=null)):this.observer.clear(),a.facet(Qe.phrases)!=this.state.facet(Qe.phrases))return this.setState(a);o=kh.create(this,a,e),o.flags|=c;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let x of e){if(m&&(m=m.map(x.changes)),x.scrollIntoView){let{main:v}=x.state.selection,{x:C,y:k}=this.state.facet(ue.cursorScrollMargin);m=new Or(v.empty?v:J.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",k,C)}for(let v of x.effects)v.is(Md)&&(m=v.value.clip(this.state))}this.viewState.update(o,m),this.bidiCache=Oh.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),t=this.docView.update(o),this.state.facet(ec)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(x=>x.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(jd)!=o.state.facet(jd)&&(this.viewState.mustMeasureContent=!0),(t||i||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!o.empty)for(let x of this.state.facet(_y))try{x(o)}catch(v){En(this.state,v,"update listener")}(d||g)&&Promise.resolve().then(()=>{d&&this.state==d.startState&&this.dispatch(d),g&&!RO(this,g)&&f.force&&Dr(this.contentDOM,f.key,f.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Fw(this,e),this.plugins=e.facet(br).map(i=>new vm(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Tw(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(br),i=e.state.facet(br);if(t!=i){let o=[];for(let a of i){let r=t.indexOf(a);if(r<0)o.push(new vm(a));else{let c=this.plugins[r];c.mustUpdate=e,o.push(c)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){En(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,o=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:r}=this.viewState;Math.abs(o-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(r<0)if(rO(i||this.win))a=-1,r=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(o);a=v.from,r=v.top}this.updateState=1;let d=this.viewState.measure();if(!d&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];d&4||([this.measureRequests,f]=[f,this.measureRequests]);let g=f.map(v=>{try{return v.read(this)}catch(C){return En(this.state,C),Ww}}),m=kh.create(this,this.state,[]),x=!1;m.flags|=d,t?t.flags|=d:t=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),x=this.docView.update(m),x&&this.docViewUpdate());for(let v=0;v<f.length;v++)if(g[v]!=Ww)try{let C=f[v];C.write&&C.write(g[v],this)}catch(C){En(this.state,C)}if(x&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,r=-1;continue}else{let C=((a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-r)/this.scaleY;if((C>1||C<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){o=o+C,i?i.scrollTop+=C:this.win.scrollBy(0,C),r=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let c of this.state.facet(_y))c(t)}get themeClasses(){return Ky+" "+(this.state.facet(Gy)?KO:GO)+" "+this.state.facet(jd)}updateAttrs(){let e=Qw(this,AO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ko)?"true":"false",class:"cm-content",style:`${ge.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Qw(this,fx,t);let i=this.observer.ignore(()=>{let o=kw(this.contentDOM,this.contentAttrs,t),a=kw(this.dom,this.editorAttrs,e);return o||a});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let o of i.effects)if(o.is(ue.announce)){t&&(this.announceDOM.textContent=""),t=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet(ec);let e=this.state.facet(ue.cspNonce);bs.mount(this.root,this.styleModules.concat(L4).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return wm(this,e,Mw(this,e,t,i))}moveByGroup(e,t){return wm(this,e,Mw(this,e,t,i=>WU(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),o=this.textDirectionAt(e.from),a=i[t?i.length-1:0];return J.cursor(a.side(t,o)+e.from,a.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,i=!0){return VU(this,e,t,i)}moveVertically(e,t,i){return wm(this,e,QU(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=Fy(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Fy(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let o=this.state.doc.lineAt(e),a=this.bidiSpans(o),r=a[Fi.find(a,e-o.from,-1,t)];return Mc(i,r.dir==yt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(CO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>B4)return fO(e.length);let t=this.textDirectionAt(e.from),i;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==t&&(a.fresh||hO(a.isolates,i=Pw(this,e))))return a.order;i||(i=Pw(this,e));let o=xU(e.text,t,i);return this.bidiCache.push(new Oh(e.from,e.to,t,i,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ge.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{aO(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,o,a,r;return Md.of(new Or(typeof e=="number"?J.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(o=t.x)!==null&&o!==void 0?o:"nearest",(a=t.yMargin)!==null&&a!==void 0?a:5,(r=t.xMargin)!==null&&r!==void 0?r:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Md.of(new Or(J.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return At.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return At.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=bs.newName(),o=[jd.of(i),ec.of(Vy(`.${i}`,e))];return t&&t.dark&&o.push(Gy.of(!0)),o}static baseTheme(e){return Sa.lowest(ec.of(Vy("."+Ky,e,VO)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),o=i&&Nt.get(i)||Nt.get(e);return((t=o?.root)===null||t===void 0?void 0:t.view)||null}}ue.styleModule=ec;ue.inputHandler=xO;ue.clipboardInputFilter=dx;ue.clipboardOutputFilter=hx;ue.scrollHandler=kO;ue.focusChangeEffect=vO;ue.perLineTextDirection=CO;ue.exceptionSink=bO;ue.updateListener=_y;ue.editable=ko;ue.mouseSelectionStyle=yO;ue.dragMovesSelection=mO;ue.clickAddsSelectionRange=gO;ue.decorations=hf;ue.blockWrappers=PO;ue.outerDecorations=px;ue.atomicRanges=Jc;ue.bidiIsolatedRanges=DO;ue.cursorScrollMargin=pe.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});ue.scrollMargins=OO;ue.darkTheme=Gy;ue.cspNonce=pe.define({combine:n=>n.length?n[0]:""});ue.contentAttributes=fx;ue.editorAttributes=AO;ue.lineWrapping=ue.contentAttributes.of({class:"cm-lineWrapping"});ue.announce=Le.define();const B4=4096,Ww={};class Oh{constructor(e,t,i,o,a,r){this.from=e,this.to=t,this.dir=i,this.isolates=o,this.fresh=a,this.order=r}static update(e,t){if(t.empty&&!e.some(a=>a.fresh))return e;let i=[],o=e.length?e[e.length-1].dir:yt.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let r=e[a];r.dir==o&&!t.touchesRange(r.from,r.to)&&i.push(new Oh(t.mapPos(r.from,1),t.mapPos(r.to,-1),r.dir,r.isolates,!1,r.order))}return i}}function Qw(n,e,t){for(let i=n.state.facet(e),o=i.length-1;o>=0;o--){let a=i[o],r=typeof a=="function"?a(n):a;r&&lx(r,t)}return t}const H4=ge.mac?"mac":ge.windows?"win":ge.linux?"linux":"key";function _4(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let o,a,r,c;for(let d=0;d<t.length-1;++d){const f=t[d];if(/^(cmd|meta|m)$/i.test(f))c=!0;else if(/^a(lt)?$/i.test(f))o=!0;else if(/^(c|ctrl|control)$/i.test(f))a=!0;else if(/^s(hift)?$/i.test(f))r=!0;else if(/^mod$/i.test(f))e=="mac"?c=!0:a=!0;else throw new Error("Unrecognized modifier name: "+f)}return o&&(i="Alt-"+i),a&&(i="Ctrl-"+i),c&&(i="Meta-"+i),r&&(i="Shift-"+i),i}function Bd(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const U4=Sa.default(ue.domEventHandlers({keydown(n,e){return QO(WO(e.state),n,e,"editor")}})),mf=pe.define({enables:U4}),Yw=new WeakMap;function WO(n){let e=n.facet(mf),t=Yw.get(e);return t||Yw.set(e,t=q4(e.reduce((i,o)=>i.concat(o),[]))),t}function z4(n,e,t){return QO(WO(n.state),e,n,t)}let fs=null;const F4=4e3;function q4(n,e=H4){let t=Object.create(null),i=Object.create(null),o=(r,c)=>{let d=i[r];if(d==null)i[r]=c;else if(d!=c)throw new Error("Key binding "+r+" is used both as a regular binding and as a multi-stroke prefix")},a=(r,c,d,f,g)=>{var m,x;let v=t[r]||(t[r]=Object.create(null)),C=c.split(/ (?!$)/).map(D=>_4(D,e));for(let D=1;D<C.length;D++){let O=C.slice(0,D).join(" ");o(O,!0),v[O]||(v[O]={preventDefault:!0,stopPropagation:!1,run:[M=>{let T=fs={view:M,prefix:O,scope:r};return setTimeout(()=>{fs==T&&(fs=null)},F4),!0}]})}let k=C.join(" ");o(k,!1);let w=v[k]||(v[k]={preventDefault:!1,stopPropagation:!1,run:((x=(m=v._any)===null||m===void 0?void 0:m.run)===null||x===void 0?void 0:x.slice())||[]});d&&w.run.push(d),f&&(w.preventDefault=!0),g&&(w.stopPropagation=!0)};for(let r of n){let c=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let f of c){let g=t[f]||(t[f]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=r;for(let x in g)g[x].run.push(v=>m(v,Wy))}let d=r[e]||r.key;if(d)for(let f of c)a(f,d,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(f,"Shift-"+d,r.shift,r.preventDefault,r.stopPropagation)}return t}let Wy=null;function QO(n,e,t,i){Wy=e;let o=oU(e),a=Mn(o,0),r=_i(a)==o.length&&o!=" ",c="",d=!1,f=!1,g=!1;fs&&fs.view==t&&fs.scope==i&&(c=fs.prefix+" ",jO.indexOf(e.keyCode)<0&&(f=!0,fs=null));let m=new Set,x=w=>{if(w){for(let D of w.run)if(!m.has(D)&&(m.add(D),D(t)))return w.stopPropagation&&(g=!0),!0;w.preventDefault&&(w.stopPropagation&&(g=!0),f=!0)}return!1},v=n[i],C,k;return v&&(x(v[c+Bd(o,e,!r)])?d=!0:r&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ge.windows&&e.ctrlKey&&e.altKey)&&!(ge.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(C=xs[e.keyCode])&&C!=o?(x(v[c+Bd(C,e,!0)])||e.shiftKey&&(k=Dc[e.keyCode])!=o&&k!=C&&x(v[c+Bd(k,e,!1)]))&&(d=!0):r&&e.shiftKey&&x(v[c+Bd(o,e,!0)])&&(d=!0),!d&&x(v._any)&&(d=!0)),f&&(d=!0),d&&g&&e.stopPropagation(),Wy=null,d}class ca{constructor(e,t,i,o,a){this.className=e,this.left=t,this.top=i,this.width=o,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let o=e.coordsAtPos(i.head,i.assoc||1);if(!o)return[];let a=YO(e);return[new ca(t,o.left-a.left,o.top-a.top,null,o.bottom-o.top)]}else return G4(e,t,i)}}function YO(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==yt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function $w(n,e,t,i){let o=n.coordsAtPos(e,t*2);if(!o)return i;let a=n.dom.getBoundingClientRect(),r=(o.top+o.bottom)/2,c=n.posAtCoords({x:a.left+1,y:r}),d=n.posAtCoords({x:a.right-1,y:r});return c==null||d==null?i:{from:Math.max(i.from,Math.min(c,d)),to:Math.min(i.to,Math.max(c,d))}}function G4(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),o=Math.min(t.to,n.viewport.to),a=n.textDirection==yt.LTR,r=n.contentDOM,c=r.getBoundingClientRect(),d=YO(n),f=r.querySelector(".cm-line"),g=f&&window.getComputedStyle(f),m=c.left+(g?parseInt(g.paddingLeft)+Math.min(0,parseInt(g.textIndent)):0),x=c.right-(g?parseInt(g.paddingRight):0),v=zy(n,i,1),C=zy(n,o,-1),k=v.type==rn.Text?v:null,w=C.type==rn.Text?C:null;if(k&&(n.lineWrapping||v.widgetLineBreaks)&&(k=$w(n,i,1,k)),w&&(n.lineWrapping||C.widgetLineBreaks)&&(w=$w(n,o,-1,w)),k&&w&&k.from==w.from&&k.to==w.to)return O(M(t.from,t.to,k));{let L=k?M(t.from,null,k):T(v,!1),N=w?M(null,t.to,w):T(C,!0),I=[];return(k||v).to<(w||C).from-(k&&w?1:0)||v.widgetLineBreaks>1&&L.bottom+n.defaultLineHeight/2<N.top?I.push(D(m,L.bottom,x,N.top)):L.bottom<N.top&&n.elementAtHeight((L.bottom+N.top)/2).type==rn.Text&&(L.bottom=N.top=(L.bottom+N.top)/2),O(L).concat(I).concat(O(N))}function D(L,N,I,K){return new ca(e,L-d.left,N-d.top,Math.max(0,I-L),K-N)}function O({top:L,bottom:N,horizontal:I}){let K=[];for(let U=0;U<I.length;U+=2)K.push(D(I[U],L,I[U+1],N));return K}function M(L,N,I){let K=1e9,U=-1e9,z=[];function X(ie,oe,B,Z,se){let Y=n.coordsAtPos(ie,ie==I.to?-2:2),ae=n.coordsAtPos(B,B==I.from?2:-2);!Y||!ae||(K=Math.min(Y.top,ae.top,K),U=Math.max(Y.bottom,ae.bottom,U),se==yt.LTR?z.push(a&&oe?m:Y.left,a&&Z?x:ae.right):z.push(!a&&Z?m:ae.left,!a&&oe?x:Y.right))}let _=L??I.from,V=N??I.to;for(let ie of n.visibleRanges)if(ie.to>_&&ie.from<V)for(let oe=Math.max(ie.from,_),B=Math.min(ie.to,V);;){let Z=n.state.doc.lineAt(oe);for(let se of n.bidiSpans(Z)){let Y=se.from+Z.from,ae=se.to+Z.from;if(Y>=B)break;ae>oe&&X(Math.max(Y,oe),L==null&&Y<=_,Math.min(ae,B),N==null&&ae>=V,se.dir)}if(oe=Z.to+1,oe>=B)break}return z.length==0&&X(_,L==null,V,N==null,n.textDirection),{top:K,bottom:U,horizontal:z}}function T(L,N){let I=c.top+(N?L.top:L.bottom);return{top:I,bottom:I,horizontal:[]}}}function K4(n,e){return n.constructor==e.constructor&&n.eq(e)}class V4{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(oh)!=e.state.facet(oh)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(oh);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!K4(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[i].constructor&&o.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(o.draw(),t);for(;t;){let o=t.nextSibling;t.remove(),t=o}this.drawn=e,ge.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const oh=pe.define();function $O(n){return[At.define(e=>new V4(e,n)),oh.of(n)]}const _r=pe.define({combine(n){return Xi(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function W4(n={}){return[_r.of(n),Q4,Y4,$4,SO.of(!0)]}function XO(n){return n.startState.facet(_r)!=n.state.facet(_r)}const Q4=$O({above:!0,markers(n){let{state:e}=n,t=e.facet(_r),i=[];for(let o of e.selection.ranges){let a=o==e.selection.main;if(o.empty||t.drawRangeCursor&&!(a&&ge.ios&&t.iosSelectionHandles)){let r=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=o.empty?o:J.cursor(o.head,o.assoc);for(let d of ca.forRange(n,r,c))i.push(d)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=XO(n);return t&&Xw(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Xw(e.state,n)},class:"cm-cursorLayer"});function Xw(n,e){e.style.animationDuration=n.facet(_r).cursorBlinkRate+"ms"}const Y4=$O({above:!1,markers(n){let e=[],{main:t,ranges:i}=n.state.selection;for(let o of i)if(!o.empty)for(let a of ca.forRange(n,"cm-selectionBackground",o))e.push(a);if(ge.ios&&!t.empty&&n.state.facet(_r).iosSelectionHandles){for(let o of ca.forRange(n,"cm-selectionHandle cm-selectionHandle-start",J.cursor(t.from,1)))e.push(o);for(let o of ca.forRange(n,"cm-selectionHandle cm-selectionHandle-end",J.cursor(t.to,1)))e.push(o)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||XO(n)},class:"cm-selectionLayer"}),$4=Sa.highest(ue.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),JO=Le.define({map(n,e){return n==null?null:e.mapPos(n)}}),nc=hn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(JO)?i.value:t,n)}}),X4=At.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(nc);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(nc)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(nc),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(nc)!=n&&this.view.dispatch({effects:JO.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function J4(){return[nc,X4]}function Jw(n,e,t,i,o){e.lastIndex=0;for(let a=n.iterRange(t,i),r=t,c;!a.next().done;r+=a.value.length)if(!a.lineBreak)for(;c=e.exec(a.value);)o(r+c.index,c)}function Z4(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:o,to:a}of t)o=Math.max(n.state.doc.lineAt(o).from,o-e),a=Math.min(n.state.doc.lineAt(a).to,a+e),i.length&&i[i.length-1].to>=o?i[i.length-1].to=a:i.push({from:o,to:a});return i}class ez{constructor(e){const{regexp:t,decoration:i,decorate:o,boundary:a,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(c,d,f,g)=>o(g,f,f+c[0].length,c,d);else if(typeof i=="function")this.addMatch=(c,d,f,g)=>{let m=i(c,d,f);m&&g(f,f+c[0].length,m)};else if(i)this.addMatch=(c,d,f,g)=>g(f,f+c[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=r}createDeco(e){let t=new Yi,i=t.add.bind(t);for(let{from:o,to:a}of Z4(e,this.maxLength))Jw(e.state.doc,this.regexp,o,a,(r,c)=>this.addMatch(c,e,r,i));return t.finish()}updateDeco(e,t){let i=1e9,o=-1;return e.docChanged&&e.changes.iterChanges((a,r,c,d)=>{d>=e.view.viewport.from&&c<=e.view.viewport.to&&(i=Math.min(c,i),o=Math.max(d,o))}),e.viewportMoved||o-i>1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),i,o):t}updateRange(e,t,i,o){for(let a of e.visibleRanges){let r=Math.max(a.from,i),c=Math.min(a.to,o);if(c>=r){let d=e.state.doc.lineAt(r),f=d.to<c?e.state.doc.lineAt(c):d,g=Math.max(a.from,d.from),m=Math.min(a.to,f.to);if(this.boundary){for(;r>d.from;r--)if(this.boundary.test(d.text[r-1-d.from])){g=r;break}for(;c<f.to;c++)if(this.boundary.test(f.text[c-f.from])){m=c;break}}let x=[],v,C=(k,w,D)=>x.push(D.range(k,w));if(d==f)for(this.regexp.lastIndex=g-d.from;(v=this.regexp.exec(d.text))&&v.index<m-d.from;)this.addMatch(v,e,v.index+d.from,C);else Jw(e.state.doc,this.regexp,g,m,(k,w)=>this.addMatch(w,e,k,C));t=t.update({filterFrom:g,filterTo:m,filter:(k,w)=>k<g||w>m,add:x})}}return t}}const Qy=/x/.unicode!=null?"gu":"g",tz=new RegExp(`[\0-\b
27
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Qy),nz={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Dm=null;function iz(){var n;if(Dm==null&&typeof document<"u"&&document.body){let e=document.body.style;Dm=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Dm||!1}const sh=pe.define({combine(n){let e=Xi(n,{render:null,specialChars:tz,addSpecialChars:null});return(e.replaceTabs=!iz())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Qy)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Qy)),e}});function oz(n={}){return[sh.of(n),sz()]}let Zw=null;function sz(){return Zw||(Zw=At.fromClass(class{constructor(n){this.view=n,this.decorations=Pe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(sh)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new ez({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:o}=t.state,a=Mn(e[0],0);if(a==9){let r=o.lineAt(i),c=t.state.tabSize,d=Vr(r.text,c,i-r.from);return Pe.replace({widget:new cz((c-d%c)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Pe.replace({widget:new lz(n,a)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(sh);n.startState.facet(sh)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const az="•";function rz(n){return n>=32?az:n==10?"␤":String.fromCharCode(9216+n)}class lz extends Ji{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=rz(this.code),i=e.state.phrase("Control character")+" "+(nz[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,i,t);if(o)return o;let a=document.createElement("span");return a.textContent=t,a.title=i,a.setAttribute("aria-label",i),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class cz extends Ji{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function uz(){return hz}const dz=Pe.line({class:"cm-activeLine"}),hz=At.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let o=n.lineBlockAt(i.head);o.from>e&&(t.push(dz.range(o.from)),e=o.from)}return Pe.set(t)}},{decorations:n=>n.decorations});class fz extends Ji{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?hc(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),o=Mc(t[0],i.direction!="rtl"),a=parseInt(i.lineHeight);return o.bottom-o.top>a*1.5?{left:o.left,right:o.right,top:o.top,bottom:o.top+a}:o}ignoreEvent(){return!1}}function pz(n){let e=At.fromClass(class{constructor(t){this.view=t,this.placeholder=n?Pe.set([Pe.widget({widget:new fz(n),side:1}).range(0)]):Pe.none}get decorations(){return this.view.state.doc.length?Pe.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,ue.contentAttributes.of({"aria-placeholder":n})]:e}const Yy=2e3;function gz(n,e,t){let i=Math.min(e.line,t.line),o=Math.max(e.line,t.line),a=[];if(e.off>Yy||t.off>Yy||e.col<0||t.col<0){let r=Math.min(e.off,t.off),c=Math.max(e.off,t.off);for(let d=i;d<=o;d++){let f=n.doc.line(d);f.length<=c&&a.push(J.range(f.from+r,f.to+c))}}else{let r=Math.min(e.col,t.col),c=Math.max(e.col,t.col);for(let d=i;d<=o;d++){let f=n.doc.line(d),g=Oy(f.text,r,n.tabSize,!0);if(g<0)a.push(J.cursor(f.to));else{let m=Oy(f.text,c,n.tabSize);a.push(J.range(f.from+g,f.from+m))}}}return a}function mz(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function e1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),o=t-i.from,a=o>Yy?-1:o==i.length?mz(n,e.clientX):Vr(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:a,off:o}}function yz(n,e){let t=e1(n,e),i=n.state.selection;return t?{update(o){if(o.docChanged){let a=o.changes.mapPos(o.startState.doc.line(t.line).from),r=o.state.doc.lineAt(a);t={line:r.number,col:t.col,off:Math.min(t.off,r.length)},i=i.map(o.changes)}},get(o,a,r){let c=e1(n,o);if(!c)return i;let d=gz(n.state,t,c);return d.length?r?J.create(d.concat(i.ranges)):J.create(d):i}}:null}function bz(n){let e=(t=>t.altKey&&t.button==0);return ue.mouseSelectionStyle.of((t,i)=>e(i)?yz(t,i):null)}const xz={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},vz={style:"cursor: crosshair"};function Cz(n={}){let[e,t]=xz[n.key||"Alt"],i=At.fromClass(class{constructor(o){this.view=o,this.isDown=!1}set(o){this.isDown!=o&&(this.isDown=o,this.view.update([]))}},{eventObservers:{keydown(o){this.set(o.keyCode==e||t(o))},keyup(o){(o.keyCode==e||!t(o))&&this.set(!1)},mousemove(o){this.set(t(o))}}});return[i,ue.contentAttributes.of(o=>{var a;return!((a=o.plugin(i))===null||a===void 0)&&a.isDown?vz:null})]}const Hd="-10000px";class ZO{constructor(e,t,i,o){this.facet=t,this.createTooltipView=i,this.removeTooltipView=o,this.input=e.state.facet(t),this.tooltips=this.input.filter(r=>r);let a=null;this.tooltipViews=this.tooltips.map(r=>a=i(r,a))}update(e,t){var i;let o=e.state.facet(this.facet),a=o.filter(d=>d);if(o===this.input){for(let d of this.tooltipViews)d.update&&d.update(e);return!1}let r=[],c=t?[]:null;for(let d=0;d<a.length;d++){let f=a[d],g=-1;if(f){for(let m=0;m<this.tooltips.length;m++){let x=this.tooltips[m];x&&x.create==f.create&&(g=m)}if(g<0)r[d]=this.createTooltipView(f,d?r[d-1]:null),c&&(c[d]=!!f.above);else{let m=r[d]=this.tooltipViews[g];c&&(c[d]=t[g]),m.update&&m.update(e)}}}for(let d of this.tooltipViews)r.indexOf(d)<0&&(this.removeTooltipView(d),(i=d.destroy)===null||i===void 0||i.call(d));return t&&(c.forEach((d,f)=>t[f]=d),t.length=c.length),this.input=o,this.tooltips=a,this.tooltipViews=r,!0}}function Sz(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Om=pe.define({combine:n=>{var e,t,i;return{position:ge.ios?"absolute":((e=n.find(o=>o.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(o=>o.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(o=>o.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Sz}}}),t1=new WeakMap,xx=At.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Om);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ZO(n,vx,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Om);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let o of this.manager.tooltipViews)o.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let o of this.manager.tooltipViews)this.container.appendChild(o.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let o=document.createElement("div");o.className="cm-tooltip-arrow",t.dom.appendChild(o)}return t.dom.style.position=this.position,t.dom.style.top=Hd,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(ge.safari){let r=a.getBoundingClientRect();t=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}else t=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(n=a.width/this.parent.offsetWidth,e=a.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),o=gx(this.view);return{visible:{left:i.left+o.left,top:i.top+o.top,right:i.right-o.right,bottom:i.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,r)=>{let c=this.manager.tooltipViews[r];return c.getCoords?c.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Om).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let c of this.manager.tooltipViews)c.dom.style.position="absolute"}let{visible:t,space:i,scaleX:o,scaleY:a}=n,r=[];for(let c=0;c<this.manager.tooltips.length;c++){let d=this.manager.tooltips[c],f=this.manager.tooltipViews[c],{dom:g}=f,m=n.pos[c],x=n.size[c];if(!m||d.clip!==!1&&(m.bottom<=Math.max(t.top,i.top)||m.top>=Math.min(t.bottom,i.bottom)||m.right<Math.max(t.left,i.left)-.1||m.left>Math.min(t.right,i.right)+.1)){g.style.top=Hd;continue}let v=d.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,C=v?7:0,k=x.right-x.left,w=(e=t1.get(f))!==null&&e!==void 0?e:x.bottom-x.top,D=f.offset||wz,O=this.view.textDirection==yt.LTR,M=x.width>i.right-i.left?O?i.left:i.right-x.width:O?Math.max(i.left,Math.min(m.left-(v?14:0)+D.x,i.right-k)):Math.min(Math.max(i.left,m.left-k+(v?14:0)-D.x),i.right-k),T=this.above[c];!d.strictSide&&(T?m.top-w-C-D.y<i.top:m.bottom+w+C+D.y>i.bottom)&&T==i.bottom-m.bottom>m.top-i.top&&(T=this.above[c]=!T);let L=(T?m.top-i.top:i.bottom-m.bottom)-C;if(L<w&&f.resize!==!1){if(L<this.view.defaultLineHeight){g.style.top=Hd;continue}t1.set(f,w),g.style.height=(w=L)/a+"px"}else g.style.height&&(g.style.height="");let N=T?m.top-w-C-D.y:m.bottom+C+D.y,I=M+k;if(f.overlap!==!0)for(let K of r)K.left<I&&K.right>M&&K.top<N+w&&K.bottom>N&&(N=T?K.top-w-2-C:K.bottom+C+2);if(this.position=="absolute"?(g.style.top=(N-n.parent.top)/a+"px",n1(g,(M-n.parent.left)/o)):(g.style.top=N/a+"px",n1(g,M/o)),v){let K=m.left+(O?D.x:-D.x)-(M+14-7);v.style.left=K/o+"px"}f.overlap!==!0&&r.push({left:M,top:N,right:I,bottom:N+w}),g.classList.toggle("cm-tooltip-above",T),g.classList.toggle("cm-tooltip-below",!T),f.positioned&&f.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Hd}},{eventObservers:{scroll(){this.maybeMeasure()}}});function n1(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const kz=ue.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),wz={x:0,y:0},vx=pe.define({enables:[xx,kz]}),Th=pe.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class yf{static create(e){return new yf(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new ZO(e,Th,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let o=i[e];if(o!==void 0){if(t===void 0)t=o;else if(t!==o)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Az=vx.compute([Th],n=>{let e=n.facet(Th);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:yf.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),eT=pe.define();class Pz{constructor(e,t,i,o,a,r){this.view=e,this.source=t,this.field=i,this.locked=o,this.setHover=a,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let o,a=1;if(i.isWidget())o=i.posAtStart;else{if(o=e.posAtCoords(t),o==null)return;let r=e.coordsAtPos(o);if(!r||t.y<r.top||t.y>r.bottom||t.x<r.left-e.defaultCharacterWidth||t.x>r.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(o)).find(f=>f.from<=o&&f.to>=o),d=c&&c.dir==yt.RTL?-1:1;a=t.x<r.left?-d:d}this.activateHover(e,o,a)}activateHover(e,t,i,o){let a=this.source(e,t,i),r=c=>{if(c&&!(Array.isArray(c)&&!c.length)){let d=Array.isArray(c)?c:[c];o&&this.locked.set(d,o),e.dispatch({effects:this.setHover.of(d)})}};if(a&&"then"in a){let c=this.pending={pos:t};a.then(d=>{this.pending==c&&(this.pending=null,r(d))},d=>En(e.state,d,"hover tooltip"))}else r(a)}get tooltip(){let e=this.view.plugin(xx),t=e?e.manager.tooltips.findIndex(i=>i.create==yf.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:o,tooltip:a}=this;if(o.length&&!this.locked.has(o)&&a&&!Dz(a.dom,e)||this.pending){let{pos:r}=o[0]||this.pending,c=(i=(t=o[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:r;(r==c?this.view.posAtCoords(this.lastMove)!=r:!Oz(this.view,r,c,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:o}=this;o.length&&!this.locked.has(o)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const _d=4;function Dz(n,e){let{left:t,right:i,top:o,bottom:a}=n.getBoundingClientRect(),r;if(r=n.querySelector(".cm-tooltip-arrow")){let c=r.getBoundingClientRect();o=Math.min(c.top,o),a=Math.max(c.bottom,a)}return e.clientX>=t-_d&&e.clientX<=i+_d&&e.clientY>=o-_d&&e.clientY<=a+_d}function Oz(n,e,t,i,o,a){let r=n.scrollDOM.getBoundingClientRect(),c=n.documentTop+n.documentPadding.top+n.contentHeight;if(r.left>i||r.right<i||r.top>o||Math.min(r.bottom,c)<o)return!1;let d=n.posAtCoords({x:i,y:o},!1);return d>=e&&d<=t}function Tz(n,e={}){let t=Le.define(),i=new WeakMap,o=hn.define({create(){return[]},update(r,c){let d=i.get(r);if(r.length&&(e.hideOnChange&&(c.docChanged||c.selection)?r=[]:d&&d(c)?r=[]:e.hideOn&&(r=r.filter(f=>!e.hideOn(c,f)))),c.docChanged&&r.length){let f=[];for(let g of r){let m=c.changes.mapPos(g.pos,-1,xn.TrackDel);if(m!=null){let x=Object.assign(Object.create(null),g);x.pos=m,x.end!=null&&(x.end=c.changes.mapPos(x.end)),f.push(x)}}r=f}for(let f of c.effects)f.is(t)&&(r=f.value,d=void 0),(f.is(Nz)&&!f.value||f.value==o)&&(r=[]);return r.length&&d&&i.set(r,d),r},provide:r=>Th.from(r)});const a=At.define(r=>new Pz(r,n,o,i,t,e.hoverTime||300));return{active:o,extension:[o,a,eT.of(a),Az]}}function Mz(n,e,t,i={}){var o;let a=n.state.facet(eT).map(r=>n.plugin(r)).filter(r=>!!r);if(i.tooltip&&i.tooltip.active){let r=a.find(c=>c.field==i.tooltip.active);r&&(a=[r])}for(let r of a)r.activateHover(n,e,t,(o=i.until)!==null&&o!==void 0?o:(()=>!1))}function tT(n,e){let t=n.plugin(xx);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Nz=Le.define(),i1=pe.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Cx(n,e){let t=n.plugin(nT),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const nT=At.fromClass(class{constructor(n){this.input=n.state.facet(Lc),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(i1);this.top=new Ud(n,!0,e.topContainer),this.bottom=new Ud(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(i1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ud(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ud(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Lc);if(t!=this.input){let i=t.filter(d=>d),o=[],a=[],r=[],c=[];for(let d of i){let f=this.specs.indexOf(d),g;f<0?(g=d(n.view),c.push(g)):(g=this.panels[f],g.update&&g.update(n)),o.push(g),(g.top?a:r).push(g)}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(r);for(let d of c)d.dom.classList.add("cm-panel"),d.mount&&d.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>ue.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ud{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=o1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=o1(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function o1(n){let e=n.nextSibling;return n.remove(),e}const Lc=pe.define({enables:nT});function Lz(n,e){let t,i=new Promise(r=>t=r),o=r=>Rz(r,e,t);n.state.field(Tm,!1)?n.dispatch({effects:iT.of(o)}):n.dispatch({effects:Le.appendConfig.of(Tm.init(()=>[o]))});let a=oT.of(o);return{close:a,result:i.then(r=>((n.win.queueMicrotask||(d=>n.win.setTimeout(d,10)))(()=>{n.state.field(Tm).indexOf(o)>-1&&n.dispatch({effects:a})}),r))}}const Tm=hn.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(iT)?n=[t.value].concat(n):t.is(oT)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Lc.computeN([n],e=>e.field(n))}),iT=Le.define(),oT=Le.define();function Rz(n,e,t){let i=e.content?e.content(n,()=>r(null)):null;if(!i){if(i=dt("form"),e.input){let c=dt("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),i.appendChild(dt("label",(e.label||"")+": ",c))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(dt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let o=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let c=0;c<o.length;c++){let d=o[c];d.addEventListener("keydown",f=>{f.keyCode==27?(f.preventDefault(),r(null)):f.keyCode==13&&(f.preventDefault(),r(d))}),d.addEventListener("submit",f=>{f.preventDefault(),r(d)})}let a=dt("div",i,dt("button",{onclick:()=>r(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function r(c){a.contains(a.ownerDocument.activeElement)&&n.focus(),t(c)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=i.querySelector(e.focus):c=i.querySelector("input")||i.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class Ro extends ys{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ro.prototype.elementClass="";Ro.prototype.toDOM=void 0;Ro.prototype.mapMode=xn.TrackBefore;Ro.prototype.startSide=Ro.prototype.endSide=-1;Ro.prototype.point=!0;const ah=pe.define(),Ez=pe.define(),Iz={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>qe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},gc=pe.define();function jz(n){return[sT(),gc.of({...Iz,...n})]}const s1=pe.define({combine:n=>n.some(e=>e)});function sT(n){return[Bz]}const Bz=At.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(gc).map(e=>new r1(n,e)),this.fixed=!n.state.facet(s1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(s1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=qe.iter(this.view.state.facet(ah),this.view.viewport.from),i=[],o=this.gutters.map(a=>new Hz(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(a.type)){let r=!0;for(let c of a.type)if(c.type==rn.Text&&r){$y(t,i,c.from);for(let d of o)d.line(this.view,c,i);r=!1}else if(c.widget)for(let d of o)d.widget(this.view,c)}else if(a.type==rn.Text){$y(t,i,a.from);for(let r of o)r.line(this.view,a,i)}else if(a.widget)for(let r of o)r.widget(this.view,a);for(let a of o)a.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(gc),t=n.state.facet(gc),i=n.docChanged||n.heightChanged||n.viewportChanged||!qe.eq(n.startState.facet(ah),n.state.facet(ah),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let o of this.gutters)o.update(n)&&(i=!0);else{i=!0;let o=[];for(let a of t){let r=e.indexOf(a);r<0?o.push(new r1(this.view,a)):(this.gutters[r].update(n),o.push(this.gutters[r]))}for(let a of this.gutters)a.dom.remove(),o.indexOf(a)<0&&a.destroy();for(let a of o)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=o}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>ue.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,o=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==yt.LTR?{left:i,right:o}:{right:i,left:o}})});function a1(n){return Array.isArray(n)?n:[n]}function $y(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class Hz{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=qe.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:o}=this,a=(t.top-this.height)/e.scaleY,r=t.height/e.scaleY;if(this.i==o.elements.length){let c=new aT(e,r,a,i);o.elements.push(c),o.dom.appendChild(c.dom)}else o.elements[this.i].update(e,r,a,i);this.height=t.bottom,this.i++}line(e,t,i){let o=[];$y(this.cursor,o,t.from),i.length&&(o=o.concat(i));let a=this.gutter.config.lineMarker(e,t,o);a&&o.unshift(a);let r=this.gutter;o.length==0&&!r.config.renderEmptyElements||this.addElement(e,t,o)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),o=i?[i]:null;for(let a of e.state.facet(Ez)){let r=a(e,t.widget,t);r&&(o||(o=[])).push(r)}o&&this.addElement(e,t,o)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class r1{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,o=>{let a=o.target,r;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let d=a.getBoundingClientRect();r=(d.top+d.bottom)/2}else r=o.clientY;let c=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[i](e,c,o)&&o.preventDefault()});this.markers=a1(t.markers(e)),t.initialSpacer&&(this.spacer=new aT(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=a1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let o=this.config.updateSpacer(this.spacer.markers[0],e);o!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[o])}let i=e.view.viewport;return!qe.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class aT{constructor(e,t,i,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,o)}update(e,t,i,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),_z(this.markers,o)||this.setMarkers(e,o)}setMarkers(e,t){let i="cm-gutterElement",o=this.dom.firstChild;for(let a=0,r=0;;){let c=r,d=a<t.length?t[a++]:null,f=!1;if(d){let g=d.elementClass;g&&(i+=" "+g);for(let m=r;m<this.markers.length;m++)if(this.markers[m].compare(d)){c=m,f=!0;break}}else c=this.markers.length;for(;r<c;){let g=this.markers[r++];if(g.toDOM){g.destroy(o);let m=o.nextSibling;o.remove(),o=m}}if(!d)break;d.toDOM&&(f?o=o.nextSibling:this.dom.insertBefore(d.toDOM(e),o)),f&&r++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function _z(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const Uz=pe.define(),zz=pe.define(),xr=pe.define({combine(n){return Xi(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let o in t){let a=i[o],r=t[o];i[o]=a?(c,d,f)=>a(c,d,f)||r(c,d,f):r}return i}})}});class Mm extends Ro{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Nm(n,e){return n.state.facet(xr).formatNumber(e,n.state)}const Fz=gc.compute([xr],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Uz)},lineMarker(e,t,i){return i.some(o=>o.toDOM)?null:new Mm(Nm(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let o of e.state.facet(zz)){let a=o(e,t,i);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(xr)!=e.state.facet(xr),initialSpacer(e){return new Mm(Nm(e,l1(e.state.doc.lines)))},updateSpacer(e,t){let i=Nm(t.view,l1(t.view.state.doc.lines));return i==e.number?e:new Mm(i)},domEventHandlers:n.facet(xr).domEventHandlers,side:"before"}));function qz(n={}){return[xr.of(n),sT(),Fz]}function l1(n){let e=9;for(;e<n;)e=e*10+9;return e}const Gz=new class extends Ro{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Kz=ah.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head).from;o>t&&(t=o,e.push(Gz.range(o)))}return qe.of(e)});function Vz(){return Kz}const rT=1024;let Wz=0;class Lm{constructor(e,t){this.from=e,this.to=t}}class _e{constructor(e={}){this.id=Wz++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Cn.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}_e.closedBy=new _e({deserialize:n=>n.split(" ")});_e.openedBy=new _e({deserialize:n=>n.split(" ")});_e.group=new _e({deserialize:n=>n.split(" ")});_e.isolate=new _e({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});_e.contextHash=new _e({perNode:!0});_e.lookAhead=new _e({perNode:!0});_e.mounted=new _e({perNode:!0});class mc{constructor(e,t,i,o=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=o}static get(e){return e&&e.props&&e.props[_e.mounted.id]}}const Qz=Object.create(null);class Cn{constructor(e,t,i,o=0){this.name=e,this.props=t,this.id=i,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Qz,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new Cn(e.name||"",t,e.id,i);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(o)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[a[0].id]=a[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(_e.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let o of i.split(" "))t[o]=e[i];return i=>{for(let o=i.prop(_e.group),a=-1;a<(o?o.length:0);a++){let r=t[a<0?i.name:o[a]];if(r)return r}}}}Cn.none=new Cn("",Object.create(null),0,8);class bf{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let o=null;for(let a of e){let r=a(i);if(r){o||(o=Object.assign({},i.props));let c=r[1],d=r[0];d.combine&&d.id in o&&(c=d.combine(o[d.id],c)),o[d.id]=c}}t.push(o?new Cn(i.name,o,i.id,i.flags):i)}return new bf(t)}}const zd=new WeakMap,c1=new WeakMap;var Tt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Tt||(Tt={}));class ht{constructor(e,t,i,o,a){if(this.type=e,this.children=t,this.positions=i,this.length=o,this.props=null,a&&a.length){this.props=Object.create(null);for(let[r,c]of a)this.props[typeof r=="number"?r:r.id]=c}}toString(){let e=mc.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let o=i.toString();o&&(t&&(t+=","),t+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Jy(this.topNode,e)}cursorAt(e,t=0,i=0){let o=zd.get(this)||this.topNode,a=new Jy(o);return a.moveTo(e,t),zd.set(this,a._tree),a}get topNode(){return new di(this,0,0,null)}resolve(e,t=0){let i=Rc(zd.get(this)||this.topNode,e,t,!1);return zd.set(this,i),i}resolveInner(e,t=0){let i=Rc(c1.get(this)||this.topNode,e,t,!0);return c1.set(this,i),i}resolveStack(e,t=0){return Xz(this,e,t)}iterate(e){let{enter:t,leave:i,from:o=0,to:a=this.length}=e,r=e.mode||0,c=(r&Tt.IncludeAnonymous)>0;for(let d=this.cursor(r|Tt.IncludeAnonymous);;){let f=!1;if(d.from<=a&&d.to>=o&&(!c&&d.type.isAnonymous||t(d)!==!1)){if(d.firstChild())continue;f=!0}for(;f&&i&&(c||!d.type.isAnonymous)&&i(d),!d.nextSibling();){if(!d.parent())return;f=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:wx(Cn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,o)=>new ht(this.type,t,i,o,this.propValues),e.makeTree||((t,i,o)=>new ht(Cn.none,t,i,o)))}static build(e){return Jz(e)}}ht.empty=new ht(Cn.none,[],[],0);class Sx{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Sx(this.buffer,this.index)}}class Cs{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Cn.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],o=this.set.types[t],a=o.name;if(/\W/.test(a)&&!o.isError&&(a=JSON.stringify(a)),e+=4,i==e)return a;let r=[];for(;e<i;)r.push(this.childString(e)),e=this.buffer[e+3];return a+"("+r.join(",")+")"}findChild(e,t,i,o,a){let{buffer:r}=this,c=-1;for(let d=e;d!=t&&!(lT(a,o,r[d+1],r[d+2])&&(c=d,i>0));d=r[d+3]);return c}slice(e,t,i){let o=this.buffer,a=new Uint16Array(t-e),r=0;for(let c=e,d=0;c<t;){a[d++]=o[c++],a[d++]=o[c++]-i;let f=a[d++]=o[c++]-i;a[d++]=o[c++]-e,r=Math.max(r,f)}return new Cs(a,r,this.set)}}function lT(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Rc(n,e,t,i){for(var o;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let r=!i&&n instanceof di&&n.index<0?null:n.parent;if(!r)return n;n=r}let a=i?0:Tt.IgnoreOverlays;if(i)for(let r=n,c=r.parent;c;r=c,c=r.parent)r instanceof di&&r.index<0&&((o=c.enter(e,t,a))===null||o===void 0?void 0:o.from)!=r.from&&(n=c);for(;;){let r=n.enter(e,t,a);if(!r)return n;n=r}}class cT{cursor(e=0){return new Jy(this,e)}getChild(e,t=null,i=null){let o=u1(this,e,t,i);return o.length?o[0]:null}getChildren(e,t=null,i=null){return u1(this,e,t,i)}resolve(e,t=0){return Rc(this,e,t,!1)}resolveInner(e,t=0){return Rc(this,e,t,!0)}matchContext(e){return Xy(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let o=t.lastChild;if(!o||o.to!=t.to)break;o.type.isError&&o.from==o.to?(i=t,t=o.prevSibling):t=o}return i}get node(){return this}get next(){return this.parent}}class di extends cT{constructor(e,t,i,o){super(),this._tree=e,this.from=t,this.index=i,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,o,a=0){for(let r=this;;){for(let{children:c,positions:d}=r._tree,f=t>0?c.length:-1;e!=f;e+=t){let g=c[e],m=d[e]+r.from,x;if(!(!(a&Tt.EnterBracketed&&g instanceof ht&&(x=mc.get(g))&&!x.overlay&&x.bracketed&&i>=m&&i<=m+g.length)&&!lT(o,i,m,m+g.length))){if(g instanceof Cs){if(a&Tt.ExcludeBuffers)continue;let v=g.findChild(0,g.buffer.length,t,i-m,o);if(v>-1)return new gs(new Yz(r,g,e,m),null,v)}else if(a&Tt.IncludeAnonymous||!g.type.isAnonymous||kx(g)){let v;if(!(a&Tt.IgnoreMounts)&&(v=mc.get(g))&&!v.overlay)return new di(v.tree,m,e,r);let C=new di(g,m,e,r);return a&Tt.IncludeAnonymous||!C.type.isAnonymous?C:C.nextChild(t<0?g.children.length-1:0,t,i,o,a)}}}if(a&Tt.IncludeAnonymous||!r.type.isAnonymous||(r.index>=0?e=r.index+t:e=t<0?-1:r._parent._tree.children.length,r=r._parent,!r))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let o;if(!(i&Tt.IgnoreOverlays)&&(o=mc.get(this._tree))&&o.overlay){let a=e-this.from,r=i&Tt.EnterBracketed&&o.bracketed;for(let{from:c,to:d}of o.overlay)if((t>0||r?c<=a:c<a)&&(t<0||r?d>=a:d>a))return new di(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function u1(n,e,t,i){let o=n.cursor(),a=[];if(!o.firstChild())return a;if(t!=null){for(let r=!1;!r;)if(r=o.type.is(t),!o.nextSibling())return a}for(;;){if(i!=null&&o.type.is(i))return a;if(o.type.is(e)&&a.push(o.node),!o.nextSibling())return i==null?a:[]}}function Xy(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Yz{constructor(e,t,i,o){this.parent=e,this.buffer=t,this.index=i,this.start=o}}class gs extends cT{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:o}=this.context,a=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,i);return a<0?null:new gs(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&Tt.ExcludeBuffers)return null;let{buffer:o}=this.context,a=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return a<0?null:new gs(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new gs(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new gs(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,o=this.index+4,a=i.buffer[this.index+3];if(a>o){let r=i.buffer[this.index+1];e.push(i.slice(o,a,r)),t.push(0)}return new ht(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uT(n){if(!n.length)return null;let e=0,t=n[0];for(let a=1;a<n.length;a++){let r=n[a];(r.from>t.from||r.to<t.to)&&(t=r,e=a)}let i=t instanceof di&&t.index<0?null:t.parent,o=n.slice();return i?o[e]=i:o.splice(e,1),new $z(o,t)}class $z{constructor(e,t){this.heads=e,this.node=t}get next(){return uT(this.heads)}}function Xz(n,e,t){let i=n.resolveInner(e,t),o=null;for(let a=i instanceof di?i:i.context.parent;a;a=a.parent)if(a.index<0){let r=a.parent;(o||(o=[i])).push(r.resolve(e,t)),a=r}else{let r=mc.get(a.tree);if(r&&r.overlay&&r.overlay[0].from<=e&&r.overlay[r.overlay.length-1].to>=e){let c=new di(r.tree,r.overlay[0].from+a.from,-1,a);(o||(o=[i])).push(Rc(c,e,t,!1))}}return o?uT(o):i}class Jy{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Tt.EnterBracketed,e instanceof di)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:o}=this.buffer;return this.type=t||o.set.types[o.buffer[e]],this.from=i+o.buffer[e+1],this.to=i+o.buffer[e+2],!0}yield(e){return e?e instanceof di?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:o}=this.buffer,a=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.buffer.start,i);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Tt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Tt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Tt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let o=i<0?0:this.stack[i]+4;if(this.index!=o)return this.yieldBuf(t.findChild(o,this.index,-1,0,4))}else{let o=t.buffer[this.index+3];if(o<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(o)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(o.buffer.buffer[a+3]<this.index)return!1;({index:t,parent:i}=o)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let a=t+e,r=e<0?-1:i._tree.children.length;a!=r;a+=e){let c=i._tree.children[a];if(this.mode&Tt.IncludeAnonymous||c instanceof Cs||!c.type.isAnonymous||kx(c))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let o=this.index,a=this.stack.length;a>=0;){for(let r=e;r;r=r._parent)if(r.index==o){if(o==this.index)return r;t=r,i=a+1;break e}o=this.stack[--a]}for(let o=i;o<this.stack.length;o++)t=new gs(this.buffer,t,this.stack[o]);return this.bufferNode=new gs(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&t&&t(this),o=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,o=!0}}}matchContext(e){if(!this.buffer)return Xy(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let o=e.length-1,a=this.stack.length-1;o>=0;a--){if(a<0)return Xy(this._tree,e,o);let r=i[t.buffer[this.stack[a]]];if(!r.isAnonymous){if(e[o]&&e[o]!=r.name)return!1;o--}}return!0}}function kx(n){return n.children.some(e=>e instanceof Cs||!e.type.isAnonymous||kx(e))}function Jz(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:o=rT,reused:a=[],minRepeatType:r=i.types.length}=n,c=Array.isArray(t)?new Sx(t,t.length):t,d=i.types,f=0,g=0;function m(L,N,I,K,U,z){let{id:X,start:_,end:V,size:ie}=c,oe=g,B=f;if(ie<0)if(c.next(),ie==-1){let de=a[X];I.push(de),K.push(_-L);return}else if(ie==-3){f=X;return}else if(ie==-4){g=X;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let Z=d[X],se,Y,ae=_-L;if(V-_<=o&&(Y=w(c.pos-N,U))){let de=new Uint16Array(Y.size-Y.skip),be=c.pos-Y.size,te=de.length;for(;c.pos>be;)te=D(Y.start,de,te);se=new Cs(de,V-Y.start,i),ae=Y.start-L}else{let de=c.pos-ie;c.next();let be=[],te=[],le=X>=r?X:-1,xe=0,Se=V;for(;c.pos>de;)le>=0&&c.id==le&&c.size>=0?(c.end<=Se-o&&(C(be,te,_,xe,c.end,Se,le,oe,B),xe=be.length,Se=c.end),c.next()):z>2500?x(_,de,be,te):m(_,de,be,te,le,z+1);if(le>=0&&xe>0&&xe<be.length&&C(be,te,_,xe,_,Se,le,oe,B),be.reverse(),te.reverse(),le>-1&&xe>0){let ye=v(Z,B);se=wx(Z,be,te,0,be.length,0,V-_,ye,ye)}else se=k(Z,be,te,V-_,oe-V,B)}I.push(se),K.push(ae)}function x(L,N,I,K){let U=[],z=0,X=-1;for(;c.pos>N;){let{id:_,start:V,end:ie,size:oe}=c;if(oe>4)c.next();else{if(X>-1&&V<X)break;X<0&&(X=ie-o),U.push(_,V,ie),z++,c.next()}}if(z){let _=new Uint16Array(z*4),V=U[U.length-2];for(let ie=U.length-3,oe=0;ie>=0;ie-=3)_[oe++]=U[ie],_[oe++]=U[ie+1]-V,_[oe++]=U[ie+2]-V,_[oe++]=oe;I.push(new Cs(_,U[2]-V,i)),K.push(V-L)}}function v(L,N){return(I,K,U)=>{let z=0,X=I.length-1,_,V;if(X>=0&&(_=I[X])instanceof ht){if(!X&&_.type==L&&_.length==U)return _;(V=_.prop(_e.lookAhead))&&(z=K[X]+_.length+V)}return k(L,I,K,U,z,N)}}function C(L,N,I,K,U,z,X,_,V){let ie=[],oe=[];for(;L.length>K;)ie.push(L.pop()),oe.push(N.pop()+I-U);L.push(k(i.types[X],ie,oe,z-U,_-z,V)),N.push(U-I)}function k(L,N,I,K,U,z,X){if(z){let _=[_e.contextHash,z];X=X?[_].concat(X):[_]}if(U>25){let _=[_e.lookAhead,U];X=X?[_].concat(X):[_]}return new ht(L,N,I,K,X)}function w(L,N){let I=c.fork(),K=0,U=0,z=0,X=I.end-o,_={size:0,start:0,skip:0};e:for(let V=I.pos-L;I.pos>V;){let ie=I.size;if(I.id==N&&ie>=0){_.size=K,_.start=U,_.skip=z,z+=4,K+=4,I.next();continue}let oe=I.pos-ie;if(ie<0||oe<V||I.start<X)break;let B=I.id>=r?4:0,Z=I.start;for(I.next();I.pos>oe;){if(I.size<0)if(I.size==-3||I.size==-4)B+=4;else break e;else I.id>=r&&(B+=4);I.next()}U=Z,K+=ie,z+=B}return(N<0||K==L)&&(_.size=K,_.start=U,_.skip=z),_.size>4?_:void 0}function D(L,N,I){let{id:K,start:U,end:z,size:X}=c;if(c.next(),X>=0&&K<r){let _=I;if(X>4){let V=c.pos-(X-4);for(;c.pos>V;)I=D(L,N,I)}N[--I]=_,N[--I]=z-L,N[--I]=U-L,N[--I]=K}else X==-3?f=K:X==-4&&(g=K);return I}let O=[],M=[];for(;c.pos>0;)m(n.start||0,n.bufferStart||0,O,M,-1,0);let T=(e=n.length)!==null&&e!==void 0?e:O.length?M[0]+O[0].length:0;return new ht(d[n.topID],O.reverse(),M.reverse(),T)}const d1=new WeakMap;function rh(n,e){if(!n.isAnonymous||e instanceof Cs||e.type!=n)return 1;let t=d1.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof ht)){t=1;break}t+=rh(n,i)}d1.set(e,t)}return t}function wx(n,e,t,i,o,a,r,c,d){let f=0;for(let C=i;C<o;C++)f+=rh(n,e[C]);let g=Math.ceil(f*1.5/8),m=[],x=[];function v(C,k,w,D,O){for(let M=w;M<D;){let T=M,L=k[M],N=rh(n,C[M]);for(M++;M<D;M++){let I=rh(n,C[M]);if(N+I>=g)break;N+=I}if(M==T+1){if(N>g){let I=C[T];v(I.children,I.positions,0,I.children.length,k[T]+O);continue}m.push(C[T])}else{let I=k[M-1]+C[M-1].length-L;m.push(wx(n,C,k,T,M,L,I,null,d))}x.push(L+O-a)}}return v(e,t,i,o,0),(c||d)(m,x,r)}class ua{constructor(e,t,i,o,a=!1,r=!1){this.from=e,this.to=t,this.tree=i,this.offset=o,this.open=(a?1:0)|(r?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let o=[new ua(0,e.length,e,0,!1,i)];for(let a of t)a.to>e.length&&o.push(a);return o}static applyChanges(e,t,i=128){if(!t.length)return e;let o=[],a=1,r=e.length?e[0]:null;for(let c=0,d=0,f=0;;c++){let g=c<t.length?t[c]:null,m=g?g.fromA:1e9;if(m-d>=i)for(;r&&r.from<m;){let x=r;if(d>=x.from||m<=x.to||f){let v=Math.max(x.from,d)-f,C=Math.min(x.to,m)-f;x=v>=C?null:new ua(v,C,x.tree,x.offset+f,c>0,!!g)}if(x&&o.push(x),r.to>m)break;r=a<e.length?e[a++]:null}if(!g)break;d=g.toA,f=g.toA-g.toB}return o}}class Ax{startParse(e,t,i){return typeof e=="string"&&(e=new Zz(e)),i=i?i.length?i.map(o=>new Lm(o.from,o.to)):[new Lm(0,0)]:[new Lm(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let o=this.startParse(e,t,i);for(;;){let a=o.advance();if(a)return a}}}class Zz{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new _e({perNode:!0});let eF=0,vo=class Zy{constructor(e,t,i,o){this.name=e,this.set=t,this.base=i,this.modified=o,this.id=eF++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Zy&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let o=new Zy(i,[],null,[]);if(o.set.push(o),t)for(let a of t.set)o.set.push(a);return o}static defineModifier(e){let t=new Mh(e);return i=>i.modified.indexOf(t)>-1?i:Mh.get(i.base||i,i.modified.concat(t).sort((o,a)=>o.id-a.id))}},tF=0;class Mh{constructor(e){this.name=e,this.instances=[],this.id=tF++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(c=>c.base==e&&nF(t,c.modified));if(i)return i;let o=[],a=new vo(e.name,o,e,t);for(let c of t)c.instances.push(a);let r=iF(t);for(let c of e.set)if(!c.modified.length)for(let d of r)o.push(Mh.get(c,d));return a}}function nF(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function iF(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,o=e.length;i<o;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function Px(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let o of t.split(" "))if(o){let a=[],r=2,c=o;for(let m=0;;){if(c=="..."&&m>0&&m+3==o.length){r=1;break}let x=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!x)throw new RangeError("Invalid path: "+o);if(a.push(x[0]=="*"?"":x[0][0]=='"'?JSON.parse(x[0]):x[0]),m+=x[0].length,m==o.length)break;let v=o[m++];if(m==o.length&&v=="!"){r=0;break}if(v!="/")throw new RangeError("Invalid path: "+o);c=o.slice(m)}let d=a.length-1,f=a[d];if(!f)throw new RangeError("Invalid path: "+o);let g=new Ec(i,r,d>0?a.slice(0,d):null);e[f]=g.sort(e[f])}}return dT.add(e)}const dT=new _e({combine(n,e){let t,i,o;for(;n||e;){if(!n||e&&n.depth>=e.depth?(o=e,e=e.next):(o=n,n=n.next),t&&t.mode==o.mode&&!o.context&&!t.context)continue;let a=new Ec(o.tags,o.mode,o.context);t?t.next=a:i=a,t=a}return i}});class Ec{constructor(e,t,i,o){this.tags=e,this.mode=t,this.context=i,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ec.empty=new Ec([],2,null);function hT(n,e){let t=Object.create(null);for(let a of n)if(!Array.isArray(a.tag))t[a.tag.id]=a.class;else for(let r of a.tag)t[r.id]=a.class;let{scope:i,all:o=null}=e||{};return{style:a=>{let r=o;for(let c of a)for(let d of c.set){let f=t[d.id];if(f){r=r?r+" "+f:f;break}}return r},scope:i}}function oF(n,e){let t=null;for(let i of n){let o=i.style(e);o&&(t=t?t+" "+o:o)}return t}function sF(n,e,t,i=0,o=n.length){let a=new aF(i,Array.isArray(e)?e:[e],t);a.highlightRange(n.cursor(),i,o,"",a.highlighters),a.flush(o)}class aF{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,o,a){let{type:r,from:c,to:d}=e;if(c>=i||d<=t)return;r.isTop&&(a=this.highlighters.filter(v=>!v.scope||v.scope(r)));let f=o,g=rF(e)||Ec.empty,m=oF(a,g.tags);if(m&&(f&&(f+=" "),f+=m,g.mode==1&&(o+=(o?" ":"")+m)),this.startSpan(Math.max(t,c),f),g.opaque)return;let x=e.tree&&e.tree.prop(_e.mounted);if(x&&x.overlay){let v=e.node.enter(x.overlay[0].from+c,1),C=this.highlighters.filter(w=>!w.scope||w.scope(x.tree.type)),k=e.firstChild();for(let w=0,D=c;;w++){let O=w<x.overlay.length?x.overlay[w]:null,M=O?O.from+c:d,T=Math.max(t,D),L=Math.min(i,M);if(T<L&&k)for(;e.from<L&&(this.highlightRange(e,T,L,o,a),this.startSpan(Math.min(L,e.to),f),!(e.to>=M||!e.nextSibling())););if(!O||M>i)break;D=O.to+c,D>t&&(this.highlightRange(v.cursor(),Math.max(t,O.from+c),Math.min(i,D),"",C),this.startSpan(Math.min(i,D),f))}k&&e.parent()}else if(e.firstChild()){x&&(o="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,o,a),this.startSpan(Math.min(i,e.to),f)}while(e.nextSibling());e.parent()}}}function rF(n){let e=n.type.prop(dT);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const he=vo.define,Fd=he(),cs=he(),h1=he(cs),f1=he(cs),us=he(),qd=he(us),Rm=he(us),Ii=he(),Xs=he(Ii),Ri=he(),Ei=he(),eb=he(),Vl=he(eb),Gd=he(),E={comment:Fd,lineComment:he(Fd),blockComment:he(Fd),docComment:he(Fd),name:cs,variableName:he(cs),typeName:h1,tagName:he(h1),propertyName:f1,attributeName:he(f1),className:he(cs),labelName:he(cs),namespace:he(cs),macroName:he(cs),literal:us,string:qd,docString:he(qd),character:he(qd),attributeValue:he(qd),number:Rm,integer:he(Rm),float:he(Rm),bool:he(us),regexp:he(us),escape:he(us),color:he(us),url:he(us),keyword:Ri,self:he(Ri),null:he(Ri),atom:he(Ri),unit:he(Ri),modifier:he(Ri),operatorKeyword:he(Ri),controlKeyword:he(Ri),definitionKeyword:he(Ri),moduleKeyword:he(Ri),operator:Ei,derefOperator:he(Ei),arithmeticOperator:he(Ei),logicOperator:he(Ei),bitwiseOperator:he(Ei),compareOperator:he(Ei),updateOperator:he(Ei),definitionOperator:he(Ei),typeOperator:he(Ei),controlOperator:he(Ei),punctuation:eb,separator:he(eb),bracket:Vl,angleBracket:he(Vl),squareBracket:he(Vl),paren:he(Vl),brace:he(Vl),content:Ii,heading:Xs,heading1:he(Xs),heading2:he(Xs),heading3:he(Xs),heading4:he(Xs),heading5:he(Xs),heading6:he(Xs),contentSeparator:he(Ii),list:he(Ii),quote:he(Ii),emphasis:he(Ii),strong:he(Ii),link:he(Ii),monospace:he(Ii),strikethrough:he(Ii),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:Gd,documentMeta:he(Gd),annotation:he(Gd),processingInstruction:he(Gd),definition:vo.defineModifier("definition"),constant:vo.defineModifier("constant"),function:vo.defineModifier("function"),standard:vo.defineModifier("standard"),local:vo.defineModifier("local"),special:vo.defineModifier("special")};for(let n in E){let e=E[n];e instanceof vo&&(e.name=n)}hT([{tag:E.link,class:"tok-link"},{tag:E.heading,class:"tok-heading"},{tag:E.emphasis,class:"tok-emphasis"},{tag:E.strong,class:"tok-strong"},{tag:E.keyword,class:"tok-keyword"},{tag:E.atom,class:"tok-atom"},{tag:E.bool,class:"tok-bool"},{tag:E.url,class:"tok-url"},{tag:E.labelName,class:"tok-labelName"},{tag:E.inserted,class:"tok-inserted"},{tag:E.deleted,class:"tok-deleted"},{tag:E.literal,class:"tok-literal"},{tag:E.string,class:"tok-string"},{tag:E.number,class:"tok-number"},{tag:[E.regexp,E.escape,E.special(E.string)],class:"tok-string2"},{tag:E.variableName,class:"tok-variableName"},{tag:E.local(E.variableName),class:"tok-variableName tok-local"},{tag:E.definition(E.variableName),class:"tok-variableName tok-definition"},{tag:E.special(E.variableName),class:"tok-variableName2"},{tag:E.definition(E.propertyName),class:"tok-propertyName tok-definition"},{tag:E.typeName,class:"tok-typeName"},{tag:E.namespace,class:"tok-namespace"},{tag:E.className,class:"tok-className"},{tag:E.macroName,class:"tok-macroName"},{tag:E.propertyName,class:"tok-propertyName"},{tag:E.operator,class:"tok-operator"},{tag:E.comment,class:"tok-comment"},{tag:E.meta,class:"tok-meta"},{tag:E.invalid,class:"tok-invalid"},{tag:E.punctuation,class:"tok-punctuation"}]);var Em;const oa=new _e;function fT(n){return pe.define({combine:n?e=>e.concat(n):void 0})}const lF=new _e;class li{constructor(e,t,i=[],o=""){this.data=e,this.name=o,Qe.prototype.hasOwnProperty("tree")||Object.defineProperty(Qe.prototype,"tree",{get(){return dn(this)}}),this.parser=t,this.extension=[Ss.of(this),Qe.languageData.of((a,r,c)=>{let d=p1(a,r,c),f=d.type.prop(oa);if(!f)return[];let g=a.facet(f),m=d.type.prop(lF);if(m){let x=d.resolve(r-d.from,c);for(let v of m)if(v.test(x,a)){let C=a.facet(v.facet);return v.type=="replace"?C:C.concat(g)}}return g})].concat(i)}isActiveAt(e,t,i=-1){return p1(e,t,i).type.prop(oa)==this.data}findRegions(e){let t=e.facet(Ss);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],o=(a,r)=>{if(a.prop(oa)==this.data){i.push({from:r,to:r+a.length});return}let c=a.prop(_e.mounted);if(c){if(c.tree.prop(oa)==this.data){if(c.overlay)for(let d of c.overlay)i.push({from:d.from+r,to:d.to+r});else i.push({from:r,to:r+a.length});return}else if(c.overlay){let d=i.length;if(o(c.tree,c.overlay[0].from+r),i.length>d)return}}for(let d=0;d<a.children.length;d++){let f=a.children[d];f instanceof ht&&o(f,a.positions[d]+r)}};return o(dn(e),0),i}get allowsNesting(){return!0}}li.setState=Le.define();function p1(n,e,t){let i=n.facet(Ss),o=dn(n).topNode;if(!i||i.allowsNesting)for(let a=o;a;a=a.enter(e,t,Tt.ExcludeBuffers|Tt.EnterBracketed))a.type.isTop&&(o=a);return o}class Ic extends li{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=fT(e.languageData);return new Ic(t,e.parser.configure({props:[oa.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ic(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function dn(n){let e=n.field(li.state,!1);return e?e.tree:ht.empty}class cF{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Wl=null;class Ur{constructor(e,t,i=[],o,a,r,c,d){this.parser=e,this.state=t,this.fragments=i,this.tree=o,this.treeLen=a,this.viewport=r,this.skipped=c,this.scheduleOn=d,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ur(e,t,[],ht.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cF(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ht.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let o=Date.now()+e;e=()=>Date.now()>o}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let o=this.parse.advance();if(o)if(this.fragments=this.withoutTempSkipped(ua.addTree(o,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=o,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ua.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wl;Wl=this;try{return e()}finally{Wl=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=g1(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:o,treeLen:a,viewport:r,skipped:c}=this;if(this.takeTree(),!e.empty){let d=[];if(e.iterChangedRanges((f,g,m,x)=>d.push({fromA:f,toA:g,fromB:m,toB:x})),i=ua.applyChanges(i,d),o=ht.empty,a=0,r={from:e.mapPos(r.from,-1),to:e.mapPos(r.to,1)},this.skipped.length){c=[];for(let f of this.skipped){let g=e.mapPos(f.from,1),m=e.mapPos(f.to,-1);g<m&&c.push({from:g,to:m})}}}return new Ur(this.parser,t,i,o,a,r,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:o,to:a}=this.skipped[i];o<e.to&&a>e.from&&(this.fragments=g1(this.fragments,o,a),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ax{createParse(t,i,o){let a=o[0].from,r=o[o.length-1].to;return{parsedPos:a,advance(){let d=Wl;if(d){for(let f of o)d.tempSkipped.push(f);e&&(d.scheduleOn=d.scheduleOn?Promise.all([d.scheduleOn,e]):e)}return this.parsedPos=r,new ht(Cn.none,[],[],r-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Wl}}function g1(n,e,t){return ua.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class zr{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new zr(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ur.create(e.facet(Ss).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new zr(i)}}li.state=hn.define({create:zr.init,update(n,e){for(let t of e.effects)if(t.is(li.setState))return t.value;return e.startState.facet(Ss)!=e.state.facet(Ss)?zr.init(e.state):n.apply(e)}});let pT=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(pT=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Im=typeof navigator<"u"&&(!((Em=navigator.scheduling)===null||Em===void 0)&&Em.isInputPending)?()=>navigator.scheduling.isInputPending():null,uF=At.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(li.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(li.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=pT(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:o}}=this.view,a=i.field(li.state);if(a.tree==a.context.tree&&a.context.isDone(o+1e5))return;let r=Date.now()+Math.min(this.chunkBudget,100,e&&!Im?Math.max(25,e.timeRemaining()-5):1e9),c=a.context.treeLen<o&&i.doc.length>o+1e3,d=a.context.work(()=>Im&&Im()||Date.now()>r,o+(c?0:1e5));this.chunkBudget-=Date.now()-t,(d||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:li.setState.of(new zr(a.context))})),this.chunkBudget>0&&!(d&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>En(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ss=pe.define({combine(n){return n.length?n[0]:null},enables:n=>[li.state,uF,ue.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class gT{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const dF=pe.define(),xf=pe.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function xa(n){let e=n.facet(xf);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function jc(n,e){let t="",i=n.tabSize,o=n.facet(xf)[0];if(o==" "){for(;e>=i;)t+=" ",e-=i;o=" "}for(let a=0;a<e;a++)t+=o;return t}function Dx(n,e){n instanceof Qe&&(n=new vf(n));for(let i of n.state.facet(dF)){let o=i(n,e);if(o!==void 0)return o}let t=dn(n.state);return t.length>=e?hF(n,t,e):null}class vf{constructor(e,t={}){this.state=e,this.options=t,this.unit=xa(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:a}=this.options;return o!=null&&o>=i.from&&o<=i.to?a&&o==e?{text:"",from:e}:(t<0?o<e:o<=e)?{text:i.text.slice(o-i.from),from:o}:{text:i.text.slice(0,o-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:o}=this.lineAt(e,t);return i.slice(e-o,Math.min(i.length,e+100-o))}column(e,t=1){let{text:i,from:o}=this.lineAt(e,t),a=this.countColumn(i,e-o),r=this.options.overrideIndentation?this.options.overrideIndentation(o):-1;return r>-1&&(a+=r-this.countColumn(i,i.search(/\S|$/))),a}countColumn(e,t=e.length){return Vr(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:o}=this.lineAt(e,t),a=this.options.overrideIndentation;if(a){let r=a(o);if(r>-1)return r}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Cf=new _e;function hF(n,e,t){let i=e.resolveStack(t),o=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(o!=i.node){let a=[];for(let r=o;r&&!(r.from<i.node.from||r.to>i.node.to||r.from==i.node.from&&r.type==i.node.type);r=r.parent)a.push(r);for(let r=a.length-1;r>=0;r--)i={node:a[r],next:i}}return mT(i,n,t)}function mT(n,e,t){for(let i=n;i;i=i.next){let o=pF(i.node);if(o)return o(Ox.create(e,t,i))}return 0}function fF(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function pF(n){let e=n.type.prop(Cf);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(_e.closedBy))){let o=n.lastChild,a=o&&i.indexOf(o.name)>-1;return r=>yT(r,!0,1,void 0,a&&!fF(r)?o.from:void 0)}return n.parent==null?gF:null}function gF(){return 0}class Ox extends vf{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Ox(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(mF(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return mT(this.context.next,this.base,this.pos)}}function mF(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function yF(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let o=n.options.simulateBreak,a=n.state.doc.lineAt(t.from),r=o==null||o<=a.from?a.to:Math.min(a.to,o);for(let c=t.to;;){let d=e.childAfter(c);if(!d||d==i)return null;if(!d.type.isSkipped){if(d.from>=r)return null;let f=/^ */.exec(a.text.slice(t.to-a.from))[0].length;return{from:t.from,to:t.to+f}}c=d.to}}function m1({closing:n,align:e=!0,units:t=1}){return i=>yT(i,e,t,n)}function yT(n,e,t,i,o){let a=n.textAfter,r=a.match(/^\s*/)[0].length,c=i&&a.slice(r,r+i.length)==i||o==n.pos+r,d=e?yF(n):null;return d?c?n.column(d.from):n.column(d.to):n.baseIndent+(c?0:n.unit*t)}function y1({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const bF=200;function xF(){return Qe.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,o=t.lineAt(i);if(i>o.from+bF)return n;let a=t.sliceString(o.from,i);if(!e.some(f=>f.test(a)))return n;let{state:r}=n,c=-1,d=[];for(let{head:f}of r.selection.ranges){let g=r.doc.lineAt(f);if(g.from==c)continue;c=g.from;let m=Dx(r,g.from);if(m==null)continue;let x=/^\s*/.exec(g.text)[0],v=jc(r,m);x!=v&&d.push({from:g.from,to:g.from+x.length,insert:v})}return d.length?[n,{changes:d,sequential:!0}]:n})}const vF=pe.define(),Tx=new _e;function bT(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function CF(n,e,t){let i=dn(n);if(i.length<t)return null;let o=i.resolveStack(t,1),a=null;for(let r=o;r;r=r.next){let c=r.node;if(c.to<=t||c.from>t)continue;if(a&&c.from<e)break;let d=c.type.prop(Tx);if(d&&(c.to<i.length-50||i.length==n.doc.length||!SF(c))){let f=d(c,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(a=f)}}return a}function SF(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Nh(n,e,t){for(let i of n.facet(vF)){let o=i(n,e,t);if(o)return o}return CF(n,e,t)}function xT(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Sf=Le.define({map:xT}),Zc=Le.define({map:xT});function vT(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const va=hn.define({create(){return Pe.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=b1(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Sf)&&!kF(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(kT),o=i?Pe.replace({widget:new MF(i(e.state,t.value))}):x1;n=n.update({add:[o.range(t.value.from,t.value.to)]})}else t.is(Zc)&&(n=n.update({filter:(i,o)=>t.value.from!=i||t.value.to!=o,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=b1(n,e.selection.main.head)),n},provide:n=>ue.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,o)=>{t.push(i,o)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],o=n[t++];if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid JSON for fold state");e.push(x1.range(i,o))}return Pe.set(e,!0)}});function b1(n,e,t=e){let i=!1;return n.between(e,t,(o,a)=>{o<t&&a>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(o,a)=>o>=t||a<=e}):n}function Lh(n,e,t){var i;let o=null;return(i=n.field(va,!1))===null||i===void 0||i.between(e,t,(a,r)=>{(!o||o.from>a)&&(o={from:a,to:r})}),o}function kF(n,e,t){let i=!1;return n.between(e,e,(o,a)=>{o==e&&a==t&&(i=!0)}),i}function CT(n,e){return n.field(va,!1)?e:e.concat(Le.appendConfig.of(wT()))}const wF=n=>{for(let e of vT(n)){let t=Nh(n.state,e.from,e.to);if(t)return n.dispatch({effects:CT(n.state,[Sf.of(t),ST(n,t)])}),!0}return!1},AF=n=>{if(!n.state.field(va,!1))return!1;let e=[];for(let t of vT(n)){let i=Lh(n.state,t.from,t.to);i&&e.push(Zc.of(i),ST(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ST(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,o=n.state.doc.lineAt(e.to).number;return ue.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${o}.`)}const PF=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let o=n.lineBlockAt(i),a=Nh(e,o.from,o.to);a&&t.push(Sf.of(a)),i=(a?n.lineBlockAt(a.to):o).to+1}return t.length&&n.dispatch({effects:CT(n.state,t)}),!!t.length},DF=n=>{let e=n.state.field(va,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,o)=>{t.push(Zc.of({from:i,to:o}))}),n.dispatch({effects:t}),!0},OF=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:wF},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:AF},{key:"Ctrl-Alt-[",run:PF},{key:"Ctrl-Alt-]",run:DF}],TF={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},kT=pe.define({combine(n){return Xi(n,TF)}});function wT(n){return[va,RF]}function AT(n,e){let{state:t}=n,i=t.facet(kT),o=r=>{let c=n.lineBlockAt(n.posAtDOM(r.target)),d=Lh(n.state,c.from,c.to);d&&n.dispatch({effects:Zc.of(d)}),r.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,o,e);let a=document.createElement("span");return a.textContent=i.placeholderText,a.setAttribute("aria-label",t.phrase("folded code")),a.title=t.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=o,a}const x1=Pe.replace({widget:new class extends Ji{toDOM(n){return AT(n,null)}}});class MF extends Ji{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return AT(e,this.value)}}const NF={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class jm extends Ro{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function LF(n={}){let e={...NF,...n},t=new jm(e,!0),i=new jm(e,!1),o=At.fromClass(class{constructor(r){this.from=r.viewport.from,this.markers=this.buildMarkers(r)}update(r){(r.docChanged||r.viewportChanged||r.startState.facet(Ss)!=r.state.facet(Ss)||r.startState.field(va,!1)!=r.state.field(va,!1)||dn(r.startState)!=dn(r.state)||e.foldingChanged(r))&&(this.markers=this.buildMarkers(r.view))}buildMarkers(r){let c=new Yi;for(let d of r.viewportLineBlocks){let f=Lh(r.state,d.from,d.to)?i:Nh(r.state,d.from,d.to)?t:null;f&&c.add(d.from,d.from,f)}return c.finish()}}),{domEventHandlers:a}=e;return[o,jz({class:"cm-foldGutter",markers(r){var c;return((c=r.plugin(o))===null||c===void 0?void 0:c.markers)||qe.empty},initialSpacer(){return new jm(e,!1)},domEventHandlers:{...a,click:(r,c,d)=>{if(a.click&&a.click(r,c,d))return!0;let f=Lh(r.state,c.from,c.to);if(f)return r.dispatch({effects:Zc.of(f)}),!0;let g=Nh(r.state,c.from,c.to);return g?(r.dispatch({effects:Sf.of(g)}),!0):!1}}}),wT()]}const RF=ue.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Wr{constructor(e,t){this.specs=e;let i;function o(c){let d=bs.newName();return(i||(i=Object.create(null)))["."+d]=c,d}const a=typeof t.all=="string"?t.all:t.all?o(t.all):void 0,r=t.scope;this.scope=r instanceof li?c=>c.prop(oa)==r.data:r?c=>c==r:void 0,this.style=hT(e.map(c=>({tag:c.tag,class:c.class||o(Object.assign({},c,{tag:null}))})),{all:a}).style,this.module=i?new bs(i):null,this.themeType=t.themeType}static define(e,t){return new Wr(e,t||{})}}const tb=pe.define(),PT=pe.define({combine(n){return n.length?[n[0]]:null}});function Bm(n){let e=n.facet(tb);return e.length?e:n.facet(PT)}function Mx(n,e){let t=[IF],i;return n instanceof Wr&&(n.module&&t.push(ue.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(PT.of(n)):i?t.push(tb.computeN([ue.darkTheme],o=>o.facet(ue.darkTheme)==(i=="dark")?[n]:[])):t.push(tb.of(n)),t}class EF{constructor(e){this.markCache=Object.create(null),this.tree=dn(e.state),this.decorations=this.buildDeco(e,Bm(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=dn(e.state),i=Bm(e.state),o=i!=Bm(e.startState),{viewport:a}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<a.to&&!o&&t.type==this.tree.type&&r>=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged||o)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=a.to)}buildDeco(e,t){if(!t||!this.tree.length)return Pe.none;let i=new Yi;for(let{from:o,to:a}of e.visibleRanges)sF(this.tree,t,(r,c,d)=>{i.add(r,c,this.markCache[d]||(this.markCache[d]=Pe.mark({class:d})))},o,a);return i.finish()}}const IF=Sa.high(At.fromClass(EF,{decorations:n=>n.decorations})),jF=Wr.define([{tag:E.meta,color:"#404740"},{tag:E.link,textDecoration:"underline"},{tag:E.heading,textDecoration:"underline",fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.keyword,color:"#708"},{tag:[E.atom,E.bool,E.url,E.contentSeparator,E.labelName],color:"#219"},{tag:[E.literal,E.inserted],color:"#164"},{tag:[E.string,E.deleted],color:"#a11"},{tag:[E.regexp,E.escape,E.special(E.string)],color:"#e40"},{tag:E.definition(E.variableName),color:"#00f"},{tag:E.local(E.variableName),color:"#30a"},{tag:[E.typeName,E.namespace],color:"#085"},{tag:E.className,color:"#167"},{tag:[E.special(E.variableName),E.macroName],color:"#256"},{tag:E.definition(E.propertyName),color:"#00c"},{tag:E.comment,color:"#940"},{tag:E.invalid,color:"#f00"}]),BF=ue.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DT=1e4,OT="()[]{}",TT=pe.define({combine(n){return Xi(n,{afterCursor:!0,brackets:OT,maxScanDistance:DT,renderMatch:UF})}}),HF=Pe.mark({class:"cm-matchingBracket"}),_F=Pe.mark({class:"cm-nonmatchingBracket"});function UF(n){let e=[],t=n.matched?HF:_F;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function v1(n){let e=[],t=n.facet(TT);for(let i of n.selection.ranges){if(!i.empty)continue;let o=qi(n,i.head,-1,t)||i.head>0&&qi(n,i.head-1,1,t)||t.afterCursor&&(qi(n,i.head,1,t)||i.head<n.doc.length&&qi(n,i.head+1,-1,t));o&&(e=e.concat(t.renderMatch(o,n)))}return Pe.set(e,!0)}const zF=At.fromClass(class{constructor(n){this.paused=!1,this.decorations=v1(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=v1(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),FF=[zF,BF];function qF(n={}){return[TT.of(n),FF]}const GF=new _e;function nb(n,e,t){let i=n.prop(e<0?_e.openedBy:_e.closedBy);if(i)return i;if(n.name.length==1){let o=t.indexOf(n.name);if(o>-1&&o%2==(e<0?1:0))return[t[o+e]]}return null}function ib(n){let e=n.type.prop(GF);return e?e(n.node):n}function qi(n,e,t,i={}){let o=i.maxScanDistance||DT,a=i.brackets||OT,r=dn(n),c=r.resolveInner(e,t);for(let d=c;d;d=d.parent){let f=nb(d.type,t,a);if(f&&d.from<d.to){let g=ib(d);if(g&&(t>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return KF(n,e,t,d,g,f,a)}}return VF(n,e,t,r,c.type,o,a)}function KF(n,e,t,i,o,a,r){let c=i.parent,d={from:o.from,to:o.to},f=0,g=c?.cursor();if(g&&(t<0?g.childBefore(i.from):g.childAfter(i.to)))do if(t<0?g.to<=i.from:g.from>=i.to){if(f==0&&a.indexOf(g.type.name)>-1&&g.from<g.to){let m=ib(g);return{start:d,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(nb(g.type,t,r))f++;else if(nb(g.type,-t,r)){if(f==0){let m=ib(g);return{start:d,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}f--}}while(t<0?g.prevSibling():g.nextSibling());return{start:d,matched:!1}}function VF(n,e,t,i,o,a,r){if(t<0?!e:e==n.doc.length)return null;let c=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),d=r.indexOf(c);if(d<0||d%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},g=n.doc.iterRange(e,t>0?n.doc.length:0),m=0;for(let x=0;!g.next().done&&x<=a;){let v=g.value;t<0&&(x+=v.length);let C=e+x*t;for(let k=t>0?0:v.length-1,w=t>0?v.length:-1;k!=w;k+=t){let D=r.indexOf(v[k]);if(!(D<0||i.resolveInner(C+k,1).type!=o))if(D%2==0==t>0)m++;else{if(m==1)return{start:f,end:{from:C+k,to:C+k+1},matched:D>>1==d>>1};m--}}t>0&&(x+=v.length)}return g.done?{start:f,matched:!1}:null}function C1(n,e,t,i=0,o=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let a=o;for(let r=i;r<e;r++)n.charCodeAt(r)==9?a+=t-a%t:a++;return a}class MT{constructor(e,t,i,o){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=o,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=C1(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:C1(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let o=r=>i?r.toLowerCase():r,a=this.string.substr(this.pos,e.length);return o(a)==o(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}}current(){return this.string.slice(this.start,this.pos)}}function WF(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||QF,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Rx,mergeTokens:n.mergeTokens!==!1}}function QF(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const S1=new WeakMap;class Nx extends li{constructor(e){let t=fT(e.languageData),i=WF(e),o,a=new class extends Ax{createParse(r,c,d){return new $F(o,r,c,d)}};super(t,a,[],e.name),this.topNode=ZF(t,this),o=this,this.streamParser=i,this.stateAfter=new _e({perNode:!0}),this.tokenTable=e.tokenTable?new ET(i.tokenTable):JF}static define(e){return new Nx(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=S1.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let o=Lx(this,e.node.tree,e.node.from,e.node.from,t??e.pos),a,r;if(o?(r=o.state,a=o.pos+1):(r=this.streamParser.startState(e.unit),a=e.node.from),e.pos-a>1e4)return null;for(;a<e.pos;){let d=e.state.doc.lineAt(a),f=Math.min(e.pos,d.to);if(d.length){let g=i?i(d.from):-1,m=new MT(d.text,e.state.tabSize,e.unit,g<0?void 0:g);for(;m.pos<f-d.from;)LT(this.streamParser.token,m,r)}else this.streamParser.blankLine(r,e.unit);if(f==e.pos)break;a=d.to+1}let c=e.lineAt(e.pos);return i&&t==null&&S1.set(e.state,c.from),this.streamParser.indent(r,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function Lx(n,e,t,i,o){let a=t>=i&&t+e.length<=o&&e.prop(n.stateAfter);if(a)return{state:n.streamParser.copyState(a),pos:t+e.length};for(let r=e.children.length-1;r>=0;r--){let c=e.children[r],d=t+e.positions[r],f=c instanceof ht&&d<o&&Lx(n,c,d,i,o);if(f)return f}return null}function NT(n,e,t,i,o){if(o&&t<=0&&i>=e.length)return e;!o&&t==0&&e.type==n.topNode&&(o=!0);for(let a=e.children.length-1;a>=0;a--){let r=e.positions[a],c=e.children[a],d;if(r<i&&c instanceof ht){if(!(d=NT(n,c,t-r,i-r,o)))break;return o?new ht(e.type,e.children.slice(0,a).concat(d),e.positions.slice(0,a+1),r+d.length):d}}return null}function YF(n,e,t,i,o){for(let a of e){let r=a.from+(a.openStart?25:0),c=a.to-(a.openEnd?25:0),d=r<=t&&c>t&&Lx(n,a.tree,0-a.offset,t,c),f;if(d&&d.pos<=i&&(f=NT(n,a.tree,t+a.offset,d.pos+a.offset,!1)))return{state:d.state,tree:f}}return{state:n.streamParser.startState(o?xa(o):4),tree:ht.empty}}let $F=class{constructor(e,t,i,o){this.lang=e,this.input=t,this.fragments=i,this.ranges=o,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=o[o.length-1].to;let a=Ur.get(),r=o[0].from,{state:c,tree:d}=YF(e,i,r,this.to,a?.state);this.state=c,this.parsedPos=this.chunkStart=r+d.length;for(let f=0;f<d.children.length;f++)this.chunks.push(d.children[f]),this.chunkPos.push(d.positions[f]);a&&this.parsedPos<a.viewport.from-1e5&&o.some(f=>f.from<=a.viewport.from&&f.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(xa(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=Ur.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
28
+ `&&(t="");else{let i=t.indexOf(`
29
+ `);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let o=this.rangeIndex;;){let a=this.ranges[o].to;if(a>=i||(t=t.slice(0,a-(i-t.length)),o++,o==this.ranges.length))break;let r=this.ranges[o].from,c=this.lineAfter(r);t+=c,i=r+c.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let o=this.ranges[this.rangeIndex].to,a=e+t;if(i>0?o>a:o>=a)break;let r=this.ranges[++this.rangeIndex].from;t+=r-o}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,o){let a=4;if(this.ranges.length>1){o=this.skipGapsTo(t,o,1),t+=o;let c=this.chunk.length;o=this.skipGapsTo(i,o,-1),i+=o,a+=this.chunk.length-c}let r=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&r>=0&&this.chunk[r]==e&&this.chunk[r+2]==t?this.chunk[r+2]=i:this.chunk.push(e,t,i,a),o}parseLine(e){let{line:t,end:i}=this.nextLine(),o=0,{streamParser:a}=this.lang,r=new MT(t,e?e.state.tabSize:4,e?xa(e.state):2);if(r.eol())a.blankLine(this.state,r.indentUnit);else for(;!r.eol();){let c=LT(a.token,r,this.state);if(c&&(o=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+r.start,this.parsedPos+r.pos,o)),r.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=ht.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:XF,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new ht(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new ht(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function LT(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let o=n(e,t);if(e.pos>e.start)return o}throw new Error("Stream parser failed to advance stream.")}const Rx=Object.create(null),Bc=[Cn.none],XF=new bf(Bc),k1=[],w1=Object.create(null),RT=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])RT[n]=IT(Rx,e);class ET{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),RT)}resolve(e){return e?this.table[e]||(this.table[e]=IT(this.extra,e)):0}}const JF=new ET(Rx);function Hm(n,e){k1.indexOf(n)>-1||(k1.push(n),console.warn(e))}function IT(n,e){let t=[];for(let c of e.split(" ")){let d=[];for(let f of c.split(".")){let g=n[f]||E[f];g?typeof g=="function"?d.length?d=d.map(g):Hm(f,`Modifier ${f} used at start of tag`):d.length?Hm(f,`Tag ${f} used as modifier`):d=Array.isArray(g)?g:[g]:Hm(f,`Unknown highlighting tag ${f}`)}for(let f of d)t.push(f)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),o=i+" "+t.map(c=>c.id),a=w1[o];if(a)return a.id;let r=w1[o]=Cn.define({id:Bc.length,name:i,props:[Px({[i]:t})]});return Bc.push(r),r.id}function ZF(n,e){let t=Cn.define({id:Bc.length,name:"Document",props:[oa.add(()=>n),Cf.add(()=>i=>e.getIndent(i))],top:!0});return Bc.push(t),t}yt.RTL,yt.LTR;const eq=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Ix(n.state,t.from);return i.line?tq(n):i.block?iq(n):!1};function Ex(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let o=n(e,t);return o?(i(t.update(o)),!0):!1}}const tq=Ex(aq,0),nq=Ex(jT,0),iq=Ex((n,e)=>jT(n,e,sq(e)),0);function Ix(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ql=50;function oq(n,{open:e,close:t},i,o){let a=n.sliceDoc(i-Ql,i),r=n.sliceDoc(o,o+Ql),c=/\s*$/.exec(a)[0].length,d=/^\s*/.exec(r)[0].length,f=a.length-c;if(a.slice(f-e.length,f)==e&&r.slice(d,d+t.length)==t)return{open:{pos:i-c,margin:c&&1},close:{pos:o+d,margin:d&&1}};let g,m;o-i<=2*Ql?g=m=n.sliceDoc(i,o):(g=n.sliceDoc(i,i+Ql),m=n.sliceDoc(o-Ql,o));let x=/^\s*/.exec(g)[0].length,v=/\s*$/.exec(m)[0].length,C=m.length-v-t.length;return g.slice(x,x+e.length)==e&&m.slice(C,C+t.length)==t?{open:{pos:i+x+e.length,margin:/\s/.test(g.charAt(x+e.length))?1:0},close:{pos:o-v-t.length,margin:/\s/.test(m.charAt(C-1))?1:0}}:null}function sq(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),o=t.to<=i.to?i:n.doc.lineAt(t.to);o.from>i.from&&o.from==t.to&&(o=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let a=e.length-1;a>=0&&e[a].to>i.from?e[a].to=o.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:o.to})}return e}function jT(n,e,t=e.selection.ranges){let i=t.map(a=>Ix(e,a.from).block);if(!i.every(a=>a))return null;let o=t.map((a,r)=>oq(e,i[r],a.from,a.to));if(n!=2&&!o.every(a=>a))return{changes:e.changes(t.map((a,r)=>o[r]?[]:[{from:a.from,insert:i[r].open+" "},{from:a.to,insert:" "+i[r].close}]))};if(n!=1&&o.some(a=>a)){let a=[];for(let r=0,c;r<o.length;r++)if(c=o[r]){let d=i[r],{open:f,close:g}=c;a.push({from:f.pos-d.open.length,to:f.pos+f.margin},{from:g.pos-g.margin,to:g.pos+d.close.length})}return{changes:a}}return null}function aq(n,e,t=e.selection.ranges){let i=[],o=-1;e:for(let{from:a,to:r}of t){let c=i.length,d=1e9,f;for(let g=a;g<=r;){let m=e.doc.lineAt(g);if(f==null&&(f=Ix(e,m.from).line,!f))continue e;if(m.from>o&&(a==r||r>m.from)){o=m.from;let x=/^\s*/.exec(m.text)[0].length,v=x==m.length,C=m.text.slice(x,x+f.length)==f?x:-1;x<m.text.length&&x<d&&(d=x),i.push({line:m,comment:C,token:f,indent:x,empty:v,single:!1})}g=m.to+1}if(d<1e9)for(let g=c;g<i.length;g++)i[g].indent<i[g].line.text.length&&(i[g].indent=d);i.length==c+1&&(i[c].single=!0)}if(n!=2&&i.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:c,token:d,indent:f,empty:g,single:m}of i)(m||!g)&&a.push({from:c.from+f,insert:d+" "});let r=e.changes(a);return{changes:r,selection:e.selection.map(r,1)}}else if(n!=1&&i.some(a=>a.comment>=0)){let a=[];for(let{line:r,comment:c,token:d}of i)if(c>=0){let f=r.from+c,g=f+d.length;r.text[g-r.from]==" "&&g++,a.push({from:f,to:g})}return{changes:a}}return null}const ob=$i.define(),rq=$i.define(),lq=pe.define(),BT=pe.define({combine(n){return Xi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,o)=>e(i,o)||t(i,o)})}}),HT=hn.define({create(){return Gi.empty},update(n,e){let t=e.state.facet(BT),i=e.annotation(ob);if(i){let d=In.fromTransaction(e,i.selection),f=i.side,g=f==0?n.undone:n.done;return d?g=Rh(g,g.length,t.minDepth,d):g=zT(g,e.startState.selection),new Gi(f==0?i.rest:g,f==0?g:i.rest)}let o=e.annotation(rq);if((o=="full"||o=="before")&&(n=n.isolate()),e.annotation(Gt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let a=In.fromTransaction(e),r=e.annotation(Gt.time),c=e.annotation(Gt.userEvent);return a?n=n.addChanges(a,r,c,t,e):e.selection&&(n=n.addSelection(e.startState.selection,r,c,t.newGroupDelay)),(o=="full"||o=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Gi(n.done.map(In.fromJSON),n.undone.map(In.fromJSON))}});function cq(n={}){return[HT,BT.of(n),ue.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?_T:e.inputType=="historyRedo"?sb:null;return i?(e.preventDefault(),i(t)):!1}})]}function kf(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let o=t.field(HT,!1);if(!o)return!1;let a=o.pop(n,t,e);return a?(i(a),!0):!1}}const _T=kf(0,!1),sb=kf(1,!1),uq=kf(0,!0),dq=kf(1,!0);class In{constructor(e,t,i,o,a){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=o,this.selectionsAfter=a}setSelAfter(e){return new In(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new In(e.changes&&qt.fromJSON(e.changes),[],e.mapped&&Wi.fromJSON(e.mapped),e.startSelection&&J.fromJSON(e.startSelection),e.selectionsAfter.map(J.fromJSON))}static fromTransaction(e,t){let i=ci;for(let o of e.startState.facet(lq)){let a=o(e);a.length&&(i=i.concat(a))}return!i.length&&e.changes.empty?null:new In(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ci)}static selection(e){return new In(void 0,ci,void 0,void 0,e)}}function Rh(n,e,t,i){let o=e+1>t+20?e-t-1:0,a=n.slice(o,e);return a.push(i),a}function hq(n,e){let t=[],i=!1;return n.iterChangedRanges((o,a)=>t.push(o,a)),e.iterChangedRanges((o,a,r,c)=>{for(let d=0;d<t.length;){let f=t[d++],g=t[d++];c>=f&&r<=g&&(i=!0)}}),i}function fq(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function UT(n,e){return n.length?e.length?n.concat(e):n:e}const ci=[],pq=200;function zT(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-pq));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Rh(n,n.length-1,1e9,t.setSelAfter(i)))}else return[In.selection([e])]}function gq(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function _m(n,e){if(!n.length)return n;let t=n.length,i=ci;for(;t;){let o=mq(n[t-1],e,i);if(o.changes&&!o.changes.empty||o.effects.length){let a=n.slice(0,t);return a[t-1]=o,a}else e=o.mapped,t--,i=o.selectionsAfter}return i.length?[In.selection(i)]:ci}function mq(n,e,t){let i=UT(n.selectionsAfter.length?n.selectionsAfter.map(c=>c.map(e)):ci,t);if(!n.changes)return In.selection(i);let o=n.changes.map(e),a=e.mapDesc(n.changes,!0),r=n.mapped?n.mapped.composeDesc(a):a;return new In(o,Le.mapEffects(n.effects,e),r,n.startSelection.map(a),i)}const yq=/^(input\.type|delete)($|\.)/;class Gi{constructor(e,t,i=0,o=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=o}isolate(){return this.prevTime?new Gi(this.done,this.undone):this}addChanges(e,t,i,o,a){let r=this.done,c=r[r.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||yq.test(i))&&(!c.selectionsAfter.length&&t-this.prevTime<o.newGroupDelay&&o.joinToEvent(a,hq(c.changes,e.changes))||i=="input.type.compose")?r=Rh(r,r.length-1,o.minDepth,new In(e.changes.compose(c.changes),UT(Le.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,ci)):r=Rh(r,r.length,o.minDepth,e),new Gi(r,ci,t,i)}addSelection(e,t,i,o){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ci;return a.length>0&&t-this.prevTime<o&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&fq(a[a.length-1],e)?this:new Gi(zT(this.done,e),this.undone,t,i)}addMapping(e){return new Gi(_m(this.done,e),_m(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let o=e==0?this.done:this.undone;if(o.length==0)return null;let a=o[o.length-1],r=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):t.selection);if(i&&a.selectionsAfter.length)return t.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:ob.of({side:e,rest:gq(o),selection:r}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let c=o.length==1?ci:o.slice(0,o.length-1);return a.mapped&&(c=_m(c,a.mapped)),t.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:ob.of({side:e,rest:c,selection:r}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Gi.empty=new Gi(ci,ci);const bq=[{key:"Mod-z",run:_T,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:sb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:sb,preventDefault:!0},{key:"Mod-u",run:uq,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:dq,preventDefault:!0}];function Qr(n,e){return J.create(n.ranges.map(e),n.mainIndex)}function Ai(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Pi({state:n,dispatch:e},t){let i=Qr(n.selection,t);return i.eq(n.selection,!0)?!1:(e(Ai(n,i)),!0)}function wf(n,e){return J.cursor(e?n.to:n.from)}function FT(n,e){return Pi(n,t=>t.empty?n.moveByChar(t,e):wf(t,e))}function fn(n){return n.textDirectionAt(n.state.selection.main.head)==yt.LTR}const qT=n=>FT(n,!fn(n)),GT=n=>FT(n,fn(n));function KT(n,e){return Pi(n,t=>t.empty?n.moveByGroup(t,e):wf(t,e))}const xq=n=>KT(n,!fn(n)),vq=n=>KT(n,fn(n));function Cq(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Af(n,e,t){let i=dn(n).resolveInner(e.head),o=t?_e.closedBy:_e.openedBy;for(let d=e.head;;){let f=t?i.childAfter(d):i.childBefore(d);if(!f)break;Cq(n,f,o)?i=f:d=t?f.to:f.from}let a=i.type.prop(o),r,c;return a&&(r=t?qi(n,i.from,1):qi(n,i.to,-1))&&r.matched?c=t?r.end.to:r.end.from:c=t?i.to:i.from,J.cursor(c,t?-1:1)}const Sq=n=>Pi(n,e=>Af(n.state,e,!fn(n))),kq=n=>Pi(n,e=>Af(n.state,e,fn(n)));function VT(n,e){return Pi(n,t=>{if(!t.empty)return wf(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const WT=n=>VT(n,!1),QT=n=>VT(n,!0);function YT(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,o;if(e){for(let a of n.state.facet(ue.scrollMargins)){let r=a(n);r?.top&&(t=Math.max(r?.top,t)),r?.bottom&&(i=Math.max(r?.bottom,i))}o=n.scrollDOM.clientHeight-t-i}else o=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,o-5)}}function $T(n,e){let t=YT(n),{state:i}=n,o=Qr(i.selection,r=>r.empty?n.moveVertically(r,e,t.height):wf(r,e));if(o.eq(i.selection))return!1;let a;if(t.selfScroll){let r=n.coordsAtPos(i.selection.main.head),c=n.scrollDOM.getBoundingClientRect(),d=c.top+t.marginTop,f=c.bottom-t.marginBottom;r&&r.top>d&&r.bottom<f&&(a=ue.scrollIntoView(o.main.head,{y:"start",yMargin:r.top-d}))}return n.dispatch(Ai(i,o),{effects:a}),!0}const A1=n=>$T(n,!1),ab=n=>$T(n,!0);function ws(n,e,t){let i=n.lineBlockAt(e.head),o=n.moveToLineBoundary(e,t);if(o.head==e.head&&o.head!=(t?i.to:i.from)&&(o=n.moveToLineBoundary(e,t,!1)),!t&&o.head==i.from&&i.length){let a=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=J.cursor(i.from+a))}return o}const wq=n=>Pi(n,e=>ws(n,e,!0)),Aq=n=>Pi(n,e=>ws(n,e,!1)),Pq=n=>Pi(n,e=>ws(n,e,!fn(n))),Dq=n=>Pi(n,e=>ws(n,e,fn(n))),Oq=n=>Pi(n,e=>J.cursor(n.lineBlockAt(e.head).from,1)),Tq=n=>Pi(n,e=>J.cursor(n.lineBlockAt(e.head).to,-1));function Mq(n,e,t){let i=!1,o=Qr(n.selection,a=>{let r=qi(n,a.head,-1)||qi(n,a.head,1)||a.head>0&&qi(n,a.head-1,1)||a.head<n.doc.length&&qi(n,a.head+1,-1);if(!r||!r.end)return a;i=!0;let c=r.start.from==a.head?r.end.to:r.end.from;return J.cursor(c)});return i?(e(Ai(n,o)),!0):!1}const Nq=({state:n,dispatch:e})=>Mq(n,e);function pi(n,e){let t=Qr(n.state.selection,i=>{let o=e(i);return J.range(i.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(Ai(n.state,t)),!0)}function XT(n,e){return pi(n,t=>n.moveByChar(t,e))}const JT=n=>XT(n,!fn(n)),ZT=n=>XT(n,fn(n));function eM(n,e){return pi(n,t=>n.moveByGroup(t,e))}const Lq=n=>eM(n,!fn(n)),Rq=n=>eM(n,fn(n)),Eq=n=>pi(n,e=>Af(n.state,e,!fn(n))),Iq=n=>pi(n,e=>Af(n.state,e,fn(n)));function tM(n,e){return pi(n,t=>n.moveVertically(t,e))}const nM=n=>tM(n,!1),iM=n=>tM(n,!0);function oM(n,e){return pi(n,t=>n.moveVertically(t,e,YT(n).height))}const P1=n=>oM(n,!1),D1=n=>oM(n,!0),jq=n=>pi(n,e=>ws(n,e,!0)),Bq=n=>pi(n,e=>ws(n,e,!1)),Hq=n=>pi(n,e=>ws(n,e,!fn(n))),_q=n=>pi(n,e=>ws(n,e,fn(n))),Uq=n=>pi(n,e=>J.cursor(n.lineBlockAt(e.head).from)),zq=n=>pi(n,e=>J.cursor(n.lineBlockAt(e.head).to)),O1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:0})),!0),T1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.doc.length})),!0),M1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.selection.main.anchor,head:0})),!0),N1=({state:n,dispatch:e})=>(e(Ai(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Fq=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),qq=({state:n,dispatch:e})=>{let t=Pf(n).map(({from:i,to:o})=>J.range(i,Math.min(o+1,n.doc.length)));return e(n.update({selection:J.create(t),userEvent:"select"})),!0},Gq=({state:n,dispatch:e})=>{let t=Qr(n.selection,i=>{let o=dn(n),a=o.resolveStack(i.from,1);if(i.empty){let r=o.resolveStack(i.from,-1);r.node.from>=a.node.from&&r.node.to<=a.node.to&&(a=r)}for(let r=a;r;r=r.next){let{node:c}=r;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&r.next)return J.range(c.to,c.from)}return i});return t.eq(n.selection)?!1:(e(Ai(n,t)),!0)};function sM(n,e){let{state:t}=n,i=t.selection,o=t.selection.ranges.slice();for(let a of t.selection.ranges){let r=t.doc.lineAt(a.head);if(e?r.to<n.state.doc.length:r.from>0)for(let c=a;;){let d=n.moveVertically(c,e);if(d.head<r.from||d.head>r.to){o.some(f=>f.head==d.head)||o.push(d);break}else{if(d.head==c.head)break;c=d}}}return o.length==i.ranges.length?!1:(n.dispatch(Ai(t,J.create(o,o.length-1))),!0)}const Kq=n=>sM(n,!1),Vq=n=>sM(n,!0),Wq=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=J.create([t.main]):t.main.empty||(i=J.create([J.cursor(t.main.head)])),i?(e(Ai(n,i)),!0):!1};function eu(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,o=i.changeByRange(a=>{let{from:r,to:c}=a;if(r==c){let d=e(a);d<r?(t="delete.backward",d=Kd(n,d,!1)):d>r&&(t="delete.forward",d=Kd(n,d,!0)),r=Math.min(r,d),c=Math.max(c,d)}else r=Kd(n,r,!1),c=Kd(n,c,!0);return r==c?{range:a}:{changes:{from:r,to:c},range:J.cursor(r,r<a.head?-1:1)}});return o.changes.empty?!1:(n.dispatch(i.update(o,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?ue.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Kd(n,e,t){if(n instanceof ue)for(let i of n.state.facet(ue.atomicRanges).map(o=>o(n)))i.between(e,e,(o,a)=>{o<e&&a>e&&(e=t?a:o)});return e}const aM=(n,e,t)=>eu(n,i=>{let o=i.from,{state:a}=n,r=a.doc.lineAt(o),c,d;if(t&&!e&&o>r.from&&o<r.from+200&&!/[^ \t]/.test(c=r.text.slice(0,o-r.from))){if(c[c.length-1]==" ")return o-1;let f=Vr(c,a.tabSize),g=f%xa(a)||xa(a);for(let m=0;m<g&&c[c.length-1-m]==" ";m++)o--;d=o}else d=$t(r.text,o-r.from,e,e)+r.from,d==o&&r.number!=(e?a.doc.lines:1)?d+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(r.text.slice(d-r.from,o-r.from))&&(d=$t(r.text,d-r.from,!1,!1)+r.from);return d}),rb=n=>aM(n,!1,!0),rM=n=>aM(n,!0,!1),lM=(n,e)=>eu(n,t=>{let i=t.head,{state:o}=n,a=o.doc.lineAt(i),r=o.charCategorizer(i);for(let c=null;;){if(i==(e?a.to:a.from)){i==t.head&&a.number!=(e?o.doc.lines:1)&&(i+=e?1:-1);break}let d=$t(a.text,i-a.from,e)+a.from,f=a.text.slice(Math.min(i,d)-a.from,Math.max(i,d)-a.from),g=r(f);if(c!=null&&g!=c)break;(f!=" "||i!=t.head)&&(c=g),i=d}return i}),cM=n=>lM(n,!1),Qq=n=>lM(n,!0),Yq=n=>eu(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),$q=n=>eu(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Xq=n=>eu(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),Jq=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Je.of(["",""])},range:J.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Zq=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let o=i.from,a=n.doc.lineAt(o),r=o==a.from?o-1:$t(a.text,o-a.from,!1)+a.from,c=o==a.to?o+1:$t(a.text,o-a.from,!0)+a.from;return{changes:{from:r,to:c,insert:n.doc.slice(o,c).append(n.doc.slice(r,o))},range:J.cursor(c)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Pf(n){let e=[],t=-1;for(let i of n.selection.ranges){let o=n.doc.lineAt(i.from),a=n.doc.lineAt(i.to);if(!i.empty&&i.to==a.from&&(a=n.doc.lineAt(i.to-1)),t>=o.number){let r=e[e.length-1];r.to=a.to,r.ranges.push(i)}else e.push({from:o.from,to:a.to,ranges:[i]});t=a.number+1}return e}function uM(n,e,t){if(n.readOnly)return!1;let i=[],o=[];for(let a of Pf(n)){if(t?a.to==n.doc.length:a.from==0)continue;let r=n.doc.lineAt(t?a.to+1:a.from-1),c=r.length+1;if(t){i.push({from:a.to,to:r.to},{from:a.from,insert:r.text+n.lineBreak});for(let d of a.ranges)o.push(J.range(Math.min(n.doc.length,d.anchor+c),Math.min(n.doc.length,d.head+c)))}else{i.push({from:r.from,to:a.from},{from:a.to,insert:n.lineBreak+r.text});for(let d of a.ranges)o.push(J.range(d.anchor-c,d.head-c))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:J.create(o,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const e6=({state:n,dispatch:e})=>uM(n,e,!1),t6=({state:n,dispatch:e})=>uM(n,e,!0);function dM(n,e,t){if(n.readOnly)return!1;let i=[];for(let a of Pf(n))t?i.push({from:a.from,insert:n.doc.slice(a.from,a.to)+n.lineBreak}):i.push({from:a.to,insert:n.lineBreak+n.doc.slice(a.from,a.to)});let o=n.changes(i);return e(n.update({changes:o,selection:n.selection.map(o,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const n6=({state:n,dispatch:e})=>dM(n,e,!1),i6=({state:n,dispatch:e})=>dM(n,e,!0),o6=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Pf(e).map(({from:o,to:a})=>(o>0?o--:a<e.doc.length&&a++,{from:o,to:a}))),i=Qr(e.selection,o=>{let a;if(n.lineWrapping){let r=n.lineBlockAt(o.head),c=n.coordsAtPos(o.head,o.assoc||1);c&&(a=r.bottom+n.documentTop-c.bottom+n.defaultLineHeight/2)}return n.moveVertically(o,!0,a)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function s6(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=dn(n).resolveInner(e),i=t.childBefore(e),o=t.childAfter(e),a;return i&&o&&i.to<=e&&o.from>=e&&(a=i.type.prop(_e.closedBy))&&a.indexOf(o.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(o.from).from&&!/\S/.test(n.sliceDoc(i.to,o.from))?{from:i.to,to:o.from}:null}const L1=hM(!1),a6=hM(!0);function hM(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(o=>{let{from:a,to:r}=o,c=e.doc.lineAt(a),d=!n&&a==r&&s6(e,a);n&&(a=r=(r<=c.to?c:e.doc.lineAt(r)).to);let f=new vf(e,{simulateBreak:a,simulateDoubleBreak:!!d}),g=Dx(f,a);for(g==null&&(g=Vr(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));r<c.to&&/\s/.test(c.text[r-c.from]);)r++;d?{from:a,to:r}=d:a>c.from&&a<c.from+100&&!/\S/.test(c.text.slice(0,a))&&(a=c.from);let m=["",jc(e,g)];return d&&m.push(jc(e,f.lineIndent(c.from,-1))),{changes:{from:a,to:r,insert:Je.of(m)},range:J.cursor(a+1+m[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function jx(n,e){let t=-1;return n.changeByRange(i=>{let o=[];for(let r=i.from;r<=i.to;){let c=n.doc.lineAt(r);c.number>t&&(i.empty||i.to>c.from)&&(e(c,o,i),t=c.number),r=c.to+1}let a=n.changes(o);return{changes:o,range:J.range(a.mapPos(i.anchor,1),a.mapPos(i.head,1))}})}const r6=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new vf(n,{overrideIndentation:a=>{let r=t[a];return r??-1}}),o=jx(n,(a,r,c)=>{let d=Dx(i,a.from);if(d==null)return;/\S/.test(a.text)||(d=0);let f=/^\s*/.exec(a.text)[0],g=jc(n,d);(f!=g||c.from<a.from+f.length)&&(t[a.from]=d,r.push({from:a.from,to:a.from+f.length,insert:g}))});return o.changes.empty||e(n.update(o,{userEvent:"indent"})),!0},fM=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(jx(n,(t,i)=>{i.push({from:t.from,insert:n.facet(xf)})}),{userEvent:"input.indent"})),!0),pM=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(jx(n,(t,i)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let a=Vr(o,n.tabSize),r=0,c=jc(n,Math.max(0,a-xa(n)));for(;r<o.length&&r<c.length&&o.charCodeAt(r)==c.charCodeAt(r);)r++;i.push({from:t.from+r,to:t.from+o.length,insert:c.slice(r)})}),{userEvent:"delete.dedent"})),!0),l6=n=>(n.setTabFocusMode(),!0),c6=[{key:"Ctrl-b",run:qT,shift:JT,preventDefault:!0},{key:"Ctrl-f",run:GT,shift:ZT},{key:"Ctrl-p",run:WT,shift:nM},{key:"Ctrl-n",run:QT,shift:iM},{key:"Ctrl-a",run:Oq,shift:Uq},{key:"Ctrl-e",run:Tq,shift:zq},{key:"Ctrl-d",run:rM},{key:"Ctrl-h",run:rb},{key:"Ctrl-k",run:Yq},{key:"Ctrl-Alt-h",run:cM},{key:"Ctrl-o",run:Jq},{key:"Ctrl-t",run:Zq},{key:"Ctrl-v",run:ab}],u6=[{key:"ArrowLeft",run:qT,shift:JT,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:xq,shift:Lq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Pq,shift:Hq,preventDefault:!0},{key:"ArrowRight",run:GT,shift:ZT,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:vq,shift:Rq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Dq,shift:_q,preventDefault:!0},{key:"ArrowUp",run:WT,shift:nM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:O1,shift:M1},{mac:"Ctrl-ArrowUp",run:A1,shift:P1},{key:"ArrowDown",run:QT,shift:iM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:T1,shift:N1},{mac:"Ctrl-ArrowDown",run:ab,shift:D1},{key:"PageUp",run:A1,shift:P1},{key:"PageDown",run:ab,shift:D1},{key:"Home",run:Aq,shift:Bq,preventDefault:!0},{key:"Mod-Home",run:O1,shift:M1},{key:"End",run:wq,shift:jq,preventDefault:!0},{key:"Mod-End",run:T1,shift:N1},{key:"Enter",run:L1,shift:L1},{key:"Mod-a",run:Fq},{key:"Backspace",run:rb,shift:rb,preventDefault:!0},{key:"Delete",run:rM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:cM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Qq,preventDefault:!0},{mac:"Mod-Backspace",run:$q,preventDefault:!0},{mac:"Mod-Delete",run:Xq,preventDefault:!0}].concat(c6.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),d6=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Sq,shift:Eq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:kq,shift:Iq},{key:"Alt-ArrowUp",run:e6},{key:"Shift-Alt-ArrowUp",run:n6},{key:"Alt-ArrowDown",run:t6},{key:"Shift-Alt-ArrowDown",run:i6},{key:"Mod-Alt-ArrowUp",run:Kq},{key:"Mod-Alt-ArrowDown",run:Vq},{key:"Escape",run:Wq},{key:"Mod-Enter",run:a6},{key:"Alt-l",mac:"Ctrl-l",run:qq},{key:"Mod-i",run:Gq,preventDefault:!0},{key:"Mod-[",run:pM},{key:"Mod-]",run:fM},{key:"Mod-Alt-\\",run:r6},{key:"Shift-Mod-k",run:o6},{key:"Shift-Mod-\\",run:Nq},{key:"Mod-/",run:eq},{key:"Alt-A",run:nq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:l6}].concat(u6),h6={key:"Tab",run:fM,shift:pM},R1=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Fr{constructor(e,t,i=0,o=e.length,a,r){this.test=r,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,o),this.bufferStart=i,this.normalize=a?c=>a(R1(c)):R1,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Mn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ix(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=_i(e);let o=this.normalize(t);if(o.length)for(let a=0,r=i,c=!0;;a++){let d=o.charCodeAt(a),f=this.match(d,r,c,this.bufferPos+this.bufferStart,a==o.length-1);if(f)return this.value=f,this;if(a==o.length-1)break;c&&a<t.length&&t.charCodeAt(a)==d?r++:c=!1}}}match(e,t,i,o,a){let r=null;for(let c=0;c<this.matches.length;){let d=this.matches[c],f=!1;this.query.charCodeAt(d.index)==e&&(d.index==this.query.length-1?r={from:d.from,to:o,precise:a&&d.precise}:(d.index++,f=!0)),f?c++:this.matches.splice(c,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:o,precise:i&&a}:this.matches.push({from:t,index:1,precise:i})),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(Fr.prototype[Symbol.iterator]=function(){return this});const gM={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Bx="gm"+(/x/.unicode==null?"":"u");class mM{constructor(e,t,i,o=0,a=e.length){if(this.text=e,this.to=a,this.curLine="",this.done=!1,this.value=gM,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new yM(e,t,i,o,a);this.re=new RegExp(t,Bx+(i?.ignoreCase?"i":"")),this.test=i?.test,this.iter=e.iter();let r=e.lineAt(o);this.curLineStart=r.from,this.matchPos=Eh(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,o=i+t[0].length;if(this.matchPos=Eh(this.text,o+(i==o?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<o||i>this.value.to)&&(!this.test||this.test(i,o,t)))return this.value={from:i,to:o,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Um=new WeakMap;class Tr{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let o=Um.get(e);if(!o||o.from>=i||o.to<=t){let c=new Tr(t,e.sliceString(t,i));return Um.set(e,c),c}if(o.from==t&&o.to==i)return o;let{text:a,from:r}=o;return r>t&&(a=e.sliceString(t,r)+a,r=t),o.to<i&&(a+=e.sliceString(o.to,i)),Um.set(e,new Tr(r,a)),new Tr(t,a.slice(t-r,i-r))}}class yM{constructor(e,t,i,o,a){this.text=e,this.to=a,this.done=!1,this.value=gM,this.matchPos=Eh(e,o),this.re=new RegExp(t,Bx+(i?.ignoreCase?"i":"")),this.test=i?.test,this.flat=Tr.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,o=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,o,t)))return this.value={from:i,to:o,precise:!0,match:t},this.matchPos=Eh(this.text,o+(i==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Tr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(mM.prototype[Symbol.iterator]=yM.prototype[Symbol.iterator]=function(){return this});function f6(n){try{return new RegExp(n,Bx),!0}catch{return!1}}function Eh(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}const p6=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:o}=Lz(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return o.then(a=>{let r=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!r){n.dispatch({effects:i});return}let c=e.doc.lineAt(e.selection.main.head),[,d,f,g,m]=r,x=g?+g.slice(1):0,v=f?+f:c.number;if(f&&m){let w=v/100;d&&(w=w*(d=="-"?-1:1)+c.number/e.doc.lines),v=Math.round(e.doc.lines*w)}else f&&d&&(v=v*(d=="-"?-1:1)+c.number);let C=e.doc.line(Math.max(1,Math.min(e.doc.lines,v))),k=J.cursor(C.from+Math.max(0,Math.min(x,C.length)));n.dispatch({effects:[i,ue.scrollIntoView(k.from,{y:"center"})],selection:k})}),!0},g6={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},m6=pe.define({combine(n){return Xi(n,g6,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function y6(n){return[S6,C6]}const b6=Pe.mark({class:"cm-selectionMatch"}),x6=Pe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function E1(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=kt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=kt.Word)}function v6(n,e,t,i){return n(e.sliceDoc(t,t+1))==kt.Word&&n(e.sliceDoc(i-1,i))==kt.Word}const C6=At.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(m6),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Pe.none;let o=i.main,a,r=null;if(o.empty){if(!e.highlightWordAroundCursor)return Pe.none;let d=t.wordAt(o.head);if(!d)return Pe.none;r=t.charCategorizer(o.head),a=t.sliceDoc(d.from,d.to)}else{let d=o.to-o.from;if(d<e.minSelectionLength||d>200)return Pe.none;if(e.wholeWords){if(a=t.sliceDoc(o.from,o.to),r=t.charCategorizer(o.head),!(E1(r,t,o.from,o.to)&&v6(r,t,o.from,o.to)))return Pe.none}else if(a=t.sliceDoc(o.from,o.to),!a)return Pe.none}let c=[];for(let d of n.visibleRanges){let f=new Fr(t.doc,a,d.from,d.to);for(;!f.next().done;){let{from:g,to:m}=f.value;if((!r||E1(r,t,g,m))&&(o.empty&&g<=o.from&&m>=o.to?c.push(x6.range(g,m)):(g>=o.to||m<=o.from)&&c.push(b6.range(g,m)),c.length>e.maxMatches))return Pe.none}}return Pe.set(c)}},{decorations:n=>n.decorations}),S6=ue.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),k6=({state:n,dispatch:e})=>{let{selection:t}=n,i=J.create(t.ranges.map(o=>n.wordAt(o.head)||J.cursor(o.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function w6(n,e){let{main:t,ranges:i}=n.selection,o=n.wordAt(t.head),a=o&&o.from==t.from&&o.to==t.to;for(let r=!1,c=new Fr(n.doc,e,i[i.length-1].to);;)if(c.next(),c.done){if(r)return null;c=new Fr(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),r=!0}else{if(r&&i.some(d=>d.from==c.value.from))continue;if(a){let d=n.wordAt(c.value.from);if(!d||d.from!=c.value.from||d.to!=c.value.to)continue}return c.value}}const A6=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(a=>a.from===a.to))return k6({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(a=>n.sliceDoc(a.from,a.to)!=i))return!1;let o=w6(n,i);return o?(e(n.update({selection:n.selection.addRange(J.range(o.from,o.to),!1),effects:ue.scrollIntoView(o.to)})),!0):!1},Yr=pe.define({combine(n){return Xi(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new _6(e),scrollToMatch:e=>ue.scrollIntoView(e)})}});class bM{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||f6(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
30
+ `:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new N6(this):new O6(this)}getCursor(e,t=0,i){let o=e.doc?e:Qe.create({doc:e});return i==null&&(i=o.doc.length),this.regexp?pr(this,o,t,i):fr(this,o,t,i)}}class xM{constructor(e){this.spec=e}}function P6(n,e,t){return(i,o,a,r)=>{if(t&&!t(i,o,a,r))return!1;let c=i>=r&&o<=r+a.length?a.slice(i-r,o-r):e.doc.sliceString(i,o);return n(c,e,i,o)}}function fr(n,e,t,i){let o;return n.wholeWord&&(o=D6(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(o=P6(n.test,e,o)),new Fr(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:a=>a.toLowerCase(),o)}function D6(n,e){return(t,i,o,a)=>((a>t||a+o.length<i)&&(a=Math.max(0,t-2),o=n.sliceString(a,Math.min(n.length,i+2))),(e(Ih(o,t-a))!=kt.Word||e(jh(o,t-a))!=kt.Word)&&(e(jh(o,i-a))!=kt.Word||e(Ih(o,i-a))!=kt.Word))}class O6 extends xM{constructor(e){super(e)}nextMatch(e,t,i){let o=fr(this.spec,e,i,e.doc.length).nextOverlapping();if(o.done){let a=Math.min(e.doc.length,t+this.spec.unquoted.length);o=fr(this.spec,e,0,a).nextOverlapping()}return o.done||o.value.from==t&&o.value.to==i?null:o.value}prevMatchInRange(e,t,i){for(let o=i;;){let a=Math.max(t,o-1e4-this.spec.unquoted.length),r=fr(this.spec,e,a,o),c=null;for(;!r.nextOverlapping().done;)c=r.value;if(c)return c;if(a==t)return null;o-=1e4}}prevMatch(e,t,i){let o=this.prevMatchInRange(e,0,t);return o||(o=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),o&&(o.from!=t||o.to!=i)?o:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=fr(this.spec,e,0,e.doc.length),o=[];for(;!i.next().done;){if(o.length>=t)return null;o.push(i.value)}return o}highlight(e,t,i,o){let a=fr(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)o(a.value.from,a.value.to)}}function T6(n,e,t){return(i,o,a)=>(!t||t(i,o,a))&&n(a[0],e,i,o)}function pr(n,e,t,i){let o;return n.wholeWord&&(o=M6(e.charCategorizer(e.selection.main.head))),n.test&&(o=T6(n.test,e,o)),new mM(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:o},t,i)}function Ih(n,e){return n.slice($t(n,e,!1),e)}function jh(n,e){return n.slice(e,$t(n,e))}function M6(n){return(e,t,i)=>!i[0].length||(n(Ih(i.input,i.index))!=kt.Word||n(jh(i.input,i.index))!=kt.Word)&&(n(jh(i.input,i.index+i[0].length))!=kt.Word||n(Ih(i.input,i.index+i[0].length))!=kt.Word)}class N6 extends xM{nextMatch(e,t,i){let o=pr(this.spec,e,i,e.doc.length).next();return o.done&&(o=pr(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,i){for(let o=1;;o++){let a=Math.max(t,i-o*1e4),r=pr(this.spec,e,a,i),c=null;for(;!r.next().done;)c=r.value;if(c&&(a==t||c.from>a+10))return c;if(a==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let o=i.length;o>0;o--){let a=+i.slice(0,o);if(a>0&&a<e.match.length)return e.match[a]+i.slice(o)}return t})}matchAll(e,t){let i=pr(this.spec,e,0,e.doc.length),o=[];for(;!i.next().done;){if(o.length>=t)return null;o.push(i.value)}return o}highlight(e,t,i,o){let a=pr(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!a.next().done;)o(a.value.from,a.value.to)}}const Hc=Le.define(),Hx=Le.define(),ms=hn.define({create(n){return new zm(lb(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Hc)?n=new zm(t.value.create(),n.panel):t.is(Hx)&&(n=new zm(n.query,t.value?_x:null));return n},provide:n=>Lc.from(n,e=>e.panel)});class zm{constructor(e,t){this.query=e,this.panel=t}}const L6=Pe.mark({class:"cm-searchMatch"}),R6=Pe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),E6=At.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ms))}update(n){let e=n.state.field(ms);(e!=n.startState.field(ms)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Pe.none;let{view:t}=this,i=new Yi;for(let o=0,a=t.visibleRanges,r=a.length;o<r;o++){let{from:c,to:d}=a[o];for(;o<r-1&&d>a[o+1].from-500;)d=a[++o].to;n.highlight(t.state,c,d,(f,g)=>{let m=t.state.selection.ranges.some(x=>x.from==f&&x.to==g);i.add(f,g,m?R6:L6)})}return i.finish()}},{decorations:n=>n.decorations});function tu(n){return e=>{let t=e.state.field(ms,!1);return t&&t.query.spec.valid?n(e,t):SM(e)}}const Bh=tu((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let o=J.single(i.from,i.to),a=n.state.facet(Yr);return n.dispatch({selection:o,effects:[Ux(n,i),a.scrollToMatch(o.main,n)],userEvent:"select.search"}),CM(n),!0}),Hh=tu((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,o=e.prevMatch(t,i,i);if(!o)return!1;let a=J.single(o.from,o.to),r=n.state.facet(Yr);return n.dispatch({selection:a,effects:[Ux(n,o),r.scrollToMatch(a.main,n)],userEvent:"select.search"}),CM(n),!0}),I6=tu((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:J.create(t.map(i=>J.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),j6=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:o}=t.main,a=[],r=0;for(let c=new Fr(n.doc,n.sliceDoc(i,o));!c.next().done;){if(a.length>1e3)return!1;c.value.from==i&&(r=a.length),a.push(J.range(c.value.from,c.value.to))}return e(n.update({selection:J.create(a,r),userEvent:"select.search.matches"})),!0},I1=tu((n,{query:e})=>{let{state:t}=n,{from:i,to:o}=t.selection.main;if(t.readOnly)return!1;let a=e.nextMatch(t,i,i);if(!a)return!1;let r=a,c=[],d,f,g=[];r.precise?r.from==i&&r.to==o&&(f=t.toText(e.getReplacement(r)),c.push({from:r.from,to:r.to,insert:f}),g.push(ue.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):r=e.nextMatch(t,r.from,r.to);let m=n.state.changes(c);return r&&(d=J.single(r.from,r.to).map(m),g.push(Ux(n,r)),g.push(t.facet(Yr).scrollToMatch(d.main,n))),n.dispatch({changes:m,selection:d,effects:g,userEvent:"input.replace"}),!0}),B6=tu((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let o of e.matchAll(n.state,1e9)){let{from:a,to:r,precise:c}=o;c&&t.push({from:a,to:r,insert:e.getReplacement(o)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:ue.announce.of(i),userEvent:"input.replace.all"}),!0});function _x(n){return n.state.facet(Yr).createPanel(n)}function lb(n,e){var t,i,o,a,r;let c=n.selection.main,d=c.empty||c.to>c.from+100?"":n.sliceDoc(c.from,c.to);if(e&&!d)return e;let f=n.facet(Yr);return new bM({search:((t=e?.literal)!==null&&t!==void 0?t:f.literal)?d:d.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:f.caseSensitive,literal:(o=e?.literal)!==null&&o!==void 0?o:f.literal,regexp:(a=e?.regexp)!==null&&a!==void 0?a:f.regexp,wholeWord:(r=e?.wholeWord)!==null&&r!==void 0?r:f.wholeWord})}function vM(n){let e=Cx(n,_x);return e&&e.dom.querySelector("[main-field]")}function CM(n){let e=vM(n);e&&e==n.root.activeElement&&e.select()}const SM=n=>{let e=n.state.field(ms,!1);if(e&&e.panel){let t=vM(n);if(t&&t!=n.root.activeElement){let i=lb(n.state,e.query.spec);i.valid&&n.dispatch({effects:Hc.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Hx.of(!0),e?Hc.of(lb(n.state,e.query.spec)):Le.appendConfig.of(z6)]});return!0},kM=n=>{let e=n.state.field(ms,!1);if(!e||!e.panel)return!1;let t=Cx(n,_x);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Hx.of(!1)}),!0},H6=[{key:"Mod-f",run:SM,scope:"editor search-panel"},{key:"F3",run:Bh,shift:Hh,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bh,shift:Hh,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kM,scope:"editor search-panel"},{key:"Mod-Shift-l",run:j6},{key:"Mod-Alt-g",run:p6},{key:"Mod-d",run:A6,preventDefault:!0}];class _6{constructor(e){this.view=e;let t=this.query=e.state.field(ms).query.spec;this.commit=this.commit.bind(this),this.searchField=dt("input",{value:t.search,placeholder:Gn(e,"Find"),"aria-label":Gn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=dt("input",{value:t.replace,placeholder:Gn(e,"Replace"),"aria-label":Gn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=dt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=dt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=dt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(o,a,r){return dt("button",{class:"cm-button",name:o,onclick:a,type:"button"},r)}this.dom=dt("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,i("next",()=>Bh(e),[Gn(e,"next")]),i("prev",()=>Hh(e),[Gn(e,"previous")]),i("select",()=>I6(e),[Gn(e,"all")]),dt("label",null,[this.caseField,Gn(e,"match case")]),dt("label",null,[this.reField,Gn(e,"regexp")]),dt("label",null,[this.wordField,Gn(e,"by word")]),...e.state.readOnly?[]:[dt("br"),this.replaceField,i("replace",()=>I1(e),[Gn(e,"replace")]),i("replaceAll",()=>B6(e),[Gn(e,"replace all")])],dt("button",{name:"close",onclick:()=>kM(e),"aria-label":Gn(e,"close"),type:"button"},["×"])])}commit(){let e=new bM({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Hc.of(e)}))}keydown(e){z4(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Hh:Bh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),I1(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Hc)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Yr).top}}function Gn(n,e){return n.state.phrase(e)}const Vd=30,Wd=/[\s\.,:;?!]/;function Ux(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),o=n.state.doc.lineAt(t).to,a=Math.max(i.from,e-Vd),r=Math.min(o,t+Vd),c=n.state.sliceDoc(a,r);if(a!=i.from){for(let d=0;d<Vd;d++)if(!Wd.test(c[d+1])&&Wd.test(c[d])){c=c.slice(d);break}}if(r!=o){for(let d=c.length-1;d>c.length-Vd;d--)if(!Wd.test(c[d-1])&&Wd.test(c[d])){c=c.slice(0,d);break}}return ue.announce.of(`${n.state.phrase("current match")}. ${c} ${n.state.phrase("on line")} ${i.number}.`)}const U6=ue.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),z6=[ms,Sa.low(E6),U6];class wM{constructor(e,t,i,o){this.state=e,this.pos=t,this.explicit=i,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=dn(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),o=t.text.slice(i-t.from,this.pos-t.from),a=o.search(AM(e,!1));return a<0?null:{from:i+a,to:this.pos,text:o.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function j1(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function F6(n){let e=Object.create(null),t=Object.create(null);for(let{label:o}of n){e[o[0]]=!0;for(let a=1;a<o.length;a++)t[o[a]]=!0}let i=j1(e)+j1(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function q6(n){let e=n.map(o=>typeof o=="string"?{label:o}:o),[t,i]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:F6(e);return o=>{let a=o.matchBefore(i);return a||o.explicit?{from:a?a.from:o.pos,options:e,validFor:t}:null}}let B1=class{constructor(e,t,i,o){this.completion=e,this.source=t,this.match=i,this.score=o}};function da(n){return n.selection.main.from}function AM(n,e){var t;let{source:i}=n,o=e&&i[0]!="^",a=i[i.length-1]!="$";return!o&&!a?n:new RegExp(`${o?"^":""}(?:${i})${a?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const PM=$i.define();function G6(n,e,t,i){let{main:o}=n.selection,a=t-o.from,r=i-o.from;return{...n.changeByRange(c=>{if(c!=o&&t!=i&&n.sliceDoc(c.from+a,c.from+r)!=n.sliceDoc(t,i))return{range:c};let d=n.toText(e);return{changes:{from:c.from+a,to:i==o.from?c.to:c.from+r,insert:d},range:J.cursor(c.from+a+d.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const H1=new WeakMap;function K6(n){if(!Array.isArray(n))return n;let e=H1.get(n);return e||H1.set(n,e=q6(n)),e}const _h=Le.define(),_c=Le.define();class V6{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Mn(e,t),o=_i(i);this.chars.push(i);let a=e.slice(t,t+o),r=a.toUpperCase();this.folded.push(Mn(r==a?a.toLowerCase():r,0)),t+=o}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:o,precise:a,byWord:r}=this;if(t.length==1){let O=Mn(e,0),M=_i(O),T=M==e.length?0:-100;if(O!=t[0])if(O==i[0])T+=-200;else return null;return this.ret(T,[0,M])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let d=t.length,f=0;if(c<0){for(let O=0,M=Math.min(e.length,200);O<M&&f<d;){let T=Mn(e,O);(T==t[f]||T==i[f])&&(o[f++]=O),O+=_i(T)}if(f<d)return null}let g=0,m=0,x=!1,v=0,C=-1,k=-1,w=/[a-z]/.test(e),D=!0;for(let O=0,M=Math.min(e.length,200),T=0;O<M&&m<d;){let L=Mn(e,O);c<0&&(g<d&&L==t[g]&&(a[g++]=O),v<d&&(L==t[v]||L==i[v]?(v==0&&(C=O),k=O+1,v++):v=0));let N,I=L<255?L>=48&&L<=57||L>=97&&L<=122?2:L>=65&&L<=90?1:0:(N=ix(L))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!O||I==1&&w||T==0&&I!=0)&&(t[m]==L||i[m]==L&&(x=!0)?r[m++]=O:r.length&&(D=!1)),T=I,O+=_i(L)}return m==d&&r[0]==0&&D?this.result(-100+(x?-200:0),r,e):v==d&&C==0?this.ret(-200-e.length+(k==e.length?0:-100),[0,k]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):v==d?this.ret(-900-e.length,[C,k]):m==d?this.result(-100+(x?-200:0)+-700+(D?0:-1100),r,e):t.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,t,i){let o=[],a=0;for(let r of t){let c=r+(this.astral?_i(Mn(i,r)):1);a&&o[a-1]==r?o[a-1]=c:(o[a++]=r,o[a++]=c)}return this.ret(e-i.length,o)}}class W6{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const Yt=pe.define({combine(n){return Xi(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Q6,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>_1(e(i),t(i)),optionClass:(e,t)=>i=>_1(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function _1(n,e){return n?e?n+" "+e:n:e}function Q6(n,e,t,i,o,a){let r=n.textDirection==yt.RTL,c=r,d=!1,f="top",g,m,x=e.left-o.left,v=o.right-e.right,C=i.right-i.left,k=i.bottom-i.top;if(c&&x<Math.min(C,v)?c=!1:!c&&v<Math.min(C,x)&&(c=!0),C<=(c?x:v))g=Math.max(o.top,Math.min(t.top,o.bottom-k))-e.top,m=Math.min(400,c?x:v);else{d=!0,m=Math.min(400,(r?e.right:o.right-e.left)-30);let O=o.bottom-e.bottom;O>=k||O>e.top?g=t.bottom-e.top:(f="bottom",g=e.bottom-t.top)}let w=(e.bottom-e.top)/a.offsetHeight,D=(e.right-e.left)/a.offsetWidth;return{style:`${f}: ${g/w}px; max-width: ${m/D}px`,class:"cm-completionInfo-"+(d?r?"left-narrow":"right-narrow":c?"left":"right")}}const zx=Le.define();function Y6(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,o,a){let r=document.createElement("span");r.className="cm-completionLabel";let c=t.displayLabel||t.label,d=0;for(let f=0;f<a.length;){let g=a[f++],m=a[f++];g>d&&r.appendChild(document.createTextNode(c.slice(d,g)));let x=r.appendChild(document.createElement("span"));x.appendChild(document.createTextNode(c.slice(g,m))),x.className="cm-completionMatchedText",d=m}return d<c.length&&r.appendChild(document.createTextNode(c.slice(d))),r},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function Fm(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let o=Math.floor(e/t);return{from:o*t,to:(o+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class $6{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:d=>this.placeInfo(d),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:a,selected:r}=o.open,c=e.state.facet(Yt);this.optionContent=Y6(c),this.optionClass=c.optionClass,this.tooltipClass=c.tooltipClass,this.range=Fm(a.length,r,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",d=>{let{options:f}=e.state.field(t).open;for(let g=d.target,m;g&&g!=this.dom;g=g.parentNode)if(g.nodeName=="LI"&&(m=/-(\d+)$/.exec(g.id))&&+m[1]<f.length){this.applyCompletion(e,f[+m[1]]),d.preventDefault();return}if(d.target==this.list){let g=this.list.classList.contains("cm-completionListIncompleteTop")&&d.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&d.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;g!=null&&(e.dispatch({effects:zx.of(g)}),d.preventDefault())}}),this.dom.addEventListener("focusout",d=>{let f=e.state.field(this.stateField,!1);f&&f.tooltip&&e.state.facet(Yt).closeOnBlur&&d.relatedTarget!=e.contentDOM&&e.dispatch({effects:_c.of(null)})}),this.showOptions(a,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=o){let{options:a,selected:r,disabled:c}=i.open;(!o.open||o.open.options!=a)&&(this.range=Fm(a.length,r,e.state.facet(Yt).maxRenderedOptions),this.showOptions(a,i.id)),this.updateSel(),c!=((t=o.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!c)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Fm(t.options.length,t.selected,this.view.state.facet(Yt).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:o}=t.options[t.selected],{info:a}=o;if(!a)return;let r=typeof a=="string"?document.createTextNode(a):a(o);if(!r)return;"then"in r?r.then(c=>{c&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(c,o)}).catch(c=>En(this.view.state,c,"completion info")):(this.addInfoPane(r,o),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:o,destroy:a}=e;i.appendChild(o),this.infoDestroy=a||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,o=this.range.from;i;i=i.nextSibling,o++)i.nodeName!="LI"||!i.id?o--:o==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&J6(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),a=this.space;if(!a){let r=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:r.clientWidth,bottom:r.clientHeight}}return o.top>Math.min(a.bottom,t.bottom)-10||o.bottom<Math.max(a.top,t.top)+10?null:this.view.state.facet(Yt).positionInfo(this.view,t,o,i,a,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const o=document.createElement("ul");o.id=t,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",r=>{r.target==o&&r.preventDefault()});let a=null;for(let r=i.from;r<i.to;r++){let{completion:c,match:d}=e[r],{section:f}=c;if(f){let x=typeof f=="string"?f:f.name;if(x!=a&&(r>i.from||i.from==0))if(a=x,typeof f!="string"&&f.header)o.appendChild(f.header(f));else{let v=o.appendChild(document.createElement("completion-section"));v.textContent=x}}const g=o.appendChild(document.createElement("li"));g.id=t+"-"+r,g.setAttribute("role","option");let m=this.optionClass(c);m&&(g.className=m);for(let x of this.optionContent){let v=x(c,this.view.state,this.view,d);v&&g.appendChild(v)}}return i.from&&o.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function X6(n,e){return t=>new $6(t,n,e)}function J6(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/o:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/o)}function U1(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Z6(n,e){let t=[],i=null,o=null,a=g=>{t.push(g);let{section:m}=g.completion;if(m){i||(i=[]);let x=typeof m=="string"?m:m.name;i.some(v=>v.name==x)||i.push(typeof m=="string"?{name:x}:m)}},r=e.facet(Yt);for(let g of n)if(g.hasResult()){let m=g.result.getMatch;if(g.result.filter===!1)for(let x of g.result.options)a(new B1(x,g.source,m?m(x):[],1e9-t.length));else{let x=e.sliceDoc(g.from,g.to),v,C=r.filterStrict?new W6(x):new V6(x);for(let k of g.result.options)if(v=C.match(k.label)){let w=k.displayLabel?m?m(k,v.matched):[]:v.matched,D=v.score+(k.boost||0);if(a(new B1(k,g.source,w,D)),typeof k.section=="object"&&k.section.rank==="dynamic"){let{name:O}=k.section;o||(o=Object.create(null)),o[O]=Math.max(D,o[O]||-1e9)}}}}if(i){let g=Object.create(null),m=0,x=(v,C)=>(v.rank==="dynamic"&&C.rank==="dynamic"?o[C.name]-o[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof C.rank=="number"?C.rank:1e9)||(v.name<C.name?-1:1);for(let v of i.sort(x))m-=1e5,g[v.name]=m;for(let v of t){let{section:C}=v.completion;C&&(v.score+=g[typeof C=="string"?C:C.name])}}let c=[],d=null,f=r.compareCompletions;for(let g of t.sort((m,x)=>x.score-m.score||f(m.completion,x.completion))){let m=g.completion;!d||d.label!=m.label||d.detail!=m.detail||d.type!=null&&m.type!=null&&d.type!=m.type||d.apply!=m.apply||d.boost!=m.boost?c.push(g):U1(g.completion)>U1(d)&&(c[c.length-1]=g),d=g.completion}return c}class vr{constructor(e,t,i,o,a,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=o,this.selected=a,this.disabled=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new vr(this.options,z1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,o,a,r){if(o&&!r&&e.some(f=>f.isPending))return o.setDisabled();let c=Z6(e,t);if(!c.length)return o&&e.some(f=>f.isPending)?o.setDisabled():null;let d=t.facet(Yt).selectOnOpen?0:-1;if(o&&o.selected!=d&&o.selected!=-1){let f=o.options[o.selected].completion;for(let g=0;g<c.length;g++)if(c[g].completion==f){d=g;break}}return new vr(c,z1(i,d),{pos:e.reduce((f,g)=>g.hasResult()?Math.min(f,g.from):f,1e8),create:sG,above:a.aboveCursor},o?o.timestamp:Date.now(),d,!1)}map(e){return new vr(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new vr(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Uh{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Uh(iG,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Yt),a=(i.override||t.languageDataAt("autocomplete",da(t)).map(K6)).map(d=>(this.active.find(g=>g.source==d)||new ui(d,this.active.some(g=>g.state!=0)?1:0)).update(e,i));a.length==this.active.length&&a.every((d,f)=>d==this.active[f])&&(a=this.active);let r=this.open,c=e.effects.some(d=>d.is(Fx));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||a.some(d=>d.hasResult()&&e.changes.touchesRange(d.from,d.to))||!eG(a,this.active)||c?r=vr.build(a,t,this.id,r,i,c):r&&r.disabled&&!a.some(d=>d.isPending)&&(r=null),!r&&a.every(d=>!d.isPending)&&a.some(d=>d.hasResult())&&(a=a.map(d=>d.hasResult()?new ui(d.source,0):d));for(let d of e.effects)d.is(zx)&&(r=r&&r.setSelected(d.value,this.id));return a==this.active&&r==this.open?this:new Uh(a,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?tG:nG}}function eG(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let o=t==n.length,a=i==e.length;if(o||a)return o==a;if(n[t++].result!=e[i++].result)return!1}}const tG={"aria-autocomplete":"list"},nG={};function z1(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const iG=[];function DM(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(PM);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class ui{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=DM(e,t),o=this;(i&8||i&16&&this.touches(e))&&(o=new ui(o.source,0)),i&4&&o.state==0&&(o=new ui(this.source,1)),o=o.updateFor(e,i);for(let a of e.effects)if(a.is(_h))o=new ui(o.source,1,a.value);else if(a.is(_c))o=new ui(o.source,0);else if(a.is(Fx))for(let r of a.value)r.source==o.source&&(o=r);return o}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(da(e.state))}}class Mr extends ui{constructor(e,t,i,o,a,r){super(e,3,t),this.limit=i,this.result=o,this.from=a,this.to=r}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let a=e.changes.mapPos(this.from),r=e.changes.mapPos(this.to,1),c=da(e.state);if(c>r||!o||t&2&&(da(e.startState)==this.from||c<this.limit))return new ui(this.source,t&4?1:0);let d=e.changes.mapPos(this.limit);return oG(o.validFor,e.state,a,r)?new Mr(this.source,this.explicit,d,o,a,r):o.update&&(o=o.update(o,a,r,new wM(e.state,c,!1)))?new Mr(this.source,this.explicit,d,o,o.from,(i=o.to)!==null&&i!==void 0?i:da(e.state)):new ui(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mr(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ui(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function oG(n,e,t,i){if(!n)return!1;let o=e.sliceDoc(t,i);return typeof n=="function"?n(o,t,i,e):AM(n,!0).test(o)}const Fx=Le.define({map(n,e){return n.map(t=>t.map(e))}}),Nn=hn.define({create(){return Uh.start()},update(n,e){return n.update(e)},provide:n=>[vx.from(n,e=>e.tooltip),ue.contentAttributes.from(n,e=>e.attrs)]});function qx(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Nn).active.find(o=>o.source==e.source);return i instanceof Mr?(typeof t=="string"?n.dispatch({...G6(n.state,t,i.from,i.to),annotations:PM.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const sG=X6(Nn,qx);function Qd(n,e="option"){return t=>{let i=t.state.field(Nn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(Yt).interactionDelay)return!1;let o=1,a;e=="page"&&(a=tT(t,i.open.tooltip))&&(o=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector("li").offsetHeight)-1));let{length:r}=i.open.options,c=i.open.selected>-1?i.open.selected+o*(n?1:-1):n?0:r-1;return c<0?c=e=="page"?0:r-1:c>=r&&(c=e=="page"?r-1:0),t.dispatch({effects:zx.of(c)}),!0}}const aG=n=>{let e=n.state.field(Nn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Yt).interactionDelay?!1:qx(n,e.open.options[e.open.selected])},qm=n=>n.state.field(Nn,!1)?(n.dispatch({effects:_h.of(!0)}),!0):!1,rG=n=>{let e=n.state.field(Nn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:_c.of(null)}),!0)};class lG{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const cG=50,uG=1e3,dG=At.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Nn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Nn),t=n.state.facet(Yt);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Nn)==e)return;let i=n.transactions.some(a=>{let r=DM(a,t);return r&8||(a.selection||a.docChanged)&&!(r&3)});for(let a=0;a<this.running.length;a++){let r=this.running[a];if(i||r.context.abortOnDocChange&&n.docChanged||r.updates.length+n.transactions.length>cG&&Date.now()-r.time>uG){for(let c of r.context.abortListeners)try{c()}catch(d){En(this.view.state,d)}r.context.abortListeners=null,this.running.splice(a--,1)}else r.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(a=>a.effects.some(r=>r.is(_h)))&&(this.pendingStart=!0);let o=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(r=>r.active.source==a.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let a of n.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Nn);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Yt).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=da(e),i=new wM(e,t,n.explicit,this.view),o=new lG(n,i);this.running.push(o),Promise.resolve(n.source(i)).then(a=>{o.context.aborted||(o.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:_c.of(null)}),En(this.view.state,a)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Yt).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Yt),i=this.view.state.field(Nn);for(let o=0;o<this.running.length;o++){let a=this.running[o];if(a.done===void 0)continue;if(this.running.splice(o--,1),a.done){let c=da(a.updates.length?a.updates[0].startState:this.view.state),d=Math.min(c,a.done.from+(a.active.explicit?0:1)),f=new Mr(a.active.source,a.active.explicit,d,a.done,a.done.from,(n=a.done.to)!==null&&n!==void 0?n:c);for(let g of a.updates)f=f.update(g,t);if(f.hasResult()){e.push(f);continue}}let r=i.active.find(c=>c.source==a.active.source);if(r&&r.isPending)if(a.done==null){let c=new ui(a.active.source,0);for(let d of a.updates)c=c.update(d,t);c.isPending||e.push(c)}else this.startQuery(r)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Fx.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Nn,!1);if(e&&e.tooltip&&this.view.state.facet(Yt).closeOnBlur){let t=e.open&&tT(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:_c.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_h.of(!1)}),20),this.composing=0}}}),hG=typeof navigator=="object"&&/Win/.test(navigator.platform),fG=Sa.highest(ue.domEventHandlers({keydown(n,e){let t=e.state.field(Nn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(hG&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],o=t.active.find(r=>r.source==i.source),a=i.completion.commitCharacters||o.result.commitCharacters;return a&&a.indexOf(n.key)>-1&&qx(e,i),!1}})),pG=ue.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Uc={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},sa=Le.define({map(n,e){let t=e.mapPos(n,-1,xn.TrackAfter);return t??void 0}}),Gx=new class extends ys{};Gx.startSide=1;Gx.endSide=-1;const OM=hn.define({create(){return qe.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(sa)&&(n=n.update({add:[Gx.range(t.value,t.value+1)]}));return n}});function gG(){return[yG,OM]}const Gm="()[]{}<>«»»«[]{}";function TM(n){for(let e=0;e<Gm.length;e+=2)if(Gm.charCodeAt(e)==n)return Gm.charAt(e+1);return ix(n<128?n:n+1)}function MM(n,e){return n.languageDataAt("closeBrackets",e)[0]||Uc}const mG=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),yG=ue.inputHandler.of((n,e,t,i)=>{if((mG?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let o=n.state.selection.main;if(i.length>2||i.length==2&&_i(Mn(i,0))==1||e!=o.from||t!=o.to)return!1;let a=vG(n.state,i);return a?(n.dispatch(a),!0):!1}),bG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=MM(n,n.selection.main.head).brackets||Uc.brackets,o=null,a=n.changeByRange(r=>{if(r.empty){let c=CG(n.doc,r.head);for(let d of i)if(d==c&&Df(n.doc,r.head)==TM(Mn(d,0)))return{changes:{from:r.head-d.length,to:r.head+d.length},range:J.cursor(r.head-d.length)}}return{range:o=r}});return o||e(n.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!o},xG=[{key:"Backspace",run:bG}];function vG(n,e){let t=MM(n,n.selection.main.head),i=t.brackets||Uc.brackets;for(let o of i){let a=TM(Mn(o,0));if(e==o)return a==o?wG(n,o,i.indexOf(o+o+o)>-1,t):SG(n,o,a,t.before||Uc.before);if(e==a&&NM(n,n.selection.main.from))return kG(n,o,a)}return null}function NM(n,e){let t=!1;return n.field(OM).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Df(n,e){let t=n.sliceString(e,e+2);return t.slice(0,_i(Mn(t,0)))}function CG(n,e){let t=n.sliceString(e-2,e);return _i(Mn(t,0))==t.length?t:t.slice(1)}function SG(n,e,t,i){let o=null,a=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:t,from:r.to}],effects:sa.of(r.to+e.length),range:J.range(r.anchor+e.length,r.head+e.length)};let c=Df(n.doc,r.head);return!c||/\s/.test(c)||i.indexOf(c)>-1?{changes:{insert:e+t,from:r.head},effects:sa.of(r.head+e.length),range:J.cursor(r.head+e.length)}:{range:o=r}});return o?null:n.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function kG(n,e,t){let i=null,o=n.changeByRange(a=>a.empty&&Df(n.doc,a.head)==t?{changes:{from:a.head,to:a.head+t.length,insert:t},range:J.cursor(a.head+t.length)}:i={range:a});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function wG(n,e,t,i){let o=i.stringPrefixes||Uc.stringPrefixes,a=null,r=n.changeByRange(c=>{if(!c.empty)return{changes:[{insert:e,from:c.from},{insert:e,from:c.to}],effects:sa.of(c.to+e.length),range:J.range(c.anchor+e.length,c.head+e.length)};let d=c.head,f=Df(n.doc,d),g;if(f==e){if(F1(n,d))return{changes:{insert:e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)};if(NM(n,d)){let x=t&&n.sliceDoc(d,d+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:d,to:d+x.length,insert:x},range:J.cursor(d+x.length)}}}else{if(t&&n.sliceDoc(d-2*e.length,d)==e+e&&(g=q1(n,d-2*e.length,o))>-1&&F1(n,g))return{changes:{insert:e+e+e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)};if(n.charCategorizer(d)(f)!=kt.Word&&q1(n,d,o)>-1&&!AG(n,d,e,o))return{changes:{insert:e+e,from:d},effects:sa.of(d+e.length),range:J.cursor(d+e.length)}}return{range:a=c}});return a?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function F1(n,e){let t=dn(n).resolveInner(e+1);return t.parent&&t.from==e}function AG(n,e,t,i){let o=dn(n).resolveInner(e,-1),a=i.reduce((r,c)=>Math.max(r,c.length),0);for(let r=0;r<5;r++){let c=n.sliceDoc(o.from,Math.min(o.to,o.from+t.length+a)),d=c.indexOf(t);if(!d||d>-1&&i.indexOf(c.slice(0,d))>-1){let g=o.firstChild;for(;g&&g.from==o.from&&g.to-g.from>t.length+d;){if(n.sliceDoc(g.to-t.length,g.to)==t)return!1;g=g.firstChild}return!0}let f=o.to==e&&o.parent;if(!f)break;o=f}return!1}function q1(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=kt.Word)return e;for(let o of t){let a=e-o.length;if(n.sliceDoc(a,e)==o&&i(n.sliceDoc(a-1,a))!=kt.Word)return a}return-1}function PG(n={}){return[fG,Nn,Yt.of(n),dG,DG,pG]}const LM=[{key:"Ctrl-Space",run:qm},{mac:"Alt-`",run:qm},{mac:"Alt-i",run:qm},{key:"Escape",run:rG},{key:"ArrowDown",run:Qd(!0)},{key:"ArrowUp",run:Qd(!1)},{key:"PageDown",run:Qd(!0,"page")},{key:"PageUp",run:Qd(!1,"page")},{key:"Enter",run:aG}],DG=Sa.highest(mf.computeN([Yt],n=>n.facet(Yt).defaultKeymap?[LM]:[]));class G1{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class ea{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let o=i.facet(zc).markerFilter;o&&(e=o(e,i));let a=e.slice().sort((v,C)=>v.from-C.from||v.to-C.to),r=new Yi,c=[],d=0,f=i.doc.iter(),g=0,m=i.doc.length;for(let v=0;;){let C=v==a.length?null:a[v];if(!C&&!c.length)break;let k,w;if(c.length)k=d,w=c.reduce((M,T)=>Math.min(M,T.to),C&&C.from>k?C.from:1e8);else{if(k=C.from,k>m)break;w=C.to,c.push(C),v++}for(;v<a.length;){let M=a[v];if(M.from==k&&(M.to>M.from||M.to==k))c.push(M),v++,w=Math.min(M.to,w);else{w=Math.min(M.from,w);break}}w=Math.min(w,m);let D=!1;if(c.some(M=>M.from==k&&(M.to==w||w==m))&&(D=k==w,!D&&w-k<10)){let M=k-(g+f.value.length);M>0&&(f.next(M),g=k);for(let T=k;;){if(T>=w){D=!0;break}if(!f.lineBreak&&g+f.value.length>T)break;T=g+f.value.length,g+=f.value.length,f.next()}}let O=UG(c);if(D)r.add(k,k,Pe.widget({widget:new jG(O),diagnostics:c.slice()}));else{let M=c.reduce((T,L)=>L.markClass?T+" "+L.markClass:T,"");r.add(k,w,Pe.mark({class:"cm-lintRange cm-lintRange-"+O+M,diagnostics:c.slice(),inclusiveEnd:c.some(T=>T.to>w)}))}if(d=w,d==m)break;for(let M=0;M<c.length;M++)c[M].to<=d&&c.splice(M--,1)}let x=r.finish();return new ea(x,t,ks(x))}}function ks(n,e=null,t=0){let i=null;return n.between(t,1e9,(o,a,{spec:r})=>{if(!(e&&r.diagnostics.indexOf(e)<0))if(!i)i=new G1(o,a,e||r.diagnostics[0]);else{if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new G1(i.from,a,i.diagnostic)}}),i}function OG(n,e){let t=e.pos,i=e.end||t,o=n.state.facet(zc).hideOn(n,t,i);if(o!=null)return o;let a=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(r=>r.is(RM))||n.changes.touchesRange(a.from,Math.max(a.to,i)))}function TG(n,e){return n.field(Yn,!1)?e:e.concat(Le.appendConfig.of(zG))}const RM=Le.define(),Kx=Le.define(),EM=Le.define(),Yn=hn.define({create(){return new ea(Pe.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,o=n.panel;if(n.selected){let a=e.changes.mapPos(n.selected.from,1);i=ks(t,n.selected.diagnostic,a)||ks(t,null,a)}!t.size&&o&&e.state.facet(zc).autoPanel&&(o=null),n=new ea(t,o,i)}for(let t of e.effects)if(t.is(RM)){let i=e.state.facet(zc).autoPanel?t.value.length?Fc.open:null:n.panel;n=ea.init(t.value,i,e.state)}else t.is(Kx)?n=new ea(n.diagnostics,t.value?Fc.open:null,n.selected):t.is(EM)&&(n=new ea(n.diagnostics,n.panel,t.value));return n},provide:n=>[Lc.from(n,e=>e.panel),ue.decorations.from(n,e=>e.diagnostics)]}),MG=Pe.mark({class:"cm-lintRange cm-lintRange-active"});function NG(n,e,t){let{diagnostics:i}=n.state.field(Yn),o,a=-1,r=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(d,f,{spec:g})=>{if(e>=d&&e<=f&&(d==f||(e>d||t>0)&&(e<f||t<0)))return o=g.diagnostics,a=d,r=f,!1});let c=n.state.facet(zc).tooltipFilter;return o&&c&&(o=c(o,n.state)),o?{pos:a,end:r,above:n.state.doc.lineAt(a).to<r,create(){return{dom:LG(n,o)}}}:null}function LG(n,e){return dt("ul",{class:"cm-tooltip-lint"},e.map(t=>jM(n,t,!1)))}const RG=n=>{let e=n.state.field(Yn,!1);(!e||!e.panel)&&n.dispatch({effects:TG(n.state,[Kx.of(!0)])});let t=Cx(n,Fc.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},K1=n=>{let e=n.state.field(Yn,!1);return!e||!e.panel?!1:(n.dispatch({effects:Kx.of(!1)}),!0)},EG=n=>{let e=n.state.field(Yn,!1);if(!e)return!1;let t=n.state.selection.main,i=ks(e.diagnostics,null,t.to+1);return!i&&(i=ks(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Mz(n,i.from,1,{tooltip:BM,until:o=>o.docChanged||o.newSelection.main.head<i.from||o.newSelection.main.head>i.to}),!0)},IG=[{key:"Mod-Shift-m",run:RG,preventDefault:!0},{key:"F8",run:EG}],zc=pe.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Xi(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:V1,tooltipFilter:V1,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,o,a)=>e(i,o,a)||t(i,o,a):e:t,autoPanel:(e,t)=>e||t})}}});function V1(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function IM(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let o=t[i];if(/[a-zA-Z]/.test(o)&&!e.some(a=>a.toLowerCase()==o.toLowerCase())){e.push(o);continue e}}e.push("")}return e}function jM(n,e,t){var i;let o=t?IM(e.actions):[];return dt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},dt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((a,r)=>{let c=!1,d=v=>{if(v.preventDefault(),c)return;c=!0;let C=ks(n.state.field(Yn).diagnostics,e);C&&a.apply(n,C.from,C.to)},{name:f}=a,g=o[r]?f.indexOf(o[r]):-1,m=g<0?f:[f.slice(0,g),dt("u",f.slice(g,g+1)),f.slice(g+1)],x=a.markClass?" "+a.markClass:"";return dt("button",{type:"button",class:"cm-diagnosticAction"+x,onclick:d,onmousedown:d,"aria-label":` Action: ${f}${g<0?"":` (access key "${o[r]})"`}.`},m)}),e.source&&dt("div",{class:"cm-diagnosticSource"},e.source))}class jG extends Ji{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return dt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class W1{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=jM(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Fc{constructor(e){this.view=e,this.items=[];let t=o=>{if(!(o.ctrlKey||o.altKey||o.metaKey)){if(o.keyCode==27)K1(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],r=IM(a.actions);for(let c=0;c<r.length;c++)if(r[c].toUpperCase().charCodeAt(0)==o.keyCode){let d=ks(this.view.state.field(Yn).diagnostics,a);d&&a.actions[c].apply(e,d.from,d.to)}}else return;o.preventDefault()}},i=o=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(o.target)&&this.moveSelection(a)};this.list=dt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=dt("div",{class:"cm-panel-lint"},this.list,dt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>K1(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Yn).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Yn),i=0,o=!1,a=null,r=new Set;for(e.between(0,this.view.state.doc.length,(c,d,{spec:f})=>{for(let g of f.diagnostics){if(r.has(g))continue;r.add(g);let m=-1,x;for(let v=i;v<this.items.length;v++)if(this.items[v].diagnostic==g){m=v;break}m<0?(x=new W1(this.view,g),this.items.splice(i,0,x),o=!0):(x=this.items[m],m>i&&(this.items.splice(i,m-i),o=!0)),t&&x.diagnostic==t.diagnostic?x.dom.hasAttribute("aria-selected")||(x.dom.setAttribute("aria-selected","true"),a=x):x.dom.hasAttribute("aria-selected")&&x.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new W1(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:c,panel:d})=>{let f=d.height/this.list.offsetHeight;c.top<d.top?this.list.scrollTop-=(d.top-c.top)/f:c.bottom>d.bottom&&(this.list.scrollTop+=(c.bottom-d.bottom)/f)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Yn),i=ks(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:EM.of(i)})}static open(e){return new Fc(e)}}function BG(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Yd(n){return BG(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const HG=ue.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Yd("#f11")},".cm-lintRange-warning":{backgroundImage:Yd("orange")},".cm-lintRange-info":{backgroundImage:Yd("#999")},".cm-lintRange-hint":{backgroundImage:Yd("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function _G(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function UG(n){let e="hint",t=1;for(let i of n){let o=_G(i.severity);o>t&&(t=o,e=i.severity)}return e}const BM=Tz(NG,{hideOn:OG}),zG=[Yn,ue.decorations.compute([Yn],n=>{let{selected:e,panel:t}=n.field(Yn);return!e||!t||e.from==e.to?Pe.none:Pe.set([MG.range(e.from,e.to)])}),BM,HG];var Q1=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,i=[];e.closeBracketsKeymap!==!1&&(i=i.concat(xG)),e.defaultKeymap!==!1&&(i=i.concat(d6)),e.searchKeymap!==!1&&(i=i.concat(H6)),e.historyKeymap!==!1&&(i=i.concat(bq)),e.foldKeymap!==!1&&(i=i.concat(OF)),e.completionKeymap!==!1&&(i=i.concat(LM)),e.lintKeymap!==!1&&(i=i.concat(IG));var o=[];return e.lineNumbers!==!1&&o.push(qz()),e.highlightActiveLineGutter!==!1&&o.push(Vz()),e.highlightSpecialChars!==!1&&o.push(oz()),e.history!==!1&&o.push(cq()),e.foldGutter!==!1&&o.push(LF()),e.drawSelection!==!1&&o.push(W4()),e.dropCursor!==!1&&o.push(J4()),e.allowMultipleSelections!==!1&&o.push(Qe.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(xF()),e.syntaxHighlighting!==!1&&o.push(Mx(jF,{fallback:!0})),e.bracketMatching!==!1&&o.push(qF()),e.closeBrackets!==!1&&o.push(gG()),e.autocompletion!==!1&&o.push(PG()),e.rectangularSelection!==!1&&o.push(bz()),t!==!1&&o.push(Cz()),e.highlightActiveLine!==!1&&o.push(uz()),e.highlightSelectionMatches!==!1&&o.push(y6()),e.tabSize&&typeof e.tabSize=="number"&&o.push(xf.of(" ".repeat(e.tabSize))),o.concat([mf.of(i.flat())]).filter(Boolean)};const FG="#e5c07b",Y1="#e06c75",qG="#56b6c2",GG="#ffffff",lh="#abb2bf",cb="#7d8799",KG="#61afef",VG="#98c379",$1="#d19a66",WG="#c678dd",QG="#21252b",X1="#2c313a",J1="#282c34",Km="#353a42",YG="#3E4451",Z1="#528bff",$G=ue.theme({"&":{color:lh,backgroundColor:J1},".cm-content":{caretColor:Z1},".cm-cursor, .cm-dropCursor":{borderLeftColor:Z1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:YG},".cm-panels":{backgroundColor:QG,color:lh},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:J1,color:cb,border:"none"},".cm-activeLineGutter":{backgroundColor:X1},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Km},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Km,borderBottomColor:Km},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:X1,color:lh}}},{dark:!0}),XG=Wr.define([{tag:E.keyword,color:WG},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:Y1},{tag:[E.function(E.variableName),E.labelName],color:KG},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:$1},{tag:[E.definition(E.name),E.separator],color:lh},{tag:[E.typeName,E.className,E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:FG},{tag:[E.operator,E.operatorKeyword,E.url,E.escape,E.regexp,E.link,E.special(E.string)],color:qG},{tag:[E.meta,E.comment],color:cb},{tag:E.strong,fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.link,color:cb,textDecoration:"underline"},{tag:E.heading,fontWeight:"bold",color:Y1},{tag:[E.atom,E.bool,E.special(E.variableName)],color:$1},{tag:[E.processingInstruction,E.string,E.inserted],color:VG},{tag:E.invalid,color:GG}]),JG=[$G,Mx(XG)];var ZG=ue.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),e8=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:o=!1,theme:a="light",placeholder:r="",basicSetup:c=!0}=e,d=[];switch(t&&d.unshift(mf.of([h6])),c&&(typeof c=="boolean"?d.unshift(Q1()):d.unshift(Q1(c))),r&&d.unshift(pz(r)),a){case"light":d.push(ZG);break;case"dark":d.push(JG);break;case"none":break;default:d.push(a);break}return i===!1&&d.push(ue.editable.of(!1)),o&&d.push(Qe.readOnly.of(!0)),[...d]},t8=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class n8{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class eA{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Vm=null,i8=()=>typeof window>"u"?new eA:(Vm||(Vm=new eA),Vm),tA=$i.define(),o8=200,s8=[];function a8(n){var{value:e,selection:t,onChange:i,onStatistics:o,onCreateEditor:a,onUpdate:r,extensions:c=s8,autoFocus:d,theme:f="light",height:g=null,minHeight:m=null,maxHeight:x=null,width:v=null,minWidth:C=null,maxWidth:k=null,placeholder:w="",editable:D=!0,readOnly:O=!1,indentWithTab:M=!0,basicSetup:T=!0,root:L,initialState:N}=n,[I,K]=A.useState(),[U,z]=A.useState(),[X,_]=A.useState(),V=A.useState(()=>({current:null}))[0],ie=A.useState(()=>({current:null}))[0],oe=ue.theme({"&":{height:g,minHeight:m,maxHeight:x,width:v,minWidth:C,maxWidth:k},"& .cm-scroller":{height:"100% !important"}}),B=ue.updateListener.of(Y=>{if(Y.docChanged&&typeof i=="function"&&!Y.transactions.some(be=>be.annotation(tA))){V.current?V.current.reset():(V.current=new n8(()=>{if(ie.current){var be=ie.current;ie.current=null,be()}V.current=null},o8),i8().add(V.current));var ae=Y.state.doc,de=ae.toString();i(de,Y)}o&&o(t8(Y))}),Z=e8({theme:f,editable:D,readOnly:O,placeholder:w,indentWithTab:M,basicSetup:T}),se=[B,oe,...Z];return r&&typeof r=="function"&&se.push(ue.updateListener.of(r)),se=se.concat(c),A.useLayoutEffect(()=>{if(I&&!X){var Y={doc:e,selection:t,extensions:se},ae=N?Qe.fromJSON(N.json,Y,N.fields):Qe.create(Y);if(_(ae),!U){var de=new ue({state:ae,parent:I,root:L});z(de),a&&a(de,ae)}}return()=>{U&&(_(void 0),z(void 0))}},[I,X]),A.useEffect(()=>{n.container&&K(n.container)},[n.container]),A.useEffect(()=>()=>{U&&(U.destroy(),z(void 0)),V.current&&(V.current.cancel(),V.current=null)},[U]),A.useEffect(()=>{d&&U&&U.focus()},[d,U]),A.useEffect(()=>{U&&U.dispatch({effects:Le.reconfigure.of(se)})},[f,c,g,m,x,v,C,k,w,D,O,M,T,i,r]),A.useEffect(()=>{if(e!==void 0){var Y=U?U.state.doc.toString():"";if(U&&e!==Y){var ae=V.current&&!V.current.isDone,de=()=>{U&&e!==U.state.doc.toString()&&U.dispatch({changes:{from:0,to:U.state.doc.toString().length,insert:e||""},annotations:[tA.of(!0)]})};ae?ie.current=de:de()}}},[e,U]),{state:X,setState:_,view:U,setView:z,container:I,setContainer:K}}var r8=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],HM=A.forwardRef((n,e)=>{var{className:t,value:i="",selection:o,extensions:a=[],onChange:r,onStatistics:c,onCreateEditor:d,onUpdate:f,autoFocus:g,theme:m="light",height:x,minHeight:v,maxHeight:C,width:k,minWidth:w,maxWidth:D,basicSetup:O,placeholder:M,indentWithTab:T,editable:L,readOnly:N,root:I,initialState:K}=n,U=j2(n,r8),z=A.useRef(null),{state:X,view:_,container:V,setContainer:ie}=a8({root:I,value:i,autoFocus:g,theme:m,height:x,minHeight:v,maxHeight:C,width:k,minWidth:w,maxWidth:D,basicSetup:O,placeholder:M,indentWithTab:T,editable:L,readOnly:N,selection:o,onChange:r,onStatistics:c,onCreateEditor:d,onUpdate:f,extensions:a,initialState:K});A.useImperativeHandle(e,()=>({editor:z.current,state:X,view:_}),[z,V,X,_]);var oe=A.useCallback(Z=>{z.current=Z,ie(Z)},[ie]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof m=="string"?"cm-theme-"+m:"cm-theme";return p.jsx("div",B2({ref:oe,className:""+B+(t?" "+t:"")},U))});HM.displayName="CodeMirror";var nA={};class zh{constructor(e,t,i,o,a,r,c,d,f,g=0,m){this.p=e,this.stack=t,this.state=i,this.reducePos=o,this.pos=a,this.score=r,this.buffer=c,this.bufferBase=d,this.curContext=f,this.lookAhead=g,this.parent=m}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let o=e.parser.context;return new zh(e,[],t,i,i,0,[],0,o?new iA(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,o=e&65535,{parser:a}=this.p,r=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),c=a.dynamicPrecedence(o);if(c&&(this.score+=c),i==0){o<a.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(a.getGoto(this.state,o,!0),this.reducePos),o<a.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,r?8:4,!0),this.reduceContext(o,this.reducePos);return}let d=this.stack.length-(i-1)*3-(e&262144?6:0),f=d?this.stack[d-2]:this.p.ranges[0].from;o<a.minRepeatTerm&&f==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let g=this.reducePos-f;g>=2e3&&!(!((t=this.p.parser.nodeSet.types[o])===null||t===void 0)&&t.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=g):this.p.lastBigReductionSize<g&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=g));let m=d?this.stack[d-1]:0,x=this.bufferBase+this.buffer.length-m;if(o<a.minRepeatTerm||e&131072){let v=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,f,v,x+4,!0)}if(e&262144)this.state=this.stack[d];else{let v=this.stack[d-3];this.state=a.getGoto(v,o,!0)}for(;this.stack.length>d;)this.stack.pop();this.reduceContext(o,f)}storeNode(e,t,i,o=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let r=this.buffer.length;if(r>0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(t==i)return;if(this.buffer[r-2]>=t){this.buffer[r-2]=i;return}}}if(!a||this.pos==i)this.buffer.push(e,t,i,o);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let c=!1;for(let d=r;d>0&&this.buffer[d-2]>i;d-=4)if(this.buffer[d-1]>=0){c=!0;break}if(c)for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=o}}shift(e,t,i,o){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let a=e,{parser:r}=this.p;this.pos=o;let c=r.stateFlag(a,1);!c&&(o>i||t<=r.maxNode)&&(this.reducePos=o),this.pushState(a,c?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=r.maxNode&&this.buffer.push(t,i,o,4)}else this.pos=o,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,o,4)}apply(e,t,i,o){e&65536?this.reduce(e):this.shift(e,t,i,o)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(i,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new zh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new l8(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let o=[];for(let a=0,r;a<t.length;a+=2)(r=t[a+1])!=this.state&&this.p.parser.hasAction(r,e)&&o.push(t[a],r);if(this.stack.length<120)for(let a=0;o.length<8&&a<t.length;a+=2){let r=t[a+1];o.some((c,d)=>d&1&&c==r)||o.push(t[a],r)}t=o}let i=[];for(let o=0;o<t.length&&i.length<4;o+=2){let a=t[o+1];if(a==this.state)continue;let r=this.split();r.pushState(a,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[o],this.pos),r.reducePos=this.pos,r.score-=200,i.push(r)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,o=t&65535,a=this.stack.length-i*3;if(a<0||e.getGoto(this.stack[a],o,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;t=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(o,a)=>{if(!t.includes(o))return t.push(o),e.allActions(o,r=>{if(!(r&393216))if(r&65536){let c=(r>>19)-a;if(c>1){let d=r&65535,f=this.stack.length-c*3;if(f>=0&&e.getGoto(this.stack[f],d,!1)>=0)return c<<19|65536|d}}else{let c=i(r,a+1);if(c!=null)return c}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new iA(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class iA{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class l8{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class Fh{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fh(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fh(this.stack,this.pos,this.index)}}function $d(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,o=0;i<n.length;){let a=0;for(;;){let r=n.charCodeAt(i++),c=!1;if(r==126){a=65535;break}r>=92&&r--,r>=34&&r--;let d=r-32;if(d>=46&&(d-=46,c=!0),a+=d,c)break;a*=46}t?t[o++]=a:t=new e(a)}return t}class ch{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const oA=new ch;class c8{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=oA,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,o=this.rangeIndex,a=this.pos+e;for(;a<i.from;){if(!o)return null;let r=this.ranges[--o];a-=i.from-r.to,i=r}for(;t<0?a>i.to:a>=i.to;){if(o==this.ranges.length-1)return null;let r=this.ranges[++o];a+=r.from-i.to,i=r}return a}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,o;if(t>=0&&t<this.chunk.length)i=this.pos+e,o=this.chunk.charCodeAt(t);else{let a=this.resolveOffset(e,1);if(a==null)return-1;if(i=a,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let r=this.rangeIndex,c=this.range;for(;c.to<=i;)c=this.ranges[++r];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>c.to&&(this.chunk2=this.chunk2.slice(0,c.to-i)),o=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),o}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=oA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(i+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return i}}class Nr{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;u8(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Nr.prototype.contextual=Nr.prototype.fallback=Nr.prototype.extend=!1;Nr.prototype.fallback=Nr.prototype.extend=!1;class Of{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function u8(n,e,t,i,o,a){let r=0,c=1<<i,{dialect:d}=t.p.parser;e:for(;(c&n[r])!=0;){let f=n[r+1];for(let v=r+3;v<f;v+=2)if((n[v+1]&c)>0){let C=n[v];if(d.allows(C)&&(e.token.value==-1||e.token.value==C||d8(C,e.token.value,o,a))){e.acceptToken(C);break}}let g=e.next,m=0,x=n[r+2];if(e.next<0&&x>m&&n[f+x*3-3]==65535){r=n[f+x*3-1];continue e}for(;m<x;){let v=m+x>>1,C=f+v+(v<<1),k=n[C],w=n[C+1]||65536;if(g<k)x=v;else if(g>=w)m=v+1;else{r=n[C+2],e.advance();continue e}}break}}function sA(n,e,t){for(let i=e,o;(o=n[i])!=65535;i++)if(o==t)return i-e;return-1}function d8(n,e,t,i){let o=sA(t,i,e);return o<0||sA(t,i,n)<o}const Kn=typeof process<"u"&&nA&&/\bparse\b/.test(nA.LOG);let Wm=null;function aA(n,e,t){let i=n.cursor(Tt.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class h8{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?aA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?aA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],o=this.index[t];if(o==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=i.children[o],r=this.start[t]+i.positions[o];if(r>e)return this.nextStart=r,null;if(a instanceof ht){if(r==e){if(r<this.safeFrom)return null;let c=r+a.length;if(c<=this.safeTo){let d=a.prop(_e.lookAhead);if(!d||c+d<this.fragment.to)return a}}this.index[t]++,r+a.length>=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(r),this.index.push(0))}else this.index[t]++,this.nextStart=r+a.length}}}class f8{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new ch)}getActions(e){let t=0,i=null,{parser:o}=e.p,{tokenizers:a}=o,r=o.stateSlot(e.state,3),c=e.curContext?e.curContext.hash:0,d=0;for(let f=0;f<a.length;f++){if((1<<f&r)==0)continue;let g=a[f],m=this.tokens[f];if(!(i&&!g.fallback)&&((g.contextual||m.start!=e.pos||m.mask!=r||m.context!=c)&&(this.updateCachedToken(m,g,e),m.mask=r,m.context=c),m.lookAhead>m.end+25&&(d=Math.max(m.lookAhead,d)),m.value!=0)){let x=t;if(m.extended>-1&&(t=this.addActions(e,m.extended,m.end,t)),t=this.addActions(e,m.value,m.end,t),!g.extend&&(i=m,t>x))break}}for(;this.actions.length>t;)this.actions.pop();return d&&e.setLookAhead(d),!i&&e.pos==this.stream.end&&(i=new ch,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ch,{pos:i,p:o}=e;return t.start=i,t.end=Math.min(i+1,o.stream.end),t.value=i==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,i){let o=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(o,e),i),e.value>-1){let{parser:a}=i.p;for(let r=0;r<a.specialized.length;r++)if(a.specialized[r]==e.value){let c=a.specializers[r](this.stream.read(e.start,e.end),i);if(c>=0&&i.p.parser.dialect.allows(c>>1)){(c&1)==0?e.value=c>>1:e.extended=c>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,i,o){for(let a=0;a<o;a+=3)if(this.actions[a]==e)return o;return this.actions[o++]=e,this.actions[o++]=t,this.actions[o++]=i,o}addActions(e,t,i,o){let{state:a}=e,{parser:r}=e.p,{data:c}=r;for(let d=0;d<2;d++)for(let f=r.stateSlot(a,d?2:1);;f+=3){if(c[f]==65535)if(c[f+1]==1)f=Co(c,f+2);else{o==0&&c[f+1]==2&&(o=this.putAction(Co(c,f+2),t,i,o));break}c[f]==t&&(o=this.putAction(Co(c,f+1),t,i,o))}return o}}class p8{constructor(e,t,i,o){this.parser=e,this.input=t,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new c8(t,o),this.tokens=new f8(e,this.stream),this.topTerm=e.top[1];let{from:a}=o[0];this.stacks=[zh.start(this,e.top[0],a)],this.fragments=i.length&&this.stream.end-a>e.bufferLength*4?new h8(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],o,a;if(this.bigReductionCount>300&&e.length==1){let[r]=e;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<e.length;r++){let c=e[r];for(;;){if(this.tokens.mainToken=null,c.pos>t)i.push(c);else{if(this.advanceStack(c,i,e))continue;{o||(o=[],a=[]),o.push(c);let d=this.tokens.getMainToken(c);a.push(d.value,d.end)}}break}}if(!i.length){let r=o&&y8(o);if(r)return Kn&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw Kn&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&o){let r=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,a,i);if(r)return Kn&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(i.length>r)for(i.sort((c,d)=>d.score-c.score);i.length>r;)i.pop();i.some(c=>c.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let r=0;r<i.length-1;r++){let c=i[r];for(let d=r+1;d<i.length;d++){let f=i[d];if(c.sameState(f)||c.buffer.length>500&&f.buffer.length>500)if((c.score-f.score||c.buffer.length-f.buffer.length)>0)i.splice(d--,1);else{i.splice(r--,1);continue e}}}i.length>12&&(i.sort((r,c)=>c.score-r.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let r=1;r<i.length;r++)i[r].pos<this.minStackPos&&(this.minStackPos=i[r].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let o=e.pos,{parser:a}=this,r=Kn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let f=e.curContext&&e.curContext.tracker.strict,g=f?e.curContext.hash:0;for(let m=this.fragments.nodeAt(o);m;){let x=this.parser.nodeSet.types[m.type.id]==m.type?a.getGoto(e.state,m.type.id):-1;if(x>-1&&m.length&&(!f||(m.prop(_e.contextHash)||0)==g))return e.useNode(m,x),Kn&&console.log(r+this.stackID(e)+` (via reuse of ${a.getName(m.type.id)})`),!0;if(!(m instanceof ht)||m.children.length==0||m.positions[0]>0)break;let v=m.children[0];if(v instanceof ht&&m.positions[0]==0)m=v;else break}}let c=a.stateSlot(e.state,4);if(c>0)return e.reduce(c),Kn&&console.log(r+this.stackID(e)+` (via always-reduce ${a.getName(c&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let f=0;f<d.length;){let g=d[f++],m=d[f++],x=d[f++],v=f==d.length||!i,C=v?e:e.split(),k=this.tokens.mainToken;if(C.apply(g,m,k?k.start:C.pos,x),Kn&&console.log(r+this.stackID(C)+` (via ${(g&65536)==0?"shift":`reduce of ${a.getName(g&65535)}`} for ${a.getName(m)} @ ${o}${C==e?"":", split"})`),v)return!0;C.pos>o?t.push(C):i.push(C)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return rA(e,t),!0}}runRecovery(e,t,i){let o=null,a=!1;for(let r=0;r<e.length;r++){let c=e[r],d=t[r<<1],f=t[(r<<1)+1],g=Kn?this.stackID(c)+" -> ":"";if(c.deadEnd&&(a||(a=!0,c.restart(),Kn&&console.log(g+this.stackID(c)+" (restarted)"),this.advanceFully(c,i))))continue;let m=c.split(),x=g;for(let v=0;v<10&&m.forceReduce()&&(Kn&&console.log(x+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,i));v++)Kn&&(x=this.stackID(m)+" -> ");for(let v of c.recoverByInsert(d))Kn&&console.log(g+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,i);this.stream.end>c.pos?(f==c.pos&&(f++,d=0),c.recoverByDelete(d,f),Kn&&console.log(g+this.stackID(c)+` (via recover-delete ${this.parser.getName(d)})`),rA(c,i)):(!o||o.score<m.score)&&(o=m)}return o}stackToTree(e){return e.close(),ht.build({buffer:Fh.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Wm||(Wm=new WeakMap)).get(e);return t||Wm.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function rA(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class g8{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const Qm=n=>n;class m8{constructor(e){this.start=e.start,this.shift=e.shift||Qm,this.reduce=e.reduce||Qm,this.reuse=e.reuse||Qm,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class qc extends Ax{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let c=0;c<e.repeatNodeCount;c++)t.push("");let i=Object.keys(e.topRules).map(c=>e.topRules[c][1]),o=[];for(let c=0;c<t.length;c++)o.push([]);function a(c,d,f){o[c].push([d,d.deserialize(String(f))])}if(e.nodeProps)for(let c of e.nodeProps){let d=c[0];typeof d=="string"&&(d=_e[d]);for(let f=1;f<c.length;){let g=c[f++];if(g>=0)a(g,d,c[f++]);else{let m=c[f+-g];for(let x=-g;x>0;x--)a(c[f++],d,m);f++}}}this.nodeSet=new bf(t.map((c,d)=>Cn.define({name:d>=this.minRepeatTerm?void 0:c,id:d,props:o[d],top:i.indexOf(d)>-1,error:d==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(d)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=rT;let r=$d(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let c=0;c<this.specializerSpecs.length;c++)this.specialized[c]=this.specializerSpecs[c].term;this.specializers=this.specializerSpecs.map(lA),this.states=$d(e.states,Uint32Array),this.data=$d(e.stateData),this.goto=$d(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(c=>typeof c=="number"?new Nr(r,c):c),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let o=new p8(this,e,t,i);for(let a of this.wrappers)o=a(o,e,t,i);return o}getGoto(e,t,i=!1){let o=this.goto;if(t>=o[0])return-1;for(let a=o[t+1];;){let r=o[a++],c=r&1,d=o[a++];if(c&&i)return d;for(let f=a+(r>>1);a<f;a++)if(o[a]==e)return d;if(c)return-1}}hasAction(e,t){let i=this.data;for(let o=0;o<2;o++)for(let a=this.stateSlot(e,o?2:1),r;;a+=3){if((r=i[a])==65535)if(i[a+1]==1)r=i[a=Co(i,a+2)];else{if(i[a+1]==2)return Co(i,a+2);break}if(r==t||r==0)return Co(i,a+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),o=i?t(i):void 0;for(let a=this.stateSlot(e,1);o==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=Co(this.data,a+2);else break;o=t(Co(this.data,a+1))}return o}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Co(this.data,i+2);else break;if((this.data[i+2]&1)==0){let o=this.data[i+1];t.some((a,r)=>r&1&&a==o)||t.push(this.data[i],o)}}return t}configure(e){let t=Object.assign(Object.create(qc.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let o=e.tokenizers.find(a=>a.from==i);return o?o.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,o)=>{let a=e.specializers.find(c=>c.from==i.external);if(!a)return i;let r=Object.assign(Object.assign({},i),{external:a.to});return t.specializers[o]=lA(r),r})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let a of e.split(" ")){let r=t.indexOf(a);r>=0&&(i[r]=!0)}let o=null;for(let a=0;a<t.length;a++)if(!i[a])for(let r=this.dialects[t[a]],c;(c=this.data[r++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[c]=1;return new g8(e,i,o)}static deserialize(e){return new qc(e)}}function Co(n,e){return n[e]|n[e+1]<<16}function y8(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function lA(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const b8=Px({String:E.string,Number:E.number,"True False":E.bool,PropertyName:E.propertyName,Null:E.null,", :":E.separator,"[ ]":E.squareBracket,"{ }":E.brace}),x8=qc.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[b8],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),v8=Ic.define({name:"json",parser:x8.configure({props:[Cf.add({Object:y1({except:/^\s*\}/}),Array:y1({except:/^\s*\]/})}),Tx.add({"Object Array":bT})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function C8(){return new gT(v8)}const gr=63,cA=64,S8=1,k8=2,_M=3,w8=4,UM=5,A8=6,P8=7,zM=65,D8=66,O8=8,T8=9,M8=10,N8=11,L8=12,FM=13,R8=19,E8=20,I8=29,j8=33,B8=34,H8=47,_8=0,Vx=1,ub=2,Gc=3,db=4;class ta{constructor(e,t,i){this.parent=e,this.depth=t,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+i}}ta.top=new ta(null,-1,_8);function yc(n,e){for(let t=0,i=e-n.pos-1;;i--,t++){let o=n.peek(i);if(Eo(o)||o==-1)return t}}function hb(n){return n==32||n==9}function Eo(n){return n==10||n==13}function qM(n){return hb(n)||Eo(n)}function aa(n){return n<0||qM(n)}const U8=new m8({start:ta.top,reduce(n,e){return n.type==Gc&&(e==E8||e==B8)?n.parent:n},shift(n,e,t,i){if(e==_M)return new ta(n,yc(i,i.pos),Vx);if(e==zM||e==UM)return new ta(n,yc(i,i.pos),ub);if(e==gr)return n.parent;if(e==R8||e==j8)return new ta(n,0,Gc);if(e==FM&&n.type==db)return n.parent;if(e==H8){let o=/[1-9]/.exec(i.read(i.pos,t.pos));if(o)return new ta(n,n.depth+ +o[0],db)}return n},hash(n){return n.hash}});function qr(n,e,t=0){return n.peek(t)==e&&n.peek(t+1)==e&&n.peek(t+2)==e&&aa(n.peek(t+3))}const z8=new Of((n,e)=>{if(n.next==-1&&e.canShift(cA))return n.acceptToken(cA);let t=n.peek(-1);if((Eo(t)||t<0)&&e.context.type!=Gc){if(qr(n,45))if(e.canShift(gr))n.acceptToken(gr);else return n.acceptToken(S8,3);if(qr(n,46))if(e.canShift(gr))n.acceptToken(gr);else return n.acceptToken(k8,3);let i=0;for(;n.next==32;)i++,n.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==Vx&&(n.next!=45||!aa(n.peek(1))))&&n.next!=-1&&!Eo(n.next)&&n.next!=35&&n.acceptToken(gr,-i)}},{contextual:!0}),F8=new Of((n,e)=>{if(e.context.type==Gc){n.next==63&&(n.advance(),aa(n.next)&&n.acceptToken(P8));return}if(n.next==45)n.advance(),aa(n.next)&&n.acceptToken(e.context.type==Vx&&e.context.depth==yc(n,n.pos-1)?w8:_M);else if(n.next==63)n.advance(),aa(n.next)&&n.acceptToken(e.context.type==ub&&e.context.depth==yc(n,n.pos-1)?A8:UM);else{let t=n.pos;for(;;)if(hb(n.next)){if(n.pos==t)return;n.advance()}else if(n.next==33)GM(n);else if(n.next==38)fb(n);else if(n.next==42){fb(n);break}else if(n.next==39||n.next==34){if(Wx(n,!0))break;return}else if(n.next==91||n.next==123){if(!G8(n))return;break}else{KM(n,!0,!1,0);break}for(;hb(n.next);)n.advance();if(n.next==58){if(n.pos==t&&e.canShift(I8))return;let i=n.peek(1);aa(i)&&n.acceptTokenTo(e.context.type==ub&&e.context.depth==yc(n,t)?D8:zM,t)}}},{contextual:!0});function q8(n){return n>32&&n<127&&n!=34&&n!=37&&n!=44&&n!=60&&n!=62&&n!=92&&n!=94&&n!=96&&n!=123&&n!=124&&n!=125}function uA(n){return n>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70}function dA(n,e){return n.next==37?(n.advance(),uA(n.next)&&n.advance(),uA(n.next)&&n.advance(),!0):q8(n.next)||e&&n.next==44?(n.advance(),!0):!1}function GM(n){if(n.advance(),n.next==60){for(n.advance();;)if(!dA(n,!0)){n.next==62&&n.advance();break}}else for(;dA(n,!1););}function fb(n){for(n.advance();!aa(n.next)&&qh(n.next)!="f";)n.advance()}function Wx(n,e){let t=n.next,i=!1,o=n.pos;for(n.advance();;){let a=n.next;if(a<0)break;if(n.advance(),a==t)if(a==39)if(n.next==39)n.advance();else break;else break;else if(a==92&&t==34)n.next>=0&&n.advance();else if(Eo(a)){if(e)return!1;i=!0}else if(e&&n.pos>=o+1024)return!1}return!i}function G8(n){for(let e=[],t=n.pos+1024;;)if(n.next==91||n.next==123)e.push(n.next),n.advance();else if(n.next==39||n.next==34){if(!Wx(n,!0))return!1}else if(n.next==93||n.next==125){if(e[e.length-1]!=n.next-2)return!1;if(e.pop(),n.advance(),!e.length)return!0}else{if(n.next<0||n.pos>t||Eo(n.next))return!1;n.advance()}}const K8="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function qh(n){return n<33?"u":n>125?"s":K8[n-33]}function Ym(n,e){let t=qh(n);return t!="u"&&!(e&&t=="f")}function KM(n,e,t,i){if(qh(n.next)=="s"||(n.next==63||n.next==58||n.next==45)&&Ym(n.peek(1),t))n.advance();else return!1;let o=n.pos;for(;;){let a=n.next,r=0,c=i+1;for(;qM(a);){if(Eo(a)){if(e)return!1;c=0}else c++;a=n.peek(++r)}if(!(a>=0&&(a==58?Ym(n.peek(r+1),t):a==35?n.peek(r-1)!=32:Ym(a,t)))||!t&&c<=i||c==0&&!t&&(qr(n,45,r)||qr(n,46,r)))break;if(e&&qh(a)=="f")return!1;for(let f=r;f>=0;f--)n.advance();if(e&&n.pos>o+1024)return!1}return!0}const V8=new Of((n,e)=>{if(n.next==33)GM(n),n.acceptToken(L8);else if(n.next==38||n.next==42){let t=n.next==38?M8:N8;fb(n),n.acceptToken(t)}else n.next==39||n.next==34?(Wx(n,!1),n.acceptToken(T8)):KM(n,!1,e.context.type==Gc,e.context.depth)&&n.acceptToken(O8)}),W8=new Of((n,e)=>{let t=e.context.type==db?e.context.depth:-1,i=n.pos;e:for(;;){let o=0,a=n.next;for(;a==32;)a=n.peek(++o);if(!o&&(qr(n,45,o)||qr(n,46,o))||!Eo(a)&&(t<0&&(t=Math.max(e.context.depth+1,o)),o<t))break;for(;;){if(n.next<0)break e;let r=Eo(n.next);if(n.advance(),r)continue e;i=n.pos}}n.acceptTokenTo(FM,i)}),Q8=Px({DirectiveName:E.keyword,DirectiveContent:E.attributeValue,"DirectiveEnd DocEnd":E.meta,QuotedLiteral:E.string,BlockLiteralHeader:E.special(E.string),BlockLiteralContent:E.content,Literal:E.content,"Key/Literal Key/QuotedLiteral":E.definition(E.propertyName),"Anchor Alias":E.labelName,Tag:E.typeName,Comment:E.lineComment,": , -":E.separator,"?":E.punctuation,"[ ]":E.squareBracket,"{ }":E.brace}),Y8=qc.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:U8,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Q8],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[z8,F8,V8,W8,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),$8=Ic.define({name:"yaml",parser:Y8.configure({props:[Cf.add({Stream:n=>{for(let e=n.node.resolve(n.pos,-1);e&&e.to>=n.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return n.baseIndentFor(e);if(e.name=="BlockLiteral")return n.baseIndentFor(e)+n.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return n.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let t=n.column(e.from,1);if(t==n.lineIndent(e.from,1))return t;if(e.to>n.pos)return null}}return null},FlowMapping:m1({closing:"}"}),FlowSequence:m1({closing:"]"})}),Tx.add({"FlowMapping FlowSequence":bT,"Item Pair BlockLiteral":(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function X8(){return new gT($8)}const J8={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(n,e){let t;if(!e.inString&&(t=n.match(/^('''|"""|'|")/))&&(e.stringType=t[0],e.inString=!0),n.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(n.match(e.stringType))e.inString=!1;else if(n.peek()==="\\")n.next(),n.next();else{if(n.eol())break;n.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&n.peek()==="]")return n.next(),e.inArray--,"bracket";if(e.lhs&&n.peek()==="["&&n.skipTo("]"))return n.next(),n.peek()==="]"&&n.next(),"atom";if(n.peek()==="#")return n.skipToEnd(),"comment";if(n.eatSpace())return null;if(e.lhs&&n.eatWhile(function(i){return i!="="&&i!=" "}))return"property";if(e.lhs&&n.peek()==="=")return n.next(),e.lhs=!1,null;if(!e.lhs&&n.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(n.match("true")||n.match("false")))return"atom";if(!e.lhs&&n.peek()==="[")return e.inArray++,n.next(),"bracket";if(!e.lhs&&n.match(/^\-?\d+(?:\.\d+)?/))return"number";n.eatSpace()||n.next()}return null},languageData:{commentTokens:{line:"#"}}};var VM=n=>{var{theme:e,settings:t={},styles:i=[]}=n,o={".cm-gutters":{}},a={};t.background&&(a.backgroundColor=t.background),t.backgroundImage&&(a.backgroundImage=t.backgroundImage),t.foreground&&(a.color=t.foreground),t.fontSize&&(a.fontSize=t.fontSize),(t.background||t.foreground)&&(o["&"]=a),t.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:t.fontFamily}),t.gutterBackground&&(o[".cm-gutters"].backgroundColor=t.gutterBackground),t.gutterForeground&&(o[".cm-gutters"].color=t.gutterForeground),t.gutterBorder&&(o[".cm-gutters"].borderRightColor=t.gutterBorder),t.caret&&(o[".cm-content"]={caretColor:t.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:t.caret});var r={};t.gutterActiveForeground&&(r.color=t.gutterActiveForeground),t.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:t.lineHighlight},r.backgroundColor=t.lineHighlight),o[".cm-activeLineGutter"]=r,t.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:t.selection+" !important"}),t.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:t.selectionMatch});var c=ue.theme(o,{dark:e==="dark"}),d=Wr.define(i),f=[c,Mx(d)];return f};function Z8(n,e){let t=n.slice(0,e).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function eK(n,e,t){let i=n.split(/\r\n|\n|\r/g),o="",a=(Math.log10(e+1)|0)+1;for(let r=e-1;r<=e+1;r++){let c=i[r-1];c&&(o+=r.toString().padEnd(a," "),o+=": ",o+=c,o+=`
31
+ `,r===e&&(o+=" ".repeat(a+t+2),o+=`^
32
+ `))}return o}class Xe extends Error{line;column;codeblock;constructor(e,t){const[i,o]=Z8(t.toml,t.ptr),a=eK(t.toml,i,o);super(`Invalid TOML document: ${e}
33
+
34
+ ${a}`,t),this.line=i,this.column=o,this.codeblock=a}}function tK(n,e){let t=0;for(;n[e-++t]==="\\";);return--t&&t%2}function pb(n,e=0,t=n.length){let i=n.indexOf(`
35
+ `,e);return n[i-1]==="\r"&&i--,i<=t?i:-1}function Tf(n,e){for(let t=e;t<n.length;t++){let i=n[t];if(i===`
36
+ `)return t;if(i==="\r"&&n[t+1]===`
37
+ `)return t+1;if(i<" "&&i!==" "||i==="")throw new Xe("control characters are not allowed in comments",{toml:n,ptr:e})}return n.length}function Oo(n,e,t,i){let o;for(;;){for(;(o=n[e])===" "||o===" "||!t&&(o===`
38
+ `||o==="\r"&&n[e+1]===`
39
+ `);)e++;if(i||o!=="#")break;e=Tf(n,e)}return e}function nK(n,e,t,i,o=!1){if(!i)return e=pb(n,e),e<0?n.length:e;for(let a=e;a<n.length;a++){let r=n[a];if(r==="#")a=pb(n,a);else{if(r===t)return a+1;if(r===i||o&&(r===`
40
+ `||r==="\r"&&n[a+1]===`
41
+ `))return a}}throw new Xe("cannot find end of structure",{toml:n,ptr:e})}function WM(n,e){let t=n[e],i=t===n[e+1]&&n[e+1]===n[e+2]?n.slice(e,e+3):t;e+=i.length-1;do e=n.indexOf(i,++e);while(e>-1&&t!=="'"&&tK(n,e));return e>-1&&(e+=i.length,i.length>1&&(n[e]===t&&e++,n[e]===t&&e++)),e}let iK=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class Cr extends Date{#t=!1;#n=!1;#e=null;constructor(e){let t=!0,i=!0,o="Z";if(typeof e=="string"){let a=e.match(iK);a?(a[1]||(t=!1,e=`0000-01-01T${e}`),i=!!a[2],i&&e[10]===" "&&(e=e.replace(" ","T")),a[2]&&+a[2]>23?e="":(o=a[3]||null,e=e.toUpperCase(),!o&&i&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=t,this.#n=i,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,t="Z"){let i=new Cr(e);return i.#e=t,i}static wrapAsLocalDateTime(e){let t=new Cr(e);return t.#e=null,t}static wrapAsLocalDate(e){let t=new Cr(e);return t.#n=!1,t.#e=null,t}static wrapAsLocalTime(e){let t=new Cr(e);return t.#t=!1,t.#e=null,t}}let oK=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,sK=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,aK=/^[+-]?0[0-9_]/,rK=/^[0-9a-f]{2,8}$/i,hA={b:"\b",t:" ",n:`
42
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function QM(n,e=0,t=n.length){let i=n[e]==="'",o=n[e++]===n[e]&&n[e]===n[e+1];o&&(t-=2,n[e+=2]==="\r"&&e++,n[e]===`
43
+ `&&e++);let a=0,r,c="",d=e;for(;e<t-1;){let f=n[e++];if(f===`
44
+ `||f==="\r"&&n[e]===`
45
+ `){if(!o)throw new Xe("newlines are not allowed in strings",{toml:n,ptr:e-1})}else if(f<" "&&f!==" "||f==="")throw new Xe("control characters are not allowed in strings",{toml:n,ptr:e-1});if(r){if(r=!1,f==="x"||f==="u"||f==="U"){let g=n.slice(e,e+=f==="x"?2:f==="u"?4:8);if(!rK.test(g))throw new Xe("invalid unicode escape",{toml:n,ptr:a});try{c+=String.fromCodePoint(parseInt(g,16))}catch{throw new Xe("invalid unicode escape",{toml:n,ptr:a})}}else if(o&&(f===`
46
+ `||f===" "||f===" "||f==="\r")){if(e=Oo(n,e-1,!0),n[e]!==`
47
+ `&&n[e]!=="\r")throw new Xe("invalid escape: only line-ending whitespace may be escaped",{toml:n,ptr:a});e=Oo(n,e)}else if(f in hA)c+=hA[f];else throw new Xe("unrecognized escape sequence",{toml:n,ptr:a});d=e}else!i&&f==="\\"&&(a=e-1,r=!0,c+=n.slice(d,a))}return c+n.slice(d,t-1)}function lK(n,e,t,i){if(n==="true")return!0;if(n==="false")return!1;if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return i?0n:0;let o=oK.test(n);if(o||sK.test(n)){if(aK.test(n))throw new Xe("leading zeroes are not allowed",{toml:e,ptr:t});n=n.replace(/_/g,"");let r=+n;if(isNaN(r))throw new Xe("invalid number",{toml:e,ptr:t});if(o){if((o=!Number.isSafeInteger(r))&&!i)throw new Xe("integer value cannot be represented losslessly",{toml:e,ptr:t});(o||i===!0)&&(r=BigInt(n))}return r}const a=new Cr(n);if(!a.isValid())throw new Xe("invalid value",{toml:e,ptr:t});return a}function cK(n,e,t){let i=n.slice(e,t),o=i.indexOf("#");return o>-1&&(Tf(n,o),i=i.slice(0,o)),[i.trimEnd(),o]}function Qx(n,e,t,i,o){if(i===0)throw new Xe("document contains excessively nested structures. aborting.",{toml:n,ptr:e});let a=n[e];if(a==="["||a==="{"){let[d,f]=a==="["?hK(n,e,i,o):dK(n,e,i,o);if(t){if(f=Oo(n,f),n[f]===",")f++;else if(n[f]!==t)throw new Xe("expected comma or end of structure",{toml:n,ptr:f})}return[d,f]}let r;if(a==='"'||a==="'"){r=WM(n,e);let d=QM(n,e,r);if(t){if(r=Oo(n,r),n[r]&&n[r]!==","&&n[r]!==t&&n[r]!==`
48
+ `&&n[r]!=="\r")throw new Xe("unexpected character encountered",{toml:n,ptr:r});r+=+(n[r]===",")}return[d,r]}r=nK(n,e,",",t);let c=cK(n,e,r-+(n[r-1]===","));if(!c[0])throw new Xe("incomplete key-value declaration: no value specified",{toml:n,ptr:e});return t&&c[1]>-1&&(r=Oo(n,e+c[1]),r+=+(n[r]===",")),[lK(c[0],n,e,o),r]}let uK=/^[a-zA-Z0-9-_]+[ \t]*$/;function gb(n,e,t="="){let i=e-1,o=[],a=n.indexOf(t,e);if(a<0)throw new Xe("incomplete key-value: cannot find end of key",{toml:n,ptr:e});do{let r=n[e=++i];if(r!==" "&&r!==" ")if(r==='"'||r==="'"){if(r===n[e+1]&&r===n[e+2])throw new Xe("multiline strings are not allowed in keys",{toml:n,ptr:e});let c=WM(n,e);if(c<0)throw new Xe("unfinished string encountered",{toml:n,ptr:e});i=n.indexOf(".",c);let d=n.slice(c,i<0||i>a?a:i),f=pb(d);if(f>-1)throw new Xe("newlines are not allowed in keys",{toml:n,ptr:e+i+f});if(d.trimStart())throw new Xe("found extra tokens after the string part",{toml:n,ptr:c});if(a<c&&(a=n.indexOf(t,c),a<0))throw new Xe("incomplete key-value: cannot find end of key",{toml:n,ptr:e});o.push(QM(n,e,c))}else{i=n.indexOf(".",e);let c=n.slice(e,i<0||i>a?a:i);if(!uK.test(c))throw new Xe("only letter, numbers, dashes and underscores are allowed in keys",{toml:n,ptr:e});o.push(c.trimEnd())}}while(i+1&&i<a);return[o,Oo(n,a+1,!0,!0)]}function dK(n,e,t,i){let o={},a=new Set,r;for(e++;(r=n[e++])!=="}"&&r;){if(r===",")throw new Xe("expected value, found comma",{toml:n,ptr:e-1});if(r==="#")e=Tf(n,e);else if(r!==" "&&r!==" "&&r!==`
49
+ `&&r!=="\r"){let c,d=o,f=!1,[g,m]=gb(n,e-1);for(let C=0;C<g.length;C++){if(C&&(d=f?d[c]:d[c]={}),c=g[C],(f=Object.hasOwn(d,c))&&(typeof d[c]!="object"||a.has(d[c])))throw new Xe("trying to redefine an already defined value",{toml:n,ptr:e});!f&&c==="__proto__"&&Object.defineProperty(d,c,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new Xe("trying to redefine an already defined value",{toml:n,ptr:e});let[x,v]=Qx(n,m,"}",t-1,i);a.add(x),d[c]=x,e=v}}if(!r)throw new Xe("unfinished table encountered",{toml:n,ptr:e});return[o,e]}function hK(n,e,t,i){let o=[],a;for(e++;(a=n[e++])!=="]"&&a;){if(a===",")throw new Xe("expected value, found comma",{toml:n,ptr:e-1});if(a==="#")e=Tf(n,e);else if(a!==" "&&a!==" "&&a!==`
50
+ `&&a!=="\r"){let r=Qx(n,e-1,"]",t-1,i);o.push(r[0]),e=r[1]}}if(!a)throw new Xe("unfinished array encountered",{toml:n,ptr:e});return[o,e]}function fA(n,e,t,i){let o=e,a=t,r,c=!1,d;for(let f=0;f<n.length;f++){if(f){if(o=c?o[r]:o[r]={},a=(d=a[r]).c,i===0&&(d.t===1||d.t===2))return null;if(d.t===2){let g=o.length-1;o=o[g],a=a[g].c}}if(r=n[f],(c=Object.hasOwn(o,r))&&a[r]?.t===0&&a[r]?.d)return null;c||(r==="__proto__"&&(Object.defineProperty(o,r,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,r,{enumerable:!0,configurable:!0,writable:!0})),a[r]={t:f<n.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(d=a[r],d.t!==i&&!(i===1&&d.t===3)||(i===2&&(d.d||(d.d=!0,o[r]=[]),o[r].push(o={}),d.c[d.i++]=d={t:1,d:!1,i:0,c:{}}),d.d))return null;if(d.d=!0,i===1)o=c?o[r]:o[r]={};else if(i===0&&c)return null;return[r,o,d.c]}function fK(n,{maxDepth:e=1e3,integersAsBigInt:t}={}){let i={},o={},a=i,r=o;for(let c=Oo(n,0);c<n.length;){if(n[c]==="["){let d=n[++c]==="[",f=gb(n,c+=+d,"]");if(d){if(n[f[1]-1]!=="]")throw new Xe("expected end of table declaration",{toml:n,ptr:f[1]-1});f[1]++}let g=fA(f[0],i,o,d?2:1);if(!g)throw new Xe("trying to redefine an already defined table or value",{toml:n,ptr:c});r=g[2],a=g[1],c=f[1]}else{let d=gb(n,c),f=fA(d[0],a,r,0);if(!f)throw new Xe("trying to redefine an already defined table or value",{toml:n,ptr:c});let g=Qx(n,d[1],void 0,e,t);f[1][f[0]]=g[0],c=g[1]}if(c=Oo(n,c,!0),n[c]&&n[c]!==`
51
+ `&&n[c]!=="\r")throw new Xe("each key-value declaration must be followed by an end-of-line",{toml:n,ptr:c});c=Oo(n,c)}return i}const pK=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function pA(n){return pK.some(e=>e.test(n))}function gK(n){if(!n.trim())return{valid:!0};try{return JSON.parse(n),{valid:!0}}catch(e){const t=e.message,i=t.match(/position (\d+)/);if(i){const o=parseInt(i[1],10),a=n.substring(0,o).split(`
52
+ `);return{valid:!1,error:t,line:a.length}}return{valid:!1,error:t}}}function mK(n){if(!n.trim())return{valid:!0};try{return fK(n),{valid:!0}}catch(e){const t=e.message,i=t.match(/line\s+(\d+)/i);return{valid:!1,error:t,line:i?Number.parseInt(i[1],10):void 0}}}const yK={yaml:/^(\s*)("(?:[^"\\]|\\.)*"|'[^']*'|[A-Za-z0-9_.-]+)\s*:\s*/gm,toml:/^(\s*)("(?:[^"\\]|\\.)*"|'[^']*'|[A-Za-z0-9_.-]+)\s*=\s*/gm};function bK(n){return n.length>=2&&n[0]==='"'&&n[n.length-1]==='"'?n.slice(1,-1).replace(/\\(.)/g,"$1"):n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"?n.slice(1,-1):n}function Yx(n,e,t){let i=e+1;if(t==="'"){const o=n.indexOf("'",i);return o>=0?o+1:n.length}for(;i<n.length;){const o=n[i];if(o==="\\"){i+=2;continue}if(o==='"')return i+1;i++}return n.length}function xK(n,e){const t=n[e];if(t!=='"'&&t!=="'")return e+1;if(n.slice(e,e+3)===t+t+t){const i=t+t+t,o=n.indexOf(i,e+3);return o>=0?o+3:n.length}return Yx(n,e,t)}function gA(n,e,t,i){const o=n.length;if(e>=o)return e;const a=n.sliceString(e,Math.min(e+3,o));if(t==="toml"){if(a==='"""'||a==="'''"){const r=a,d=n.sliceString(e+3,o).indexOf(r);return d>=0?e+3+d+3:o}if(a[0]==="["){const r=n.toString();let c=0,d=e;for(;d<o;){const f=r[d];if(f==='"'||f==="'"){d=xK(r,d);continue}if(f==="#"){const g=r.indexOf(`
53
+ `,d);d=g>=0?g+1:o;continue}if(f==="[")c++;else if(f==="]"&&(c--,c===0))return d+1;d++}return o}return n.lineAt(e).to}if(t==="yaml"){if(a[0]==="|"||a[0]===">"){let r=n.lineAt(e),c=r.to;for(;r.number<n.lines;){const d=n.line(r.number+1);if(d.text.replace(/\s+$/,"")===""){c=d.to,r=d;continue}if(d.text.search(/\S/)<=i)break;c=d.to,r=d}return c}return n.lineAt(e).to}if(a[0]==="["||a[0]==="{"){const r=a[0],c=r==="["?"]":"}",d=n.toString();let f=0,g=e;for(;g<o;){const m=d[g];if(m==='"'){g=Yx(d,g,'"');continue}if(m===r)f++;else if(m===c&&(f--,f===0))return g+1;g++}return o}return n.lineAt(e).to}function vK(n){const e=[];let t=0,i=null;for(;t<n.length;){const o=n[t];if(o===" "||o===" "||o===`
54
+ `||o==="\r"){t++;continue}if(o==='"'){const a=t,r=Yx(n,t,'"');let c=r;for(;c<n.length&&(n[c]===" "||n[c]===" "||n[c]===`
55
+ `||n[c]==="\r");)c++;if((i==="{"||i===","||i===null)&&n[c]===":"){const g=n.slice(a+1,r-1).replace(/\\(.)/g,"$1");let m=c+1;for(;m<n.length&&(n[m]===" "||n[m]===" "||n[m]===`
56
+ `||n[m]==="\r");)m++;e.push({valueStart:m,key:g}),i='"',t=c+1;continue}i='"',t=r;continue}i=o,t++}return e}function mA(n,e){const t=new Yi,i=n.state.doc,o=i.toString();if(e==="json"){for(const{valueStart:c,key:d}of vK(o)){if(!pA(d)||c>=i.length)continue;const f=gA(i,c,"json",0),g=i.sliceString(c,f).replace(/\s+$/,"").length;g!==0&&t.add(c,c+g,Pe.mark({class:"cm-sensitive-mask"}))}return t.finish()}const a=new RegExp(yK[e].source,"gm");let r;for(;(r=a.exec(o))!==null;){const c=bK(r[2]),d=r[1].length;if(!pA(c))continue;const f=r.index+r[0].length;if(f>=i.length)continue;const g=gA(i,f,e,d),m=i.sliceString(f,g).replace(/\s+$/,"").length;m!==0&&t.add(f,f+m,Pe.mark({class:"cm-sensitive-mask"}))}return t.finish()}function CK(n){return At.fromClass(class{decorations;constructor(e){this.decorations=mA(e,n)}update(e){e.docChanged&&(this.decorations=mA(e.view,n))}},{decorations:e=>e.decorations})}const SK=VM({theme:"light",settings:{background:"transparent",foreground:"#393A34",caret:"#393A34",selection:"rgba(57, 58, 52, 0.18)",selectionMatch:"rgba(57, 58, 52, 0.12)",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#999988"},styles:[{tag:[E.comment,E.lineComment,E.blockComment],color:"#999988",fontStyle:"italic"},{tag:[E.string,E.special(E.string),E.regexp],color:"#e3116c"},{tag:[E.number,E.bool,E.null,E.atom,E.variableName,E.propertyName,E.url],color:"#36acaa"},{tag:[E.keyword,E.attributeName,E.modifier,E.operatorKeyword],color:"#00a4db"},{tag:[E.function(E.variableName),E.labelName],color:"#6f42c1"},{tag:[E.tagName,E.heading],color:"#00009f",fontWeight:"bold"},{tag:[E.deleted,E.invalid],color:"#d73a49"},{tag:[E.punctuation,E.operator,E.bracket,E.brace,E.separator],color:"#393A34"}]}),kK=VM({theme:"dark",settings:{background:"transparent",foreground:"#d6deeb",caret:"#80a4c2",selection:"rgba(29, 59, 83, 0.99)",selectionMatch:"rgba(35, 77, 112, 0.6)",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"#4b6479"},styles:[{tag:[E.comment,E.lineComment,E.blockComment],color:"#637777",fontStyle:"italic"},{tag:[E.string,E.special(E.string),E.url],color:"rgb(173, 219, 103)"},{tag:E.number,color:"rgb(247, 140, 108)"},{tag:[E.bool,E.null,E.atom],color:"rgb(255, 88, 116)"},{tag:[E.keyword,E.modifier,E.operatorKeyword],color:"rgb(127, 219, 202)"},{tag:[E.propertyName,E.attributeName],color:"rgb(128, 203, 196)"},{tag:[E.variableName,E.labelName],color:"rgb(214, 222, 235)"},{tag:E.function(E.variableName),color:"rgb(130, 170, 255)"},{tag:[E.tagName,E.heading],color:"rgb(127, 219, 202)"},{tag:[E.bracket,E.punctuation,E.operator,E.brace,E.separator],color:"rgb(199, 146, 234)"},{tag:[E.className,E.special(E.string)],color:"rgb(255, 203, 139)"},{tag:[E.deleted,E.invalid],color:"rgba(239, 83, 80, 0.56)"}]}),wK=ue.baseTheme({".cm-sensitive-mask":{filter:"blur(3px)",opacity:"0.7",transition:"filter 200ms ease, opacity 200ms ease"},".cm-sensitive-revealed .cm-sensitive-mask":{filter:"none",opacity:"1"}});function YM({value:n,onChange:e,language:t="json",readonly:i=!1,exactText:o=!1,className:a,minHeight:r="300px",heightMode:c="content"}){const{isDark:d}=Mb(),{t:f}=Ce(),[g,m]=A.useState(!1),[x,v]=A.useState(!0),C=c==="fill-parent",k=A.useMemo(()=>t==="json"?gK(n):t==="toml"?mK(n):{valid:!0},[n,t]),w=A.useMemo(()=>[t==="json"?C8():t==="yaml"?X8():Nx.define(J8),ue.lineWrapping,wK,CK(t),ue.theme({"&":{fontSize:"0.875rem",backgroundColor:"transparent"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",padding:"12px 0",caretColor:"currentColor"},".cm-line":{padding:"0 12px",lineHeight:"1.625"},".cm-scroller":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:"1.625"},".cm-gutters":{display:"none"}})],[t]);return p.jsxs("div",{className:q("flex min-h-0 flex-col",C&&"h-full",a),style:C?{height:r==="auto"?void 0:r}:void 0,"data-slot":"code-editor-root",children:[p.jsxs("div",{className:q("relative rounded-md border overflow-hidden bg-muted/30",C&&"flex min-h-0 flex-1 flex-col",g&&"ring-2 ring-ring ring-offset-2 ring-offset-background",i&&"opacity-70",!k.valid&&"border-destructive"),"data-slot":"code-editor-surface",children:[p.jsx("div",{className:q(C?"scrollbar-editor min-h-0 flex-1 overflow-hidden":void 0),"data-slot":C?"code-editor-viewport":void 0,children:p.jsx(HM,{value:n,onChange:i?void 0:e,readOnly:i,editable:!i,theme:d?kK:SK,extensions:w,height:C?"100%":void 0,minHeight:C?void 0:r,basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1,searchKeymap:!0},onFocus:()=>m(!0),onBlur:()=>m(!1),className:q("cm-editor-root",!x&&"cm-sensitive-revealed",C&&"h-full"),"data-slot":"code-editor-codemirror"})}),p.jsx("div",{className:"absolute top-2 right-2 z-20 opacity-50 hover:opacity-100 transition-opacity",children:p.jsx(mt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>v(!x),title:f(x?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:x?p.jsx(Vc,{className:"h-3 w-3"}):p.jsx(Kc,{className:"h-3 w-3"})})})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[k.valid?p.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[p.jsx(Wc,{className:"w-3 h-3 text-green-500"}),f("codeEditor.valid",{language:t.toUpperCase()})]}):p.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[p.jsx(vc,{className:"w-3 h-3"}),k.error,k.line&&` (line ${k.line})`]}),i&&p.jsx("span",{className:"ml-auto text-muted-foreground",children:f("codeEditor.readOnly")})]})]})}const Mf=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:YM},Symbol.toStringTag,{value:"Module"})),AK={browserConfig:null,browserStatus:null,browserLoading:!0,browserStatusLoading:!0,browserSaving:!1,browserError:null,browserSuccess:!1,webSearchConfig:null,webSearchStatus:null,webSearchLoading:!0,webSearchStatusLoading:!0,webSearchSaving:!1,webSearchError:null,webSearchSuccess:!1,globalEnvConfig:null,globalEnvLoading:!0,globalEnvSaving:!1,globalEnvError:null,globalEnvSuccess:!1,proxyConfig:null,proxyLoading:!0,proxySaving:!1,proxyError:null,proxySuccess:!1,proxyTestResult:null,proxyTesting:!1,rawConfig:null,rawConfigLoading:!1};function PK(n,e){switch(e.type){case"SET_BROWSER_CONFIG":return{...n,browserConfig:e.payload};case"SET_BROWSER_STATUS":return{...n,browserStatus:e.payload};case"SET_BROWSER_LOADING":return{...n,browserLoading:e.payload};case"SET_BROWSER_STATUS_LOADING":return{...n,browserStatusLoading:e.payload};case"SET_BROWSER_SAVING":return{...n,browserSaving:e.payload};case"SET_BROWSER_ERROR":return{...n,browserError:e.payload};case"SET_BROWSER_SUCCESS":return{...n,browserSuccess:e.payload};case"SET_WEBSEARCH_CONFIG":return{...n,webSearchConfig:e.payload};case"SET_WEBSEARCH_STATUS":return{...n,webSearchStatus:e.payload};case"SET_WEBSEARCH_LOADING":return{...n,webSearchLoading:e.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...n,webSearchStatusLoading:e.payload};case"SET_WEBSEARCH_SAVING":return{...n,webSearchSaving:e.payload};case"SET_WEBSEARCH_ERROR":return{...n,webSearchError:e.payload};case"SET_WEBSEARCH_SUCCESS":return{...n,webSearchSuccess:e.payload};case"SET_GLOBALENV_CONFIG":return{...n,globalEnvConfig:e.payload};case"SET_GLOBALENV_LOADING":return{...n,globalEnvLoading:e.payload};case"SET_GLOBALENV_SAVING":return{...n,globalEnvSaving:e.payload};case"SET_GLOBALENV_ERROR":return{...n,globalEnvError:e.payload};case"SET_GLOBALENV_SUCCESS":return{...n,globalEnvSuccess:e.payload};case"SET_PROXY_CONFIG":return{...n,proxyConfig:e.payload};case"SET_PROXY_LOADING":return{...n,proxyLoading:e.payload};case"SET_PROXY_SAVING":return{...n,proxySaving:e.payload};case"SET_PROXY_ERROR":return{...n,proxyError:e.payload};case"SET_PROXY_SUCCESS":return{...n,proxySuccess:e.payload};case"SET_PROXY_TEST_RESULT":return{...n,proxyTestResult:e.payload};case"SET_PROXY_TESTING":return{...n,proxyTesting:e.payload};case"SET_RAW_CONFIG":return{...n,rawConfig:e.payload};case"SET_RAW_CONFIG_LOADING":return{...n,rawConfigLoading:e.payload};default:return n}}const $M=A.createContext(null);function DK({children:n}){const[e,t]=A.useReducer(PK,AK);return p.jsx($M.Provider,{value:{state:e,dispatch:t},children:n})}function XM(){const n=A.useContext($M);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function OK(){const{dispatch:n}=XM(),e=A.useCallback(V=>n({type:"SET_BROWSER_CONFIG",payload:V}),[n]),t=A.useCallback(V=>n({type:"SET_BROWSER_STATUS",payload:V}),[n]),i=A.useCallback(V=>n({type:"SET_BROWSER_LOADING",payload:V}),[n]),o=A.useCallback(V=>n({type:"SET_BROWSER_STATUS_LOADING",payload:V}),[n]),a=A.useCallback(V=>n({type:"SET_BROWSER_SAVING",payload:V}),[n]),r=A.useCallback(V=>n({type:"SET_BROWSER_ERROR",payload:V}),[n]),c=A.useCallback(V=>n({type:"SET_BROWSER_SUCCESS",payload:V}),[n]),d=A.useCallback(V=>n({type:"SET_WEBSEARCH_CONFIG",payload:V}),[n]),f=A.useCallback(V=>n({type:"SET_WEBSEARCH_STATUS",payload:V}),[n]),g=A.useCallback(V=>n({type:"SET_WEBSEARCH_LOADING",payload:V}),[n]),m=A.useCallback(V=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:V}),[n]),x=A.useCallback(V=>n({type:"SET_WEBSEARCH_SAVING",payload:V}),[n]),v=A.useCallback(V=>n({type:"SET_WEBSEARCH_ERROR",payload:V}),[n]),C=A.useCallback(V=>n({type:"SET_WEBSEARCH_SUCCESS",payload:V}),[n]),k=A.useCallback(V=>n({type:"SET_GLOBALENV_CONFIG",payload:V}),[n]),w=A.useCallback(V=>n({type:"SET_GLOBALENV_LOADING",payload:V}),[n]),D=A.useCallback(V=>n({type:"SET_GLOBALENV_SAVING",payload:V}),[n]),O=A.useCallback(V=>n({type:"SET_GLOBALENV_ERROR",payload:V}),[n]),M=A.useCallback(V=>n({type:"SET_GLOBALENV_SUCCESS",payload:V}),[n]),T=A.useCallback(V=>n({type:"SET_PROXY_CONFIG",payload:V}),[n]),L=A.useCallback(V=>n({type:"SET_PROXY_LOADING",payload:V}),[n]),N=A.useCallback(V=>n({type:"SET_PROXY_SAVING",payload:V}),[n]),I=A.useCallback(V=>n({type:"SET_PROXY_ERROR",payload:V}),[n]),K=A.useCallback(V=>n({type:"SET_PROXY_SUCCESS",payload:V}),[n]),U=A.useCallback(V=>n({type:"SET_PROXY_TEST_RESULT",payload:V}),[n]),z=A.useCallback(V=>n({type:"SET_PROXY_TESTING",payload:V}),[n]),X=A.useCallback(V=>n({type:"SET_RAW_CONFIG",payload:V}),[n]),_=A.useCallback(V=>n({type:"SET_RAW_CONFIG_LOADING",payload:V}),[n]);return A.useMemo(()=>({setBrowserConfig:e,setBrowserStatus:t,setBrowserLoading:i,setBrowserStatusLoading:o,setBrowserSaving:a,setBrowserError:r,setBrowserSuccess:c,setWebSearchConfig:d,setWebSearchStatus:f,setWebSearchLoading:g,setWebSearchStatusLoading:m,setWebSearchSaving:x,setWebSearchError:v,setWebSearchSuccess:C,setGlobalEnvConfig:k,setGlobalEnvLoading:w,setGlobalEnvSaving:D,setGlobalEnvError:O,setGlobalEnvSuccess:M,setProxyConfig:T,setProxyLoading:L,setProxySaving:N,setProxyError:I,setProxySuccess:K,setProxyTestResult:U,setProxyTesting:z,setRawConfig:X,setRawConfigLoading:_}),[e,t,i,o,a,r,c,d,f,g,m,x,v,C,k,w,D,O,M,T,L,N,I,K,U,z,X,_])}function TK(){const[n,e]=oP(),t=n.get("tab")?.toLowerCase(),i=t==="imageanalysis"||t==="image"?"image":t==="channels"?"channels":t==="globalenv"?"globalenv":t==="proxy"?"proxy":t==="auth"?"auth":t==="thinking"?"thinking":t==="backups"?"backups":"websearch",o=A.useCallback(a=>{e({tab:a},{replace:!0})},[e]);return{activeTab:i,setActiveTab:o}}function MK(){const{state:n}=XM(),e=OK(),[t,i]=A.useState(!1),o=A.useCallback(async()=>{try{e.setRawConfigLoading(!0);const r=await fetch("/api/config/raw");if(!r.ok){e.setRawConfig(null);return}const c=await r.text();e.setRawConfig(c)}catch{e.setRawConfig(null)}finally{e.setRawConfigLoading(!1)}},[e]),a=A.useCallback(async()=>{if(n.rawConfig)try{await navigator.clipboard.writeText(n.rawConfig),i(!0),setTimeout(()=>i(!1),2e3)}catch{}},[n.rawConfig]);return{rawConfig:n.rawConfig,loading:n.rawConfigLoading,copied:t,fetchRawConfig:o,copyToClipboard:a}}function yA({activeTab:n,onTabChange:e}){const{t}=Ce(),i=[{value:"browser",label:t("settingsTabs.browser"),icon:GE},{value:"websearch",label:t("settingsTabs.web"),icon:pP},{value:"image",label:t("settingsTabs.image"),icon:yP},{value:"channels",label:t("settingsTabs.channels"),icon:KE},{value:"globalenv",label:t("settingsTabs.env"),icon:Cb},{value:"thinking",label:t("settingsTabs.think"),icon:VE},{value:"proxy",label:t("settingsTabs.proxy"),icon:WE},{value:"auth",label:t("settingsTabs.auth"),icon:bb},{value:"backups",label:t("settingsTabs.backup"),icon:QE}];return p.jsx(PD,{value:n,onValueChange:o=>e(o),children:p.jsx($b,{className:"grid w-full grid-cols-9",children:i.map(({value:o,label:a,icon:r})=>p.jsxs(bh,{value:o,className:"gap-1.5 px-2 text-xs",children:[p.jsx(r,{className:"h-3.5 w-3.5 shrink-0"}),p.jsx("span",{className:"truncate",children:a})]},o))})})}function bA(){return p.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[p.jsx(tt,{className:"h-4 w-2/3"}),p.jsx("div",{className:"p-4 rounded-lg border",children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(tt,{className:"h-5 w-32"}),p.jsx(tt,{className:"h-4 w-48"})]}),p.jsx(tt,{className:"h-6 w-10 rounded-full"})]})}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(tt,{className:"h-5 w-24"}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(tt,{className:"h-20 w-full rounded-lg"}),p.jsx(tt,{className:"h-20 w-full rounded-lg"}),p.jsx(tt,{className:"h-20 w-full rounded-lg"})]})]})]})}function JM(n,e=3,t=1e3){return n().catch(i=>{if(e<=0)throw i;return new Promise(o=>setTimeout(o,t)).then(()=>JM(n,e-1,t*2))})}function jo(n){return A.lazy(()=>JM(n))}const xA=jo(()=>rt(()=>import("./index-Bgcd4FYK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),vA=jo(()=>rt(()=>import("./index-hHb9o079.js"),__vite__mapDeps([10,1,2,11,4,5,6,7,8,9]))),CA=jo(()=>rt(()=>import("./index-CFu0saCM.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),SA=jo(()=>rt(()=>import("./channels-CimlCc2d.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),kA=jo(()=>rt(()=>import("./globalenv-section-CYNmD12i.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),wA=jo(()=>rt(()=>import("./index-BC5ssPfF.js"),__vite__mapDeps([15,1,2,4,5,6,7,8,9]))),AA=jo(()=>rt(()=>import("./index-D3kxCuJ7.js"),__vite__mapDeps([16,1,2,17,4,18,19,5,6,20,21,7,8,9]))),PA=jo(()=>rt(()=>import("./auth-section-iGkrMaT4.js"),__vite__mapDeps([22,1,2,4,5,6,7,8,9]))),DA=jo(()=>rt(()=>import("./backups-section-DUGG_4KP.js"),__vite__mapDeps([23,1,2,19,4,5,6,7,8,9])));class OA extends A.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?p.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:p.jsxs("div",{className:"text-center p-6 max-w-md",children:[p.jsx(vc,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),p.jsx("p",{className:"font-medium text-foreground mb-2",children:re.t("settings.sectionLoadFailed")}),p.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||re.t("settings.unknownError")}),p.jsxs(mt,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[p.jsx(xc,{className:"w-4 h-4"}),re.t("settings.reloadPage")]})]})}):this.props.children}}function NK(n){switch(n?.toLowerCase()){case"browser":return"browser";case"imageanalysis":case"image":return"image";case"channels":return"channels";case"globalenv":return"globalenv";case"proxy":return"proxy";case"auth":return"auth";case"thinking":return"thinking";case"backups":return"backups";default:return"websearch"}}function LK(){const{t:n}=Ce(),{setActiveTab:e}=TK(),[t]=oP(),i=NK(t.get("tab")),{rawConfig:o,loading:a,copied:r,fetchRawConfig:c,copyToClipboard:d}=MK();A.useEffect(()=>{c()},[c]);const f=g=>{A.startTransition(()=>{e(g)})};return p.jsxs("div",{className:"h-full min-h-0",children:[p.jsxs("div",{className:"md:hidden h-full flex flex-col",children:[p.jsx("div",{className:"border-b bg-background p-4",children:p.jsx(yA,{activeTab:i,onTabChange:f})}),p.jsx(OA,{children:p.jsxs(A.Suspense,{fallback:p.jsx(bA,{}),children:[i==="browser"&&p.jsx(vA,{}),i==="websearch"&&p.jsx(xA,{}),i==="image"&&p.jsx(CA,{}),i==="channels"&&p.jsx(SA,{}),i==="globalenv"&&p.jsx(kA,{}),i==="thinking"&&p.jsx(wA,{}),i==="proxy"&&p.jsx(AA,{}),i==="auth"&&p.jsx(PA,{}),i==="backups"&&p.jsx(DA,{})]})})]}),p.jsxs(Qb,{direction:"horizontal",className:"h-full hidden md:flex",children:[p.jsx(Sc,{defaultSize:46,minSize:36,maxSize:62,children:p.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[p.jsx("div",{className:"p-5 border-b bg-background",children:p.jsx(yA,{activeTab:i,onTabChange:f})}),p.jsx(OA,{children:p.jsxs(A.Suspense,{fallback:p.jsx(bA,{}),children:[i==="browser"&&p.jsx(vA,{}),i==="websearch"&&p.jsx(xA,{}),i==="image"&&p.jsx(CA,{}),i==="channels"&&p.jsx(SA,{}),i==="globalenv"&&p.jsx(kA,{}),i==="thinking"&&p.jsx(wA,{}),i==="proxy"&&p.jsx(AA,{}),i==="auth"&&p.jsx(PA,{}),i==="backups"&&p.jsx(DA,{})]})})]})}),p.jsx(Yb,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:p.jsx(Qh,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),p.jsx(Sc,{defaultSize:54,minSize:35,children:p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(ek,{className:"w-5 h-5 text-primary"}),p.jsxs("div",{children:[p.jsx("h2",{className:"font-semibold",children:"config.yaml"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(mt,{variant:"outline",size:"sm",onClick:d,disabled:!o,children:r?p.jsxs(p.Fragment,{children:[p.jsx(Lr,{className:"w-4 h-4 mr-1"}),n("settings.copied")]}):p.jsxs(p.Fragment,{children:[p.jsx(dh,{className:"w-4 h-4 mr-1"}),n("settings.copy")]})}),p.jsx(mt,{variant:"outline",size:"sm",onClick:c,disabled:a,children:p.jsx(xc,{className:`w-4 h-4 ${a?"animate-spin":""}`})})]})]}),p.jsx("div",{className:"flex-1 overflow-auto",children:o?p.jsx(YM,{value:o,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):a?p.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[p.jsx(xc,{className:"w-5 h-5 animate-spin mr-2"}),n("settings.loading")]}):p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:p.jsxs("div",{className:"text-center",children:[p.jsx(ek,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),p.jsx("p",{children:n("settings.configFileNotFound")}),p.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function RK(){return p.jsx(DK,{children:p.jsx(LK,{})})}const EK=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:RK},Symbol.toStringTag,{value:"Module"}));function IK(n,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const jK={},ic={};function ra(n,e){try{const i=(jK[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return i in ic?ic[i]:TA(i,i.split(":"))}catch{if(n in ic)return ic[n];const t=n?.match(BK);return t?TA(n,t.slice(1)):NaN}}const BK=/([+-]\d\d):?(\d\d)?/;function TA(n,e){const t=+(e[0]||0),i=+(e[1]||0),o=+(e[2]||0)/60;return ic[n]=t*60+i>0?t*60+i+o:t*60-i-o}class Ki extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ra(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ZM(this),mb(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ki(...t,e):new Ki(Date.now(),e)}withTimeZone(e){return new Ki(+this,e)}getTimezoneOffset(){const e=-ra(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),mb(this),+this}[Symbol.for("constructDateFrom")](e){return new Ki(+new Date(e),this.timeZone)}}const MA=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!MA.test(n))return;const e=n.replace(MA,"$1UTC");Ki.prototype[e]&&(n.startsWith("get")?Ki.prototype[n]=function(){return this.internal[e]()}:(Ki.prototype[n]=function(){return Date.prototype[e].apply(this.internal,arguments),HK(this),+this},Ki.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),mb(this),+this}))});function mb(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-ra(n.timeZone,n)*60))}function HK(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),ZM(n)}function ZM(n){const e=ra(n.timeZone,n),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+n);i.setUTCHours(i.getUTCHours()-1);const o=-new Date(+n).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=o-a,c=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();r&&c&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+r);const d=o-t;d&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+d);const f=new Date(+n);f.setUTCSeconds(0);const g=o>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(ra(n.timeZone,n)*60))%60;(m||g)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+m+g));const x=ra(n.timeZone,n),v=x>0?Math.floor(x):Math.ceil(x),k=-new Date(+n).getTimezoneOffset()-v,w=v!==t,D=k-d;if(w&&D){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+D);const O=ra(n.timeZone,n),M=O>0?Math.floor(O):Math.ceil(O),T=v-M;T&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+T))}}class wo extends Ki{static tz(e,...t){return t.length?new wo(...t,e):new wo(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),o=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${i} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,o]=this.tzComponents();return`${e} GMT${t}${i}${o} (${IK(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),o=String(Math.abs(e)%60).padStart(2,"0");return[t,i,o]}withTimeZone(e){return new wo(+this,e)}[Symbol.for("constructDateFrom")](e){return new wo(+new Date(e),this.timeZone)}}const NA=5,_K=4;function UK(n,e){const t=e.startOfMonth(n),i=t.getDay()>0?t.getDay():7,o=e.addDays(n,-i+1),a=e.addDays(o,NA*7-1);return e.getMonth(n)===e.getMonth(a)?NA:_K}function eN(n,e){const t=e.startOfMonth(n),i=t.getDay();return i===1?t:i===0?e.addDays(t,-6):e.addDays(t,-1*(i-1))}function zK(n,e){const t=eN(n,e),i=UK(n,e);return e.addDays(t,i*7-1)}const tN={...Ul,labels:{labelDayButton:(n,e,t,i)=>{let o;i&&typeof i.format=="function"?o=i.format.bind(i):o=(r,c)=>Yl(r,c,{locale:Ul,...t});let a=o(n,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:n=>`Week ${n}`,labelYearDropdown:"Choose the Year",labelGrid:(n,e,t)=>{let i;return t&&typeof t.format=="function"?i=t.format.bind(t):i=(o,a)=>Yl(o,a,{locale:Ul,...e}),i(n,"LLLL yyyy")},labelGridcell:(n,e,t,i)=>{let o;i&&typeof i.format=="function"?o=i.format.bind(i):o=(r,c)=>Yl(r,c,{locale:Ul,...t});let a=o(n,"PPPP");return e?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,e,t)=>{let i;return t&&typeof t.format=="function"?i=t.format.bind(t):i=(o,a)=>Yl(o,a,{locale:Ul,...e}),i(n,"cccc")}}};class $n{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?wo.tz(this.options.timeZone):new this.Date,this.newDate=(i,o,a)=>this.overrides?.newDate?this.overrides.newDate(i,o,a):this.options.timeZone?new wo(i,o,a,this.options.timeZone):new Date(i,o,a),this.addDays=(i,o)=>this.overrides?.addDays?this.overrides.addDays(i,o):ZE(i,o),this.addMonths=(i,o)=>this.overrides?.addMonths?this.overrides.addMonths(i,o):e2(i,o),this.addWeeks=(i,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(i,o):t2(i,o),this.addYears=(i,o)=>this.overrides?.addYears?this.overrides.addYears(i,o):n2(i,o),this.differenceInCalendarDays=(i,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,o):i2(i,o),this.differenceInCalendarMonths=(i,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,o):o2(i,o),this.eachMonthOfInterval=i=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):s2(i),this.eachYearOfInterval=i=>{const o=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(i):a2(i),a=new Set(o.map(c=>this.getYear(c)));if(a.size===o.length)return o;const r=[];return a.forEach(c=>{r.push(new Date(c,0,1))}),r},this.endOfBroadcastWeek=i=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(i):zK(i,this),this.endOfISOWeek=i=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(i):r2(i),this.endOfMonth=i=>this.overrides?.endOfMonth?this.overrides.endOfMonth(i):l2(i),this.endOfWeek=(i,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(i,o):c2(i,this.options),this.endOfYear=i=>this.overrides?.endOfYear?this.overrides.endOfYear(i):u2(i),this.format=(i,o,a)=>{const r=this.overrides?.format?this.overrides.format(i,o,this.options):Yl(i,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(r):r},this.getISOWeek=i=>this.overrides?.getISOWeek?this.overrides.getISOWeek(i):d2(i),this.getMonth=(i,o)=>this.overrides?.getMonth?this.overrides.getMonth(i,this.options):h2(i,this.options),this.getYear=(i,o)=>this.overrides?.getYear?this.overrides.getYear(i,this.options):f2(i,this.options),this.getWeek=(i,o)=>this.overrides?.getWeek?this.overrides.getWeek(i,this.options):p2(i,this.options),this.isAfter=(i,o)=>this.overrides?.isAfter?this.overrides.isAfter(i,o):g2(i,o),this.isBefore=(i,o)=>this.overrides?.isBefore?this.overrides.isBefore(i,o):m2(i,o),this.isDate=i=>this.overrides?.isDate?this.overrides.isDate(i):y2(i),this.isSameDay=(i,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(i,o):b2(i,o),this.isSameMonth=(i,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(i,o):x2(i,o),this.isSameYear=(i,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(i,o):v2(i,o),this.max=i=>this.overrides?.max?this.overrides.max(i):C2(i),this.min=i=>this.overrides?.min?this.overrides.min(i):S2(i),this.setMonth=(i,o)=>this.overrides?.setMonth?this.overrides.setMonth(i,o):k2(i,o),this.setYear=(i,o)=>this.overrides?.setYear?this.overrides.setYear(i,o):w2(i,o),this.startOfBroadcastWeek=(i,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):eN(i,this),this.startOfDay=i=>this.overrides?.startOfDay?this.overrides.startOfDay(i):A2(i),this.startOfISOWeek=i=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(i):P2(i),this.startOfMonth=i=>this.overrides?.startOfMonth?this.overrides.startOfMonth(i):D2(i),this.startOfWeek=(i,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(i,this.options):O2(i,this.options),this.startOfYear=i=>this.overrides?.startOfYear?this.overrides.startOfYear(i):T2(i),this.options={locale:tN,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),i={};for(let o=0;o<10;o++)i[o.toString()]=t.format(o);return i}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,i=>t[i]||i)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&$n.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:i,numerals:o}=this.options,a=t?.code;if(a&&$n.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:i,numberingSystem:o}).format(e)}catch{}const r=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,r)}}$n.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Zi=new $n;class nN{constructor(e,t,i=Zi){this.date=e,this.displayMonth=t,this.outside=!!(t&&!i.isSameMonth(e,t)),this.dateLib=i,this.isoDate=i.format(e,"yyyy-MM-dd"),this.displayMonthId=i.format(t,"yyyy-MM"),this.dateMonthId=i.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class FK{constructor(e,t){this.date=e,this.weeks=t}}class qK{constructor(e,t){this.days=t,this.weekNumber=e}}function GK(n){return me.createElement("button",{...n})}function KK(n){return me.createElement("span",{...n})}function VK(n){const{size:e=24,orientation:t="left",className:i}=n;return me.createElement("svg",{className:i,width:e,height:e,viewBox:"0 0 24 24"},t==="up"&&me.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),t==="down"&&me.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),t==="left"&&me.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),t==="right"&&me.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function WK(n){const{day:e,modifiers:t,...i}=n;return me.createElement("td",{...i})}function QK(n){const{day:e,modifiers:t,...i}=n,o=me.useRef(null);return me.useEffect(()=>{t.focused&&o.current?.focus()},[t.focused]),me.createElement("button",{ref:o,...i})}var we;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(we||(we={}));var wt;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(wt||(wt={}));var Si;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Si||(Si={}));var Qn;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(Qn||(Qn={}));function YK(n){const{options:e,className:t,components:i,classNames:o,...a}=n,r=[o[we.Dropdown],t].join(" "),c=e?.find(({value:d})=>d===a.value);return me.createElement("span",{"data-disabled":a.disabled,className:o[we.DropdownRoot]},me.createElement(i.Select,{className:r,...a},e?.map(({value:d,label:f,disabled:g})=>me.createElement(i.Option,{key:d,value:d,disabled:g},f))),me.createElement("span",{className:o[we.CaptionLabel],"aria-hidden":!0},c?.label,me.createElement(i.Chevron,{orientation:"down",size:18,className:o[we.Chevron]})))}function $K(n){return me.createElement("div",{...n})}function XK(n){return me.createElement("div",{...n})}function JK(n){const{calendarMonth:e,displayIndex:t,...i}=n;return me.createElement("div",{...i},n.children)}function ZK(n){const{calendarMonth:e,displayIndex:t,...i}=n;return me.createElement("div",{...i})}function eV(n){return me.createElement("table",{...n})}function tV(n){return me.createElement("div",{...n})}const iN=A.createContext(void 0);function nu(){const n=A.useContext(iN);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function nV(n){const{components:e}=nu();return me.createElement(e.Dropdown,{...n})}function iV(n){const{onPreviousClick:e,onNextClick:t,previousMonth:i,nextMonth:o,...a}=n,{components:r,classNames:c,labels:{labelPrevious:d,labelNext:f}}=nu(),g=A.useCallback(x=>{o&&t?.(x)},[o,t]),m=A.useCallback(x=>{i&&e?.(x)},[i,e]);return me.createElement("nav",{...a},me.createElement(r.PreviousMonthButton,{type:"button",className:c[we.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":d(i),onClick:m},me.createElement(r.Chevron,{disabled:i?void 0:!0,className:c[we.Chevron],orientation:"left"})),me.createElement(r.NextMonthButton,{type:"button",className:c[we.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":f(o),onClick:g},me.createElement(r.Chevron,{disabled:o?void 0:!0,orientation:"right",className:c[we.Chevron]})))}function oV(n){const{components:e}=nu();return me.createElement(e.Button,{...n})}function sV(n){return me.createElement("option",{...n})}function aV(n){const{components:e}=nu();return me.createElement(e.Button,{...n})}function rV(n){const{rootRef:e,...t}=n;return me.createElement("div",{...t,ref:e})}function lV(n){return me.createElement("select",{...n})}function cV(n){const{week:e,...t}=n;return me.createElement("tr",{...t})}function uV(n){return me.createElement("th",{...n})}function dV(n){return me.createElement("thead",{"aria-hidden":!0},me.createElement("tr",{...n}))}function hV(n){const{week:e,...t}=n;return me.createElement("th",{...t})}function fV(n){return me.createElement("th",{...n})}function pV(n){return me.createElement("tbody",{...n})}function gV(n){const{components:e}=nu();return me.createElement(e.Dropdown,{...n})}const mV=Object.freeze(Object.defineProperty({__proto__:null,Button:GK,CaptionLabel:KK,Chevron:VK,Day:WK,DayButton:QK,Dropdown:YK,DropdownNav:$K,Footer:XK,Month:JK,MonthCaption:ZK,MonthGrid:eV,Months:tV,MonthsDropdown:nV,Nav:iV,NextMonthButton:oV,Option:sV,PreviousMonthButton:aV,Root:rV,Select:lV,Week:cV,WeekNumber:hV,WeekNumberHeader:fV,Weekday:uV,Weekdays:dV,Weeks:pV,YearsDropdown:gV},Symbol.toStringTag,{value:"Module"}));function Ao(n,e,t=!1,i=Zi){let{from:o,to:a}=n;const{differenceInCalendarDays:r,isSameDay:c}=i;return o&&a?(r(a,o)<0&&([o,a]=[a,o]),r(e,o)>=(t?1:0)&&r(a,e)>=(t?1:0)):!t&&a?c(a,e):!t&&o?c(o,e):!1}function $x(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function Nf(n){return!!(n&&typeof n=="object"&&"from"in n)}function Xx(n){return!!(n&&typeof n=="object"&&"after"in n)}function Jx(n){return!!(n&&typeof n=="object"&&"before"in n)}function oN(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function sN(n,e){return Array.isArray(n)&&n.every(e.isDate)}function Po(n,e,t=Zi){const i=Array.isArray(e)?e:[e],{isSameDay:o,differenceInCalendarDays:a,isAfter:r}=t;return i.some(c=>{if(typeof c=="boolean")return c;if(t.isDate(c))return o(n,c);if(sN(c,t))return c.some(d=>o(n,d));if(Nf(c))return Ao(c,n,!1,t);if(oN(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(n.getDay()):c.dayOfWeek===n.getDay();if($x(c)){const d=a(c.before,n),f=a(c.after,n),g=d>0,m=f<0;return r(c.before,c.after)?m&&g:g||m}return Xx(c)?a(n,c.after)>0:Jx(c)?a(c.before,n)>0:typeof c=="function"?c(n):!1})}function yV(n,e,t,i,o){const{disabled:a,hidden:r,modifiers:c,showOutsideDays:d,broadcastCalendar:f,today:g=o.today()}=e,{isSameDay:m,isSameMonth:x,startOfMonth:v,isBefore:C,endOfMonth:k,isAfter:w}=o,D=t&&v(t),O=i&&k(i),M={[wt.focused]:[],[wt.outside]:[],[wt.disabled]:[],[wt.hidden]:[],[wt.today]:[]},T={};for(const L of n){const{date:N,displayMonth:I}=L,K=!!(I&&!x(N,I)),U=!!(D&&C(N,D)),z=!!(O&&w(N,O)),X=!!(a&&Po(N,a,o)),_=!!(r&&Po(N,r,o))||U||z||!f&&!d&&K||f&&d===!1&&K,V=m(N,g);K&&M.outside.push(L),X&&M.disabled.push(L),_&&M.hidden.push(L),V&&M.today.push(L),c&&Object.keys(c).forEach(ie=>{const oe=c?.[ie];oe&&Po(N,oe,o)&&(T[ie]?T[ie].push(L):T[ie]=[L])})}return L=>{const N={[wt.focused]:!1,[wt.disabled]:!1,[wt.hidden]:!1,[wt.outside]:!1,[wt.today]:!1},I={};for(const K in M){const U=M[K];N[K]=U.some(z=>z===L)}for(const K in T)I[K]=T[K].some(U=>U===L);return{...N,...I}}}function bV(n,e,t={}){return Object.entries(n).filter(([,o])=>o===!0).reduce((o,[a])=>(t[a]?o.push(t[a]):e[wt[a]]?o.push(e[wt[a]]):e[Si[a]]&&o.push(e[Si[a]]),o),[e[we.Day]])}function xV(n){return{...mV,...n}}function vV(n){const e={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([t,i])=>{t.startsWith("data-")&&(e[t]=i)}),e}function CV(){const n={};for(const e in we)n[we[e]]=`rdp-${we[e]}`;for(const e in wt)n[wt[e]]=`rdp-${wt[e]}`;for(const e in Si)n[Si[e]]=`rdp-${Si[e]}`;for(const e in Qn)n[Qn[e]]=`rdp-${Qn[e]}`;return n}function aN(n,e,t){return(t??new $n(e)).formatMonthYear(n)}const SV=aN;function kV(n,e,t){return(t??new $n(e)).format(n,"d")}function wV(n,e=Zi){return e.format(n,"LLLL")}function AV(n,e,t){return(t??new $n(e)).format(n,"cccccc")}function PV(n,e=Zi){return n<10?e.formatNumber(`0${n.toLocaleString()}`):e.formatNumber(`${n.toLocaleString()}`)}function DV(){return""}function rN(n,e=Zi){return e.format(n,"yyyy")}const OV=rN,TV=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:aN,formatDay:kV,formatMonthCaption:SV,formatMonthDropdown:wV,formatWeekNumber:PV,formatWeekNumberHeader:DV,formatWeekdayName:AV,formatYearCaption:OV,formatYearDropdown:rN},Symbol.toStringTag,{value:"Module"}));function MV(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...TV,...n}}function Zx(n,e,t,i){let o=(i??new $n(t)).format(n,"PPPP");return e.today&&(o=`Today, ${o}`),e.selected&&(o=`${o}, selected`),o}const NV=Zx;function ev(n,e,t){return(t??new $n(e)).formatMonthYear(n)}const LV=ev;function lN(n,e,t,i){let o=(i??new $n(t)).format(n,"PPPP");return e?.today&&(o=`Today, ${o}`),o}function cN(n){return"Choose the Month"}function uN(){return""}const RV="Go to the Next Month";function dN(n,e){return RV}function hN(n){return"Go to the Previous Month"}function fN(n,e,t){return(t??new $n(e)).format(n,"cccc")}function pN(n,e){return`Week ${n}`}function gN(n){return"Week Number"}function mN(n){return"Choose the Year"}const EV=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:LV,labelDay:NV,labelDayButton:Zx,labelGrid:ev,labelGridcell:lN,labelMonthDropdown:cN,labelNav:uN,labelNext:dN,labelPrevious:hN,labelWeekNumber:pN,labelWeekNumberHeader:gN,labelWeekday:fN,labelYearDropdown:mN},Symbol.toStringTag,{value:"Module"})),xi=(n,e,t)=>e||(t?typeof t=="function"?t:(...i)=>t:n);function IV(n,e){const t=e.locale?.labels??{};return{...EV,...n??{},labelDayButton:xi(Zx,n?.labelDayButton,t.labelDayButton),labelMonthDropdown:xi(cN,n?.labelMonthDropdown,t.labelMonthDropdown),labelNext:xi(dN,n?.labelNext,t.labelNext),labelPrevious:xi(hN,n?.labelPrevious,t.labelPrevious),labelWeekNumber:xi(pN,n?.labelWeekNumber,t.labelWeekNumber),labelYearDropdown:xi(mN,n?.labelYearDropdown,t.labelYearDropdown),labelGrid:xi(ev,n?.labelGrid,t.labelGrid),labelGridcell:xi(lN,n?.labelGridcell,t.labelGridcell),labelNav:xi(uN,n?.labelNav,t.labelNav),labelWeekNumberHeader:xi(gN,n?.labelWeekNumberHeader,t.labelWeekNumberHeader),labelWeekday:xi(fN,n?.labelWeekday,t.labelWeekday)}}function jV(n,e,t,i,o){const{startOfMonth:a,startOfYear:r,endOfYear:c,eachMonthOfInterval:d,getMonth:f}=o;return d({start:r(n),end:c(n)}).map(x=>{const v=i.formatMonthDropdown(x,o),C=f(x),k=e&&x<a(e)||t&&x>a(t)||!1;return{value:C,label:v,disabled:k}})}function BV(n,e={},t={}){let i={...e?.[we.Day]};return Object.entries(n).filter(([,o])=>o===!0).forEach(([o])=>{i={...i,...t?.[o]}}),i}function HV(n,e,t,i){const o=i??n.today(),a=t?n.startOfBroadcastWeek(o,n):e?n.startOfISOWeek(o):n.startOfWeek(o),r=[];for(let c=0;c<7;c++){const d=n.addDays(a,c);r.push(d)}return r}function _V(n,e,t,i,o=!1){if(!n||!e)return;const{startOfYear:a,endOfYear:r,eachYearOfInterval:c,getYear:d}=i,f=a(n),g=r(e),m=c({start:f,end:g});return o&&m.reverse(),m.map(x=>{const v=t.formatYearDropdown(x,i);return{value:d(x),label:v,disabled:!1}})}const iu=n=>n instanceof HTMLElement?n:null,$m=n=>[...n.querySelectorAll("[data-animated-month]")??[]],UV=n=>iu(n.querySelector("[data-animated-month]")),Xm=n=>iu(n.querySelector("[data-animated-caption]")),Jm=n=>iu(n.querySelector("[data-animated-weeks]")),zV=n=>iu(n.querySelector("[data-animated-nav]")),FV=n=>iu(n.querySelector("[data-animated-weekdays]"));function qV(n,e,{classNames:t,months:i,focused:o,dateLib:a}){const r=A.useRef(null),c=A.useRef(i),d=A.useRef(!1);A.useLayoutEffect(()=>{const f=c.current;if(c.current=i,!e||!n.current||!(n.current instanceof HTMLElement)||i.length===0||f.length===0||i.length!==f.length)return;const g=a.isSameMonth(i[0].date,f[0].date),m=a.isAfter(i[0].date,f[0].date),x=m?t[Qn.caption_after_enter]:t[Qn.caption_before_enter],v=m?t[Qn.weeks_after_enter]:t[Qn.weeks_before_enter],C=r.current,k=n.current.cloneNode(!0);if(k instanceof HTMLElement?($m(k).forEach(M=>{if(!(M instanceof HTMLElement))return;const T=UV(M);T&&M.contains(T)&&M.removeChild(T);const L=Xm(M);L&&L.classList.remove(x);const N=Jm(M);N&&N.classList.remove(v)}),r.current=k):r.current=null,d.current||g||o)return;const w=C instanceof HTMLElement?$m(C):[],D=$m(n.current);if(D?.every(O=>O instanceof HTMLElement)&&w&&w.every(O=>O instanceof HTMLElement)){d.current=!0,n.current.style.isolation="isolate";const O=zV(n.current);O&&(O.style.zIndex="1"),D.forEach((M,T)=>{const L=w[T];if(!L)return;M.style.position="relative",M.style.overflow="hidden";const N=Xm(M);N&&N.classList.add(x);const I=Jm(M);I&&I.classList.add(v);const K=()=>{d.current=!1,n.current&&(n.current.style.isolation=""),O&&(O.style.zIndex=""),N&&N.classList.remove(x),I&&I.classList.remove(v),M.style.position="",M.style.overflow="",M.contains(L)&&M.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const U=FV(L);U&&(U.style.opacity="0");const z=Xm(L);z&&(z.classList.add(m?t[Qn.caption_before_exit]:t[Qn.caption_after_exit]),z.addEventListener("animationend",K));const X=Jm(L);X&&X.classList.add(m?t[Qn.weeks_before_exit]:t[Qn.weeks_after_exit]),M.insertBefore(L,M.firstChild)})}})}function GV(n,e,t,i){const o=n[0],a=n[n.length-1],{ISOWeek:r,fixedWeeks:c,broadcastCalendar:d}=t??{},{addDays:f,differenceInCalendarDays:g,differenceInCalendarMonths:m,endOfBroadcastWeek:x,endOfISOWeek:v,endOfMonth:C,endOfWeek:k,isAfter:w,startOfBroadcastWeek:D,startOfISOWeek:O,startOfWeek:M}=i,T=d?D(o,i):r?O(o):M(o),L=d?x(a):r?v(C(a)):k(C(a)),N=e&&(d?x(e):r?v(e):k(e)),I=N&&w(L,N)?N:L,K=g(I,T),U=m(a,o)+1,z=[];for(let V=0;V<=K;V++){const ie=f(T,V);z.push(ie)}const _=(d?35:42)*U;if(c&&z.length<_){const V=_-z.length;for(let ie=0;ie<V;ie++){const oe=f(z[z.length-1],1);z.push(oe)}}return z}function KV(n){const e=[];return n.reduce((t,i)=>{const o=i.weeks.reduce((a,r)=>a.concat(r.days.slice()),e.slice());return t.concat(o.slice())},e.slice())}function VV(n,e,t,i){const{numberOfMonths:o=1}=t,a=[];for(let r=0;r<o;r++){const c=i.addMonths(n,r);if(e&&c>e)break;a.push(c)}return a}function LA(n,e,t,i){const{month:o,defaultMonth:a,today:r=i.today(),numberOfMonths:c=1}=n;let d=o||a||r;const{differenceInCalendarMonths:f,addMonths:g,startOfMonth:m}=i;if(t&&f(t,d)<c-1){const x=-1*(c-1);d=g(t,x)}return e&&f(d,e)<0&&(d=e),m(d)}function WV(n,e,t,i){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:r,endOfMonth:c,endOfWeek:d,getISOWeek:f,getWeek:g,startOfBroadcastWeek:m,startOfISOWeek:x,startOfWeek:v}=i,C=n.reduce((k,w)=>{const D=t.broadcastCalendar?m(w,i):t.ISOWeek?x(w):v(w),O=t.broadcastCalendar?a(w):t.ISOWeek?r(c(w)):d(c(w)),M=e.filter(I=>I>=D&&I<=O),T=t.broadcastCalendar?35:42;if(t.fixedWeeks&&M.length<T){const I=e.filter(K=>{const U=T-M.length;return K>O&&K<=o(O,U)});M.push(...I)}const L=M.reduce((I,K)=>{const U=t.ISOWeek?f(K):g(K),z=I.find(_=>_.weekNumber===U),X=new nN(K,w,i);return z?z.days.push(X):I.push(new qK(U,[X])),I},[]),N=new FK(w,L);return k.push(N),k},[]);return t.reverseMonths?C.reverse():C}function QV(n,e){let{startMonth:t,endMonth:i}=n;const{startOfYear:o,startOfDay:a,startOfMonth:r,endOfMonth:c,addYears:d,endOfYear:f,newDate:g,today:m}=e,{fromYear:x,toYear:v,fromMonth:C,toMonth:k}=n;!t&&C&&(t=C),!t&&x&&(t=e.newDate(x,0,1)),!i&&k&&(i=k),!i&&v&&(i=g(v,11,31));const w=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return t?t=r(t):x?t=g(x,0,1):!t&&w&&(t=o(d(n.today??m(),-100))),i?i=c(i):v?i=g(v,11,31):!i&&w&&(i=f(n.today??m())),[t&&a(t),i&&a(i)]}function YV(n,e,t,i){if(t.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=t,{startOfMonth:r,addMonths:c,differenceInCalendarMonths:d}=i,f=o?a:1,g=r(n);if(!e)return c(g,f);if(!(d(e,n)<a))return c(g,f)}function $V(n,e,t,i){if(t.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=t,{startOfMonth:r,addMonths:c,differenceInCalendarMonths:d}=i,f=o?a??1:1,g=r(n);if(!e)return c(g,-f);if(!(d(g,e)<=0))return c(g,-f)}function XV(n){const e=[];return n.reduce((t,i)=>t.concat(i.weeks.slice()),e.slice())}function Lf(n,e){const[t,i]=A.useState(n);return[e===void 0?t:e,i]}function JV(n,e){const[t,i]=QV(n,e),{startOfMonth:o,endOfMonth:a}=e,r=LA(n,t,i,e),[c,d]=Lf(r,n.month?r:void 0);A.useEffect(()=>{const T=LA(n,t,i,e);d(T)},[n.timeZone]);const{months:f,weeks:g,days:m,previousMonth:x,nextMonth:v}=A.useMemo(()=>{const T=VV(c,i,{numberOfMonths:n.numberOfMonths},e),L=GV(T,n.endMonth?a(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},e),N=WV(T,L,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},e),I=XV(N),K=KV(N),U=$V(c,t,n,e),z=YV(c,i,n,e);return{months:N,weeks:I,days:K,previousMonth:U,nextMonth:z}},[e,c.getTime(),i?.getTime(),t?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:C,onMonthChange:k}=n,w=T=>g.some(L=>L.days.some(N=>N.isEqualTo(T))),D=T=>{if(C)return;let L=o(T);t&&L<o(t)&&(L=o(t)),i&&L>o(i)&&(L=o(i)),d(L),k?.(L)};return{months:f,weeks:g,days:m,navStart:t,navEnd:i,previousMonth:x,nextMonth:v,goToMonth:D,goToDay:T=>{w(T)||D(T.date)}}}var Bi;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(Bi||(Bi={}));function RA(n){return!n[wt.disabled]&&!n[wt.hidden]&&!n[wt.outside]}function ZV(n,e,t,i){let o,a=-1;for(const r of n){const c=e(r);RA(c)&&(c[wt.focused]&&a<Bi.FocusedModifier?(o=r,a=Bi.FocusedModifier):i?.isEqualTo(r)&&a<Bi.LastFocused?(o=r,a=Bi.LastFocused):t(r.date)&&a<Bi.Selected?(o=r,a=Bi.Selected):c[wt.today]&&a<Bi.Today&&(o=r,a=Bi.Today))}return o||(o=n.find(r=>RA(e(r)))),o}function e9(n,e,t,i,o,a,r){const{ISOWeek:c,broadcastCalendar:d}=a,{addDays:f,addMonths:g,addWeeks:m,addYears:x,endOfBroadcastWeek:v,endOfISOWeek:C,endOfWeek:k,max:w,min:D,startOfBroadcastWeek:O,startOfISOWeek:M,startOfWeek:T}=r;let N={day:f,week:m,month:g,year:x,startOfWeek:I=>d?O(I,r):c?M(I):T(I),endOfWeek:I=>d?v(I):c?C(I):k(I)}[n](t,e==="after"?1:-1);return e==="before"&&i?N=w([i,N]):e==="after"&&o&&(N=D([o,N])),N}function yN(n,e,t,i,o,a,r,c=0){if(c>365)return;const d=e9(n,e,t.date,i,o,a,r),f=!!(a.disabled&&Po(d,a.disabled,r)),g=!!(a.hidden&&Po(d,a.hidden,r)),m=d,x=new nN(d,m,r);return!f&&!g?x:yN(n,e,x,i,o,a,r,c+1)}function t9(n,e,t,i,o){const{autoFocus:a}=n,[r,c]=A.useState(),d=ZV(e.days,t,i||(()=>!1),r),[f,g]=A.useState(a?d:void 0);return{isFocusTarget:k=>!!d?.isEqualTo(k),setFocused:g,focused:f,blur:()=>{c(f),g(void 0)},moveFocus:(k,w)=>{if(!f)return;const D=yN(k,w,f,e.navStart,e.navEnd,n,o);D&&(n.disableNavigation&&!e.days.some(M=>M.isEqualTo(D))||(e.goToDay(D),g(D)))}}}function n9(n,e){const{selected:t,required:i,onSelect:o}=n,[a,r]=Lf(t,o?t:void 0),c=o?t:a,{isSameDay:d}=e,f=v=>c?.some(C=>d(C,v))??!1,{min:g,max:m}=n;return{selected:c,select:(v,C,k)=>{let w=[...c??[]];if(f(v)){if(c?.length===g||i&&c?.length===1)return;w=c?.filter(D=>!d(D,v))}else c?.length===m?w=[v]:w=[...w,v];return o||r(w),o?.(w,v,C,k),w},isSelected:f}}function i9(n,e,t=0,i=0,o=!1,a=Zi){const{from:r,to:c}=e||{},{isSameDay:d,isAfter:f,isBefore:g}=a;let m;if(!r&&!c)m={from:n,to:t>0?void 0:n};else if(r&&!c)d(r,n)?t===0?m={from:r,to:n}:o?m={from:r,to:void 0}:m=void 0:g(n,r)?m={from:n,to:r}:m={from:r,to:n};else if(r&&c)if(d(r,n)&&d(c,n))o?m={from:r,to:c}:m=void 0;else if(d(r,n))m={from:r,to:t>0?void 0:n};else if(d(c,n))m={from:n,to:t>0?void 0:n};else if(g(n,r))m={from:n,to:c};else if(f(n,r))m={from:r,to:n};else if(f(n,c))m={from:r,to:n};else throw new Error("Invalid range");if(m?.from&&m?.to){const x=a.differenceInCalendarDays(m.to,m.from);i>0&&x>i?m={from:n,to:void 0}:t>1&&x<t&&(m={from:n,to:void 0})}return m}function o9(n,e,t=Zi){const i=Array.isArray(e)?e:[e];let o=n.from;const a=t.differenceInCalendarDays(n.to,n.from),r=Math.min(a,6);for(let c=0;c<=r;c++){if(i.includes(o.getDay()))return!0;o=t.addDays(o,1)}return!1}function EA(n,e,t=Zi){return Ao(n,e.from,!1,t)||Ao(n,e.to,!1,t)||Ao(e,n.from,!1,t)||Ao(e,n.to,!1,t)}function s9(n,e,t=Zi){const i=Array.isArray(e)?e:[e];if(i.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:t.isDate(c)?Ao(n,c,!1,t):sN(c,t)?c.some(d=>Ao(n,d,!1,t)):Nf(c)?c.from&&c.to?EA(n,{from:c.from,to:c.to},t):!1:oN(c)?o9(n,c.dayOfWeek,t):$x(c)?t.isAfter(c.before,c.after)?EA(n,{from:t.addDays(c.after,1),to:t.addDays(c.before,-1)},t):Po(n.from,c,t)||Po(n.to,c,t):Xx(c)||Jx(c)?Po(n.from,c,t)||Po(n.to,c,t):!1))return!0;const r=i.filter(c=>typeof c=="function");if(r.length){let c=n.from;const d=t.differenceInCalendarDays(n.to,n.from);for(let f=0;f<=d;f++){if(r.some(g=>g(c)))return!0;c=t.addDays(c,1)}}return!1}function a9(n,e){const{disabled:t,excludeDisabled:i,selected:o,required:a,onSelect:r}=n,[c,d]=Lf(o,r?o:void 0),f=r?o:c;return{selected:f,select:(x,v,C)=>{const{min:k,max:w}=n,D=x?i9(x,f,k,w,a,e):void 0;return i&&t&&D?.from&&D.to&&s9({from:D.from,to:D.to},t,e)&&(D.from=x,D.to=void 0),r||d(D),r?.(D,x,v,C),D},isSelected:x=>f&&Ao(f,x,!1,e)}}function r9(n,e){const{selected:t,required:i,onSelect:o}=n,[a,r]=Lf(t,o?t:void 0),c=o?t:a,{isSameDay:d}=e;return{selected:c,select:(m,x,v)=>{let C=m;return!i&&c&&c&&d(m,c)&&(C=void 0),o||r(C),o?.(C,m,x,v),C},isSelected:m=>c?d(c,m):!1}}function l9(n,e){const t=r9(n,e),i=n9(n,e),o=a9(n,e);switch(n.mode){case"single":return t;case"multiple":return i;case"range":return o;default:return}}function sn(n,e){return n instanceof wo&&n.timeZone===e?n:new wo(n,e)}function IA(n,e){return typeof n=="boolean"||typeof n=="function"?n:n instanceof Date?sn(n,e):Array.isArray(n)?n.map(t=>t instanceof Date?sn(t,e):t):Nf(n)?{...n,from:n.from?sn(n.from,e):n.from,to:n.to?sn(n.to,e):n.to}:$x(n)?{before:sn(n.before,e),after:sn(n.after,e)}:Xx(n)?{after:sn(n.after,e)}:Jx(n)?{before:sn(n.before,e)}:n}function Zm(n,e){return n&&(Array.isArray(n)?n.map(t=>IA(t,e)):IA(n,e))}function c9(n){let e=n;const t=e.timeZone;if(t&&(e={...n,timeZone:t},e.today&&(e.today=sn(e.today,t)),e.month&&(e.month=sn(e.month,t)),e.defaultMonth&&(e.defaultMonth=sn(e.defaultMonth,t)),e.startMonth&&(e.startMonth=sn(e.startMonth,t)),e.endMonth&&(e.endMonth=sn(e.endMonth,t)),e.mode==="single"&&e.selected?e.selected=sn(e.selected,t):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Re=>sn(Re,t)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?sn(e.selected.from,t):e.selected.from,to:e.selected.to?sn(e.selected.to,t):e.selected.to}),e.disabled!==void 0&&(e.disabled=Zm(e.disabled,t)),e.hidden!==void 0&&(e.hidden=Zm(e.hidden,t)),e.modifiers)){const Re={};Object.keys(e.modifiers).forEach(Ve=>{Re[Ve]=Zm(e.modifiers?.[Ve],t)}),e.modifiers=Re}const{components:i,formatters:o,labels:a,dateLib:r,locale:c,classNames:d}=A.useMemo(()=>{const Re={...tN,...e.locale},Ve=new $n({locale:Re,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib);return{dateLib:Ve,components:xV(e.components),formatters:MV(e.formatters),labels:IV(e.labels,Ve.options),locale:Re,classNames:{...CV(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:r.today()});const{captionLayout:f,mode:g,navLayout:m,numberOfMonths:x=1,onDayBlur:v,onDayClick:C,onDayFocus:k,onDayKeyDown:w,onDayMouseEnter:D,onDayMouseLeave:O,onNextClick:M,onPrevClick:T,showWeekNumber:L,styles:N}=e,{formatCaption:I,formatDay:K,formatMonthDropdown:U,formatWeekNumber:z,formatWeekNumberHeader:X,formatWeekdayName:_,formatYearDropdown:V}=o,ie=JV(e,r),{days:oe,months:B,navStart:Z,navEnd:se,previousMonth:Y,nextMonth:ae,goToMonth:de}=ie,be=yV(oe,e,Z,se,r),{isSelected:te,select:le,selected:xe}=l9(e,r)??{},{blur:Se,focused:ye,isFocusTarget:Oe,moveFocus:je,setFocused:nt}=t9(e,ie,be,te??(()=>!1),r),{labelDayButton:Pt,labelGridcell:Te,labelGrid:Ye,labelMonthDropdown:it,labelNav:ln,labelPrevious:Sn,labelNext:As,labelWeekday:zt,labelWeekNumber:Bo,labelWeekNumberHeader:Ps,labelYearDropdown:gi}=a,ka=A.useMemo(()=>HV(r,e.ISOWeek,e.broadcastCalendar,e.today),[r,e.ISOWeek,e.broadcastCalendar,e.today]),wa=g!==void 0||C!==void 0,Xt=A.useCallback(()=>{Y&&(de(Y),T?.(Y))},[Y,de,T]),$r=A.useCallback(()=>{ae&&(de(ae),M?.(ae))},[de,ae,M]),ou=A.useCallback((Re,Ve)=>Me=>{Me.preventDefault(),Me.stopPropagation(),nt(Re),!Ve.disabled&&(le?.(Re.date,Ve,Me),C?.(Re.date,Ve,Me))},[le,C,nt]),su=A.useCallback((Re,Ve)=>Me=>{nt(Re),k?.(Re.date,Ve,Me)},[k,nt]),Aa=A.useCallback((Re,Ve)=>Me=>{Se(),v?.(Re.date,Ve,Me)},[Se,v]),Rf=A.useCallback((Re,Ve)=>Me=>{const $e={ArrowLeft:[Me.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[Me.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[Me.shiftKey?"year":"week","after"],ArrowUp:[Me.shiftKey?"year":"week","before"],PageUp:[Me.shiftKey?"year":"month","before"],PageDown:[Me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if($e[Me.key]){Me.preventDefault(),Me.stopPropagation();const[Kt,He]=$e[Me.key];je(Kt,He)}w?.(Re.date,Ve,Me)},[je,w,e.dir]),au=A.useCallback((Re,Ve)=>Me=>{D?.(Re.date,Ve,Me)},[D]),Ef=A.useCallback((Re,Ve)=>Me=>{O?.(Re.date,Ve,Me)},[O]),If=A.useCallback(Re=>Ve=>{const Me=Number(Ve.target.value),$e=r.setMonth(r.startOfMonth(Re),Me);de($e)},[r,de]),Ds=A.useCallback(Re=>Ve=>{const Me=Number(Ve.target.value),$e=r.setYear(r.startOfMonth(Re),Me);de($e)},[r,de]),{className:pn,style:Di}=A.useMemo(()=>({className:[d[we.Root],e.className].filter(Boolean).join(" "),style:{...N?.[we.Root],...e.style}}),[d,e.className,e.style,N]),gn=vV(e),ru=A.useRef(null);qV(ru,!!e.animate,{classNames:d,months:B,focused:ye,dateLib:r});const jf={dayPickerProps:e,selected:xe,select:le,isSelected:te,months:B,nextMonth:ae,previousMonth:Y,goToMonth:de,getModifiers:be,components:i,classNames:d,styles:N,labels:a,formatters:o};return me.createElement(iN.Provider,{value:jf},me.createElement(i.Root,{rootRef:e.animate?ru:void 0,className:pn,style:Di,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...gn},me.createElement(i.Months,{className:d[we.Months],style:N?.[we.Months]},!e.hideNavigation&&!m&&me.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[we.Nav],style:N?.[we.Nav],"aria-label":ln(),onPreviousClick:Xt,onNextClick:$r,previousMonth:Y,nextMonth:ae}),B.map((Re,Ve)=>me.createElement(i.Month,{"data-animated-month":e.animate?"true":void 0,className:d[we.Month],style:N?.[we.Month],key:Ve,displayIndex:Ve,calendarMonth:Re},m==="around"&&!e.hideNavigation&&Ve===0&&me.createElement(i.PreviousMonthButton,{type:"button",className:d[we.PreviousMonthButton],tabIndex:Y?void 0:-1,"aria-disabled":Y?void 0:!0,"aria-label":Sn(Y),onClick:Xt,"data-animated-button":e.animate?"true":void 0},me.createElement(i.Chevron,{disabled:Y?void 0:!0,className:d[we.Chevron],orientation:e.dir==="rtl"?"right":"left"})),me.createElement(i.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:d[we.MonthCaption],style:N?.[we.MonthCaption],calendarMonth:Re,displayIndex:Ve},f?.startsWith("dropdown")?me.createElement(i.DropdownNav,{className:d[we.Dropdowns],style:N?.[we.Dropdowns]},(()=>{const Me=f==="dropdown"||f==="dropdown-months"?me.createElement(i.MonthsDropdown,{key:"month",className:d[we.MonthsDropdown],"aria-label":it(),classNames:d,components:i,disabled:!!e.disableNavigation,onChange:If(Re.date),options:jV(Re.date,Z,se,o,r),style:N?.[we.Dropdown],value:r.getMonth(Re.date)}):me.createElement("span",{key:"month"},U(Re.date,r)),$e=f==="dropdown"||f==="dropdown-years"?me.createElement(i.YearsDropdown,{key:"year",className:d[we.YearsDropdown],"aria-label":gi(r.options),classNames:d,components:i,disabled:!!e.disableNavigation,onChange:Ds(Re.date),options:_V(Z,se,o,r,!!e.reverseYears),style:N?.[we.Dropdown],value:r.getYear(Re.date)}):me.createElement("span",{key:"year"},V(Re.date,r));return r.getMonthYearOrder()==="year-first"?[$e,Me]:[Me,$e]})(),me.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},I(Re.date,r.options,r))):me.createElement(i.CaptionLabel,{className:d[we.CaptionLabel],role:"status","aria-live":"polite"},I(Re.date,r.options,r))),m==="around"&&!e.hideNavigation&&Ve===x-1&&me.createElement(i.NextMonthButton,{type:"button",className:d[we.NextMonthButton],tabIndex:ae?void 0:-1,"aria-disabled":ae?void 0:!0,"aria-label":As(ae),onClick:$r,"data-animated-button":e.animate?"true":void 0},me.createElement(i.Chevron,{disabled:ae?void 0:!0,className:d[we.Chevron],orientation:e.dir==="rtl"?"left":"right"})),Ve===x-1&&m==="after"&&!e.hideNavigation&&me.createElement(i.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[we.Nav],style:N?.[we.Nav],"aria-label":ln(),onPreviousClick:Xt,onNextClick:$r,previousMonth:Y,nextMonth:ae}),me.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":g==="multiple"||g==="range","aria-label":Ye(Re.date,r.options,r)||void 0,className:d[we.MonthGrid],style:N?.[we.MonthGrid]},!e.hideWeekdays&&me.createElement(i.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:d[we.Weekdays],style:N?.[we.Weekdays]},L&&me.createElement(i.WeekNumberHeader,{"aria-label":Ps(r.options),className:d[we.WeekNumberHeader],style:N?.[we.WeekNumberHeader],scope:"col"},X()),ka.map(Me=>me.createElement(i.Weekday,{"aria-label":zt(Me,r.options,r),className:d[we.Weekday],key:String(Me),style:N?.[we.Weekday],scope:"col"},_(Me,r.options,r)))),me.createElement(i.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:d[we.Weeks],style:N?.[we.Weeks]},Re.weeks.map(Me=>me.createElement(i.Week,{className:d[we.Week],key:Me.weekNumber,style:N?.[we.Week],week:Me},L&&me.createElement(i.WeekNumber,{week:Me,style:N?.[we.WeekNumber],"aria-label":Bo(Me.weekNumber,{locale:c}),className:d[we.WeekNumber],scope:"row",role:"rowheader"},z(Me.weekNumber,r)),Me.days.map($e=>{const{date:Kt}=$e,He=be($e);if(He[wt.focused]=!He.hidden&&!!ye?.isEqualTo($e),He[Si.selected]=te?.(Kt)||He.selected,Nf(xe)){const{from:Ts,to:eo}=xe;He[Si.range_start]=!!(Ts&&eo&&r.isSameDay(Kt,Ts)),He[Si.range_end]=!!(Ts&&eo&&r.isSameDay(Kt,eo)),He[Si.range_middle]=Ao(xe,Kt,!0,r)}const Os=BV(He,N,e.modifiersStyles),Bf=bV(He,d,e.modifiersClassNames),lu=!wa&&!He.hidden?Te(Kt,He,r.options,r):void 0;return me.createElement(i.Day,{key:`${$e.isoDate}_${$e.displayMonthId}`,day:$e,modifiers:He,className:Bf.join(" "),style:Os,role:"gridcell","aria-selected":He.selected||void 0,"aria-label":lu,"data-day":$e.isoDate,"data-month":$e.outside?$e.dateMonthId:void 0,"data-selected":He.selected||void 0,"data-disabled":He.disabled||void 0,"data-hidden":He.hidden||void 0,"data-outside":$e.outside||void 0,"data-focused":He.focused||void 0,"data-today":He.today||void 0},!He.hidden&&wa?me.createElement(i.DayButton,{className:d[we.DayButton],style:N?.[we.DayButton],type:"button",day:$e,modifiers:He,disabled:!He.focused&&He.disabled||void 0,"aria-disabled":He.focused&&He.disabled||void 0,tabIndex:Oe($e)?0:-1,"aria-label":Pt(Kt,He,r.options,r),onClick:ou($e,He),onBlur:Aa($e,He),onFocus:su($e,He),onKeyDown:Rf($e,He),onMouseEnter:au($e,He),onMouseLeave:Ef($e,He)},K(Kt,r.options,r)):!He.hidden&&K($e.date,r.options,r))})))))))),e.footer&&me.createElement(i.Footer,{className:d[we.Footer],style:N?.[we.Footer],role:"status","aria-live":"polite"},e.footer)))}function u9({className:n,classNames:e,showOutsideDays:t=!0,...i}){return p.jsx(c9,{showOutsideDays:t,className:q("p-2",n),classNames:{root:"relative",months:"flex flex-col sm:flex-row gap-2 sm:gap-4",month:"flex flex-col gap-2",month_caption:"flex justify-center pt-1 relative items-center h-8",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-2 flex items-center justify-between px-1 z-10",button_previous:q(Xd({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:q(Xd({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),month_grid:"w-full border-collapse",weekdays:"flex w-full",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",weeks:"flex flex-col",week:"flex w-full",day:q("relative h-8 w-8 p-0 text-center text-xs font-normal focus-within:relative focus-within:z-20","hover:bg-accent hover:text-accent-foreground rounded-full select-none"),day_button:q(Xd({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-l-full aria-selected:rounded-r-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_end:q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-r-full aria-selected:rounded-l-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_middle:q("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:q("bg-primary text-primary-foreground rounded-full","hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground"),today:"bg-accent text-accent-foreground rounded-full",outside:"text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...e},components:{Chevron:({orientation:o,className:a,...r})=>{const c=o==="left"?YE:o==="right"?Vh:o==="up"?xb:Wh;return p.jsx(c,{className:q("h-4 w-4",a),...r})}},...i})}u9.displayName="Calendar";const d9=A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function oQ({rawJsonContent:n,isRawJsonValid:e,rawJsonEdits:t,rawSettingsEnv:i,onChange:o,missingRequiredFields:a=[]}){const{t:r}=Ce(),c=a.length>0;return p.jsx(A.Suspense,{fallback:p.jsxs("div",{className:"flex items-center justify-center h-full",children:[p.jsx(hi,{className:"w-6 h-6 animate-spin text-muted-foreground"}),p.jsx("span",{className:"ml-2 text-muted-foreground",children:r("providerEditor.loadingEditor")})]}),children:p.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!e&&t!==null&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[p.jsx(Gr,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),e&&c&&p.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[p.jsx(Qi,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",p.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:a.join(", ")}),p.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:p.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:p.jsx(d9,{value:n,onChange:o,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),p.jsx("div",{className:"mx-6 mb-4",children:p.jsx("div",{className:"border rounded-md overflow-hidden",children:p.jsx(Jb,{profileEnv:i})})})]})})}A.lazy(()=>rt(()=>Promise.resolve().then(()=>Mf),void 0).then(n=>({default:n.CodeEditor})));function h9(){const{t:n}=Ce(),{isDark:e,setTheme:t}=Mb(),[i,o]=A.useState(""),[a,r]=A.useState(""),[c,d]=A.useState(!1),[f,g]=A.useState(null),[m,x]=A.useState(!1),{login:v,authRequired:C,isAuthenticated:k,loading:w,accessMode:D,authEnabled:O}=Jh(),M=yb(),T=Kh(),L=D==="setup",N=n(L?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),I=n(L?O?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),K=T.state?.from?.pathname||"/";if(A.useEffect(()=>{w||(k||!C)&&M(K,{replace:!0})},[k,C,w,M,K]),w)return p.jsx("div",{className:"flex min-h-[100dvh] items-center justify-center bg-background px-4",children:p.jsxs("div",{className:"flex items-center gap-3 rounded-full border border-border/80 bg-card/90 px-5 py-3 text-sm text-muted-foreground shadow-sm",children:[p.jsx(hi,{className:"h-4 w-4 animate-spin"}),n("auth.loading")]})});if(k||!C)return null;const U=async z=>{z.preventDefault(),g(null),x(!0);try{await v(i,a),M(K,{replace:!0})}catch(X){g(X instanceof Error?X.message:n("auth.loginFailed"))}finally{x(!1)}};return p.jsxs("div",{className:"relative min-h-[100dvh] overflow-hidden bg-background",children:[p.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(167,85,52,0.16),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(39,39,42,0.12),transparent_48%)]"}),p.jsx("div",{className:"absolute inset-0 opacity-[0.18] [background-image:linear-gradient(rgba(127,117,107,0.14)_1px,transparent_1px),linear-gradient(90deg,rgba(127,117,107,0.14)_1px,transparent_1px)] [background-size:24px_24px]"}),p.jsx("div",{className:"relative mx-auto flex min-h-[100dvh] max-w-6xl items-center px-4 py-8 sm:px-6",children:p.jsxs("div",{className:"grid w-full items-stretch gap-6 lg:grid-cols-[minmax(0,1.05fr)_minmax(360px,430px)]",children:[p.jsxs("section",{className:"flex flex-col justify-between rounded-[28px] border border-border/70 bg-card/85 p-6 shadow-[0_24px_80px_-48px_rgba(68,48,34,0.55)] backdrop-blur sm:p-8",children:[p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p.jsxs("span",{className:"inline-flex w-fit items-center gap-2 rounded-full border border-border/70 bg-background/75 px-3 py-1 text-xs font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:[p.jsx(Cd,{className:"h-3.5 w-3.5 text-accent"}),N]}),p.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/75 p-1 shadow-sm backdrop-blur",children:[p.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:q("rounded-full px-3 text-xs font-semibold",!e&&"bg-card text-foreground shadow-sm"),"aria-pressed":!e,onClick:()=>t("light"),children:[p.jsx(uP,{className:"h-3.5 w-3.5"}),n("auth.lightMode")]}),p.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:q("rounded-full px-3 text-xs font-semibold",e&&"bg-card text-foreground shadow-sm"),"aria-pressed":e,onClick:()=>t("dark"),children:[p.jsx(dP,{className:"h-3.5 w-3.5"}),n("auth.darkMode")]})]})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsx("h1",{className:"max-w-xl text-4xl font-semibold tracking-[-0.04em] text-balance text-foreground sm:text-5xl",children:n(L?"auth.remoteSetupTitle":"auth.dashboardTitle")}),p.jsx("p",{className:"max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg",children:I})]})]}),p.jsxs("div",{className:"mt-8 grid gap-3 text-sm text-muted-foreground sm:grid-cols-3",children:[p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(tk,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteRemote")})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(nk,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteLocal")})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[p.jsx(Cd,{className:"mb-3 h-4 w-4 text-accent"}),p.jsx("p",{children:n("auth.safetyNoteSession")})]})]})]}),p.jsxs(w_,{className:"justify-center rounded-[28px] border-border/70 bg-card/95 py-0 shadow-[0_24px_90px_-54px_rgba(34,24,16,0.62)]",children:[p.jsxs(A_,{className:"space-y-3 border-b border-border/70 px-6 py-6",children:[p.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-accent/20 bg-accent/10",children:L?p.jsx(tk,{className:"h-5 w-5 text-accent"}):p.jsx(nk,{className:"h-5 w-5 text-accent"})}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx(P_,{className:"text-2xl tracking-[-0.03em]",children:n(L?"auth.remoteSetupTitle":"auth.dashboardTitle")}),p.jsx(D_,{className:"text-sm leading-6 text-muted-foreground",children:L?I:n("auth.credentialsHint")})]})]}),p.jsx(O_,{className:"space-y-5 px-6 py-6",children:L?p.jsxs(p.Fragment,{children:[p.jsxs(rc,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[p.jsx(vc,{className:"h-4 w-4"}),p.jsx(yh,{children:n("auth.noDefaultCredentials")}),p.jsx(lc,{children:n("auth.credentialsHint")})]}),p.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[p.jsx($E,{className:"h-4 w-4 text-accent"}),n("auth.hostStepTitle")]}),p.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n("auth.hostStepDescription")}),p.jsx("code",{className:"mt-4 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"ccs config auth setup"}),p.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:n("auth.dockerStepDescription")}),p.jsx("code",{className:"mt-2 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"docker exec -it ccs-cliproxy ccs config auth setup"})]}),p.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[p.jsx(Cd,{className:"h-4 w-4 text-accent"}),n("auth.localStepTitle")]}),p.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:n("auth.localStepDescription")})]})]})]}):p.jsxs("form",{onSubmit:U,className:"space-y-4",children:[f&&p.jsxs(rc,{variant:"destructive",className:"rounded-2xl",children:[p.jsx(vc,{className:"h-4 w-4"}),p.jsx(lc,{children:f})]}),p.jsxs(rc,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[p.jsx(Cd,{className:"h-4 w-4"}),p.jsx(yh,{children:n("auth.noDefaultCredentials")}),p.jsx(lc,{children:n("auth.credentialsHint")})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{htmlFor:"username",className:"text-sm font-semibold",children:n("auth.username")}),p.jsx(ji,{id:"username",type:"text",value:i,onChange:z=>o(z.target.value),placeholder:n("auth.usernamePlaceholder"),autoComplete:"username",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 text-base md:text-base",disabled:m,required:!0})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(yn,{htmlFor:"password",className:"text-sm font-semibold",children:n("auth.password")}),p.jsxs("div",{className:"relative",children:[p.jsx(ji,{id:"password",type:c?"text":"password",value:a,onChange:z=>r(z.target.value),placeholder:n("auth.passwordPlaceholder"),autoComplete:"current-password",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 pr-14 text-base md:text-base",disabled:m,required:!0}),p.jsx(mt,{type:"button",variant:"ghost",size:"sm",className:"absolute inset-y-1 right-1 h-auto rounded-xl px-3 text-muted-foreground hover:text-foreground","aria-label":n(c?"auth.hidePassword":"auth.showPassword"),"aria-pressed":c,onClick:()=>d(z=>!z),disabled:m,children:c?p.jsx(Kc,{className:"h-4 w-4"}):p.jsx(Vc,{className:"h-4 w-4"})})]})]}),p.jsx(mt,{type:"submit",className:"h-12 w-full rounded-2xl text-sm font-semibold",disabled:m,children:m?p.jsxs(p.Fragment,{children:[p.jsx(hi,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})]})})]})}const f9=A.lazy(()=>rt(()=>import("./index-CqsmdQoA.js"),__vite__mapDeps([24,1,2,4,5,25,6,7,9,8])).then(n=>({default:n.AnalyticsPage}))),p9=A.lazy(()=>rt(()=>import("./api-CjLfG9mL.js"),__vite__mapDeps([26,1,2,5,27,19,6,4,3,7,8,9])).then(n=>({default:n.ApiPage}))),g9=A.lazy(()=>rt(()=>import("./cliproxy-fai69Vyd.js"),__vite__mapDeps([28,1,2,5,17,6,4,21,29,27,19,30,31,18,20,7,8,9])).then(n=>({default:n.CliproxyPage}))),m9=A.lazy(()=>rt(()=>import("./cliproxy-ai-providers-2lI5jSHb.js"),__vite__mapDeps([32,1,2,18,19,5,6,4,20,27,7,8,9])).then(n=>({default:n.CliproxyAiProvidersPage}))),y9=A.lazy(()=>rt(()=>import("./cliproxy-control-panel-63gDI-e5.js"),__vite__mapDeps([33,1,2,5,17,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),b9=A.lazy(()=>rt(()=>import("./copilot-BgG5x_X6.js"),__vite__mapDeps([34,1,2,5,27,19,4,30,31,6,7,8,9])).then(n=>({default:n.CopilotPage}))),x9=A.lazy(()=>rt(()=>import("./cursor-DF63lFcy.js"),__vite__mapDeps([35,1,2,6,5,17,30,31,4,7,8,9])).then(n=>({default:n.CursorPage}))),v9=A.lazy(()=>rt(()=>import("./claude-extension-B2v9bsN9.js"),__vite__mapDeps([36,1,2,5,6,4,7,8,9])).then(n=>({default:n.ClaudeExtensionPage}))),C9=A.lazy(()=>rt(()=>import("./codex-i_hfI4Tv.js"),__vite__mapDeps([37,1,2,6,38,5,4,20,30,39,7,8,9])).then(n=>({default:n.CodexPage}))),S9=A.lazy(()=>rt(()=>import("./droid-CqlQmFtN.js"),__vite__mapDeps([40,1,2,6,5,39,4,30,7,8,9])).then(n=>({default:n.DroidPage}))),k9=A.lazy(()=>rt(()=>import("./logs-Dy-yZhIK.js"),__vite__mapDeps([41,1,2,4,5,6,7,8,9])).then(n=>({default:n.LogsPage}))),w9=A.lazy(()=>rt(()=>import("./accounts-B2THsSu_.js"),__vite__mapDeps([42,1,2,5,38,19,25,6,4,29,7,8,9])).then(n=>({default:n.AccountsPage}))),A9=A.lazy(()=>rt(()=>Promise.resolve().then(()=>EK),void 0).then(n=>({default:n.SettingsPage}))),P9=A.lazy(()=>rt(()=>import("./health-7ZO5PEm9.js"),__vite__mapDeps([43,1,2,5,6,4,11,7,8,9])).then(n=>({default:n.HealthPage}))),D9=A.lazy(()=>rt(()=>import("./shared-BiIwM7--.js"),__vite__mapDeps([44,1,2,25,5,6,4,7,8,9])).then(n=>({default:n.SharedPage}))),O9=A.lazy(()=>rt(()=>import("./updates-ButNfJqt.js"),__vite__mapDeps([45,1,2,4,5,6,7,8,9])).then(n=>({default:n.UpdatesPage}))),T9=null;function cn(){return p.jsx("div",{className:"flex h-64 items-center justify-center",children:p.jsx(hi,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function M9(){return p.jsx(gE,{client:K2,children:p.jsx(_I,{defaultTheme:"system",storageKey:"vite-ui-theme",children:p.jsx(UI,{children:p.jsx(KI,{children:p.jsxs(dE,{children:[p.jsxs(hE,{children:[p.jsx(Et,{path:"/login",element:p.jsx(h9,{})}),p.jsx(Et,{element:p.jsx(VI,{}),children:p.jsxs(Et,{element:p.jsx(aB,{}),children:[p.jsx(Et,{path:"/",element:p.jsx(N3,{})}),p.jsx(Et,{path:"/analytics",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(f9,{})})}),p.jsx(Et,{path:"/updates",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(O9,{})})}),p.jsx(Et,{path:"/providers",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(p9,{})})}),p.jsx(Et,{path:"/cliproxy",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(g9,{})})}),p.jsx(Et,{path:"/cliproxy/ai-providers",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(m9,{})})}),p.jsx(Et,{path:"/cliproxy/control-panel",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(y9,{})})}),p.jsx(Et,{path:"/copilot",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(b9,{})})}),p.jsx(Et,{path:"/cursor",element:p.jsx(iP,{to:"/cliproxy?provider=cursor",replace:!0})}),p.jsx(Et,{path:"/legacy/cursor",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(x9,{})})}),p.jsx(Et,{path:"/claude-extension",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(v9,{})})}),p.jsx(Et,{path:"/codex",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(C9,{})})}),p.jsx(Et,{path:"/droid",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(S9,{})})}),p.jsx(Et,{path:"/accounts",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(w9,{})})}),p.jsx(Et,{path:"/settings",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(A9,{})})}),p.jsx(Et,{path:"/health",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(P9,{})})}),p.jsx(Et,{path:"/logs",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(k9,{})})}),p.jsx(Et,{path:"/shared",element:p.jsx(A.Suspense,{fallback:p.jsx(cn,{}),children:p.jsx(D9,{})})}),T9]})})]}),p.jsx(mE,{position:"top-right"})]})})})})})}const bN=document.getElementById("root");if(!bN)throw new Error("Root element not found. Failed to mount React application.");F2.createRoot(bN).render(p.jsx(A.StrictMode,{children:p.jsx(M9,{})}));export{D_ as $,RW as A,Qt as B,w_ as C,j3 as D,F3 as E,MW as F,LW as G,R3 as H,ji as I,U3 as J,q3 as K,yn as L,NW as M,$j as N,Xj as O,MP as P,Jj as Q,PD as R,tt as S,To as T,$b as U,bh as V,py as W,re as X,IW as Y,Ue as Z,EW as _,Ce as a,J9 as a$,BW as a0,HW as a1,_W as a2,UW as a3,zW as a4,FW as a5,TD as a6,qW as a7,N_ as a8,Fb as a9,VW as aA,WW as aB,KW as aC,m5 as aD,xW as aE,Rk as aF,s_ as aG,GW as aH,W3 as aI,ID as aJ,nH as aK,bH as aL,pa as aM,V5 as aN,W5 as aO,Q5 as aP,Y5 as aQ,zB as aR,VP as aS,iW as aT,oW as aU,sW as aV,aW,ZW as aX,q9 as aY,Yj as aZ,X9 as a_,qb as aa,U9 as ab,Gj as ac,G9 as ad,Y9 as ae,eW as af,tW as ag,Nb as ah,Lb as ai,Rb as aj,Eb as ak,Ib as al,QW as am,R_ as an,YW as ao,Ca as ap,SW as aq,Xl as ar,kW as as,ly as at,nW as au,wW as av,AW as aw,DW as ax,Ek as ay,PW as az,O_ as b,Kj as b0,Vj as b1,Z9 as b2,Wj as b3,Qj as b4,$9 as b5,_b as b6,CW as b7,pW as b8,mW as b9,MK as bA,uW as bB,rW as bC,P5 as bD,D5 as bE,vW as bF,dW as bG,K9 as bH,V9 as bI,W9 as bJ,Q9 as bK,lW as bL,cW as bM,fW as bN,hW as bO,kP as bP,wI as bQ,SI as bR,iy as bS,ha as bT,pI as bU,mI as bV,vI as bW,PI as bX,Xd as bY,yW as ba,gW as bb,YM as bc,Jb as bd,bW as be,$l as bf,z9 as bg,F9 as bh,rc as bi,yh as bj,lc as bk,oQ as bl,Qb as bm,Sc as bn,Yb as bo,k3 as bp,fj as bq,mj as br,yj as bs,bj as bt,xj as bu,O3 as bv,OW as bw,TW as bx,XM as by,OK as bz,q as c,jW as d,mt as e,$W as f,XW as g,E_ as h,u9 as i,zP as j,Ub as k,FP as l,zb as m,ac as n,_9 as o,A_ as p,P_ as q,GB as r,KB as s,Kr as t,kb as u,JW as v,Mo as w,No as x,ow as y,V3 as z};