@minimalcorp/tsunagi 0.0.4 → 0.0.6

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 (699) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/app-path-routes-manifest.json +0 -28
  3. package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
  4. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/apps/web/.next/required-server-files.json +1 -15
  6. package/.next/standalone/apps/web/.next/routes-manifest.json +1 -200
  7. package/.next/standalone/apps/web/.next/server/app/_global-error/page.js +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  13. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/standalone/apps/web/.next/server/app/_not-found/page.js +1 -1
  18. package/.next/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  21. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +13 -13
  22. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  23. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
  25. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next/standalone/apps/web/.next/server/app/icon.png/route.js +1 -2
  29. package/.next/standalone/apps/web/.next/server/app/icon.png/route.js.nft.json +1 -1
  30. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  31. package/.next/standalone/apps/web/.next/server/app/index.rsc +15 -15
  32. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  33. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +15 -15
  34. package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +4 -4
  35. package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +8 -8
  36. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  37. package/.next/standalone/apps/web/.next/server/app/page.js +1 -1
  38. package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  39. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/apps/web/.next/server/app/settings/page.js +1 -1
  41. package/.next/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  42. package/.next/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
  44. package/.next/standalone/apps/web/.next/server/app/settings.rsc +15 -15
  45. package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +15 -15
  46. package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  47. package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +8 -8
  48. package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  49. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  50. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  51. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page.js +1 -1
  52. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page.js.nft.json +1 -1
  53. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/apps/web/.next/server/app-paths-manifest.json +0 -28
  55. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0jam776._.js +13 -0
  56. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_icon_png_route_actions_01922jn.js +1 -1
  57. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0.df2qi._.js +3 -0
  58. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0a8.h72._.js +3 -0
  59. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0cl-0al._.js +3 -0
  60. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0e2_bho._.js +3 -0
  61. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ff1foz._.js +3 -0
  62. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__01cqrhy._.js → [root-of-the-server]__0h4wzcb._.js} +2 -2
  63. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0hhfi7s._.js +3 -0
  64. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ji00ks._.js +3 -0
  65. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0n2qong._.js +3 -0
  66. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__098q4~4._.js → [root-of-the-server]__0ome304._.js} +2 -2
  67. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0qtqq5d._.js +3 -0
  68. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__03mpod.._.js → [root-of-the-server]__0qw6wy3._.js} +4 -4
  69. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0sha5xx._.js +3 -0
  70. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__00pql9~._.js → [root-of-the-server]__12yece_._.js} +4 -4
  71. package/.next/standalone/apps/web/.next/server/chunks/ssr/_00wnq9i._.js +2 -2
  72. package/.next/standalone/apps/web/.next/server/chunks/ssr/{_0ol3g7m._.js → _075y~8w._.js} +2 -2
  73. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0g.cd6a._.js +1 -1
  74. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0mjd2fj._.js +2 -2
  75. package/.next/standalone/apps/web/.next/server/chunks/ssr/_10np2kf._.js +2 -2
  76. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__global-error_page_actions_0.u5cfa.js +1 -1
  77. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__not-found_page_actions_0appun9.js +1 -1
  78. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_page_actions_0rm5_5w.js +1 -1
  79. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_settings_page_actions_0f6epye.js +1 -1
  80. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_tasks_[id]_page_actions_0.6kbe~.js +1 -1
  81. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_settings_page_tsx_0i6itlb._.js +2 -2
  82. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +2 -2
  83. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0.o~~kw._.js +31 -0
  84. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0236txg._.js +26 -0
  85. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_064q4aj._.js +3 -0
  86. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_07maurq._.js +3 -0
  87. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_07pr0y_._.js +3 -0
  88. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0_9vx8p._.js +45 -0
  89. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0d3g-x9._.js +3 -0
  90. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0hisk_6._.js +26 -0
  91. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0imu_yh._.js +45 -0
  92. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0j_6wlf._.js +31 -0
  93. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0llt_c0._.js +11 -0
  94. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0p7i50i._.js +11 -0
  95. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0tba1-p._.js +3 -0
  96. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0xodfy.._.js +3 -0
  97. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0yd1acw._.js +3 -0
  98. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0yvlzfi._.js +3 -0
  99. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
  100. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  101. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  102. package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
  103. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  104. package/.next/standalone/apps/web/.next/static/{JoYqGRe1NI9K8yLxCSu7g → bSPSUH1nA_0wClz0cgylZ}/_buildManifest.js +1 -5
  105. package/.next/standalone/apps/web/.next/static/chunks/{0k7r2.t3p~iwm.js → 066xfipi1ub8l.js} +2 -2
  106. package/.next/standalone/apps/web/.next/static/chunks/0b8.3al6nvw3d.css +4 -0
  107. package/.next/standalone/apps/web/.next/static/chunks/0lx0y8ph~faus.js +3 -0
  108. package/.next/standalone/apps/web/.next/static/chunks/{0p63tiak1b6s-.js → 0qyu6t8~exdxl.js} +2 -2
  109. package/.next/standalone/apps/web/.next/static/chunks/0rqog09uuknxq.js +5 -0
  110. package/.next/standalone/apps/web/.next/static/chunks/{0g.j9ko1tr-q0.js → 0xn4aezxw~.je.js} +1 -1
  111. package/.next/standalone/apps/web/.next/static/chunks/{0kxp1btclqdj7.js → 11_tr0pr9kxkl.js} +7 -7
  112. package/.next/standalone/apps/web/.next/static/chunks/{0whqmdgrwdcvt.js → 13nnuqjd3vrm1.js} +2 -2
  113. package/.next/standalone/apps/web/package.json +11 -78
  114. package/.next/standalone/apps/web/server.js +8 -2
  115. package/dist/auto-migrate.d.ts +1 -0
  116. package/dist/auto-migrate.js +30 -0
  117. package/dist/cli.d.ts +2 -0
  118. package/dist/cli.js +100 -0
  119. package/dist/plugin-lifecycle.d.ts +11 -0
  120. package/dist/plugin-lifecycle.js +86 -0
  121. package/dist/server/editor-session-store.d.ts +8 -0
  122. package/dist/server/editor-session-store.js +3 -6
  123. package/dist/server/generated/prisma/browser.d.ts +29 -0
  124. package/dist/server/generated/prisma/browser.js +17 -0
  125. package/dist/server/generated/prisma/client.d.ts +48 -0
  126. package/dist/server/generated/prisma/client.js +34 -0
  127. package/dist/server/generated/prisma/commonInputTypes.d.ts +355 -0
  128. package/dist/{generated → server/generated}/prisma/commonInputTypes.js +1 -2
  129. package/dist/server/generated/prisma/enums.d.ts +1 -0
  130. package/dist/{generated → server/generated}/prisma/enums.js +1 -2
  131. package/dist/server/generated/prisma/internal/class.d.ts +174 -0
  132. package/dist/{generated → server/generated}/prisma/internal/class.js +6 -42
  133. package/dist/server/generated/prisma/internal/prismaNamespace.d.ts +874 -0
  134. package/dist/server/generated/prisma/internal/prismaNamespace.js +146 -0
  135. package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.d.ts +110 -0
  136. package/dist/{generated → server/generated}/prisma/internal/prismaNamespaceBrowser.js +15 -51
  137. package/dist/server/generated/prisma/models/EnvironmentVariable.d.ts +1331 -0
  138. package/dist/server/generated/prisma/models/EnvironmentVariable.js +1 -0
  139. package/dist/server/generated/prisma/models/PlannerTab.d.ts +1089 -0
  140. package/dist/server/generated/prisma/models/PlannerTab.js +1 -0
  141. package/dist/server/generated/prisma/models/Repository.d.ts +1277 -0
  142. package/dist/server/generated/prisma/models/Repository.js +1 -0
  143. package/dist/server/generated/prisma/models/Tab.d.ts +1357 -0
  144. package/dist/server/generated/prisma/models/Tab.js +1 -0
  145. package/dist/server/generated/prisma/models/Task.d.ts +1779 -0
  146. package/dist/server/generated/prisma/models/Task.js +1 -0
  147. package/dist/server/generated/prisma/models.d.ts +6 -0
  148. package/dist/server/generated/prisma/models.js +1 -0
  149. package/dist/server/index.d.ts +1 -0
  150. package/dist/server/index.js +40 -22
  151. package/dist/server/lib/branch-utils.d.ts +1 -0
  152. package/dist/server/lib/branch-utils.js +4 -0
  153. package/dist/server/lib/data-path.d.ts +15 -0
  154. package/dist/server/lib/data-path.js +23 -0
  155. package/dist/server/lib/db.d.ts +2 -0
  156. package/dist/server/lib/db.js +13 -0
  157. package/dist/server/lib/repositories/environment.d.ts +6 -0
  158. package/dist/{src → server}/lib/repositories/environment.js +14 -21
  159. package/dist/server/lib/repositories/repository.d.ts +6 -0
  160. package/dist/{src → server}/lib/repositories/repository.js +13 -20
  161. package/dist/server/lib/repositories/task.d.ts +27 -0
  162. package/dist/{src → server}/lib/repositories/task.js +27 -41
  163. package/dist/server/lib/services/task-service.d.ts +69 -0
  164. package/dist/{src → server}/lib/services/task-service.js +22 -70
  165. package/dist/server/lib/worktree-manager.d.ts +25 -0
  166. package/dist/{src → server}/lib/worktree-manager.js +37 -89
  167. package/dist/server/pty-manager.d.ts +40 -0
  168. package/dist/server/pty-manager.js +3 -39
  169. package/dist/server/routes/commands.d.ts +2 -0
  170. package/dist/server/routes/commands.js +46 -0
  171. package/dist/server/routes/editor.d.ts +2 -0
  172. package/dist/server/routes/editor.js +15 -18
  173. package/dist/server/routes/env.d.ts +2 -0
  174. package/dist/server/routes/env.js +144 -0
  175. package/dist/server/routes/hooks.d.ts +25 -0
  176. package/dist/server/routes/hooks.js +15 -29
  177. package/dist/server/routes/internal.d.ts +2 -0
  178. package/dist/server/routes/internal.js +52 -0
  179. package/dist/server/routes/mcp.d.ts +2 -0
  180. package/dist/server/routes/mcp.js +65 -42
  181. package/dist/server/routes/onboarding.d.ts +2 -0
  182. package/dist/server/routes/onboarding.js +15 -0
  183. package/dist/server/routes/planner.d.ts +2 -0
  184. package/dist/server/routes/planner.js +86 -0
  185. package/dist/server/routes/repos.d.ts +2 -0
  186. package/dist/server/routes/repos.js +187 -0
  187. package/dist/server/routes/tasks.d.ts +2 -0
  188. package/dist/server/routes/tasks.js +322 -59
  189. package/dist/server/routes/terminal.d.ts +2 -0
  190. package/dist/server/routes/terminal.js +32 -67
  191. package/dist/server/routes/worktrees.d.ts +2 -0
  192. package/dist/server/routes/worktrees.js +82 -0
  193. package/dist/single-instance-lock.d.ts +6 -0
  194. package/dist/{scripts/single-instance-lock.js → single-instance-lock.js} +4 -40
  195. package/dist/with-plugin.d.ts +2 -0
  196. package/dist/with-plugin.js +66 -0
  197. package/package.json +10 -49
  198. package/prisma/schema.prisma +1 -1
  199. package/tsunagi-marketplace/plugins/tsunagi-plugin/.claude-plugin/plugin.json +24 -24
  200. package/.next/standalone/apps/web/.next/server/app/api/clone/route/app-paths-manifest.json +0 -3
  201. package/.next/standalone/apps/web/.next/server/app/api/clone/route/build-manifest.json +0 -9
  202. package/.next/standalone/apps/web/.next/server/app/api/clone/route/server-reference-manifest.json +0 -4
  203. package/.next/standalone/apps/web/.next/server/app/api/clone/route.js +0 -8
  204. package/.next/standalone/apps/web/.next/server/app/api/clone/route.js.map +0 -5
  205. package/.next/standalone/apps/web/.next/server/app/api/clone/route.js.nft.json +0 -1
  206. package/.next/standalone/apps/web/.next/server/app/api/clone/route_client-reference-manifest.js +0 -3
  207. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route/app-paths-manifest.json +0 -3
  208. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route/build-manifest.json +0 -9
  209. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route/server-reference-manifest.json +0 -4
  210. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route.js +0 -6
  211. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route.js.map +0 -5
  212. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route.js.nft.json +0 -1
  213. package/.next/standalone/apps/web/.next/server/app/api/commands/open/route_client-reference-manifest.js +0 -3
  214. package/.next/standalone/apps/web/.next/server/app/api/env/list/route/app-paths-manifest.json +0 -3
  215. package/.next/standalone/apps/web/.next/server/app/api/env/list/route/build-manifest.json +0 -9
  216. package/.next/standalone/apps/web/.next/server/app/api/env/list/route/server-reference-manifest.json +0 -4
  217. package/.next/standalone/apps/web/.next/server/app/api/env/list/route.js +0 -7
  218. package/.next/standalone/apps/web/.next/server/app/api/env/list/route.js.map +0 -5
  219. package/.next/standalone/apps/web/.next/server/app/api/env/list/route.js.nft.json +0 -1
  220. package/.next/standalone/apps/web/.next/server/app/api/env/list/route_client-reference-manifest.js +0 -3
  221. package/.next/standalone/apps/web/.next/server/app/api/env/route/app-paths-manifest.json +0 -3
  222. package/.next/standalone/apps/web/.next/server/app/api/env/route/build-manifest.json +0 -9
  223. package/.next/standalone/apps/web/.next/server/app/api/env/route/server-reference-manifest.json +0 -4
  224. package/.next/standalone/apps/web/.next/server/app/api/env/route.js +0 -7
  225. package/.next/standalone/apps/web/.next/server/app/api/env/route.js.map +0 -5
  226. package/.next/standalone/apps/web/.next/server/app/api/env/route.js.nft.json +0 -1
  227. package/.next/standalone/apps/web/.next/server/app/api/env/route_client-reference-manifest.js +0 -3
  228. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route/app-paths-manifest.json +0 -3
  229. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route/build-manifest.json +0 -9
  230. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route/server-reference-manifest.json +0 -4
  231. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route.js +0 -7
  232. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route.js.map +0 -5
  233. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route.js.nft.json +0 -1
  234. package/.next/standalone/apps/web/.next/server/app/api/env/toggle/route_client-reference-manifest.js +0 -3
  235. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route/app-paths-manifest.json +0 -3
  236. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route/build-manifest.json +0 -9
  237. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route/server-reference-manifest.json +0 -4
  238. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route.js +0 -7
  239. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route.js.map +0 -5
  240. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route.js.nft.json +0 -1
  241. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/status/route_client-reference-manifest.js +0 -3
  242. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route/app-paths-manifest.json +0 -3
  243. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route/build-manifest.json +0 -9
  244. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route/server-reference-manifest.json +0 -4
  245. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route.js +0 -7
  246. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route.js.map +0 -5
  247. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route.js.nft.json +0 -1
  248. package/.next/standalone/apps/web/.next/server/app/api/internal/tabs/[tab_id]/todos/route_client-reference-manifest.js +0 -3
  249. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route/app-paths-manifest.json +0 -3
  250. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route/build-manifest.json +0 -9
  251. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route/server-reference-manifest.json +0 -4
  252. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route.js +0 -7
  253. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route.js.map +0 -5
  254. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route.js.nft.json +0 -1
  255. package/.next/standalone/apps/web/.next/server/app/api/onboarding/status/route_client-reference-manifest.js +0 -3
  256. package/.next/standalone/apps/web/.next/server/app/api/owners/route/app-paths-manifest.json +0 -3
  257. package/.next/standalone/apps/web/.next/server/app/api/owners/route/build-manifest.json +0 -9
  258. package/.next/standalone/apps/web/.next/server/app/api/owners/route/server-reference-manifest.json +0 -4
  259. package/.next/standalone/apps/web/.next/server/app/api/owners/route.js +0 -7
  260. package/.next/standalone/apps/web/.next/server/app/api/owners/route.js.map +0 -5
  261. package/.next/standalone/apps/web/.next/server/app/api/owners/route.js.nft.json +0 -1
  262. package/.next/standalone/apps/web/.next/server/app/api/owners/route_client-reference-manifest.js +0 -3
  263. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route/app-paths-manifest.json +0 -3
  264. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route/build-manifest.json +0 -9
  265. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route/server-reference-manifest.json +0 -4
  266. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route.js +0 -6
  267. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route.js.map +0 -5
  268. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route.js.nft.json +0 -1
  269. package/.next/standalone/apps/web/.next/server/app/api/planner/config/route_client-reference-manifest.js +0 -3
  270. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route/app-paths-manifest.json +0 -3
  271. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route/build-manifest.json +0 -9
  272. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route/server-reference-manifest.json +0 -4
  273. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route.js +0 -7
  274. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route.js.map +0 -5
  275. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route.js.nft.json +0 -1
  276. package/.next/standalone/apps/web/.next/server/app/api/planner/tabs/route_client-reference-manifest.js +0 -3
  277. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route/app-paths-manifest.json +0 -3
  278. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route/build-manifest.json +0 -9
  279. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route/server-reference-manifest.json +0 -4
  280. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route.js +0 -7
  281. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route.js.map +0 -5
  282. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route.js.nft.json +0 -1
  283. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/branches/route_client-reference-manifest.js +0 -3
  284. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route/app-paths-manifest.json +0 -3
  285. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route/build-manifest.json +0 -9
  286. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route/server-reference-manifest.json +0 -4
  287. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route.js +0 -7
  288. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route.js.map +0 -5
  289. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route.js.nft.json +0 -1
  290. package/.next/standalone/apps/web/.next/server/app/api/repos/[owner]/[repo]/route_client-reference-manifest.js +0 -3
  291. package/.next/standalone/apps/web/.next/server/app/api/repos/route/app-paths-manifest.json +0 -3
  292. package/.next/standalone/apps/web/.next/server/app/api/repos/route/build-manifest.json +0 -9
  293. package/.next/standalone/apps/web/.next/server/app/api/repos/route/server-reference-manifest.json +0 -4
  294. package/.next/standalone/apps/web/.next/server/app/api/repos/route.js +0 -7
  295. package/.next/standalone/apps/web/.next/server/app/api/repos/route.js.map +0 -5
  296. package/.next/standalone/apps/web/.next/server/app/api/repos/route.js.nft.json +0 -1
  297. package/.next/standalone/apps/web/.next/server/app/api/repos/route_client-reference-manifest.js +0 -3
  298. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route/app-paths-manifest.json +0 -3
  299. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route/build-manifest.json +0 -9
  300. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route/server-reference-manifest.json +0 -4
  301. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route.js +0 -7
  302. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route.js.map +0 -5
  303. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route.js.nft.json +0 -1
  304. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/complete/route_client-reference-manifest.js +0 -3
  305. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route/app-paths-manifest.json +0 -3
  306. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route/build-manifest.json +0 -9
  307. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route/server-reference-manifest.json +0 -4
  308. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route.js +0 -8
  309. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route.js.map +0 -5
  310. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route.js.nft.json +0 -1
  311. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/needs-rebase/route_client-reference-manifest.js +0 -3
  312. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route/app-paths-manifest.json +0 -3
  313. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route/build-manifest.json +0 -9
  314. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route/server-reference-manifest.json +0 -4
  315. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route.js +0 -8
  316. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route.js.map +0 -5
  317. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route.js.nft.json +0 -1
  318. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/rebase/route_client-reference-manifest.js +0 -3
  319. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route/app-paths-manifest.json +0 -3
  320. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route/build-manifest.json +0 -9
  321. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route/server-reference-manifest.json +0 -4
  322. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route.js +0 -8
  323. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route.js.map +0 -5
  324. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route.js.nft.json +0 -1
  325. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +0 -3
  326. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route/app-paths-manifest.json +0 -3
  327. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route/build-manifest.json +0 -9
  328. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route/server-reference-manifest.json +0 -4
  329. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route.js +0 -7
  330. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route.js.map +0 -5
  331. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route.js.nft.json +0 -1
  332. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/status/route_client-reference-manifest.js +0 -3
  333. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route/app-paths-manifest.json +0 -3
  334. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route/build-manifest.json +0 -9
  335. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route/server-reference-manifest.json +0 -4
  336. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route.js +0 -7
  337. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route.js.map +0 -5
  338. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route.js.nft.json +0 -1
  339. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/[tab_id]/route_client-reference-manifest.js +0 -3
  340. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route/app-paths-manifest.json +0 -3
  341. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route/build-manifest.json +0 -9
  342. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route/server-reference-manifest.json +0 -4
  343. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route.js +0 -7
  344. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route.js.map +0 -5
  345. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route.js.nft.json +0 -1
  346. package/.next/standalone/apps/web/.next/server/app/api/tasks/[id]/tabs/route_client-reference-manifest.js +0 -3
  347. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route/app-paths-manifest.json +0 -3
  348. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route/build-manifest.json +0 -9
  349. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route/server-reference-manifest.json +0 -4
  350. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route.js +0 -8
  351. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route.js.map +0 -5
  352. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route.js.nft.json +0 -1
  353. package/.next/standalone/apps/web/.next/server/app/api/tasks/batch-delete/route_client-reference-manifest.js +0 -3
  354. package/.next/standalone/apps/web/.next/server/app/api/tasks/route/app-paths-manifest.json +0 -3
  355. package/.next/standalone/apps/web/.next/server/app/api/tasks/route/build-manifest.json +0 -9
  356. package/.next/standalone/apps/web/.next/server/app/api/tasks/route/server-reference-manifest.json +0 -4
  357. package/.next/standalone/apps/web/.next/server/app/api/tasks/route.js +0 -8
  358. package/.next/standalone/apps/web/.next/server/app/api/tasks/route.js.map +0 -5
  359. package/.next/standalone/apps/web/.next/server/app/api/tasks/route.js.nft.json +0 -1
  360. package/.next/standalone/apps/web/.next/server/app/api/tasks/route_client-reference-manifest.js +0 -3
  361. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route/app-paths-manifest.json +0 -3
  362. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route/build-manifest.json +0 -9
  363. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route/server-reference-manifest.json +0 -4
  364. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route.js +0 -7
  365. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route.js.map +0 -5
  366. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route.js.nft.json +0 -1
  367. package/.next/standalone/apps/web/.next/server/app/api/tasks/validate/route_client-reference-manifest.js +0 -3
  368. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route/app-paths-manifest.json +0 -3
  369. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route/build-manifest.json +0 -9
  370. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route/server-reference-manifest.json +0 -4
  371. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route.js +0 -7
  372. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route.js.map +0 -5
  373. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route.js.nft.json +0 -1
  374. package/.next/standalone/apps/web/.next/server/app/api/worktrees/create/route_client-reference-manifest.js +0 -3
  375. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route/app-paths-manifest.json +0 -3
  376. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route/build-manifest.json +0 -9
  377. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route/server-reference-manifest.json +0 -4
  378. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route.js +0 -7
  379. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route.js.map +0 -5
  380. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route.js.nft.json +0 -1
  381. package/.next/standalone/apps/web/.next/server/app/api/worktrees/delete/route_client-reference-manifest.js +0 -3
  382. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route/app-paths-manifest.json +0 -3
  383. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route/build-manifest.json +0 -9
  384. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route/server-reference-manifest.json +0 -4
  385. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route.js +0 -8
  386. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route.js.map +0 -5
  387. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route.js.nft.json +0 -1
  388. package/.next/standalone/apps/web/.next/server/app/api/worktrees/init/route_client-reference-manifest.js +0 -3
  389. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route/app-paths-manifest.json +0 -3
  390. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route/build-manifest.json +0 -9
  391. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route/server-reference-manifest.json +0 -4
  392. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route.js +0 -7
  393. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route.js.map +0 -5
  394. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route.js.nft.json +0 -1
  395. package/.next/standalone/apps/web/.next/server/app/api/worktrees/list/route_client-reference-manifest.js +0 -3
  396. package/.next/standalone/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_repos_[owner]_[repo]_route_actions_0y.unn4.js +0 -3
  397. package/.next/standalone/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_tasks_[id]_needs-rebase_route_actions_0y9hgye.js +0 -3
  398. package/.next/standalone/apps/web/.next/server/chunks/07~4_@prisma_client_runtime_query_compiler_fast_bg_sqlite_wasm-base64_mjs_0wnnza3._.js +0 -3
  399. package/.next/standalone/apps/web/.next/server/chunks/09og__next-internal_server_app_api_tasks_[id]_tabs_[tab_id]_route_actions_0m796s4.js +0 -3
  400. package/.next/standalone/apps/web/.next/server/chunks/0nf3_next-internal_server_app_api_internal_tabs_[tab_id]_todos_route_actions_02z31m7.js +0 -3
  401. package/.next/standalone/apps/web/.next/server/chunks/0z2a_server_app_api_internal_tabs_[tab_id]_status_route_actions_0ilq1cc.js +0 -3
  402. package/.next/standalone/apps/web/.next/server/chunks/0z2a_server_app_api_repos_[owner]_[repo]_branches_route_actions_0kw~i.m.js +0 -3
  403. package/.next/standalone/apps/web/.next/server/chunks/[externals]_@prisma_client_runtime_query_compiler_fast_bg_sqlite_mjs_0ov7..a._.js +0 -3
  404. package/.next/standalone/apps/web/.next/server/chunks/[externals]_node_buffer_0063pbu._.js +0 -3
  405. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0.7m5hr._.js +0 -3
  406. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0._xutx._.js +0 -3
  407. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0.dvtyz._.js +0 -3
  408. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__00esaoi._.js +0 -3
  409. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__00yawse._.js +0 -3
  410. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0153q01._.js +0 -3
  411. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__054zsor._.js +0 -3
  412. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__07kmv.l._.js +0 -3
  413. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__08s5l~m._.js +0 -3
  414. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0_o7jmk._.js +0 -3
  415. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0a-_dt5._.js +0 -3
  416. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0a7x-4o._.js +0 -3
  417. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0a_fd8w._.js +0 -3
  418. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0b0ufhx._.js +0 -3
  419. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0dvf7qr._.js +0 -3
  420. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0iyjaeq._.js +0 -3
  421. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0jbiea4._.js +0 -3
  422. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0kh_uy7._.js +0 -3
  423. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0kw0mqq._.js +0 -3
  424. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0p84cpj._.js +0 -3
  425. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0qmft~f._.js +0 -3
  426. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0u78gov._.js +0 -3
  427. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0u9--cs._.js +0 -3
  428. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0v8bdq7._.js +0 -13
  429. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0wr1n.-._.js +0 -3
  430. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0y44m9i._.js +0 -3
  431. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0y~0muj._.js +0 -3
  432. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__10omlcu._.js +0 -3
  433. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__10twj-0._.js +0 -3
  434. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__122yu-6._.js +0 -3
  435. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__13qyx58._.js +0 -3
  436. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_clone_route_actions_0i2usjl.js +0 -3
  437. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_commands_open_route_actions_0nr.lf~.js +0 -3
  438. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_env_list_route_actions_03ou9qy.js +0 -3
  439. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_env_route_actions_0j.l7e1.js +0 -3
  440. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_env_toggle_route_actions_0yul8q5.js +0 -3
  441. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_onboarding_status_route_actions_0-p50l9.js +0 -3
  442. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_owners_route_actions_0sf6d-s.js +0 -3
  443. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_planner_config_route_actions_0.2kv.b.js +0 -3
  444. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_planner_tabs_route_actions_00fsht3.js +0 -3
  445. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_repos_route_actions_08hf6lh.js +0 -3
  446. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_[id]_complete_route_actions_0955tfc.js +0 -3
  447. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_[id]_rebase_route_actions_0ltqhj..js +0 -3
  448. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_[id]_route_actions_0514yxk.js +0 -3
  449. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_[id]_status_route_actions_117cpp9.js +0 -3
  450. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_[id]_tabs_route_actions_0ex3~xn.js +0 -3
  451. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_batch-delete_route_actions_0ww_i~d.js +0 -3
  452. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_route_actions_0ff_.5_.js +0 -3
  453. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_tasks_validate_route_actions_0l5uu.c.js +0 -3
  454. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_worktrees_create_route_actions_0~lsdsh.js +0 -3
  455. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_worktrees_delete_route_actions_06nfkez.js +0 -3
  456. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_worktrees_init_route_actions_09tfs9b.js +0 -3
  457. package/.next/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_worktrees_list_route_actions_0_-udvz.js +0 -3
  458. package/.next/standalone/apps/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0kdit-s.js +0 -3
  459. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0-9rd88._.js +0 -3
  460. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__022775m._.js +0 -11
  461. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__033jtpd._.js +0 -3
  462. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__05s9qb9._.js +0 -3
  463. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__07bkjd6._.js +0 -26
  464. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__089qidr._.js +0 -45
  465. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_.vrpf._.js +0 -3
  466. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0b3x4kh._.js +0 -11
  467. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0en9qbe._.js +0 -31
  468. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ezg31n._.js +0 -3
  469. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0k~0jgm._.js +0 -3
  470. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0qk3s0-._.js +0 -45
  471. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0v5tqy.._.js +0 -3
  472. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0vnxm6a._.js +0 -3
  473. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0zqz-u3._.js +0 -3
  474. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~5jgy1._.js +0 -26
  475. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10.ql0_._.js +0 -3
  476. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__13m~gd4._.js +0 -3
  477. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__13qfjv1._.js +0 -31
  478. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0_q14j_._.js +0 -3
  479. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0fn7k5m._.js +0 -3
  480. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0h0q2lx._.js +0 -3
  481. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0hraodu._.js +0 -3
  482. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0i.0.fq._.js +0 -3
  483. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0orz5ju._.js +0 -3
  484. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0pr8ov_._.js +0 -3
  485. package/.next/standalone/apps/web/.next/static/chunks/0i_guf4-4_p5..css +0 -4
  486. package/.next/standalone/apps/web/.next/static/chunks/0o_q.90~v1nxx.js +0 -3
  487. package/.next/standalone/apps/web/.next/static/chunks/0x48ir_5my2vr.js +0 -5
  488. package/.next/standalone/node_modules/@libsql/client/package.json +0 -123
  489. package/.next/standalone/node_modules/@libsql/core/package.json +0 -89
  490. package/.next/standalone/node_modules/@libsql/hrana-client/package.json +0 -60
  491. package/.next/standalone/node_modules/@libsql/isomorphic-fetch/node.cjs +0 -23
  492. package/.next/standalone/node_modules/@libsql/isomorphic-fetch/node.js +0 -21
  493. package/.next/standalone/node_modules/@libsql/isomorphic-fetch/package.json +0 -51
  494. package/.next/standalone/node_modules/@libsql/isomorphic-fetch/web.cjs +0 -4
  495. package/.next/standalone/node_modules/@libsql/isomorphic-fetch/web.js +0 -8
  496. package/.next/standalone/node_modules/@libsql/isomorphic-ws/node.cjs +0 -3
  497. package/.next/standalone/node_modules/@libsql/isomorphic-ws/node.mjs +0 -2
  498. package/.next/standalone/node_modules/@libsql/isomorphic-ws/package.json +0 -43
  499. package/.next/standalone/node_modules/@libsql/isomorphic-ws/web.cjs +0 -12
  500. package/.next/standalone/node_modules/@libsql/isomorphic-ws/web.mjs +0 -11
  501. package/.next/standalone/node_modules/@libsql/linux-x64-gnu/package.json +0 -36
  502. package/.next/standalone/node_modules/@libsql/linux-x64-musl/package.json +0 -36
  503. package/.next/standalone/node_modules/@neon-rs/load/dist/index.js +0 -102
  504. package/.next/standalone/node_modules/@neon-rs/load/package.json +0 -37
  505. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/hrana.js +0 -372
  506. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/http.js +0 -268
  507. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/node.js +0 -41
  508. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/package.json +0 -3
  509. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/sql_cache.js +0 -91
  510. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/sqlite3.js +0 -500
  511. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/web.js +0 -41
  512. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-cjs/ws.js +0 -395
  513. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/hrana.js +0 -341
  514. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/http.js +0 -232
  515. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/node.js +0 -23
  516. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/sql_cache.js +0 -87
  517. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/sqlite3.js +0 -476
  518. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/web.js +0 -22
  519. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/lib-esm/ws.js +0 -359
  520. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/client/package.json +0 -123
  521. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-cjs/api.js +0 -34
  522. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-cjs/config.js +0 -143
  523. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-cjs/package.json +0 -3
  524. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-cjs/uri.js +0 -125
  525. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-cjs/util.js +0 -60
  526. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-esm/api.js +0 -29
  527. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-esm/config.js +0 -138
  528. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-esm/uri.js +0 -120
  529. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/lib-esm/util.js +0 -55
  530. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/core/package.json +0 -91
  531. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/LICENSE +0 -20
  532. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/batch.js +0 -277
  533. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/byte_queue.js +0 -49
  534. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/client.js +0 -17
  535. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/cursor.js +0 -6
  536. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/describe.js +0 -12
  537. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/index.js +0 -11
  538. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/json/decode.js +0 -70
  539. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/json/encode.js +0 -77
  540. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/protobuf/decode.js +0 -155
  541. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/protobuf/encode.js +0 -100
  542. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/encoding/protobuf/util.js +0 -9
  543. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/errors.js +0 -116
  544. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/client.js +0 -130
  545. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/cursor.js +0 -165
  546. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/json_decode.js +0 -90
  547. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/json_encode.js +0 -60
  548. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/proto.js +0 -18
  549. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/protobuf_decode.js +0 -47
  550. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/protobuf_encode.js +0 -83
  551. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/http/stream.js +0 -372
  552. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/id_alloc.js +0 -51
  553. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/index.js +0 -77
  554. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/libsql_url.js +0 -79
  555. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/package.json +0 -3
  556. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/queue.js +0 -30
  557. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/queue_microtask.js +0 -15
  558. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/result.js +0 -56
  559. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/shared/json_decode.js +0 -138
  560. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/shared/json_encode.js +0 -76
  561. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/shared/proto.js +0 -3
  562. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/shared/protobuf_decode.js +0 -118
  563. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/shared/protobuf_encode.js +0 -90
  564. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/sql.js +0 -51
  565. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/stmt.js +0 -81
  566. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/stream.js +0 -61
  567. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/util.js +0 -8
  568. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/value.js +0 -88
  569. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/client.js +0 -322
  570. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/cursor.js +0 -84
  571. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/json_decode.js +0 -101
  572. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/json_encode.js +0 -81
  573. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/proto.js +0 -18
  574. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/protobuf_decode.js +0 -63
  575. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/protobuf_encode.js +0 -119
  576. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-cjs/ws/stream.js +0 -215
  577. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/batch.js +0 -271
  578. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/byte_queue.js +0 -45
  579. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/client.js +0 -13
  580. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/cursor.js +0 -2
  581. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/describe.js +0 -8
  582. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/index.js +0 -4
  583. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/json/decode.js +0 -59
  584. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/json/encode.js +0 -72
  585. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/protobuf/decode.js +0 -150
  586. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/protobuf/encode.js +0 -95
  587. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/encoding/protobuf/util.js +0 -6
  588. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/errors.js +0 -102
  589. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/client.js +0 -126
  590. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/cursor.js +0 -138
  591. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/json_decode.js +0 -62
  592. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/json_encode.js +0 -55
  593. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/proto.js +0 -2
  594. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/protobuf_decode.js +0 -44
  595. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/protobuf_encode.js +0 -78
  596. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/http/stream.js +0 -368
  597. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/id_alloc.js +0 -47
  598. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/index.js +0 -42
  599. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/libsql_url.js +0 -75
  600. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/queue.js +0 -26
  601. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/queue_microtask.js +0 -13
  602. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/result.js +0 -48
  603. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/shared/json_decode.js +0 -106
  604. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/shared/json_encode.js +0 -71
  605. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/shared/proto.js +0 -2
  606. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/shared/protobuf_decode.js +0 -115
  607. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/shared/protobuf_encode.js +0 -85
  608. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/sql.js +0 -46
  609. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/stmt.js +0 -76
  610. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/stream.js +0 -57
  611. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/util.js +0 -4
  612. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/value.js +0 -83
  613. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/client.js +0 -318
  614. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/cursor.js +0 -80
  615. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/json_decode.js +0 -74
  616. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/json_encode.js +0 -77
  617. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/proto.js +0 -2
  618. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/protobuf_decode.js +0 -60
  619. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/protobuf_encode.js +0 -115
  620. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/lib-esm/ws/stream.js +0 -211
  621. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/hrana-client/package.json +0 -60
  622. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/linux-x64-gnu/index.node +0 -0
  623. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/linux-x64-gnu/package.json +0 -36
  624. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/linux-x64-musl/index.node +0 -0
  625. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/@libsql/linux-x64-musl/package.json +0 -36
  626. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/libsql/auth.js +0 -22
  627. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/libsql/index.js +0 -441
  628. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/libsql/package.json +0 -90
  629. package/.next/standalone/node_modules/@prisma/adapter-libsql/node_modules/libsql/sqlite-error.js +0 -21
  630. package/.next/standalone/node_modules/@prisma/client/package.json +0 -282
  631. package/.next/standalone/node_modules/@prisma/client/runtime/client.js +0 -82
  632. package/.next/standalone/node_modules/@prisma/client/runtime/query_compiler_fast_bg.sqlite.mjs +0 -2
  633. package/.next/standalone/node_modules/@prisma/client/runtime/query_compiler_fast_bg.sqlite.wasm-base64.mjs +0 -2
  634. package/.next/standalone/node_modules/@prisma/client-runtime-utils/dist/index.js +0 -2559
  635. package/.next/standalone/node_modules/@prisma/client-runtime-utils/package.json +0 -39
  636. package/.next/standalone/node_modules/cross-fetch/dist/node-ponyfill.js +0 -22
  637. package/.next/standalone/node_modules/cross-fetch/node_modules/node-fetch/lib/index.js +0 -1787
  638. package/.next/standalone/node_modules/cross-fetch/node_modules/node-fetch/package.json +0 -89
  639. package/.next/standalone/node_modules/cross-fetch/package.json +0 -129
  640. package/.next/standalone/node_modules/detect-libc/lib/detect-libc.js +0 -279
  641. package/.next/standalone/node_modules/detect-libc/lib/filesystem.js +0 -41
  642. package/.next/standalone/node_modules/detect-libc/lib/process.js +0 -19
  643. package/.next/standalone/node_modules/js-base64/base64.js +0 -321
  644. package/.next/standalone/node_modules/js-base64/base64.mjs +0 -301
  645. package/.next/standalone/node_modules/js-base64/package.json +0 -43
  646. package/.next/standalone/node_modules/libsql/package.json +0 -84
  647. package/.next/standalone/node_modules/node-fetch/package.json +0 -131
  648. package/.next/standalone/node_modules/promise-limit/index.js +0 -88
  649. package/.next/standalone/node_modules/promise-limit/package.json +0 -39
  650. package/.next/standalone/node_modules/tr46/index.js +0 -193
  651. package/.next/standalone/node_modules/tr46/lib/mappingTable.json +0 -1
  652. package/.next/standalone/node_modules/tr46/package.json +0 -31
  653. package/.next/standalone/node_modules/webidl-conversions/lib/index.js +0 -189
  654. package/.next/standalone/node_modules/webidl-conversions/package.json +0 -23
  655. package/.next/standalone/node_modules/whatwg-url/lib/URL-impl.js +0 -200
  656. package/.next/standalone/node_modules/whatwg-url/lib/URL.js +0 -196
  657. package/.next/standalone/node_modules/whatwg-url/lib/public-api.js +0 -11
  658. package/.next/standalone/node_modules/whatwg-url/lib/url-state-machine.js +0 -1297
  659. package/.next/standalone/node_modules/whatwg-url/lib/utils.js +0 -20
  660. package/.next/standalone/node_modules/whatwg-url/package.json +0 -32
  661. package/.next/standalone/node_modules/ws/index.js +0 -22
  662. package/.next/standalone/node_modules/ws/lib/buffer-util.js +0 -131
  663. package/.next/standalone/node_modules/ws/lib/constants.js +0 -19
  664. package/.next/standalone/node_modules/ws/lib/event-target.js +0 -292
  665. package/.next/standalone/node_modules/ws/lib/extension.js +0 -203
  666. package/.next/standalone/node_modules/ws/lib/limiter.js +0 -55
  667. package/.next/standalone/node_modules/ws/lib/permessage-deflate.js +0 -528
  668. package/.next/standalone/node_modules/ws/lib/receiver.js +0 -706
  669. package/.next/standalone/node_modules/ws/lib/sender.js +0 -602
  670. package/.next/standalone/node_modules/ws/lib/stream.js +0 -161
  671. package/.next/standalone/node_modules/ws/lib/subprotocol.js +0 -62
  672. package/.next/standalone/node_modules/ws/lib/validation.js +0 -152
  673. package/.next/standalone/node_modules/ws/lib/websocket-server.js +0 -554
  674. package/.next/standalone/node_modules/ws/lib/websocket.js +0 -1393
  675. package/.next/standalone/node_modules/ws/package.json +0 -70
  676. package/.next/standalone/node_modules/ws/wrapper.mjs +0 -21
  677. package/README.md +0 -381
  678. package/dist/generated/prisma/browser.js +0 -56
  679. package/dist/generated/prisma/client.js +0 -73
  680. package/dist/generated/prisma/internal/prismaNamespace.js +0 -182
  681. package/dist/generated/prisma/models/EnvironmentVariable.js +0 -2
  682. package/dist/generated/prisma/models/PlannerTab.js +0 -2
  683. package/dist/generated/prisma/models/Repository.js +0 -2
  684. package/dist/generated/prisma/models/Tab.js +0 -2
  685. package/dist/generated/prisma/models/Task.js +0 -2
  686. package/dist/generated/prisma/models.js +0 -2
  687. package/dist/scripts/auto-migrate.js +0 -82
  688. package/dist/scripts/cli.js +0 -152
  689. package/dist/scripts/db-backup.js +0 -93
  690. package/dist/scripts/db-restore.js +0 -114
  691. package/dist/scripts/migrate-to-sqlite.js +0 -164
  692. package/dist/scripts/plugin-lifecycle.js +0 -130
  693. package/dist/scripts/with-plugin.js +0 -60
  694. package/dist/src/lib/branch-utils.js +0 -7
  695. package/dist/src/lib/data-path.js +0 -61
  696. package/dist/src/lib/db.js +0 -16
  697. package/dist/src/lib/types.js +0 -2
  698. /package/.next/standalone/apps/web/.next/static/{JoYqGRe1NI9K8yLxCSu7g → bSPSUH1nA_0wClz0cgylZ}/_clientMiddlewareManifest.js +0 -0
  699. /package/.next/standalone/apps/web/.next/static/{JoYqGRe1NI9K8yLxCSu7g → bSPSUH1nA_0wClz0cgylZ}/_ssgManifest.js +0 -0
