neondeck 1.0.0-beta.10

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 (804) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/DEVELOPMENT.md +304 -0
  3. package/LICENSE +21 -0
  4. package/README.md +129 -0
  5. package/SOUL.md +8 -0
  6. package/bin/neondeck.mjs +27 -0
  7. package/config/dashboard.json +224 -0
  8. package/config/dashboard.schema.json +247 -0
  9. package/dist/SOUL.md +8 -0
  10. package/dist/assets/app-CnXGMuTl.js +3878 -0
  11. package/dist/assets/app-CnXGMuTl.js.map +1 -0
  12. package/dist/assets/autopilot-B8lfWyA1.js +68813 -0
  13. package/dist/assets/autopilot-B8lfWyA1.js.map +1 -0
  14. package/dist/assets/briefing-BT8h9XXT.js +52 -0
  15. package/dist/assets/briefing-BT8h9XXT.js.map +1 -0
  16. package/dist/assets/briefing-VMdQPEGc.js +2 -0
  17. package/dist/assets/briefings-DuApznpN.js +1596 -0
  18. package/dist/assets/briefings-DuApznpN.js.map +1 -0
  19. package/dist/assets/command-run-CnPOA8iY.js +20 -0
  20. package/dist/assets/command-run-CnPOA8iY.js.map +1 -0
  21. package/dist/assets/command-run-Smpq7waT.js +2 -0
  22. package/dist/assets/display-assistant-CKU4YJlc.js +392 -0
  23. package/dist/assets/display-assistant-CKU4YJlc.js.map +1 -0
  24. package/dist/assets/fix-pr-ci-Ce2SIcyf.js +46 -0
  25. package/dist/assets/fix-pr-ci-Ce2SIcyf.js.map +1 -0
  26. package/dist/assets/fix-pr-ci-P3dLxmbx.js +2 -0
  27. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  28. package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
  29. package/dist/assets/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
  30. package/dist/assets/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
  31. package/dist/assets/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
  32. package/dist/assets/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
  33. package/dist/assets/migrations/20260714213018_pr_reviews/migration.sql +34 -0
  34. package/dist/assets/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
  35. package/dist/assets/pr-reviews-BtJ5cm5P.js +521 -0
  36. package/dist/assets/pr-reviews-BtJ5cm5P.js.map +1 -0
  37. package/dist/assets/prepare-pr-worktree-B0qMZMRP.js +2 -0
  38. package/dist/assets/prepare-pr-worktree-C7SmiaTp.js +17 -0
  39. package/dist/assets/prepare-pr-worktree-C7SmiaTp.js.map +1 -0
  40. package/dist/assets/push-pr-autofix-CsMbrnXR.js +17 -0
  41. package/dist/assets/push-pr-autofix-CsMbrnXR.js.map +1 -0
  42. package/dist/assets/push-pr-autofix-njuM6ej2.js +2 -0
  43. package/dist/assets/review-pr-for-human-CEciM46A.js +2 -0
  44. package/dist/assets/review-pr-for-human-TPiQNRWV.js +790 -0
  45. package/dist/assets/review-pr-for-human-TPiQNRWV.js.map +1 -0
  46. package/dist/assets/safety-BQC7exnI.js +1931 -0
  47. package/dist/assets/safety-BQC7exnI.js.map +1 -0
  48. package/dist/assets/scheduled-agent-instruction-BbxwCKbU.js +2 -0
  49. package/dist/assets/scheduled-agent-instruction-C58itQyU.js +22 -0
  50. package/dist/assets/scheduled-agent-instruction-C58itQyU.js.map +1 -0
  51. package/dist/assets/scheduler-tick-B2S9jCYS.js +90 -0
  52. package/dist/assets/scheduler-tick-B2S9jCYS.js.map +1 -0
  53. package/dist/assets/scheduler-workflow-CnI0tWbg.js +21 -0
  54. package/dist/assets/scheduler-workflow-CnI0tWbg.js.map +1 -0
  55. package/dist/assets/skills/github-gh/SKILL.md +56 -0
  56. package/dist/assets/skills/neon-ci-fix/SKILL.md +15 -0
  57. package/dist/assets/skills/neon-docs-fix/SKILL.md +15 -0
  58. package/dist/assets/skills/neon-issue-triage/SKILL.md +13 -0
  59. package/dist/assets/skills/neon-pr-review/SKILL.md +19 -0
  60. package/dist/assets/skills/neondeck/SKILL.md +127 -0
  61. package/dist/assets/skills/neondeck-handoff/SKILL.md +31 -0
  62. package/dist/assets/triage-pr-event-CBje6df5.js +2 -0
  63. package/dist/assets/triage-pr-event-IgC-IrNs.js +17 -0
  64. package/dist/assets/triage-pr-event-IgC-IrNs.js.map +1 -0
  65. package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js +75 -0
  66. package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js.map +1 -0
  67. package/dist/assets/verify-then-push-pr-autofix-oZ0-wa7L.js +2 -0
  68. package/dist/config/dashboard.json +224 -0
  69. package/dist/config/dashboard.schema.json +247 -0
  70. package/dist/server.mjs +583 -0
  71. package/dist/server.mjs.map +1 -0
  72. package/dist/skills/github-gh/SKILL.md +56 -0
  73. package/dist/skills/neon-ci-fix/SKILL.md +15 -0
  74. package/dist/skills/neon-docs-fix/SKILL.md +15 -0
  75. package/dist/skills/neon-issue-triage/SKILL.md +13 -0
  76. package/dist/skills/neon-pr-review/SKILL.md +19 -0
  77. package/dist/skills/neondeck/SKILL.md +127 -0
  78. package/dist/skills/neondeck-handoff/SKILL.md +31 -0
  79. package/drizzle.config.ts +7 -0
  80. package/package.json +156 -0
  81. package/shared/patch-anchors.ts +78 -0
  82. package/shared/report-document.ts +91 -0
  83. package/src/agents/busywork-workflow.ts +24 -0
  84. package/src/agents/display-assistant.ts +137 -0
  85. package/src/agents/pr-review-assistant.ts +25 -0
  86. package/src/agents/scheduler-workflow.ts +20 -0
  87. package/src/agents/support/tools.ts +346 -0
  88. package/src/app.ts +1 -0
  89. package/src/cli/index.ts +560 -0
  90. package/src/cli/learning.ts +44 -0
  91. package/src/cli/mcp.ts +496 -0
  92. package/src/cli/modules.ts +107 -0
  93. package/src/cli/onboarding.ts +666 -0
  94. package/src/cli/options.ts +102 -0
  95. package/src/cli/output.ts +399 -0
  96. package/src/cli/preapprovals.ts +204 -0
  97. package/src/cli/prompts.ts +108 -0
  98. package/src/cli/types.ts +59 -0
  99. package/src/db.ts +41 -0
  100. package/src/desktop/open.ts +698 -0
  101. package/src/desktop/service.ts +863 -0
  102. package/src/domains/mcp/actions.ts +420 -0
  103. package/src/domains/mcp/config.ts +501 -0
  104. package/src/domains/mcp/format.ts +35 -0
  105. package/src/domains/mcp/gate.ts +188 -0
  106. package/src/domains/mcp/index.ts +9 -0
  107. package/src/domains/mcp/instructions.ts +18 -0
  108. package/src/domains/mcp/oauth.ts +1063 -0
  109. package/src/domains/mcp/policy.ts +15 -0
  110. package/src/domains/mcp/registry.ts +461 -0
  111. package/src/domains/mcp/schemas.ts +171 -0
  112. package/src/domains/mcp/stdio.ts +451 -0
  113. package/src/domains/mcp/store.ts +905 -0
  114. package/src/domains/mcp/tools.ts +119 -0
  115. package/src/lib/action-result.ts +51 -0
  116. package/src/lib/exec.ts +118 -0
  117. package/src/lib/git.ts +20 -0
  118. package/src/lib/report-html.ts +193 -0
  119. package/src/lib/sqlite.ts +51 -0
  120. package/src/lib/valibot.ts +33 -0
  121. package/src/modules/app-state/index.ts +4 -0
  122. package/src/modules/app-state/notification-events.ts +44 -0
  123. package/src/modules/app-state/notifications.ts +259 -0
  124. package/src/modules/app-state/types.ts +42 -0
  125. package/src/modules/app-state/workflow-summaries.ts +201 -0
  126. package/src/modules/autonomous-audit/index.ts +225 -0
  127. package/src/modules/autopilot/actions.ts +186 -0
  128. package/src/modules/autopilot/admissions.ts +865 -0
  129. package/src/modules/autopilot/approvals.ts +59 -0
  130. package/src/modules/autopilot/ci-fix-run.ts +1332 -0
  131. package/src/modules/autopilot/ci-fix.ts +718 -0
  132. package/src/modules/autopilot/comments.ts +426 -0
  133. package/src/modules/autopilot/fixtures.ts +344 -0
  134. package/src/modules/autopilot/github-facts.ts +306 -0
  135. package/src/modules/autopilot/index.ts +64 -0
  136. package/src/modules/autopilot/notifications.ts +271 -0
  137. package/src/modules/autopilot/push-support.ts +260 -0
  138. package/src/modules/autopilot/push.ts +670 -0
  139. package/src/modules/autopilot/recovery.ts +656 -0
  140. package/src/modules/autopilot/review-feedback.ts +649 -0
  141. package/src/modules/autopilot/review-support.ts +524 -0
  142. package/src/modules/autopilot/revision-run.ts +445 -0
  143. package/src/modules/autopilot/schemas.ts +485 -0
  144. package/src/modules/autopilot/state-mappers.ts +517 -0
  145. package/src/modules/autopilot/state-schemas.ts +450 -0
  146. package/src/modules/autopilot/state-store.ts +183 -0
  147. package/src/modules/autopilot/state.ts +255 -0
  148. package/src/modules/autopilot/triage-support.ts +234 -0
  149. package/src/modules/autopilot/triage.ts +156 -0
  150. package/src/modules/autopilot/utils.ts +145 -0
  151. package/src/modules/autopilot/worktree.ts +637 -0
  152. package/src/modules/autopilot-policy/config.ts +101 -0
  153. package/src/modules/autopilot-policy/index.ts +4 -0
  154. package/src/modules/autopilot-policy/risk.ts +359 -0
  155. package/src/modules/autopilot-policy/schemas.ts +229 -0
  156. package/src/modules/autopilot-policy/service.ts +272 -0
  157. package/src/modules/briefings/actions.ts +80 -0
  158. package/src/modules/briefings/index.ts +5 -0
  159. package/src/modules/briefings/schemas.ts +125 -0
  160. package/src/modules/briefings/service.ts +642 -0
  161. package/src/modules/briefings/snapshot.ts +291 -0
  162. package/src/modules/briefings/store.ts +644 -0
  163. package/src/modules/commands/actions.ts +112 -0
  164. package/src/modules/commands/handlers/index.ts +3 -0
  165. package/src/modules/commands/handlers/misc.ts +367 -0
  166. package/src/modules/commands/handlers/queue.ts +710 -0
  167. package/src/modules/commands/handlers/repo.ts +339 -0
  168. package/src/modules/commands/index.ts +5 -0
  169. package/src/modules/commands/registry.ts +157 -0
  170. package/src/modules/commands/runner.ts +152 -0
  171. package/src/modules/commands/schemas.ts +109 -0
  172. package/src/modules/commands/summaries.ts +108 -0
  173. package/src/modules/commands/utils.ts +113 -0
  174. package/src/modules/config/actions.ts +253 -0
  175. package/src/modules/config/events.ts +80 -0
  176. package/src/modules/config/files.ts +9 -0
  177. package/src/modules/config/history.ts +74 -0
  178. package/src/modules/config/index.ts +9 -0
  179. package/src/modules/config/mutations/dashboard.ts +333 -0
  180. package/src/modules/config/mutations/execution.ts +89 -0
  181. package/src/modules/config/mutations/models.ts +467 -0
  182. package/src/modules/config/mutations/providers.ts +163 -0
  183. package/src/modules/config/mutations/repos.ts +663 -0
  184. package/src/modules/config/read.ts +130 -0
  185. package/src/modules/config/result.ts +66 -0
  186. package/src/modules/config/schemas.ts +180 -0
  187. package/src/modules/docs-drift/index.ts +1 -0
  188. package/src/modules/docs-drift/service.ts +863 -0
  189. package/src/modules/execution/actions.ts +35 -0
  190. package/src/modules/execution/approvals.ts +322 -0
  191. package/src/modules/execution/exedev/checkouts.ts +356 -0
  192. package/src/modules/execution/exedev/context.ts +286 -0
  193. package/src/modules/execution/index.ts +7 -0
  194. package/src/modules/execution/policy.ts +102 -0
  195. package/src/modules/execution/run.ts +589 -0
  196. package/src/modules/execution/schemas.ts +116 -0
  197. package/src/modules/execution/scope.ts +137 -0
  198. package/src/modules/execution/store.ts +320 -0
  199. package/src/modules/execution/utils.ts +105 -0
  200. package/src/modules/execution-policy/index.ts +424 -0
  201. package/src/modules/flue/execution-context.ts +40 -0
  202. package/src/modules/flue/index.ts +2 -0
  203. package/src/modules/flue/origin.ts +7 -0
  204. package/src/modules/github/actions.ts +334 -0
  205. package/src/modules/github/checks.ts +484 -0
  206. package/src/modules/github/client.ts +110 -0
  207. package/src/modules/github/comments.ts +204 -0
  208. package/src/modules/github/errors.ts +50 -0
  209. package/src/modules/github/index.ts +93 -0
  210. package/src/modules/github/issues.ts +116 -0
  211. package/src/modules/github/pr-file-cache.ts +264 -0
  212. package/src/modules/github/pull-requests.ts +411 -0
  213. package/src/modules/github/queue.ts +350 -0
  214. package/src/modules/github/reviews.ts +1446 -0
  215. package/src/modules/github/schemas.ts +794 -0
  216. package/src/modules/github/state-truncation.ts +31 -0
  217. package/src/modules/handoff/index.ts +2 -0
  218. package/src/modules/handoff/schemas.ts +61 -0
  219. package/src/modules/handoff/service.ts +587 -0
  220. package/src/modules/hygiene/index.ts +1 -0
  221. package/src/modules/hygiene/service.ts +513 -0
  222. package/src/modules/kilo/actions.ts +229 -0
  223. package/src/modules/kilo/ci-fix-run-reconcile.ts +299 -0
  224. package/src/modules/kilo/docs-drift-boundary.ts +178 -0
  225. package/src/modules/kilo/index.ts +8 -0
  226. package/src/modules/kilo/notifications.ts +295 -0
  227. package/src/modules/kilo/process.ts +637 -0
  228. package/src/modules/kilo/results/actions.ts +66 -0
  229. package/src/modules/kilo/results/gates.ts +227 -0
  230. package/src/modules/kilo/results/index.ts +23 -0
  231. package/src/modules/kilo/results/schemas.ts +112 -0
  232. package/src/modules/kilo/results/service.ts +512 -0
  233. package/src/modules/kilo/results/state.ts +508 -0
  234. package/src/modules/kilo/results/verify.ts +328 -0
  235. package/src/modules/kilo/revision-reconcile.ts +187 -0
  236. package/src/modules/kilo/runtime-facts.ts +128 -0
  237. package/src/modules/kilo/schemas.ts +265 -0
  238. package/src/modules/kilo/service.ts +714 -0
  239. package/src/modules/kilo/sessions-adapters.ts +343 -0
  240. package/src/modules/kilo/sessions.ts +446 -0
  241. package/src/modules/kilo/store.ts +689 -0
  242. package/src/modules/kilo/utils.ts +166 -0
  243. package/src/modules/learning/automation-health.ts +441 -0
  244. package/src/modules/learning/automation-memory.ts +179 -0
  245. package/src/modules/learning/index.ts +6 -0
  246. package/src/modules/learning/observability.ts +616 -0
  247. package/src/modules/learning/operator.ts +404 -0
  248. package/src/modules/learning/reviews/agents.ts +33 -0
  249. package/src/modules/learning/reviews/complete.ts +321 -0
  250. package/src/modules/learning/reviews/context.ts +145 -0
  251. package/src/modules/learning/reviews/events.ts +306 -0
  252. package/src/modules/learning/reviews/index.ts +6 -0
  253. package/src/modules/learning/reviews/pr-cadence.ts +157 -0
  254. package/src/modules/learning/reviews/pr-context.ts +749 -0
  255. package/src/modules/learning/reviews/prepare.ts +387 -0
  256. package/src/modules/learning/reviews/schemas.ts +184 -0
  257. package/src/modules/learning/reviews/store.ts +405 -0
  258. package/src/modules/learning/skill-patches/actions.ts +86 -0
  259. package/src/modules/learning/skill-patches/index.ts +3 -0
  260. package/src/modules/learning/skill-patches/schemas.ts +60 -0
  261. package/src/modules/learning/skill-patches/service.ts +571 -0
  262. package/src/modules/learning/skill-patches/support.ts +417 -0
  263. package/src/modules/memory/actions.ts +183 -0
  264. package/src/modules/memory/candidates.ts +525 -0
  265. package/src/modules/memory/events.ts +2 -0
  266. package/src/modules/memory/index.ts +6 -0
  267. package/src/modules/memory/prompt.ts +214 -0
  268. package/src/modules/memory/schemas.ts +170 -0
  269. package/src/modules/memory/service.ts +578 -0
  270. package/src/modules/memory/store.ts +489 -0
  271. package/src/modules/pr-events/actions.ts +191 -0
  272. package/src/modules/pr-events/index.ts +46 -0
  273. package/src/modules/pr-events/schemas.ts +186 -0
  274. package/src/modules/pr-events/service.ts +1414 -0
  275. package/src/modules/pr-events/target.ts +222 -0
  276. package/src/modules/pr-events/utils.ts +85 -0
  277. package/src/modules/pr-events/watermarks.ts +308 -0
  278. package/src/modules/pr-local-diffs/index.ts +334 -0
  279. package/src/modules/pr-review-assist/actions.ts +239 -0
  280. package/src/modules/pr-review-assist/index.ts +3 -0
  281. package/src/modules/pr-review-assist/schemas.ts +86 -0
  282. package/src/modules/pr-review-assist/service.ts +706 -0
  283. package/src/modules/pr-reviews/events.ts +39 -0
  284. package/src/modules/pr-reviews/index.ts +4 -0
  285. package/src/modules/pr-reviews/service.ts +655 -0
  286. package/src/modules/pr-reviews/store.ts +186 -0
  287. package/src/modules/pr-reviews/types.ts +48 -0
  288. package/src/modules/prepared-diffs/actions.ts +132 -0
  289. package/src/modules/prepared-diffs/index.ts +53 -0
  290. package/src/modules/prepared-diffs/schemas.ts +255 -0
  291. package/src/modules/prepared-diffs/service.ts +791 -0
  292. package/src/modules/prepared-diffs/store.ts +678 -0
  293. package/src/modules/repo-guardrails/config.ts +61 -0
  294. package/src/modules/repo-guardrails/index.ts +162 -0
  295. package/src/modules/repo-guardrails/risk.ts +2 -0
  296. package/src/modules/reports/index.ts +1 -0
  297. package/src/modules/reports/service.ts +337 -0
  298. package/src/modules/repos/index.ts +3 -0
  299. package/src/modules/repos/model-discovery.ts +233 -0
  300. package/src/modules/repos/providers.ts +194 -0
  301. package/src/modules/repos/registry.ts +232 -0
  302. package/src/modules/runtime/agent-config.ts +167 -0
  303. package/src/modules/runtime/doctor.ts +528 -0
  304. package/src/modules/runtime/env.ts +123 -0
  305. package/src/modules/runtime/index.ts +12 -0
  306. package/src/modules/runtime/local-api-auth.ts +43 -0
  307. package/src/modules/runtime/metrics.ts +211 -0
  308. package/src/modules/runtime/skills-actions.ts +141 -0
  309. package/src/modules/runtime/skills.ts +689 -0
  310. package/src/modules/runtime/soul.ts +68 -0
  311. package/src/modules/runtime/status-database.ts +252 -0
  312. package/src/modules/runtime/status-schema.ts +149 -0
  313. package/src/modules/runtime/status.ts +481 -0
  314. package/src/modules/runtime/subagents.ts +37 -0
  315. package/src/modules/runtime/utility-model.ts +47 -0
  316. package/src/modules/safety/index.ts +3 -0
  317. package/src/modules/safety/policy-entries.ts +2528 -0
  318. package/src/modules/safety/schemas.ts +63 -0
  319. package/src/modules/safety/service.ts +58 -0
  320. package/src/modules/safety/tools.ts +15 -0
  321. package/src/modules/scheduled-tasks/actions.ts +113 -0
  322. package/src/modules/scheduled-tasks/dispatch.ts +107 -0
  323. package/src/modules/scheduled-tasks/index.ts +6 -0
  324. package/src/modules/scheduled-tasks/schemas.ts +91 -0
  325. package/src/modules/scheduled-tasks/service.ts +296 -0
  326. package/src/modules/scheduled-tasks/store.ts +814 -0
  327. package/src/modules/scheduled-tasks/triggers.ts +87 -0
  328. package/src/modules/scheduler/actions.ts +37 -0
  329. package/src/modules/scheduler/dispatch.ts +192 -0
  330. package/src/modules/scheduler/index.ts +4 -0
  331. package/src/modules/scheduler/lease.ts +247 -0
  332. package/src/modules/scheduler/pr-watch-event-deltas.ts +367 -0
  333. package/src/modules/scheduler/pr-watch-events.ts +834 -0
  334. package/src/modules/scheduler/schemas.ts +79 -0
  335. package/src/modules/scheduler/service.ts +228 -0
  336. package/src/modules/scheduler/utils.ts +106 -0
  337. package/src/modules/scheduler/workflow-invocation.ts +48 -0
  338. package/src/modules/sessions/actions.ts +213 -0
  339. package/src/modules/sessions/active-session.ts +46 -0
  340. package/src/modules/sessions/activity.ts +122 -0
  341. package/src/modules/sessions/agent-context.ts +152 -0
  342. package/src/modules/sessions/approval-nudges.ts +156 -0
  343. package/src/modules/sessions/events.ts +57 -0
  344. package/src/modules/sessions/index.ts +12 -0
  345. package/src/modules/sessions/queries.ts +252 -0
  346. package/src/modules/sessions/references.ts +113 -0
  347. package/src/modules/sessions/repo-context.ts +131 -0
  348. package/src/modules/sessions/schemas.ts +285 -0
  349. package/src/modules/sessions/service.ts +845 -0
  350. package/src/modules/sessions/store.ts +560 -0
  351. package/src/modules/sessions/summaries.ts +129 -0
  352. package/src/modules/sessions/utils.ts +18 -0
  353. package/src/modules/watches/actions.ts +115 -0
  354. package/src/modules/watches/index.ts +6 -0
  355. package/src/modules/watches/polling.ts +245 -0
  356. package/src/modules/watches/references.ts +293 -0
  357. package/src/modules/watches/schemas.ts +156 -0
  358. package/src/modules/watches/service.ts +557 -0
  359. package/src/modules/watches/store.ts +398 -0
  360. package/src/modules/watches/utils.ts +51 -0
  361. package/src/modules/worktree-verification/index.ts +256 -0
  362. package/src/modules/worktrees/access.ts +129 -0
  363. package/src/modules/worktrees/actions.ts +108 -0
  364. package/src/modules/worktrees/cleanup.ts +98 -0
  365. package/src/modules/worktrees/ensure-pr-worktree.ts +63 -0
  366. package/src/modules/worktrees/errors.ts +38 -0
  367. package/src/modules/worktrees/git.ts +48 -0
  368. package/src/modules/worktrees/index.ts +7 -0
  369. package/src/modules/worktrees/locks.ts +231 -0
  370. package/src/modules/worktrees/paths.ts +209 -0
  371. package/src/modules/worktrees/push-target.ts +39 -0
  372. package/src/modules/worktrees/queries.ts +31 -0
  373. package/src/modules/worktrees/schemas.ts +237 -0
  374. package/src/modules/worktrees/service.ts +680 -0
  375. package/src/modules/worktrees/store.ts +415 -0
  376. package/src/repo-edit/actions.ts +509 -0
  377. package/src/repo-edit/audit.ts +180 -0
  378. package/src/repo-edit/fuzzy-replace.ts +256 -0
  379. package/src/repo-edit/git.ts +830 -0
  380. package/src/repo-edit/index.ts +4 -0
  381. package/src/repo-edit/locks.ts +27 -0
  382. package/src/repo-edit/patch-parser.ts +212 -0
  383. package/src/repo-edit/patch-service.ts +572 -0
  384. package/src/repo-edit/path-safety.ts +299 -0
  385. package/src/repo-edit/schemas.ts +239 -0
  386. package/src/repo-edit/service.ts +488 -0
  387. package/src/repo-edit/support.ts +459 -0
  388. package/src/runtime-home/app-db/index.ts +74 -0
  389. package/src/runtime-home/app-db/migrate.ts +491 -0
  390. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
  391. package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
  392. package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
  393. package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
  394. package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
  395. package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
  396. package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/migration.sql +34 -0
  397. package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
  398. package/src/runtime-home/app-db/reconcile.ts +155 -0
  399. package/src/runtime-home/app-db/schema.ts +1209 -0
  400. package/src/runtime-home/bootstrap.ts +177 -0
  401. package/src/runtime-home/dashboard-migrations.ts +101 -0
  402. package/src/runtime-home/defaults.ts +54 -0
  403. package/src/runtime-home/files.ts +193 -0
  404. package/src/runtime-home/guardrails.ts +77 -0
  405. package/src/runtime-home/index.ts +71 -0
  406. package/src/runtime-home/paths.ts +75 -0
  407. package/src/runtime-home/schemas.ts +520 -0
  408. package/src/sandboxes/exedev.ts +676 -0
  409. package/src/server/app.ts +5 -0
  410. package/src/server/autopilot-push-dispatch.ts +326 -0
  411. package/src/server/create-app.ts +160 -0
  412. package/src/server/events/event-stream.ts +109 -0
  413. package/src/server/http.ts +56 -0
  414. package/src/server/learning-hooks.ts +489 -0
  415. package/src/server/middleware.ts +81 -0
  416. package/src/server/routes/autopilot.ts +318 -0
  417. package/src/server/routes/briefings.ts +34 -0
  418. package/src/server/routes/commands.ts +12 -0
  419. package/src/server/routes/config.ts +124 -0
  420. package/src/server/routes/execution.ts +71 -0
  421. package/src/server/routes/github.ts +559 -0
  422. package/src/server/routes/handoff.ts +69 -0
  423. package/src/server/routes/kilo.ts +179 -0
  424. package/src/server/routes/learning.ts +384 -0
  425. package/src/server/routes/mcp.ts +301 -0
  426. package/src/server/routes/memory.ts +99 -0
  427. package/src/server/routes/metrics.ts +12 -0
  428. package/src/server/routes/notifications.ts +48 -0
  429. package/src/server/routes/repo-edit.ts +115 -0
  430. package/src/server/routes/reports.ts +128 -0
  431. package/src/server/routes/repos.ts +50 -0
  432. package/src/server/routes/reviews.ts +257 -0
  433. package/src/server/routes/runtime.ts +48 -0
  434. package/src/server/routes/safety.ts +13 -0
  435. package/src/server/routes/scheduled-tasks.ts +60 -0
  436. package/src/server/routes/scheduler.ts +13 -0
  437. package/src/server/routes/sessions.ts +229 -0
  438. package/src/server/routes/skills.ts +103 -0
  439. package/src/server/routes/watches.ts +81 -0
  440. package/src/server/routes/workflows.ts +21 -0
  441. package/src/server/routes/worktrees.ts +64 -0
  442. package/src/server/scheduler-workflow.ts +541 -0
  443. package/src/server/serve.ts +100 -0
  444. package/src/setup.ts +162 -0
  445. package/src/skills/github-gh/SKILL.md +56 -0
  446. package/src/skills/neon-ci-fix/SKILL.md +15 -0
  447. package/src/skills/neon-docs-fix/SKILL.md +15 -0
  448. package/src/skills/neon-issue-triage/SKILL.md +13 -0
  449. package/src/skills/neon-pr-review/SKILL.md +19 -0
  450. package/src/skills/neondeck/SKILL.md +127 -0
  451. package/src/skills/neondeck-handoff/SKILL.md +31 -0
  452. package/src/workflows/briefing.ts +50 -0
  453. package/src/workflows/command-run.ts +15 -0
  454. package/src/workflows/comment-pr-autofix-result.ts +10 -0
  455. package/src/workflows/curate_learning_store.ts +37 -0
  456. package/src/workflows/dev-doctor.ts +10 -0
  457. package/src/workflows/fix-pr-ci-failure.ts +10 -0
  458. package/src/workflows/fix-pr-ci.ts +15 -0
  459. package/src/workflows/fix-pr-review-feedback.ts +10 -0
  460. package/src/workflows/handoff_to_kilo.ts +10 -0
  461. package/src/workflows/prepare-pr-worktree.ts +10 -0
  462. package/src/workflows/promote_kilo_result.ts +10 -0
  463. package/src/workflows/push-pr-autofix.ts +10 -0
  464. package/src/workflows/reconcile_kilo_task.ts +10 -0
  465. package/src/workflows/review-pr-for-human.ts +15 -0
  466. package/src/workflows/review_conversation_for_learning.ts +37 -0
  467. package/src/workflows/review_kilo_result.ts +10 -0
  468. package/src/workflows/review_pr_batch_for_learning.ts +37 -0
  469. package/src/workflows/scheduled-agent-instruction.ts +16 -0
  470. package/src/workflows/scheduler-tick.ts +10 -0
  471. package/src/workflows/summarize_kilo_session.ts +25 -0
  472. package/src/workflows/triage-pr-event.ts +10 -0
  473. package/src/workflows/verify-pr-worktree.ts +10 -0
  474. package/src/workflows/verify-then-push-pr-autofix.ts +82 -0
  475. package/src/workflows/verify_kilo_result.ts +10 -0
  476. package/src/workflows/watch-pr.ts +10 -0
  477. package/web/dist/assets/GitHubPrReview-Bf8PXCaq.js +3 -0
  478. package/web/dist/assets/MultiFileView-CFYStqTV.js +2970 -0
  479. package/web/dist/assets/PrReviewPopoutPage-CZN1CV82.js +1 -0
  480. package/web/dist/assets/abap-CLvhMVsD.js +1 -0
  481. package/web/dist/assets/actionscript-3--17pq3dv.js +1 -0
  482. package/web/dist/assets/ada-C5qYipkI.js +1 -0
  483. package/web/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  484. package/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
  485. package/web/dist/assets/angular-ts-BfdufMKP.js +1 -0
  486. package/web/dist/assets/apache-U0d_L8uA.js +1 -0
  487. package/web/dist/assets/apex-VAyPSnFM.js +1 -0
  488. package/web/dist/assets/apl-DWBSSoBH.js +1 -0
  489. package/web/dist/assets/applescript-CCn79oCD.js +1 -0
  490. package/web/dist/assets/ara-4CJ0cIlV.js +1 -0
  491. package/web/dist/assets/asciidoc-DE70LPWp.js +1 -0
  492. package/web/dist/assets/asm-Cmm7eHzH.js +1 -0
  493. package/web/dist/assets/astro-3LtMP0Sq.js +1 -0
  494. package/web/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  495. package/web/dist/assets/awk-BWXHIvNe.js +1 -0
  496. package/web/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  497. package/web/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  498. package/web/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  499. package/web/dist/assets/ballerina-B7ZEbQpA.js +1 -0
  500. package/web/dist/assets/bat-Bo4NYOV-.js +1 -0
  501. package/web/dist/assets/beancount-D-usSTwE.js +1 -0
  502. package/web/dist/assets/berry-DKpUyyne.js +1 -0
  503. package/web/dist/assets/bibtex-Ci_nEsc7.js +1 -0
  504. package/web/dist/assets/bicep-CUHmPFLl.js +1 -0
  505. package/web/dist/assets/bird2-C6vDhewU.js +1 -0
  506. package/web/dist/assets/blade-llJRbbtR.js +1 -0
  507. package/web/dist/assets/bsl-BkkzgIyY.js +1 -0
  508. package/web/dist/assets/c-Wt1voDr2.js +1 -0
  509. package/web/dist/assets/c3-BFHwR3_K.js +1 -0
  510. package/web/dist/assets/cadence-CQ2zXKGN.js +1 -0
  511. package/web/dist/assets/cairo-DLTphjLi.js +1 -0
  512. package/web/dist/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
  513. package/web/dist/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
  514. package/web/dist/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
  515. package/web/dist/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
  516. package/web/dist/assets/ccount-CMHa3wy6.js +1 -0
  517. package/web/dist/assets/clarity-SemFz856.js +1 -0
  518. package/web/dist/assets/clojure-DqKBuwfJ.js +1 -0
  519. package/web/dist/assets/cmake-Bj61d0ZC.js +1 -0
  520. package/web/dist/assets/cobol-x_HIyl2P.js +1 -0
  521. package/web/dist/assets/codeowners-C8r90Shi.js +1 -0
  522. package/web/dist/assets/codeql-oeQT6MSM.js +1 -0
  523. package/web/dist/assets/coffee-CThvmt4R.js +1 -0
  524. package/web/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
  525. package/web/dist/assets/coq-BrsZFFmf.js +1 -0
  526. package/web/dist/assets/cpp-NtAeskI3.js +1 -0
  527. package/web/dist/assets/crystal-DNu_sX0G.js +1 -0
  528. package/web/dist/assets/csharp-oqKa8noW.js +1 -0
  529. package/web/dist/assets/css-DJp_X0uY.js +1 -0
  530. package/web/dist/assets/csv-Dx-8-gkx.js +1 -0
  531. package/web/dist/assets/cue-CE9AQfxI.js +1 -0
  532. package/web/dist/assets/cypher-ClKdZ_lG.js +1 -0
  533. package/web/dist/assets/d-qD-0Kul2.js +1 -0
  534. package/web/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  535. package/web/dist/assets/dart-CnvKMtbv.js +1 -0
  536. package/web/dist/assets/dax-BkyTk9wS.js +1 -0
  537. package/web/dist/assets/desktop-Dlh5hvp9.js +1 -0
  538. package/web/dist/assets/diff-woXpYk--.js +1 -0
  539. package/web/dist/assets/docker-IyjqRm3v.js +1 -0
  540. package/web/dist/assets/dotenv-_5a1GRtc.js +1 -0
  541. package/web/dist/assets/dracula-BHWKrbxM.js +1 -0
  542. package/web/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  543. package/web/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
  544. package/web/dist/assets/edge-ozw5tpLl.js +1 -0
  545. package/web/dist/assets/elixir-VhA6FeZt.js +1 -0
  546. package/web/dist/assets/elm-dREJmIFz.js +1 -0
  547. package/web/dist/assets/emacs-lisp-B4R74twV.js +1 -0
  548. package/web/dist/assets/erb-CIg6G69l.js +1 -0
  549. package/web/dist/assets/erlang-Cphh6RMH.js +1 -0
  550. package/web/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  551. package/web/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  552. package/web/dist/assets/fennel-DQxkIbk2.js +1 -0
  553. package/web/dist/assets/fish-BJitypiv.js +1 -0
  554. package/web/dist/assets/fluent-C03EYrpw.js +1 -0
  555. package/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  556. package/web/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
  557. package/web/dist/assets/fsharp-D13ZGOAj.js +1 -0
  558. package/web/dist/assets/gdresource-C0sCabJj.js +1 -0
  559. package/web/dist/assets/gdscript-Cp2uCuqX.js +1 -0
  560. package/web/dist/assets/gdshader-CBce3t8t.js +1 -0
  561. package/web/dist/assets/genie-CV2tkWYe.js +1 -0
  562. package/web/dist/assets/gherkin-DExj1W_8.js +1 -0
  563. package/web/dist/assets/git-commit-BSykSTBG.js +1 -0
  564. package/web/dist/assets/git-rebase-B44mJPta.js +1 -0
  565. package/web/dist/assets/github-dark-C-LZuMrd.js +1 -0
  566. package/web/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
  567. package/web/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  568. package/web/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  569. package/web/dist/assets/github-light-EUqPIrTm.js +1 -0
  570. package/web/dist/assets/github-light-default-BXViO-2h.js +1 -0
  571. package/web/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  572. package/web/dist/assets/gleam-CSRkHgEL.js +1 -0
  573. package/web/dist/assets/glimmer-js-vH_gHG0-.js +1 -0
  574. package/web/dist/assets/glimmer-ts--abOzSAQ.js +1 -0
  575. package/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
  576. package/web/dist/assets/gn-ilITqXS6.js +1 -0
  577. package/web/dist/assets/gnuplot-7GGW24-e.js +1 -0
  578. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  579. package/web/dist/assets/graphql-CB4jsw2E.js +1 -0
  580. package/web/dist/assets/groovy-CacY0gHj.js +1 -0
  581. package/web/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  582. package/web/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  583. package/web/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  584. package/web/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  585. package/web/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  586. package/web/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  587. package/web/dist/assets/hack-DvEYX148.js +1 -0
  588. package/web/dist/assets/haml-zE6W3STP.js +1 -0
  589. package/web/dist/assets/handlebars-CzBR2SDs.js +1 -0
  590. package/web/dist/assets/haskell-D8IpX4py.js +1 -0
  591. package/web/dist/assets/haxe-OTjmBuCE.js +1 -0
  592. package/web/dist/assets/hcl-Dh228itO.js +1 -0
  593. package/web/dist/assets/hjson-CxZEssPk.js +1 -0
  594. package/web/dist/assets/hlsl-Cvrh5tZx.js +1 -0
  595. package/web/dist/assets/horizon-CE9ld1lL.js +1 -0
  596. package/web/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  597. package/web/dist/assets/houston-CsvMBhTu.js +1 -0
  598. package/web/dist/assets/html-C8UlPnhE.js +1 -0
  599. package/web/dist/assets/html-derivative-CY6NRz-J.js +1 -0
  600. package/web/dist/assets/http-Cyd7bS_S.js +1 -0
  601. package/web/dist/assets/hurl-CWPsiEpf.js +1 -0
  602. package/web/dist/assets/hxml-B0Qn7Nwc.js +1 -0
  603. package/web/dist/assets/hy-CZbG8q4J.js +1 -0
  604. package/web/dist/assets/imba-DsUTQ-LC.js +1 -0
  605. package/web/dist/assets/index-BTjK1c82.js +44 -0
  606. package/web/dist/assets/index-D0kg2-9O.css +2 -0
  607. package/web/dist/assets/ini-B5eOa1yu.js +1 -0
  608. package/web/dist/assets/java-CGc3VwQr.js +1 -0
  609. package/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
  610. package/web/dist/assets/jinja-CD-Z-FLd.js +1 -0
  611. package/web/dist/assets/jison-imPNup1l.js +1 -0
  612. package/web/dist/assets/json-Bg9ijW3F.js +1 -0
  613. package/web/dist/assets/json5-BR5RXkoi.js +1 -0
  614. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  615. package/web/dist/assets/jsonl-CmCQp5Yx.js +1 -0
  616. package/web/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
  617. package/web/dist/assets/jssm-DXw9l8Rf.js +1 -0
  618. package/web/dist/assets/jsx-CY6oMTks.js +1 -0
  619. package/web/dist/assets/julia-Dc3O-irA.js +1 -0
  620. package/web/dist/assets/just-BhOq_Kbv.js +1 -0
  621. package/web/dist/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
  622. package/web/dist/assets/kanagawa-lotus-BN08jTvb.js +1 -0
  623. package/web/dist/assets/kanagawa-wave-CTweb8Dz.js +1 -0
  624. package/web/dist/assets/kdl-CsD5j6eV.js +1 -0
  625. package/web/dist/assets/kilo-CvN-tXHs.js +1 -0
  626. package/web/dist/assets/kotlin-DhhofPvG.js +1 -0
  627. package/web/dist/assets/kusto-C7mF5XQf.js +1 -0
  628. package/web/dist/assets/laserwave-C_8bwKvT.js +1 -0
  629. package/web/dist/assets/latex-Cu4Y1d5w.js +1 -0
  630. package/web/dist/assets/lean-CewbzKMR.js +1 -0
  631. package/web/dist/assets/less-DVTAwKKz.js +1 -0
  632. package/web/dist/assets/light-plus-DVQuIRkW.js +1 -0
  633. package/web/dist/assets/liquid-CvXMrjlQ.js +1 -0
  634. package/web/dist/assets/llvm-Cm23YOpf.js +1 -0
  635. package/web/dist/assets/log-BNLmms1o.js +1 -0
  636. package/web/dist/assets/logo-Cluzi2Zq.js +1 -0
  637. package/web/dist/assets/lua-BjLEUjKY.js +1 -0
  638. package/web/dist/assets/luau-FMPmPwt6.js +1 -0
  639. package/web/dist/assets/make-Dixweg8N.js +1 -0
  640. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  641. package/web/dist/assets/marko-DvhNOisQ.js +1 -0
  642. package/web/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  643. package/web/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  644. package/web/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  645. package/web/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  646. package/web/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  647. package/web/dist/assets/matlab-D7qyCx1q.js +1 -0
  648. package/web/dist/assets/mdc-Bm9TpL1X.js +1 -0
  649. package/web/dist/assets/mdx-DQZ5AkYe.js +1 -0
  650. package/web/dist/assets/mermaid-Bk4SNUv9.js +1 -0
  651. package/web/dist/assets/min-dark-BSWPekZh.js +1 -0
  652. package/web/dist/assets/min-light-DDpmG2fV.js +1 -0
  653. package/web/dist/assets/mipsasm-BMqwQI7S.js +1 -0
  654. package/web/dist/assets/mojo-BgCJLMeH.js +1 -0
  655. package/web/dist/assets/monokai-CdkpiU2Y.js +1 -0
  656. package/web/dist/assets/moonbit-CaWjb8XO.js +1 -0
  657. package/web/dist/assets/move-B1IS1UjX.js +1 -0
  658. package/web/dist/assets/narrat-_X_XdTYD.js +1 -0
  659. package/web/dist/assets/nextflow-BJtWHP5T.js +1 -0
  660. package/web/dist/assets/nextflow-groovy-DJMQeKeT.js +1 -0
  661. package/web/dist/assets/nginx-Bhc82uuv.js +1 -0
  662. package/web/dist/assets/night-owl-DhmEMT88.js +1 -0
  663. package/web/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  664. package/web/dist/assets/nim-DXTVBFnF.js +1 -0
  665. package/web/dist/assets/nix-IvuFDN5E.js +1 -0
  666. package/web/dist/assets/nord-Cb4Vim4T.js +1 -0
  667. package/web/dist/assets/nushell-DcLAeLz5.js +1 -0
  668. package/web/dist/assets/objective-c-D1A_Heim.js +1 -0
  669. package/web/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
  670. package/web/dist/assets/ocaml-O90oeIOV.js +1 -0
  671. package/web/dist/assets/odin-B1RWQWA5.js +1 -0
  672. package/web/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
  673. package/web/dist/assets/one-light-D7Lr4KcI.js +1 -0
  674. package/web/dist/assets/openscad-BUDT5pXO.js +1 -0
  675. package/web/dist/assets/pascal-4ZHwLPI5.js +1 -0
  676. package/web/dist/assets/perl-C7veXV9z.js +1 -0
  677. package/web/dist/assets/php-BRiuMnnr.js +1 -0
  678. package/web/dist/assets/pierre-dark-CpLgRqie.js +1 -0
  679. package/web/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
  680. package/web/dist/assets/pierre-dark-soft-kZQmAZld.js +1 -0
  681. package/web/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
  682. package/web/dist/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
  683. package/web/dist/assets/pierre-light-CoaEpmwp.js +1 -0
  684. package/web/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
  685. package/web/dist/assets/pierre-light-soft-lWLdNTOI.js +1 -0
  686. package/web/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
  687. package/web/dist/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
  688. package/web/dist/assets/pkl-ot-7Btpt.js +1 -0
  689. package/web/dist/assets/plastic-DQwYfKfQ.js +1 -0
  690. package/web/dist/assets/plsql-DGHpHOYJ.js +1 -0
  691. package/web/dist/assets/po-BiJDBrnU.js +1 -0
  692. package/web/dist/assets/poimandres-DRFjx7u4.js +1 -0
  693. package/web/dist/assets/polar-C7UOKdEL.js +1 -0
  694. package/web/dist/assets/postcss-BXeXVLqQ.js +1 -0
  695. package/web/dist/assets/powerquery-DNMTfnFr.js +1 -0
  696. package/web/dist/assets/powershell-DshXNtvi.js +1 -0
  697. package/web/dist/assets/prisma-BsRQq5mF.js +1 -0
  698. package/web/dist/assets/prolog-iXnhIJG7.js +1 -0
  699. package/web/dist/assets/proto-DB4EqR-F.js +1 -0
  700. package/web/dist/assets/pug-C5hz5LQ7.js +1 -0
  701. package/web/dist/assets/puppet-CDv2pdJW.js +1 -0
  702. package/web/dist/assets/purescript-9MfHhQsQ.js +1 -0
  703. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  704. package/web/dist/assets/qml-BdUV3aTS.js +1 -0
  705. package/web/dist/assets/qmldir-DCQb3MpD.js +1 -0
  706. package/web/dist/assets/qss-Fe1Jh2GI.js +1 -0
  707. package/web/dist/assets/r-8R7vtdQc.js +1 -0
  708. package/web/dist/assets/racket-DcIDlBhZ.js +1 -0
  709. package/web/dist/assets/raku-B3gFvitq.js +1 -0
  710. package/web/dist/assets/razor-DRL52XO2.js +1 -0
  711. package/web/dist/assets/red-CJ3rzSJv.js +1 -0
  712. package/web/dist/assets/reg-CRGYupPL.js +1 -0
  713. package/web/dist/assets/regexp-Omp9DhTb.js +1 -0
  714. package/web/dist/assets/rel-BtDbiS_P.js +1 -0
  715. package/web/dist/assets/reviews-CUXp47M8.js +1 -0
  716. package/web/dist/assets/riscv-Ckw8ddFX.js +1 -0
  717. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  718. package/web/dist/assets/ron-VUp2lXgN.js +1 -0
  719. package/web/dist/assets/rose-pine-BthvhNj6.js +1 -0
  720. package/web/dist/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
  721. package/web/dist/assets/rose-pine-moon-hon4tzzS.js +1 -0
  722. package/web/dist/assets/rosmsg-CAekHB0j.js +1 -0
  723. package/web/dist/assets/rst-BHX71KW9.js +1 -0
  724. package/web/dist/assets/ruby-B--HzjGU.js +1 -0
  725. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  726. package/web/dist/assets/sas-DrLaYOK_.js +1 -0
  727. package/web/dist/assets/sass-DXrisJhu.js +1 -0
  728. package/web/dist/assets/scala-DKOlJaKm.js +1 -0
  729. package/web/dist/assets/scheme-DQCgrYNe.js +1 -0
  730. package/web/dist/assets/scss-DdSxiZKl.js +1 -0
  731. package/web/dist/assets/sdbl-bTVj8UrX.js +1 -0
  732. package/web/dist/assets/shaderlab-TOUzSsQk.js +1 -0
  733. package/web/dist/assets/shellscript-DwcUjJBL.js +1 -0
  734. package/web/dist/assets/shellsession-CPZkydE6.js +1 -0
  735. package/web/dist/assets/slack-dark-DnToyrRv.js +1 -0
  736. package/web/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  737. package/web/dist/assets/smalltalk-B16xEiuN.js +1 -0
  738. package/web/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  739. package/web/dist/assets/solarized-dark-DV17i1UV.js +1 -0
  740. package/web/dist/assets/solarized-light-DSh2HLQt.js +1 -0
  741. package/web/dist/assets/solidity-CKzVLygQ.js +1 -0
  742. package/web/dist/assets/soy-Br5FhD7c.js +1 -0
  743. package/web/dist/assets/sparql-D_iOobhT.js +1 -0
  744. package/web/dist/assets/splunk-BC2Px7Mm.js +1 -0
  745. package/web/dist/assets/sql-DNssxck8.js +1 -0
  746. package/web/dist/assets/ssh-config-BgfXC-Er.js +1 -0
  747. package/web/dist/assets/stata-DXn1tqOr.js +1 -0
  748. package/web/dist/assets/stylus-B6D30XZt.js +1 -0
  749. package/web/dist/assets/surfaces-Dlg1xLbg.js +1 -0
  750. package/web/dist/assets/surrealql-IeLNQw0f.js +1 -0
  751. package/web/dist/assets/svelte-DOdLCIlh.js +1 -0
  752. package/web/dist/assets/swift-DonLKvLd.js +1 -0
  753. package/web/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  754. package/web/dist/assets/system-verilog-DJ5XKQeo.js +1 -0
  755. package/web/dist/assets/systemd-BxMlprV5.js +1 -0
  756. package/web/dist/assets/talonscript-CohzipZa.js +1 -0
  757. package/web/dist/assets/tasl-DMoTqEGO.js +1 -0
  758. package/web/dist/assets/tcl-CZd0xW_V.js +1 -0
  759. package/web/dist/assets/templ-CIwIngms.js +1 -0
  760. package/web/dist/assets/terraform-DswuEJGm.js +1 -0
  761. package/web/dist/assets/tex-D8QMumu5.js +1 -0
  762. package/web/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  763. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  764. package/web/dist/assets/ts-tags-BMVY4q-l.js +1 -0
  765. package/web/dist/assets/tsv-sltzmVWM.js +1 -0
  766. package/web/dist/assets/tsx-5Eka4NBX.js +1 -0
  767. package/web/dist/assets/turtle-ByJddavk.js +1 -0
  768. package/web/dist/assets/twig-C8o_5mgw.js +1 -0
  769. package/web/dist/assets/typescript-DOu2WMV5.js +1 -0
  770. package/web/dist/assets/typespec-BRdr0IET.js +1 -0
  771. package/web/dist/assets/typst-DI99ib-x.js +1 -0
  772. package/web/dist/assets/v-DETTlOr0.js +1 -0
  773. package/web/dist/assets/vala-zf12oZj6.js +1 -0
  774. package/web/dist/assets/vb-Djn5o6TS.js +1 -0
  775. package/web/dist/assets/verilog-CiiDBU1e.js +1 -0
  776. package/web/dist/assets/vesper-DdrHHSXu.js +1 -0
  777. package/web/dist/assets/vhdl-BroJfC0k.js +1 -0
  778. package/web/dist/assets/viml-DvXPmvsu.js +1 -0
  779. package/web/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  780. package/web/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  781. package/web/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  782. package/web/dist/assets/vue-BU18DNDL.js +1 -0
  783. package/web/dist/assets/vue-html-BeluIYX0.js +1 -0
  784. package/web/dist/assets/vue-vine-DGUAbOCX.js +1 -0
  785. package/web/dist/assets/vyper-CgoNMtux.js +1 -0
  786. package/web/dist/assets/wasm-BnjxR4X6.js +1 -0
  787. package/web/dist/assets/wasm-ByWQv1Qj.js +1 -0
  788. package/web/dist/assets/wenyan-C8pVoKbM.js +1 -0
  789. package/web/dist/assets/wgsl-BsKzXJz4.js +1 -0
  790. package/web/dist/assets/wikitext-ClFFjSW2.js +1 -0
  791. package/web/dist/assets/wit-DdvCle-K.js +1 -0
  792. package/web/dist/assets/wolfram-DLL8P-h_.js +1 -0
  793. package/web/dist/assets/worker-05jVtNwz.js +160 -0
  794. package/web/dist/assets/xml-DIqSwXR3.js +1 -0
  795. package/web/dist/assets/xsl-Ct_-YIAy.js +1 -0
  796. package/web/dist/assets/yaml-DTtCYNlS.js +1 -0
  797. package/web/dist/assets/zenscript-BnlCZFoB.js +1 -0
  798. package/web/dist/assets/zig-CMLA9XwU.js +1 -0
  799. package/web/dist/icons/neondeck-icon-192.png +0 -0
  800. package/web/dist/icons/neondeck-icon-512.png +0 -0
  801. package/web/dist/icons/neondeck-icon.svg +41 -0
  802. package/web/dist/icons/neondeck-maskable-512.png +0 -0
  803. package/web/dist/index.html +27 -0
  804. package/web/dist/manifest.webmanifest +28 -0
@@ -0,0 +1,2970 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BVBpGdXr.js","assets/rolldown-runtime-QTnfLwEv.js","assets/html-C8UlPnhE.js","assets/javascript-CUt1pgmJ.js","assets/css-DJp_X0uY.js","assets/angular-ts-BfdufMKP.js","assets/scss-DdSxiZKl.js","assets/apl-DWBSSoBH.js","assets/xml-DIqSwXR3.js","assets/java-CGc3VwQr.js","assets/json-Bg9ijW3F.js","assets/astro-3LtMP0Sq.js","assets/typescript-DOu2WMV5.js","assets/postcss-BXeXVLqQ.js","assets/tsx-5Eka4NBX.js","assets/blade-llJRbbtR.js","assets/html-derivative-CY6NRz-J.js","assets/sql-DNssxck8.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/c-Wt1voDr2.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-x_HIyl2P.js","assets/coffee-CThvmt4R.js","assets/cpp-NtAeskI3.js","assets/regexp-Omp9DhTb.js","assets/glsl-Dv5r7kPw.js","assets/crystal-DNu_sX0G.js","assets/shellscript-DwcUjJBL.js","assets/edge-ozw5tpLl.js","assets/elixir-VhA6FeZt.js","assets/elm-dREJmIFz.js","assets/erb-CIg6G69l.js","assets/ruby-B--HzjGU.js","assets/haml-zE6W3STP.js","assets/graphql-CB4jsw2E.js","assets/jsx-CY6oMTks.js","assets/lua-BjLEUjKY.js","assets/yaml-DTtCYNlS.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-B44mJPta.js","assets/glimmer-js-vH_gHG0-.js","assets/glimmer-ts--abOzSAQ.js","assets/hack-DvEYX148.js","assets/handlebars-CzBR2SDs.js","assets/http-Cyd7bS_S.js","assets/hurl-CWPsiEpf.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-CD-Z-FLd.js","assets/jison-imPNup1l.js","assets/julia-Dc3O-irA.js","assets/r-8R7vtdQc.js","assets/just-BhOq_Kbv.js","assets/perl-C7veXV9z.js","assets/latex-Cu4Y1d5w.js","assets/tex-D8QMumu5.js","assets/liquid-CvXMrjlQ.js","assets/marko-DvhNOisQ.js","assets/less-DVTAwKKz.js","assets/mdc-Bm9TpL1X.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-Bhc82uuv.js","assets/nim-DXTVBFnF.js","assets/php-BRiuMnnr.js","assets/pug-C5hz5LQ7.js","assets/qml-BdUV3aTS.js","assets/razor-DRL52XO2.js","assets/csharp-oqKa8noW.js","assets/rst-BHX71KW9.js","assets/cmake-Bj61d0ZC.js","assets/sas-DrLaYOK_.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-CPZkydE6.js","assets/soy-Br5FhD7c.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-DXn1tqOr.js","assets/surrealql-IeLNQw0f.js","assets/svelte-DOdLCIlh.js","assets/templ-CIwIngms.js","assets/go-rLFTqkRN.js","assets/ts-tags-BMVY4q-l.js","assets/twig-C8o_5mgw.js","assets/vue-BU18DNDL.js","assets/vue-html-BeluIYX0.js","assets/vue-vine-DGUAbOCX.js","assets/stylus-B6D30XZt.js","assets/xsl-Ct_-YIAy.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-QTnfLwEv.js";import{C as r,G as i,a,c as o,f as s,i as c,n as l,o as u,r as d,s as f,t as p,tt as m,y as h}from"./ccount-CMHa3wy6.js";var g=t(m(),1),_=i(),v={}.hasOwnProperty;function y(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&v.call(t,e)){let n=String(t[e]);i=v.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var b=/^diff --git a\/(.+?) b\/(.+)$/gm;function x(e){return!!(e&&e.trim().length>0)}function S(e){if(!e)return[];let t=[];for(let n of e.matchAll(b)){let e=n[2]??n[1];e&&t.push(e)}return[...new Set(t)]}function C(e){let t=e??``;if(!x(t))return[];let n=[...t.matchAll(b)];return n.length===0?[{additions:0,deletions:0,path:`patch.diff`,status:`M`,patch:null,message:`Patch is not in canonical git diff format.`}]:n.map((e,r)=>{let i=e.index??0,a=n[r+1]?.index??t.length,o=t.slice(i,a).trimEnd(),s=e[2]??e[1]??`patch.diff`;return{additions:D(o,`+`),binary:/Binary files .+ differ/.test(o),deletions:D(o,`-`),generatedLike:!1,path:s,status:te(o),patch:`${o}\n`,truncated:!1}})}function ee(e){return`${e} file${e===1?``:`s`}`}function w(e){return e.binary?`binary`:`+${Number.isFinite(e.additions)?e.additions:0} -${Number.isFinite(e.deletions)?e.deletions:0}`}function T(e){return e.find(e=>x(e.patch))?.path??e[0]?.path}function E(e){return e.binary?`binary file`:e.truncated?`patch truncated`:x(e.patch)?null:e.message??`No patch available for this file.`}function D(e,t){let n=t===`+`?`+++`:`---`;return e.split(`
3
+ `).filter(e=>e.startsWith(t)&&!e.startsWith(n)).length}function te(e){return/^new file mode /m.test(e)?`A`:/^deleted file mode /m.test(e)?`D`:/^---\s+\/dev\/null$/m.test(e)?`A`:/^\+\+\+\s+\/dev\/null$/m.test(e)?`D`:/^rename from /m.test(e)?`R`:`M`}var O=`file-tree-container`,k=`data-file-tree-style`,A=`data-file-tree-unsafe-css`,ne=`data-file-tree-scrollbar-measure`,j=`data-file-tree-scrollbar-gutter-measured`,re=`--trees-scrollbar-gutter-measured`,ie=`header`,ae=`context-menu`,oe=`context-menu-trigger`,se=typeof window>`u`?g.useEffect:g.useLayoutEffect;function ce(e,t,n){let r=e==null?null:(0,_.jsx)(`div`,{slot:ie,children:e}),i=t!=null&&n!=null?(0,_.jsx)(`div`,{slot:ae,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,_.jsxs)(_.Fragment,{children:[r,i]})}function le(e,t){return typeof window>`u`&&t!=null?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,_.jsx)(_.Fragment,{children:e})}function ue(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement||e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function de(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function fe({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useRef)(n.getComposition()),d=(0,g.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,g.useCallback)(()=>{s(null)},[]),m=(0,g.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,v=(0,g.useMemo)(()=>de(h,e,f,p,m),[h,p,m,f,e]),y=(0,g.useCallback)(e=>{l(e)},[]);(0,g.useEffect)(()=>{f||s(null)},[f]),se(()=>{n.setComposition(v)},[v,n]),se(()=>{if(c!=null)return r!=null&&ue(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let b=le(ce(e,i,o),r),x=t??r?.id,S={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,_.jsx)(O,{...a,id:x,ref:y,style:S,suppressHydrationWarning:r!=null,children:b})}var pe=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
4
+ <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
5
+ <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
6
+ </symbol>
7
+ <symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
8
+ <circle cx="3" cy="3" r="3" />
9
+ </symbol>
10
+ <symbol id="file-tree-icon-file" viewBox="0 0 16 16">
11
+ <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
12
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
13
+ </symbol>
14
+ <symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
15
+ <path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
16
+ </symbol>
17
+ <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
18
+ <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
19
+ </symbol>
20
+ </svg>`,me=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
21
+ <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
22
+ <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
23
+ </symbol>`,he=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
24
+ <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
25
+ </symbol>`,ge=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
26
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
27
+ <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
28
+ </symbol>`,_e=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
29
+ <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
30
+ </symbol>`,ve=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
31
+ <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
32
+ <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
33
+ </symbol>`,ye=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
34
+ <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
35
+ <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
36
+ <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
37
+ </symbol>`,be=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
38
+ <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
39
+ </symbol>`,xe=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
40
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
41
+ </symbol>`,Se=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
42
+ <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
43
+ </symbol>`,Ce=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
44
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
45
+ </symbol>`,we=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
46
+ <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
47
+ <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
48
+ </symbol>`,Te=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
49
+ <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
50
+ <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
51
+ <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
52
+ </symbol>`,Ee=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
53
+ <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
54
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
55
+ </symbol>`,De=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
56
+ <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
57
+ <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
58
+ </symbol>`,Oe=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
59
+ <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
60
+ <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
61
+ </symbol>`,ke=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
62
+ <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
63
+ </symbol>`,Ae=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
64
+ <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
65
+ </symbol>`,je=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
66
+ <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
67
+ </symbol>`,Me=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
68
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
69
+ </symbol>`,M=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
70
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
71
+ <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
72
+ </symbol>`,Ne=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
73
+ <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
74
+ <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
75
+ </symbol>`,Pe=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
76
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
77
+ <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
78
+ </symbol>`,Fe=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
79
+ <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
80
+ </symbol>`,Ie=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
81
+ <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
82
+ </symbol>`,Le=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
83
+ <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
84
+ <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
85
+ </symbol>`,Re=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
86
+ <defs>
87
+ <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
88
+ <stop stop-color="currentColor"/>
89
+ <stop offset="1" stop-color="currentColor" stop-opacity="0"/>
90
+ </linearGradient>
91
+ </defs>
92
+ <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
93
+ <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
94
+ <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
95
+ </symbol>`,ze=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
96
+ <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
97
+ <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
98
+ </symbol>`,Be=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
99
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
100
+ </symbol>`,Ve=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
101
+ <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
102
+ </symbol>`,He=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
103
+ <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
104
+ <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
105
+ <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
106
+ <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
107
+ </symbol>`,Ue=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
108
+ <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
109
+ <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
110
+ </symbol>`,We=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
111
+ <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
112
+ <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
113
+ </symbol>`,Ge=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
114
+ <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
115
+ </symbol>`,Ke=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
116
+ <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
117
+ </symbol>`,qe=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
118
+ <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
119
+ </symbol>`,Je=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
120
+ <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
121
+ <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
122
+ </symbol>`,Ye=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
123
+ <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
124
+ </symbol>`,Xe=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
125
+ <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
126
+ <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
127
+ </symbol>`,Ze=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
128
+ <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
129
+ <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
130
+ </symbol>`,Qe=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
131
+ <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
132
+ </symbol>`,$e=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
133
+ <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
134
+ <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
135
+ </symbol>`,et=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
136
+ <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
137
+ </symbol>`,tt=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
138
+ <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
139
+ </symbol>`,nt=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
140
+ <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
141
+ <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
142
+ </symbol>`,rt=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
143
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
144
+ <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
145
+ </symbol>`,it=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
146
+ <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
147
+ </symbol>`,at=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
148
+ <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
149
+ <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
150
+ <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
151
+ </symbol>`,ot=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
152
+ <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
153
+ <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
154
+ </symbol>`,st=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
155
+ <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
156
+ <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
157
+ <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
158
+ </symbol>`,ct=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
159
+ <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
160
+ <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
161
+ </symbol>`,lt=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
162
+ <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
163
+ </symbol>`,ut=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
164
+ <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
165
+ <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
166
+ </symbol>`,dt=[ge,xe,Ce,we,Te,Ee,ke,Ae,je,M,Ne,Pe,Fe,Ie,Le,Ue,Ge,Ke,Qe,$e,nt,rt,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
167
+ <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
168
+ <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
169
+ </symbol>`],ft=[me,he,_e,ve,ye,be,Se,De,Oe,Me,Re,ze,Be,Ve,He,We,qe,Je,Ye,Xe,Ze,et,tt,it,at,ot,st,ct,lt,ut];function pt(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
170
+ `)}\n</svg>`)}var mt=pt(pe,dt),N={minimal:pe,standard:mt,complete:pt(mt,ft)},P={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},ht={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},gt={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},_t=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),vt=new Set([`complete`]);function yt(e){return N[e===`none`?`minimal`:e]}function bt(e){return`file-tree-builtin-${e}`}function xt(e){return e!==`none`&&vt.has(e)}function St(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=P[t.toLowerCase()];if(i!=null&&(r||_t.has(i)))return i;for(let e of n){if(r){let t=gt[e];if(t!=null)return t}let t=ht[e];if(t!=null&&(r||_t.has(t)))return t}return`default`}function Ct(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function F(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Ct(e)?`none`:`complete`),colored:e.colored??!0}}var wt={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Tt(e,t){if(typeof e==`number`)return{itemHeight:t??wt.default.itemHeight,factor:e};let n=wt[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Et=wt.default.itemHeight,Dt=`@layer base {
171
+ :host {
172
+ --trees-accent: var(--trees-accent-override, #009fff);
173
+ --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
174
+ --trees-fg-muted: var(--trees-fg-muted-override, var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a)));
175
+ --trees-bg: var(--trees-bg-override, var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415)));
176
+ --trees-bg-muted: var(--trees-bg-muted-override, var(--trees-theme-list-hover-bg, light-dark(color-mix(in lab,
177
+ var(--trees-accent) var(--trees-bg-alpha-light, 8%),
178
+ var(--trees-bg)), color-mix(in lab,
179
+ var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
180
+ var(--trees-bg)))));
181
+ --trees-input-bg: var(--trees-input-bg-override, light-dark(#f8f8f8, #070707));
182
+ --trees-added-light: #16a994;
183
+ --trees-added-dark: #00cab1;
184
+ --trees-ignored-light: #adadb1;
185
+ --trees-ignored-dark: #4a4a4e;
186
+ --trees-modified-light: #1ca1c7;
187
+ --trees-modified-dark: #08c0ef;
188
+ --trees-renamed-light: #d5a910;
189
+ --trees-renamed-dark: #ffd452;
190
+ --trees-untracked-light: #16a994;
191
+ --trees-untracked-dark: #00cab1;
192
+ --trees-deleted-light: #ff2e3f;
193
+ --trees-deleted-dark: #ff6762;
194
+ --trees-border-color: var(--trees-border-color-override, var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707)));
195
+ --trees-indent-guide-bg: var(--trees-indent-guide-bg-override, color-mix(in lab, var(--trees-fg-muted) 25%, transparent));
196
+ --trees-density: var(--trees-density-override, 1);
197
+ --trees-border-radius: var(--trees-border-radius-override, calc(6px * var(--trees-density)));
198
+ --trees-font-family: var(--trees-font-family-override, system-ui);
199
+ --trees-font-size: var(--trees-font-size-override, 13px);
200
+ --trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
201
+ --trees-font-weight-semibold: var(--trees-font-weight-semibold-override, 600);
202
+ --trees-focus-ring-color: var(--trees-focus-ring-color-override, var(--trees-theme-focus-ring, var(--trees-accent)));
203
+ --trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
204
+ --trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
205
+ --trees-search-fg: var(--trees-search-fg-override, var(--trees-theme-input-fg, var(--trees-fg)));
206
+ --trees-search-font-weight: var(--trees-search-font-weight-override, 600);
207
+ --trees-search-bg: var(--trees-search-bg-override, var(--trees-theme-input-bg, var(--trees-input-bg)));
208
+ --trees-scrollbar-thumb: var(--trees-scrollbar-thumb-override, var(--trees-theme-scrollbar-thumb, color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))));
209
+ --trees-selected-fg: var(--trees-selected-fg-override, var(--trees-theme-list-active-selection-fg, var(--trees-fg)));
210
+ --trees-selected-bg: var(--trees-selected-bg-override, var(--trees-theme-list-active-selection-bg, light-dark(color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)), color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg)))));
211
+ --trees-selected-focused-border-color: var(--trees-selected-focused-border-color-override, var(--trees-theme-focus-ring, var(--trees-accent)));
212
+ --trees-status-added: var(--trees-status-added-override, var(--trees-theme-git-added-fg, light-dark(var(--trees-added-light), var(--trees-added-dark))));
213
+ --trees-status-ignored: var(--trees-status-ignored-override, var(--trees-theme-git-ignored-fg, light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))));
214
+ --trees-status-modified: var(--trees-status-modified-override, var(--trees-theme-git-modified-fg, light-dark(var(--trees-modified-light), var(--trees-modified-dark))));
215
+ --trees-status-renamed: var(--trees-status-renamed-override, var(--trees-theme-git-renamed-fg, light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))));
216
+ --trees-status-untracked: var(--trees-status-untracked-override, var(--trees-theme-git-untracked-fg, light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))));
217
+ --trees-status-deleted: var(--trees-status-deleted-override, var(--trees-theme-git-deleted-fg, light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))));
218
+ --trees-git-modified-color: var(--trees-git-modified-color-override, var(--trees-status-modified));
219
+ --trees-git-added-color: var(--trees-git-added-color-override, var(--trees-status-added));
220
+ --trees-git-ignored-color: var(--trees-git-ignored-color-override, var(--trees-status-ignored));
221
+ --trees-git-deleted-color: var(--trees-git-deleted-color-override, var(--trees-status-deleted));
222
+ --trees-git-renamed-color: var(--trees-git-renamed-color-override, var(--trees-status-renamed));
223
+ --trees-git-untracked-color: var(--trees-git-untracked-color-override, var(--trees-status-untracked));
224
+ --trees-icon-gray: light-dark(#84848a, #adadb1);
225
+ --trees-icon-red: light-dark(#d52c36, #ff6762);
226
+ --trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
227
+ --trees-icon-orange: light-dark(#d47628, #ffa359);
228
+ --trees-icon-yellow: light-dark(#d5a910, #ffd452);
229
+ --trees-icon-green: light-dark(#199f43, #5ecc71);
230
+ --trees-icon-teal: light-dark(#17a5af, #64d1db);
231
+ --trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
232
+ --trees-icon-blue: light-dark(#1a85d4, #69b1ff);
233
+ --trees-icon-indigo: light-dark(#693acf, #9d6afb);
234
+ --trees-icon-purple: light-dark(#a631be, #d568ea);
235
+ --trees-icon-pink: light-dark(#d32a61, #ff678d);
236
+ --trees-icon-mauve: light-dark(#594c5b, #79697b);
237
+ --trees-file-icon-color-default: var(--trees-file-icon-color, var(--trees-icon-gray));
238
+ --trees-file-icon-color-astro: var(--trees-file-icon-color, var(--trees-icon-purple));
239
+ --trees-file-icon-color-babel: var(--trees-file-icon-color, var(--trees-icon-yellow));
240
+ --trees-file-icon-color-bash: var(--trees-file-icon-color, var(--trees-icon-green));
241
+ --trees-file-icon-color-biome: var(--trees-file-icon-color, var(--trees-icon-blue));
242
+ --trees-file-icon-color-bootstrap: var(--trees-file-icon-color, var(--trees-icon-indigo));
243
+ --trees-file-icon-color-browserslist: var(--trees-file-icon-color, var(--trees-icon-yellow));
244
+ --trees-file-icon-color-bun: var(--trees-file-icon-color, var(--trees-icon-mauve));
245
+ --trees-file-icon-color-c: var(--trees-file-icon-color, var(--trees-icon-blue));
246
+ --trees-file-icon-color-cpp: var(--trees-file-icon-color, var(--trees-icon-blue));
247
+ --trees-file-icon-color-claude: var(--trees-file-icon-color, var(--trees-icon-orange));
248
+ --trees-file-icon-color-css: var(--trees-file-icon-color, var(--trees-icon-indigo));
249
+ --trees-file-icon-color-database: var(--trees-file-icon-color, var(--trees-icon-purple));
250
+ --trees-file-icon-color-docker: var(--trees-file-icon-color, var(--trees-icon-blue));
251
+ --trees-file-icon-color-eslint: var(--trees-file-icon-color, var(--trees-icon-indigo));
252
+ --trees-file-icon-color-git: var(--trees-file-icon-vermilion, var(--trees-icon-vermilion));
253
+ --trees-file-icon-color-go: var(--trees-file-icon-color, var(--trees-icon-cyan));
254
+ --trees-file-icon-color-graphql: var(--trees-file-icon-color, var(--trees-icon-pink));
255
+ --trees-file-icon-color-html: var(--trees-file-icon-color, var(--trees-icon-orange));
256
+ --trees-file-icon-color-image: var(--trees-file-icon-color, var(--trees-icon-pink));
257
+ --trees-file-icon-color-javascript: var(--trees-file-icon-color, var(--trees-icon-yellow));
258
+ --trees-file-icon-color-json: var(--trees-file-icon-color, var(--trees-icon-orange));
259
+ --trees-file-icon-color-markdown: var(--trees-file-icon-color, var(--trees-icon-green));
260
+ --trees-file-icon-color-mcp: var(--trees-file-icon-color, var(--trees-icon-teal));
261
+ --trees-file-icon-color-npm: var(--trees-file-icon-color, var(--trees-icon-red));
262
+ --trees-file-icon-color-oxc: var(--trees-file-icon-cyan, var(--trees-icon-cyan));
263
+ --trees-file-icon-color-postcss: var(--trees-file-icon-color, var(--trees-icon-red));
264
+ --trees-file-icon-color-prettier: var(--trees-file-icon-color, var(--trees-icon-teal));
265
+ --trees-file-icon-color-python: var(--trees-file-icon-color, var(--trees-icon-blue));
266
+ --trees-file-icon-color-react: var(--trees-file-icon-color, var(--trees-icon-cyan));
267
+ --trees-file-icon-color-ruby: var(--trees-file-icon-color, var(--trees-icon-red));
268
+ --trees-file-icon-color-rust: var(--trees-file-icon-color, var(--trees-icon-orange));
269
+ --trees-file-icon-color-sass: var(--trees-file-icon-color, var(--trees-icon-pink));
270
+ --trees-file-icon-color-svg: var(--trees-file-icon-color, var(--trees-icon-orange));
271
+ --trees-file-icon-color-svelte: var(--trees-file-icon-color, var(--trees-icon-red));
272
+ --trees-file-icon-color-svgo: var(--trees-file-icon-color, var(--trees-icon-green));
273
+ --trees-file-icon-color-swift: var(--trees-file-icon-color, var(--trees-icon-orange));
274
+ --trees-file-icon-color-table: var(--trees-file-icon-color, var(--trees-icon-teal));
275
+ --trees-file-icon-color-text: var(--trees-file-icon-color, var(--trees-icon-gray));
276
+ --trees-file-icon-color-tailwind: var(--trees-file-icon-color, var(--trees-icon-cyan));
277
+ --trees-file-icon-color-terraform: var(--trees-file-icon-color, var(--trees-icon-indigo));
278
+ --trees-file-icon-color-typescript: var(--trees-file-icon-color, var(--trees-icon-blue));
279
+ --trees-file-icon-color-vite: var(--trees-file-icon-color, var(--trees-icon-purple));
280
+ --trees-file-icon-color-vscode: var(--trees-file-icon-color, var(--trees-icon-blue));
281
+ --trees-file-icon-color-vue: var(--trees-file-icon-color, var(--trees-icon-green));
282
+ --trees-file-icon-color-wasm: var(--trees-file-icon-color, var(--trees-icon-indigo));
283
+ --trees-file-icon-color-webpack: var(--trees-file-icon-color, var(--trees-icon-blue));
284
+ --trees-file-icon-color-yml: var(--trees-file-icon-color, var(--trees-icon-red));
285
+ --trees-file-icon-color-zig: var(--trees-file-icon-color, var(--trees-icon-orange));
286
+ --trees-file-icon-color-zip: var(--trees-file-icon-color, var(--trees-icon-orange));
287
+ --trees-level-gap: var(--trees-level-gap-override, calc(8px * var(--trees-density)));
288
+ --trees-item-padding-x: var(--trees-item-padding-x-override, calc(8px * var(--trees-density)));
289
+ --trees-item-margin-x: var(--trees-item-margin-x-override, calc(2px * var(--trees-density)));
290
+ --trees-item-row-gap: var(--trees-item-row-gap-override, calc(6px * var(--trees-density)));
291
+ --trees-icon-width: var(--trees-icon-width-override, 16px);
292
+ --trees-icon-nudge: var(--trees-icon-nudge-override, calc(1px * var(--trees-density)));
293
+ --trees-row-height: var(--trees-item-height, 30px);
294
+ --trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
295
+ --trees-action-lane-width: var(--trees-action-lane-width-override, calc(var(--trees-icon-width) + 2px));
296
+ --trees-context-menu-trigger-inline-offset: calc(var(--trees-padding-inline) + var(--trees-item-padding-x) -
297
+ var(--trees-focus-ring-width));
298
+ --trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
299
+ --trees-padding-inline: var(--trees-padding-inline-override, 16px);
300
+ color-scheme: light dark;
301
+ font-size: var(--trees-font-size);
302
+ color: var(--trees-fg);
303
+ background-color: var(--trees-bg);
304
+ --truncate-marker-background-color: var(--trees-bg);
305
+ --truncate-marker-background-overlay-color: transparent;
306
+ font-family: var(--trees-font-family);
307
+ font-weight: var(--trees-font-weight-regular);
308
+ flex-direction: column;
309
+ display: flex;
310
+ }
311
+
312
+ :host([data-file-tree-virtualized="true"]) {
313
+ height: 100%;
314
+ overflow: hidden;
315
+ }
316
+
317
+ [data-file-tree-virtualized-wrapper="true"], [data-file-tree-virtualized-root="true"] {
318
+ flex-direction: column;
319
+ height: 100%;
320
+ display: flex;
321
+ overflow: hidden;
322
+ }
323
+
324
+ [data-file-tree-virtualized-scroll="true"], [data-file-tree-scrollbar-measure="true"] {
325
+ --trees-scrollbar-thumb-current: transparent;
326
+ scrollbar-gutter: stable;
327
+ overflow-y: auto;
328
+
329
+ &:hover {
330
+ --trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
331
+ }
332
+
333
+ &::-webkit-scrollbar {
334
+ width: var(--trees-scrollbar-gutter);
335
+ height: var(--trees-scrollbar-gutter);
336
+ }
337
+
338
+ &::-webkit-scrollbar-track {
339
+ background: none;
340
+ }
341
+
342
+ &::-webkit-scrollbar-thumb {
343
+ background-color: var(--trees-scrollbar-thumb-current);
344
+ border-radius: calc(var(--trees-scrollbar-gutter) / 2);
345
+ background-clip: content-box;
346
+ border: 1px solid #0000;
347
+ }
348
+
349
+ &::-webkit-scrollbar-corner {
350
+ background-color: #0000;
351
+ }
352
+ }
353
+
354
+ [data-file-tree-scrollbar-measure="true"] {
355
+ visibility: hidden;
356
+ pointer-events: none;
357
+ width: 100px;
358
+ height: 100px;
359
+ position: absolute;
360
+ top: 0;
361
+ left: 0;
362
+ }
363
+
364
+ @supports ((-moz-appearance: none)) {
365
+ [data-file-tree-virtualized-scroll="true"], [data-file-tree-scrollbar-measure="true"] {
366
+ scrollbar-width: thin;
367
+ scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
368
+ }
369
+ }
370
+
371
+ [data-file-tree-virtualized-scroll="true"] {
372
+ min-height: 0;
373
+ padding-inline: max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
374
+ 0px)
375
+ /* NOTE(amadeus): We can assume that all Webkit based browser gutters
376
+ * will align to the value of '--trees-scrollbar-gutter', however if not, then
377
+ * \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
378
+ * hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
379
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
380
+ */
381
+ max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x) -
382
+ var(--trees-scrollbar-gutter-measured, var(--trees-scrollbar-gutter))),
383
+ 0px);
384
+ flex: 1 1 0;
385
+ position: relative;
386
+ overflow-y: auto;
387
+ }
388
+
389
+ @supports ((-moz-appearance: none)) {
390
+ [data-file-tree-virtualized-scroll="true"] {
391
+ padding-inline: max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
392
+ 0px)
393
+ /* NOTE(amadeus): However on Firefox it can vary a little bit, but most
394
+ * likely the majority of cases will default to a 0px width scrollbar lets
395
+ * inherit that first to avoid SSR jumps. In non-SSR'd environments
396
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
397
+ */
398
+ max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x) -
399
+ var(--trees-scrollbar-gutter-measured, 0px)),
400
+ 0px);
401
+ }
402
+ }
403
+
404
+ [data-file-tree-sticky-overlay="true"] {
405
+ z-index: 4;
406
+ pointer-events: none;
407
+ height: 0;
408
+ position: sticky;
409
+ top: 0;
410
+ overflow: visible;
411
+ }
412
+
413
+ [data-file-tree-virtualized-root="true"][data-scroll-at-top="true"]:not([data-overlay-reveal]) [data-file-tree-sticky-overlay="true"] {
414
+ visibility: hidden;
415
+ }
416
+
417
+ [data-file-tree-sticky-overlay-content="true"] {
418
+ background-color: var(--trees-bg);
419
+ pointer-events: none;
420
+ position: relative;
421
+ }
422
+
423
+ [data-file-tree-virtualized-list="true"] {
424
+ background-color: var(--trees-bg);
425
+ overflow-anchor: none;
426
+ width: 100%;
427
+ min-height: 100%;
428
+ position: relative;
429
+
430
+ &[data-is-scrolling] {
431
+ pointer-events: none;
432
+ }
433
+ }
434
+
435
+ [data-file-tree-virtualized-sticky-offset="true"] {
436
+ contain: layout size;
437
+ }
438
+
439
+ [data-file-tree-virtualized-sticky="true"] {
440
+ isolation: isolate;
441
+ will-change: transform;
442
+ flex-direction: column;
443
+ width: 100%;
444
+ display: flex;
445
+ position: sticky;
446
+ top: 0;
447
+ }
448
+
449
+ [data-file-tree-search-container] {
450
+ padding: 0;
451
+ padding-inline: var(--trees-padding-inline);
452
+ margin-bottom: var(--trees-item-row-gap);
453
+ display: flex;
454
+ }
455
+
456
+ [data-file-tree-search-input] {
457
+ --trees-focus-ring-width: 2px;
458
+ font-family: var(--trees-font-family);
459
+ font-size: var(--trees-font-size);
460
+ height: var(--trees-row-height);
461
+ padding-inline: var(--trees-item-padding-x);
462
+ line-height: var(--trees-row-height);
463
+ color: var(--trees-search-fg);
464
+ background-color: var(--trees-search-bg);
465
+ border: 1px solid var(--trees-border-color);
466
+ border-radius: var(--trees-border-radius);
467
+ outline: none;
468
+ flex: 1;
469
+ margin-block: 1px;
470
+
471
+ &::placeholder {
472
+ color: color-mix(in lab,
473
+ var(--trees-search-fg) 65%,
474
+ var(--trees-search-bg));
475
+ }
476
+
477
+ &:focus-visible, &[data-file-tree-search-input-fake-focus="true"] {
478
+ outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
479
+ outline-offset: var(--trees-focus-ring-offset);
480
+ }
481
+ }
482
+
483
+ [role="tree"] {
484
+ gap: var(--trees-gap-override, 0);
485
+ flex-direction: column;
486
+ display: flex;
487
+ position: relative;
488
+ }
489
+
490
+ [data-type="item"] {
491
+ color: inherit;
492
+ font-family: var(--trees-font-family);
493
+ font-size: var(--trees-font-size);
494
+ text-align: start;
495
+ background-color: var(--trees-bg);
496
+ padding: 0 var(--trees-item-padding-x);
497
+ margin: 0 var(--trees-item-margin-x);
498
+ cursor: pointer;
499
+ user-select: none;
500
+ -webkit-touch-callout: none;
501
+ touch-action: manipulation;
502
+ flex: 0 0 var(--trees-row-height);
503
+ height: var(--trees-row-height);
504
+ line-height: var(--trees-row-height);
505
+ align-items: center;
506
+ gap: var(--trees-item-row-gap);
507
+ border-radius: var(--trees-border-radius);
508
+ --truncate-marker-background-color: var(--trees-bg);
509
+ --truncate-marker-background-overlay-color: transparent;
510
+ --truncate-marker-block-inset: 0px;
511
+ border: none;
512
+ outline: none;
513
+ display: flex;
514
+ position: relative;
515
+
516
+ &:hover, &[data-item-context-hover="true"] {
517
+ background-color: var(--trees-bg-muted);
518
+ --truncate-marker-background-overlay-color: var(--trees-bg-muted);
519
+ }
520
+
521
+ &[data-item-focused="true"], &:focus-visible {
522
+ z-index: 2;
523
+
524
+ & [data-item-flattened-subitems] {
525
+ --truncate-marker-block-inset: var(--trees-focus-ring-width);
526
+ }
527
+
528
+ &:before {
529
+ content: "";
530
+ border-radius: var(--trees-border-radius);
531
+ outline: var(--trees-focus-ring-width) solid
532
+ var(--trees-focus-ring-color);
533
+ outline-offset: var(--trees-focus-ring-offset);
534
+ pointer-events: none;
535
+ display: block;
536
+ position: absolute;
537
+ inset: 0;
538
+ }
539
+
540
+ &[data-item-selected="true"]:before {
541
+ outline-color: var(--trees-selected-focused-border-color);
542
+ }
543
+ }
544
+
545
+ &[data-item-selected="true"] {
546
+ color: var(--trees-selected-fg);
547
+ background-color: var(--trees-selected-bg);
548
+ --truncate-marker-background-overlay-color: var(--trees-selected-bg);
549
+ z-index: 3;
550
+
551
+ & [data-item-section="icon"] {
552
+ color: var(--trees-selected-fg);
553
+ }
554
+ }
555
+
556
+ &[data-item-search-match="true"] {
557
+ font-weight: var(--trees-search-font-weight);
558
+ }
559
+ }
560
+
561
+ [data-type="item"][data-file-tree-sticky-row="true"] {
562
+ pointer-events: auto;
563
+ }
564
+
565
+ [data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"] {
566
+ pointer-events: none;
567
+ }
568
+
569
+ [data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"]:hover:not([data-item-selected="true"]), [data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"][data-item-context-hover="true"]:not([data-item-selected="true"]) {
570
+ background-color: var(--trees-bg);
571
+ --truncate-marker-background-overlay-color: transparent;
572
+ }
573
+
574
+ [data-item-selected="true"]:has( + [data-item-selected="true"]) {
575
+ border-bottom-right-radius: 0;
576
+ border-bottom-left-radius: 0;
577
+ }
578
+
579
+ [data-item-selected="true"] + [data-item-selected="true"] {
580
+ border-top-left-radius: 0;
581
+ border-top-right-radius: 0;
582
+ }
583
+
584
+ [data-item-flattened-subitems] {
585
+ align-items: center;
586
+ gap: 2px;
587
+ display: inline-flex;
588
+ }
589
+
590
+ [data-item-flattened-subitem]:hover, [data-item-flattened-subitem-drag-target="true"] {
591
+ text-decoration: underline;
592
+ }
593
+
594
+ [data-item-section="icon"] {
595
+ color: var(--trees-fg-muted);
596
+ fill: currentColor;
597
+ width: var(--trees-icon-width);
598
+ flex-shrink: 0;
599
+ justify-content: center;
600
+ align-items: center;
601
+ display: flex;
602
+ }
603
+
604
+ :where([data-item-section="icon"] > [data-icon-token]) {
605
+ color: var(--trees-fg-muted);
606
+ }
607
+
608
+ [data-file-tree-colored-icons="true"] {
609
+ & [data-icon-token="astro"] {
610
+ color: var(--trees-file-icon-color-astro);
611
+ }
612
+
613
+ & [data-icon-token="babel"] {
614
+ color: var(--trees-file-icon-color-babel);
615
+ }
616
+
617
+ & [data-icon-token="bash"] {
618
+ color: var(--trees-file-icon-color-bash);
619
+ }
620
+
621
+ & [data-icon-token="biome"] {
622
+ color: var(--trees-file-icon-color-biome);
623
+ }
624
+
625
+ & [data-icon-token="bootstrap"] {
626
+ color: var(--trees-file-icon-color-bootstrap);
627
+ }
628
+
629
+ & [data-icon-token="browserslist"] {
630
+ color: var(--trees-file-icon-color-browserslist);
631
+ }
632
+
633
+ & [data-icon-token="bun"] {
634
+ color: var(--trees-file-icon-color-bun);
635
+ }
636
+
637
+ & [data-icon-token="c"] {
638
+ color: var(--trees-file-icon-color-c);
639
+ }
640
+
641
+ & [data-icon-token="cpp"] {
642
+ color: var(--trees-file-icon-color-cpp);
643
+ }
644
+
645
+ & [data-icon-token="claude"] {
646
+ color: var(--trees-file-icon-color-claude);
647
+ }
648
+
649
+ & [data-icon-token="css"] {
650
+ color: var(--trees-file-icon-color-css);
651
+ }
652
+
653
+ & [data-icon-token="database"] {
654
+ color: var(--trees-file-icon-color-database);
655
+ }
656
+
657
+ & [data-icon-token="default"] {
658
+ color: var(--trees-file-icon-color-default);
659
+ }
660
+
661
+ & [data-icon-token="docker"] {
662
+ color: var(--trees-file-icon-color-docker);
663
+ }
664
+
665
+ & [data-icon-token="eslint"] {
666
+ color: var(--trees-file-icon-color-eslint);
667
+ }
668
+
669
+ & [data-icon-token="git"] {
670
+ color: var(--trees-file-icon-color-git);
671
+ }
672
+
673
+ & [data-icon-token="go"] {
674
+ color: var(--trees-file-icon-color-go);
675
+ }
676
+
677
+ & [data-icon-token="graphql"] {
678
+ color: var(--trees-file-icon-color-graphql);
679
+ }
680
+
681
+ & [data-icon-token="html"] {
682
+ color: var(--trees-file-icon-color-html);
683
+ }
684
+
685
+ & [data-icon-token="image"] {
686
+ color: var(--trees-file-icon-color-image);
687
+ }
688
+
689
+ & [data-icon-token="javascript"] {
690
+ color: var(--trees-file-icon-color-javascript);
691
+ }
692
+
693
+ & [data-icon-token="json"] {
694
+ color: var(--trees-file-icon-color-json);
695
+ }
696
+
697
+ & [data-icon-token="markdown"] {
698
+ color: var(--trees-file-icon-color-markdown);
699
+ }
700
+
701
+ & [data-icon-token="mcp"] {
702
+ color: var(--trees-file-icon-color-mcp);
703
+ }
704
+
705
+ & [data-icon-token="npm"] {
706
+ color: var(--trees-file-icon-color-npm);
707
+ }
708
+
709
+ & [data-icon-token="oxc"] {
710
+ color: var(--trees-file-icon-color-oxc);
711
+ }
712
+
713
+ & [data-icon-token="postcss"] {
714
+ color: var(--trees-file-icon-color-postcss);
715
+ }
716
+
717
+ & [data-icon-token="prettier"] {
718
+ color: var(--trees-file-icon-color-prettier);
719
+ }
720
+
721
+ & [data-icon-token="python"] {
722
+ color: var(--trees-file-icon-color-python);
723
+ }
724
+
725
+ & [data-icon-token="react"] {
726
+ color: var(--trees-file-icon-color-react);
727
+ }
728
+
729
+ & [data-icon-token="ruby"] {
730
+ color: var(--trees-file-icon-color-ruby);
731
+ }
732
+
733
+ & [data-icon-token="rust"] {
734
+ color: var(--trees-file-icon-color-rust);
735
+ }
736
+
737
+ & [data-icon-token="sass"] {
738
+ color: var(--trees-file-icon-color-sass);
739
+ }
740
+
741
+ & [data-icon-token="svg"] {
742
+ color: var(--trees-file-icon-color-svg);
743
+ }
744
+
745
+ & [data-icon-token="svelte"] {
746
+ color: var(--trees-file-icon-color-svelte);
747
+ }
748
+
749
+ & [data-icon-token="svgo"] {
750
+ color: var(--trees-file-icon-color-svgo);
751
+ }
752
+
753
+ & [data-icon-token="swift"] {
754
+ color: var(--trees-file-icon-color-swift);
755
+ }
756
+
757
+ & [data-icon-token="table"] {
758
+ color: var(--trees-file-icon-color-table);
759
+ }
760
+
761
+ & [data-icon-token="text"] {
762
+ color: var(--trees-file-icon-color-text);
763
+ }
764
+
765
+ & [data-icon-token="tailwind"] {
766
+ color: var(--trees-file-icon-color-tailwind);
767
+ }
768
+
769
+ & [data-icon-token="terraform"] {
770
+ color: var(--trees-file-icon-color-terraform);
771
+ }
772
+
773
+ & [data-icon-token="typescript"] {
774
+ color: var(--trees-file-icon-color-typescript);
775
+ }
776
+
777
+ & [data-icon-token="vite"] {
778
+ color: var(--trees-file-icon-color-vite);
779
+ }
780
+
781
+ & [data-icon-token="vscode"] {
782
+ color: var(--trees-file-icon-color-vscode);
783
+ }
784
+
785
+ & [data-icon-token="vue"] {
786
+ color: var(--trees-file-icon-color-vue);
787
+ }
788
+
789
+ & [data-icon-token="wasm"] {
790
+ color: var(--trees-file-icon-color-wasm);
791
+ }
792
+
793
+ & [data-icon-token="webpack"] {
794
+ color: var(--trees-file-icon-color-webpack);
795
+ }
796
+
797
+ & [data-icon-token="yml"] {
798
+ color: var(--trees-file-icon-color-yml);
799
+ }
800
+
801
+ & [data-icon-token="zig"] {
802
+ color: var(--trees-file-icon-color-zig);
803
+ }
804
+
805
+ & [data-icon-token="zip"] {
806
+ color: var(--trees-file-icon-color-zip);
807
+ }
808
+ }
809
+
810
+ [data-icon-name="file-tree-icon-chevron"] {
811
+ &[data-align-capitals="false"] {
812
+ transform: translate(0, var(--trees-icon-nudge));
813
+ }
814
+
815
+ &[data-align-capitals="true"] {
816
+ transform: translate(0);
817
+ }
818
+ }
819
+
820
+ [data-item-section="content"] {
821
+ text-align: start;
822
+ text-overflow: ellipsis;
823
+ flex: 0 auto;
824
+ min-width: 0;
825
+ max-width: 100%;
826
+ overflow: hidden;
827
+ }
828
+
829
+ [data-item-section="decoration"] {
830
+ text-align: end;
831
+ min-width: 0;
832
+ color: var(--trees-fg-muted);
833
+ flex: 1 1 0;
834
+ justify-content: flex-end;
835
+ display: flex;
836
+ overflow: hidden;
837
+ }
838
+
839
+ [data-item-section="decoration"] > span {
840
+ text-overflow: ellipsis;
841
+ white-space: nowrap;
842
+ justify-content: flex-end;
843
+ align-items: center;
844
+ min-width: 0;
845
+ max-width: 100%;
846
+ display: inline-flex;
847
+ overflow: hidden;
848
+ }
849
+
850
+ [data-item-section="git"], [data-item-section="action"] {
851
+ flex: none;
852
+ justify-content: center;
853
+ align-items: center;
854
+ display: flex;
855
+ }
856
+
857
+ [data-item-section="git"] {
858
+ width: var(--trees-git-lane-width);
859
+ }
860
+
861
+ [data-item-section="action"] {
862
+ width: var(--trees-action-lane-width);
863
+ color: var(--trees-fg-muted);
864
+ fill: currentColor;
865
+ pointer-events: none;
866
+ }
867
+
868
+ [data-item-section="git"] > span, [data-item-section="action"] > span {
869
+ justify-content: center;
870
+ align-items: center;
871
+ width: 100%;
872
+ display: inline-flex;
873
+ }
874
+
875
+ [data-item-action-affordance="decorative"] {
876
+ opacity: .85;
877
+ }
878
+
879
+ [data-item-rename-input] {
880
+ appearance: none;
881
+ width: 100%;
882
+ min-width: 0;
883
+ height: calc(var(--trees-row-height) - 4px);
884
+ font-family: inherit;
885
+ font-size: inherit;
886
+ color: inherit;
887
+ box-sizing: border-box;
888
+ background-color: #0000;
889
+ border: 0;
890
+ outline: none;
891
+ padding-inline: 6px;
892
+ }
893
+
894
+ [data-item-section="content"]:has([data-item-rename-input]) ~ [data-item-section="action"], [data-item-section="content"]:has([data-item-rename-input]) ~ [data-item-section="decoration"] {
895
+ display: none;
896
+ }
897
+
898
+ [aria-expanded="false"][data-item-type="folder"] > [data-item-section="icon"] > [data-icon-name="file-tree-icon-chevron"] {
899
+ &[data-align-capitals="true"] {
900
+ transform: rotate(-90deg)
901
+ translate(calc(var(--trees-icon-nudge) / 2),
902
+ calc(var(--trees-icon-nudge) / 2));
903
+ }
904
+
905
+ &[data-align-capitals="false"] {
906
+ transform: rotate(-90deg)
907
+ translate(calc(var(--trees-icon-nudge) / 2 * -1),
908
+ calc(var(--trees-icon-nudge) / 2));
909
+ }
910
+ }
911
+
912
+ [data-item-section="spacing"] {
913
+ height: var(--trees-row-height);
914
+ padding-left: calc(calc(var(--trees-icon-width) / 2) - .5px);
915
+ flex-direction: row;
916
+ justify-content: center;
917
+ align-items: center;
918
+ display: flex;
919
+
920
+ &:empty {
921
+ padding-left: 0;
922
+ }
923
+ }
924
+
925
+ [data-item-section="spacing-item"] {
926
+ border-left: 1px solid var(--trees-indent-guide-bg);
927
+ height: 100%;
928
+ margin-right: calc(var(--trees-level-gap) - 1px);
929
+ opacity: 0;
930
+ transition: opacity .15s;
931
+ display: inline-block;
932
+ transform: translateX(-.25px);
933
+
934
+ & + & {
935
+ margin-left: calc(var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - .5px);
936
+ }
937
+ }
938
+
939
+ :host(:hover) [data-item-section="spacing-item"] {
940
+ opacity: .75;
941
+ }
942
+
943
+ [data-item-contains-git-change="true"] > [data-item-section="git"] {
944
+ color: var(--trees-git-modified-color);
945
+ opacity: .5;
946
+ fill: currentColor;
947
+ }
948
+
949
+ [data-item-git-status] {
950
+ & > :where([data-item-section="icon"]) > :where(:not([data-icon-name="file-tree-icon-chevron"])), & > [data-item-section="content"] {
951
+ color: var(--trees-item-git-status-color);
952
+ }
953
+
954
+ & > [data-item-section="git"] {
955
+ color: var(--trees-item-git-status-color);
956
+ font-weight: var(--trees-font-weight-semibold);
957
+ }
958
+ }
959
+
960
+ [data-item-git-status="added"] {
961
+ --trees-item-git-status-color: var(--trees-git-added-color);
962
+ }
963
+
964
+ [data-item-git-status="deleted"] {
965
+ --trees-item-git-status-color: var(--trees-git-deleted-color);
966
+ }
967
+
968
+ [data-item-git-status="ignored"] {
969
+ --trees-item-git-status-color: var(--trees-git-ignored-color);
970
+
971
+ & > [data-item-section="icon"] {
972
+ opacity: .5;
973
+ }
974
+ }
975
+
976
+ [data-item-section="git"] [data-icon-name="file-tree-icon-dot"] {
977
+ transform: translateY(calc(.65ex - 50%));
978
+ }
979
+
980
+ [data-item-git-status="modified"] {
981
+ --trees-item-git-status-color: var(--trees-git-modified-color);
982
+ }
983
+
984
+ [data-item-git-status="renamed"] {
985
+ --trees-item-git-status-color: var(--trees-git-renamed-color);
986
+ }
987
+
988
+ [data-item-git-status="untracked"] {
989
+ --trees-item-git-status-color: var(--trees-git-untracked-color);
990
+ }
991
+
992
+ [data-item-drag-target="true"] {
993
+ background-color: var(--trees-selected-bg);
994
+ }
995
+
996
+ [data-item-dragging="true"] {
997
+ opacity: .5;
998
+ }
999
+
1000
+ [data-item-section="lock"] {
1001
+ color: var(--trees-fg-muted);
1002
+ flex: none;
1003
+ align-items: center;
1004
+ margin-left: auto;
1005
+ display: flex;
1006
+ }
1007
+
1008
+ [data-item-section="lock"] svg {
1009
+ display: block;
1010
+ }
1011
+
1012
+ [data-type="header-slot"] {
1013
+ flex: none;
1014
+ display: block;
1015
+ }
1016
+
1017
+ [data-type="context-menu-wash"] {
1018
+ z-index: 3;
1019
+ touch-action: none;
1020
+ background-color: #0000;
1021
+ position: absolute;
1022
+ inset: 0;
1023
+ }
1024
+
1025
+ [data-type="context-menu-anchor"] {
1026
+ top: 0;
1027
+ right: var(--trees-context-menu-trigger-inline-offset);
1028
+ z-index: 4;
1029
+ align-items: center;
1030
+ display: none;
1031
+ position: absolute;
1032
+
1033
+ &[data-visible="true"] {
1034
+ display: flex;
1035
+ }
1036
+ }
1037
+
1038
+ [data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="context-menu-anchor"] {
1039
+ display: none;
1040
+ }
1041
+
1042
+ [data-type="context-menu-anchor"] > slot[name="context-menu"] {
1043
+ flex: 0 0 0;
1044
+ width: 0;
1045
+ min-width: 0;
1046
+ display: block;
1047
+ overflow: visible;
1048
+ }
1049
+
1050
+ [data-type="context-menu-trigger"] {
1051
+ all: unset;
1052
+ width: var(--trees-action-lane-width);
1053
+ color: var(--trees-fg-muted);
1054
+ fill: currentColor;
1055
+ cursor: pointer;
1056
+ font-family: var(--trees-font-family);
1057
+ font-size: var(--trees-font-size);
1058
+ border-top-right-radius: var(--trees-border-radius);
1059
+ border-bottom-right-radius: var(--trees-border-radius);
1060
+ margin: var(--trees-focus-ring-width);
1061
+ height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
1062
+ border-width: 0;
1063
+ justify-content: center;
1064
+ align-items: center;
1065
+ transition: color .12s;
1066
+ display: flex;
1067
+ }
1068
+
1069
+ [data-type="context-menu-trigger"]:hover, [data-type="context-menu-trigger"][aria-expanded="true"] {
1070
+ color: var(--trees-fg);
1071
+ }
1072
+
1073
+ [data-truncate-container] {
1074
+ --truncate-internal-marker-fade-width: var(--truncate-marker-fade-width, 2px);
1075
+ --truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
1076
+ --truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
1077
+ --truncate-internal-middle-marker-opacity: var(--truncate-middle-marker-opacity, 80%);
1078
+ --truncate-internal-marker-background-color: var(--truncate-marker-background-color, light-dark(#fff, #000));
1079
+ --truncate-internal-marker-background-overlay-color: var(--truncate-marker-background-overlay-color, transparent);
1080
+ --truncate-internal-marker-block-inset: var(--truncate-marker-block-inset, 0px);
1081
+ --truncate-internal-marker-fade-out-duration: var(--truncate-marker-fade-out-duration, 0s);
1082
+ --truncate-internal-marker-fade-in-duration: var(--truncate-marker-fade-in-duration, .1s);
1083
+ --truncate-internal-fade-marker-color: var(--truncate-fade-marker-color, #000);
1084
+ --truncate-internal-fade-marker-width: var(--truncate-fade-marker-width, .2lh);
1085
+ --truncate-internal-single-line-height: 1lh;
1086
+ height: var(--truncate-internal-single-line-height);
1087
+ min-width: 0;
1088
+ margin-top: -1px;
1089
+ margin-bottom: -1px;
1090
+ overflow: hidden;
1091
+ }
1092
+
1093
+ [data-truncate-marker] {
1094
+ height: var(--truncate-internal-single-line-height);
1095
+ padding-block: var(--truncate-internal-marker-block-inset);
1096
+ box-sizing: border-box;
1097
+ z-index: 2;
1098
+ color: color-mix(in srgb,
1099
+ currentColor var(--truncate-internal-marker-opacity),
1100
+ transparent);
1101
+ opacity: 0;
1102
+ transition: opacity var(--truncate-internal-marker-fade-out-duration)
1103
+ ease-in-out;
1104
+ background-clip: content-box;
1105
+ align-items: center;
1106
+ display: flex;
1107
+ position: absolute;
1108
+ }
1109
+
1110
+ @container measure (height > 1lh) {
1111
+ [data-truncate-marker] {
1112
+ opacity: 1;
1113
+ transition: opacity var(--truncate-internal-marker-fade-in-duration)
1114
+ ease-in-out;
1115
+ }
1116
+ }
1117
+
1118
+ [data-truncate-grid] {
1119
+ display: grid;
1120
+ position: relative;
1121
+ }
1122
+
1123
+ [data-truncate-content="visible"] {
1124
+ white-space: nowrap;
1125
+ }
1126
+
1127
+ [data-truncate-content="overflow"] {
1128
+ opacity: 0;
1129
+ pointer-events: none;
1130
+ user-select: none;
1131
+ word-break: break-all;
1132
+ margin-top: calc(-1 * var(--truncate-internal-single-line-height));
1133
+ }
1134
+
1135
+ [data-truncate-marker-cell] {
1136
+ user-select: none;
1137
+ pointer-events: none;
1138
+ overflow: visible;
1139
+ container: measure / size;
1140
+ }
1141
+
1142
+ [data-truncate-container="truncate"] {
1143
+ & [data-truncate-grid] {
1144
+ grid-template-columns: minmax(0, max-content) 0;
1145
+ }
1146
+
1147
+ & [data-truncate-marker] {
1148
+ right: 0;
1149
+ }
1150
+
1151
+ & [data-truncate-fade] {
1152
+ margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
1153
+ }
1154
+ }
1155
+
1156
+ [data-truncate-container="fruncate"] {
1157
+ & [data-truncate-grid] {
1158
+ grid-template-columns: 0 minmax(0, max-content) auto;
1159
+ }
1160
+
1161
+ & [data-truncate-content] {
1162
+ direction: rtl;
1163
+ }
1164
+
1165
+ & [data-truncate-content] > span {
1166
+ unicode-bidi: plaintext;
1167
+ }
1168
+
1169
+ & [data-truncate-fade] {
1170
+ margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
1171
+ }
1172
+ }
1173
+
1174
+ [data-truncate-variant="default"] {
1175
+ & [data-truncate-marker] {
1176
+ background-color: var(--truncate-internal-marker-background-color);
1177
+ background-image: linear-gradient(var(--truncate-internal-marker-background-overlay-color),
1178
+ var(--truncate-internal-marker-background-overlay-color));
1179
+ }
1180
+
1181
+ & [data-truncate-marker]:after, & [data-truncate-marker]:before {
1182
+ content: "";
1183
+ width: calc(var(--truncate-internal-marker-fade-width) +
1184
+ var(--truncate-internal-marker-gap));
1185
+ height: max(0px,
1186
+ calc(var(--truncate-internal-single-line-height) -
1187
+ var(--truncate-internal-marker-block-inset) * 2));
1188
+ background-color: var(--truncate-internal-marker-background-color);
1189
+ background-image: linear-gradient(var(--truncate-internal-marker-background-overlay-color),
1190
+ var(--truncate-internal-marker-background-overlay-color));
1191
+ -webkit-mask-image: linear-gradient(var(--truncate-internal-fade-dir),
1192
+ #000 0%,
1193
+ #000 var(--truncate-internal-marker-gap),
1194
+ transparent 100%);
1195
+ mask-image: linear-gradient(var(--truncate-internal-fade-dir),
1196
+ #000 0%,
1197
+ #000 var(--truncate-internal-marker-gap),
1198
+ transparent 100%);
1199
+ position: absolute;
1200
+ inset-block-start: var(--truncate-internal-marker-block-inset);
1201
+ }
1202
+
1203
+ & [data-truncate-marker]:after {
1204
+ --truncate-internal-fade-dir: to right;
1205
+ right: calc(-1 *
1206
+ (
1207
+ var(--truncate-internal-marker-fade-width) +
1208
+ var(--truncate-internal-marker-gap)
1209
+ ));
1210
+ }
1211
+
1212
+ & [data-truncate-marker]:before {
1213
+ --truncate-internal-fade-dir: to left;
1214
+ left: calc(-1 *
1215
+ (
1216
+ var(--truncate-internal-marker-fade-width) +
1217
+ var(--truncate-internal-marker-gap)
1218
+ ));
1219
+ }
1220
+ }
1221
+
1222
+ [data-truncate-variant="fade"] {
1223
+ & [data-truncate-marker] {
1224
+ background: none;
1225
+ }
1226
+ }
1227
+
1228
+ [data-truncate-fade] {
1229
+ box-shadow: 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
1230
+ var(--truncate-internal-fade-marker-color),
1231
+ 0 0 var(--truncate-internal-fade-marker-width)
1232
+ var(--truncate-internal-fade-marker-color);
1233
+ width: calc(var(--truncate-internal-fade-marker-width) * 2);
1234
+ height: calc(var(--truncate-internal-single-line-height) -
1235
+ (var(--truncate-internal-fade-marker-width) * 2));
1236
+ margin: var(--truncate-internal-fade-marker-width) 0;
1237
+ }
1238
+
1239
+ [data-truncate-group-container="middle"] {
1240
+ & [data-truncate-container] {
1241
+ --truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
1242
+ }
1243
+
1244
+ min-width: 0;
1245
+ display: flex;
1246
+
1247
+ & > div {
1248
+ min-width: 0;
1249
+ }
1250
+
1251
+ & > div[data-truncate-segment-priority="1"] {
1252
+ flex: 0 1 max-content;
1253
+ }
1254
+
1255
+ & > div[data-truncate-segment-priority="2"] {
1256
+ flex: 0 999999 max-content;
1257
+ }
1258
+ }
1259
+ }
1260
+
1261
+ @layer theme, unsafe;
1262
+ `,Ot=`@layer base, unsafe;`;function kt(e){return`${Ot}
1263
+ @layer base {
1264
+ ${e}
1265
+ }`}function At(e){return`${Ot}
1266
+ @layer unsafe {
1267
+ ${e}
1268
+ }`}var jt=new WeakMap;function Mt(e){let t=jt.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(ne,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),jt.set(e,i),i}function Nt(e,t){if(!e.isConnected)return;let n=Mt(t);if(n==null)return;let r=t.querySelector(`style[${j}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(j,``),t.appendChild(i)),i.textContent=`:host { ${re}: ${n}px; }`}var Pt;function Ft(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Pt??(Pt=new CSSStyleSheet,Pt.replaceSync(kt(Dt)));let t=!1;try{e.adoptedStyleSheets=[Pt],t=!0}catch{}if(t){e.querySelector(`style[${k}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(k,``),t.textContent=kt(Dt),e.prepend(t)}}function It(e,t){Lt(e,t),Ft(t),Nt(e,t)}function Lt(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});It(this,e)}}if(customElements.define(O,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(O)))e instanceof HTMLElement&&It(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Rt=5,zt=1<<Rt,Bt=zt*4;function Vt(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Ht(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Ut(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function Wt(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function Gt(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function Kt(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function qt(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,Zt(e,t)}function Jt(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=Wt(e).get(t);if(i===void 0)return;let a=i>>Rt;e.childVisibleChunkSums[a]+=r}function Yt(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Qt(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=zt}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Xt(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Rt;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Rt}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function Zt(e,t){if(t.childIds.length<Bt){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/zt),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Rt]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Qt(e,t,n,r){let i=Math.min(t.childIds.length,n+zt),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var $t=7,en=3,tn=1<<en,nn=4;function rn(e,t,n=0){return e<<nn|n<<en|t}function an(e){return e.depthAndFlags>>>nn}function on(e){return(e.depthAndFlags&tn)>>en}function I(e){return(e.depthAndFlags&tn)!==0}function sn(e){return e.depthAndFlags&$t}function L(e,t){return(sn(e)&t)!==0}function cn(e,t){e.depthAndFlags|=t}function ln(e,t){e.depthAndFlags=rn(t,sn(e),on(e))}var un=Symbol(`benchmarkInstrumentation`);function dn(e,t){return t==null||Object.defineProperty(e,un,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function fn(e){return e==null?null:e[un]??null}function R(e,t,n){return e==null?n():e.measurePhase(t,n)}function pn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function mn(e){return e>=48&&e<=57}function hn(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!mn(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&mn(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function gn(e){let t=e.toLowerCase();return{lowerValue:t,tokens:hn(t)}}function _n(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function vn(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=_n(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function yn(e,t,n){let r=vn(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function bn(e,t){return yn(e,t,gn)}function xn(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Sn(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=xn(e,r);return a===xn(t,r)?bn(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Cn(e,t){return Sn(e,t)}function wn(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=gn(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=xn(e,n);return o===xn(t,n)?yn(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Tn(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=gn(r);return e.sortKeyById[t]=i,i}function En(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Dn(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function On(e){let{hasTrailingSlash:t,segments:n}=Dn(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function kn(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Dn(e);return{requiresDirectory:t,segments:n}}function An(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[gn(``)]}}function jn(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Mn(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Nn=Symbol(`pathStorePreparedInputKind`);function Pn(e,t){return e[Nn]=t,e}function Fn(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function In(e,t,n){return n==="default"?Cn(e,t):n(Fn(e),Fn(t))}function Ln(){return{depthAndFlags:rn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Rn(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function zn(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Bn(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Vn(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Hn(e,t={}){return Jn(e,t).map(e=>e.path)}function Un(e,t={}){let n=Jn(e,t);return Pn({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Wn(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Pn({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Gn(e){let t=e,n=t.preparedPaths;if(t[Nn]===`prepared`&&n!=null)return n;if(!Bn(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Kn(e){let t=e;return t[Nn]===`presorted`&&t.presortedPaths!=null||Vn(t.presortedPaths)?t.presortedPaths:null}function qn(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Jn(e,t={}){let n=En(t),r=fn(t);pn(r,`workload.inputFiles`,e.length);let i=R(r,`store.preparePathEntries.parse`,()=>e.map(e=>On(e)));return R(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>In(e,t,n.sort))),i}var Yn=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Ln()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=An();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=fn(e),this.options=En(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,Vt())}appendPaths(e){return R(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>On(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,R(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return R(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:rn(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:rn(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:rn(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=On(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:rn(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:rn(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=On(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(R(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||R(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?wn(this.lastPreparedPath,e,this.segmentSortKeyCache):In(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=zn(e),i=n==null?0:zn(n),a=n==null?0:Rn(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=jn(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:rn(an(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),Gt(i,s),s}createFileChildUnchecked(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:rn(an(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Gt(r,a),a}getOrCreateDirectoryChild(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!I(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:rn(an(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Gt(r,a),this.directories.set(a,Vt()),a}createDirectoryChild(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:rn(an(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Gt(r,a),this.directories.set(a,Vt()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!I(n))throw Error(`Path is not a directory: "${t}"`);if(L(n,1))throw Error(`Duplicate path: "${t}"`);cn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,Ht());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(I(a)){let t=Ht();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;I(n)&&this.directories.set(t,Vt());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),Gt(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!I(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return qt(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Xn(e,t=`closed`,n=null){let r=Qn(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Zn(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Qn(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function $n(e,t){return L(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&an(t)<=e.defaultExpansion}function er(e,t,n=e.snapshot.nodes[t]){return n==null||!I(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:$n(e,n)}function tr(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!I(r))return;let i=$n(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function nr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function rr(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function ir(e,t){let n=nr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function ar(e,t){let n=nr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function or(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function sr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function cr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function lr(e,t){e.directoryLoadInfoById.delete(t)}function ur(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function dr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function fr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function pr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function mr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function hr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function gr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function _r(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function vr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function yr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function br(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function xr(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Sr(e,t,n){return{...n,visibleCountDelta:Nr(e)-t}}function Cr(e,t){let n=Nr(e),r=Zn();e.transactionStack.push(r);try{t()}catch(t){throw Er(e,r,!1),t}Er(e,r,!0,Nr(e)-n)}function wr(e,t){let n=e.instrumentation;if(n==null){Tr(e,t);return}R(n,`store.events.record`,()=>Tr(e,t))}function Tr(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){jr(e,t);return}n.events.push(t),Ar(n,t)}function Er(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?kr(i,t):R(n,`store.events.batch.merge`,()=>kr(i,t));return}let a=Dr(t,r),o=e.instrumentation;if(o==null){jr(e,a);return}R(o,`store.events.batch.commit`,()=>jr(e,a))}function Dr(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Or(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function kr(e,t){for(let n of t.events)e.events.push(n);Or(e,t)}function Ar(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function jr(e,t){let n=e.instrumentation;if(n==null){Mr(e,t);return}R(n,`store.events.emit`,()=>Mr(e,t))}function Mr(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Nr(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Pr(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!I(n)||L(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!I(a)?null:i}function Fr(e,t){let n=t;for(;;){let t=Pr(e,n);if(t==null)return n;n=t}}function Ir(e,t){let n=[t],r=t;for(;;){let t=Pr(e,r);if(t==null)return n;n.push(t),r=t}}function Lr(e,t){let n=t==null?e.snapshot.rootId:Kr(e,t);return n==null?[]:Jr(e,n)}function Rr(e,t){let n=On(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=li(e,ci(e,r)),{createdNodeIds:a,directoryId:o}=Yr(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=V(e,o);if(L(n,1))throw Error(`Path already exists: "${t}"`);cn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Zr(e,o,n.basename),s.add(c);Ur(e,o);let l=li(e,o);return dr({affectedAncestorIds:Gr(e,c),affectedNodeIds:[...s],path:t,projectionChanged:ui(i,l)})}function zr(e,t,n){let r=Kr(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=V(e,r);if(L(i,2))throw Error(`The root node cannot be removed`);if(I(i)&&B(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=li(e,a),s=oi(e,r);ei(e,a,r,i.nameId),si(e,a),Ur(e,a);let c=li(e,a);return fr({affectedAncestorIds:Gr(e,a),affectedNodeIds:s,path:t,projectionChanged:ui(o,c),recursive:n.recursive===!0})}function Br(e,t,n,r){let i=Kr(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=V(e,i);if(L(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=ii(e,i,n),c=li(e,a.parentId),l=li(e,s.parentId),u=Mn(e.snapshot.segmentTable,a.nameId),d=jn(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(I(a)&&mi(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=Ut(e.snapshot.nodes,B(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&ai(e,p,o,on(a))===`skip`)return null;let m=a.parentId;ei(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),pi(e,i),$r(e,s.parentId,i),si(e,m),e.pathCacheVersion++,Ur(e,m),s.parentId!==m&&Ur(e,s.parentId);let h=li(e,m),g=li(e,s.parentId);return pr({affectedAncestorIds:[...new Set([...Gr(e,m),...Gr(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:di([c,l],[h,g]),to:z(e,i)})}function Vr(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function Hr(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function z(e,t){let n=V(e,t),r=Vr(e,t);if(r!=null)return r;if(L(n,2))return Hr(e,t,``);let i=z(e,n.parentId),a=Mn(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return Hr(e,t,I(n)?`${o}/`:o)}function Ur(e,t){let n=e.instrumentation;if(n==null){gi(e,t);return}R(n,`store.recomputeCountsUpwardFrom`,()=>gi(e,t))}function Wr(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!I(o)){hi(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){hi(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function Gr(e,t){let n=[],r=t;for(;r!=null;){let t=V(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function Kr(e,t){if(t.length===0)return e.snapshot.rootId;let n=kn(t);return qr(e,n.segments,n.requiresDirectory)}function qr(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=B(e,r),a=Ut(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=V(e,r);return n&&!I(i)?null:r}function B(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function V(e,t){let n=e.snapshot.nodes[t];if(n===void 0||L(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Jr(e,t){let n=e.snapshot.nodes[t];if(n===void 0||L(n,4))return[];if(!I(n))return[z(e,t)];if(B(e,t).childIds.length===0)return L(n,1)&&!L(n,2)?[z(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||L(n,4)){i.pop();continue}if(!I(n)){r.push(z(e,t.nodeId)),i.pop();continue}let a=B(e,t.nodeId);if(a.childIds.length===0){L(n,1)&&!L(n,2)&&r.push(z(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Yr(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=jn(e.snapshot.segmentTable,i),a=B(e,r),o=Ut(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!I(V(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Xr(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Xr(e,t,n){let r=V(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:rn(an(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,Vt()),$r(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Zr(e,t,n){let r=jn(e.snapshot.segmentTable,n),i=B(e,t);if(Ut(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${vi(e,t,n)}"`);let a=V(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:rn(an(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),$r(e,t,o),e.activeNodeCount++,o}function Qr(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}ti(e,n,o)<0?i=a:r=a+1}return r}function $r(e,t,n){let r=B(e,t),i=V(e,n);Ut(e.snapshot.nodes,r).set(i.nameId,n),Jt(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Qr(e,r,n);r.childIds.splice(a,0,n),Kt(r,a),Zt(e.snapshot.nodes,r)}function ei(e,t,n,r){let i=B(e,t),a=Wt(i),o=a.get(n)??-1;Ut(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Jt(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),Kt(i,o),Zt(e.snapshot.nodes,i))}function ti(e,t,n){let r=e.snapshot.options.sort;return r==="default"?ni(e,t,n):r(ri(e,t),ri(e,n))}function ni(e,t,n){let r=V(e,t),i=V(e,n),a=I(r);if(a!==I(i))return a?-1:1;let o=vn(Tn(e.snapshot.segmentTable,r.nameId),Tn(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Mn(e.snapshot.segmentTable,r.nameId),c=Mn(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function ri(e,t){let n=V(e,t),r=z(e,t),i=I(n),a=i?r.slice(0,-1):r;return{basename:Mn(e.snapshot.segmentTable,n.nameId),depth:an(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function ii(e,t,n){let r=V(e,t),i=Kr(e,n);if(i!=null){let t=V(e,i);if(I(t))return{basename:Mn(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=kn(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=kn(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:qr(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function ai(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${z(e,t)}"`);let i=V(e,t);if(on(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(I(i)&&B(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return oi(e,t),ei(e,a,t,o),si(e,a),Ur(e,a),`handled`}function oi(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=V(e,t.nodeId);if(t.visitedChildren||!I(i)){I(i)&&e.snapshot.directories.delete(t.nodeId),cn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),lr(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=B(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function si(e,t){let n=t;for(;n!=null;){let t=V(e,n);if(!I(t)||L(t,2)||B(e,n).childIds.length>0)return;cn(t,1),n=t.parentId===n?null:t.parentId}}function ci(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=Ut(e.snapshot.nodes,B(e,n)).get(t);if(i==null||!I(V(e,i)))break;n=i}return n}function li(e,t){let n=fi(e,t);if(n==null)return null;let r=Fr(e,n),i=V(e,r),a=n===r?null:Ir(e,n).map(t=>z(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:B(e,r).childIds.length>0,path:z(e,r),terminalKind:on(i)})}function ui(e,t){return di([e],[t])}function di(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function fi(e,t){let n=t;for(;n!=null;){let t=V(e,n);if(!I(t)||L(t,2))return null;if(!er(e,n,t))return n;n=t.parentId}return null}function pi(e,t){let n=V(e,t);if(ln(n,(t===e.snapshot.rootId?-1:an(V(e,n.parentId)))+1),!I(n))return;let r=B(e,t);for(let t of r.childIds)pi(e,t)}function mi(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=V(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function hi(e,t,n=V(e,t),r=!1){let i=e.instrumentation;if(i==null){_i(e,t,n,r);return}R(i,`store.recomputeNodeCounts`,()=>_i(e,t,n,r))}function gi(e,t){let n=t;for(;n!=null;){let t=V(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(hi(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Jt(B(e,s),n,a,o),n=s}}function _i(e,t,n,r){if(!I(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=B(e,t);if(r){let t=e.instrumentation;t==null?qt(e.snapshot.nodes,i):R(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>qt(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,L(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Pr(e,t)==null?er(e,t,n)?1+o:1:o}function vi(e,t,n){let r=z(e,t);return r.length===0?n:`${r}${n}`}function yi(e){return e!=null&&!L(e,4)}function bi(e,t){let n=e.snapshot.nodes[t];return!yi(n)||!I(n)||L(n,2)?null:n}function xi(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&yi(e.snapshot.nodes[n])&&(t+=1);return t}function Si(e){return Math.max(0,e.valueById.length-1)}function Ci(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:xi(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Si(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function wi(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Ti(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)bi(e,n)!=null&&t.push(z(e,n));for(let t of e.expandedDirectoryIds)bi(e,t)!=null&&n.push(z(e,t));return{collapsedPaths:t,expandedPaths:n}}function Ei(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)bi(e,n)==null||rr(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:z(e,n)});return t}function Di(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=Kr(e,n);t!=null&&tr(e,t,!0,V(e,t))}for(let n of t.collapsedPaths){let t=Kr(e,n);t!=null&&tr(e,t,!1,V(e,t))}}function Oi(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=Kr(e,n.path);t!=null&&bi(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function ki(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Ai(e){let t=e.snapshot.segmentTable,n=An();for(let r of e.snapshot.nodes)if(yi(r)){if(L(r,2)){r.nameId=0;continue}r.nameId=jn(n,Mn(t,r.nameId))}e.snapshot.segmentTable=n}function ji(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!yi(r)||!I(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return yi(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[V(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),qt(e.snapshot.nodes,n)}}function Mi(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(yi(n))break;--t}e.snapshot.nodes.length=t+1}function Ni(e){let t=Ti(e),n=Ei(e);R(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>ki(e)),R(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Ai(e)),R(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ji(e)),R(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Mi(e)),R(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Di(e,t)),R(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>Oi(e,n)),R(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>Wr(e,e.snapshot.rootId))}function Pi(e){let t=Ti(e),n=Ei(e),r=R(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Lr(e)),i=dn({...e.snapshot.options},e.instrumentation),a=R(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Yn(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,R(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Di(e,t)),R(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>Oi(e,n)),R(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>Wr(e,e.snapshot.rootId))}function Fi(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function Ii(e,t){let n=Ci(e);t===`stable`?R(e.instrumentation,`store.cleanup.stable`,()=>Ni(e)):R(e.instrumentation,`store.cleanup.aggressive`,()=>Pi(e));let r=Ci(e);return wi(t,t===`stable`,n,r)}var Li=64;function Ri(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function zi(e){return V(e,e.snapshot.rootId).visibleSubtreeCount}function Bi(e,t,n,r){let i=V(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Vi(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:oa(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Bi(e,t.cursor,t.index,n)}}function Hi(e,t,n,r,i,a){let o=B(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Yt(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return Ui(e,u,l,r+c,i+1,s,o.childIds.length,a)}function Ui(e,t,n,r,i,a,o,s){if(!I(V(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=ea(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=V(e,c.terminalNodeId);if(!I(l)||!er(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Hi(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function Wi(e,t){let n=zi(e);if(t<0||t>=n)return null;let r=Hi(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>z(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Vi(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:oa(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Bi(e,r.cursor,r.index,n)}}function Gi(e,t,n){let r=e.instrumentation,i=zi(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return aa(e,o+1);let t=[],n=Zi(e,a);for(let r=a;r<=o&&n!=null;r++){let r=oa(e,n);t.push(r),n=na(e,n)}return t}let s=[],c=0,l=0,u=R(r,`store.getVisibleSlice.selectFirstRow`,()=>Zi(e,a));for(let t=a;t<=o&&u!=null;t++){let t=R(r,`store.getVisibleSlice.materializeRow`,()=>oa(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=R(r,`store.getVisibleSlice.advanceCursor`,()=>na(e,u))}return pn(r,`workload.visibleRowsRead`,s.length),pn(r,`workload.flattenedRowsRead`,c),pn(r,`workload.flattenedSegmentsRead`,l),s}function Ki(e,t=zi(e)){let n=e.instrumentation;return n==null?ia(e,t):R(n,`store.getVisibleTreeProjection`,()=>ia(e,t))}function qi(e){return ra(Ki(e))}function Ji(e,t){let n=Kr(e,t);if(n==null||n===e.snapshot.rootId||I(V(e,n))&&Fr(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=V(e,i).parentId,n=B(e,t),s=Wt(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Xt(a,n,s),t!==o){let n=V(e,t),a=Pr(e,t);if(!er(e,t,n)&&a!==i)return null;Fr(e,t)===t&&(r+=1)}i=t}return r}function Yi(e,t){let n=Kr(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=V(e,n);if(!I(r))throw Error(`Path is not a directory: "${t}"`);return er(e,n,r)?null:(tr(e,n,!0,r),Ur(e,n),mr({affectedAncestorIds:Gr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Xi(e,t){let n=Kr(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=V(e,n);if(!I(r))throw Error(`Path is not a directory: "${t}"`);return er(e,n,r)?(tr(e,n,!1,r),Ur(e,n),hr({affectedAncestorIds:Gr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function Zi(e,t){return t<0||t>=zi(e)?null:Qi(e,e.snapshot.rootId,t,-1)}function Qi(e,t,n,r){let i=B(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Yt(e.snapshot.nodes,i,n):R(a,`store.getVisibleSlice.selectChildIndex`,()=>Yt(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return $i(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function $i(e,t,n,r){if(!I(V(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=ea(e,t,r);if(n===0)return i;let a=V(e,i.terminalNodeId);if(!I(a)||!er(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Qi(e,i.terminalNodeId,n-1,i.visibleDepth)}function ea(e,t,n){return I(V(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Fr(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:R(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Fr(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function ta(e,t){let n=V(e,t);if(!I(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Pr(e,r)!==t}function na(e,t){let n=V(e,t.terminalNodeId);if(I(n)){let r=B(e,t.terminalNodeId);if(er(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:$i(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=V(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=B(e,n),o=Wt(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return $i(e,s,0,i);ta(e,r)&&i--,r=n}}function ra(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function ia(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Li);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Ri(o,y);let x,S=_;if(I(v))S=f?Fr(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:z(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&I(C)&&er(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function aa(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!I(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:z(e,f)};continue}let h=l?Fr(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=oa(e,g);let _=i[h];_!=null&&I(_)&&er(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function oa(e,t){let n=V(e,t.terminalNodeId),r=I(n)?sa(e,t):null,i=z(e,t.terminalNodeId),a=Mn(e.snapshot.segmentTable,n.nameId),o=I(n)&&B(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Ir(e,t.headNodeId).map(n=>{let r=V(e,n);return{isTerminal:n===t.terminalNodeId,name:Mn(e.snapshot.segmentTable,r.nameId),nodeId:n,path:z(e,n)}}):R(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Ir(e,t.headNodeId).map(n=>{let r=V(e,n);return{isTerminal:n===t.terminalNodeId,name:Mn(e.snapshot.segmentTable,r.nameId),nodeId:n,path:z(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:I(n)&&er(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:I(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function sa(e,t){if(t.headNodeId===t.terminalNodeId)return rr(e,t.terminalNodeId);let n=Ir(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=rr(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function ca(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!I(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&Zt(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&I(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,Zt(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function la(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var ua=class e{#e;constructor(e={}){let t=fn(e),n=R(t,`store.builder.create`,()=>new Yn(e));if(e.preparedInput!=null){let t=Kn(e.preparedInput);t==null?n.appendPreparedPaths(Gn(e.preparedInput),!1):n.appendPresortedPaths(t,qn(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(R(t,`store.preparePathEntries`,()=>Jn(r,e)))}let r=R(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=R(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=R(t,`store.state.create`,()=>Xn(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:R(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||la(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&R(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?R(t,`store.state.initializeOpenVisibleCounts`,()=>ca(this.#e)):R(t,`store.state.recomputeCounts`,()=>Wr(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Hn(e,t)}static prepareInput(e,t={}){return Un(e,t)}static preparePresortedInput(e){return Wn(e)}list(e){return R(this.#e.instrumentation,`store.list`,()=>Lr(this.#e,e))}add(e){R(this.#e.instrumentation,`store.add`,()=>{let t=zi(this.#e);wr(this.#e,Sr(this.#e,t,Rr(this.#e,e)))})}remove(e,t={}){R(this.#e.instrumentation,`store.remove`,()=>{let n=zi(this.#e);wr(this.#e,Sr(this.#e,n,zr(this.#e,e,t)))})}move(e,t,n={}){R(this.#e.instrumentation,`store.move`,()=>{let r=zi(this.#e),i=Br(this.#e,e,t,n);i!=null&&wr(this.#e,Sr(this.#e,r,i))})}batch(e){Cr(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return R(this.#e.instrumentation,`store.getVisibleCount`,()=>zi(this.#e))}getVisibleSlice(e,t){return R(this.#e.instrumentation,`store.getVisibleSlice`,()=>Gi(this.#e,e,t))}getVisibleRowContext(e){return R(this.#e.instrumentation,`store.getVisibleRowContext`,()=>Wi(this.#e,e))}getVisibleTreeProjection(){return qi(this.#e)}getVisibleTreeProjectionData(e){return Ki(this.#e,e)}getVisibleIndex(e){return R(this.#e.instrumentation,`store.getVisibleIndex`,()=>Ji(this.#e,e))}getPathInfo(e){return R(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=Kr(this.#e,e);if(t==null)return null;let n=V(this.#e,t);return{depth:an(n),kind:I(n)?`directory`:`file`,path:z(this.#e,t)}})}isExpanded(e){return R(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=V(this.#e,t);return er(this.#e,t,n)})}expand(e){R(this.#e.instrumentation,`store.expand`,()=>{let t=zi(this.#e),n=Yi(this.#e,e);n!=null&&wr(this.#e,Sr(this.#e,t,n))})}collapse(e){R(this.#e.instrumentation,`store.collapse`,()=>{let t=zi(this.#e),n=Xi(this.#e,e);n!=null&&wr(this.#e,Sr(this.#e,t,n))})}on(e,t){return ur(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return rr(this.#e,t)}markDirectoryUnloaded(e){R(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(B(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=zi(this.#e);ar(this.#e,t),wr(this.#e,Sr(this.#e,n,gr({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return R(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=zi(this.#e),r=ir(this.#e,t);return wr(this.#e,Sr(this.#e,n,_r({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return R(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||rr(this.#e,n)!==`loading`||!sr(this.#e,n,e.attemptId))return!1;let r=z(this.#e,n);this.validateChildPatch(r,t);let i=zi(this.#e),a=[];for(let e of t.operations){da(r,e);let t=zi(this.#e);switch(e.type){case`add`:a.push(Sr(this.#e,t,Rr(this.#e,e.path)));break;case`remove`:a.push(Sr(this.#e,t,zr(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Br(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Sr(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return wr(this.#e,Sr(this.#e,i,vr({affectedAncestorIds:Gr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:z(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return R(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=zi(this.#e),r=or(this.#e,t,e.attemptId);return wr(this.#e,Sr(this.#e,n,yr({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:z(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return R(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=zi(this.#e),i=cr(this.#e,n,e.attemptId,t);return wr(this.#e,Sr(this.#e,r,br({affectedAncestorIds:Gr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:z(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return R(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(Fi(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=zi(this.#e),n=Ii(this.#e,e.mode??`stable`);return wr(this.#e,Sr(this.#e,t,xr({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=B(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??gn(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=vn(Tn(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!I(V(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=V(this.#e,n);er(this.#e,n,i)||(tr(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=V(this.#e,e);if(!er(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=Kr(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!I(V(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!I(V(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=V(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=V(this.#e,e),r=Pr(this.#e,e);if(!er(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function da(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var fa=e=>e.startsWith(`f::`)?e.slice(3):e;function pa(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function ma(e,t){return e===``?t:`${e}/${t}`}function ha({files:e,path:t,isFolder:n,nextBasename:r}){let i=fa(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=pa(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=ma(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function ga(e){return e.endsWith(`/`)}function _a(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function va(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function ya(e,t){return t.includes(e)?va(t):[e]}function ba(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function xa(e,t){return{draggedPaths:e,target:t}}function Sa(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(ga(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Ca(e,t){return t.kind===`root`||t.directoryPath==null?_a(e):t.directoryPath}function wa(e,t){let n=e.map(e=>{let n=Ca(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function Ta(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Ea(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!Ta(ua.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function Da(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function Oa(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function ka(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function Aa(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return ka(e,t.path)?n?e:null:e;case`move`:return Oa(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=Aa(r,e,n),r==null)return null;return r}}}function ja(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Ma(e){switch(e.operation){case`add`:return{...ja(e),operation:`add`,path:e.path};case`remove`:return{...ja(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...ja(e),from:e.from,operation:`move`,to:e.to}}}function Na(e){return{...ja(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Ma(e)),operation:`batch`}}function Pa(e){switch(e.operation){case`add`:case`remove`:case`move`:return Ma(e);case`batch`:return Na(e);default:return null}}function Fa(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Ia(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function La(e){return Ia(e).at(-1)??null}function Ra(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function za(e){return e.endsWith(`/`)}var Ba=e=>e.toLowerCase();function Va(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Ha(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Ua(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Wa=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},Ga=Symbol(`FILE_TREE_RENAME_VIEW`),Ka=512,qa=512;function Ja(e){return e===`top`||e===`center`?e:`nearest`}function Ya(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Ia(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Xa(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Ya(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Za=class e{static{Object.defineProperty(e.prototype,Ga,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Ea({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=La(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Ja(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=qa){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=ya(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=xa(t.draggedPaths,n);(Sa(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}ba(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=xa(e.draggedPaths,t);if(Sa(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=wa(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=za(r),a=Ha(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Ia(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=Va(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,za(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,za(e)?{recursive:!0}:void 0);return}let t=za(e),n=ha({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Ha(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(Ua(n.sourcePath,t),Ua(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=Ea({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!Fa(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=La(e),n=Ra(e,t),r=null,i=null;for(let e of this.#be()){if(La(e)!==t)continue;let a=Ra(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=Ia(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!Fa(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new ua({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of Ia(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Ba),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Ba),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of Ia(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Wa(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of Ia(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of Ia(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Xa(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,Ka)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=Aa(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=Aa(this.#c,e,!0),r=[...this.#B].map(t=>Aa(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=Aa(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return Fa(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&Da(e)&&(this.#i=null);let t=Da(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=Pa(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},Qa=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function $a(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function eo(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function to(e,t){return t?`${e}/`:e}function no(e,t=null){let n=Qa(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=io(t);e!=null&&so({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function ro(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=ao(e);t!=null&&(c=oo({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=io(e);t!=null&&(c=so({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:uo(i),statusByPath:i}:e}function io(e){return ao(e.path)}function ao(e){let t=$a(e);if(t!=null)return{canonicalPath:to(t.path,t.isDirectory),isDirectory:t.isDirectory}}function oo({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a==null?!1:(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),lo(t,n,e),!0)}function so({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s===a?!1:(s??co(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function co(e,t,n){for(let r of eo(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function lo(e,t,n){for(let r of eo(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function uo(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var fo=e=>e.trim().toLowerCase(),po=e=>e.split(`/`).at(-1)??e,mo=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function ho(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function go(e){let t=F(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(fo(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=po(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return ho(l,e);for(let[t,n]of a)if(c.includes(t))return ho(n,e);let u=mo(s);for(let t of u){let n=i.get(t);if(n!=null)return ho(n,e)}let d=St(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return ho(t,e)}return{name:bt(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:ho(s,e)}}}var H,_o,vo,yo,bo,xo,So,Co,wo,To,Eo={},Do=[],Oo=Array.isArray,ko=Do.slice,Ao=Object.assign;function jo(e){e&&e.parentNode&&e.remove()}function Mo(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ko.call(arguments,2):n),No(e,o,r,i,null)}function No(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++_o,__i:-1,__u:0};return i==null&&H.vnode!=null&&H.vnode(a),a}function Po(e){return e.children}function Fo(e,t){this.props=e,this.context=t,this.__g=0}function Io(e,t){if(t==null)return e.__?Io(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Io(e):null}function Lo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Lo(e)}}function Ro(e){(8&e.__g||!(e.__g|=8)||!vo.push(e)||bo++)&&yo==H.debounceRendering||((yo=H.debounceRendering)||queueMicrotask)(zo)}function zo(){for(var e,t,n,r,i,a,o,s,c=1;vo.length;)vo.length>c&&vo.sort(xo),e=vo.shift(),c=vo.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Ao({},r)).__v=r.__v+1,H.vnode&&H.vnode(n),qo(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??Io(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Yo(a,n,o),n.__e!=i&&Lo(n)));bo=0}function Bo(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Do,b=t.length;for(c=Vo(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Eo:y[m.__i]||Eo,m.__i=f,_=qo(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Qo(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Ho(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Vo(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?No(null,o,null,null,null):Oo(o)?No(Po,{children:o},null,null,null):o.constructor==null&&o.__b>0?No(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Uo(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Io(s)),$o(s,s));return r}function Ho(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Ho(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Io(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Uo(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Wo(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Go(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Wo(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Wo(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(So,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=Co,e.addEventListener(t,a?To:wo,a)):e.removeEventListener(t,a?To:wo,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Ko(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Co++;else if(t.u<n.l)return;return n(H.event?H.event(t):t)}}}function qo(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,T,E,D,te,O,k,A=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=H.__b)&&d(t);n:if(typeof A==`function`)try{if(v=t.props,y=`prototype`in A&&A.prototype.render,b=(d=A.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new A(v,x):(t.__c=f=new Fo(v,x),f.constructor=A,f.render=es),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&A.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ao({},f.__s)),Ao(f.__s,A.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&A.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&A.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=H.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=Ao({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),T=d,d!=null&&d.type===Po&&d.key==null&&(T=Xo(d.props.children)),s=Bo(e,Oo(T)?T:[T],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(E=0,D=!1,t.__u|=c?160:128,t.__c.__z=[],te=0;te<a.length;te++)(O=a[te])==null||D||(O.nodeType==8&&O.data==`$s`?(E>0&&t.__c.__z.push(O),E++,a[te]=null):O.nodeType==8&&O.data==`/$s`?(--E>0&&t.__c.__z.push(O),D=E===0,s=a[te],a[te]=null):E>0&&(t.__c.__z.push(O),a[te]=null));if(!D){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(k=a.length;k--;)jo(a[k]);Jo(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Jo(t);H.__e(e,t,n)}else s=t.__e=Zo(n.__e,t,n,r,i,a,o,c,l,u);return(d=H.diffed)&&d(t),128&t.__u?void 0:s}function Jo(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Jo)}function Yo(e,t,n){for(var r=0;r<n.length;r++)Qo(n[r],n[++r],n[++r]);H.__c&&H.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){H.__e(e,t.__v)}})}function Xo(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Oo(e)?e.map(Xo):Ao({},e)}function Zo(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(H.__m&&H.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=ko.call(e.childNodes),v=n.props||Eo,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Go(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Go(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Bo(b==`template`?e.content:e,Oo(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Io(n,0),s,c,l),a!=null)for(u=a.length;u--;)jo(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Go(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Go(e,u,g,v[u],i))}return e}function Qo(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){H.__e(e,n)}}function $o(e,t,n){var r,i;if(H.unmount&&H.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Qo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){H.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&$o(r[i],t,n||typeof e.type!=`function`);n||jo(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function es(e,t,n){return this.constructor(e,n)}function ts(e,t){var n,r,i,a;t==document&&(t=document.documentElement),H.__&&H.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Mo(Po,null,[e]),i=[],a=[],qo(t,e,r||Eo,Eo,t.namespaceURI,r?null:t.firstChild?ko.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Yo(i,e,a)}function ns(e,t){e.__u|=32,ts(e,t)}H={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw bo=0,e}},_o=0,Fo.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ao({},this.state);typeof e==`function`&&(e=e(Ao({},n),this.props)),e&&Ao(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ro(this))},Fo.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ro(this))},Fo.prototype.render=Po,vo=[],bo=0,xo=function(e,t){return e.__v.__b-t.__v.__b},So=/(PointerCapture)$|Capture$/i,Co=0,wo=Ko(!1),To=Ko(!0);var rs=0;Array.isArray;function U(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--rs,__i:-1,__u:0,__source:i,__self:a};return H.vnode&&H.vnode(l),l}var is=16,as=16,os={};function ss({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=os[e]??{width:is,height:as},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return U(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:U(`use`,{href:c})})}var cs=e=>e!==void 0&&/\s/.test(e),ls=(e,t)=>{let n=t=>cs(e[t-1])||cs(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},us=e=>ls(e,Math.ceil(e.length/2)),ds=e=>{if(e.length<2)return[e,``];let t=us(e);return[e.slice(0,t),e.slice(t)]},fs=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:us(e);return[e.slice(0,r),e.slice(r)]},ps=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},ms=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},hs=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},gs=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function _s({children:e,marker:t,variant:n=`default`}){"use no memo";return U(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:U(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?U(`span`,{"data-truncate-fade":!0}):t})})}function vs(e){"use no memo";let{mode:t,children:n}=e;return U(`div`,{children:[U(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?U(`span`,{children:n}):n}),U(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?U(`span`,{children:n}):n})]})}function ys({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=U(vs,{mode:t,children:e},`content`),o=U(_s,{marker:n,mode:t,variant:r},`marker`),s=U(`div`,{"data-truncate-fill":!0},`fill`);return U(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:U(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function bs({children:e,...t}){"use no memo";return U(ys,{mode:`truncate`,...t,children:e})}function xs({children:e,...t}){"use no memo";return U(ys,{mode:`fruncate`,...t,children:e})}function Ss({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=U(bs,{...s,children:t[0]}),l=U(xs,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return U(`div`,{className:a,style:o});if(e.length<i)return U(n===`end`?xs:bs,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=ds:r===`extension`?t=fs:r===`leaf-path`&&(t=ps);else if(typeof r==`number`)t=ms,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=hs:e===`first`&&(t=gs)}else typeof r==`function`&&(t=r);t??=ds;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=U(bs,{...s,..._,children:f}),l=U(xs,{...s,...v,children:p})}return U(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[U(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),U(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var Cs={endIndex:-1,startIndex:-1};function ws(e,t,n){return Math.min(Math.max(e,t),n)}function Ts(e,t){return e<0||t<e?Cs:{endIndex:t,startIndex:e}}function Es(e){return e.startIndex<0||e.endIndex<e.startIndex}function Ds(e,t){return Es(e)?0:(e.endIndex-e.startIndex+1)*t}function Os(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function ks(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function As(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function js(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function Ms(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function Ns(e,t,n){if(e.length===0||t<=0)return[];let r=Ms(e),i=As(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=js(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function Ps(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=ws(t.scrollTop,0,o),c=t.stickyRows??Ns(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=Os(s,n,t.itemHeight),m=Os(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?Cs:Ts(m,ks(u+d,n,t.itemHeight)),y=g+1,b=Es(v)?Cs:Ts(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Ds(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:Es(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var Fs={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Is={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Ls=`Contains git status items`;function Rs(e){return e.current?!0:(e.current=!0,!1)}function zs(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function Bs(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return zs({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function Vs(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function Hs(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function Us(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function Ws(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Gs(e,t){return e!=null&&e>0?e:t}function Ks(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function qs(e,t,n,r,i=0){let a=zs({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Js(e,t,n,r,i,a,o=0){let s=Bs({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Ys(e,t,n,r,i,a){let o=Vs({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Xs(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Zs(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function Qs({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return U(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function $s(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function ec(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var tc,W,nc,rc,ic=Object.is,ac=0,oc=[],G=H,sc=G.__b,cc=G.__r,lc=G.diffed,uc=G.__c,dc=G.unmount,fc=G.__;function pc(e,t){G.__h&&G.__h(W,e,ac||t),ac=0;var n=W.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function mc(e){return ac=1,hc(Ec,e)}function hc(e,t,n){var r=pc(tc++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ec(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);ic(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,ic(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};W.__f=!0;var a=W.shouldComponentUpdate,o=W.componentWillUpdate;W.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},W.shouldComponentUpdate=i}return r.__N||r.__}function gc(e,t){var n=pc(tc++,3);!G.__s&&Tc(n.__H,t)&&(n.__=e,n.u=t,W.__H.__h.push(n))}function _c(e,t){var n=pc(tc++,4);!G.__s&&Tc(n.__H,t)&&(n.__=e,n.u=t,W.__h.push(n))}function K(e){return ac=5,vc(function(){return{current:e}},[])}function vc(e,t){var n=pc(tc++,7);return Tc(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function yc(e,t){return ac=8,vc(function(){return e},t)}function bc(){for(var e;e=oc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Cc),e.__H.__h.forEach(wc),e.__H.__h=[]}catch(t){e.__H.__h=[],G.__e(t,e.__v)}}G.__b=function(e){W=null,sc&&sc(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),fc&&fc(e,t)},G.__r=function(e){cc&&cc(e),tc=0;var t=(W=e.__c).__H;t&&(nc===W?(t.__h=[],W.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Cc),t.__h.forEach(wc),t.__h=[],tc=0)),nc=W},G.diffed=function(e){lc&&lc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(oc.push(t)!==1&&rc===G.requestAnimationFrame||((rc=G.requestAnimationFrame)||Sc)(bc)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),nc=W=null},G.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Cc),e.__h=e.__h.filter(function(e){return!e.__||wc(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],G.__e(n,e.__v)}}),uc&&uc(e,t)},G.unmount=function(e){dc&&dc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Cc(e)}catch(e){t=e}}),n.__H=void 0,t&&G.__e(t,n.__v))};var xc=typeof requestAnimationFrame==`function`;function Sc(e){var t,n=function(){clearTimeout(r),xc&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);xc&&(t=requestAnimationFrame(n))}function Cc(e){var t=W,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),W=t}function wc(e){var t=W;e.__c=e.__(),W=t}function Tc(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!ic(t,e[n])})}function Ec(e,t){return typeof t==`function`?t(e):t}function Dc(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:U(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return U(Po,{children:[U(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:U(bs,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Oc(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function kc(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function Ac(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function jc({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=Ps(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:Ac(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?Ac(u,1,t,o):i&&r<=0&&c.length>0?Ns(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var Mc=400,Nc=10,Pc=40,Fc=18;function Ic(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?Lc(e,t,n):a instanceof HTMLElement?a:null}function Lc(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function Rc(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function zc(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Bc(){return navigator.vendor!==`Apple Computer, Inc.`}function Vc(e,t){let n=e-t.top;if(n<Pc)return-Math.ceil((Pc-Math.max(0,n))/Pc*Fc);let r=t.bottom-e;return r<Pc?Math.ceil((Pc-Math.max(0,r))/Pc*Fc):0}function Hc(e,t){if(e!=null){let t=Fs[e];return t==null?null:{text:t,title:Is[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Ls}:null}function Uc(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function Wc(e){return e!=null&&`toggle`in e}function Gc(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Kc(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function qc(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Jc(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Yc(e,t){return t&&Jc(e)||(e.ctrlKey||e.metaKey)&&Gc(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Xc=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Zc(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Qc(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function $c(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function el(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function tl(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function nl(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function rl(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function il(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function al(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=il(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function ol(e,t){return{kind:e.kind,name:kc(e),path:t}}function sl(e){return e==null?void 0:`${e}__tree`}function cl(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function ll(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function ul(e,t){if(e==null)return null;if(`text`in e)return U(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?ll(e.icon)?t(e.icon):{name:e.icon}:ll(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return U(`span`,{title:e.title,children:U(ss,{...n})})}function dl(e){e!=null&&Hs(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function fl(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Oc(e);return U(Po,{children:[e.depth>0?U(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>U(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,U(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?U(ss,{...t(`file-tree-icon-chevron`)}):U(ss,{...t(`file-tree-icon-file`,u)})}),U(`div`,{"data-item-section":`content`,children:e.isFlattened?Dc(e,c,a):c??U(Ss,{minimumLength:5,split:`extension`,children:e.name})}),i?U(`div`,{"data-item-section":`decoration`,children:r==null?null:ul(r,t)}):null,s?U(`div`,{"data-item-section":`git`,children:ul(o,t)}):null,n?U(`div`,{"data-item-section":`action`,children:l?U(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:U(ss,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function pl(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:w,contextMenuRightClickEnabled:T,registerRenameInput:E,registerButton:D,resolveIcon:te,renderDecorationForRow:O,openContextMenuForRow:k,onRowClick:A,onKeyDown:ne}=e,j=Oc(t),{isParked:re=!1,mode:ie=`flow`,style:ae}=r,oe=ie===`sticky`,se=_?.get(j)??null??Uc(t.ancestorPaths,v,y),ce=t.kind===`directory`&&(b?.has(j)??!1),le=O(t,j),ue=Hc(se,ce),de=S&&ee,fe=le!=null||x||de,pe=de&&w===`always`,me=a.getPath()===j,he=me?a.getValue():``,ge=oe||!me?null:U(Qs,{ref:E,ariaLabel:`Rename ${kc(t)}`,isFlattened:t.isFlattened,value:he,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),_e=fl(t,te,{actionLaneEnabled:de,customDecoration:le,decorationLaneEnabled:fe,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ue,gitLaneActive:x,renameInput:ge,showDecorativeActionAffordance:pe}),ve={...$s({ariaLabel:kc(t),domId:t.isFocused?cl(h,j,re):void 0,extraStyle:ae,features:{actionLaneEnabled:de,contextMenuButtonVisibility:de?w:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:re,itemHeight:g,mode:ie,row:t,state:{containsGitChange:ce,effectiveGitStatus:se,isContextHovered:s===j,isDragTarget:l?.kind===`directory`&&l.directoryPath===j,isDragging:c?.has(j)===!0,isFocusRinged:t.isFocused&&o===j},targetPath:j}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),T&&(i.focusMountedPathFromInput(j),k(t,j,{anchorRect:$c(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:oe?void 0:()=>{i.focusMountedPathFromInput(j)},onKeyDown:oe?void 0:ne,ref:e=>{D(j,e)}};return!oe&&me?U(`div`,{...ve,children:_e}):U(`button`,{...ve,type:`button`,draggable:u&&!re,onDragEnd:u&&!re?p:void 0,onDragStart:u&&!re?e=>{f(e,t,j)}:void 0,onMouseDown:e=>{if(oe){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!re?e=>{m(e,t,j)}:void 0,onClick:e=>{A(e,t,j,ie)},children:_e})}function ml(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Oc(e))).map((n,r)=>pl(e,n,t.start+r))}function hl({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Et,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=K(null),v=K(null),y=K(!1),b=K(null),x=K(null),S=K(null),C=K(null),ee=K(null),w=K(new Map),T=K(new Map),E=K(()=>{}),D=K(null),te=K(0),O=K(!1),k=K(null);k.current!==t&&(O.current=!1,k.current=t);let A=K(!1),ne=K(null),j=K(null),re=K(!1),se=K(null),ce=K(null),le=K(null),ue=K(null),de=K(null),fe=K(null),pe=K(null),me=K(null),he=K(!1),ge=K(null),_e=K(null),ve=K(null),ye=K(null),be=vc(()=>new Map,[]),[,xe]=mc(0),Se=K(!1),[Ce,we]=mc(null),[Te,Ee]=mc(null),[De,Oe]=mc(null),[ke,Ae]=mc(null),[je,Me]=mc(0),[M,Ne]=mc(null),Pe=K(M);Pe.current=M;let Fe=K(null),Ie=K(null),Le=K(null),Re=K(null),ze=K(null),Be=K(!1),Ve=()=>{Ie.current=null,Le.current=null,Re.current=null},He=(e,t)=>{Ie.current=e,Le.current=null,Re.current=t==null?null:{path:e,scrollTop:t}},Ue=(e,t)=>{Ie.current=null,Le.current={path:e,viewportOffset:t},Re.current=null},We=K(d===`retain`&&t.isSearchOpen()),[Ge,Ke]=mc(p);gc(()=>{p||Ke(!1)},[p]);let qe=K(!1),Je=yc(()=>{qe.current=!0,Ke(e=>e&&!1)},[]),[Ye,Xe]=mc(()=>jc({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ze,Qe]=mc(!1);gc(()=>{Qe(!0)},[]);let $e=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,et=e?.contextMenu?.triggerMode??($e?`right-click`:`both`),tt=et===`both`||et===`button`,nt=e?.contextMenu?.buttonVisibility??`when-needed`,rt=et===`both`||et===`right-click`;_c(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;ze.current=t,Ee(t),Ae(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Be.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let it=yc((e,t)=>{tl(w.current,e,t)},[]),at=yc((e,t)=>{tl(T.current,e,t)},[]),ot=yc(e=>{x.current=e},[]),st=yc(e=>nl(e,T.current,w.current),[]),ct=n!=null||r!=null||i!=null,{resolveIcon:lt}=vc(()=>go(a),[a]),ut=t[Ga](),dt=ut.getPath(),ft=dt!=null,pt=t.isSearchOpen(),mt=t.getSearchValue(),N=t.getFocusedPath(),P=t.getFocusedIndex(),ht=t.getScrollRequest(),gt=t.isDragAndDropEnabled(),_t=t.getDragSession(),vt=vc(()=>_t==null?null:new Set(_t.draggedPaths),[_t]),yt=_t?.target??null,bt=_t?.primaryPath??null,xt=sl(o),{overlayHeight:St,overlayRows:Ct,snapshot:F,visibleRows:wt}=Ye,Tt=F.physical.viewportHeight,Dt=vc(()=>({end:F.window.endIndex,start:F.window.startIndex}),[F.window.endIndex,F.window.startIndex]),Ot=Ct,kt=F.sticky.rows,At=F.physical.totalHeight,jt=F.sticky.height,Mt=vc(()=>new Set(kt.map(e=>Oc(e.row))),[kt]),Nt=P>=0&&P>=Dt.start&&P<=Dt.end,Pt=yc((e,t)=>u?.({item:ol(e,t),row:e})??null,[u]),Ft=yc(e=>Hs(e==null?null:w.current.get(e)??null)?!0:Hs(S.current),[]),It=yc(e=>{Ft(t.focusNearestPath(e))},[t,Ft]),Lt=K(It);Lt.current=It;let Rt=K(!0),zt=K(()=>{}),Bt=yc((t=!0)=>{let n=Pe.current;n!=null&&(Rt.current=Rt.current&&t,Ne(null),e?.contextMenu?.onClose?.(),Rt.current&&It(n.path))},[e?.contextMenu,It]);zt.current=Bt;let Vt=yc(e=>{let t=e==null?null:el(S.current,e);Oe(e=>e===t?e:t)},[]),Ht=yc((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=st(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;He(n,e?.scrollTop??null),A.current=!0,we(e=>e===n?e:n)}i.focus(),Vt(a),Rt.current=!0,Ne({anchorRect:r?.anchorRect??null,item:ol(e,n),path:n,source:r?.source??`keyboard`})},[t,st,Vt]),Ut=yc(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=Ws(e,Tt);se.current=P<0||e==null?null:Math.max(0,Math.min(P*s-e.scrollTop,Math.max(0,t-s))),re.current=!0}t.startRenaming(e)!==!1&&(Ae(`focus`),xe(e=>e+1))}},[t,P,s,l,Tt]),Wt=yc((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=Ws(i,Tt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:jc({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return A.current=!0,Ys(i,a,s,l,u,d),E.current(),Fe.current=n?e:null,!0},[t,s,c,Tt,h]),Gt=()=>y.current===!0||ye.current!=null||he.current===!0,Kt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),qt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Jt=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Yt=()=>{fe.current?.remove(),fe.current=null},Xt=()=>{qt(ce.current),ce.current=null,de.current=null},Zt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Qt=()=>{me.current?.(),me.current=null,ye.current!=null&&(clearTimeout(ye.current),ye.current=null),he.current=!1,ge.current=null,ve.current=null,_e.current!=null&&(_e.current.setAttribute(`draggable`,`true`),_e.current.style.removeProperty(`touch-action`),_e.current=null),Yt(),Jt(),Xt(),pe.current=null},$t=(e,n)=>{let r=S.current?.getRootNode(),i=Rc(Ic(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},en=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Jt();return}let r=t.getItem(e.directoryPath),i=Wc(r)?r:null;if(i==null||i.isExpanded()){Jt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Jt(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},tn=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Vc(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,E.current()),en($t(e.clientX,e.clientY)),ce.current=Kt(tn)},nn=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=Kt(tn)},rn=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Qt(),Yt(),Jt(),Xt(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Bc())){let t=zc(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Zt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},an=()=>{Yt(),Jt(),Xt(),pe.current=null,t.cancelDrag()},on=(e,n,r)=>{if(ye.current!=null||he.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ve.current={clientX:i.clientX,clientY:i.clientY},_e.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!he.current;ye.current!=null&&(clearTimeout(ye.current),ye.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),_e.current===a&&(_e.current=null),ve.current=null)},s=e=>{let t=e.touches[0],n=ve.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=Nc*Nc||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ye.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),_e.current===a&&(_e.current=null),ve.current=null;return}he.current=!0,_e.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=zc(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Zt(s),fe.current=s,ge.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ge.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),en($t(t.clientX,t.clientY)),nn(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&$t(n.clientX,n.clientY),t.completeDrag(),Qt()},u=()=>{t.cancelDrag(),Qt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},Mc)},I=e=>{if(M!=null){if(e.key===`Escape`){Bt(),e.preventDefault(),e.stopPropagation();return}Xc.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ut.isActive()){if(e.key===`Escape`)ut.cancel();else if(e.key===`Enter`)ut.commit();else return;Ae(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ut(N??void 0),e.preventDefault(),e.stopPropagation();return}if(pt){if(e.key===`Escape`)re.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=Ws(n,Tt);se.current=P<0||n==null?null:Math.max(0,Math.min(P*s-n.scrollTop,Math.max(0,r-s))),re.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ae(`focus`),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Kc(e)){t.openSearch(e.key),xe(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=$e&&Jc(e),r=Yc(e,$e),i=r&&S.current!=null?Us(S.current):null,a=r?new Set(rl(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==N&&a.has(o)){let e=C.current;He(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Wc(p)?p:null,h=u!=null&&(Mt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=nl(u,T.current,w.current);e==null||n==null?y=!1:Ht(e,u)}else if((e.ctrlKey||e.metaKey)&&Gc(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ae(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Mt.has(b)||a.has(b)),ee=g&&b!==u,E=n&&c&&o===u&&b===u;if((h||E)&&b!=null&&(ee&&x||E))He(b,v?.scrollTop??null),A.current=!0,we(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Ue(b,al(S.current,v,i,u,s,jt,Tt)),A.current=!0,we(e=>e===b?e:b)):Ve()}xe(e=>e+1),e.preventDefault(),e.stopPropagation()};_c(()=>{if(!(!f||!pt)){if(We.current){We.current=!1;return}Hs(ee.current)}},[pt,f]),_c(()=>{let e=x.current;switch(Zs({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:dt})){case`reset`:j.current=null;return;case`reveal-canonical`:dt!=null&&Wt(dt,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Fe.current=null,j.current=dt,Hs(e),e.select());return}},[Dt.end,Dt.start,dt,Wt,Mt]),_c(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Us(e)?.dataset.itemPath??null;we(e=>e===t?e:t)},i=()=>{n(),A.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Us(e)!=null){r();return}A.current=!1,we(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),A.current=!1,we(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;we(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),_c(()=>{let e=S.current;e!=null&&(F.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[F.physical.scrollTop]),_c(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;D.current=Ws(n,g);let a=()=>{let e=t.getVisibleCount(),r=Gs(D.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Xe(jc({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!O.current){O.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Gs(D.current,g),i=t.getVisibleRows(e,e)[0]??null;qs(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}E.current=a;let o=t.subscribe(()=>{Rs(Se)&&xe(e=>e+1),a()}),l=()=>{Be.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Me(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i==null||Be.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200))},p=()=>{if(a(),n.scrollTop>0&&d(),Pe.current!=null&&y.current&&zt.current(),Be.current===!0){y.current=!1;return}Ee(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{D.current=(e[0]==null?null:Ks(e[0]))??Ws(n,g),a()}):null;return x?.observe(n),()=>{E.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,D.current=null,x?.disconnect()}},[t,g,s,c,h]),_c(()=>{$e||M==null||Bt(!1)},[Bt,$e,M]);let sn=vc(()=>M==null?null:`${M.path}::${M.source}`,[M]);_c(()=>{if(sn==null){m?.clearSlotContent(ae);return}let t=Pe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Qc(n.getBoundingClientRect()),close:e=>{zt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Rt.current&&Lt.current(Pe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(ae,i),e?.contextMenu?.onOpen?.(t.item,r),dl(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&dl(i)}),()=>{m?.clearSlotContent(ae)}},[sn,e?.contextMenu,m]),_c(()=>{M!=null&&t.getItem(M.path)==null&&Bt()},[Bt,M,t]),_c(()=>{if(M==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Zc(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Bt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Bt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Bt,M]),_c(()=>{let e=C.current,n=S.current;if(e==null||n==null){ne.current=N;return}let r=N==null?null:w.current.get(N)??null,i=Us(n),a=i?.dataset.itemPath??null,o=ft&&x.current===i,c=f&&ee.current===i,l=re.current&&!pt,u=se.current??0,d=Fe.current,p=Ie.current,m=Le.current,g=Re.current,_=i!=null,v=A.current||_,y=ne.current!==N,b=p!=null&&p===N&&N!=null,T=!1,D=!1;if(ht!=null&&ht.id!==te.current){te.current=ht.id;let n=ht.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,Tt-s))):jt;T=!0,D=Js(e,n,s,Tt,At,ht.offset,t)}t.clearScrollRequest(ht.id)}let O=!T&&l&&Ys(e,P,s,Tt,At,u),k=!T&&d!=null&&d===N&&Ys(e,P,s,Tt,At,jt),j=!T&&m!=null&&m.path===N&&Ys(e,P,s,Tt,At,m.viewportOffset),ie=!T&&g!=null&&g.path===N&&e.scrollTop!==g.scrollTop;if(ie&&(e.scrollTop=g.scrollTop),(ie||D||k||j||O||v&&y&&d!==N&&!b&&qs(e,P,s,Tt,jt))&&E.current(),T){ne.current=N;return}if(!v){ne.current=N;return}if(o){ne.current=N;return}if(c&&!l){ne.current=N;return}if(r==null){l&&P>=0&&(Ys(e,P,s,Tt,At,u),E.current()),ne.current=N;return}(y||l||d===N||p===N||m?.path===N||g?.path===N||a==null||a!==N)&&(Hs(r),d===N&&(Fe.current=null),p===N&&(Ie.current=null),m?.path===N&&(Le.current=null),g?.path===N&&(Re.current=null),re.current=!1,se.current=null),ne.current=N},[t,P,N,Nt,s,ft,pt,Dt,Tt,f,ht,h,jt,At,wt]);let L=P>=0&&P>=F.visible.startIndex&&P<=F.visible.endIndex,cn=N!=null&&Ot.some(e=>Oc(e.row)===N),ln=L||cn,un=tt&&A.current===!0&&ln?N:null,dn=ke===`pointer`?Te:null,fn=M?.path??ze.current??dn??un??Te,R=M?.source===`right-click`;_c(()=>{y.current&&M==null||Vt(st(fn))},[M,st,Dt,Tt,je,Ot,fn,Vt,wt]);let pn=yc(e=>{if(y.current||Zc(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ae(e=>e===`pointer`?e:`pointer`),Ee(e=>e===i?e:i)},[]),mn=yc(()=>{Ee(null)},[]);_c(()=>{if(!gt)return;let e=()=>{Qt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Qt(),t.cancelDrag()}},[t,gt]);let hn=e=>{if(!gt||t.getDragSession()==null||he.current)return;let n=Rc(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),en(t.getDragSession()?.target??null),nn(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},gn=e=>{if(!gt||t.getDragSession()==null||he.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Jt(),Xt(),t.setDragTarget(null))},_n=e=>{!gt||t.getDragSession()==null||he.current||(e.preventDefault(),$t(e.clientX,e.clientY),t.completeDrag(),Yt(),Jt(),Xt(),pe.current=null)},vn=F.window.height,yn=F.window.offsetTop,bn=Math.min(0,Tt-vn),xn=Math.min(0,Tt-vn-jt),Sn=Ce===N||re.current,Cn=N!=null&&Sn&&!Nt&&P>=0?wt[P]??t.getVisibleRows(P,P)[0]??null:null,wn=Cn==null?null:Xs(P,s,Dt,vn),Tn=pe.current,En=bt!=null&&Tn!=null&&Tn.path===bt&&Tn.index>=Dt.start&&Tn.index<=Dt.end,Dn=bt!=null&&Tn!=null&&Tn.path===bt&&!En&&Tn.path!==Cn?.path?Tn:null,On=Dn==null?null:Xs(Dn.index,s,Dt,vn),kn=qc((P>=0?wt[P]??t.getVisibleRows(P,P)[0]??null:null)?.ancestorPaths.at(-1)??null),An=pt&&N!=null?cl(o,N,!Nt):void 0,jn=M?.path??(pt?N:Ce),Mn=M?.path??Te,Nn=st(fn),Pn=$e&&tt&&!R&&!ft&&Nn!=null&&De!=null&&fn!=null,Fn=$e&&(Pn||M!=null),In=M?.anchorRect,Ln=In==null&&Nn!=null&&De!=null&&(M!=null||Pn)?De:null,Rn=In==null?Ln==null?void 0:{top:`${Ln}px`}:{left:`${In.left}px`,position:`fixed`,right:`auto`,top:`${In.top}px`},zn=R?{opacity:`0`}:void 0,Bn=yc((e,n,r,i)=>{let a=ec({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:pt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=F.visible.startIndex&&n.index<=F.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(A.current=!0,we(e=>e===c?e:c),Ae(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Wt(c,{targetOffset:`sticky-parents`})},[t,pt,F.visible.endIndex,F.visible.startIndex,Wt]),Vn=()=>{if(y.current||!tt||fn==null||Nn==null)return;let e=t.getItem(fn);e!=null&&(Vt(Nn),Rt.current=!0,Ne({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:Nn.getAttribute(`aria-label`)??fn,path:e.getPath()},path:e.getPath(),source:`button`}))},Hn={contextHoverPath:Mn,contextMenuButtonTriggerEnabled:tt,contextMenuButtonVisibility:nt,contextMenuEnabled:$e,contextMenuRightClickEnabled:rt,contextMenuTriggerMode:et,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:gt,draggedPathSet:vt,dragTarget:yt,gitLaneActive:ct,gitStatusByPath:n,handleRowDragEnd:an,handleRowDragStart:rn,handleRowTouchStart:on,ignoredGitDirectories:r,ignoredInheritanceCache:be,instanceId:o,itemHeight:s,onKeyDown:I,onRowClick:Bn,openContextMenuForRow:Ht,registerButton:it,registerRenameInput:ot,renameView:ut,renderDecorationForRow:Pt,resolveIcon:lt,shouldSuppressContextMenu:Gt,visualFocusPath:jn},Un={...Hn,registerButton:at};return U(`div`,{ref:S,id:xt,"data-file-tree-context-menu-button-visibility":$e&&tt?nt:void 0,"data-file-tree-context-menu-trigger-mode":$e?et:void 0,"data-file-tree-has-context-menu-action-lane":$e&&tt?`true`:void 0,"data-file-tree-has-git-lane":ct?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:gt?gn:void 0,onDragOver:gt?hn:void 0,onDrop:gt?_n:void 0,onKeyDown:I,onPointerLeave:$e?mn:void 0,onPointerOver:$e?pn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[U(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:kn}}),U(`slot`,{name:ie,"data-type":`header-slot`}),f?U(`div`,{"data-file-tree-search-container":!0,"data-open":pt?`true`:`false`,children:U(`input`,{ref:ee,"aria-activedescendant":An,"aria-controls":xt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ge?`true`:void 0,value:mt,onBlur:()=>{d===`retain`&&!qe.current||t.closeSearch()},onFocus:Je,onPointerDown:Je,onInput:e=>{Je();let n=e.currentTarget;t.setSearch(n.value)}})}):null,U(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ze&&Ot.length>0?U(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:U(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${St}px`},children:Ot.map((e,t)=>pl(Un,e.row,`sticky:${Oc(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Ot.length-t}`}}))})}):null,U(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${At}px`},children:[U(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${yn}px`}}),U(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${vn}px`,top:`${bn}px`,bottom:`${xn}px`},children:[ml(Hn,Dt,Mt),Cn!=null&&wn!=null?pl(Hn,Cn,`parked:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:bt===Cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${wn}px`}}):null,Dn!=null&&On!=null?pl(Hn,Dn,`parked-drag:${Dn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${On}px`}}):null]})]})]}),$e?U(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Fn?`true`:`false`,style:Rn,children:[U(`button`,{ref:v,type:`button`,"data-type":oe,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":M==null?`false`:`true`,"data-visible":Pn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),M!=null){Bt();return}Vn()},tabIndex:-1,style:zn,children:U(ss,{...lt(`file-tree-icon-ellipsis`)})}),M==null?null:U(`slot`,{name:ae})]}):null,M==null?null:U(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Bt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Bt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var gl={hydrateRoot:(e,t)=>{ns(Mo(hl,t),e)},renderRoot:(e,t)=>{ts(Mo(hl,t),e)},unmountRoot:e=>{ts(null,e)}};function _l(e,t){gl.renderRoot(e,t)}function vl(e,t){gl.hydrateRoot(e,t)}function yl(e){gl.unmountRoot(e)}var bl=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var xl=0;function Sl(e){return e!=null&&e.length>0?e:(xl+=1,`pst_ft_${xl}`)}function Cl({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Et)}function wl(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function Tl(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function El(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var Dl=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new bl;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=Sl(a),this.#p=no(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Tt(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Za({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(yl(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=ro(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&_l(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),_l(t.wrapper,this.#w()))}setGitStatus(e){let t=no(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&_l(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),_l(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),vl(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),_l(r,this.#w())}#C(){return{initialViewportHeight:Cl({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(ie,e());return}this.#l.setSlotHtml(ie,this.#e?.header?.html??null)}#k(e){let t=El(e).find(e=>Tl(e)),n=wl(yt(F(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=El(e),n=t.find(e=>Tl(e)),r=t.filter(e=>e!==n),i=F(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=wl(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=F(this.#m);t.colored&&xt(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${A}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(A,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=At(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return It(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function Ol(e){let[t]=(0,g.useState)(()=>new Dl(e)),n=(0,g.useRef)({timeout:null,model:t});return(0,g.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var kl=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Al=/^0(?:\.0+)?%?$/;function jl(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function Ml(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Nl(e){if(e==null)return null;let t=Ml(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Pl(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||kl.test(t))return!0;let n=jl(t);return n!=null&&Al.test(n)}function Fl(e,t,n){if(t==null||n==null)return!1;let r=Nl(e),i=Nl(t),a=Nl(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Il=new WeakMap;function Ll(e){let t=Il.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;Rl(r,`editor.background`,i),Rl(r,`editor.foreground`,a),Rl(r,`sideBar.background`,o),Rl(r,`sideBar.foreground`,s),Rl(r,`input.background`,n[`input.background`]??o),Rl(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),Rl(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),Rl(r,`gitDecoration.addedResourceForeground`,zl(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),Rl(r,`gitDecoration.modifiedResourceForeground`,zl(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),Rl(r,`gitDecoration.deletedResourceForeground`,zl(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Pl(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Pl(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(Bl(l,o)||Fl(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Il.set(e,u),u}function Rl(e,t,n){n!=null&&n!==``&&(e[t]=n)}function zl(...e){for(let t of e)if(t!=null&&t!==``)return t}function Bl(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Vl(e,t={}){return ua.prepareInput(e,t)}var Hl=120;function Ul({files:e,selectedPath:t,onSelectPath:n}){let r=(0,g.useMemo)(()=>e.map(e=>e.path),[e]),i=(0,g.useMemo)(()=>e.map(e=>Kl(e)).filter(e=>!!e),[e]),a=(0,g.useMemo)(()=>Vl(r),[r]),o=r.length>Hl?`closed`:`open`,s=(0,g.useMemo)(()=>Jl(r),[r]);return r.length===0?null:(0,_.jsx)(Wl,{files:e,gitStatus:i,initialExpansion:o,onSelectPath:n,paths:r,preparedInput:a,selectedPath:t},s)}function Wl({files:e,gitStatus:t,initialExpansion:n,onSelectPath:r,paths:i,preparedInput:a,selectedPath:o}){let s=(0,g.useMemo)(()=>new Set(i),[i]),{model:c}=Ol({flattenEmptyDirectories:!0,gitStatus:t,initialExpansion:n,initialSelectedPaths:o?[o]:[],itemHeight:24,onSelectionChange(e){let t=[...e].reverse().find(e=>s.has(e));t&&r(t)},preparedInput:a,search:!0,searchBlurBehavior:`retain`,unsafeCSS:ql});return(0,g.useEffect)(()=>{if(!o)return;for(let e of c.getSelectedPaths())e!==o&&c.getItem(e)?.deselect();let e=c.getItem(o);e?.isSelected()||e?.select(),c.scrollToPath(o,{focus:!1,offset:`nearest`})},[c,o]),(0,g.useEffect)(()=>{c.setGitStatus(t)},[t,c]),(0,_.jsx)(`div`,{className:`diff-tree-host`,children:(0,_.jsx)(fe,{"aria-label":`Changed files`,header:(0,_.jsx)(Gl,{files:e}),model:c,style:{height:`100%`}})})}function Gl({files:e}){let t=e.reduce((e,t)=>e+(t.additions??0),0),n=e.reduce((e,t)=>e+(t.deletions??0),0),r=e.length>Hl;return(0,_.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-line px-2 py-1.5 font-mono text-[10px] text-muted`,children:[(0,_.jsx)(`span`,{children:`files`}),(0,_.jsxs)(`span`,{className:`text-primary`,children:[`+`,t,` -`,n,r?(0,_.jsx)(`span`,{className:`text-muted`,children:` - large set`}):null]})]})}function Kl(e){let t=e.status.toLowerCase();return t===`a`||t===`added`?{path:e.path,status:`added`}:t===`d`||t===`deleted`||t===`removed`?{path:e.path,status:`deleted`}:t===`r`||t===`renamed`?{path:e.path,status:`renamed`}:t===`??`||t===`untracked`?{path:e.path,status:`untracked`}:t?{path:e.path,status:`modified`}:null}var ql=`
1269
+ :host {
1270
+ --trees-bg-override: transparent;
1271
+ --trees-fg-override: var(--ink);
1272
+ --trees-fg-muted-override: var(--muted);
1273
+ --trees-border-color-override: var(--line);
1274
+ --trees-font-family-override: var(--font-mono);
1275
+ --trees-font-size-override: calc(10px * var(--deck-text-scale));
1276
+ --trees-selected-bg-override: color-mix(in srgb, var(--primary) 18%, transparent);
1277
+ --trees-bg-muted-override: color-mix(in srgb, var(--primary) 9%, transparent);
1278
+ display: block;
1279
+ height: 100%;
1280
+ min-height: 0;
1281
+ }
1282
+ button[data-type='item'] {
1283
+ border-radius: 0;
1284
+ }
1285
+ input {
1286
+ border-radius: 0;
1287
+ border-color: var(--trees-border-color-override);
1288
+ background: var(--trees-bg-muted-override);
1289
+ color: var(--trees-fg-override);
1290
+ font-family: var(--trees-font-family-override);
1291
+ }
1292
+ input::placeholder {
1293
+ color: var(--trees-fg-muted-override);
1294
+ }
1295
+ input:focus {
1296
+ outline: 1px solid var(--trees-selected-bg-override);
1297
+ outline-offset: 0;
1298
+ }
1299
+ `;function Jl(e){let t=2166136261;for(let n of e)for(let e=0;e<n.length;e+=1)t^=n.charCodeAt(e),t=Math.imul(t,16777619);return`${e.length}:${t>>>0}`}var Yl={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Xl={display:`contents`};function Zl(){return null}var Ql=`diffs-container`,$l=/(?=^From [a-f0-9]+ .+$)/m,eu=/(?=^diff --git)/gm,tu=/(?<=\n)/,nu=/^(---|\+\+\+)\s+([^\t\r\n]+)/,ru=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,iu=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,au=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,ou=`header-prefix`,su=`header-metadata`,cu=`header-custom`,lu={dark:`pierre-dark`,light:`pierre-light`},uu=`data-theme-css`,du=`data-unsafe-css`,fu=`data-diffs-scrollbar-measure`,pu=`--diffs-scrollbar-gutter-measured`,mu=1e5,hu={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...hu});var gu=Object.freeze({fromStart:0,fromEnd:0}),_u={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},vu={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function yu(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function bu({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function xu(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Su(n,e.startContentIndex)}}function Su(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}function Cu({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderMergeConflictUtility:s,lineAnnotations:c,getHoveredLine:l,getInstance:u}){let d=n?.(e),f=r?.(e),p=i?.(e);return(0,_.jsxs)(_.Fragment,{children:[d==null?(0,_.jsxs)(_.Fragment,{children:[f!=null&&(0,_.jsx)(`div`,{slot:`header-prefix`,children:f}),p!=null&&(0,_.jsx)(`div`,{slot:`header-metadata`,children:p})]}):(0,_.jsx)(`div`,{slot:cu,children:d}),a!=null&&c?.map((e,t)=>(0,_.jsx)(`div`,{slot:yu(e),children:a(e)},t)),t!=null&&s!=null&&u!=null&&t.map(t=>{if(t==null)return;let n=wu(t,e);return(0,_.jsx)(`div`,{slot:n,style:Xl,children:s(t,u)},n)}),o!=null&&(0,_.jsx)(`div`,{slot:`gutter-utility-slot`,style:Yl,children:o(l)})]})}function wu(e,t){let n=xu(e,t);return n==null?void 0:bu({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function Tu(e){let t=(0,g.useRef)(e);return(0,g.useInsertionEffect)(()=>void(t.current=e)),(0,g.useCallback)((...e)=>t.current(...e),[])}function Eu(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}var Du=new Set;function Ou(e){let t=[],n=new Set;for(let r of ku(e.themes)){let e=Mu(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Ou({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Ou({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function ku(e){return Au(e)?[e]:e}function Au(e){return Mu(e)||ju(e)}function ju(e){return typeof e.name==`string`&&typeof e.load==`function`}function Mu(e){return typeof e.getThemes==`function`}function Nu(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Pu=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Fu=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Iu=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Lu(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Pu(t);e.set(t,n)}function a(t,n){return e.has(t)?!1:(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Fu(i));let c=r,l=s().then(e=>{let a=Nu(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new Iu(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var Ru=Lu();function zu(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Ru.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Ru.getResolvedTheme(n)??Ru.seedResolvedTheme(n,e);Du.has(n)||(Du.add(n),t.loadThemeSync(e))}}var Bu=new Map,Vu=new Map,Hu=new Map,Uu=new Set;function Wu(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Uu.has(n.name))continue;let e=Bu.get(n.name);e??(e=n,Bu.set(n.name,e)),Uu.add(e.name),t.loadLanguageSync(e.data)}}function Gu(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Ku=Object.defineProperty,qu=Object.getOwnPropertyDescriptor,Ju=Object.getOwnPropertyNames,Yu=Object.prototype.hasOwnProperty,Xu=(e,t)=>{let n={};for(var r in e)Ku(n,r,{get:e[r],enumerable:!0});return t||Ku(n,Symbol.toStringTag,{value:`Module`}),n},Zu=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Ju(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Yu.call(e,s)&&s!==n&&Ku(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=qu(t,s))||r.enumerable});return e},Qu=(e,t,n)=>(Zu(e,t,`default`),n&&Zu(n,t,`default`)),$u=[{id:`abap`,name:`ABAP`,import:(()=>o(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>o(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>o(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>o(()=>import(`./angular-html-BVBpGdXr.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>o(()=>import(`./angular-ts-BfdufMKP.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>o(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>o(()=>import(`./apex-VAyPSnFM.js`),[]))},{id:`apl`,name:`APL`,import:(()=>o(()=>import(`./apl-DWBSSoBH.js`),__vite__mapDeps([7,3,1,4,2,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>o(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>o(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>o(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>o(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>o(()=>import(`./astro-3LtMP0Sq.js`),__vite__mapDeps([11,3,1,4,10,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>o(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>o(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>o(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>o(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>o(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>o(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>o(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>o(()=>import(`./bird2-C6vDhewU.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>o(()=>import(`./blade-llJRbbtR.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>o(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>o(()=>import(`./c-Wt1voDr2.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>o(()=>import(`./c3-BFHwR3_K.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>o(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>o(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>o(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>o(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>o(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>o(()=>import(`./cobol-x_HIyl2P.js`),__vite__mapDeps([23,2,1,3,4,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>o(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>o(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>o(()=>import(`./coffee-CThvmt4R.js`),__vite__mapDeps([24,3,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>o(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>o(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>o(()=>import(`./cpp-NtAeskI3.js`).then(e=>e.n),__vite__mapDeps([25,1,17,26,27,20])))},{id:`crystal`,name:`Crystal`,import:(()=>o(()=>import(`./crystal-DNu_sX0G.js`),__vite__mapDeps([28,3,1,4,2,17,20,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>o(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>o(()=>import(`./css-DJp_X0uY.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`csv`,name:`CSV`,import:(()=>o(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>o(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>o(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>o(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>o(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>o(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>o(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>o(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>o(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>o(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>o(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>o(()=>import(`./edge-ozw5tpLl.js`),__vite__mapDeps([30,2,1,3,4,12,16])))},{id:`elixir`,name:`Elixir`,import:(()=>o(()=>import(`./elixir-VhA6FeZt.js`),__vite__mapDeps([31,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>o(()=>import(`./elm-dREJmIFz.js`),__vite__mapDeps([32,27,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>o(()=>import(`./emacs-lisp-B4R74twV.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>o(()=>import(`./erb-CIg6G69l.js`),__vite__mapDeps([33,2,1,3,4,34,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>o(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>o(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>o(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>o(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>o(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>o(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>o(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>o(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>o(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>o(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>o(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>o(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>o(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>o(()=>import(`./git-rebase-B44mJPta.js`),__vite__mapDeps([50,29,1])))},{id:`gleam`,name:`Gleam`,import:(()=>o(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>o(()=>import(`./glimmer-js-vH_gHG0-.js`),__vite__mapDeps([51,3,1,4,2,12])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>o(()=>import(`./glimmer-ts--abOzSAQ.js`),__vite__mapDeps([52,3,1,4,2,12])))},{id:`glsl`,name:`GLSL`,import:(()=>o(()=>import(`./glsl-Dv5r7kPw.js`).then(e=>e.n),__vite__mapDeps([27,1,20])))},{id:`gn`,name:`GN`,import:(()=>o(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>o(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>o(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>o(()=>import(`./graphql-CB4jsw2E.js`).then(e=>e.n),__vite__mapDeps([36,1,3,12,14,37])))},{id:`groovy`,name:`Groovy`,import:(()=>o(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>o(()=>import(`./hack-DvEYX148.js`),__vite__mapDeps([53,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>o(()=>import(`./haml-zE6W3STP.js`).then(e=>e.n),__vite__mapDeps([35,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>o(()=>import(`./handlebars-CzBR2SDs.js`),__vite__mapDeps([54,3,1,4,2,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>o(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>o(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>o(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>o(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>o(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>o(()=>import(`./html-C8UlPnhE.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>o(()=>import(`./html-derivative-CY6NRz-J.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>o(()=>import(`./http-Cyd7bS_S.js`),__vite__mapDeps([55,8,1,9,10,29,36,3,12,14,37])))},{id:`hurl`,name:`Hurl`,import:(()=>o(()=>import(`./hurl-CWPsiEpf.js`),__vite__mapDeps([56,8,1,9,57,36,3,12,14,37])))},{id:`hxml`,name:`HXML`,import:(()=>o(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>o(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>o(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>o(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>o(()=>import(`./java-CGc3VwQr.js`).then(e=>e.n),__vite__mapDeps([9,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>o(()=>import(`./javascript-CUt1pgmJ.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`jinja`,name:`Jinja`,import:(()=>o(()=>import(`./jinja-CD-Z-FLd.js`),__vite__mapDeps([60,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>o(()=>import(`./jison-imPNup1l.js`),__vite__mapDeps([61,3,1])))},{id:`json`,name:`JSON`,import:(()=>o(()=>import(`./json-Bg9ijW3F.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`json5`,name:`JSON5`,import:(()=>o(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>o(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>o(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>o(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>o(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>o(()=>import(`./jsx-CY6oMTks.js`).then(e=>e.n),__vite__mapDeps([37,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>o(()=>import(`./julia-Dc3O-irA.js`),__vite__mapDeps([62,3,1,17,22,25,26,27,20,63])))},{id:`just`,name:`Just`,import:(()=>o(()=>import(`./just-BhOq_Kbv.js`),__vite__mapDeps([64,3,1,12,22,29,34,4,2,8,9,17,20,25,26,27,35,36,14,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>o(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>o(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>o(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>o(()=>import(`./latex-Cu4Y1d5w.js`),__vite__mapDeps([66,67,63,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>o(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>o(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>o(()=>import(`./liquid-CvXMrjlQ.js`),__vite__mapDeps([68,3,1,4,2,10])))},{id:`llvm`,name:`LLVM IR`,import:(()=>o(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>o(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>o(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>o(()=>import(`./lua-BjLEUjKY.js`).then(e=>e.n),__vite__mapDeps([38,1,20])))},{id:`luau`,name:`Luau`,import:(()=>o(()=>import(`./luau-FMPmPwt6.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>o(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>o(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>o(()=>import(`./marko-DvhNOisQ.js`),__vite__mapDeps([69,4,1,6,12,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>o(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>o(()=>import(`./mdc-Bm9TpL1X.js`),__vite__mapDeps([71,16,2,1,3,4,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>o(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>o(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>o(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>o(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>o(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>o(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>o(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>o(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>o(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>o(()=>import(`./nginx-Bhc82uuv.js`),__vite__mapDeps([74,38,1,20])))},{id:`nim`,name:`Nim`,import:(()=>o(()=>import(`./nim-DXTVBFnF.js`),__vite__mapDeps([75,3,1,4,2,8,9,20,27,41])))},{id:`nix`,name:`Nix`,import:(()=>o(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>o(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>o(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>o(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>o(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>o(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>o(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>o(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>o(()=>import(`./perl-C7veXV9z.js`),__vite__mapDeps([65,3,1,4,2,8,9,17])))},{id:`php`,name:`PHP`,import:(()=>o(()=>import(`./php-BRiuMnnr.js`),__vite__mapDeps([76,3,1,4,2,8,9,10,17])))},{id:`pkl`,name:`Pkl`,import:(()=>o(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>o(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>o(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>o(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>o(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>o(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>o(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>o(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>o(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>o(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>o(()=>import(`./pug-C5hz5LQ7.js`),__vite__mapDeps([77,3,1,4,2])))},{id:`puppet`,name:`Puppet`,import:(()=>o(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>o(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>o(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>o(()=>import(`./qml-BdUV3aTS.js`),__vite__mapDeps([78,3,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>o(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>o(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>o(()=>import(`./r-8R7vtdQc.js`).then(e=>e.n),__vite__mapDeps([63,1])))},{id:`racket`,name:`Racket`,import:(()=>o(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>o(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>o(()=>import(`./razor-DRL52XO2.js`),__vite__mapDeps([79,2,1,3,4,80])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>o(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>o(()=>import(`./regexp-Omp9DhTb.js`).then(e=>e.n),__vite__mapDeps([26,1])))},{id:`rel`,name:`Rel`,import:(()=>o(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>o(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>o(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>o(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>o(()=>import(`./rst-BHX71KW9.js`),__vite__mapDeps([81,3,1,16,2,4,22,82,25,17,26,27,20,29,39,34,8,9,35,36,12,14,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>o(()=>import(`./ruby-B--HzjGU.js`),__vite__mapDeps([34,3,1,4,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>o(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>o(()=>import(`./sas-DrLaYOK_.js`),__vite__mapDeps([83,17,1])))},{id:`sass`,name:`Sass`,import:(()=>o(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>o(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>o(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>o(()=>import(`./scss-DdSxiZKl.js`).then(e=>e.n),__vite__mapDeps([6,1,4])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>o(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>o(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([84,85])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>o(()=>import(`./shellscript-DwcUjJBL.js`).then(e=>e.n),__vite__mapDeps([29,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>o(()=>import(`./shellsession-CPZkydE6.js`),__vite__mapDeps([86,29,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>o(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>o(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>o(()=>import(`./soy-Br5FhD7c.js`),__vite__mapDeps([87,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>o(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([88,89])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>o(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>o(()=>import(`./sql-DNssxck8.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>o(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>o(()=>import(`./stata-DXn1tqOr.js`),__vite__mapDeps([90,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>o(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>o(()=>import(`./surrealql-IeLNQw0f.js`),__vite__mapDeps([91,3,1])))},{id:`svelte`,name:`Svelte`,import:(()=>o(()=>import(`./svelte-DOdLCIlh.js`),__vite__mapDeps([92,3,1,4,12,13])))},{id:`swift`,name:`Swift`,import:(()=>o(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>o(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>o(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>o(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>o(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>o(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>o(()=>import(`./templ-CIwIngms.js`),__vite__mapDeps([93,3,1,4,94])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>o(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>o(()=>import(`./tex-D8QMumu5.js`),__vite__mapDeps([67,63,1])))},{id:`toml`,name:`TOML`,import:(()=>o(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>o(()=>import(`./ts-tags-BMVY4q-l.js`),__vite__mapDeps([95,3,1,4,2,8,9,12,17,27,20])))},{id:`tsv`,name:`TSV`,import:(()=>o(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>o(()=>import(`./tsx-5Eka4NBX.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`turtle`,name:`Turtle`,import:(()=>o(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>o(()=>import(`./twig-C8o_5mgw.js`),__vite__mapDeps([96,3,1,4,6,22,34,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39,76,10])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>o(()=>import(`./typescript-DOu2WMV5.js`).then(e=>e.n),__vite__mapDeps([12,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>o(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>o(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>o(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>o(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>o(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>o(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>o(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>o(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>o(()=>import(`./vue-BU18DNDL.js`),__vite__mapDeps([97,3,1,4,2,10,12,16])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>o(()=>import(`./vue-html-BeluIYX0.js`),__vite__mapDeps([98,3,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>o(()=>import(`./vue-vine-DGUAbOCX.js`),__vite__mapDeps([99,3,1,4,6,13,70,100])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>o(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>o(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>o(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>o(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>o(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>o(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>o(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>o(()=>import(`./xml-DIqSwXR3.js`).then(e=>e.n),__vite__mapDeps([8,1,9])))},{id:`xsl`,name:`XSL`,import:(()=>o(()=>import(`./xsl-Ct_-YIAy.js`),__vite__mapDeps([101,8,1,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>o(()=>import(`./yaml-DTtCYNlS.js`).then(e=>e.n),__vite__mapDeps([39,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>o(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>o(()=>import(`./zig-CMLA9XwU.js`),[]))}],ed=Object.fromEntries($u.map(e=>[e.id,e.import])),td=Object.fromEntries($u.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),nd={...ed,...td},rd=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>o(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>o(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>o(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>o(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>o(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>o(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>o(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>o(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>o(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>o(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>o(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>o(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>o(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>o(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>o(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>o(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>o(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>o(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>o(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>o(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>o(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>o(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>o(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>o(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>o(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>o(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>o(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>o(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>o(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>o(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>o(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>o(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>o(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>o(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>o(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>o(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>o(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>o(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>o(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>o(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>o(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>o(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>o(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>o(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>o(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>o(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>o(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>o(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>o(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>o(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>o(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>o(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>o(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>o(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>o(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>o(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>o(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>o(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>o(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>o(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>o(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>o(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>o(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>o(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>o(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),id=e({createOnigurumaEngine:()=>jd,getDefaultWasmLoader:()=>Ad,loadWasm:()=>wd,setDefaultWasmLoader:()=>kd}),ad=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function od(){return 2147483648}function sd(){return typeof performance<`u`?performance.now():Date.now()}var cd=(e,t)=>e+(t-e%t)%t;async function ld(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=od();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,cd(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:sd,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ud=Object.defineProperty,dd=(e,t,n)=>t in e?ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t,n)=>dd(e,typeof t==`symbol`?t:t+``,n),fd=null;function pd(e){throw new ad(e.UTF8ToString(e.getLastOnigError()))}var md=class e{constructor(t){q(this,`utf16Length`),q(this,`utf8Length`),q(this,`utf16Value`),q(this,`utf8Value`),q(this,`utf16OffsetToUtf8`),q(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},hd=class e{constructor(t){if(q(this,`id`,++e.LAST_ID),q(this,`_onigBinding`),q(this,`content`),q(this,`utf16Length`),q(this,`utf8Length`),q(this,`utf16OffsetToUtf8`),q(this,`utf8OffsetToUtf16`),q(this,`ptr`),!fd)throw new ad(`Must invoke loadWasm first.`);this._onigBinding=fd,this.content=t;let n=new md(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=fd.omalloc(1e4),e._sharedPtrInUse=!0,fd.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(fd)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};q(hd,`LAST_ID`,0),q(hd,`_sharedPtr`,0),q(hd,`_sharedPtrInUse`,!1);var gd=hd,_d=class{constructor(e){if(q(this,`_onigBinding`),q(this,`_ptr`),!fd)throw new ad(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new md(e[r]);t[r]=i.createString(fd),n[r]=i.utf8Length}let r=fd.omalloc(4*e.length);fd.HEAPU32.set(t,r/4);let i=fd.omalloc(4*e.length);fd.HEAPU32.set(n,i/4);let a=fd.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)fd.ofree(t[n]);fd.ofree(i),fd.ofree(r),a===0&&pd(fd),this._onigBinding=fd,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new gd(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function vd(e){return typeof e.instantiator==`function`}function yd(e){return typeof e.default==`function`}function bd(e){return e.data!==void 0}function xd(e){return typeof Response<`u`&&e instanceof Response}function Sd(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Cd;function wd(e){if(Cd)return Cd;async function t(){fd=await ld(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),vd(n)?n=await n.instantiator(t):yd(n)?n=await n.default(t):(bd(n)&&(n=n.data),xd(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Ed(n)(t):await Dd(n)(t):Sd(n)||n instanceof WebAssembly.Module?n=await Td(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Td(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Cd=t(),Cd}function Td(e){return t=>WebAssembly.instantiate(e,t)}function Ed(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Dd(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Od;function kd(e){Od=e}function Ad(){return Od}async function jd(e){return e&&await wd(e),{createScanner(e){return new _d(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new gd(e)}}}var Md=Xu({});Qu(Md,id);var J=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Nd(e){return Pd(e)}function Pd(e){return Array.isArray(e)?Fd(e):e instanceof RegExp?e:typeof e==`object`?Id(e):e}function Fd(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Pd(e[n]);return t}function Id(e){let t={};for(let n in e)t[n]=Pd(e[n]);return t}function Ld(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Rd(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Rd(e.substring(0,e.length-1)):e.substr(~t+1)}var zd=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Bd=class{static hasCaptures(e){return e===null?!1:(zd.lastIndex=0,zd.test(e))}static replaceCaptures(e,t,n){return e.replace(zd,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Vd(e,t){return e<t?-1:+(e>t)}function Hd(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Vd(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Ud(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Wd(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Gd=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Kd=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Zd(e),t)}static createFromParsedTheme(e,t){return ef(e,t)}_cachedMatchRoot=new Gd(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Jd(e.parent,t.parentScopes));return n?new Xd(n.fontStyle,n.foreground,n.background):null}},qd=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Jd(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Yd(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Yd(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Xd=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Zd(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&Ud(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Ud(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Qd(l,u,e,o,s,c)}}return n}var Qd=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},$d=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))($d||{});function ef(e,t){e.sort((e,t)=>{let n=Vd(e.scope,t.scope);return n!==0||(n=Hd(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new tf(t),o=new Xd(n,a.getId(r),a.getId(i)),s=new af(new rf(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Kd(a,o,s)}var tf=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},nf=Object.freeze([]),rf=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||nf,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},af=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),rf.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Hd(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new rf(e,t,n,r,i))}},of=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=cf(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function sf(e){return e}function cf(e){return e}function lf(e,t){let n=[],r=df(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(uf(i)){let e=[];do e.push(i),i=r.next();while(uf(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function uf(e){return!!e&&!!e.match(/[\w\.:]+/)}function df(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ff(e){typeof e.dispose==`function`&&e.dispose()}var pf=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},mf=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},hf=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},gf=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new pf(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new hf;for(let n of e)_f(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof pf){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function _f(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof pf?yf({baseGrammar:a,selfGrammar:i},r):vf(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new pf(e))}function vf(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];bf([r],t,n)}}function yf(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&bf(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&bf(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function bf(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Ld({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&bf(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Ef(i);switch(a.kind){case 0:yf({...t,selfGrammar:t.baseGrammar},n);break;case 1:yf(t,n);break;case 2:vf(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?vf(a.ruleName,i,n):yf(i,n)}else a.kind===4?n.add(new mf(a.scopeName,a.ruleName)):n.add(new pf(a.scopeName));break}}}var xf=class{kind=0},Sf=class{kind=1},Cf=class{constructor(e){this.ruleName=e}kind=2},wf=class{constructor(e){this.scopeName=e}kind=3},Tf=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ef(e){if(e===`$base`)return new xf;if(e===`$self`)return new Sf;let t=e.indexOf(`#`);return t===-1?new wf(e):t===0?new Cf(e.substring(1)):new Tf(e.substring(0,t),e.substring(t+1))}var Df=/\\(\d+)/,Of=/\\(\d+)/g,kf=-1,Af=-2;function jf(e){return e}function Mf(e){return e}var Nf=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Bd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Bd.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Rd(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Bd.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Bd.replaceCaptures(this._contentName,e,t)}},Pf=class extends Nf{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Ff=class extends Nf{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Bf(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Vf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},If=class extends Nf{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Vf,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lf=class extends Nf{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Bf(i,this.id),this.beginCaptures=a,this._end=new Bf(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Vf;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Rf=class extends Nf{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Bf(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Bf(o,Af),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Vf;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Vf,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},zf=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Pf(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ff(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Ld({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new If(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Rf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Lf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Ef(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof If||e instanceof Lf||e instanceof Rf)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Bf=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Df.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Of.lastIndex=0,this.source.replace(Of,(e,t)=>Wd(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Vf=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Hf(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Hf(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Hf=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
1300
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Uf=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Wf=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Uf(e,8),this._embeddedLanguagesMatcher=new Gf(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Uf(0,0);_getBasicScopeAttributes=new Gd(e=>new Uf(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Gf=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Wd(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Kf=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function qf(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Jf(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Kf(i,!0);f()}return new Kf(i,!1);function f(){let o=Yf(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===kf){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),ep(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Lf){let r=o;ep(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Rf){let r=o;ep(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(ep(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Jf(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Rf&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=$f(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Af){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),ep(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Yf(e,t,n,r,i,a){let o=Xf(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Zf(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Xf(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Qf(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Zf(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Qf(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Qf(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function $f(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ep(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));qf(e,p,n&&d.start===0,d.start,f,i,!1,0),ff(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new tp(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var tp=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function np(e,t,n,r,i,a,o,s){return new op(e,t,n,r,i,a,o,s)}function rp(e,t,n,r,i){let a=lf(t,ip),o=zf.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function ip(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(ap(t[r],e))return n=r+1,!0;return!1})}function ap(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var op=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Wf(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=sp(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=lf(e,ip);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)rp(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&rp(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(jf(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Mf(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=sp(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=zf.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===lp.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=of.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?cp.createRootAndLookUpScopeName(a,r,this):cp.createRoot(`unknown`,r),t=new lp(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
1301
+ `;let a=this.createOnigString(e),o=a.content.length,s=new dp(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=qf(this,a,i,0,t,s,!0,r);return ff(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function sp(e,t){return e=Nd(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var cp=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=qd.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new qd(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new qd(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),of.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},lp=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?cp.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Mf(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=cp.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,jf(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,cp.fromExtension(r,n.contentNameScopesList))}},up=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):lf(e,ip).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>lf(e,ip).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},dp=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=of.set(n,0,sf(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=of.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},fp=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,np(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},pp=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new fp(Kd.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Kd.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new up(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new gf(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},mp=lp.NULL;function hp(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function gp(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _p(e){return Array.isArray(e)?e:[e]}async function vp(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function yp(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function bp(e){return e===`ansi`||yp(e)}function xp(e){return e===`none`}function Sp(e){return xp(e)}var Cp=/(\r?\n)/g;function wp(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Cp),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Tp={light:`#333333`,dark:`#bbbbbb`},Ep={light:`#fffffe`,dark:`#1e1e1e`},Dp=`__shiki_resolved`;function Op(e){if(e?.[Dp])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Tp.light:Tp.dark,n||=t.type===`light`?Ep.light:Ep.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Dp,{enumerable:!1,writable:!1,value:!0}),t}async function kp(e){return[...new Set((await Promise.all(e.filter(e=>!bp(e)).map(async e=>await vp(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ap(e){return(await Promise.all(e.map(async e=>Sp(e)?null:Op(await vp(e))))).filter(e=>!!e)}function jp(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new J(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Mp=class extends pp{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Op(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Kd.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=jp(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new J(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Np=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Pp=0;function Fp(e){Pp+=1,e.warnings!==!1&&Pp>=10&&Pp%10==0&&console.warn(`[Shiki] ${Pp} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new J("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Op),i=new Mp(new Np(e.engine,n),r,n,e.langAlias),a;function o(t){return jp(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new J(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new J(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await kp(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ap(e))}function g(){if(t)throw new J(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Pp)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ip(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ap(e.themes||[]),kp(e.langs||[]),e.engine]);return Fp({...e,themes:t,langs:n,engine:r})}var Lp=new WeakMap;function Rp(e,t){Lp.set(e,t)}function zp(e){return Lp.get(e)}var Bp=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(_p(n).map(e=>[e,mp])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Vp(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Vp(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Hp(e,t){if(!(e instanceof Bp))throw new J(`Invalid grammar state`);return e.getInternalStack(t)}var Up=/,/,Wp=/ /;function Gp(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(yp(e.resolveLangAlias(n.lang||`text`))||xp(r))return wp(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new J(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new J(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return qp(t,o,i,a,n)}function Kp(...e){if(e.length===2)return zp(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(yp(i)||xp(a))throw new J(`Plain language does not have grammar state`);if(i===`ansi`)throw new J(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Bp(Jp(n,c,o,s,r).stateStack,c.name,o.name)}function qp(e,t,n,r,i){let a=Jp(e,t,n,r,i),o=new Bp(a.stateStack,t.name,n.name);return Rp(a.tokens,o),a.tokens}function Jp(e,t,n,r,i){let a=hp(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=wp(e),l=i.grammarState?Hp(i.grammarState,n.name)??mp:i.grammarContextCode==null?mp:Jp(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=gp(r[of.getForeground(s)],a),l=of.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Up).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Wp))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Yp(t.scopes):Xp(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Yp(e){return e.map(e=>({scopeName:e}))}function Xp(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:$p(e,i,t.slice(0,r))}}return n}function Zp(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Qp(e,t,n){if(!Zp(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Zp(e[r],n[i])&&--r,--i;return r===-1}function $p(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Qp(e,t,n)){r.push(a);break}return r}function em(e,t,n,r=Gp){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:zp(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=tm(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Bp(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Rp(s,c),s}function tm(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var nm=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],rm=/["&'<>`]/g,im=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,am=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,om=/[|\\{}()[\]^$+*?.]/g,sm=new WeakMap;function cm(e,t){if(e=e.replace(t.subset?lm(t.subset):rm,r),t.subset||t.escapeOnly)return e;return e.replace(im,n).replace(am,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function lm(e){let t=sm.get(e);return t||(t=um(e),sm.set(e,t)),t}function um(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(om,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var dm=/[\dA-Fa-f]/;function fm(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!dm.test(String.fromCharCode(t))?r:r+`;`}var pm=/\d/;function mm(e,t,n){let r=`&#`+String(e);return n&&t&&!pm.test(String.fromCharCode(t))?r:r+`;`}var hm=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),gm={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},_m=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],vm={}.hasOwnProperty,ym={},bm;for(bm in gm)vm.call(gm,bm)&&(ym[gm[bm]]=bm);var xm=/[^\dA-Za-z]/;function Sm(e,t,n,r){let i=String.fromCharCode(e);if(vm.call(ym,i)){let e=ym[i],a=`&`+e;return n&&hm.includes(e)&&!_m.includes(e)&&(!r||t&&t!==61&&xm.test(String.fromCharCode(t)))?a:a+`;`}return``}function Cm(e,t,n){let r=fm(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Sm(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=mm(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function wm(e,t){return cm(e,Object.assign({format:Cm},t))}var Tm=/^>|^->|<!--|-->|--!>|<!-$/g,Em=[`>`],Dm=[`<`,`>`];function Om(e,t,n,r){return r.settings.bogusComments?`<?`+wm(e.value,Object.assign({},r.settings.characterReferences,{subset:Em}))+`>`:`<!--`+e.value.replace(Tm,i)+`-->`;function i(e){return wm(e,Object.assign({},r.settings.characterReferences,{subset:Dm}))}}function km(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var Y=Mm(1),Am=Mm(-1),jm=[];function Mm(e){return t;function t(t,n,r){let i=t?t.children:jm,a=(n||0)+e,o=i[a];if(!r)for(;o&&u(o);)a+=e,o=i[a];return o}}var Nm={}.hasOwnProperty;function Pm(e){return t;function t(t,n,r){return Nm.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Fm=Pm({body:Rm,caption:Im,colgroup:Im,dd:Hm,dt:Vm,head:Im,html:Lm,li:Bm,optgroup:Wm,option:Gm,p:zm,rp:Um,rt:Um,tbody:qm,td:Xm,tfoot:Jm,th:Xm,thead:Km,tr:Ym});function Im(e,t,n){let r=Y(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&u(r.value.charAt(0)))}function Lm(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function Rm(e,t,n){let r=Y(n,t);return!r||r.type!==`comment`}function zm(e,t,n){let r=Y(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Bm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Vm(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Hm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Um(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Wm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Gm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Km(e,t,n){let r=Y(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function qm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Jm(e,t,n){return!Y(n,t)}function Ym(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Xm(e,t,n){let r=Y(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Zm=Pm({body:eh,colgroup:th,head:$m,html:Qm,tbody:nh});function Qm(e){let t=Y(e,-1);return!t||t.type!==`comment`}function $m(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function eh(e){let t=Y(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&u(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function th(e,t,n){let r=Am(n,t),i=Y(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Fm(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function nh(e,t,n){let r=Am(n,t),i=Y(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Fm(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var rh={name:[[`
1302
+ \f\r &/=>`.split(``),`
1303
+ \f\r "&'/=>\``.split(``)],[`\0
1304
+ \f\r "&'/<=>`.split(``),`\0
1305
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
1306
+ \f\r &>`.split(``),`\0
1307
+ \f\r "&'<=>\``.split(``)],[`\0
1308
+ \f\r "&'<=>\``.split(``),`\0
1309
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ih(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],l;i.space===`html`&&e.tagName===`svg`&&(r.schema=c);let u=ah(r,e.properties),d=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,d&&(o=!1),(u||!a||!Zm(e,t,n))&&(s.push(`<`,e.tagName,u?` `+u:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(d),!o&&(!a||!Fm(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function ah(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=oh(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function oh(e,t,n){let r=a(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,o=+!e.settings.allowDangerousCharacters,s=e.quote,c;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let u=wm(r.attribute,Object.assign({},e.settings.characterReferences,{subset:rh.name[i][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?f:l)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?u:(e.settings.preferUnquoted&&(c=wm(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:rh.unquoted[i][o]}))),c!==n&&(e.settings.quoteSmart&&p(n,s)>p(n,e.alternative)&&(s=e.alternative),c=s+wm(n,Object.assign({},e.settings.characterReferences,{subset:(s===`'`?rh.single:rh.double)[i][o],attribute:!0}))+s),u+(c&&`=`+c))}var sh=[`<`,`&`];function ch(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:wm(e.value,Object.assign({},r.settings.characterReferences,{subset:sh}))}function lh(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ch(e,t,n,r)}function uh(e,t,n,r){return r.all(e)}var dh=y(`type`,{invalid:fh,unknown:ph,handlers:{comment:Om,doctype:km,element:ih,raw:lh,root:uh,text:ch}});function fh(e){throw Error("Expected node, not `"+e+"`")}function ph(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var mh={},hh={},gh=[];function _h(e,t){let n=t||mh,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:vh,all:yh,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||nm,characterReferences:n.characterReferences||hh,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?c:d,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function vh(e,t,n){return dh(e,t,n,this)}function yh(e){let t=[],n=e&&e.children||gh,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var bh=/\s+/g;function xh(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(bh)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(bh);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var Sh=/:?lang=["']([^"']+)["']/g,Ch=/(?:```|~~~)([\w-]+)/g,wh=/\\begin\{([\w-]+)\}/g,Th=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function Eh(e){let t=wp(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Dh(e,t,n){let r=new Set;for(let t of e.matchAll(Sh)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Ch)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(wh)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Th)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var Oh=[`color`,`background-color`];function kh(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Ah(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?kh(e,t):e})):e}function jh(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Mh(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&Oh.includes(a))if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new J('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Mh(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&$d.Italic&&(t[`font-style`]=`italic`),e.fontStyle&$d.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&$d.Underline&&n.push(`underline`),e.fontStyle&$d.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Nh(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Ph(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Eh(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new J(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new J(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new J(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Fh(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Ah(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new J(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Ih(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new J(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new J(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&xh(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Fh(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new J(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new J(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Ih(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Ih).join(``):``}var Lh=[Ph()];function Rh(e){let t=zh(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Lh]}function zh(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Bh=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Vh={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Hh(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Uh(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Wh(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Vh[r]&&t.push({type:`setDecoration`,value:Vh[r]});else if(r<=29){let e=Vh[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Bh[r-30]}});else if(r===38){let n=Uh(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Bh[r-40]}});else if(r===48){let n=Uh(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Bh[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Bh[r-100+8]}})}return t}function Gh(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Hh(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Wh(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Kh={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function qh(e=Kh){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Bh.length;e++)r.push(t(Bh[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Jh=/#([0-9a-f]{3,8})/i,Yh=/var\((--[\w-]+-ansi-[\w-]+)\)/,Xh={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Zh(e,t,n){let r=hp(e,n),i=wp(t),a=qh(Object.fromEntries(Bh.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Xh[t]]}))),o=Gh();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=gp(i,r),o=gp(o,r),n.decorations.has(`dim`)&&(i=Qh(i));let s=$d.None;return n.decorations.has(`bold`)&&(s|=$d.Bold),n.decorations.has(`italic`)&&(s|=$d.Italic),n.decorations.has(`underline`)&&(s|=$d.Underline),n.decorations.has(`strikethrough`)&&(s|=$d.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Qh(e){let t=e.match(Jh);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Yh);return n?`var(${n[1]}-dim)`:e}function $h(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!yp(r)&&!xp(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Zh(r,t,n)}return Gp(e,t,n)}function eg(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new J("`themes` option must not be empty");let p=em(e,t,n,$h);if(c=zp(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new J(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>jh(e,h,u,l,d))),c&&Rp(a,c);let g=f.map(e=>hp(e.theme,n));i=tg(f,m,g,u,l,`fg`,d),r=tg(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=hp(n.theme,n);a=$h(e,t,n);let l=e.getTheme(n.theme);r=gp(l.bg,s),i=gp(l.fg,s),o=l.name,c=zp(a)}else throw new J("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function tg(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=gp(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new J('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${gp(t[r][a],n[r])||`inherit`}, ${gp(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var ng=/^\s+$/,rg=/^(\s*)(.*?)(\s*)$/;function ig(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>ig(e,t,n),codeToTokens:(t,n)=>eg(e,t,n)}){let i=t;for(let e of Rh(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=eg(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=og(a):d===`never`&&(a=sg(a)),f&&(a=cg(a));let p={...r,get source(){return i}};for(let e of Rh(n))a=e.tokens?.call(p,a)||a;return ag(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function ag(e,t,n,r=zp(e)){let i=Rh(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:xh,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
1310
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Nh(a.htmlStyle||Mh(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Rp(m,r),m}function og(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&$d.Underline||i.fontStyle&$d.Strikethrough));o&&ng.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function sg(e){return e.map(e=>e.flatMap(e=>{if(ng.test(e.content))return e;let t=e.content.match(rg);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function cg(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Nh(e.htmlStyle||Mh(e)),i=Nh(n.htmlStyle||Mh(n)),a=e.fontStyle&&(e.fontStyle&$d.Underline||e.fontStyle&$d.Strikethrough),o=n.fontStyle&&(n.fontStyle&$d.Underline||n.fontStyle&$d.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var lg=_h;function ug(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>ig(e,t,n),codeToTokens:(t,n)=>eg(e,t,n)},i=lg(ig(e,t,n,r));for(let e of Rh(n))i=e.postprocess?.call(r,i,n)||i;return i}async function dg(e){let t=await Ip(e);return{getLastGrammarState:(...e)=>Kp(t,...e),codeToTokensBase:(e,n)=>$h(t,e,n),codeToTokensWithThemes:(e,n)=>em(t,e,n),codeToTokens:(e,n)=>eg(t,e,n),codeToHast:(e,n)=>ig(t,e,n),codeToHtml:(e,n)=>ug(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function fg(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,bp(n))return[];let r=t[n];if(!r)throw new J(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Sp(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new J(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await dg({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function pg(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function mg(e,t){let n=pg(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var hg=fg({langs:nd,themes:rd,engine:()=>(0,Md.createOnigurumaEngine)(o(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:gg,codeToHast:_g,codeToTokens:vg,codeToTokensBase:yg,codeToTokensWithThemes:bg,getSingletonHighlighter:xg,getLastGrammarState:Sg}=mg(hg,{guessEmbeddedLanguages:Dh}),Cg=4294967295,wg=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Cg,end:Cg,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Tg(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Eg(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Dg=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Og=String.raw;function kg(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ag=Og`\[\^?`,jg=`c.? | C(?:-.?)?|${Og`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Og`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Og`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Og`o\{[^\}]*\}?`}|${Og`\d{1,3}`}`,Mg=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ng=new RegExp(Og`
1311
+ \\ (?:
1312
+ ${jg}
1313
+ | [gk]<[^>]*>?
1314
+ | [gk]'[^']*'?
1315
+ | .
1316
+ )
1317
+ | \( (?:
1318
+ \? (?:
1319
+ [:=!>({]
1320
+ | <[=!]
1321
+ | <[^>]*>
1322
+ | '[^']*'
1323
+ | ~\|?
1324
+ | #(?:[^)\\]|\\.?)*
1325
+ | [^:)]*[:)]
1326
+ )?
1327
+ | \*[^\)]*\)?
1328
+ )?
1329
+ | (?:${Mg.source})+
1330
+ | ${Ag}
1331
+ | .
1332
+ `.replace(/\s+/g,``),`gsu`),Pg=new RegExp(Og`
1333
+ \\ (?:
1334
+ ${jg}
1335
+ | .
1336
+ )
1337
+ | \[:(?:\^?\p{Alpha}+|\^):\]
1338
+ | ${Ag}
1339
+ | &&
1340
+ | .
1341
+ `.replace(/\s+/g,``),`gsu`);function Fg(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=d_(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Ng.lastIndex=0;s=Ng.exec(e);){let t=Ig(a,e,s[0],Ng.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Ng.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?p_(e,u):e).flat(),flags:r}}function Ig(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Lg(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Vg(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:t_(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Hg(n)}}if(a===`K`)return{token:Yg(`keep`,n)};if(a===`N`||a===`R`)return{token:Jg(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Jg(`any`,n)};if(a===`X`)return{token:Jg(`text_segment`,n)};let e=zg(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:o_(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:a_(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Qg(`group`,n)};if(n===`(?>`)return{token:Qg(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Qg(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Qg(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Qg(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Zg(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
1342
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Jg(`dot`,n)}:n===`^`||n===`$`?{token:Vg(e.singleline?{"^":Og`\A`,$:Og`\Z`}[n]:n,n)}:n===`|`?{token:Bg(n)}:Mg.test(n)?{tokens:m_(n)}:{token:Ug(Tg(n),n)}}function Lg(e,t,n){let r=[qg(t[1]===`^`,t)],i=1,a;for(Pg.lastIndex=n;a=Pg.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(qg(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Ug(93,e));else if(i--,r.push(Wg(e)),!i)break}else{let t=Rg(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Pg.lastIndex||e.length}}function Rg(e){if(e[0]===`\\`)return zg(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Dg.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Jg(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Gg(e):e===`&&`?Kg(e):Ug(Tg(e),e)}function zg(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return i_(e);if(`dDhHsSwW`.includes(n))return c_(e);if(e.startsWith(Og`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return l_(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Ug(Tg(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Ug(f_(e),e);if(r_.has(n))return Ug(r_.get(n),e);if(/\d/.test(n))return Xg(t,e);if(e===`\\`)throw Error(Og`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ug(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Bg(e){return{type:`Alternator`,raw:e}}function Vg(e,t){return{type:`Assertion`,kind:e,raw:t}}function Hg(e){return{type:`Backreference`,raw:e}}function Ug(e,t){return{type:`Character`,value:e,raw:t}}function Wg(e){return{type:`CharacterClassClose`,raw:e}}function Gg(e){return{type:`CharacterClassHyphen`,raw:e}}function Kg(e){return{type:`CharacterClassIntersector`,raw:e}}function qg(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Jg(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Yg(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:kg(n.flags),raw:t}}function Xg(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Zg(e){return{type:`GroupClose`,raw:e}}function Qg(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function $g(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function e_(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function t_(e){return{type:`Subroutine`,raw:e}}var n_=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),r_=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function i_(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Ug(Tg(t.toUpperCase())-64,e)}function a_(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=u_(n),o=u_(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Yg(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Qg(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function o_(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=n_.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return $g(l,r??null,i?.split(`,`)??null,e)}function s_(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return e_(t,n,r,e)}function c_(e){let t=e[1].toLowerCase();return Jg({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function l_(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Jg(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function u_(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function d_(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function f_(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function p_(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Hg(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(Og`Octal encoded byte above 177 unsupported "${n}"`)}else r=Tg(t);a.push(Ug(r,(e===0?`\\`:``)+t))}return a}function m_(e){let t=[],n=new RegExp(Mg,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(s_(e.slice(0,-1)));continue}}}t.push(s_(e))}return t}function h_(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function g_(e){return __.has(e.type)}var __=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function v_(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Fg(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return O_();case`Assertion`:return y_(n);case`Backreference`:return b_(n,a);case`Character`:return M_(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return x_(n,a,t);case`CharacterClassOpen`:return S_(n,a,t);case`CharacterSet`:return C_(n,a);case`Directive`:return I_(n.kind,{flags:n.flags});case`GroupOpen`:return w_(n,a,t);case`NamedCallout`:return B_(n.kind,n.tag,n.arguments);case`Quantifier`:return T_(n,a);case`Subroutine`:return E_(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=U_(L_(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(Og`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Og`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function y_({kind:e}){return k_(kg({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===Og`\B`||e===Og`\Y`})}function b_({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i)if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,A_(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return A_(r)}return i(+r)}function x_(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),P_(o,e);throw Error(`Invalid character class range`)}return M_(Tg(`-`))}function S_({negate:e},t,n){let{tokens:r,walk:i}=t,a=[N_()],o=r[t.nextIndex],s=ev(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(N_()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=ev(r[t.nextIndex],o)}let c=N_({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function C_({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=$_(n);if(Dg.has(r)&&!o?.has(r))e=`posix`,n=r;else return G_(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?V_(n,{negate:t}):F_(e,{negate:t})}function w_(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=K_(e),l=c.type===`AbsenceFunction`,u=X_(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Eg(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=tv(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(O_()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(Y_(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Y_(t)||X_(t)&&t.negate)throw Error(e)}}f=tv(r[t.nextIndex])}return t.nextIndex++,c}function T_({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!g_(a))throw Error(`Quantifier requires a repeatable token`);let o=H_(e,t,n,a);return i.body.pop(),o}function E_({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=W_(i);return r.push(o),o}function D_(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:q_(t?.body)}}function O_(e){return{type:`Alternative`,body:J_(e?.body)}}function k_(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function A_(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function j_(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Z_(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:q_(t?.body)}}function M_(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function N_(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:J_(e?.body)}}function P_(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function F_(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function I_(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:kg(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function L_(e){return{type:`Flags`,...e}}function R_(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:q_(e?.body)}}function z_(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:q_(e?.body)}}function B_(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function V_(e,t){let n=!!t?.negate;if(!Dg.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function H_(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function U_(e,t){return{type:`Regex`,body:q_(t?.body),flags:e}}function W_(e){return{type:`Subroutine`,ref:e}}function G_(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get($_(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Q_(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Og`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function K_({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return D_(`repeater`);case`atomic`:return R_({atomic:!0});case`capturing`:return j_(i,{name:n});case`group`:return R_({flags:e});case`lookahead`:case`lookbehind`:return z_({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function q_(e){if(e===void 0)e=[O_()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function J_(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function Y_(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function X_(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Z_(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Q_(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function $_(e){return e.replace(/[- _]+/g,``).toLowerCase()}function ev(e,t){let n=t;return kg(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function tv(e){return kg(e,`Unclosed group`)}function nv(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){rv(c).splice(Math.max(0,iv(s)+l),1),l--,u=!0},removeAllNextSiblings(){return rv(c).splice(iv(s)+1)},removeAllPrevSiblings(){let e=iv(s)+l;return l-=e,rv(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,iv(s)+l)]=e:kg(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(rv(c).splice(Math.max(0,iv(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,iv(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function rv(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function iv(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var av=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ov(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function sv(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var cv=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function lv(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===cv.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?cv.CHAR_CLASS:cv.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function uv(e,t,n,r){lv(e,t,n,r)}function dv(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===cv.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function fv(e,t,n){return!!dv(e,t,0,n)}function pv(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var mv=new RegExp(String.raw`(?<noncapturingStart>${av})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function hv(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(mv.lastIndex=Number.isNaN(c)?0:c+7;f=mv.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),ov(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=lv(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},cv.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var gv=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,_v=new RegExp(String.raw`
1343
+ \\(?: \d+
1344
+ | c[A-Za-z]
1345
+ | [gk]<[^>]+>
1346
+ | [pPu]\{[^\}]+\}
1347
+ | u[A-Fa-f\d]{4}
1348
+ | x[A-Fa-f\d]{2}
1349
+ )
1350
+ | \((?: \? (?: [:=!>]
1351
+ | <(?:[=!]|[^>]+>)
1352
+ | [A-Za-z\-]+:
1353
+ | \(DEFINE\)
1354
+ ))?
1355
+ | (?<qBase>${gv})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
1356
+ | \\?.
1357
+ `.replace(/\s+/g,``),`gsu`);function vv(e){if(!RegExp(`${gv}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(_v.lastIndex=0;o=_v.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a)if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=sv(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}_v.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null);i=s}return{pattern:e}}var yv=String.raw,bv=yv`\(\?R=(?<rDepth>[^\)]+)\)|${yv`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,xv=yv`\(\?<(?![=!])(?<captureName>[^>]+)>`,Sv=yv`${xv}|(?<unnamed>\()(?!\?)`,Cv=new RegExp(yv`${xv}|${bv}|\(\?|\\?.`,`gsu`),wv=`Cannot use multiple overlapping recursions`;function Tv(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(bv,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&fv(e,yv`\(\?\(DEFINE\)`,cv.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=fv(e,yv`\\[1-9]`,cv.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Cv.lastIndex=0;f=Cv.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else if(m){if(Ev(m),l)throw Error(wv);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Cv.lastIndex);if(fv(s,bv,cv.DEFAULT))throw Error(wv);let c=m-1;e=Dv(t,s,c,!1,n,a,d),i=Av(i,t,c,a.length,0,d);break}else if(h){Ev(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(wv);break}if(!u)throw Error(yv`Recursive \g cannot be used outside the referenced group "${r===`external`?h:yv`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=pv(e,p);if(o&&fv(m,yv`${xv}|\((?!\?)`,cv.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Dv(_,v,b,!0,n,a,d);i=Av(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Cv.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Cv.lastIndex),s.set(p,Cv.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Cv.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Ev(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Dv(e,t,n,r,i,a,o){let s=new Set;r&&uv(e+t,xv,({groups:{captureName:e}})=>{s.add(e)},cv.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Ov(`(?:${e}`,`forward`,...c)}(?:)${Ov(`${t})`,`backward`,...c)}${t}`}function Ov(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=lv(e,yv`${Sv}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),kv(i,n),s?e:`(?<${t}${l}>`}return yv`\k<${c}${l}>`},cv.DEFAULT)}return c}function kv(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Av(e,t,n,r,i,a){if(e.size&&r){let o=0;uv(t,Sv,()=>o++,cv.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var X=String.fromCodePoint,Z=String.raw,jv={},Mv=globalThis.RegExp;jv.flagGroups=(()=>{try{new Mv(`(?i:)`)}catch{return!1}return!0})(),jv.unicodeSets=(()=>{try{new Mv(`[[]]`,`v`)}catch{return!1}return!0})(),jv.bugFlagVLiteralHyphenIsRange=jv.unicodeSets?(()=>{try{new Mv(Z`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,jv.bugNestedClassIgnoresNegation=jv.unicodeSets&&new Mv(`[[^a]]`,`v`).test(`a`);function Nv(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Pv(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Fv(e,t){return Lv[e]>=Lv[t]}function Iv(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Lv={ES2025:2025,ES2024:2024,ES2018:2018},Rv={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function zv(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Rv[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=jv.flagGroups?`ES2025`:jv.unicodeSets?`ES2024`:`ES2018`),t}var Bv=`[ -\r ]`,Vv=new Set([X(304),X(305)]),Hv=Z`[\p{L}\p{M}\p{N}\p{Pc}]`;function Uv(e){if(Vv.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=qv.get(n),a=Gv.get(n),o=Kv.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Wv=new Map(`C Other
1358
+ Cc Control cntrl
1359
+ Cf Format
1360
+ Cn Unassigned
1361
+ Co Private_Use
1362
+ Cs Surrogate
1363
+ L Letter
1364
+ LC Cased_Letter
1365
+ Ll Lowercase_Letter
1366
+ Lm Modifier_Letter
1367
+ Lo Other_Letter
1368
+ Lt Titlecase_Letter
1369
+ Lu Uppercase_Letter
1370
+ M Mark Combining_Mark
1371
+ Mc Spacing_Mark
1372
+ Me Enclosing_Mark
1373
+ Mn Nonspacing_Mark
1374
+ N Number
1375
+ Nd Decimal_Number digit
1376
+ Nl Letter_Number
1377
+ No Other_Number
1378
+ P Punctuation punct
1379
+ Pc Connector_Punctuation
1380
+ Pd Dash_Punctuation
1381
+ Pe Close_Punctuation
1382
+ Pf Final_Punctuation
1383
+ Pi Initial_Punctuation
1384
+ Po Other_Punctuation
1385
+ Ps Open_Punctuation
1386
+ S Symbol
1387
+ Sc Currency_Symbol
1388
+ Sk Modifier_Symbol
1389
+ Sm Math_Symbol
1390
+ So Other_Symbol
1391
+ Z Separator
1392
+ Zl Line_Separator
1393
+ Zp Paragraph_Separator
1394
+ Zs Space_Separator
1395
+ ASCII
1396
+ ASCII_Hex_Digit AHex
1397
+ Alphabetic Alpha
1398
+ Any
1399
+ Assigned
1400
+ Bidi_Control Bidi_C
1401
+ Bidi_Mirrored Bidi_M
1402
+ Case_Ignorable CI
1403
+ Cased
1404
+ Changes_When_Casefolded CWCF
1405
+ Changes_When_Casemapped CWCM
1406
+ Changes_When_Lowercased CWL
1407
+ Changes_When_NFKC_Casefolded CWKCF
1408
+ Changes_When_Titlecased CWT
1409
+ Changes_When_Uppercased CWU
1410
+ Dash
1411
+ Default_Ignorable_Code_Point DI
1412
+ Deprecated Dep
1413
+ Diacritic Dia
1414
+ Emoji
1415
+ Emoji_Component EComp
1416
+ Emoji_Modifier EMod
1417
+ Emoji_Modifier_Base EBase
1418
+ Emoji_Presentation EPres
1419
+ Extended_Pictographic ExtPict
1420
+ Extender Ext
1421
+ Grapheme_Base Gr_Base
1422
+ Grapheme_Extend Gr_Ext
1423
+ Hex_Digit Hex
1424
+ IDS_Binary_Operator IDSB
1425
+ IDS_Trinary_Operator IDST
1426
+ ID_Continue IDC
1427
+ ID_Start IDS
1428
+ Ideographic Ideo
1429
+ Join_Control Join_C
1430
+ Logical_Order_Exception LOE
1431
+ Lowercase Lower
1432
+ Math
1433
+ Noncharacter_Code_Point NChar
1434
+ Pattern_Syntax Pat_Syn
1435
+ Pattern_White_Space Pat_WS
1436
+ Quotation_Mark QMark
1437
+ Radical
1438
+ Regional_Indicator RI
1439
+ Sentence_Terminal STerm
1440
+ Soft_Dotted SD
1441
+ Terminal_Punctuation Term
1442
+ Unified_Ideograph UIdeo
1443
+ Uppercase Upper
1444
+ Variation_Selector VS
1445
+ White_Space space
1446
+ XID_Continue XIDC
1447
+ XID_Start XIDS`.split(/\s/).map(e=>[$_(e),e])),Gv=new Map([[`s`,X(383)],[X(383),`s`]]),Kv=new Map([[X(223),X(7838)],[X(107),X(8490)],[X(229),X(8491)],[X(969),X(8486)]]),qv=new Map([Xv(453),Xv(456),Xv(459),Xv(498),...Zv(8072,8079),...Zv(8088,8095),...Zv(8104,8111),Xv(8124),Xv(8140),Xv(8188)]),Jv=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function Yv(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Xv(e){let t=X(e);return[t.toLowerCase(),t]}function Zv(e,t){return Yv(e,t).map(e=>Xv(e))}var Qv=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function $v(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};ry(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Fv(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};nv(e,ey,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return nv(e,ty,a),nv(e,ny,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var ey={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=R_();e.body[0].body.push(z_({negate:!0,body:r}),G_(`Any`));let i=R_();i.body[0].body.push(H_(`greedy`,0,1/0,e)),n(Q(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Pv(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=uy(t.get(e));if(n){let t=R_({flags:n});t.body[0].body=e.body,e.body=[Q(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Q(z_({body:[O_({body:[k_(`string_end`)]}),O_({body:[M_(10)]})]}),t));else if(c===`line_start`)o(Q(yy(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`)if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&gy(e))o(Q(z_({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(xy(k_(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(Q(yy(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Hv})(?!${Hv})|(?<!${Hv})(?=${Hv}))`,n=`(?:(?<=${Hv})(?=${Hv})|(?<!${Hv})(?!${Hv}))`;o(Q(yy(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!vy(n)&&(n=ly(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!vy(r)&&(r=ly(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Q(N_({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(xy(F_(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Q(by(yy(Bv),l),t));return}if(s&&(c===`word`||u===`word`)){n(xy(F_(`word`,{negate:l}),t));return}if(c===`any`)n(xy(G_(`Any`),t));else if(c===`digit`)n(xy(G_(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Q(yy(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(xy(G_(`AHex`,{negate:l}),t));else if(c===`newline`)n(Q(yy(l?`[^
1448
+ ]`:`(?>\r
1449
+ ?|[
1450
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${X(e.codePointAt(0)-1)}${X(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(yy(`[${e}]`),t))}else n(Q(by(yy(Jv.get(u)),l),t));else if(c===`property`)Wv.has($_(u))||(e.key=`sc`);else if(c===`space`)n(xy(G_(`space`,{negate:l}),t));else if(c===`word`)n(Q(by(yy(Hv),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=R_({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&h_(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=z_({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(z_({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=R_();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=py(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!vy(n)&&(n=ly(n,t),e.ref=n)}},ty={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=xy(sy(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Pv(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Pv(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Nv(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?sy(0):oy(o,r.groupOriginByCopy,null),l=c;if(!s){let e=uy(cy(o,e=>e.type===`Group`&&!!e.flags)),t=e?Nv(r.globalFlags,e):r.globalFlags;iy(t,r.currentFlags)||(l=R_({flags:dy(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},ny={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>ay(t,e));i.length?i.length>1?n(Q(R_({atomic:!0,body:i.reverse().map(e=>O_({body:[A_(e.number)]}))}),t)):e.ref=i[0].number:n(Q(z_({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=j_();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ry(e){nv(e,{"*"({node:e,parent:t}){e.parent=t}})}function iy(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function ay(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=fy(n.parent);for(let r of t){if(r===n)break;if(r===e||my(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function oy(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=oy(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function sy(e){let t=W_(e);return t.isRecursive=!0,t}function cy(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function ly(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function uy(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function dy({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function fy(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function py(e){let t=e.find(e=>e.kind===`search_start`||_y(e,{negate:!1})||!hy(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=py(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function my(e,t){let n=fy(e)??[];for(let e of n)if(e===t||my(e,t))return!0;return!1}function hy({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function gy(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function _y(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&h_(e.body[0],{type:`Assertion`,kind:`search_start`})}function vy(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function yy(e,t){let n=v_(e,{...t,unicodePropertyMap:Wv}).body;return n.length>1||n[0].body.length>1?R_({body:n}):n[0].body[0]}function by(e,t){return e.negate=t,e}function xy(e,t){return e.parent=t,e}function Q(e,t){return ry(e),e.parent=t,e}function Sy(e,t){let n=zv(t),r=Fv(n.target,`ES2024`),i=Fv(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];nv(e,Cy,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Iv(wy[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Pv(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Cy={"*":{enter({node:e},t){if(Iy(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Nv({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Iy(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Ay(X(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),jy(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Qv.has(e.value)&&t.setHasCasedChar()}},wy={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=X(e),r=My(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Ay(n)){let e=Uv(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);jv.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(Ry)&&(o=[M_(45),...o.filter(e=>!Ry(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||jv.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=R_(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=O_({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(jv.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=My(n,i),o=My(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Ny(jy(e)).forEach(e=>{s.add(Array.isArray(e)?`${My(e[0],i)}-${My(e[1],i)}`:My(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Qv.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Nv(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Py(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Fy(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},Ty=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Ey=new Set([`-`,`\\`,`]`,`^`,`[`]),Dy=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Oy=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),ky=/^\p{Cased}$/u;function Ay(e){return ky.test(e)}function jy(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=X(e);if(!Ay(t))continue;let o=Uv(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function My(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Oy.has(e))return Oy.get(e);if(e<32||e>126&&e<160||e>262143||t&&Ly(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Dy:Ey:Ty,a=X(e);return(i.has(a)?`\\`:``)+a}function Ny(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Py(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Fy({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Iy({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Ly(e){return e>47&&e<58}function Ry({type:e,value:t}){return e===`Character`&&t===45}var zy=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Vy(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(By(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Hy(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function By(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Vy(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Pv(n,t,{}).transferTo=e;return n}function Hy(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Uy(e,t){let n=Wy(e,t);return n.options?new zy(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Wy(e,t){let n=zv(t),r=$v(v_(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Wv}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Sy(r,n),a=Tv(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=hv(vv(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Gy(e,t){return Uy(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Ky(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Gy(e,{target:t.target}),{createScanner(e){return new wg(e,t)},createString(e){return{content:e}}}}async function qy(e){if(Gu())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Vu.get(e);if(t!=null)return t;try{let t=Hu.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(nd,e)&&(t=nd[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return Bu.has(e)||Bu.set(e,n),n});return Vu.set(e,n),await n}finally{Vu.delete(e)}}function Jy(e){return Bu.get(e)??qy(e)}function Yy({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Xy(t)}}function Xy(e){return async()=>Op(Nu(await e()))}var Zy=`pierre`,Qy=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],$y=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],eb=[...$y,...Qy],tb=new Set($y);function nb(e){return tb.has(e)?`light`:`dark`}var rb={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},ib={"pierre-dark":()=>o(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>o(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>o(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>o(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>o(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>o(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>o(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>o(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>o(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>o(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function ab(e){return Yy({name:e,collection:Zy,colorScheme:nb(e),displayName:rb[e],load:ib[e]})}var ob=Ou({themes:eb.map(e=>ab(e))}),sb=`shiki`,cb=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],lb=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),ub=new Set(cb);function db(e){return ub.has(e)?`light`:`dark`}var fb={andromeeda:()=>o(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>o(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>o(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>o(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>o(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>o(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]),"catppuccin-latte":()=>o(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]),"catppuccin-macchiato":()=>o(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]),"catppuccin-mocha":()=>o(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]),"dark-plus":()=>o(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>o(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>o(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>o(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>o(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>o(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>o(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>o(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>o(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>o(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>o(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>o(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>o(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>o(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>o(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>o(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>o(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>o(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>o(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>o(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>o(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>o(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]),"kanagawa-lotus":()=>o(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]),"kanagawa-wave":()=>o(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]),laserwave:()=>o(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>o(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>o(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>o(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>o(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>o(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>o(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>o(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>o(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>o(()=>import(`./monokai-CdkpiU2Y.js`),[]),"night-owl":()=>o(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>o(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>o(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>o(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>o(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>o(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>o(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>o(()=>import(`./red-CJ3rzSJv.js`),[]),"rose-pine":()=>o(()=>import(`./rose-pine-BthvhNj6.js`),[]),"rose-pine-dawn":()=>o(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]),"rose-pine-moon":()=>o(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]),"slack-dark":()=>o(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>o(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>o(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>o(()=>import(`./solarized-dark-DV17i1UV.js`),[]),"solarized-light":()=>o(()=>import(`./solarized-light-DSh2HLQt.js`),[]),"synthwave-84":()=>o(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>o(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>o(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>o(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>o(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>o(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function pb(e){return Yy({name:e,collection:sb,colorScheme:db(e),load:fb[e]})}var mb=Ou({themes:Object.freeze([...cb.map(e=>pb(e)),...lb.map(e=>pb(e))])});function hb(e){if(Gu())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(Ru.hasRegisteredTheme(e))return;let t=mb.getTheme(e);if(t!=null){Ru.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function gb(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function _b(e){hb(e);let t=await Ru.resolveTheme(e);return gb(e,t),t}function vb(e){return Ru.getResolvedTheme(e)??_b(e)}var yb;async function bb({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){yb??=hg({themes:[],langs:[`text`],engine:n===`shiki-wasm`?jd(o(()=>import(`./wasm-BnjxR4X6.js`),[])):Ky()});let r=Sb(yb)?await yb:yb;yb=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Jy(e);`then`in t?i.push(t):Wu(t,r)}let a=[];for(let t of e){let e=vb(t);`then`in e?a.push(e):zu(e,yb)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Wu(e,r)}),Promise.all(a).then(e=>{zu(e,r)})]),r}function xb(){if(yb!=null&&!(`then`in yb))return yb}function Sb(e=yb){return e!=null&&`then`in e}for(let e of ob.getThemes())Ru.registerThemeIfAbsent(e.name,e.load);function Cb(e=lu){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function wb(e){return Ru.hasResolvedThemes(e)}function Tb(e,t){return Eu(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Eb(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Db=new Map,Ob=0,kb={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Ab(e){if(Db.has(e))return Db.get(e)??`text`;if(kb[e]!=null)return kb[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Db.has(t[1]))return Db.get(t[1])??`text`;if(kb[t[1]]!=null)return kb[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Db.has(n)?Db.get(n)??`text`:kb[n]??`text`}function jb(){return Ob}function Mb(){return Object.fromEntries(Db)}function Nb(e){return(e.lang??Ab(e.name))===`text`}function Pb({lines:e,startingLine:t=0,totalLines:n=1/0,callback:r}){let i=Math.min(t+n,e.length),a=(()=>{let t=e.at(-1);return t===``||t===`
1451
+ `||t===`\r
1452
+ `||t===`\r`?Math.max(0,e.length-2):e.length-1})();for(let n=t;n<i;n++){let t=n===a;if(r({lineIndex:n,lineNumber:n+1,content:e[n],isLastLine:t})===!0||t)break}}function Fb(e){return e.replace(/\n$|\r\n$/,``)}function Ib(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Lb({name:e,width:t=16,height:n=16,properties:r}){return $({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[$({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Rb(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function zb(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function Bb(e,t,n,r={}){return $({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[$({tagName:`span`,properties:{"data-line-number-content":``},children:[Ib(`${t}`)]})]})}function Vb(e,t,n){return $({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Hb(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Ib(`
1453
+ `)),e}var Ub=Symbol(`no-token`),Wb=Symbol(`multiple-tokens`);function Gb(e){let t=Kb(e);if(t!=null)return t;let n=Ub,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Jb(e,a);for(let t of e.children)qb(t)}else qb(e);r.push(e),i=[],a=void 0;return}for(let e of i)qb(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Ub){if(e===Wb){n=Wb;return}if(n===Ub){n=e;return}n!==e&&(n=Wb)}};for(let t of e.children){let e=t.type===`element`?Gb(t):Ub;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function Kb(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function qb(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)qb(t)}}function Jb(e,t){e.properties[`data-char`]=t}function Yb(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=t+Xb(typeof e==`string`?e:a(e))+n;return o=r(o),i.has(o)||i.set(o,typeof e==`string`?e:{...e}),o}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function Xb(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Zb(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Rb(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Gb(a),i.push(Hb(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push($b,Qb),{state:n,transformers:r,toClass:Qb}}var Qb=Yb({classPrefix:`hl-`}),$b={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function ex(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}function tx({theme:e=lu,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=Ll(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${ex(`global`)}fg:${a.fg};`,r+=`${ex(`global`)}bg:${a.bg};`,r+=nx(i,n)}else{let n=t.getTheme(e.dark),i=Ll(n);r+=`${ex(`global`)}dark:${i.fg};`,r+=`${ex(`global`)}dark-bg:${i.bg};`,r+=nx(n,`dark`),n=t.getTheme(e.light),i=Ll(n),r+=`${ex(`global`)}light:${i.fg};`,r+=`${ex(`global`)}light-bg:${i.bg};`,r+=nx(n,`light`)}return r}function nx(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${ex(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${ex(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${ex(`global`)}${t}modified-color:${a};`),n}function rx(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function ix(e){return e===``?[]:e.split(tu)}var ax={forcePlainText:!1};function ox(e,t,{theme:n=lu,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=ax){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=Zb(i),f=a?`text`:e.lang??Ab(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=tx({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:ex(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:ex(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=rx(t.codeToHast(l?sx(c??ix(e.contents),o,s):Fb(e.contents),h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function sx(e,t,n){let r=``;return Pb({lines:e,startingLine:t,totalLines:n,callback({content:e}){r+=e}}),r}function cx(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function lx(e,t){return Eu(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function ux(e){let t=e.lang??Ab(e.name),n=e.lang??(e.prevName==null?`text`:Ab(e.prevName));return t===`text`&&n===`text`}function dx(e){return{...hu,...e}}function fx(e,t){let n=px(e,t);return t?n:e.diffHeaderHeight+n}function px(e,t){return e.paddingTop??(t?e.spacing:0)}function mx(e){return e.paddingBottom??e.spacing}function hx(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function gx({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function _x({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function vx({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=_x({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function yx({type:e,metrics:t}){return t.hunkSeparatorHeight??hx(e)}function bx({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function xx({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function Sx(e){return e!==`simple`&&e!==`metadata`}function Cx({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!xx({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=yx({type:e,metrics:t}),a=bx({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function wx({type:e,metrics:t}){if(!Sx(e))return;let n=yx({type:e,metrics:t}),r=bx({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Tx({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=Ex({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=c.unifiedCount+e<n,a=c.splitCount+r<n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=gx({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),s=n===c.finalHunkIndex?vx({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,l=o.fromStart+o.fromEnd;function u(e,n){return s==null||s.collapsedLines<=0||s.fromStart+s.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?s.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?s.collapsedLines:0}let d=o.collapsedLines===0;function f(){return d?0:(d=!0,o.collapsedLines)}if(c.shouldSkip(l,l))c.incrementCounts(l,l),f();else{let e=r.unifiedLineStart-o.rangeSize,i=r.splitLineStart-o.rangeSize,a=r.deletionLineIndex-o.rangeSize,s=r.additionLineIndex-o.rangeSize,l=r.deletionStart-o.rangeSize,u=r.additionStart-o.rangeSize;if(kx(c,o.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-o.fromEnd,i=r.splitLineStart-o.fromEnd,a=r.deletionLineIndex-o.fromEnd,s=r.additionLineIndex-o.fromEnd,l=r.deletionStart-o.fromEnd,u=r.additionStart-o.fromEnd,kx(c,o.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}),()=>{f()})))break hunkIterator}let p=r.unifiedLineStart,m=r.splitLineStart,h=r.deletionLineIndex,g=r.additionLineIndex,_=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===y;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),f();else if(kx(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=p+t,s=m+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:u(o,s),type:`context`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:g+t,lineNumber:v+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{f()}))break hunkIterator;p+=e.lines,m+=e.lines,h+=e.lines,g+=e.lines,_+=e.lines,v+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Ax(c,e,t);(s[0]?.[0]??0)>0&&f();for(let[l,d]of s)for(let s=l;s<d;s++){let l=u(p+s,t===`unified`?m+(s<e.deletions?s:s-e.deletions):m+s);if(c.emit(jx({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:p,splitLineIndex:m,additionLineIndex:g,deletionLineIndex:h,additionLineNumber:v,deletionLineNumber:_,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}f(),c.incrementCounts(o,a),p+=o,m+=a,h+=e.deletions,g+=e.additions,_+=e.deletions,v+=e.additions}}if(s!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=s,a=r+i;if(kx(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:!1,unifiedLineIndex:p+t,splitLineIndex:m+t},additionLine:{unifiedLineIndex:p+t,splitLineIndex:m+t,lineIndex:g+t,lineNumber:v+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function Ex({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Dx({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function Dx({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=gx({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?vx({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function Ox(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function kx(e,t,n,r,i,a){let[o,s]=Ox(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Ax(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function jx({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,T=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&T!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:T};if(w!=null&&T==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||T==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:T}}var Mx=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Nx=new class extends Mx{};function Px(e,t,n){return Nx.diff(e,t,n)}function Fx(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Ix(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Lx(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Rx(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function zx(e,t){return Lx(e,t,``)}function Bx(e,t){return Rx(e,t,``)}function Vx(e,t){return t.slice(0,Hx(e,t))}function Hx(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Ux(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Wx(e,t){if(t)return Kx(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Gx(e,t){if(t)return Kx(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Kx(e,t){if(!t)return[Gx(e),Wx(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Ux(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var qx=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Jx=RegExp(`[${qx}]+|\\s+|[^${qx}]`,`ug`);new class extends Mx{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Ux(e,r)}else n=e.match(Jx)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Yx(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Yx(n,i,r,null,t.intlSegmenter),e}};function Yx(e,t,n,r,i){if(t&&n){let[a,o]=Kx(t.value,i),[s,c]=Kx(n.value,i);if(e){let r=Fx(a,s);e.value=Rx(e.value,s,r),t.value=zx(t.value,r),n.value=zx(n.value,r)}if(r){let e=Ix(o,c);r.value=Lx(r.value,c,e),t.value=Bx(t.value,e),n.value=Bx(n.value,e)}}else if(n){if(e){let e=Gx(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Gx(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Gx(r.value,i),[a,o]=Kx(t.value,i),s=Fx(n,a);t.value=zx(t.value,s);let c=Ix(zx(n,s),o);t.value=Bx(t.value,c),r.value=Lx(r.value,n,c),e.value=Rx(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Gx(r.value,i),n=Vx(Wx(t.value,i),e);t.value=Bx(t.value,n)}else if(e){let n=Vx(Wx(e.value,i),Gx(t.value,i));t.value=zx(t.value,n)}}var Xx=new class extends Mx{tokenize(e){let t=RegExp(`(\\r?\\n)|[${qx}]+|[^\\S\\n\\r]+|[^${qx}]`,`ug`);return e.match(t)||[]}};function Zx(e,t,n){return Xx.diff(e,t,n)}var Qx=new class extends Mx{constructor(){super(...arguments),this.tokenize=eS}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
1454
+ `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
1455
+ `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
1456
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
1457
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function $x(e,t,n){return Qx.diff(e,t,n)}function eS(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
1458
+ `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function tS(e){return e==`.`||e==`!`||e==`?`}new class extends Mx{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(tS(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Mx{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Mx{constructor(){super(...arguments),this.tokenize=eS}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(nS(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function nS(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=nS(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=nS(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Mx{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function rS(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function iS(e){if(!rS(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];e===7?t+=`\\a`:e===8?t+=`\\b`:e===9?t+=`\\t`:e===10?t+=`\\n`:e===11?t+=`\\v`:e===12?t+=`\\f`:e===13?t+=`\\r`:e===34?t+=`\\"`:e===92?t+=`\\\\`:e>=32&&e<=126?t+=String.fromCharCode(e):t+=`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var aS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function oS(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;$x(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l($x(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||lS(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
1459
+ `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function sS(e,t){if(t||=aS,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>sS(e,t)).join(`
1460
+ `)}let n=[];if(e.isGit){if(t=aS,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+iS(r)+` `+iS(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+iS((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+iS((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+iS((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+iS((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+iS(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+iS(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
1461
+ `)+`
1462
+ `}function cS(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;oS(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?sS(e,o.headerOptions):void 0)}}))}else{let s=oS(e,t,n,r,i,a,o);return s?sS(s,o?.headerOptions):void 0}}function lS(e){let t=e.endsWith(`
1463
+ `),n=e.split(`
1464
+ `).map(e=>e+`
1465
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function uS({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function dS({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}var fS={forcePlainText:!1};function pS(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=fS){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=tx({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??hS();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}Tx({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&mS({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=gS({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function mS({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Fb(e),t=Fb(t),e.length>s||t.length>s))return;let c=o===`char`?Px(e,t):Zx(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(dS({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),dS({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?dS({item:e,arr:l,enableJoin:d,isLastItem:t}):dS({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(uS({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(uS({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function hS(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function gS({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=lu,...l}}){let u=s??Ab(e.name),d=s??Ab(t.name),{state:f,transformers:p}=Zb(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:ex(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:ex(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,rx(i.codeToHast(Fb(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,rx(i.codeToHast(Fb(t.contents),m)))}}function _S(e){let t=[];for(let n of e){let e=Bu.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function vS(e){for(let t of Array.isArray(e)?e:[e])if(!Bu.has(t))return!1;return!0}async function yS(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=Jy(r)??qy(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function bS(e){return Ru.getResolvedThemes(e)}async function xS(e){for(let t of e)hb(t);let t=await Ru.resolveThemes(e);for(let n=0;n<e.length;n++)gb(e[n],t[n]);return t}var SS=t(n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n||=self).lru_map=n.lru_map||{})})(e,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),CS=Symbol(`IGNORE_RESPONSE`),wS=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},TS=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=lu,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new SS.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new SS.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??lu,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||lx(a,this.renderOptions))return;let o=Cb(e),c=[];if(Eu(a.theme,this.renderOptions.theme)||(c=wb(o)?bS(o):await xS(o)),!s())return;if(this.highlighter!=null)zu(c,this.highlighter);else{let e=await bb({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof wS||!s())return;throw e}}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);OS(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=Cb(this.renderOptions.theme),i=[];if(i=wb(r)?bS(r):await xS(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=vS(e)?_S(e):await yS(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([bb({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof wS||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=jb(),i=r>0?Mb():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>console.error(`Worker error:`,e,o)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};this.activeTaskById.set(s,c),this.executeTask(o,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=DS(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);Nb(t)||n!=null&&Tb(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||Nb(e)||t!=null&&Tb(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`file`,file:e},n):r.primeCache=!0}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return ox(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);ux(t)||n!=null&&lx(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||ux(e)||t!=null&&lx(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`diff`,diff:e},n):r.primeCache=!0}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:pS(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new wS;for(let t of this.activeTaskById.values())`reject`in t&&t.reject(e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r}}})();this.enqueueRenderTask(a)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(t=>!e.langs.has(t));if(r.length>0&&(vS(r)?t.request.resolvedLanguages=_S(r):t.request.resolvedLanguages=await yS(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw CS;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(OS(n))this.notifyHighlightError(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}else switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!Tb(i,this.getFileRenderOptions()))throw CS;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.file.cacheKey!=null&&this.fileCache.set(a.file.cacheKey,{result:r,options:i}),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!lx(i,this.getDiffRenderOptions()))throw CS;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.diff.cacheKey!=null&&this.diffCache.set(a.diff.cacheKey,{result:r,options:i}),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==CS&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,OS(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(OS(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){ES(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of DS(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),OS(t)?this.notifyHighlightError(t,n):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=jb();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=Mb())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of kS(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))OS(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of kS(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of kS(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of kS(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of kS(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Eb(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&cx(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())OS(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function ES(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function DS(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??Ab(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??Ab(e.request.diff.name)),t.add(e.request.diff.lang??Ab(e.request.diff.prevName??`-`));break}return t.delete(`text`),Array.from(t)}function OS(e){return e?.type===`file`||e?.type===`diff`}function kS(e){return e.instances}var AS;function jS({poolOptions:e,highlighterOptions:t}){return AS??=new TS(e,t),AS}function MS(){AS!=null&&(AS.terminate(),AS=void 0)}var NS=(0,g.createContext)(void 0),PS=0;function FS({children:e,poolOptions:t,highlighterOptions:n}){let[r]=(0,g.useState)(()=>{if(!(typeof window>`u`))return jS({poolOptions:t,highlighterOptions:n})});return(0,g.useInsertionEffect)(()=>{if(r!=null)return PS++,()=>{PS--}},[r]),(0,g.useEffect)(()=>()=>{PS===0&&MS()},[]),(0,_.jsx)(NS.Provider,{value:r,children:e})}function IS(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function LS(e,t){let n=e?.theme??lu,r=t?.theme??lu,i=RS(e),a=RS(t);return Eu(n,r)&&IS(e,t,[`theme`,`parseDiffOptions`])&&IS(i,a)}function RS(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function zS(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function BS(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}var VS=`-1,-1`;function HS(e){return e?.some(e=>e.lineNumber===0)??!1}function US(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function WS(e){return e.startingLine===0&&e.totalLines>0}function GS(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function KS(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Lb({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}var qS=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){let n=!(e===this.selectedRange||zS(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&uC(e.composedPath())||(dC(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(dC(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(dC(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){dC(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();dC(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);dC(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=QS(i)&&this.hoveredLine?.lineElement===i.lineElement;ZS(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ZS(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),QS(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(eC(i)&&p!=null){p(i);break}if($S(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!QS(i))break;ZS(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,dC(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),dC(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),dC(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();uC(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),a=r?.top??i;i==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:a,current:i},t&&(this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(GS(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=_h(KS());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);XS(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(rC(t));if(XS(n)&&!(this.mode===`diff`&&e.side!=null&&n.side!==e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(XS(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(XS(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&uC(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=rC(e);if(t&&uC(n))return;let r=iC(e);return r==null?this.pathFromAnnotationSlot(e):rC(r)}pathFromAnnotationSlot(e){let t=oC(aC(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:rC(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=sC(t)?t:sC(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}zS(r??void 0,i??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute(`data-line-annotation`)||s.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);tC(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=lC(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=lC(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:nC(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:nC(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:cC(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:cC(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function JS({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:YS({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function YS({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function XS(e){return e!=null&&`kind`in e&&e.kind===`line`}function ZS(e){return e!=null&&`kind`in e&&e.kind===`token`}function QS(e){return XS(e)||ZS(e)}function $S(e){return`type`in e&&e.type===`line-info`}function eC(e){return`kind`in e&&e.kind===`merge-conflict-action`}function tC(e){return e===`current`||e===`incoming`||e===`both`}function nC(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function rC(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function iC(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function aC(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function oC(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function sC(e){return e!=null&&typeof e.elementFromPoint==`function`}function cC(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function lC(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function uC(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}function dC(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return;break}console.log(...n)}var fC=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,t){let n=new Set,r=0,i=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(r===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;r++;let n=i.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let a=e.firstElementChild;a instanceof HTMLElement||(a=null),n==null?(n={type:`code`,codeElement:e,numberElement:a,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,n),this.observe(e),a!=null&&(this.observedNodes.set(a,n),this.observe(a))):(this.observedNodes.set(e,n),i.delete(e),n.numberElement===a?n.numberElement==null?n.numberWidth=0:(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),a!=null&&(this.observe(a),i.delete(a),this.observedNodes.set(a,n)),n.numberElement=a,n.numberWidth=0))}if(r>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),r=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let n=r.get(t);n??(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[r,a]=t,o=r.firstElementChild,s=a.firstElementChild;if(!(r instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=i.get(o);if(c!=null){this.observedNodes.set(o,c),this.observedNodes.set(s,c),i.delete(o),i.delete(s);continue}let l=o.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:r,child:o,childHeight:l},column2:{container:a,child:s,childHeight:u},currentHeight:`auto`},n.add({child1:o,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of n)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);n.clear()}for(let[e,t]of i)this.unobserve(e),t.type===`code`?hC(t):gC(t);i.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:pC(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:mC(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;if(!(!i&&!a)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e==`number`?`${e}px`:`auto`}`),a&&t.codeElement.style.setProperty(`--diffs-column-number-width`,`${r===0?`auto`:`${r}px`}`),i||a&&e!==`auto`)){let n=typeof e==`number`?Math.max(e-r,0):0;t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n>0?`${n}px`:`auto`}`)}}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function pC(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function mC(e){return Math.max(Math.ceil(e),0)}function hC(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`))}function gC(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function _C(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function vC(e){for(let t of Array.isArray(e)?e:[e])if(!(t===`text`||t===`ansi`)&&!Uu.has(t))return!1;return!0}function yC(e){for(let t of Cb(e))if(!Du.has(t))return!1;return!0}function bC(e){return $({tagName:`div`,children:[$({tagName:`div`,children:e.annotations?.map(e=>$({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function xC(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function SC(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function CC({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return $({tagName:`div`,children:[t===`custom`?$({tagName:`slot`,properties:{name:cu}}):wC({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[TC(r)]],properties:i})}function wC({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:ou}}),Lb({name:SC(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Ib(t)]})],properties:{"data-prev-name":``}})),r.push(Lb({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Ib(e)]})],properties:{"data-title":``}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function TC(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push($({tagName:`span`,children:[Ib(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[Ib(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:su}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function EC(e){return $({tagName:`pre`,properties:DC(e)})}function DC({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function OC(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Cb(t),preferredHighlighter:n}}function kC(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}var AC=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1466
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
1467
+ <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
1468
+ </symbol>
1469
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
1470
+ <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
1471
+ </symbol>
1472
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
1473
+ <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
1474
+ </symbol>
1475
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
1476
+ <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
1477
+ </symbol>
1478
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
1479
+ <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
1480
+ </symbol>
1481
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
1482
+ <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
1483
+ </symbol>
1484
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
1485
+ <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
1486
+ </symbol>
1487
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
1488
+ <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
1489
+ </symbol>
1490
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
1491
+ <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
1492
+ </symbol>
1493
+ <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
1494
+ <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
1495
+ </symbol>
1496
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
1497
+ <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
1498
+ </symbol>
1499
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
1500
+ <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
1501
+ </symbol>
1502
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
1503
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
1504
+ </symbol>
1505
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
1506
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
1507
+ </symbol>
1508
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
1509
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
1510
+ </symbol>
1511
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
1512
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
1513
+ </symbol>
1514
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
1515
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
1516
+ </symbol>
1517
+ </svg>`;function jC(e,t){return e==null||t==null?e===t:NC(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var MC={};function NC(e=MC,t=MC){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function PC(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function FC(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function IC(){let e=document.createElement(`style`);return e.setAttribute(du,``),e}var LC;function RC(e){if(LC!=null)return LC;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(fu,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),LC=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),LC}function zC(e){return`${pu}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var BC=`@layer base {
1518
+ :host {
1519
+ --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
1520
+ "Courier New", monospace;
1521
+ --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
1522
+ "Noto Sans", "Liberation Sans", Arial, sans-serif;
1523
+ --diffs-mixer: light-dark(#000, #fff);
1524
+ --diffs-gap-fallback: 8px;
1525
+ --diffs-scrollbar-gutter-fallback: 6px;
1526
+ --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
1527
+ --diffs-added-light: #0dbe4e;
1528
+ --diffs-added-dark: #5ecc71;
1529
+ --diffs-modified-light: #009fff;
1530
+ --diffs-modified-dark: #69b1ff;
1531
+ --diffs-deleted-light: #ff2e3f;
1532
+ --diffs-deleted-dark: #ff6762;
1533
+ color-scheme: light dark;
1534
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1535
+ font-size: var(--diffs-font-size, 13px);
1536
+ line-height: var(--diffs-line-height, 20px);
1537
+ font-feature-settings: var(--diffs-font-features);
1538
+ --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
1539
+ --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
1540
+ --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
1541
+ --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
1542
+ --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
1543
+ --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
1544
+ --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
1545
+ --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
1546
+ --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
1547
+ --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
1548
+ --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
1549
+ --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
1550
+ --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
1551
+ --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
1552
+ --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
1553
+ --diffs-selection-base: var(--diffs-modified-base);
1554
+ --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
1555
+ background-color: var(--diffs-bg);
1556
+ color: var(--diffs-fg);
1557
+ display: block;
1558
+ }
1559
+
1560
+ pre, code, [data-error-wrapper] {
1561
+ isolation: isolate;
1562
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1563
+ outline: none;
1564
+ margin: 0;
1565
+ padding: 0;
1566
+ display: block;
1567
+ }
1568
+
1569
+ pre, code {
1570
+ background-color: var(--diffs-bg);
1571
+ }
1572
+
1573
+ code {
1574
+ contain: content;
1575
+ }
1576
+
1577
+ *, :before, :after {
1578
+ box-sizing: border-box;
1579
+ }
1580
+
1581
+ [data-icon-sprite] {
1582
+ display: none;
1583
+ }
1584
+
1585
+ [data-diffs-header], [data-separator] {
1586
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1587
+ }
1588
+
1589
+ [data-diffs-header][data-sticky] {
1590
+ z-index: 1;
1591
+ background-color: var(--diffs-bg);
1592
+ position: sticky;
1593
+ top: 0;
1594
+ }
1595
+
1596
+ [data-file-info] {
1597
+ color: var(--fg);
1598
+ background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
1599
+ border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
1600
+ padding: 10px;
1601
+ font-weight: 700;
1602
+ }
1603
+
1604
+ [data-diff], [data-file] {
1605
+ --diffs-grid-number-column-width: minmax(min-content, max-content);
1606
+ --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
1607
+
1608
+ &[data-dehydrated] {
1609
+ --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
1610
+ }
1611
+
1612
+ &:hover [data-code]::-webkit-scrollbar-thumb {
1613
+ background-color: var(--diffs-bg-context);
1614
+ }
1615
+ }
1616
+
1617
+ @supports (-webkit-touch-callout: none) {
1618
+ :host {
1619
+ --diffs-scrollbar-gutter-fallback: 0px;
1620
+ }
1621
+ }
1622
+
1623
+ [data-line] span {
1624
+ color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
1625
+ background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
1626
+ font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
1627
+ font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
1628
+ text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
1629
+ }
1630
+
1631
+ [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions] {
1632
+ --diffs-computed-decoration-bg: var(--diffs-bg);
1633
+ --diffs-computed-diff-line-bg: var(--diffs-bg);
1634
+ --diffs-computed-selected-line-bg: var(--diffs-bg);
1635
+ color: var(--diffs-fg);
1636
+ background-color: var(--diffs-line-bg, var(--diffs-bg));
1637
+
1638
+ @media (pointer: fine) {
1639
+ &:where([data-hovered]) {
1640
+ --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
1641
+ var(--diffs-computed-selected-line-bg) 97%,
1642
+ var(--diffs-bg-hover-override, var(--diffs-mixer))), color-mix(in lab,
1643
+ var(--diffs-computed-selected-line-bg) 91%,
1644
+ var(--diffs-bg-hover-override, var(--diffs-mixer))));
1645
+ --diffs-line-bg: var(--diffs-computed-hovered-line-bg, inherit);
1646
+ }
1647
+ }
1648
+ }
1649
+
1650
+ [data-line], [data-no-newline] {
1651
+ &[data-decoration-bg] {
1652
+ --mix-deco-light: 92%;
1653
+ --mix-deco-dark: 85%;
1654
+
1655
+ &[data-decoration-bg-depth="2"] {
1656
+ --mix-deco-light: 88%;
1657
+ --mix-deco-dark: 80%;
1658
+ }
1659
+
1660
+ &[data-decoration-bg-depth="3"] {
1661
+ --mix-deco-light: 85%;
1662
+ --mix-deco-dark: 78%;
1663
+ }
1664
+
1665
+ @media (pointer: fine) {
1666
+ &[data-hovered]:not([data-selected-line]) {
1667
+ --mix-deco-light: 85%;
1668
+ --mix-deco-dark: 85%;
1669
+ }
1670
+
1671
+ &[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="2"] {
1672
+ --mix-deco-light: 83%;
1673
+ --mix-deco-dark: 83%;
1674
+ }
1675
+
1676
+ &[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="3"] {
1677
+ --mix-deco-light: 81%;
1678
+ --mix-deco-dark: 81%;
1679
+ }
1680
+ }
1681
+
1682
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
1683
+ var(--diffs-bg) var(--mix-deco-light),
1684
+ var(--diffs-decoration-bg)), color-mix(in lab,
1685
+ var(--diffs-bg) var(--mix-deco-dark),
1686
+ var(--diffs-decoration-bg)));
1687
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
1688
+ --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
1689
+ --diffs-line-bg: var(--diffs-computed-decoration-bg);
1690
+ }
1691
+ }
1692
+
1693
+ [data-line-annotation], [data-gutter-buffer="annotation"] {
1694
+ --diffs-annotation-bg: var(--diffs-bg-context);
1695
+ --diffs-computed-decoration-bg: var(--diffs-annotation-bg);
1696
+ --diffs-computed-diff-line-bg: var(--diffs-annotation-bg);
1697
+ --diffs-computed-selected-line-bg: var(--diffs-annotation-bg);
1698
+ --diffs-line-bg: var(--diffs-annotation-bg);
1699
+ }
1700
+
1701
+ [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
1702
+ --diffs-computed-decoration-bg: var(--diffs-bg-context);
1703
+ --diffs-computed-diff-line-bg: var(--diffs-bg-context);
1704
+ --diffs-computed-selected-line-bg: var(--diffs-bg-context);
1705
+ --diffs-line-bg: var(--diffs-bg-context);
1706
+ }
1707
+
1708
+ [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
1709
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
1710
+ var(--diffs-bg) 78%,
1711
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
1712
+ var(--diffs-bg) 68%,
1713
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
1714
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
1715
+ --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
1716
+ --diffs-line-bg: var(--diffs-computed-decoration-bg);
1717
+ }
1718
+
1719
+ [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
1720
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
1721
+ var(--diffs-bg) 78%,
1722
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
1723
+ var(--diffs-bg) 68%,
1724
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
1725
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
1726
+ --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
1727
+ --diffs-line-bg: var(--diffs-computed-decoration-bg);
1728
+ }
1729
+
1730
+ [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
1731
+ --diffs-computed-decoration-bg: var(--diffs-bg);
1732
+ --diffs-computed-diff-line-bg: var(--diffs-bg);
1733
+ --diffs-computed-selected-line-bg: var(--diffs-bg);
1734
+ --diffs-line-bg: var(--diffs-bg);
1735
+ }
1736
+
1737
+ :where([data-background]) {
1738
+ & [data-gutter-buffer], & [data-column-number] {
1739
+ --mix-light: 91%;
1740
+ --mix-dark: 85%;
1741
+ }
1742
+
1743
+ & [data-line], & [data-no-newline] {
1744
+ --mix-light: 88%;
1745
+ --mix-dark: 80%;
1746
+ }
1747
+
1748
+ & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
1749
+ --diffs-diff-line-mix-target: var(--diffs-bg);
1750
+
1751
+ &[data-line-type="change-deletion"] {
1752
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
1753
+
1754
+ @media (pointer: fine) {
1755
+ &[data-hovered] {
1756
+ --mix-light: 80%;
1757
+ --mix-dark: 75%;
1758
+ }
1759
+ }
1760
+
1761
+ &:where([data-gutter-buffer], [data-column-number]) {
1762
+ color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
1763
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
1764
+ }
1765
+
1766
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
1767
+ var(--diffs-computed-decoration-bg) var(--mix-light),
1768
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
1769
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
1770
+ var(--diffs-diff-line-mix-target)));
1771
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
1772
+ --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
1773
+ }
1774
+
1775
+ &[data-line-type="change-addition"] {
1776
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
1777
+
1778
+ @media (pointer: fine) {
1779
+ &[data-hovered] {
1780
+ --mix-light: 80%;
1781
+ --mix-dark: 70%;
1782
+ }
1783
+ }
1784
+
1785
+ &:where([data-gutter-buffer], [data-column-number]) {
1786
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
1787
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
1788
+ }
1789
+
1790
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
1791
+ var(--diffs-computed-decoration-bg) var(--mix-light),
1792
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
1793
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
1794
+ var(--diffs-diff-line-mix-target)));
1795
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
1796
+ --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
1797
+ }
1798
+
1799
+ &[data-merge-conflict="current"] {
1800
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
1801
+
1802
+ &:where([data-gutter-buffer], [data-column-number]) {
1803
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
1804
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
1805
+ }
1806
+
1807
+ @media (pointer: fine) {
1808
+ &[data-hovered] {
1809
+ --mix-light: 80%;
1810
+ --mix-dark: 70%;
1811
+ }
1812
+ }
1813
+
1814
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
1815
+ var(--diffs-computed-decoration-bg) var(--mix-light),
1816
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
1817
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
1818
+ var(--diffs-diff-line-mix-target)));
1819
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
1820
+ --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
1821
+ }
1822
+
1823
+ &[data-merge-conflict="incoming"] {
1824
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
1825
+
1826
+ &:where([data-gutter-buffer], [data-column-number]) {
1827
+ color: var(--diffs-modified-base);
1828
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
1829
+ }
1830
+
1831
+ @media (pointer: fine) {
1832
+ &[data-hovered] {
1833
+ --mix-light: 80%;
1834
+ --mix-dark: 70%;
1835
+ }
1836
+ }
1837
+
1838
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
1839
+ var(--diffs-computed-decoration-bg) var(--mix-light),
1840
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
1841
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
1842
+ var(--diffs-diff-line-mix-target)));
1843
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
1844
+ --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
1845
+ }
1846
+ }
1847
+ }
1848
+
1849
+ [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline] {
1850
+ --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
1851
+
1852
+ &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
1853
+ --mix-selection-light: 82%;
1854
+ --mix-selection-dark: 75%;
1855
+
1856
+ @media (pointer: fine) {
1857
+ &[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
1858
+ --mix-selection-light: 75%;
1859
+ --mix-selection-dark: 70%;
1860
+ }
1861
+ }
1862
+ }
1863
+
1864
+ &:where([data-gutter-buffer], [data-column-number])[data-selected-line] {
1865
+ --mix-selection-light: 75%;
1866
+ --mix-selection-dark: 60%;
1867
+ --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
1868
+
1869
+ @media (pointer: fine) {
1870
+ &[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
1871
+ --mix-selection-light: 70%;
1872
+ --mix-selection-dark: 55%;
1873
+ }
1874
+ }
1875
+ }
1876
+
1877
+ &[data-selected-line] {
1878
+ --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
1879
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
1880
+ var(--diffs-selection-mix-target)), color-mix(in lab,
1881
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
1882
+ var(--diffs-selection-mix-target)));
1883
+ --diffs-line-bg: var(--diffs-computed-selected-line-bg, inherit);
1884
+ }
1885
+ }
1886
+
1887
+ [data-gutter-buffer], [data-column-number] {
1888
+ &[data-selected-line] {
1889
+ color: var(--diffs-selection-number-fg);
1890
+ }
1891
+ }
1892
+
1893
+ [data-no-newline] {
1894
+ user-select: none;
1895
+
1896
+ & span {
1897
+ opacity: .6;
1898
+ }
1899
+ }
1900
+
1901
+ [data-diff-type="split"][data-overflow="scroll"] {
1902
+ grid-template-columns: 1fr 1fr;
1903
+ display: grid;
1904
+
1905
+ & [data-additions] {
1906
+ border-left: 1px solid var(--diffs-bg);
1907
+ }
1908
+
1909
+ & [data-deletions] {
1910
+ border-right: 1px solid var(--diffs-bg);
1911
+ }
1912
+ }
1913
+
1914
+ [data-code] {
1915
+ grid-auto-flow: dense;
1916
+ grid-template-columns: var(--diffs-code-grid);
1917
+ overflow: var(--diffs-overflow-override, scroll) clip;
1918
+ overscroll-behavior-x: none;
1919
+ tab-size: var(--diffs-tab-size, 2);
1920
+ padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
1921
+ padding-bottom: max(0px,
1922
+ calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
1923
+ var(--diffs-scrollbar-gutter)));
1924
+ scrollbar-gutter: stable;
1925
+ align-self: flex-start;
1926
+ display: grid;
1927
+ }
1928
+
1929
+ [data-diffs-scrollbar-measure] {
1930
+ opacity: 0;
1931
+ pointer-events: none;
1932
+ scrollbar-gutter: auto;
1933
+ grid-template-columns: none;
1934
+ width: 100px;
1935
+ height: 100px;
1936
+ padding: 0;
1937
+ position: absolute;
1938
+ top: -200px;
1939
+ left: -200px;
1940
+ }
1941
+
1942
+ [data-container-size] {
1943
+ container-type: inline-size;
1944
+ }
1945
+
1946
+ [data-code]::-webkit-scrollbar {
1947
+ width: 0;
1948
+ height: var(--diffs-scrollbar-gutter);
1949
+ }
1950
+
1951
+ [data-code]::-webkit-scrollbar-track {
1952
+ background: none;
1953
+ }
1954
+
1955
+ [data-code]::-webkit-scrollbar-thumb {
1956
+ background-color: #0000;
1957
+ background-clip: content-box;
1958
+ border: 1px solid #0000;
1959
+ border-radius: 3px;
1960
+ }
1961
+
1962
+ [data-code]::-webkit-scrollbar-corner {
1963
+ background-color: #0000;
1964
+ }
1965
+
1966
+ @supports ((-moz-appearance: none)) {
1967
+ [data-code] {
1968
+ scrollbar-width: thin;
1969
+ scrollbar-color: var(--diffs-bg-context) transparent;
1970
+ padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
1971
+ }
1972
+ }
1973
+
1974
+ [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
1975
+ & [data-code], &[data-overflow="wrap"] {
1976
+ padding-top: 0;
1977
+ }
1978
+ }
1979
+
1980
+ [data-gutter] {
1981
+ grid-template-rows: subgrid;
1982
+ grid-template-columns: subgrid;
1983
+ z-index: 3;
1984
+ background-color: var(--diffs-bg);
1985
+ grid-column: 1;
1986
+ display: grid;
1987
+ position: relative;
1988
+
1989
+ & [data-gutter-buffer], & [data-column-number] {
1990
+ border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
1991
+ }
1992
+ }
1993
+
1994
+ [data-content] {
1995
+ grid-template-rows: subgrid;
1996
+ grid-template-columns: subgrid;
1997
+ background-color: var(--diffs-bg);
1998
+ grid-column: 2;
1999
+ min-width: 0;
2000
+ display: grid;
2001
+ }
2002
+
2003
+ [data-diff-type="split"][data-overflow="wrap"] {
2004
+ grid-auto-flow: dense;
2005
+ grid-template-columns: repeat(2, var(--diffs-code-grid));
2006
+ padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
2007
+ display: grid;
2008
+
2009
+ & [data-deletions] {
2010
+ display: contents;
2011
+
2012
+ & [data-gutter] {
2013
+ grid-column: 1;
2014
+ }
2015
+
2016
+ & [data-content] {
2017
+ border-right: 1px solid var(--diffs-bg);
2018
+ grid-column: 2;
2019
+ }
2020
+ }
2021
+
2022
+ & [data-additions] {
2023
+ display: contents;
2024
+
2025
+ & [data-gutter] {
2026
+ border-left: 1px solid var(--diffs-bg);
2027
+ grid-column: 3;
2028
+ }
2029
+
2030
+ & [data-content] {
2031
+ grid-column: 4;
2032
+ }
2033
+ }
2034
+ }
2035
+
2036
+ [data-overflow="scroll"] [data-gutter] {
2037
+ position: sticky;
2038
+ left: 0;
2039
+ }
2040
+
2041
+ [data-interactive-lines] [data-line] {
2042
+ cursor: pointer;
2043
+ }
2044
+
2045
+ [data-interactive-line-numbers] [data-column-number] {
2046
+ cursor: pointer;
2047
+ touch-action: none;
2048
+ }
2049
+
2050
+ [data-content-buffer], [data-gutter-buffer] {
2051
+ user-select: none;
2052
+ min-height: 1lh;
2053
+ position: relative;
2054
+ }
2055
+
2056
+ [data-gutter-buffer] {
2057
+ padding-left: 2ch;
2058
+ padding-right: 1ch;
2059
+
2060
+ &:before {
2061
+ content: "";
2062
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
2063
+ display: block;
2064
+ }
2065
+ }
2066
+
2067
+ [data-gutter-buffer="annotation"] {
2068
+ --diffs-annotation-bg: var(--diffs-bg-context-gutter);
2069
+ min-height: 0;
2070
+ }
2071
+
2072
+ [data-gutter-buffer="buffer"] {
2073
+ --diffs-line-bg: var(--diffs-bg-context-gutter);
2074
+ }
2075
+
2076
+ [data-content-buffer] {
2077
+ background-position: 5px 0;
2078
+ background-size: 8px 8px;
2079
+ background-origin: border-box;
2080
+ background-image: repeating-linear-gradient(-45deg,
2081
+ transparent,
2082
+ transparent calc(3px * 1.414),
2083
+ var(--diffs-bg-buffer) calc(3px * 1.414),
2084
+ var(--diffs-bg-buffer) calc(4px * 1.414));
2085
+ grid-column: 1;
2086
+ }
2087
+
2088
+ [data-separator] {
2089
+ box-sizing: content-box;
2090
+ background-color: var(--diffs-bg);
2091
+ }
2092
+
2093
+ [data-separator="simple"] {
2094
+ min-height: 4px;
2095
+ }
2096
+
2097
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
2098
+ background-color: var(--diffs-bg-separator);
2099
+ }
2100
+
2101
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
2102
+ height: 32px;
2103
+ position: relative;
2104
+ }
2105
+
2106
+ [data-separator-wrapper] {
2107
+ user-select: none;
2108
+ fill: currentColor;
2109
+ background-color: var(--diffs-bg);
2110
+ align-items: center;
2111
+ height: 100%;
2112
+ display: flex;
2113
+ position: absolute;
2114
+ inset-inline: 0;
2115
+ }
2116
+
2117
+ [data-content] [data-separator-wrapper] {
2118
+ display: none;
2119
+ }
2120
+
2121
+ [data-separator="metadata"] [data-separator-wrapper] {
2122
+ background-color: var(--diffs-bg-separator);
2123
+ height: 100%;
2124
+ color: var(--diffs-fg-number);
2125
+ white-space: nowrap;
2126
+ text-overflow: ellipsis;
2127
+ min-width: min-content;
2128
+ padding-inline: 1ch;
2129
+ inset-inline: 100% auto;
2130
+ overflow: hidden;
2131
+ }
2132
+
2133
+ [data-separator="line-info"] {
2134
+ margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
2135
+
2136
+ & [data-separator-wrapper] {
2137
+ min-width: 16px;
2138
+ }
2139
+ }
2140
+
2141
+ [data-separator="line-info-basic"], [data-separator="metadata"] {
2142
+ margin-block: 0;
2143
+ }
2144
+
2145
+ [data-separator="line-info"][data-separator-first] {
2146
+ margin-top: 0;
2147
+ }
2148
+
2149
+ [data-separator="line-info"][data-separator-last] {
2150
+ margin-bottom: 0;
2151
+ }
2152
+
2153
+ [data-expand-index] [data-separator-wrapper] {
2154
+ grid-template-columns: 32px auto;
2155
+ display: grid;
2156
+ }
2157
+
2158
+ [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
2159
+ grid-template-columns: 32px 32px auto;
2160
+ }
2161
+
2162
+ [data-expand-button], [data-separator-content] {
2163
+ background-color: var(--diffs-bg-separator);
2164
+ flex: none;
2165
+ align-items: center;
2166
+ display: flex;
2167
+ }
2168
+
2169
+ [data-expand-index] [data-separator-content]:hover {
2170
+ cursor: pointer;
2171
+ text-decoration: underline;
2172
+ }
2173
+
2174
+ [data-expand-button] {
2175
+ cursor: pointer;
2176
+ min-width: 32px;
2177
+ color: var(--diffs-fg-number);
2178
+ border-right: 2px solid var(--diffs-bg);
2179
+ flex-shrink: 0;
2180
+ justify-content: center;
2181
+ align-self: stretch;
2182
+
2183
+ &:hover {
2184
+ color: var(--diffs-fg);
2185
+ }
2186
+
2187
+ &[data-expand-all-button] {
2188
+ display: none;
2189
+ }
2190
+ }
2191
+
2192
+ [data-expand-down] [data-icon] {
2193
+ transform: scaleY(-1);
2194
+ }
2195
+
2196
+ [data-separator-content] {
2197
+ height: 100%;
2198
+ color: var(--diffs-fg-number);
2199
+ flex: auto;
2200
+ justify-content: flex-start;
2201
+ padding: 0 1ch;
2202
+ overflow: hidden;
2203
+ }
2204
+
2205
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
2206
+ & [data-separator-content] {
2207
+ user-select: none;
2208
+ height: 100%;
2209
+ overflow: clip;
2210
+ }
2211
+ }
2212
+
2213
+ [data-unmodified-lines] {
2214
+ text-overflow: ellipsis;
2215
+ white-space: nowrap;
2216
+ flex: 0 auto;
2217
+ min-width: 0;
2218
+ display: block;
2219
+ overflow: hidden;
2220
+ }
2221
+
2222
+ @supports (width: 1cqi) {
2223
+ [data-unified] {
2224
+ & [data-separator="line-info"] [data-separator-wrapper] {
2225
+ padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
2226
+ width: 100cqi;
2227
+
2228
+ & [data-separator-content] {
2229
+ border-radius: 6px;
2230
+ }
2231
+ }
2232
+
2233
+ & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
2234
+ border-top-left-radius: unset;
2235
+ border-bottom-left-radius: unset;
2236
+ }
2237
+ }
2238
+
2239
+ [data-gutter] {
2240
+ & [data-separator="line-info"] [data-separator-wrapper] {
2241
+ padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
2242
+ }
2243
+
2244
+ & [data-separator="line-info"] [data-separator-content] {
2245
+ border-top-left-radius: 6px;
2246
+ border-bottom-left-radius: 6px;
2247
+ }
2248
+
2249
+ & [data-separator="line-info"][data-expand-index] [data-separator-content] {
2250
+ border-top-left-radius: unset;
2251
+ border-bottom-left-radius: unset;
2252
+ }
2253
+ }
2254
+
2255
+ [data-additions] {
2256
+ & [data-content] [data-separator="line-info"] {
2257
+ background-color: var(--diffs-bg);
2258
+
2259
+ & [data-separator-wrapper] {
2260
+ display: none;
2261
+ }
2262
+ }
2263
+
2264
+ & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
2265
+ background-color: var(--diffs-bg-separator);
2266
+ border-top-right-radius: 6px;
2267
+ border-bottom-right-radius: 6px;
2268
+ height: 100%;
2269
+ display: block;
2270
+
2271
+ & [data-separator-content], & [data-expand-button] {
2272
+ display: none;
2273
+ }
2274
+ }
2275
+ }
2276
+
2277
+ [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
2278
+ width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
2279
+ }
2280
+
2281
+ [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
2282
+ background-color: var(--diffs-bg-separator);
2283
+ height: 100%;
2284
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
2285
+ border-top-right-radius: 6px;
2286
+ border-bottom-right-radius: 6px;
2287
+ display: block;
2288
+
2289
+ & [data-separator-content], & [data-expand-button] {
2290
+ display: none;
2291
+ }
2292
+ }
2293
+
2294
+ [data-separator="line-info"] [data-separator-wrapper] {
2295
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
2296
+ border-top-left-radius: 6px;
2297
+ border-bottom-left-radius: 6px;
2298
+ }
2299
+ }
2300
+
2301
+ @media (pointer: fine) {
2302
+ [data-separator="line-info"] [data-separator-wrapper] {
2303
+ &[data-separator-multi-button] {
2304
+ & [data-expand-up] {
2305
+ border-top-left-radius: 6px;
2306
+ border-bottom-left-radius: unset;
2307
+ }
2308
+
2309
+ & [data-expand-down] {
2310
+ border-bottom-left-radius: 6px;
2311
+ border-top-left-radius: unset;
2312
+ }
2313
+ }
2314
+ }
2315
+ }
2316
+ }
2317
+
2318
+ @media (pointer: coarse) {
2319
+ [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
2320
+ grid-template-columns: 34px 34px auto;
2321
+
2322
+ & [data-separator-content] {
2323
+ grid-column: unset;
2324
+ grid-row: unset;
2325
+ }
2326
+ }
2327
+
2328
+ @supports (width: 1cqi) {
2329
+ [data-separator="line-info"] [data-separator-wrapper] {
2330
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
2331
+ border-top-left-radius: 6px;
2332
+ border-bottom-left-radius: 6px;
2333
+ }
2334
+
2335
+ &[data-separator-multi-button] {
2336
+ & [data-expand-up] {
2337
+ border-top-left-radius: 6px;
2338
+ border-bottom-left-radius: 6px;
2339
+ }
2340
+
2341
+ & [data-expand-down] {
2342
+ border-bottom-left-radius: unset;
2343
+ border-top-left-radius: unset;
2344
+ }
2345
+ }
2346
+ }
2347
+ }
2348
+ }
2349
+
2350
+ @media (pointer: fine) {
2351
+ [data-separator-wrapper][data-separator-multi-button] {
2352
+ grid-template-rows: 50% 50%;
2353
+ display: grid;
2354
+
2355
+ & [data-separator-content] {
2356
+ grid-area: 1 / 2 / -1;
2357
+ min-width: min-content;
2358
+ }
2359
+
2360
+ & [data-expand-button] {
2361
+ grid-column: 1;
2362
+ }
2363
+ }
2364
+
2365
+ [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
2366
+ grid-template-columns: 34px auto;
2367
+ }
2368
+
2369
+ [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
2370
+ grid-template-columns: 100% auto;
2371
+ }
2372
+
2373
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
2374
+ & [data-separator-multi-button] {
2375
+ & [data-expand-up] {
2376
+ border-bottom: 1px solid var(--diffs-bg);
2377
+ border-right: 2px solid var(--diffs-bg);
2378
+ }
2379
+
2380
+ & [data-expand-down] {
2381
+ border-top: 1px solid var(--diffs-bg);
2382
+ border-right: 2px solid var(--diffs-bg);
2383
+ }
2384
+ }
2385
+ }
2386
+ }
2387
+
2388
+ [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
2389
+ display: none;
2390
+ }
2391
+
2392
+ [data-line-annotation] {
2393
+ min-height: var(--diffs-annotation-min-height, 0);
2394
+ z-index: 2;
2395
+ }
2396
+
2397
+ [data-merge-conflict-actions] {
2398
+ z-index: 2;
2399
+ }
2400
+
2401
+ [data-separator="custom"] {
2402
+ grid-template-columns: subgrid;
2403
+ display: grid;
2404
+ }
2405
+
2406
+ [data-line], [data-column-number], [data-no-newline] {
2407
+ padding-inline: 1ch;
2408
+ position: relative;
2409
+ }
2410
+
2411
+ [data-indicators="classic"] [data-line] {
2412
+ padding-inline-start: 2ch;
2413
+ }
2414
+
2415
+ [data-indicators="classic"] {
2416
+ & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
2417
+ &[data-no-newline], &[data-line] {
2418
+ &:before {
2419
+ user-select: none;
2420
+ width: 1ch;
2421
+ height: 1lh;
2422
+ display: inline-block;
2423
+ position: absolute;
2424
+ top: 0;
2425
+ left: 0;
2426
+ }
2427
+ }
2428
+ }
2429
+
2430
+ & [data-line-type="change-addition"] {
2431
+ &[data-line], &[data-no-newline] {
2432
+ &:before {
2433
+ content: "+";
2434
+ color: var(--diffs-addition-base);
2435
+ }
2436
+ }
2437
+ }
2438
+
2439
+ & [data-line-type="change-deletion"] {
2440
+ &[data-line], &[data-no-newline] {
2441
+ &:before {
2442
+ content: "-";
2443
+ color: var(--diffs-deletion-base);
2444
+ }
2445
+ }
2446
+ }
2447
+ }
2448
+
2449
+ [data-indicators="bars"] {
2450
+ & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
2451
+ &[data-column-number] {
2452
+ &:before {
2453
+ content: "";
2454
+ user-select: none;
2455
+ contain: strict;
2456
+ width: 4px;
2457
+ height: 100%;
2458
+ display: block;
2459
+ position: absolute;
2460
+ top: 0;
2461
+ left: 0;
2462
+ }
2463
+ }
2464
+ }
2465
+
2466
+ & [data-line-type="change-deletion"] {
2467
+ &[data-column-number] {
2468
+ &:before {
2469
+ background-image: linear-gradient(0deg,
2470
+ var(--diffs-bg-deletion) 50%,
2471
+ var(--diffs-deletion-base) 50%);
2472
+ background-repeat: repeat;
2473
+ background-size: 2px 2px;
2474
+ background-size: calc(1lh / round(1lh / 2px))
2475
+ calc(1lh / round(1lh / 2px));
2476
+ }
2477
+ }
2478
+ }
2479
+
2480
+ & [data-line-type="change-addition"] {
2481
+ &[data-column-number] {
2482
+ &:before {
2483
+ background-color: var(--diffs-addition-base);
2484
+ }
2485
+ }
2486
+ }
2487
+ }
2488
+
2489
+ [data-overflow="wrap"] {
2490
+ & [data-line], & [data-annotation-content] {
2491
+ white-space: pre-wrap;
2492
+ word-break: break-word;
2493
+ }
2494
+ }
2495
+
2496
+ [data-overflow="scroll"] [data-line] {
2497
+ white-space: pre;
2498
+ min-height: 1lh;
2499
+ }
2500
+
2501
+ [data-column-number] {
2502
+ box-sizing: content-box;
2503
+ text-align: right;
2504
+ user-select: none;
2505
+ color: var(--diffs-fg-number);
2506
+ padding-left: 2ch;
2507
+ }
2508
+
2509
+ [data-line-number-content] {
2510
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
2511
+ z-index: 1;
2512
+ display: inline-block;
2513
+ position: relative;
2514
+ }
2515
+
2516
+ [data-disable-line-numbers] {
2517
+ & [data-gutter-buffer], & [data-column-number] {
2518
+ min-width: 4px;
2519
+ padding: 0;
2520
+
2521
+ &:before {
2522
+ min-width: 0;
2523
+ }
2524
+ }
2525
+
2526
+ & [data-line-number-content] {
2527
+ display: none;
2528
+ }
2529
+
2530
+ & [data-gutter-utility-slot] {
2531
+ right: unset;
2532
+ justify-content: flex-start;
2533
+ left: 0;
2534
+ }
2535
+
2536
+ &[data-indicators="bars"] [data-gutter-utility-slot] {
2537
+ left: 6px;
2538
+ }
2539
+ }
2540
+
2541
+ [data-file][data-disable-line-numbers] {
2542
+ & [data-gutter-buffer], & [data-column-number] {
2543
+ border-right: 0;
2544
+ min-width: 0;
2545
+ }
2546
+ }
2547
+
2548
+ [data-diff-span] {
2549
+ box-decoration-break: clone;
2550
+ border-radius: 3px;
2551
+ }
2552
+
2553
+ [data-line-type="change-addition"] [data-diff-span] {
2554
+ background-color: var(--diffs-bg-addition-emphasis);
2555
+ }
2556
+
2557
+ [data-line-type="change-deletion"] [data-diff-span] {
2558
+ background-color: var(--diffs-bg-deletion-emphasis);
2559
+ }
2560
+
2561
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
2562
+ color: var(--diffs-fg);
2563
+ padding-left: 1ch;
2564
+ }
2565
+
2566
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
2567
+ align-items: center;
2568
+ display: flex;
2569
+
2570
+ &:after {
2571
+ color: var(--diffs-fg-conflict-marker);
2572
+ font-size: .75rem;
2573
+ font-style: normal;
2574
+ line-height: 1.25rem;
2575
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
2576
+ padding-left: 1ch;
2577
+ }
2578
+ }
2579
+
2580
+ [data-merge-conflict="marker-start"]:after {
2581
+ content: "(Current Change)";
2582
+ }
2583
+
2584
+ [data-merge-conflict="marker-end"]:after {
2585
+ content: "(Incoming Change)";
2586
+ }
2587
+
2588
+ [data-merge-conflict-actions-content] {
2589
+ min-height: 1.75rem;
2590
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
2591
+ color: var(--diffs-fg);
2592
+ align-items: center;
2593
+ gap: .25rem;
2594
+ padding-inline: .5rem;
2595
+ font-size: .75rem;
2596
+ line-height: 1.2;
2597
+ display: flex;
2598
+ }
2599
+
2600
+ [data-merge-conflict-action] {
2601
+ appearance: none;
2602
+ color: var(--diffs-fg-number);
2603
+ font: inherit;
2604
+ cursor: pointer;
2605
+ background: none;
2606
+ border: 0;
2607
+ padding: 0;
2608
+ font-style: normal;
2609
+ }
2610
+
2611
+ [data-merge-conflict-action]:hover {
2612
+ color: var(--diffs-fg);
2613
+ }
2614
+
2615
+ [data-merge-conflict-action="current"]:hover {
2616
+ color: var(--diffs-addition-base);
2617
+ }
2618
+
2619
+ [data-merge-conflict-action="incoming"]:hover {
2620
+ color: var(--diffs-modified-base);
2621
+ }
2622
+
2623
+ [data-merge-conflict-action-separator] {
2624
+ color: var(--diffs-fg-number);
2625
+ opacity: .6;
2626
+ user-select: none;
2627
+ }
2628
+
2629
+ [data-diffs-header="default"] {
2630
+ background-color: var(--diffs-bg);
2631
+ justify-content: space-between;
2632
+ align-items: center;
2633
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
2634
+ min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
2635
+ z-index: 2;
2636
+ flex-direction: row;
2637
+ padding-inline: 16px;
2638
+ display: flex;
2639
+ position: relative;
2640
+ top: 0;
2641
+ }
2642
+
2643
+ [data-header-content] {
2644
+ align-items: center;
2645
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
2646
+ white-space: nowrap;
2647
+ flex-direction: row;
2648
+ min-width: 0;
2649
+ display: flex;
2650
+ }
2651
+
2652
+ [data-header-content] [data-prev-name], [data-header-content] [data-title] {
2653
+ text-overflow: ellipsis;
2654
+ white-space: nowrap;
2655
+ direction: rtl;
2656
+ min-width: 0;
2657
+ overflow: hidden;
2658
+ }
2659
+
2660
+ [data-prev-name] {
2661
+ opacity: .7;
2662
+ }
2663
+
2664
+ [data-rename-icon] {
2665
+ fill: currentColor;
2666
+ flex-grow: 0;
2667
+ flex-shrink: 0;
2668
+ }
2669
+
2670
+ [data-diffs-header="default"] [data-metadata] {
2671
+ white-space: nowrap;
2672
+ align-items: center;
2673
+ gap: 1ch;
2674
+ display: flex;
2675
+ }
2676
+
2677
+ [data-diffs-header="default"] [data-additions-count] {
2678
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
2679
+ color: var(--diffs-addition-base);
2680
+ }
2681
+
2682
+ [data-diffs-header="default"] [data-deletions-count] {
2683
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
2684
+ color: var(--diffs-deletion-base);
2685
+ }
2686
+
2687
+ [data-change-icon] {
2688
+ fill: currentColor;
2689
+ flex-shrink: 0;
2690
+ }
2691
+
2692
+ [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
2693
+ color: var(--diffs-modified-base);
2694
+ }
2695
+
2696
+ [data-change-icon="new"] {
2697
+ color: var(--diffs-addition-base);
2698
+ }
2699
+
2700
+ [data-change-icon="deleted"] {
2701
+ color: var(--diffs-deletion-base);
2702
+ }
2703
+
2704
+ [data-change-icon="file"] {
2705
+ opacity: .6;
2706
+ }
2707
+
2708
+ [data-annotation-content] {
2709
+ z-index: 2;
2710
+ isolation: isolate;
2711
+ align-self: flex-start;
2712
+ min-width: 0;
2713
+ display: flow-root;
2714
+ position: relative;
2715
+ }
2716
+
2717
+ [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
2718
+ width: var(--diffs-column-content-width, auto);
2719
+ left: var(--diffs-column-number-width, 0);
2720
+ position: sticky;
2721
+ }
2722
+
2723
+ [data-annotation-slot] {
2724
+ text-wrap-mode: wrap;
2725
+ word-break: normal;
2726
+ white-space-collapse: collapse;
2727
+ }
2728
+
2729
+ [data-gutter-utility-slot] {
2730
+ touch-action: none;
2731
+ justify-content: flex-end;
2732
+ display: flex;
2733
+ position: absolute;
2734
+ top: 0;
2735
+ bottom: 0;
2736
+ right: 0;
2737
+ }
2738
+
2739
+ [data-utility-button] {
2740
+ appearance: none;
2741
+ cursor: pointer;
2742
+ width: 1lh;
2743
+ height: 1lh;
2744
+ font-size: var(--diffs-font-size, 13px);
2745
+ line-height: var(--diffs-line-height, 20px);
2746
+ background-color: var(--diffs-modified-base);
2747
+ color: var(--diffs-bg);
2748
+ fill: currentColor;
2749
+ z-index: 4;
2750
+ touch-action: none;
2751
+ border: none;
2752
+ border-radius: 4px;
2753
+ justify-content: center;
2754
+ align-items: center;
2755
+ margin-right: calc(-1lh + 1ch);
2756
+ padding: 0;
2757
+ display: flex;
2758
+ position: relative;
2759
+
2760
+ &:before {
2761
+ content: "";
2762
+ display: block;
2763
+ position: absolute;
2764
+ inset: 0 0 0 -4px;
2765
+ }
2766
+ }
2767
+
2768
+ [data-decoration-bar-stack] {
2769
+ pointer-events: none;
2770
+ isolation: isolate;
2771
+ z-index: 1;
2772
+ background-color: var(--diffs-decoration-bar-color, transparent);
2773
+ box-sizing: content-box;
2774
+ border-left: 2px solid var(--diffs-bg);
2775
+ border-right: 2px solid var(--diffs-bg);
2776
+ width: 6px;
2777
+ position: absolute;
2778
+ top: 0;
2779
+ bottom: 0;
2780
+ right: -2px;
2781
+
2782
+ [data-decoration-bar-depth="1"] & {
2783
+ background-color: color-mix(in lab,
2784
+ var(--diffs-bg) 20%,
2785
+ var(--diffs-decoration-bar-color, transparent));
2786
+ }
2787
+
2788
+ [data-decoration-bar-depth="2"] & {
2789
+ background-color: color-mix(in lab,
2790
+ var(--diffs-bg) 45%,
2791
+ var(--diffs-decoration-bar-color, transparent));
2792
+ }
2793
+
2794
+ [data-decoration-bar-depth="3"] & {
2795
+ background-color: color-mix(in lab,
2796
+ var(--diffs-bg) 65%,
2797
+ var(--diffs-decoration-bar-color, transparent));
2798
+ }
2799
+
2800
+ [data-decoration-bar-start] & {
2801
+ border-top-left-radius: 5px;
2802
+ border-top-right-radius: 5px;
2803
+ }
2804
+
2805
+ [data-decoration-bar-end] & {
2806
+ z-index: 3;
2807
+ border-bottom-right-radius: 5px;
2808
+ border-bottom-left-radius: 5px;
2809
+ }
2810
+ }
2811
+
2812
+ [data-placeholder] {
2813
+ contain: strict;
2814
+ }
2815
+
2816
+ [data-error-wrapper] {
2817
+ padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
2818
+ var(--diffs-gap-inline, var(--diffs-gap-fallback));
2819
+ scrollbar-width: none;
2820
+ max-height: 400px;
2821
+ overflow: auto;
2822
+
2823
+ & [data-error-message] {
2824
+ color: var(--diffs-deletion-base);
2825
+ font-size: 18px;
2826
+ font-weight: bold;
2827
+ }
2828
+
2829
+ & [data-error-stack] {
2830
+ color: var(--diffs-fg-number);
2831
+ }
2832
+ }
2833
+ }
2834
+
2835
+ @layer theme, rendered, unsafe;
2836
+ `,VC=`@layer base, theme, rendered, unsafe;`,HC=RegExp(`${KC(pu)}\\s*:\\s*[^;]+;`);function UC(e){return`${VC}
2837
+ @layer unsafe {
2838
+ ${e}
2839
+ }`}function WC(e,t=`system`,n){return`${VC}
2840
+ @layer rendered {
2841
+ :host {${t===`system`?``:`
2842
+ color-scheme: ${t};`}
2843
+ ${zC(n)}
2844
+ ${e}
2845
+ }
2846
+ }`}function GC(e,t){let n=zC(t);return e.replace(HC,n)}function KC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function qC({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function JC({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=YC(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function YC(){let e=document.createElement(`style`);return e.setAttribute(uu,``),e}function XC(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function ZC(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`);break}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(BC)),t.adoptedStyleSheets=[e]}connectedCallback(){RC(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(Ql,t)}function QC({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o}){let s=fx(t,n),c=s,l=i?!0:a,u=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=gx({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:l,hunkIndex:n,collapsedContextThreshold:o}),d=(a.fromStart+a.fromEnd)*t.lineHeight;if(s+=d,c+=d,a.collapsedLines>0){let e=Cx({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;s+=e,c+=e}s+=i.splitLineCount*t.lineHeight,c+=i.unifiedLineCount*t.lineHeight;let f=$C(i);s+=f.split*t.lineHeight,c+=f.unified*t.lineHeight;let p=n===u?vx({fileDiff:e,hunkIndex:n,expandedHunks:l,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(p!=null){let e=(p.fromStart+p.fromEnd)*t.lineHeight;if(s+=e,c+=e,p.collapsedLines>0){let e=wx({type:r,metrics:t})?.totalHeight??0;s+=e,c+=e}}}if(e.hunks.length>0){let e=mx(t);s+=e,c+=e}return{splitHeight:s,unifiedHeight:c}}function $C(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return ew(e,t)}function ew(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var tw=new TextEncoder,nw=new TextDecoder(`utf-8`,{ignoreBOM:!0}),rw=/[\uD800-\uDFFF]/,iw=1024,aw=new Uint8Array(iw);function ow(){aw.length!==iw&&(aw=new Uint8Array(iw))}function sw(e){if(e.length===0)return e;if(rw.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;aw.length<t&&(aw=new Uint8Array(t));let{written:n}=tw.encodeInto(e,aw);return nw.decode(aw.subarray(0,n))}function cw(e,t,n){try{return lw(e,t,n)}finally{ow()}}function lw(e,t,n=!1){let r=Dw(e),i=r?gw(e):_w(e),a,o=[];for(let e of i){if(r&&!eu.test(e)){if(a==null)a=sw(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!vw(e)){if(a==null)a=sw(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=dw(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function uw(e,t){try{return dw(e,t)}finally{ow()}}function dw(e,{cacheKey:t,isGitDiff:n=eu.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Ow(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=hw(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=ww(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?mw(i.contents):[],deletionLines:!l&&r!=null&&i!=null?mw(r.contents):[],cacheKey:Aw(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(iu),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=sw(r.trim()),n!==r&&(c.prevName=sw(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?ru:nu):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=sw(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=sw(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=sw(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=sw(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=sw(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=sw(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(au)??[];t!=null&&(c.prevObjectId=sw(t)),n!=null&&(c.newObjectId=sw(n)),r!=null&&(c.mode=sw(r))}e.startsWith(`rename from `)&&(c.prevName=sw(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=sw(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
2847
+ `||s[s.length-1]===`\r`||s[s.length-1]===`\r
2848
+ `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:Aw(p.hunkContext),hunkSpecs:sw(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&Sw(t)&&!Cw(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=jw(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Mw(t);(g==null||g.type!==`change`)&&(g=Nw(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Mw(t);(g==null||g.type!==`change`)&&(g=Nw(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Mw(t);(g==null||g.type!==`context`)&&(g=Nw(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=Fb(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=Fb(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function fw(e,t,n=!1){let r=[],i=pw(e)?e.split($l):[e];for(let e of i)try{r.push(cw(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function pw(e){return e.startsWith(`From `)||e.includes(`
2849
+ From `)}function mw(e){let t=hw(e);for(let e=0;e<t.length;e++)t[e]=sw(t[e]);return t}function hw(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
2850
+ `,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function gw(e){return Ow(e,`diff --git`)}function _w(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=xw(e,r);if(i<=0&&a<=0){if(yw(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=xw(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=ww(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function vw(e){return yw(e,0)}function yw(e,t){let n=xw(e,t);return bw(e,t,`---`)&&bw(e,n,`+++`)}function bw(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
2851
+ `||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function xw(e,t){let n=e.indexOf(`
2852
+ `,t);return n===-1?e.length:n+1}function Sw(e){let t=e[0];return t===`+`||t===`-`||t===` `}function Cw(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
2853
+ `&&n!==`\r`)return!1}return!0}function ww(e){if(!e.startsWith(`@@ -`))return;let t=4,n=Tw(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=Tw(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=Tw(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=Tw(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Ew(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function Tw(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Ew(e){return e.endsWith(`\r
2854
+ `)?e.slice(0,-2):e.endsWith(`
2855
+ `)?e.slice(0,-1):e}function Dw(e){return e.startsWith(`diff --git`)||e.includes(`
2856
+ diff --git`)}function Ow(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:kw(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=kw(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function kw(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function Aw(e){return e==null?e:sw(e)}function jw(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function Mw(e){let t=e.slice(1);return sw(t===``?`
2857
+ `:t)}function Nw(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function Pw(e,t,n,r=!1){let i=uw(cS(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var Fw=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Iw(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Lw(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[Ib(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function Rw(e){return $({tagName:`div`,children:[Lb({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function zw({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push($({tagName:`div`,children:[Ib(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(Rw(`up`)),s++),o||(e.push(Rw(`down`)),s++)):(e.push(Rw(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[Ib(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[Ib(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push($({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push($({tagName:`slot`,properties:{name:i}})),$({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function Bw(e,t){return`hunk-separator-${e}-${t}`}function Vw(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function Hw(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var Uw=-1,Ww=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Uw}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:lu},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=yC(e.theme??lu)?xb():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??gu}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t===`change`?{gutterLineType:e===`deletions`?`change-deletion`:`change-addition`}:{gutterLineType:t}}createAnnotationElement=e=>bC(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=lu,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=mu,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await bb(OC(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=$w(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!lx(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!ux(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??Ab(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:kC(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!cx(e,n.diff)||!lx(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=_u){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||ux(e)||$w(e,this.getTokenizeMaxLength()),l=!cx(e,this.renderCache.diff),u=!_C(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Hw(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??Ab(e.name);let t=this.highlighter!=null&&yC(i.theme),n=this.highlighter!=null&&vC(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=_u){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return EC({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=$w(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Ab(e.name);let n=this.highlighter!=null&&yC(this.options.theme??lu),r=t||this.highlighter!=null&&vC(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:pS(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!this.renderCache.highlighted||!lx(this.renderCache.options,n)||!cx(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!lx(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&cx(e,n.diff)&&lx(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let d=a===`unified`,f=[],p=[],m=[],h=[],{additionLines:g,deletionLines:_}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:p,unifiedContentAST:m,unifiedGutterAST:zb(),deletionsGutterAST:zb(),additionsGutterAST:zb(),expansionLineCount:c,hunkData:h,incrementRowCount(e=1){v.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:v.unifiedGutterAST.children.push(t);break;case`deletions`:v.deletionsGutterAST.children.push(t);break;case`additions`:v.additionsGutterAST.children.push(t);break}}},y=_x({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),b={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(v.pushToGutter(`additions`,Vb(void 0,`buffer`,this.size)),f?.push(Iw(this.size))):(v.pushToGutter(`deletions`,Vb(void 0,`buffer`,this.size)),p?.push(Iw(this.size))),this.size=0,this.side=void 0}}},x=(e,t,n,r,i)=>{v.pushToGutter(e,Bb(t,n,r,i))};function S(e){b.flush(),a===`unified`?Zw(`unified`,e,v):(Zw(`deletions`,e,v),Zw(`additions`,e,v))}this.pushFileLevelAnnotations(e,a,t,v),Tx({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&b.flush(),r>0&&S({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=a===`unified`?d:l,p={type:c,hunkIndex:t,lineIndex:f,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(p);n?.before!=null&&Jw(n.before,v);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});x(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=Qw(r,u.contentProperties)):i=Qw(i,u.contentProperties),Xw({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,f),createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&Jw(n.after,v)}else{let n=this.getSplitInjectedRowsForLine?.(p);n?.before!=null&&Yw(n.before,v,b);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(d!=null){if(b.side!=null&&b.side!==d)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);b.side=d,b.increment()}let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,f);if(m!=null&&b.size>0&&b.flush(),s!=null){let e=Qw(r,a.contentProperties);x(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Qw(i,u.contentProperties);x(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Xw({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&Yw(n.after,v,b)}let m=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,h=m?n.noEOFCRDeletions:!1,C=m?n.noEOFCRAdditions:!1,ee=(s?.noEOFCR??!1)||h,w=(o?.noEOFCR??!1)||C;if(w||ee){if(a===`split`&&b.flush(),ee){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(v.unifiedContentAST.push(Lw(e)),v.pushToGutter(`unified`,Vb(e,`metadata`,1))):(v.deletionsContentAST.push(Lw(e)),v.pushToGutter(`deletions`,Vb(e,`metadata`,1)),w||(v.pushToGutter(`additions`,Vb(void 0,`buffer`,1)),v.additionsContentAST.push(Iw(1))))}if(w){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(v.unifiedContentAST.push(Lw(e)),v.pushToGutter(`unified`,Vb(e,`metadata`,1))):(v.additionsContentAST.push(Lw(e)),v.pushToGutter(`additions`,Vb(e,`metadata`,1)),ee||(v.pushToGutter(`deletions`,Vb(void 0,`buffer`,1)),v.deletionsContentAST.push(Iw(1))))}v.incrementRowCount(1)}i>0&&u!==`simple`&&S({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:y,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),a===`split`&&b.flush();let C=Math.max(Vw(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ee=t.bufferBefore>0||t.bufferAfter>0,w=!d&&e.type!==`deleted`,T=!d&&e.type!==`new`,E=v.rowCount>0||ee;f=w&&E?f:void 0,p=T&&E?p:void 0,m=d&&E?m:void 0;let D=this.createPreElement(p!=null&&f!=null,C);return{unifiedGutterAST:d&&E?v.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:T&&E?v.deletionsGutterAST.children:void 0,deletionsContentAST:p,additionsGutterAST:w&&E?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:h,preNode:D,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:C,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=zb(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,xC(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push($({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push($({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push($({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return _h(this.renderFullAST(e,t))}renderPartialHTML(e,t){return _h(t==null?e:$({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!WS(n))return;let i=e.type===`new`?[]:Gw(US(this.deletionAnnotations)),a=e.type===`deleted`?[]:Gw(US(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Xw({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Xw({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(yu(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(yu(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return CC({fileOrDiff:e,mode:t,stickyHeader:n})}};function Gw(e){return e?.map(e=>yu(e))??[]}var Kw=new Intl.PluralRules(`en-US`);function qw(e){return`${e} unmodified line${Kw.select(e)===`one`?``:`s`}`}function Jw(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Yw(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Xw({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,Vb(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,Vb(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,Vb(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Zw(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,zw({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(zw({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,zw({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(zw({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=Bw(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,zw({type:c.hunkSeparators,content:qw(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(zw({type:c.hunkSeparators,content:qw(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Qw(e,t){return e==null||e.type!==`element`||t==null?e:{...e,properties:{...e.properties,...t}}}function $w(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function eT(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function tT(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function nT(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}var rT=-1,iT=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++rT}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:lu},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new fC,this.scrollSyncManager=new Fw,this.interactionManager=new qS(`diff`,JS(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return nT(e)}createHunksRenderer(e){return new Ww(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(JS(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Eu(this.appliedThemeCSS.theme,this.options.theme??lu)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),sT(this.pre,aT({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||cT(this.headerElement,oT({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),XC(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?Pw(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:a=!1,lineAnnotations:o,fileContainer:s,containerWrapper:c,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:u=!1,themeType:d=`system`}=this.options,f=u?void 0:l,p=this.hasThemeChanged(),m=e!=null&&t!=null&&(!Eb(e,this.deletionFile)||!Eb(t,this.additionFile)),h=n!=null&&n!==this.fileDiff,g=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations;if(!u&&_C(f,this.renderRange)&&!i&&!g&&!p&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);let{renderRange:_}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&m&&(h=!0,this.fileDiff=Pw(e,t,this.options.parseDiffOptions)):this.fileDiff=n,h&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:v=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,c),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,vu);e!=null&&this.applyThemeState(s,e.themeStyles,d,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(i,g,m||h||p)&&this.applyPartialRender({previousRenderRange:_,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,t.themeStyles,d,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,s),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{fileDiff:e,workerManager:t}=this;if(e==null||t==null||ux(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!tT(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${yu(r)}`,a=this.annotationCache.get(i);if(a==null||!eT(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:PC(yu(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=FC();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:BS(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):BS(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=AC;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??_h(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderMetadata:o}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,cu,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(n)??void 0,c=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,ou,s),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,su,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=IC(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=UC(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??lu,s=typeof o==`string`?o:{...o},c=RC(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=JC({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:WC(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=GC(this.themeCSSStyle.textContent??``,RC(e)))}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=qC({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=qC({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=qC({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=lT(t[0]),i=lT(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};jC(u,this.appliedPreAttributes)||(ZC(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function aT({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function oT({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function sT(e,t,n=!1){return!n&&e==null&&t}function cT(e,t,n=!1){return e==null&&t&&!n}function lT(e){if(!(e==null||e.type!==`element`))return e.children??[]}var uT=5e3,dT=-1,fT=class extends iT{__id=`little-virtualized-file-diff:${++dT}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=dx(n)}setMetrics(e,t=!1){let n=dx(e);!t&&IS(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!HS(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!LS(t,e),r=n&&bT(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:xT(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&i&&WS(this.renderRange)){let t=pT(r)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!i&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of r){if(t==null)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let i=CT(r,n),a=t.getBoundingClientRect().height,o=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(o=!0),a+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(o),c=this.cache.heightDeltas.get(i)??0,l=a-s;l!==c&&(e=!0,this.cache.measuredHeightDeltaTotal+=l-c,l===0?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,l))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,r){let i=!cx(this.fileDiff,e),a=this.syncLineAnnotations(r),o=n?.resetDiffLayoutCache===!0||i||a,s=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=dx(n.metrics),o=!0,s=!0);let{collapsed:c=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!0),o&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null||e<1)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=fx(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return Tx({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=s===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=Cx({type:c,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(f+=r.gapBefore,l>=o-n&&l<o)return p={top:f,height:r.height},!0;f+=r.height+r.gapAfter}}let u=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===l)return p={top:f,height:u},!0;if(f+=u,r>0){let e=wx({type:c,metrics:this.metrics});if(e!=null){if(l>o&&l<=o+r)return p={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),p}getNumericScrollAnchor(e){if(this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1}=this.options;if(r)return;let a=this.getDiffStyle(),o=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(e),c=s?.top??fx(this.metrics,t)+this.cache.fileAnnotationHeight,l;return Tx({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:s,additionLine:u})=>{let d=a===`split`?u?.splitLineIndex??s?.splitLineIndex:u?.unifiedLineIndex??s?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=Cx({type:o,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(c+=e.totalHeight)}if(c>=e&&(s==null?u!=null&&(l={lineNumber:u.lineNumber,side:`additions`,top:c}):l={lineNumber:s.lineNumber,side:`deletions`,top:c},l!=null))return!0;let f=this.getLineHeight(d,(u?.noEOFCR??!1)||(s?.noEOFCR??!1));if(c+=f,i>0){let e=wx({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1}=this.options,a=fx(this.metrics,r);if(this.height+=a,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();let e=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:i}=QC({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:a,...o}={}){let{forceRenderOverride:s,isSetup:c}=this;this.forceRenderOverride=void 0;let l=this.syncLineAnnotations(a);if(l&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=r??(t!=null&&n!=null?Pw(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(c)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let u=this.virtualizer.getWindowSpecs(),d=this.top??0,f=this.computeRenderRangeFromWindow(this.fileDiff,d,u);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:f,oldFile:t,newFile:n,lineAnnotations:a,forceRender:(s??i)||l,...o})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return ST(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),a=this.getHunkSeparatorType(),o=t?!0:this.hunksRenderer.getExpandedHunksMap(),s=mT(this.cache.heightDeltas),c=fx(this.metrics,e)+this.cache.fileAnnotationHeight,l=0,u=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=l,o=l+e,u=_T(a);for(;u<o;){let e=u-a,r=c+(e>0?n:0)+e*this.metrics.lineHeight+vT(i,e)*this.metrics.lineHeight+hT(s,t,t+e);this.cache.checkpoints.push({renderedLineIndex:u,lineIndex:t+e,top:r}),u+=uT}c+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+hT(s,t,t+e)+r,l=o};for(let e=0;e<this.fileDiff.hunks.length;e++){let t=this.fileDiff.hunks[e];if(t==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let s=gx({isPartial:this.fileDiff.isPartial,rangeSize:t.collapsedBefore,expandedHunks:o,hunkIndex:e,collapsedContextThreshold:n}),c=s.collapsedLines>0?Cx({type:a,metrics:this.metrics,hunkIndex:e,hunkSpecs:t.hunkSpecs})?.totalHeight??0:0;u({rowCount:s.fromStart,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.rangeSize});let l=c;u({rowCount:s.fromEnd,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.fromEnd,preSeparatorHeight:l}),s.fromEnd>0&&(l=0);let d=e===r?vx({fileDiff:this.fileDiff,hunkIndex:e,expandedHunks:o,collapsedContextThreshold:n,errorPrefix:`VirtualizedFileDiff`}):void 0,f=d!=null&&d.collapsedLines>0?wx({type:a,metrics:this.metrics})?.totalHeight??0:0,p=d==null?0:d.fromStart+d.fromEnd,m=i===`split`?t.splitLineCount:t.unifiedLineCount,h=i===`split`?t.splitLineStart:t.unifiedLineStart;u({rowCount:m,startLineIndex:h,preSeparatorHeight:l,postSeparatorHeight:p===0?f:0,metadataOffsets:yT({diffStyle:i,hunk:t,rowCount:m})}),d!=null&&p>0&&u({rowCount:p,startLineIndex:h+m,postSeparatorHeight:f})}this.cache.totalLines=l}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=gx({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=vx({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=this.height,f=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,l),p=fx(this.metrics,i),m=e.hunks.length>0?mx(this.metrics):0,{fileAnnotationHeight:h}=this.cache,g=p+h,_=Math.max(0,d-p-h-m),v=this.hasFileAnnotations(e),y=t+p,b=h>0&&v&&y<r&&y+h>n;if(t<n-d||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};if(f<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),f=this.cache.totalLines>0?this.cache.totalLines:f;let x=Math.ceil(Math.max(r-n,0)/c),S=Math.ceil(x/s)*s+s,C=S/s,ee=C,w=[],T=(n+r)/2,E=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-S*c*2),s),D=t+(E?.top??g),te=E?.renderedLineIndex??0,O,k,A;if(Tx({diff:e,diffStyle:l,startingLine:E?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:i,collapsedBefore:a,collapsedAfter:o,deletionLine:c,additionLine:d})=>{let f=d==null?c.splitLineIndex:d.splitLineIndex,p=d==null?c.unifiedLineIndex:d.unifiedLineIndex,m=(d?.noEOFCR??!1)||(c?.noEOFCR??!1),h=(a>0?Cx({type:u,metrics:this.metrics,hunkIndex:e,hunkSpecs:i?.hunkSpecs}):void 0)?.totalHeight??0;D+=h;let _=te%s===0,v=Math.floor(te/s);if(_&&(w[v]=D-(t+g+h),A!=null)){if(A<=0)return!0;A--}let y=this.getLineHeight(l===`split`?f:p,m);return D>n-y&&D<r&&(O??=v),k==null&&D+y>T&&(k=v),A==null&&D>=r&&_&&(A=ee),te++,D+=y,o>0&&(D+=wx({type:u,metrics:this.metrics})?.totalHeight??0),!1}}),O==null)if(b)O=0,k=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};k??=O;let ne=Math.round(k-C/2),j=Math.max(0,Math.ceil(f/s)-C),re=Math.max(0,Math.min(ne,j)),ie=re*s,ae=ne<0?S+ne*s:S,oe=w[re]??0,se=ie===0?0:h+oe,ce=re+ae/s,le=ce<w.length?_-w[ce]:_-(D-t-g);return{startingLine:ie,totalLines:ae,bufferBefore:se,bufferAfter:Math.max(0,le)}}};function pT(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===VS&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function mT(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function hT({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=gT(e,n);return(t[gT(e,r)]??0)-(t[i]??0)}function gT(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function _T(e){return Math.ceil(e/uT)*uT}function vT(e,t){let n=0;for(let r of e)r<t&&n++;return n}function yT({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function bT(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function xT(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function ST(e){return typeof e==`function`?`custom`:e??`line-info`}function CT(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function wT(e,t){return typeof window>`u`&&t!=null?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,_.jsx)(_.Fragment,{children:e})}var TT=(0,g.createContext)(void 0);function ET(){return(0,g.useContext)(TT)}var DT=typeof window>`u`?g.useEffect:g.useLayoutEffect;function OT({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c}){let l=ET(),u=r!==void 0,d=(0,g.useContext)(NS),f=(0,g.useRef)(null),p=Tu(r=>{if(r!=null){if(f.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);l==null?f.current=new iT(kT({controlledSelection:u,hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c?void 0:d,!0):f.current=new fT(kT({controlledSelection:u,hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),l,a,c?void 0:d,!0),f.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(f.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);f.current.cleanUp(),f.current=null}});return DT(()=>{let{current:i}=f;if(i==null)return;let a=kT({controlledSelection:u,hasCustomHeader:s,hasGutterRenderUtility:o,options:t}),c=!LS(i.options,a);i.setOptions(a),i.render({forceRender:c,fileDiff:e,lineAnnotations:n}),r!==void 0&&i.setSelectedLines(r)}),{ref:p,getHoveredLine:(0,g.useCallback)(()=>f.current?.getHoveredLine(),[])}}function kT({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return!t&&!r&&!n?e:{...e,controlledSelection:t,renderCustomHeader:n?Zl:e?.renderCustomHeader,renderGutterUtility:r?Zl:e?.renderGutterUtility}}function AT(e){let t=fw(e);if(t.length!==1)throw console.error(t),Error(`PatchDiff: Provided patch must include only 1 patch, with 1 diff`);let{files:n}=t[0];if(n.length!==1)throw console.error(n),Error(`FileDiff: Provided patch must contain exactly 1 file diff`);return n[0]}function jT({patch:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderGutterUtility:f,disableWorkerPool:p=!1}){let m=MT(e),{ref:h,getHoveredLine:g}=OT({fileDiff:m,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:f!=null,hasCustomHeader:l!=null,disableWorkerPool:p});return(0,_.jsx)(Ql,{ref:h,className:a,style:o,children:wT(Cu({fileDiff:m,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderMetadata:d,renderAnnotation:c,lineAnnotations:r,renderGutterUtility:f,getHoveredLine:g}),s)})}function MT(e){return(0,g.useMemo)(()=>AT(e),[e])}var NT={theme:{dark:`pierre-dark`,light:`pierre-light`},diffStyle:`unified`,diffIndicators:`bars`,hunkSeparators:`line-info-basic`,lineDiffType:`word`,overflow:`wrap`,stickyHeader:!0,tokenizeMaxLineLength:1800,tokenizeMaxLength:22e4,useTokenTransformer:!0};function PT(e){return{...NT,themeType:e}}var FT=`
2858
+ :host {
2859
+ --diffs-font-family: var(--font-mono);
2860
+ --diffs-font-size: calc(10.5px * var(--deck-text-scale));
2861
+ --diffs-line-height: 1.55;
2862
+ color: var(--ink);
2863
+ }
2864
+ [data-neondeck-review-annotation] {
2865
+ border: 1px solid var(--line);
2866
+ background: color-mix(in srgb, var(--primary) 10%, var(--field));
2867
+ color: var(--ink);
2868
+ padding: 6px 8px;
2869
+ font-family: var(--font-sans);
2870
+ font-size: calc(10.5px * var(--deck-text-scale));
2871
+ line-height: 1.4;
2872
+ }
2873
+ [data-neondeck-review-annotation-title] {
2874
+ display: flex;
2875
+ justify-content: space-between;
2876
+ gap: 8px;
2877
+ color: var(--primary);
2878
+ font-family: var(--font-mono);
2879
+ font-size: calc(9.5px * var(--deck-text-scale));
2880
+ text-transform: uppercase;
2881
+ }
2882
+ [data-neondeck-review-annotation] p {
2883
+ margin: 4px 0 0;
2884
+ }
2885
+ [data-neondeck-review-annotation] a {
2886
+ color: var(--primary);
2887
+ display: inline-flex;
2888
+ font-family: var(--font-mono);
2889
+ font-size: calc(9.5px * var(--deck-text-scale));
2890
+ margin-top: 4px;
2891
+ text-decoration: none;
2892
+ }
2893
+ [data-neondeck-review-annotation].pr-review-draft-stale {
2894
+ border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
2895
+ background: color-mix(in srgb, var(--accent) 10%, var(--field));
2896
+ }
2897
+ .pr-review-composer {
2898
+ display: grid;
2899
+ gap: 6px;
2900
+ }
2901
+ .pr-review-composer textarea {
2902
+ width: 100%;
2903
+ min-height: 54px;
2904
+ resize: vertical;
2905
+ border: 1px solid var(--line);
2906
+ background: var(--field);
2907
+ padding: 6px;
2908
+ color: var(--ink);
2909
+ font-family: var(--font-sans);
2910
+ font-size: calc(10.5px * var(--deck-text-scale));
2911
+ line-height: 1.4;
2912
+ outline: none;
2913
+ }
2914
+ .pr-review-composer textarea::placeholder {
2915
+ color: var(--deck-faint);
2916
+ opacity: 1;
2917
+ }
2918
+ .pr-review-composer textarea:focus {
2919
+ border-color: var(--primary);
2920
+ box-shadow: 0 0 0 1px var(--primary);
2921
+ }
2922
+ .pr-review-composer-actions,
2923
+ .pr-review-inline-actions {
2924
+ display: flex;
2925
+ min-width: 0;
2926
+ align-items: center;
2927
+ gap: 6px;
2928
+ flex-wrap: wrap;
2929
+ }
2930
+ .pr-review-composer-actions button,
2931
+ .pr-review-inline-actions button,
2932
+ .pr-review-inline-actions a {
2933
+ display: inline-flex;
2934
+ min-height: calc(24px * var(--deck-density-space));
2935
+ align-items: center;
2936
+ justify-content: center;
2937
+ border: 1px solid var(--line);
2938
+ background: var(--field);
2939
+ padding: 4px 6px;
2940
+ color: var(--ink);
2941
+ font-family: var(--font-mono);
2942
+ font-size: calc(9.5px * var(--deck-text-scale));
2943
+ line-height: 1;
2944
+ text-decoration: none;
2945
+ transition:
2946
+ background-color 160ms ease,
2947
+ border-color 160ms ease,
2948
+ color 160ms ease;
2949
+ white-space: nowrap;
2950
+ }
2951
+ .pr-review-composer-actions button:not(:disabled):hover,
2952
+ .pr-review-inline-actions button:not(:disabled):hover,
2953
+ .pr-review-inline-actions a:hover {
2954
+ border-color: var(--primary);
2955
+ background: color-mix(in srgb, var(--primary) 8%, var(--field));
2956
+ color: var(--primary-strong);
2957
+ }
2958
+ .pr-review-composer-actions button:focus-visible,
2959
+ .pr-review-inline-actions button:focus-visible,
2960
+ .pr-review-inline-actions a:focus-visible {
2961
+ border-color: var(--primary);
2962
+ box-shadow: 0 0 0 1px var(--primary);
2963
+ outline: none;
2964
+ }
2965
+ .pr-review-composer-actions button:disabled,
2966
+ .pr-review-inline-actions button:disabled {
2967
+ cursor: not-allowed;
2968
+ opacity: 0.45;
2969
+ }
2970
+ `;function IT(e){return new Worker(`/assets/worker-05jVtNwz.js`,{name:e?.name})}var LT={workerFactory:()=>new IT,poolSize:zT(),totalASTLRUCacheSize:24},RT={langs:[`bash`,`css`,`diff`,`html`,`javascript`,`json`,`markdown`,`shellscript`,`sql`,`tsx`,`typescript`,`yaml`],theme:{dark:`pierre-dark`,light:`pierre-light`},useTokenTransformer:!0,tokenizeMaxLineLength:1800,lineDiffType:`word`,maxLineDiffLength:1e3};function zT(){return typeof navigator>`u`?2:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))}function BT({children:e}){return(0,_.jsx)(FS,{highlighterOptions:RT,poolOptions:LT,children:e})}function VT({patch:e,title:t=`Diff`,detail:n,tone:i=`primary`,meta:a,className:o,lineAnnotations:c,renderAnnotation:l,selectedLines:u,onSelectedLinesChange:d}){let f=UT();if(!x(e))return(0,_.jsx)(h,{label:`No patch content available.`});let p=S(e).length;return(0,_.jsxs)(`section`,{className:r(`diff-viewer-shell`,o),children:[(0,_.jsxs)(`header`,{className:`diff-viewer-header`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`p`,{className:r(`diff-viewer-title`,HT(i)),children:t}),n?(0,_.jsx)(`p`,{className:`diff-viewer-detail`,children:n}):null]}),(0,_.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1.5`,children:[a,(0,_.jsx)(s,{children:ee(p||1)})]})]}),(0,_.jsx)(jT,{className:`diff-patch`,lineAnnotations:c,options:{...PT(f),controlledSelection:u!==void 0,enableLineSelection:!!d,onLineSelectionEnd:d,unsafeCSS:FT},patch:e??``,renderAnnotation:l,selectedLines:u})]})}function HT(e){return e===`accent`?`text-accent`:e===`violet`?`text-violet`:`text-primary`}function UT(){let[e,t]=(0,g.useState)(()=>WT());return(0,g.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>{t(WT())});return n.observe(e,{attributeFilter:[`data-theme`],attributes:!0}),t(WT()),()=>n.disconnect()},[]),e}function WT(){return typeof document>`u`?`dark`:document.documentElement.dataset.theme===`light`?`light`:`dark`}function GT({activePath:e,className:t,detail:n,emptyLabel:i=`No changed files.`,files:a,isLoadingPatch:o=!1,onActivePathChange:c,patchError:l,annotationsByPath:u,renderAnnotation:d,selectedLines:f,onSelectedLinesChange:p,footer:m,inspector:v,inspectorLabel:y=`Diff inspector`,title:b,tone:S=`primary`}){let C=(0,g.useId)(),[D,te]=(0,g.useState)(()=>T(a)??null),O=e??D,k=a.find(e=>e.path===O)??a[0]??null,A=k?.patch??null;if((0,g.useEffect)(()=>{if(O&&a.some(e=>e.path===O))return;let e=T(a)??null;te(e),e&&c&&c(e)},[a,c,O]),a.length===0)return(0,_.jsx)(h,{label:i});let ne=e=>{te(e),c?.(e)},j=k?E(k):null;return(0,_.jsxs)(`section`,{className:r(`diff-multi-file`,v?`diff-multi-file-with-inspector`:void 0,t),children:[(0,_.jsx)(`aside`,{className:`diff-tree-pane`,children:(0,_.jsx)(Ul,{files:a,onSelectPath:ne,selectedPath:k?.path??null})}),(0,_.jsxs)(`div`,{className:`diff-file-column`,children:[(0,_.jsxs)(`div`,{className:`diff-file-selector`,children:[(0,_.jsx)(`label`,{className:`sr-only`,htmlFor:C,children:`Changed file`}),(0,_.jsx)(`select`,{className:`w-full border border-line bg-field px-2 py-1 font-mono text-[10px] text-ink outline-none transition-colors focus:border-primary focus:ring-1 focus:ring-primary`,id:C,onChange:e=>ne(e.currentTarget.value),value:k?.path??``,children:a.map(e=>(0,_.jsx)(`option`,{value:e.path,children:e.path},e.path))})]}),(0,_.jsx)(BT,{children:(0,_.jsx)(VT,{className:`min-h-0 flex-1`,detail:n??k?.path,lineAnnotations:k?u?.[k.path]:void 0,meta:k?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{children:k.status}),(0,_.jsx)(s,{children:w(k)})]}):(0,_.jsx)(s,{children:ee(a.length)}),patch:x(A)?A:null,renderAnnotation:d,selectedLines:f,onSelectedLinesChange:p,title:b,tone:S})}),o?(0,_.jsx)(`p`,{className:`border-x border-b border-line bg-field px-2 py-1 font-mono text-[10px] text-muted`,children:`Loading patch...`}):null,l?(0,_.jsx)(`p`,{className:`border-x border-b border-line bg-field px-2 py-1 font-mono text-[10px] text-accent`,children:l}):null,j&&!o&&!l?(0,_.jsx)(`p`,{className:`border-x border-b border-line bg-field px-2 py-1 font-mono text-[10px] text-muted`,children:j}):null,m]}),v?(0,_.jsx)(`aside`,{"aria-label":y,className:`diff-inspector-pane`,children:v}):null]})}export{x as a,T as i,BT as n,C as o,VT as r,GT as t};