@@ -8,7 +8,7 @@ ${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
8
8
 
9
9
  If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component.
10
10
 
11
- For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536);function dt({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch(`/api/repos/${e}/${i}/branches`);if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch("http://localhost:2792/tasks/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch("http://localhost:2792/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(dt,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},48214,31245,68054,57212,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245);let s=(0,i.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,s],68054);let o=(0,i.default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,o],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,96085,31343,10031,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f,p,g,m;var _,v,y=e.i(18050),b=e.i(71645),S=e.i(37727),w=e.i(31278),x=e.i(48214),C=e.i(31245),k=e.i(68054),E=e.i(63209),R=e.i(57212),T=e.i(95468),D=e.i(73884),L=e.i(86311),A=e.i(68995),M=e.i(85902);function P({entry:e}){if(!e||"idle"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(x.CirclePause,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(w.Loader2,{className:"w-3 h-3 animate-spin"}),(0,y.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,y.jsx)(E.AlertCircle,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(R.WifiOff,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,y.jsx)(w.Loader2,{className:"w-3 h-3 animate-spin"}),(0,y.jsx)("span",{children:"running"})]});case"waiting":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,y.jsx)(L.MessageSquare,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"waiting"})]});case"success":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,y.jsx)(T.CheckCircle2,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,y.jsx)(D.XCircle,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(x.CirclePause,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,b.useRef)([]),[c,h]=(0,b.useState)({left:0,width:0}),[u,d]=(0,b.useState)(null);return(0,b.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(A.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,y.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,y.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
11
+ For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},48214,31245,68054,57212,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245);let s=(0,i.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,s],68054);let o=(0,i.default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,o],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,96085,31343,10031,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f,p,g,m;var _,v,y=e.i(18050),b=e.i(71645),S=e.i(37727),w=e.i(31278),x=e.i(48214),C=e.i(31245),k=e.i(68054),E=e.i(63209),R=e.i(57212),T=e.i(95468),D=e.i(73884),L=e.i(86311),A=e.i(68995),M=e.i(85902);function P({entry:e}){if(!e||"idle"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(x.CirclePause,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(w.Loader2,{className:"w-3 h-3 animate-spin"}),(0,y.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,y.jsx)(E.AlertCircle,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(R.WifiOff,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,y.jsx)(w.Loader2,{className:"w-3 h-3 animate-spin"}),(0,y.jsx)("span",{children:"running"})]});case"waiting":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,y.jsx)(L.MessageSquare,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"waiting"})]});case"success":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,y.jsx)(T.CheckCircle2,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,y.jsx)(D.XCircle,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,y.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,y.jsx)(x.CirclePause,{className:"w-3 h-3"}),(0,y.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,b.useRef)([]),[c,h]=(0,b.useState)({left:0,width:0}),[u,d]=(0,b.useState)(null);return(0,b.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(A.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,y.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,y.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
12
12
  flex items-center gap-2 px-4 pt-1 pb-2 h-10 flex-shrink-0 transition-colors cursor-pointer
13
13
  ${o?"text-primary":h?"text-primary-light":"text-muted-foreground hover:text-foreground"}
14
14
  `,children:[(0,y.jsx)("div",{className:"font-medium flex items-center gap-2",children:(0,y.jsx)(P,{entry:c})}),e.length>1&&(0,y.jsx)(M.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,y.jsx)(S.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,y.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,y.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,y.jsx)(M.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,y.jsx)(k.Terminal,{className:"w-4 h-4"})}),(0,y.jsx)(M.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,y.jsx)(C.Bot,{className:"w-4 h-4"})})]}),(0,y.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var O=e.i(47167),B=Object.defineProperty,N=Object.getOwnPropertyDescriptor,I=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?N(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&B(i,r,o),o},F=(e,i)=>(r,n)=>i(r,n,e),z="Terminal input",H="Too much output to announce, navigate to rows manually to read";function j(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function W(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function $(e,i,r,n,s){W(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function U(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function q(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var V=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},K=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},Y=class e{constructor(){this.fg=0,this.bg=0,this.extended=new X}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},X=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},G=class e extends Y{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new X,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?U(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},J="di$target",Z="di$dependencies",Q=new Map;function ee(e){if(Q.has(e))return Q.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[J]===o?o[Z].push({id:s,index:a}):(o[Z]=[{id:s,index:a}],o[J]=o)};return i._id=e,Q.set(e,i),i}var et=ee("BufferService"),ei=ee("CoreMouseService"),er=ee("CoreService"),en=ee("CharsetService"),es=ee("InstantiationService"),eo=ee("LogService"),ea=ee("OptionsService"),el=ee("OscLinkService"),ec=ee("UnicodeService"),eh=ee("DecorationService"),eu=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new G,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
@@ -28,5 +28,5 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
28
28
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),rT&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&!!i&&this._areCoordsInSelection(i,r,n)}isCellInSelection(e,i){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&this._areCoordsInSelection([e,i],r,n)}_areCoordsInSelection(e,i,r){return e[1]>i[1]&&e[1]<r[1]||i[1]===r[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<r[0]||i[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||i[1]<r[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let r=this._linkifier.currentLink?.link?.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=r$(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,i),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=ru(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=r?0:(i>r&&(i-=r),(i=Math.min(Math.max(i,-50),50)/50)/Math.abs(i)+Math.round(14*i))}shouldForceSelection(e){return rC?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(2===e.button&&this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=3*!!this.shouldColumnSelect(e),this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&0===i.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(rC&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let e=r.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}i&&i[0]===this._model.selectionEnd[0]&&i[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&void 0!==i[0]&&void 0!==i[1]){let e=function(e,i,r,n){var s,o,a,l,c,h,u,d,f,p,g,m,_,v,y,b;let S,w=r.buffer.x,x=r.buffer.y;if(!r.buffer.hasScrollback){let b,S,C;return s=w,(0===rI(o=x,i,a=r,l=n).length?"":rj(rz(s,o,s,o-rF(o,a),!1,a).length,rH("D",l)))+rI(x,i,r,n)+(c=w,h=x,u=e,b=rI(h,d=i,f=r,p=n).length>0?d-rF(d,f):h,C=(g=c,m=h,S=rI(_=u,v=d,y=f,p).length>0?v-rF(v,y):m,g<_&&S<=v||g>=_&&S<v?"C":"D"),rj(rz(c,b,u,d,"C"===C,f).length,rH(C,p)))}if(x===i)return S=w>e?"D":"C",rj(Math.abs(w-e),rH(S,n));S=x>i?"D":"C";let C=Math.abs(x-i);return rj((b=x>i?e:w,r.cols-b+(C-1)*r.cols+1+((x>i?w:e)-1)),rH(S,n))}(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,r=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,i,r);return}!e||!i||this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&i[0]===this._oldSelectionEnd[0]&&i[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,i,r)}_fireOnSelectionChange(e,i,r){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,i){let r=i;for(let n=0;i>=n;n++){let s=e.loadCell(n,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:s>1&&i!==n&&(r+=s-1)}return r}setSelection(e,i,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,o=s.lines.get(e[1]);if(!o)return;let a=s.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(o,e[0]),c=l,h=e[0]-l,u=0,d=0,f=0,p=0;if(" "===a.charAt(l)){for(;l>0&&" "===a.charAt(l-1);)l--;for(;c<a.length&&" "===a.charAt(c+1);)c++}else{let i=e[0],r=e[0];0===o.getWidth(i)&&(u++,i--),2===o.getWidth(r)&&(d++,r++);let n=o.getString(r).length;for(n>1&&(p+=n-1,c+=n-1);i>0&&l>0&&!this._isCharWordSeparator(o.loadCell(i-1,this._workCell));){o.loadCell(i-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,i--):e>1&&(f+=e-1,l-=e-1),l--,i--}for(;r<o.length&&c+1<a.length&&!this._isCharWordSeparator(o.loadCell(r+1,this._workCell));){o.loadCell(r+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,r++):e>1&&(p+=e-1,c+=e-1),c++,r++}}c++;let g=l+h-u+f,m=Math.min(this._bufferService.cols,c-l+u+d-f-p);if(!(!i&&""===a.slice(l,c).trim())){if(r&&0===g&&32!==o.getCodePoint(0)){let i=s.lines.get(e[1]-1);if(i&&o.isWrapped&&32!==i.getCodePoint(this._bufferService.cols-1)){let i=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(i){let e=this._bufferService.cols-i.start;g-=e,m+=e}}}if(n&&g+m===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){let i=s.lines.get(e[1]+1);if(i?.isWrapped&&32!==i.getCodePoint(0)){let i=this._getWordAt([0,e[1]+1],!1,!1,!0);i&&(m+=i.length)}}return{start:g,length:m}}}_selectWordAt(e,i){let r=this._getWordAt(e,i);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let r=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,r]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=r$(r,this._bufferService.cols)}};rq=I([F(3,et),F(4,er),F(5,ep),F(6,ea),F(7,eg),F(8,ef)],rq);var rV=class{constructor(){this._data={}}set(e,i,r){this._data[e]||(this._data[e]={}),this._data[e][i]=r}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},rK=class{constructor(){this._color=new rV,this._css=new rV}setCss(e,i,r){this._css.set(e,i,r)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,r){this._color.set(e,i,r)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},rY=Object.freeze((()=>{let e=[nb.toColor("#2e3436"),nb.toColor("#cc0000"),nb.toColor("#4e9a06"),nb.toColor("#c4a000"),nb.toColor("#3465a4"),nb.toColor("#75507b"),nb.toColor("#06989a"),nb.toColor("#d3d7cf"),nb.toColor("#555753"),nb.toColor("#ef2929"),nb.toColor("#8ae234"),nb.toColor("#fce94f"),nb.toColor("#729fcf"),nb.toColor("#ad7fa8"),nb.toColor("#34e2e2"),nb.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=i[r/36%6|0],s=i[r/6%6|0],o=i[r%6];e.push({css:iF.toCss(n,s,o),rgba:iF.toRgba(n,s,o)})}for(let i=0;i<24;i++){let r=8+10*i;e.push({css:iF.toCss(r,r,r),rgba:iF.toRgba(r,r,r)})}return e})()),rX=nb.toColor("#ffffff"),rG=nb.toColor("#000000"),rJ=nb.toColor("#ffffff"),rZ={css:"rgba(255, 255, 255, 0.3)",rgba:0xffffff4d},rQ=class extends eO{constructor(e){super(),this._optionsService=e,this._contrastCache=new rK,this._halfContrastCache=new rK,this._onChangeColors=this._register(new eQ),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:rX,background:rG,cursor:rJ,cursorAccent:rG,selectionForeground:void 0,selectionBackgroundTransparent:rZ,selectionBackgroundOpaque:ny.blend(rG,rZ),selectionInactiveBackgroundTransparent:rZ,selectionInactiveBackgroundOpaque:ny.blend(rG,rZ),scrollbarSliderBackground:ny.opacity(rX,.2),scrollbarSliderHoverBackground:ny.opacity(rX,.4),scrollbarSliderActiveBackground:ny.opacity(rX,.5),overviewRulerBorder:rX,ansi:rY.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=r0(e.foreground,rX),i.background=r0(e.background,rG),i.cursor=ny.blend(i.background,r0(e.cursor,rJ)),i.cursorAccent=ny.blend(i.background,r0(e.cursorAccent,rG)),i.selectionBackgroundTransparent=r0(e.selectionBackground,rZ),i.selectionBackgroundOpaque=ny.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=r0(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=ny.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?r0(e.selectionForeground,i$):void 0,i.selectionForeground===i$&&(i.selectionForeground=void 0),ny.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=ny.opacity(i.selectionBackgroundTransparent,.3)),ny.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=ny.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=r0(e.scrollbarSliderBackground,ny.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=r0(e.scrollbarSliderHoverBackground,ny.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=r0(e.scrollbarSliderActiveBackground,ny.opacity(i.foreground,.5)),i.overviewRulerBorder=r0(e.overviewRulerBorder,rX),i.ansi=rY.slice(),i.ansi[0]=r0(e.black,rY[0]),i.ansi[1]=r0(e.red,rY[1]),i.ansi[2]=r0(e.green,rY[2]),i.ansi[3]=r0(e.yellow,rY[3]),i.ansi[4]=r0(e.blue,rY[4]),i.ansi[5]=r0(e.magenta,rY[5]),i.ansi[6]=r0(e.cyan,rY[6]),i.ansi[7]=r0(e.white,rY[7]),i.ansi[8]=r0(e.brightBlack,rY[8]),i.ansi[9]=r0(e.brightRed,rY[9]),i.ansi[10]=r0(e.brightGreen,rY[10]),i.ansi[11]=r0(e.brightYellow,rY[11]),i.ansi[12]=r0(e.brightBlue,rY[12]),i.ansi[13]=r0(e.brightMagenta,rY[13]),i.ansi[14]=r0(e.brightCyan,rY[14]),i.ansi[15]=r0(e.brightWhite,rY[15]),e.extendedAnsi){let r=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)i.ansi[n+16]=r0(e.extendedAnsi[n],rY[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(void 0===e){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function r0(e,i){if(void 0!==e)try{return nb.toColor(e)}catch{}return i}rQ=I([F(0,ea)],rQ);var r1=class{constructor(...e){for(let[i,r]of(this._entries=new Map,e))this.set(i,r)}set(e,i){let r=this._entries.get(e);return this._entries.set(e,i),r}forEach(e){for(let[i,r]of this._entries.entries())e(i,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},r2=class{constructor(){this._services=new r1,this._services.set(es,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let r=(e[Z]||[]).sort((e,i)=>e.index-i.index),n=[];for(let i of r){let r=this._services.get(i.id);if(!r)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${i.id._id}.`);n.push(r)}let s=r.length>0?r[0].index:i.length;if(i.length!==s)throw Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${i.length} static arguments`);return new e(...i,...n)}},r5={trace:0,debug:1,info:2,warn:3,error:4,off:5},r3=class extends eO{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=r5[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)"function"==typeof e[i]&&(e[i]=e[i]())}_log(e,i,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...r)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};r3=I([F(0,ea)],r3);var r4=class extends eO{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new eQ),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new eQ),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new eQ),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=Array(e);for(let r=0;r<Math.min(e,this.length);r++)i[r]=this._array[this._getCyclicIndex(r)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...r){if(i){for(let r=e;r<this._length-i;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,r){if(!(i<=0)){if(e<0||e>=this._length)throw Error("start argument out of range");if(e+r<0)throw Error("Cannot shift elements in list beyond index 0");if(r>0){for(let n=i-1;n>=0;n--)this.set(e+n+r,this.get(e+n));let n=e+i+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<i;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},r6=Object.freeze(new Y),r9=0,r8=class e{constructor(e,i,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let n=i||G.fromCharData([0,"",1,0]);for(let i=0;i<e;++i)this.setCell(i,n);this.length=e}get(e){let i=this._data[3*e+0],r=2097151&i;return[this._data[3*e+1],2097152&i?this._combined[e]:r?U(r):"",i>>22,2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):r]}set(e,i){this._data[3*e+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[3*e+0]=2097152|e|i[2]<<22):this._data[3*e+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 0xc00000&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&i}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e]:2097151&i?U(2097151&i):""}isProtected(e){return 0x20000000&this._data[3*e+2]}loadCell(e,i){return r9=3*e,i.content=this._data[r9+0],i.fg=this._data[r9+1],i.bg=this._data[r9+2],2097152&i.content&&(i.combinedData=this._combined[e]),0x10000000&i.bg&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){2097152&i.content&&(this._combined[e]=i.combinedData),0x10000000&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=i.content,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}setCellFromCodepoint(e,i,r,n){0x10000000&n.bg&&(this._extendedAttrs[e]=n.extended),this._data[3*e+0]=i|r<<22,this._data[3*e+1]=n.fg,this._data[3*e+2]=n.bg}addCodepointToCell(e,i,r){let n=this._data[3*e+0];2097152&n?this._combined[e]+=U(i):2097151&n?(this._combined[e]=U(2097151&n)+U(i),n&=-2097152,n|=2097152):n=4194304|i,r&&(n&=-0xc00001,n|=r<<22),this._data[3*e+0]=n}insertCells(e,i,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length-e){let n=new G;for(let r=this.length-e-i-1;r>=0;--r)this.setCell(e+i+r,this.loadCell(e+r,n));for(let n=0;n<i;++n)this.setCell(e+n,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);2===this.getWidth(this.length-1)&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(e,i,r){if(e%=this.length,i<this.length-e){let n=new G;for(let r=0;r<this.length-e-i;++r)this.setCell(e+r,this.loadCell(e+i+r,n));for(let e=this.length-i;e<this.length;++e)this.setCell(e,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,r)}replaceCells(e,i,r,n=!1){if(n){for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,r),e++;return}for(e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.setCell(e++,r)}resize(e,i){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let r=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{let e=new Uint32Array(r);e.set(this._data),this._data=e}for(let r=this.length;r<e;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let r=0;r<i.length;r++){let n=parseInt(i[r],10);n>=e&&delete this._combined[n]}let n=Object.keys(this._extendedAttrs);for(let i=0;i<n.length;i++){let r=parseInt(n[i],10);r>=e&&delete this._extendedAttrs[r]}}return this.length=e,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,e)}copyFrom(e){for(let i in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[i]=e._combined[i];for(let i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let i=new e(0);for(let e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(let e in this._extendedAttrs)i._extendedAttrs[e]=this._extendedAttrs[e];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||0x3000000&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,i,r,n,s){let o=e._data;if(s)for(let s=n-1;s>=0;s--){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}else for(let s=0;s<n;s++){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}let a=Object.keys(e._combined);for(let n=0;n<a.length;n++){let s=parseInt(a[n],10);s>=i&&(this._combined[s-i+r]=e._combined[s])}}translateToString(e,i,r,n){i=i??0,r=r??this.length,e&&(r=Math.min(r,this.getTrimmedLength())),n&&(n.length=0);let s="";for(;i<r;){let e=this._data[3*i+0],r=2097151&e,o=2097152&e?this._combined[i]:r?U(r):" ";if(s+=o,n)for(let e=0;e<o.length;++e)n.push(i);i+=e>>22||1}return n&&n.push(i),s}};function r7(e,i,r){if(i===e.length-1)return e[i].getTrimmedLength();let n=!e[i].hasContent(r-1)&&1===e[i].getWidth(r-1),s=2===e[i+1].getWidth(0);return n&&s?r-1:r}var ne=class e{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new eQ),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),eL(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};ne._nextId=1;var nt={},ni=nt.B;nt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},nt.A={"#":"£"},nt.B=void 0,nt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},nt.C=nt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},nt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},nt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},nt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},nt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},nt.E=nt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},nt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},nt.H=nt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},nt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var nr=class{constructor(e,i,r){this._hasScrollback=e,this._optionsService=i,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=r6.clone(),this.savedCharset=ni,this.markers=[],this._nullCell=G.fromCharData([0,"",1,0]),this._whitespaceCell=G.fromCharData([0," ",1,32]),this._isClearing=!1,this._memoryCleanupQueue=new rP,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r4(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new X),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new X),this._whitespaceCell}getBlankLine(e,i){return new r8(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>0xffffffff?0xffffffff:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r6);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r4(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let r=this.getNullCell(r6),n=0,s=this._getCorrectBufferLength(i);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);let o=0;if(this._rows<i)for(let n=this._rows;n<i;n++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||void 0!==this._optionsService.rawOptions.windowsPty.backend||void 0!==this._optionsService.rawOptions.windowsPty.buildNumber?this.lines.push(new r8(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new r8(e,r)));else for(let e=this._rows;e>i;e--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let e=this.lines.length-s;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if((i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory())>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&"conpty"===e.backend&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=function(e,i,r,n,s,o){let a=[];for(let l=0;l<e.length-1;l++){let c=l,h=e.get(++c);if(!h.isWrapped)continue;let u=[e.get(l)];for(;c<e.length&&h.isWrapped;)u.push(h),h=e.get(++c);if(!o&&n>=l&&n<c){l+=u.length-1;continue}let d=0,f=r7(u,0,i),p=1,g=0;for(;p<u.length;){let e=r7(u,p,i),n=Math.min(e-g,r-f);u[d].copyCellsFrom(u[p],g,f,n,!1),(f+=n)===r&&(d++,f=0),(g+=n)===e&&(p++,g=0),0===f&&0!==d&&2===u[d-1].getWidth(r-1)&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,s))}u[d].replaceCells(f,r,s);let m=0;for(let e=u.length-1;e>0&&(e>d||0===u[e].getTrimmedLength());e--)m++;m>0&&(a.push(l+u.length-m),a.push(m)),l+=u.length-1}return a}(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r6),r);if(n.length>0){let r=function(e,i){let r=[],n=0,s=i[0],o=0;for(let a=0;a<e.length;a++)if(s===a){let r=i[++n];e.onDeleteEmitter.fire({index:a-o,amount:r}),a+=r-1,o+=r,s=i[++n]}else r.push(a);return{layout:r,countRemoved:o}}(this.lines,n);(function(e,i){let r=[];for(let n=0;n<i.length;n++)r.push(e.get(i[n]));for(let i=0;i<r.length;i++)e.set(i,r[i]);e.length=i.length})(this.lines,r.layout),this._reflowLargerAdjustViewport(e,i,r.countRemoved)}}_reflowLargerAdjustViewport(e,i,r){let n=this.getNullCell(r6),s=r;for(;s-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new r8(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(r6),s=[],o=0;for(let a=this.lines.length-1;a>=0;a--){let l=this.lines.get(a);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let c=[l];for(;l.isWrapped&&a>0;)l=this.lines.get(--a),c.unshift(l);if(!r){let e=this.ybase+this.y;if(e>=a&&e<a+c.length)continue}let h=c[c.length-1].getTrimmedLength(),u=function(e,i,r){let n=[],s=e.map((r,n)=>r7(e,n,i)).reduce((e,i)=>e+i),o=0,a=0,l=0;for(;l<s;){if(s-l<r){n.push(s-l);break}o+=r;let c=r7(e,a,i);o>c&&(o-=c,a++);let h=2===e[a].getWidth(o-1);h&&o--;let u=h?r-1:r;n.push(u),l+=u}return n}(c,this._cols,e),d=u.length-c.length,f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(r6,!0);p.push(e)}p.length>0&&(s.push({start:a+c.length+o,newLines:p}),o+=p.length),c.push(...p);let g=u.length-1,m=u[g];0===m&&(m=u[--g]);let _=c.length-d-1,v=h;for(;_>=0;){let e=Math.min(v,m);if(void 0===c[g])break;c[g].copyCellsFrom(c[_],v-e,m-e,e,!0),0==(m-=e)&&(m=u[--g]),0==(v-=e)&&(v=r7(c,Math.max(--_,0),this._cols))}for(let i=0;i<c.length;i++)u[i]<e&&c[i].setCell(u[i],n);let y=d-f;for(;y-- >0;)0===this.ybase?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+i-1)}if(s.length>0){let e=[],i=[];for(let e=0;e<this.lines.length;e++)i.push(this.lines.get(e));let r=this.lines.length,n=r-1,a=0,l=s[0];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let c=0;for(let h=Math.min(this.lines.maxLength-1,r+o-1);h>=0;h--)if(l&&l.start>n+c){for(let e=l.newLines.length-1;e>=0;e--)this.lines.set(h--,l.newLines[e]);h++,e.push({index:n+1,amount:l.newLines.length}),c+=l.newLines.length,l=s[++a]}else this.lines.set(h,i[n--]);let h=0;for(let i=e.length-1;i>=0;i--)e[i].index+=h,this.lines.onInsertEmitter.fire(e[i]),h+=e[i].amount;let u=Math.max(0,r+o-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,i,r=0,n){let s=this.lines.get(e);return s?s.translateToString(i,r,n):""}getWrappedRangeForLine(e){let i=e,r=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:i,last:r}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new ne(e);return this.markers.push(i),i.register(this.lines.onTrim(e=>{i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(e=>{i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(e=>{i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},nn=class extends eO{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new eQ),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new nr(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new nr(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ns=class extends eO{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new eQ),this.onResize=this._onResize.event,this._onScroll=this._register(new eQ),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,2),this.rows=Math.max(e.rawOptions.rows||0,1),this.buffers=this._register(new nn(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let r=this.cols!==e,n=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let r=this.buffer,n;(n=this._cachedBlankLine)&&n.length===this.cols&&n.getFg(0)===e.fg&&n.getBg(0)===e.bg||(n=r.getBlankLine(e,i),this._cachedBlankLine=n),n.isWrapped=i;let s=r.ybase+r.scrollTop,o=r.ybase+r.scrollBottom;if(0===r.scrollTop){let e=r.lines.isFull;o===r.lines.length-1?e?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(o+1,0,n.clone()),e?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let e=o-s+1;r.lines.shiftElements(s+1,e-1,-1),r.lines.set(o,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,i){let r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};ns=I([F(0,ea)],ns);var no={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:rC,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},na=["normal","bold","100","200","300","400","500","600","700","800","900"],nl=class extends eO{constructor(e){super(),this._onOptionChange=this._register(new eQ),this.onOptionChange=this._onOptionChange.event;let i={...no};for(let r in e)if(r in i)try{let n=e[r];i[r]=this._sanitizeAndValidateOption(r,n)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(eA(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(r=>{r===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(r=>{-1!==e.indexOf(r)&&i()})}_setupOptions(){let e=e=>{if(!(e in no))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in no))throw Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":var r;if(i||(i=no[e]),"block"!==(r=i)&&"underline"!==r&&"bar"!==r)throw Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=no[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=na.includes(i)?i:no[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,0xffffffff))<0)throw Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}};function nc(e,i=5){if("object"!=typeof e)return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=i<=1?e[n]:e[n]&&nc(e[n],i-1);return r}var nh=Object.freeze({insertMode:!1}),nu=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),nd=class extends eO{constructor(e,i,r){super(),this._bufferService=e,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new eQ),this.onData=this._onData.event,this._onUserInput=this._register(new eQ),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new eQ),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new eQ),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=nc(nh),this.decPrivateModes=nc(nu)}reset(){this.modes=nc(nh),this.decPrivateModes=nc(nu)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};nd=I([F(0,et),F(1,eo),F(2,ea)],nd);var nf={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function np(e,i){let r=16*!!e.ctrl|4*!!e.shift|8*!!e.alt;return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||i||(r|=3)),r}var ng=String.fromCharCode,nm={DEFAULT:e=>{let i=[np(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1b[M${ng(i[0])}${ng(i[1])}${ng(i[2])}`},SGR:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${np(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${np(e,!0)};${e.x};${e.y}${i}`}},n_=class extends eO{constructor(e,i,r){for(let n of(super(),this._bufferService=e,this._coreService=i,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new eQ),this.onProtocolChange=this._onProtocolChange.event,Object.keys(nf)))this.addProtocol(n,nf[n]);for(let e of Object.keys(nm))this.addEncoding(e,nm[e]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,r){if(0===e.deltaY||e.shiftKey||void 0===i||void 0===r)return 0;let n=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=i/r+0,50>Math.abs(e.deltaY)&&(n*=.3),this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,i,r){if(r){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return e.button===i.button&&e.action===i.action&&e.ctrl===i.ctrl&&e.alt===i.alt&&e.shift===i.shift}};n_=I([F(0,et),F(1,er),F(2,ea)],n_);var nv,ny,nb,nS,nw,nx,nC=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],nk=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],nE=class{constructor(){if(this.version="6",!nx){(nx=new Uint8Array(65536)).fill(1),nx[0]=0,nx.fill(0,1,32),nx.fill(0,127,160),nx.fill(2,4352,4448),nx[9001]=2,nx[9002]=2,nx.fill(2,11904,42192),nx[12351]=1,nx.fill(2,44032,55204),nx.fill(2,63744,64256),nx.fill(2,65040,65050),nx.fill(2,65072,65136),nx.fill(2,65280,65377),nx.fill(2,65504,65511);for(let e=0;e<nC.length;++e)nx.fill(0,nC[e][0],nC[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?nx[e]:!function(e,i){let r=0,n=i.length-1,s;if(e<i[0][0]||e>i[n][1])return!1;for(;n>=r;)if(e>i[s=r+n>>1][1])r=s+1;else{if(!(e<i[s][0]))return!0;n=s-1}return!1}(e,nk)?e>=131072&&e<=196605||e>=196608&&e<=262141?2:1:0}charProperties(e,i){let r=this.wcwidth(e),n=0===r&&0!==i;if(n){let e=nR.extractWidth(i);0===e?n=!1:e>r&&(r=e)}return nR.createPropertyValue(0,r,n)}},nR=class e{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new eQ,this.onChange=this._onChange.event;let e=new nE;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(1&e)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,r=!1){return(0xffffff&e)<<3|(3&i)<<1|!!r}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0,n=0,s=i.length;for(let o=0;o<s;++o){let a=i.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=s)return r+this.wcwidth(a);let e=i.charCodeAt(o);56320<=e&&e<=57343?a=(a-55296)*1024+e-56320+65536:r+=this.wcwidth(e)}let l=this.charProperties(a,n),c=e.extractWidth(l);e.extractShouldJoin(l)&&(c-=e.extractWidth(n)),r+=c,n=l}return r}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},nT=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function nD(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=0!==i[3]&&32!==i[3])}var nL=class e{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>256)throw Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let r=new e;if(!i.length)return r;for(let e=+!!Array.isArray(i[0]);e<i.length;++e){let n=i[e];if(Array.isArray(n))for(let e=0;e<n.length;++e)r.addSubParam(n[e]);else r.addParam(n)}return r}clone(){let i=new e(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,n))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>0x7fffffff?0x7fffffff:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>0x7fffffff?0x7fffffff:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-i>0?this._subParams.subarray(i,r):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&(e[i]=this._subParams.slice(r,n))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,n=r[i-1];r[i-1]=~n?Math.min(10*n+e,0x7fffffff):e}},nA=[],nM=class{constructor(){this._state=0,this._active=nA,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nA}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=nA,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||nA,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._id,"PUT",q(e,i,r))}start(){this.reset(),this._state=1}put(e,i,r){if(3!==this._state){if(1===this._state)for(;i<r;){let r=e[i++];if(59===r){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}-1===this._id&&(this._id=0),this._id=10*this._id+r-48}2===this._state&&r-i>0&&this._put(e,i,r)}}end(e,i=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].end(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._id,"END",e);this._active=nA,this._id=-1,this._state=0}}},nP=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=q(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data))instanceof Promise)return i.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,i}},nO=[],nB=class{constructor(){this._handlers=Object.create(null),this._active=nO,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nO}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=nO,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nO,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(i);else this._handlerFb(this._ident,"HOOK",i)}put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._ident,"PUT",q(e,i,r))}unhook(e,i=!0){if(this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].unhook(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",e);this._active=nO,this._ident=0}},nN=new nL;nN.addParam(0);var nI=class{constructor(e){this._handler=e,this._data="",this._params=nN,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():nN,this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=q(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params))instanceof Promise)return i.then(e=>(this._params=nN,this._data="",this._hitLimit=!1,e));return this._params=nN,this._data="",this._hitLimit=!1,i}},nF=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,r,n){this.table[i<<8|e]=r<<4|n}addMany(e,i,r,n){for(let s=0;s<e.length;s++)this.table[i<<8|e[s]]=r<<4|n}},nz=function(){let e=new nF(4095),i=Array.apply(null,Array(256)).map((e,i)=>i),r=(e,r)=>i.slice(e,r),n=r(32,127),s=r(0,24);s.push(25),s.push.apply(s,r(28,32));let o=r(0,14),a;for(a in e.setDefault(1,0),e.addMany(n,0,2,0),o)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}(),nH=class extends eO{constructor(e=nz){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new nL,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,r)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(eA(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new nM),this._dcsParser=this._register(new nB),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let n=e.intermediates.charCodeAt(i);if(32>n||n>47)throw Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(1!==e.final.length)throw Error("final must be a single byte");let n=e.final.charCodeAt(0);if(i[0]>n||n>i[1])throw Error(`final must be in range ${i[0]} .. ${i[1]}`);return r<<=8,r|=n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(255&e)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,r,n,s){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=s}parse(e,i,r){let n=0,s=0,o=0,a;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===r||1===this._parseStack.state)throw this._parseStack.state=1,Error("improper continuation due to previous async handler, giving up parsing");let i=this._parseStack.handlers,s=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s](this._params));s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 4:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s]());s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let r=o;r<i;++r){switch(n=e[r],(s=this._transitions.table[this.currentState<<8|(n<160?n:160)])>>4){case 2:for(let s=r+1;;++s)if(s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160){this._printHandler(e,r,s),r=s-1;break}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|n],l=o?o.length-1:-1;for(;l>=0&&!0!==(a=o[l](this._params));l--)if(a instanceof Promise)return this._preserveStack(3,o,l,s,r),a;l<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++r<i&&(n=e[r])>47&&n<60)r--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let c=this._escHandlers[this._collect<<8|n],h=c?c.length-1:-1;for(;h>=0&&!0!==(a=c[h]());h--)if(a instanceof Promise)return this._preserveStack(4,c,h,s,r),a;h<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let s=r+1;;++s)if(s>=i||24===(n=e[s])||26===n||27===n||n>127&&n<160){this._dcsParser.put(e,r,s),r=s-1;break}break;case 14:if(a=this._dcsParser.unhook(24!==n&&26!==n))return this._preserveStack(6,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let s=r+1;;s++)if(s>=i||(n=e[s])<32||n>127&&n<160){this._oscParser.put(e,r,s),r=s-1;break}break;case 6:if(a=this._oscParser.end(24!==n&&26!==n))return this._preserveStack(5,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&s}}},nj=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,nW=/^[\da-f]+$/;function n$(e){if(!e)return;let i=e.toLowerCase();if(0===i.indexOf("rgb:")){i=i.slice(4);let e=nj.exec(i);if(e){let i=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/i*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/i*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/i*255)]}}else if(0===i.indexOf("#")&&(i=i.slice(1),nW.exec(i)&&[3,6,9,12].includes(i.length))){let e=i.length/3,r=[0,0,0];for(let n=0;n<3;++n){let s=parseInt(i.slice(e*n,e*n+e),16);r[n]=1===e?s<<4:2===e?s:3===e?s>>4:s>>8}return r}}function nU(e,i){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(i){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}var nq={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function nV(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var nK=0,nY=class extends eO{constructor(e,i,r,n,s,o,a,l,c=new nH){for(let h in super(),this._bufferService=e,this._charsetService=i,this._coreService=r,this._logService=n,this._optionsService=s,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new V,this._utf8Decoder=new K,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r6.clone(),this._eraseAttrDataInternal=r6.clone(),this._onRequestBell=this._register(new eQ),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new eQ),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new eQ),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new eQ),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new eQ),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new eQ),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new eQ),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new eQ),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new eQ),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new eQ),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new eQ),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new eQ),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new eQ),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new nX(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,i)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:i.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,i,r)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:i,data:r})}),this._parser.setDcsHandlerFallback((e,i,r)=>{"HOOK"===i&&(r=r.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:i,payload:r})}),this._parser.setPrintHandler((e,i,r)=>this.print(e,i,r)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(iB.BEL,()=>this.bell()),this._parser.setExecuteHandler(iB.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(iB.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(iB.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(iB.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(iB.BS,()=>this.backspace()),this._parser.setExecuteHandler(iB.HT,()=>this.tab()),this._parser.setExecuteHandler(iB.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(iB.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(iN.IND,()=>this.index()),this._parser.setExecuteHandler(iN.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(iN.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new nP(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new nP(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new nP(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new nP(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new nP(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new nP(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new nP(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new nP(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new nP(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new nP(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new nP(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new nP(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset()),nt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new nI((e,i)=>this.requestStatusString(e,i)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let r,n=this._activeBuffer.x,s=this._activeBuffer.y,o=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>131072&&(o=this._parseStack.position+131072)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${"string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join("")}"`}`),0===this._logService.logLevel&&this._logService.trace("parsing data (codes)","string"==typeof e?e.split("").map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),a||this._dirtyRowTracker.clearRange(),e.length>131072)for(let i=o;i<e.length;i+=131072){let o=i+131072<e.length?i+131072:e.length,a="string"==typeof e?this._stringDecoder.decode(e.substring(i,o),this._parseBuffer):this._utf8Decoder.decode(e.subarray(i,o),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,a))return this._preserveStack(n,s,a,i),this._logSlowResolvingAsync(r),r}else if(!a){let i="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,i))return this._preserveStack(n,s,i,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,i,r){let n,s,o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-i>0&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=i;p<r;++p){if((n=e[p])<127&&o){let e=o[String.fromCharCode(n)];e&&(n=e.charCodeAt(0))}let i=this._unicodeService.charProperties(n,f);s=nR.extractWidth(i);let r=nR.extractShouldJoin(i),g=r?nR.extractWidth(f):0;if(f=i,a&&this._onA11yChar.fire(U(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-g>l){if(c){let e=d,i=this._activeBuffer.x-g;for(this._activeBuffer.x=g,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),g>0&&d instanceof r8&&d.copyCellsFrom(e,i,0,g,!1);i<l;)e.setCellFromCodepoint(i++,0,1,u)}else if(this._activeBuffer.x=l-1,2===s)continue}if(r&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,n,s);for(let e=s-g;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(h&&(d.insertCells(this._activeBuffer.x,s-g,this._activeBuffer.getNullCell(u)),2===d.getWidth(l-1)&&d.setCellFromCodepoint(l-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,n,s,u),s>0)for(;--s;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<l&&r-i>0&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,i):this._parser.registerCsiHandler(e,e=>!nV(e.params[0],this._optionsService.rawOptions.windowOptions)||i(e))}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new nI(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new nP(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return 0===i?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===i&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return 1===i&&(this._curAttrData.bg|=0x20000000),(2===i||0===i)&&(this._curAttrData.bg&=-0x20000001),!0}_eraseInBufferLine(e,i,r,n=!1,s=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(i,r,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(o.isWrapped=!1)}_resetBufferLine(e,i=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,i=!1){let r;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);r<this._bufferService.rows;r++)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0))}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;i--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;i--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r6));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let r=e.params[0]||1,n=nR.extractWidth(i),s=this._activeBuffer.x-n,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(o.length*r),l=0;for(let e=0;e<o.length;){let i=o.codePointAt(e)||0;a[l++]=i,e+=i>65535?2:1}let c=l;for(let e=1;e<r;++e)a.copyWithin(c,0,l),c+=l;return this.print(a,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(iB.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(iB.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(iB.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(iB.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(iB.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ni),this._charsetService.setgCharset(1,ni),this._charsetService.setgCharset(2,ni),this._charsetService.setgCharset(3,ni);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[i]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,i){let r,n,s,o;(n=r||={})[n.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",n[n.SET=1]="SET",n[n.RESET=2]="RESET",n[n.PERMANENTLY_SET=3]="PERMANENTLY_SET",n[n.PERMANENTLY_RESET=4]="PERMANENTLY_RESET";let a=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:c}=this._coreMouseService,h=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:f,alt:p}=u,g=this._optionsService.rawOptions,m=e=>e?1:2,_=e.params[0];return s=_,o=i?2===_?4:4===_?m(h.modes.insertMode):12===_?3:20===_?m(g.convertEol):0:1===_?m(a.applicationCursorKeys):3===_?g.windowOptions.setWinLines?80===d?2:+(132===d):0:6===_?m(a.origin):7===_?m(a.wraparound):8===_?3:9===_?m("X10"===l):12===_?m(g.cursorBlink):25===_?m(!h.isCursorHidden):45===_?m(a.reverseWraparound):66===_?m(a.applicationKeypad):67===_?4:1e3===_?m("VT200"===l):1002===_?m("DRAG"===l):1003===_?m("ANY"===l):1004===_?m(a.sendFocus):1005===_?4:1006===_?m("SGR"===c):1015===_?4:1016===_?m("SGR_PIXELS"===c):1048===_?1:47===_||1047===_||1049===_?m(f===p):2004===_?m(a.bracketedPasteMode):2026===_?m(a.synchronizedOutput):0,h.triggerDataEvent(`${iB.ESC}[${i?"":"?"}${s};${o}$y`),!0}_updateAttrColor(e,i,r,n,s){return 2===i?(e|=0x3000000,e&=-0x1000000,e|=Y.fromColorRGB([r,n,s])):5===i&&(e&=-0x3000100,e|=0x2000000|255&r),e}_extractColor(e,i,r){let n=[0,0,-1,0,0,0],s=0,o=0;do{if(n[o+s]=e.params[i+o],e.hasSubParams(i+o)){let r=e.getSubParams(i+o),a=0;do 5===n[1]&&(s=1),n[o+a+1+s]=r[a];while(++a<r.length&&a+o+1+s<n.length)break}if(5===n[1]&&o+s>=2||2===n[1]&&o+s>=5)break;n[1]&&(s=1)}while(++o+i<e.length&&o+s<n.length)for(let e=2;e<n.length;++e)-1===n[e]&&(n[e]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return o}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=0x10000000,0===e&&(i.fg&=-0x10000001),i.updateExtended()}_processSGR0(e){e.fg=r6.fg,e.bg=r6.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-0x4000000,e.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._processSGR0(this._curAttrData),!0;let i=e.length,r,n=this._curAttrData;for(let s=0;s<i;s++)(r=e.params[s])>=30&&r<=37?(n.fg&=-0x3000100,n.fg|=0x1000000|r-30):r>=40&&r<=47?(n.bg&=-0x3000100,n.bg|=0x1000000|r-40):r>=90&&r<=97?(n.fg&=-0x3000100,n.fg|=0x1000000|r-90|8):r>=100&&r<=107?(n.bg&=-0x3000100,n.bg|=0x1000000|r-100|8):0===r?this._processSGR0(n):1===r?n.fg|=0x8000000:3===r?n.bg|=0x4000000:4===r?(n.fg|=0x10000000,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,n)):5===r?n.fg|=0x20000000:7===r?n.fg|=0x4000000:8===r?n.fg|=0x40000000:9===r?n.fg|=0x80000000:2===r?n.bg|=0x8000000:21===r?this._processUnderline(2,n):22===r?(n.fg&=-0x8000001,n.bg&=-0x8000001):23===r?n.bg&=-0x4000001:24===r?(n.fg&=-0x10000001,this._processUnderline(0,n)):25===r?n.fg&=-0x20000001:27===r?n.fg&=-0x4000001:28===r?n.fg&=-0x40000001:29===r?n.fg&=0x7fffffff:39===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r6.fg):49===r?(n.bg&=-0x4000000,n.bg|=0xffffff&r6.bg):38===r||48===r||58===r?s+=this._extractColor(e,s,n):53===r?n.bg|=0x40000000:55===r?n.bg&=-0x40000001:59===r?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):100===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r6.fg,n.bg&=-0x4000000,n.bg|=0xffffff&r6.bg):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${iB.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iB.ESC}[${i};${r}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iB.ESC}[?${e};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r6.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let i=0===e.length?1:e.params[0];if(0===i)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar"}this._coreService.decPrivateModes.cursorBlink=i%2==1}return!0}setScrollRegion(e){let i=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||0===r)&&(r=this._bufferService.rows),r>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!nV(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==i&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${iB.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(0===i||2===i)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),(0===i||1===i)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:(0===i||2===i)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(0===i||1===i)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],r=e.split(";");for(;r.length>1;){let e=r.shift(),n=r.shift();if(/^\d+$/.exec(e)){let r=parseInt(e);if(nG(r))if("?"===n)i.push({type:0,index:r});else{let e=n$(n);e&&i.push({type:1,index:r,color:e})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(-1===i)return!0;let r=e.slice(0,i).trim(),n=e.slice(i+1);return n?this._createHyperlink(r,n):!r.trim()&&this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,s=r.findIndex(e=>e.startsWith("id="));return -1!==s&&(n=r[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let r=e.split(";");for(let e=0;e<r.length&&!(i>=this._specialColors.length);++e,++i)if("?"===r[e])this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let n=n$(r[e]);n&&this._onColor.fire([{type:1,index:this._specialColors[i],color:n}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],r=e.split(";");for(let e=0;e<r.length;++e)if(/^\d+$/.exec(r[e])){let n=parseInt(r[e]);nG(n)&&i.push({type:2,index:n})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,ni),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"===e[0]||this._charsetService.setgCharset(nq[e[0]],nt[e[1]]||ni),!0}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=r6.clone(),this._eraseAttrDataInternal=r6.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-0x4000000,this._eraseAttrDataInternal.bg|=0x3ffffff&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new G;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let r=this._activeBuffer.ybase+this._activeBuffer.y+i,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let r=e=>(this._coreService.triggerDataEvent(`${iB.ESC}${e}${iB.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return r('"q'===e?`P1$r${+!!this._curAttrData.isProtected()}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${({block:2,underline:4,bar:6})[s.cursorStyle]-!!s.cursorBlink} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},nX=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(nK=e,e=i,i=nK),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function nG(e){return 0<=e&&e<256}nX=I([F(0,et)],nX);var nJ=class extends eO{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new eQ),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){let r;if(void 0!==i&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=0x7fffffff,this._isSyncWriting=!1,this._syncCalls=0}}write(e,i){if(this._pendingData>5e7)throw Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],n=this._action(e,i);if(n){let e=e=>performance.now()-r>=12?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);n.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-r>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},nZ=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(void 0===e.id){let r=i.addMarker(i.ybase+i.y),n={data:e,id:this._nextId++,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(n,r)),this._dataByLinkId.set(n.id,n),n.id}let r=this._getEntryIdKey(e),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,i.ybase+i.y),n.id;let s=i.addMarker(i.ybase+i.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,i){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(e=>e.line!==i)){let e=this._bufferService.buffer.addMarker(i);r.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(r,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let r=e.lines.indexOf(i);-1!==r&&(e.lines.splice(r,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};nZ=I([F(0,et)],nZ);var nQ=!1,n0=class extends eO{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new eB),this._onBinary=this._register(new eQ),this.onBinary=this._onBinary.event,this._onData=this._register(new eQ),this.onData=this._onData.event,this._onLineFeed=this._register(new eQ),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new eQ),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new eQ),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new eQ),this._instantiationService=new r2,this.optionsService=this._register(new nl(e)),this._instantiationService.setService(ea,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ns)),this._instantiationService.setService(et,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(r3)),this._instantiationService.setService(eo,this._logService),this.coreService=this._register(this._instantiationService.createInstance(nd)),this._instantiationService.setService(er,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(n_)),this._instantiationService.setService(ei,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nR)),this._instantiationService.setService(ec,this.unicodeService),this._charsetService=this._instantiationService.createInstance(nT),this._instantiationService.setService(en,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(nZ),this._instantiationService.setService(el,this._oscLinkService),this._inputHandler=this._register(new nY(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(eV.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(eV.forward(this._bufferService.onResize,this._onResize)),this._register(eV.forward(this.coreService.onData,this._onData)),this._register(eV.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new nJ((e,i)=>this._inputHandler.parse(e,i))),this._register(eV.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new eQ),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!nQ&&(this._logService.warn("writeSync is unreliable and will be removed soon."),nQ=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,2),i=Math.max(i,1),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&void 0!==i.buildNumber&&void 0!==i.buildNumber?e="conpty"===i.backend&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(nD.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(nD(this._bufferService),!1))),this._windowsWrappingHeuristics.value=eA(()=>{for(let i of e)i.dispose()})}}},n1={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']},n2=0,n5=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new rP,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new rP,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),0===this._insertedValues.length&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,i)=>this._getKey(e)-this._getKey(i)),i=0,r=0,n=Array(this._array.length+this._insertedValues.length);for(let s=0;s<n.length;s++)r>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[r])?(n[s]=e[i],i++):n[s]=this._array[r++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),0===this._array.length)return!1;let i=this._getKey(e);if(void 0===i||-1===(n2=this._search(i))||this._getKey(this._array[n2])!==i)return!1;do if(this._array[n2]===e)return 0===this._deletedIndices.length&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(n2),!0;while(++n2<this._array.length&&this._getKey(this._array[n2])===i)return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,i)=>e-i),i=0,r=Array(this._array.length-e.length),n=0;for(let s=0;s<this._array.length;s++)e[i]===s?i++:r[n++]=this._array[s];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((n2=this._search(e))<0||n2>=this._array.length)&&this._getKey(this._array[n2])===e)do yield this._array[n2];while(++n2<this._array.length&&this._getKey(this._array[n2])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((n2=this._search(e))<0||n2>=this._array.length)&&this._getKey(this._array[n2])===e)do i(this._array[n2]);while(++n2<this._array.length&&this._getKey(this._array[n2])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,r=this._array.length-1;for(;r>=i;){let n=i+r>>1,s=this._getKey(this._array[n]);if(s>e)r=n-1;else if(s<e)i=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return i}},n3=0,n4=0,n6=class extends eO{constructor(){super(),this._decorations=new n5(e=>e?.marker.line),this._onDecorationRegistered=this._register(new eQ),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new eQ),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(eA(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new n9(e);if(i){let e=i.marker.onDispose(()=>i.dispose()),r=i.onDispose(()=>{r.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),e.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,r){let n=0,s=0;for(let o of this._decorations.getKeyIterator(i))s=(n=o.options.x??0)+(o.options.width??1),e>=n&&e<s&&(!r||(o.options.layer??"bottom")===r)&&(yield o)}forEachDecorationAtCell(e,i,r,n){this._decorations.forEachByKey(i,i=>{n4=(n3=i.options.x??0)+(i.options.width??1),e>=n3&&e<n4&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},n9=class extends eP{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new eQ),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new eQ),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=nb.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=nb.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},n8=class{constructor(e,i=1e3){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,r){this._rowCount=r,e=void 0!==e?e:0,i=void 0!==i?i:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,i):i;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=n-this._lastRefreshMs,i=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},i)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},n7=class extends eO{constructor(e,i,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new n8(this._renderRows.bind(this))),!this._terminal.element)throw Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
29
29
  `))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(t5(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(eA(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
30
30
  `&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=H)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let r=this._terminal.buffer,n=r.lines.length.toString();for(let s=e;s<=i;s++){let e=r.lines.get(r.ydisp+s),i=[],o=e?.translateToString(!0,void 0,void 0,i)||"",a=(r.ydisp+s+1).toString(),l=this._rowElements[s];l&&(0===o.length?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=o,this._rowColumns.set(l,i)),l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",n),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let r,n,s=e.target,o=this._rowElements[0===i?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===i?"1":`${this._terminal.buffer.lines.length}`)&&e.relatedTarget===o){if(0===i?(r=s,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=s,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===i){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===i?-1:1),this._rowElements[0===i?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}}_handleSelectionChange(){if(0===this._rowElements.length)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===r.node&&i.offset>r.offset)&&([i,r]=[r,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let s=({node:e,offset:i})=>{let r=e instanceof Text?e.parentNode:e,n=parseInt(r?.getAttribute("aria-posinset"),10)-1;if(isNaN(n))return console.warn("row is invalid. Race condition?"),null;let s=this._rowColumns.get(r);if(!s)return console.warn("columns is null. Race condition?"),null;let o=i<s.length?s[i]:s.slice(-1)[0]+1;return o>=this._terminal.cols&&(++n,o=0),{row:n,column:o}},o=s(i),a=s(r);if(!(!o||!a)){if(o.row>a.row||o.row===a.row&&o.column>=a.column)throw Error("invalid range");this._terminal.select(o.column,o.row,(a.row-o.row)*this._terminal.cols-o.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let i=e.getBoundingClientRect().width,r=this._rowColumns.get(e)?.slice(-1)?.[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/i})`}};n7=I([F(1,es),F(2,ef),F(3,eg)],n7);var se=class extends eO{constructor(e,i,r,n,s){super(),this._element=e,this._mouseService=i,this._renderService=r,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new eQ),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new eQ),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(eA(()=>{eL(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(t5(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(t5(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(t5(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(t5(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let r=e.composedPath();for(let e=0;e<r.length;e++){let i=r[e];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,s]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):s.provideLinks(e.y,i=>{if(this._isMouseOut)return;let s=i?.map(e=>({link:e}));this._activeProviderReplies?.set(n,s),r=this._checkLinkProviderResult(n,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let r=new Set;for(let n=0;n<i.size;n++){let s=i.get(n);if(s)for(let i=0;i<s.length;i++){let n=s[i],o=n.link.range.start.y<e?0:n.link.range.start.x,a=n.link.range.end.y>e?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(i--,1);break}r.add(e)}}}}_checkLinkProviderResult(e,i,r){if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),s=!1;for(let i=0;i<e;i++)(!this._activeProviderReplies.has(i)||this._activeProviderReplies.get(i))&&(s=!0);if(!s&&n){let e=n.find(e=>this._linkAtPosition(e.link,i));e&&(r=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let e=0;e<this._activeProviderReplies.size;e++){let n=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,i));if(n){r=!0,this._handleNewLink(n);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var i,r;if(!this._currentLink)return;let n=this._positionFromMouseEvent(e,this._element,this._mouseService);n&&this._mouseDownLink&&(i=this._mouseDownLink.link,r=this._currentLink.link,i.text===r.text&&i.range.start.x===r.range.start.x&&i.range.start.y===r.range.start.y&&i.range.end.x===r.range.end.x&&i.range.end.y===r.range.end.y)&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){this._currentLink&&this._lastMouseEvent&&(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,eL(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let i=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(i,r),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(r,i.text)}_fireUnderlineEvent(e,i){let r=e.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(r,i.text)}_linkAtPosition(e,i){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,s=i.y*this._bufferService.cols+i.x;return r<=s&&s<=n}_positionFromMouseEvent(e,i,r){let n=r.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,r,n,s){return{x1:e,y1:i,x2:r,y2:n,cols:this._bufferService.cols,fg:s}}};se=I([F(1,ep),F(2,eg),F(3,et),F(4,ey)],se);var st=class extends n0{constructor(e={}){super(e),this._linkifier=this._register(new eB),this.browser=rp,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new eB),this._onCursorMove=this._register(new eQ),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new eQ),this.onKey=this._onKey.event,this._onRender=this._register(new eQ),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new eQ),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new eQ),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new eQ),this.onBell=this._onBell.event,this._onFocus=this._register(new eQ),this._onBlur=this._register(new eQ),this._onA11yCharEmitter=this._register(new eQ),this._onA11yTabEmitter=this._register(new eQ),this._onWillOpen=this._register(new eQ),this._setup(),this._decorationService=this._instantiationService.createInstance(n6),this._instantiationService.setService(eh,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(rh),this._instantiationService.setService(ey,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(eu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(eV.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(eV.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(eV.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(eV.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(eA(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let e,r="";switch(i.index){case 256:e="foreground",r="10";break;case 257:e="background",r="11";break;case 258:e="cursor",r="12";break;default:e="ansi",r="4;"+i.index}switch(i.type){case 0:let n=ny.toColorRGB("ansi"===e?this._themeService.colors.ansi[i.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${iB.ESC}]${r};${function(e,i=16){let[r,n,s]=e;return`rgb:${nU(r,i)}/${nU(n,i)}/${nU(s,i)}`}(n)}${iI.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors(e=>e.ansi[i.index]=iF.toColor(...i.color));else{let r=e;this._themeService.modifyColors(e=>e[r]=iF.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(n7,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iB.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iB.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,s=i.getWidth(r),o=this._renderService.dimensions.css.cell.width*s,a=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=a+"px",this.textarea.style.width=o+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(t5(this.element,"copy",e=>{var i;this.hasSelection()&&(i=this._selectionService,e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault())}));let e=e=>{var i,r,n;return i=this.textarea,r=this.coreService,n=this.optionsService,void(e.stopPropagation(),e.clipboardData&&j(e.clipboardData.getData("text/plain"),i,r,n))};this._register(t5(this.textarea,"paste",e)),this._register(t5(this.element,"paste",e)),rb?this._register(t5(this.element,"mousedown",e=>{2===e.button&&$(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(t5(this.element,"contextmenu",e=>{$(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),rT&&this._register(t5(this.element,"auxclick",e=>{1===e.button&&W(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(t5(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(t5(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(t5(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(t5(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(t5(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(t5(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(t5(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(t5(this.screenElement,"mousemove",e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",z),rD||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(rl,this.textarea,e.ownerDocument.defaultView??window,this._document??"u">typeof window?window.document:null)),this._instantiationService.setService(ef,this._coreBrowserService),this._register(t5(this.textarea,"focus",e=>this._handleTextAreaFocus(e))),this._register(t5(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(rn,this._document,this._helperContainer),this._instantiationService.setService(ed,this._charSizeService),this._themeService=this._instantiationService.createInstance(rQ),this._instantiationService.setService(ev,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(i0),this._instantiationService.setService(e_,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(rB,this.rows,this.screenElement)),this._instantiationService.setService(eg,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(iD,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(rd),this._instantiationService.setService(ep,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(se,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(iw,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(rq,this.element,this.screenElement,n)),this._instantiationService.setService(em,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(eV.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(ix,this.screenElement)),this._register(t5(this.element,"mousedown",e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(n7,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(iT,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(iT,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(rr,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function r(i){let r,n,s=e._mouseService.getMouseReportCoords(i,e.screenElement);if(!s)return!1;switch(i.overrideType||i.type){case"mousemove":n=32,void 0===i.buttons?(r=3,void 0!==i.button&&(r=i.button<3?i.button:3)):r=1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":n=0,r=i.button<3?i.button:3;break;case"mousedown":n=1,r=i.button<3?i.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(i))return!1;let o=i.deltaY;if(0===o||0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return!1;n=o<0?0:1,r=4;break;default:return!1}return void 0!==n&&void 0!==r&&!(r>4)&&e.coreMouseService.triggerMouseEvent({col:s.col,row:s.row,x:s.x,y:s.y,button:r,action:n,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s=e=>(r(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),o=e=>(r(e),this.cancel(e,!0)),a=e=>{e.buttons&&r(e)},l=e=>{e.buttons||r(e)};this._register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(i.addEventListener("mousemove",l),n.mousemove=l):(i.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(i.addEventListener("wheel",o,{passive:!1}),n.wheel=o):(i.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=s):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=a):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(t5(i,"mousedown",e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return r(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this._register(t5(i,"wheel",i=>{if(!n.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(i))return!1;if(!this.buffer.hasScrollback){if(0===i.deltaY)return!1;if(0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return this.cancel(i,!0);let r=iB.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(i.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(r,!0),this.cancel(i,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}paste(e){j(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,i,r){this._selectionService.setSelection(e,i,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;i||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);let r=function(e,i,r,n){let s={type:0,cancel:!1,key:void 0},o=!!e.shiftKey|2*!!e.altKey|4*!!e.ctrlKey|8*!!e.metaKey;switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?i?s.key=iB.ESC+"OA":s.key=iB.ESC+"[A":"UIKeyInputLeftArrow"===e.key?i?s.key=iB.ESC+"OD":s.key=iB.ESC+"[D":"UIKeyInputRightArrow"===e.key?i?s.key=iB.ESC+"OC":s.key=iB.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(i?s.key=iB.ESC+"OB":s.key=iB.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":iB.DEL,e.altKey&&(s.key=iB.ESC+s.key);break;case 9:if(e.shiftKey){s.key=iB.ESC+"[Z";break}s.key=iB.HT,s.cancel=!0;break;case 13:s.key=e.altKey?iB.ESC+iB.CR:iB.CR,s.cancel=!0;break;case 27:s.key=iB.ESC,e.altKey&&(s.key=iB.ESC+iB.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;o?s.key=iB.ESC+"[1;"+(o+1)+"D":i?s.key=iB.ESC+"OD":s.key=iB.ESC+"[D";break;case 39:if(e.metaKey)break;o?s.key=iB.ESC+"[1;"+(o+1)+"C":i?s.key=iB.ESC+"OC":s.key=iB.ESC+"[C";break;case 38:if(e.metaKey)break;o?s.key=iB.ESC+"[1;"+(o+1)+"A":i?s.key=iB.ESC+"OA":s.key=iB.ESC+"[A";break;case 40:if(e.metaKey)break;o?s.key=iB.ESC+"[1;"+(o+1)+"B":i?s.key=iB.ESC+"OB":s.key=iB.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=iB.ESC+"[2~");break;case 46:o?s.key=iB.ESC+"[3;"+(o+1)+"~":s.key=iB.ESC+"[3~";break;case 36:o?s.key=iB.ESC+"[1;"+(o+1)+"H":i?s.key=iB.ESC+"OH":s.key=iB.ESC+"[H";break;case 35:o?s.key=iB.ESC+"[1;"+(o+1)+"F":i?s.key=iB.ESC+"OF":s.key=iB.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=iB.ESC+"[5;"+(o+1)+"~":s.key=iB.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=iB.ESC+"[6;"+(o+1)+"~":s.key=iB.ESC+"[6~";break;case 112:o?s.key=iB.ESC+"[1;"+(o+1)+"P":s.key=iB.ESC+"OP";break;case 113:o?s.key=iB.ESC+"[1;"+(o+1)+"Q":s.key=iB.ESC+"OQ";break;case 114:o?s.key=iB.ESC+"[1;"+(o+1)+"R":s.key=iB.ESC+"OR";break;case 115:o?s.key=iB.ESC+"[1;"+(o+1)+"S":s.key=iB.ESC+"OS";break;case 116:o?s.key=iB.ESC+"[15;"+(o+1)+"~":s.key=iB.ESC+"[15~";break;case 117:o?s.key=iB.ESC+"[17;"+(o+1)+"~":s.key=iB.ESC+"[17~";break;case 118:o?s.key=iB.ESC+"[18;"+(o+1)+"~":s.key=iB.ESC+"[18~";break;case 119:o?s.key=iB.ESC+"[19;"+(o+1)+"~":s.key=iB.ESC+"[19~";break;case 120:o?s.key=iB.ESC+"[20;"+(o+1)+"~":s.key=iB.ESC+"[20~";break;case 121:o?s.key=iB.ESC+"[21;"+(o+1)+"~":s.key=iB.ESC+"[21~";break;case 122:o?s.key=iB.ESC+"[23;"+(o+1)+"~":s.key=iB.ESC+"[23~";break;case 123:o?s.key=iB.ESC+"[24;"+(o+1)+"~":s.key=iB.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if((!r||n)&&e.altKey&&!e.metaKey){let i=n1[e.keyCode]?.[+!!e.shiftKey];if(i)s.key=iB.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){let i=String.fromCharCode(e.ctrlKey?e.keyCode-64:e.keyCode+32);e.shiftKey&&(i=i.toUpperCase()),s.key=iB.ESC+i}else if(32===e.keyCode)s.key=iB.ESC+(e.ctrlKey?iB.NUL:" ");else if("Dead"===e.key&&e.code.startsWith("Key")){let i=e.code.slice(3,4);e.shiftKey||(i=i.toLowerCase()),s.key=iB.ESC+i,s.cancel=!0}}else!r||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?!e.key||e.ctrlKey||e.altKey||e.metaKey||!(e.keyCode>=48)||1!==e.key.length?e.key&&e.ctrlKey&&("_"===e.key&&(s.key=iB.US),"@"===e.key&&(s.key=iB.NUL)):s.key=e.key:65===e.keyCode&&(s.type=1);else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=iB.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=iB.DEL:219===e.keyCode?s.key=iB.ESC:220===e.keyCode?s.key=iB.FS:221===e.keyCode&&(s.key=iB.GS)}return s}(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===r.type||2===r.type){let i=this.rows-1;return this.scrollLines(2===r.type?-i:i),this.cancel(e,!0)}return 1===r.type&&this.selectAll(),!!(this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&90>=e.key.charCodeAt(0))||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):((r.key===iB.ETX||r.key===iB.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)?this.cancel(e,!0):void(this._keyDownHandled=!0))}_isThirdLevelShift(e,i){let r=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return"keypress"===i.type?r:r&&(!i.keyCode||i.keyCode>47)}_keyUp(e){var i;this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16===(i=e).keyCode||17===i.keyCode||18===i.keyCode||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(null===e.which||void 0===e.which)i=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;i=e.which}return!!i&&(!e.altKey&&!e.ctrlKey&&!e.metaKey||!!this._isThirdLevelShift(this.browser,e))&&(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(r6));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(iB.ESC+"[I"):this.coreService.triggerDataEvent(iB.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${iB.ESC}[4;${r};${i}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${iB.ESC}[6;${s};${n}t`)}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}},si=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let r={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(r),i.dispose=()=>this._wrappedAddonDispose(r),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){i=r;break}if(-1===i)throw Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},sr=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new G)}translateToString(e,i,r){return this._line.translateToString(e,i,r)}},sn=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let i=this._buffer.lines.get(e);if(i)return new sr(i)}getNullCell(){return new G}},ss=class extends eO{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new eQ),this.onBufferChange=this._onBufferChange.event,this._normal=new sn(this._core.buffers.normal,"normal"),this._alternate=new sn(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},so=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,e=>i(e.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,r)=>i(e,r.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},sa=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},sl=["cols","rows"],sc=0,sh=class extends eO{constructor(e){super(),this._core=this._register(new st(e)),this._addonManager=this._register(new si),this._publicOptions={...this._core.options};let i=e=>this._core.options[e],r=(e,i)=>{this._checkReadonlyOptions(e),this._core.options[e]=i};for(let e in this._core.options){let n={get:i.bind(this,e),set:r.bind(this,e)};Object.defineProperty(this._publicOptions,e,n)}}_checkReadonlyOptions(e){if(sl.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new so(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new sa(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new ss(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,r){this._verifyIntegers(e,i,r),this._core.select(e,i,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
31
- `,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return z},set promptLabel(t){z=t},get tooMuchOutput(){return H},set tooMuchOutput(t){H=t}}}_verifyIntegers(...e){for(sc of e)if(sc===1/0||isNaN(sc)||sc%1!=0)throw Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(sc of e)if(sc&&(sc===1/0||isNaN(sc)||sc%1!=0||sc<0))throw Error("This API only accepts positive integers")}};e.s(["Terminal",0,sh],99894);var su=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let i=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},l=a.top+a.bottom;return{cols:Math.max(2,Math.floor((s-(a.right+a.left)-i)/e.css.cell.width)),rows:Math.max(1,Math.floor((n-l)/e.css.cell.height))}}};e.s(["FitAddon",0,su],93309);let sd=Object.create(null);sd.open="0",sd.close="1",sd.ping="2",sd.pong="3",sd.message="4",sd.upgrade="5",sd.noop="6";let sf=Object.create(null);Object.keys(sd).forEach(e=>{sf[sd[e]]=e});let sp={type:"error",data:"parser error"},sg="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),sm="function"==typeof ArrayBuffer,s_=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,sv=({type:e,data:i},r,n)=>{if(sg&&i instanceof Blob)if(r)return n(i);else return sy(i,n);if(sm&&(i instanceof ArrayBuffer||s_(i)))if(r)return n(i);else return sy(new Blob([i]),n);return n(sd[e]+(i||""))},sy=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function sb(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let sS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sw="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<sS.length;e++)sw[sS.charCodeAt(e)]=e;let sx="function"==typeof ArrayBuffer,sC=(e,i)=>{if("string"!=typeof e)return{type:"message",data:sE(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:sk(e.substring(1),i)}:sf[r]?e.length>1?{type:sf[r],data:e.substring(1)}:{type:sf[r]}:sp},sk=(e,i)=>sx?sE((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=sw[e.charCodeAt(n)],a=sw[e.charCodeAt(n+1)],l=sw[e.charCodeAt(n+2)],c=sw[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},sE=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function sR(e){return e.reduce((e,i)=>e+i.length,0)}function sT(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function sD(e){if(e){var i=e;for(var r in sD.prototype)i[r]=sD.prototype[r];return i}}sD.prototype.on=sD.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},sD.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},sD.prototype.off=sD.prototype.removeListener=sD.prototype.removeAllListeners=sD.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},sD.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},sD.prototype.emitReserved=sD.prototype.emit,sD.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},sD.prototype.hasListeners=function(e){return!!this.listeners(e).length};let sL="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),sA="u">typeof self?self:"u">typeof window?window:Function("return this")();function sM(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let sP=sA.setTimeout,sO=sA.clearTimeout;function sB(e,i){i.useNativeTimers?(e.setTimeoutFn=sP.bind(sA),e.clearTimeoutFn=sO.bind(sA)):(e.setTimeoutFn=sA.setTimeout.bind(sA),e.clearTimeoutFn=sA.clearTimeout.bind(sA))}function sN(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class sI extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class sF extends sD{constructor(e){super(),this.writable=!1,sB(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new sI(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=sC(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class sz extends sF{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=sC(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{sv(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=sN()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let sH=!1;try{sH="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let sj=sH;function sW(){}class s$ extends sz{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class sU extends sD{constructor(e,i,r){super(),this.createRequest=e,sB(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=sM(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=sU.requestsCount++,sU.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=sW,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete sU.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function sq(){for(let e in sU.requests)sU.requests.hasOwnProperty(e)&&sU.requests[e].abort()}sU.requestsCount=0,sU.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",sq):"function"==typeof addEventListener&&addEventListener("onpagehide"in sA?"pagehide":"unload",sq,!1));let sV=(m=sK({xdomain:!1}))&&null!==m.responseType;function sK(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||sj))return new XMLHttpRequest}catch(e){}if(!i)try{return new sA[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let sY="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class sX extends sF{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=sY?{}:sM(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;sv(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&sL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=sN()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let sG=sA.WebSocket||sA.MozWebSocket,sJ={websocket:class extends sX{createSocket(e,i,r){return sY?new sG(e,i,r):i?new sG(e,i):new sG(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends sF{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,a,l,c,h=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],a=0,l=-1,c=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===a){if(1>sR(o))break;let e=sT(o,1);c=(128&e[0])==128,a=(l=127&e[0])<126?3:126===l?1:2}else if(1===a){if(2>sR(o))break;let e=sT(o,2);l=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),a=3}else if(2===a){if(8>sR(o))break;let e=sT(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(sp);break}l=0x100000000*n+r.getUint32(4),a=3}else{if(sR(o)<l)break;let e=sT(o,l);i.enqueue(sC(c?e:r.decode(e),s)),a=0}if(0===l||l>n){i.enqueue(sp);break}}}})),u=e.readable.pipeThrough(h).getReader(),d=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},sg&&e.data instanceof Blob?e.data.arrayBuffer().then(sb).then(n):sm&&(e.data instanceof ArrayBuffer||s_(e.data))?n(sb(e.data)):sv(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});d.readable.pipeTo(e.writable),this._writer=d.writable.getWriter();let f=()=>{u.read().then(({done:e,value:i})=>{e||(this.onPacket(i),f())}).catch(e=>{})};f();let p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this._writer.write(p).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&sL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends s${constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=sV&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new sU(sK,this.uri(),e)}}},sZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sQ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function s0(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=sZ.exec(e||""),h={},u=14;for(;u--;)h[sQ[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let s1="function"==typeof addEventListener&&"function"==typeof removeEventListener,s2=[];s1&&addEventListener("offline",()=>{s2.forEach(e=>e())},!1);class s5 extends sD{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=s0(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=s0(i.host).host);sB(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),s1&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},s2.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&s5.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s5.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,sL(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(s5.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),s1&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=s2.indexOf(this._offlineEventListener);-1!==e&&s2.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}s5.protocol=4;class s3 extends s5{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;s5.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;s5.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class s4 extends s3{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>sJ[e]).filter(e=>!!e)),super(e,r)}}s4.protocol;let s6="function"==typeof ArrayBuffer,s9=Object.prototype.toString,s8="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===s9.call(Blob),s7="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===s9.call(File);function oe(e){return s6&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||s8&&e instanceof Blob||s7&&e instanceof File}let ot=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(_=v||(v={}))[_.CONNECT=0]="CONNECT",_[_.DISCONNECT=1]="DISCONNECT",_[_.EVENT=2]="EVENT",_[_.ACK=3]="ACK",_[_.CONNECT_ERROR=4]="CONNECT_ERROR",_[_.BINARY_EVENT=5]="BINARY_EVENT",_[_.BINARY_ACK=6]="BINARY_ACK";class oi extends sD{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===v.BINARY_EVENT;r||i.type===v.BINARY_ACK?(i.type=r?v.EVENT:v.ACK,this.reconstructor=new or(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(oe(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===v[r.type])throw Error("unknown packet type "+r.type);if(r.type===v.BINARY_EVENT||r.type===v.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!on(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(oi.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case v.CONNECT:return os(i);case v.DISCONNECT:return void 0===i;case v.CONNECT_ERROR:return"string"==typeof i||os(i);case v.EVENT:case v.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===ot.indexOf(i[0]));case v.ACK:case v.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class or{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let on=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function os(e){return"[object Object]"===Object.prototype.toString.call(e)}function oo(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,oi,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===v.EVENT||e.type===v.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(oe(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===v.EVENT?v.BINARY_EVENT:v.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===v.BINARY_EVENT||e.type===v.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(oe(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,v,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||on(i))&&function(e,i){switch(e){case v.CONNECT:return void 0===i||os(i);case v.DISCONNECT:return void 0===i;case v.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===ot.indexOf(i[0]));case v.ACK:return Array.isArray(i);case v.CONNECT_ERROR:return"string"==typeof i||os(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let oa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ol extends sD{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[oo(e,"open",this.onopen.bind(this)),oo(e,"packet",this.onpacket.bind(this)),oo(e,"error",this.onerror.bind(this)),oo(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(oa.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:v.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:v.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case v.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case v.EVENT:case v.BINARY_EVENT:this.onevent(e);break;case v.ACK:case v.BINARY_ACK:this.onack(e);break;case v.DISCONNECT:this.ondisconnect();break;case v.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:v.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:v.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var oc=e.i(51890);function oh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}oh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},oh.prototype.reset=function(){this.attempts=0},oh.prototype.setMin=function(e){this.ms=e},oh.prototype.setMax=function(e){this.max=e},oh.prototype.setJitter=function(e){this.jitter=e};class ou extends sD{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,sB(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new oh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||oc;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new s4(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=oo(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=oo(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(oo(e,"ping",this.onping.bind(this)),oo(e,"data",this.ondata.bind(this)),oo(e,"error",this.onerror.bind(this)),oo(e,"close",this.onclose.bind(this)),oo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){sL(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new ol(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let od={};function of(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=s0(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=od[o]&&a in od[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new ou(s,i):(od[o]||(od[o]=new ou(s,i)),r=od[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(of,{Manager:ou,Socket:ol,io:of,connect:of}),e.s(["io",0,of],96085);var op=e.i(75254);let og=(0,op.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,og],31343);let om=(0,op.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["SquarePen",0,om],10031)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary transition-all",e),...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},67211,e=>{"use strict";var i=e.i(18050),r=e.i(71645),n=e.i(99894),s=e.i(93309),o=e.i(96085),a=e.i(627),l=e.i(31278),c=e.i(74886),h=e.i(31343),u=e.i(43531),d=e.i(10031),f=e.i(12382),p=e.i(85902),g=e.i(77814);let m="http://localhost:2792",_=(0,r.forwardRef)(function({tabId:e,cwd:_,env:v,worktreePath:y,command:b,className:S="",initialTodos:w,isActive:x,onTodosUpdated:C,onStatusChange:k},E){let R=(0,r.useRef)(null),T=(0,r.useRef)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(e),[M,P]=(0,r.useState)(!1),O=(0,r.useRef)(!1),B=(0,r.useRef)(x),N=(0,r.useRef)(!1),I=(0,r.useRef)(!1),[F,z]=(0,r.useState)("idle"),[H,j]=(0,r.useState)("idle"),[W,$]=(0,r.useState)(w??[]),[U,q]=(0,r.useState)(!1),{effectiveTheme:V}=(0,a.useTheme)(),K=(0,r.useRef)(k);K.current=k;let Y="dark"===V,X=Y?{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",selectionBackground:"#add6ff"};function G(){let e=L.current,i=T.current,r=A.current;e&&e.connected&&i&&r&&e.emit("resize",{sessionId:r,cols:i.cols,rows:i.rows})}function J(e){e.write("\x1b[2J\x1b[3J\x1b[H")}async function Z(i,r,n){z("connecting");try{var s,a,l,c;let h,u,d=await fetch(`${m}/api/terminal/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:_,env:v,worktreePath:y,sessionId:i,command:b}),signal:n});if(!d.ok){let e=await d.text().catch(()=>"");throw Error(`Failed to create session: ${d.status} ${e}`)}let f=await d.json();if(n.aborted)return;A.current=f.sessionId,f.reused||J(r),s=f.sessionId,a=f.reused,l=r,c=n,L.current=h=(0,o.io)(m,{transports:["websocket"]}),u=!1,h.on("connect",()=>{let e=N.current;N.current=!0,e?l.writeln("\x1b[90mReconnected.\x1b[0m"):a?(I.current=!0,J(l)):l.writeln("\x1b[90mConnected.\x1b[0m"),z("connected"),h.emit("join",{room:`tab:${s}`}),e&&B.current&&l.focus()}),h.on("output",({data:e})=>{a&&!u?(u=!0,l.write(e,()=>{I.current=!1,D.current?.fit(),G()})):l.write(e)}),h.on("exit",({exitCode:e})=>{console.log("[TerminalView] PTY exited with code:",e),z("exited"),A.current=null,L.current=null}),h.on("error",({message:e})=>{console.error("[TerminalView] Socket error message:",e),z("error")}),h.on("disconnect",()=>{c.aborted||z(e=>"exited"===e||"paused"===e||"idle"===e?e:"exited")}),h.on("status-changed",({status:e})=>{j(e)}),h.on("todos-updated",({todos:i})=>{$(i),C?.(e,i)}),h.on("editor:open",({sessionId:e,content:i})=>{window.dispatchEvent(new CustomEvent("editor-session-open-request",{detail:{sessionId:e,content:i}}))}),l.onData(e=>{h.connected&&A.current&&h.emit("input",{sessionId:A.current,data:e})})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("[TerminalView] connectSession error:",e instanceof Error?e.message:String(e)),z("error")}}async function Q(){let i=T.current;if(!i)return;let r=new AbortController;await Z(e,i,r.signal)}(0,r.useEffect)(()=>{K.current?.(e,F,H)},[e,F,H]),(0,r.useLayoutEffect)(()=>{B.current=x}),(0,r.useEffect)(()=>{x&&T.current?.focus()},[x]),(0,r.useEffect)(()=>{if(M)T.current?.blur();else if(x){let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}},[M,x]),(0,r.useEffect)(()=>{"connected"===F&&D.current&&(D.current.fit(),I.current||G())},[F]),(0,r.useEffect)(()=>{if(!R.current)return;let i=new n.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Cascadia Code", "Fira Code", "Menlo", monospace',theme:X,allowProposedApi:!0}),r=new s.FitAddon;i.loadAddon(r),i.open(R.current),r.fit(),T.current=i,D.current=r,B.current&&i.focus(),i.attachCustomKeyEventHandler(()=>!O.current);let o=new ResizeObserver(()=>{r.fit(),I.current||G()});o.observe(R.current);let a=new AbortController;return Z(e,i,a.signal),()=>{a.abort(),o.disconnect(),i.dispose(),T.current=null,D.current=null,L.current?.disconnect(),L.current=null}},[]),(0,r.useEffect)(()=>{T.current&&(T.current.options.theme=X)},[Y]),(0,r.useEffect)(()=>{function e(){O.current=!0,T.current?.blur()}function i(){if(O.current=!1,setTimeout(()=>{let e=L.current,i=A.current,r=T.current;e?.connected&&i&&r&&(e.emit("resize",{sessionId:i,cols:r.cols,rows:r.rows+1}),setTimeout(()=>{let e=T.current,r=L.current;r?.connected&&i&&e&&r.emit("resize",{sessionId:i,cols:e.cols,rows:e.rows})},30))},200),!B.current)return;let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}return window.addEventListener("editor-session-open",e),window.addEventListener("editor-session-done",i),()=>{window.removeEventListener("editor-session-open",e),window.removeEventListener("editor-session-done",i)}},[]),(0,r.useEffect)(()=>{function e(){if("visible"!==document.visibilityState)return;let e=L.current;if(!e||!e.connected)return;let i=setTimeout(()=>{e.off("health-check-ack",r),e.disconnect()},3e3);function r(){clearTimeout(i),B.current&&T.current?.focus()}e.once("health-check-ack",r),e.emit("health-check")}return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,r.useImperativeHandle)(E,()=>({sendInput:e=>{let i=L.current,r=A.current;i?.connected&&r&&i.emit("input",{sessionId:r,data:e})},focus:()=>{T.current?.focus()}}));let ee=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{q(!0),setTimeout(()=>q(!1),2e3)})},[e]),et="connecting"===F,ei="paused"===F||"exited"===F||"error"===F,er="connected"===F,en=W.filter(e=>"completed"===e.status).length,es=W.length,eo=e.length>8?`${e.slice(0,8)}…`:e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`flex flex-col h-full min-h-0 ${S}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border flex-shrink-0 bg-card",children:[(0,i.jsx)("span",{className:"font-mono text-xs text-muted-foreground",title:e,children:eo}),(0,i.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground hover:text-foreground",title:"Copy tab ID",children:U?(0,i.jsx)(u.Check,{className:"w-3 h-3 text-success"}):(0,i.jsx)(c.Copy,{className:"w-3 h-3"})}),(0,i.jsxs)(p.Button,{size:"xs",onClick:function(){let e=L.current,i=A.current;if(!e||!e.connected||!i)return;let r=`claude --dangerously-skip-permissions --resume ${i} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${i}
31
+ `,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return z},set promptLabel(t){z=t},get tooMuchOutput(){return H},set tooMuchOutput(t){H=t}}}_verifyIntegers(...e){for(sc of e)if(sc===1/0||isNaN(sc)||sc%1!=0)throw Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(sc of e)if(sc&&(sc===1/0||isNaN(sc)||sc%1!=0||sc<0))throw Error("This API only accepts positive integers")}};e.s(["Terminal",0,sh],99894);var su=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let i=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},l=a.top+a.bottom;return{cols:Math.max(2,Math.floor((s-(a.right+a.left)-i)/e.css.cell.width)),rows:Math.max(1,Math.floor((n-l)/e.css.cell.height))}}};e.s(["FitAddon",0,su],93309);let sd=Object.create(null);sd.open="0",sd.close="1",sd.ping="2",sd.pong="3",sd.message="4",sd.upgrade="5",sd.noop="6";let sf=Object.create(null);Object.keys(sd).forEach(e=>{sf[sd[e]]=e});let sp={type:"error",data:"parser error"},sg="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),sm="function"==typeof ArrayBuffer,s_=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,sv=({type:e,data:i},r,n)=>{if(sg&&i instanceof Blob)if(r)return n(i);else return sy(i,n);if(sm&&(i instanceof ArrayBuffer||s_(i)))if(r)return n(i);else return sy(new Blob([i]),n);return n(sd[e]+(i||""))},sy=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function sb(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let sS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sw="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<sS.length;e++)sw[sS.charCodeAt(e)]=e;let sx="function"==typeof ArrayBuffer,sC=(e,i)=>{if("string"!=typeof e)return{type:"message",data:sE(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:sk(e.substring(1),i)}:sf[r]?e.length>1?{type:sf[r],data:e.substring(1)}:{type:sf[r]}:sp},sk=(e,i)=>sx?sE((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=sw[e.charCodeAt(n)],a=sw[e.charCodeAt(n+1)],l=sw[e.charCodeAt(n+2)],c=sw[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},sE=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function sR(e){return e.reduce((e,i)=>e+i.length,0)}function sT(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function sD(e){if(e){var i=e;for(var r in sD.prototype)i[r]=sD.prototype[r];return i}}sD.prototype.on=sD.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},sD.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},sD.prototype.off=sD.prototype.removeListener=sD.prototype.removeAllListeners=sD.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},sD.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},sD.prototype.emitReserved=sD.prototype.emit,sD.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},sD.prototype.hasListeners=function(e){return!!this.listeners(e).length};let sL="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),sA="u">typeof self?self:"u">typeof window?window:Function("return this")();function sM(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let sP=sA.setTimeout,sO=sA.clearTimeout;function sB(e,i){i.useNativeTimers?(e.setTimeoutFn=sP.bind(sA),e.clearTimeoutFn=sO.bind(sA)):(e.setTimeoutFn=sA.setTimeout.bind(sA),e.clearTimeoutFn=sA.clearTimeout.bind(sA))}function sN(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class sI extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class sF extends sD{constructor(e){super(),this.writable=!1,sB(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new sI(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=sC(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class sz extends sF{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=sC(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{sv(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=sN()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let sH=!1;try{sH="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let sj=sH;function sW(){}class s$ extends sz{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class sU extends sD{constructor(e,i,r){super(),this.createRequest=e,sB(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=sM(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=sU.requestsCount++,sU.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=sW,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete sU.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function sq(){for(let e in sU.requests)sU.requests.hasOwnProperty(e)&&sU.requests[e].abort()}sU.requestsCount=0,sU.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",sq):"function"==typeof addEventListener&&addEventListener("onpagehide"in sA?"pagehide":"unload",sq,!1));let sV=(m=sK({xdomain:!1}))&&null!==m.responseType;function sK(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||sj))return new XMLHttpRequest}catch(e){}if(!i)try{return new sA[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let sY="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class sX extends sF{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=sY?{}:sM(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;sv(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&sL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=sN()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let sG=sA.WebSocket||sA.MozWebSocket,sJ={websocket:class extends sX{createSocket(e,i,r){return sY?new sG(e,i,r):i?new sG(e,i):new sG(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends sF{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,a,l,c,h=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],a=0,l=-1,c=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===a){if(1>sR(o))break;let e=sT(o,1);c=(128&e[0])==128,a=(l=127&e[0])<126?3:126===l?1:2}else if(1===a){if(2>sR(o))break;let e=sT(o,2);l=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),a=3}else if(2===a){if(8>sR(o))break;let e=sT(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(sp);break}l=0x100000000*n+r.getUint32(4),a=3}else{if(sR(o)<l)break;let e=sT(o,l);i.enqueue(sC(c?e:r.decode(e),s)),a=0}if(0===l||l>n){i.enqueue(sp);break}}}})),u=e.readable.pipeThrough(h).getReader(),d=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},sg&&e.data instanceof Blob?e.data.arrayBuffer().then(sb).then(n):sm&&(e.data instanceof ArrayBuffer||s_(e.data))?n(sb(e.data)):sv(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});d.readable.pipeTo(e.writable),this._writer=d.writable.getWriter();let f=()=>{u.read().then(({done:e,value:i})=>{e||(this.onPacket(i),f())}).catch(e=>{})};f();let p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this._writer.write(p).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&sL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends s${constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=sV&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new sU(sK,this.uri(),e)}}},sZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sQ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function s0(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=sZ.exec(e||""),h={},u=14;for(;u--;)h[sQ[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let s1="function"==typeof addEventListener&&"function"==typeof removeEventListener,s2=[];s1&&addEventListener("offline",()=>{s2.forEach(e=>e())},!1);class s5 extends sD{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=s0(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=s0(i.host).host);sB(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),s1&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},s2.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&s5.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s5.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,sL(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(s5.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),s1&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=s2.indexOf(this._offlineEventListener);-1!==e&&s2.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}s5.protocol=4;class s3 extends s5{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;s5.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;s5.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class s4 extends s3{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>sJ[e]).filter(e=>!!e)),super(e,r)}}s4.protocol;let s6="function"==typeof ArrayBuffer,s9=Object.prototype.toString,s8="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===s9.call(Blob),s7="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===s9.call(File);function oe(e){return s6&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||s8&&e instanceof Blob||s7&&e instanceof File}let ot=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(_=v||(v={}))[_.CONNECT=0]="CONNECT",_[_.DISCONNECT=1]="DISCONNECT",_[_.EVENT=2]="EVENT",_[_.ACK=3]="ACK",_[_.CONNECT_ERROR=4]="CONNECT_ERROR",_[_.BINARY_EVENT=5]="BINARY_EVENT",_[_.BINARY_ACK=6]="BINARY_ACK";class oi extends sD{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===v.BINARY_EVENT;r||i.type===v.BINARY_ACK?(i.type=r?v.EVENT:v.ACK,this.reconstructor=new or(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(oe(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===v[r.type])throw Error("unknown packet type "+r.type);if(r.type===v.BINARY_EVENT||r.type===v.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!on(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(oi.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case v.CONNECT:return os(i);case v.DISCONNECT:return void 0===i;case v.CONNECT_ERROR:return"string"==typeof i||os(i);case v.EVENT:case v.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===ot.indexOf(i[0]));case v.ACK:case v.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class or{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let on=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function os(e){return"[object Object]"===Object.prototype.toString.call(e)}function oo(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,oi,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===v.EVENT||e.type===v.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(oe(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===v.EVENT?v.BINARY_EVENT:v.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===v.BINARY_EVENT||e.type===v.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(oe(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,v,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||on(i))&&function(e,i){switch(e){case v.CONNECT:return void 0===i||os(i);case v.DISCONNECT:return void 0===i;case v.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===ot.indexOf(i[0]));case v.ACK:return Array.isArray(i);case v.CONNECT_ERROR:return"string"==typeof i||os(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let oa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ol extends sD{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[oo(e,"open",this.onopen.bind(this)),oo(e,"packet",this.onpacket.bind(this)),oo(e,"error",this.onerror.bind(this)),oo(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(oa.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:v.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:v.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case v.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case v.EVENT:case v.BINARY_EVENT:this.onevent(e);break;case v.ACK:case v.BINARY_ACK:this.onack(e);break;case v.DISCONNECT:this.ondisconnect();break;case v.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:v.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:v.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var oc=e.i(51890);function oh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}oh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},oh.prototype.reset=function(){this.attempts=0},oh.prototype.setMin=function(e){this.ms=e},oh.prototype.setMax=function(e){this.max=e},oh.prototype.setJitter=function(e){this.jitter=e};class ou extends sD{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,sB(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new oh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||oc;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new s4(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=oo(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=oo(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(oo(e,"ping",this.onping.bind(this)),oo(e,"data",this.ondata.bind(this)),oo(e,"error",this.onerror.bind(this)),oo(e,"close",this.onclose.bind(this)),oo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){sL(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new ol(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let od={};function of(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=s0(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=od[o]&&a in od[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new ou(s,i):(od[o]||(od[o]=new ou(s,i)),r=od[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(of,{Manager:ou,Socket:ol,io:of,connect:of}),e.s(["io",0,of],96085);var op=e.i(75254);let og=(0,op.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,og],31343);let om=(0,op.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["SquarePen",0,om],10031)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary transition-all",e),...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},67211,e=>{"use strict";var i=e.i(18050),r=e.i(71645),n=e.i(99894),s=e.i(93309),o=e.i(96085),a=e.i(627),l=e.i(31278),c=e.i(74886),h=e.i(31343),u=e.i(43531),d=e.i(10031),f=e.i(12382),p=e.i(85902),g=e.i(77814),m=e.i(70935);let _=(0,r.forwardRef)(function({tabId:e,cwd:_,env:v,worktreePath:y,command:b,className:S="",initialTodos:w,isActive:x,onTodosUpdated:C,onStatusChange:k},E){let R=(0,r.useRef)(null),T=(0,r.useRef)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(e),[M,P]=(0,r.useState)(!1),O=(0,r.useRef)(!1),B=(0,r.useRef)(x),N=(0,r.useRef)(!1),I=(0,r.useRef)(!1),[F,z]=(0,r.useState)("idle"),[H,j]=(0,r.useState)("idle"),[W,$]=(0,r.useState)(w??[]),[U,q]=(0,r.useState)(!1),{effectiveTheme:V}=(0,a.useTheme)(),K=(0,r.useRef)(k);K.current=k;let Y="dark"===V,X=Y?{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",selectionBackground:"#add6ff"};function G(){let e=L.current,i=T.current,r=A.current;e&&e.connected&&i&&r&&e.emit("resize",{sessionId:r,cols:i.cols,rows:i.rows})}function J(e){e.write("\x1b[2J\x1b[3J\x1b[H")}async function Z(i,r,n){z("connecting");try{var s,a,l,c;let h,u,d=await fetch((0,m.apiUrl)("/api/terminal/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:_,env:v,worktreePath:y,sessionId:i,command:b}),signal:n});if(!d.ok){let e=await d.text().catch(()=>"");throw Error(`Failed to create session: ${d.status} ${e}`)}let f=await d.json();if(n.aborted)return;A.current=f.sessionId,f.reused||J(r),s=f.sessionId,a=f.reused,l=r,c=n,L.current=h=(0,o.io)((0,m.getServerUrl)(),{transports:["websocket"]}),u=!1,h.on("connect",()=>{let e=N.current;N.current=!0,e?l.writeln("\x1b[90mReconnected.\x1b[0m"):a?(I.current=!0,J(l)):l.writeln("\x1b[90mConnected.\x1b[0m"),z("connected"),h.emit("join",{room:`tab:${s}`}),e&&B.current&&l.focus()}),h.on("output",({data:e})=>{a&&!u?(u=!0,l.write(e,()=>{I.current=!1,D.current?.fit(),G()})):l.write(e)}),h.on("exit",({exitCode:e})=>{console.log("[TerminalView] PTY exited with code:",e),z("exited"),A.current=null,L.current=null}),h.on("error",({message:e})=>{console.error("[TerminalView] Socket error message:",e),z("error")}),h.on("disconnect",()=>{c.aborted||z(e=>"exited"===e||"paused"===e||"idle"===e?e:"exited")}),h.on("status-changed",({status:e})=>{j(e)}),h.on("todos-updated",({todos:i})=>{$(i),C?.(e,i)}),h.on("editor:open",({sessionId:e,content:i})=>{window.dispatchEvent(new CustomEvent("editor-session-open-request",{detail:{sessionId:e,content:i}}))}),l.onData(e=>{h.connected&&A.current&&h.emit("input",{sessionId:A.current,data:e})})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("[TerminalView] connectSession error:",e instanceof Error?e.message:String(e)),z("error")}}async function Q(){let i=T.current;if(!i)return;let r=new AbortController;await Z(e,i,r.signal)}(0,r.useEffect)(()=>{K.current?.(e,F,H)},[e,F,H]),(0,r.useLayoutEffect)(()=>{B.current=x}),(0,r.useEffect)(()=>{x&&T.current?.focus()},[x]),(0,r.useEffect)(()=>{if(M)T.current?.blur();else if(x){let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}},[M,x]),(0,r.useEffect)(()=>{"connected"===F&&D.current&&(D.current.fit(),I.current||G())},[F]),(0,r.useEffect)(()=>{if(!R.current)return;let i=new n.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Cascadia Code", "Fira Code", "Menlo", monospace',theme:X,allowProposedApi:!0}),r=new s.FitAddon;i.loadAddon(r),i.open(R.current),r.fit(),T.current=i,D.current=r,B.current&&i.focus(),i.attachCustomKeyEventHandler(()=>!O.current);let o=new ResizeObserver(()=>{r.fit(),I.current||G()});o.observe(R.current);let a=new AbortController;return Z(e,i,a.signal),()=>{a.abort(),o.disconnect(),i.dispose(),T.current=null,D.current=null,L.current?.disconnect(),L.current=null}},[]),(0,r.useEffect)(()=>{T.current&&(T.current.options.theme=X)},[Y]),(0,r.useEffect)(()=>{function e(){O.current=!0,T.current?.blur()}function i(){if(O.current=!1,setTimeout(()=>{let e=L.current,i=A.current,r=T.current;e?.connected&&i&&r&&(e.emit("resize",{sessionId:i,cols:r.cols,rows:r.rows+1}),setTimeout(()=>{let e=T.current,r=L.current;r?.connected&&i&&e&&r.emit("resize",{sessionId:i,cols:e.cols,rows:e.rows})},30))},200),!B.current)return;let e=R.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}return window.addEventListener("editor-session-open",e),window.addEventListener("editor-session-done",i),()=>{window.removeEventListener("editor-session-open",e),window.removeEventListener("editor-session-done",i)}},[]),(0,r.useEffect)(()=>{function e(){if("visible"!==document.visibilityState)return;let e=L.current;if(!e||!e.connected)return;let i=setTimeout(()=>{e.off("health-check-ack",r),e.disconnect()},3e3);function r(){clearTimeout(i),B.current&&T.current?.focus()}e.once("health-check-ack",r),e.emit("health-check")}return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,r.useImperativeHandle)(E,()=>({sendInput:e=>{let i=L.current,r=A.current;i?.connected&&r&&i.emit("input",{sessionId:r,data:e})},focus:()=>{T.current?.focus()}}));let ee=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{q(!0),setTimeout(()=>q(!1),2e3)})},[e]),et="connecting"===F,ei="paused"===F||"exited"===F||"error"===F,er="connected"===F,en=W.filter(e=>"completed"===e.status).length,es=W.length,eo=e.length>8?`${e.slice(0,8)}…`:e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`flex flex-col h-full min-h-0 ${S}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border flex-shrink-0 bg-card",children:[(0,i.jsx)("span",{className:"font-mono text-xs text-muted-foreground",title:e,children:eo}),(0,i.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground hover:text-foreground",title:"Copy tab ID",children:U?(0,i.jsx)(u.Check,{className:"w-3 h-3 text-success"}):(0,i.jsx)(c.Copy,{className:"w-3 h-3"})}),(0,i.jsxs)(p.Button,{size:"xs",onClick:function(){let e=L.current,i=A.current;if(!e||!e.connected||!i)return;let r=`claude --dangerously-skip-permissions --resume ${i} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${i}
32
32
  `;e.emit("input",{sessionId:i,data:r})},disabled:!er,title:"Run Claude",children:[(0,i.jsx)(h.Play,{className:"w-3 h-3"}),"Run Claude"]}),(0,i.jsxs)(p.Button,{variant:"ghost",size:"xs",onClick:()=>P(!0),disabled:!er,className:"text-muted-foreground hover:text-foreground",title:"Open editor input",children:[(0,i.jsx)(d.SquarePen,{className:"w-3 h-3"}),"Open Editor"]}),es>0&&(0,i.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",title:W.find(e=>"in_progress"===e.status)?.content??"",children:[(0,i.jsx)(g.Progress,{value:en,max:es,className:"w-16 gap-0 [&_[data-slot=progress-track]]:h-[3px]"}),(0,i.jsxs)("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[en,"/",es]})]})]}),(0,i.jsxs)("div",{className:"relative flex-1 min-h-0 overflow-hidden",children:[(0,i.jsx)("div",{ref:R,className:"w-full h-full",style:{padding:"4px"}}),et&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background",children:(0,i.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[(0,i.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),(0,i.jsx)("span",{children:"Connecting..."})]})}),ei&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/90",children:(0,i.jsxs)("div",{className:"text-center space-y-2",children:["error"===F&&(0,i.jsx)("p",{className:"text-xs text-destructive",children:"Connection failed"}),"exited"===F&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Session ended"}),"paused"===F&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paused"}),(0,i.jsx)(p.Button,{size:"xs",onClick:Q,children:"Reconnect"})]})})]})]}),(0,i.jsx)(f.MonacoEditorModal,{open:M,onOpenChange:e=>{e.open||P(!1)},onSubmit:e=>{T.current&&e&&T.current.paste(e),P(!1)},title:"Terminal Input",submitLabel:"Paste"})]})});e.s(["TerminalView",0,_])}]);